Skip to content

Commit

Permalink
Anzeige des Food Buffer wenn Animal Grazing Mod verwendet wird.
Browse files Browse the repository at this point in the history
  • Loading branch information
Achimobil committed Dec 20, 2023
1 parent bd893fe commit f8c6335
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 2 deletions.
21 changes: 20 additions & 1 deletion InfoDisplayExtension.lua
Original file line number Diff line number Diff line change
Expand Up @@ -650,12 +650,31 @@ end;

function InfoDisplayExtension:updateInfoPlaceableHusbandryFood(_, superFunc, infoTable)
superFunc(self, infoTable)

if self.animalGrazing ~= nil and self.animalGrazing.outputFillTypes ~= nil then
local grazingFoodBuffer = 0;
local hasGrazing = false;
for fillTypeName, outputFillType in pairs(self.animalGrazing.outputFillTypes) do
grazingFoodBuffer = grazingFoodBuffer + outputFillType.foodBuffer;
hasGrazing = true;
end

if hasGrazing and grazingFoodBuffer ~= 0 then
table.insert(infoTable,
{
title = g_i18n:getText("infoDisplayExtension_grazingFoodBuffer"),
text = InfoDisplayExtension:formatVolume(grazingFoodBuffer, 0)
}
)
end
end


local spec = self.spec_husbandryFood
local fillLevel = self:getTotalFood()
local capacity = self:getFoodCapacity()
spec.info.text = InfoDisplayExtension:formatCapacity(fillLevel, capacity, 0);

table.insert(infoTable, spec.info)
end
PlaceableHusbandryFood.updateInfo = Utils.overwrittenFunction(PlaceableHusbandryFood.updateInfo, InfoDisplayExtension.updateInfoPlaceableHusbandryFood)
Expand Down
3 changes: 2 additions & 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="79">
<author>Achimobil</author>
<version>1.7.0.2</version>
<version>1.7.0.3</version>
<title>
<de>Info Display Erweiterung</de>
<en>Info Display Extension</en>
Expand Down Expand Up @@ -30,6 +30,7 @@ Das Verändern oder erneutes hochladen, ob ganz oder in Teilen, ist nicht gestat
Fehler und Anregungen gerne auf <a href="https://github.com/Achimobil/FS22_InfoDisplayExtension">GitHub</a>
Changelog
1.7.0.3 - Anzeige des Food Buffer wenn Animal Grazing Mod verwendet wird.
1.7.0.2 - Bei Produktionen werden die Filltypes jetzt gesplittet angezeigt nach nur Eingang oder Ausgang oder beides
1.7.0.1 - Übersetzungen PL verbessert. Jetzt auch übersetzt in BR und FR, danke an die Übersetzer
Expand Down
1 change: 1 addition & 0 deletions translations/translation_br.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@
<text name="infoDisplayExtension_animals_ridingRange" text="Cavalgado"/>
<text name="infoDisplayExtension_animals_fitness" text="Fitness"/>
<text name="infoDisplayExtension_animals_fitnessRange" text="Fitness"/>
<text name="infoDisplayExtension_grazingFoodBuffer" text="Grazing Buffer"/>
</texts>
</l10n>
1 change: 1 addition & 0 deletions translations/translation_de.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@
<text name="infoDisplayExtension_animals_ridingRange" text="Reiten"/>
<text name="infoDisplayExtension_animals_fitness" text="Fitness"/>
<text name="infoDisplayExtension_animals_fitnessRange" text="Fitness"/>
<text name="infoDisplayExtension_grazingFoodBuffer" text="Grazing Buffer"/>
</texts>
</l10n>
1 change: 1 addition & 0 deletions translations/translation_en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@
<text name="infoDisplayExtension_animals_ridingRange" text="Riding"/>
<text name="infoDisplayExtension_animals_fitness" text="Fitness"/>
<text name="infoDisplayExtension_animals_fitnessRange" text="Fitness"/>
<text name="infoDisplayExtension_grazingFoodBuffer" text="Grazing Buffer"/>
</texts>
</l10n>
1 change: 1 addition & 0 deletions translations/translation_fr.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@
<text name="infoDisplayExtension_animals_ridingRange" text="Moyenne d'équitation"/>
<text name="infoDisplayExtension_animals_fitness" text="Forme"/>
<text name="infoDisplayExtension_animals_fitnessRange" text="Moyenne de forme"/>
<text name="infoDisplayExtension_grazingFoodBuffer" text="Grazing Buffer"/>
</texts>
</l10n>
1 change: 1 addition & 0 deletions translations/translation_pl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@
<text name="infoDisplayExtension_animals_ridingRange" text="Jazda"/>
<text name="infoDisplayExtension_animals_fitness" text="Kondycja"/>
<text name="infoDisplayExtension_animals_fitnessRange" text="Kondycja"/>
<text name="infoDisplayExtension_grazingFoodBuffer" text="Grazing Buffer"/>
</texts>
</l10n>
1 change: 1 addition & 0 deletions translations/translation_ru.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@
<text name="infoDisplayExtension_animals_ridingRange" text="Ежедневная прогулка"/>
<text name="infoDisplayExtension_animals_fitness" text="Физ. форма"/>
<text name="infoDisplayExtension_animals_fitnessRange" text="Физ. форма"/>
<text name="infoDisplayExtension_grazingFoodBuffer" text="Grazing Buffer"/>
</texts>
</l10n>
1 change: 1 addition & 0 deletions translations/translation_sv.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@
<text name="infoDisplayExtension_animals_ridingRange" text="Riding"/>
<text name="infoDisplayExtension_animals_fitness" text="Fitness"/>
<text name="infoDisplayExtension_animals_fitnessRange" text="Fitness"/>
<text name="infoDisplayExtension_grazingFoodBuffer" text="Grazing Buffer"/>
</texts>
</l10n>

0 comments on commit f8c6335

Please sign in to comment.