Created
August 22, 2023 15:38
-
-
Save andythenorth/bd8f4481745589b152b75745a83b0980 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function IndustryProductionIncreaseHistory(vulcan_town, extra_params) { | |
local industry = extra_params[0]; | |
if (industry in ::persistent_storage.industry_production_increase_timeseries) { | |
// we clone the timeseries so we can non-destructively reverse it for iterating over | |
local industry_timeseries_clone = clone(::persistent_storage.industry_production_increase_timeseries[industry]); | |
industry_timeseries_clone.reverse(); | |
local counter = 0; | |
local next_string = null; | |
foreach (increase_date in industry_timeseries_clone) { | |
if (counter == 0) { | |
next_string = GSText(GSText.STR_TOWN_STORY_INDUSTRY_REPORT_HISTORY_DATE_NO_RECURSE, increase_date); | |
} | |
else { | |
next_string = GSText(GSText.STR_TOWN_STORY_INDUSTRY_REPORT_HISTORY_DATE_RECURSE, increase_date, next_string); | |
} | |
counter++; | |
} | |
return next_string; | |
} | |
else { | |
return GSText(GSText.STR_CABBAGE); | |
} | |
} | |
--- | |
STR_TOWN_STORY_INDUSTRY_REPORT_HISTORY_DATE_RECURSE :{DATE_LONG} {STRING} | |
STR_TOWN_STORY_INDUSTRY_REPORT_HISTORY_DATE_NO_RECURSE :{DATE_LONG} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment