Skip to content

Commit

Permalink
Aktuelle und maximale Wachstums anzeigen, solange das Feld noch im Wa…
Browse files Browse the repository at this point in the history
…chstum ist #12
  • Loading branch information
Achimobil committed Dec 8, 2024
1 parent f1426e6 commit 7ee1bbf
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
21 changes: 20 additions & 1 deletion InfoDisplayExtension.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Das verändern und wiederöffentlichen, auch in Teilen, ist untersagt und wird a
]]

InfoDisplayExtension = {}
InfoDisplayExtension.Debug = false;
InfoDisplayExtension.Debug = true;

InfoDisplayExtension.metadata = {
title = "InfoDisplayExtension",
Expand Down Expand Up @@ -1134,4 +1134,23 @@ function InfoDisplayExtension:loadMap(name)
end
end

function InfoDisplayExtension.PlayerHUDUpdaterFieldAddField(self, fieldInfo, box)

local fruitTypeIndex = fieldInfo.fruitTypeIndex;
local growthState = fieldInfo.growthState;

if fruitTypeIndex ~= FruitType.UNKNOWN then
local fruitTypeDesc = g_fruitTypeManager:getFruitTypeByIndex(fruitTypeIndex);
local numGrowthStates = fruitTypeDesc.numGrowthStates;

if fruitTypeDesc:getIsGrowing(growthState) then
box:addLine(g_i18n:getText("ui_map_growth"), string.format("%s / %s", growthState, fruitTypeDesc.numGrowthStates))
end
end
end

PlayerHUDUpdater.fieldAddField = Utils.appendedFunction(PlayerHUDUpdater.fieldAddField, InfoDisplayExtension.PlayerHUDUpdaterFieldAddField)



addModEventListener(InfoDisplayExtension)
2 changes: 1 addition & 1 deletion modDesc.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<modDesc descVersion="93">
<author>Achimobil</author>
<version>1.0.1.1</version>
<version>1.0.1.2</version>
<title>
<de>Info Display Erweiterung</de>
<en>Info Display Extension</en>
Expand Down

0 comments on commit 7ee1bbf

Please sign in to comment.