diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/dm/inventory.cpp | 16 | ||||
-rw-r--r-- | engines/dm/inventory.h | 1 |
2 files changed, 17 insertions, 0 deletions
diff --git a/engines/dm/inventory.cpp b/engines/dm/inventory.cpp index ea643dac4d..98713d01ce 100644 --- a/engines/dm/inventory.cpp +++ b/engines/dm/inventory.cpp @@ -107,4 +107,20 @@ void InventoryMan::drawPanelHorizontalBar(int16 x, int16 y, int16 pixelWidth, Co _vm->_displayMan->clearScreenBox(color, box); } +void InventoryMan::drawPanelFoodOrWaterBar(int16 amount, int16 y, Color color) { + if (amount < -512) { + color = kColorRed; + } else if(amount < 0) { + color = kColorYellow; + } + + int16 pixelWidth = amount + 1024; + if (pixelWidth == 3072) { + pixelWidth = 3071; + } + pixelWidth /= 32; + drawPanelHorizontalBar(115, y + 2, pixelWidth, kColorBlack); + drawPanelHorizontalBar(113, y, pixelWidth, color); +} + } diff --git a/engines/dm/inventory.h b/engines/dm/inventory.h index 192b68964a..bd6f18d788 100644 --- a/engines/dm/inventory.h +++ b/engines/dm/inventory.h @@ -16,6 +16,7 @@ public: void toggleInventory(ChampionIndex championIndex); // @ F0355_INVENTORY_Toggle_CPSE void drawStatusBoxPortrait(ChampionIndex championIndex); // @ F0354_INVENTORY_DrawStatusBoxPortrait void drawPanelHorizontalBar(int16 x, int16 y, int16 pixelWidth, Color color); // @ F0343_INVENTORY_DrawPanel_HorizontalBar + void drawPanelFoodOrWaterBar(int16 amount, int16 y, Color color); // @ F0344_INVENTORY_DrawPanel_FoodOrWaterBar }; }
\ No newline at end of file |