Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
if params.capacity then
result.personCapacity = {
type = ({"RESIDENTIAL", "COMMERCIAL", "INDUSTRIAL"})[(params.resComInd or 0) + 1],
capacity = params.capacity * 5
}
else
result.personCapacity = nil
end
You can do better than that with an array of capacities, like {0, 5, 10, 20, 50, 100}. More freedom and no more ugly factor 5.
You can also use BUTTON instead of SLIDER, it's nicer to use.
{
key = "resComInd",
name = _("Type"),
uiType = "BUTTON",
values = { _("Residential"), _("Commercial"), _("Industrial") }
},
{
key = "capacity",
name = _("Capacity"),
uiType = "SLIDER",
values = { _("0"), _("5"), _("10"), _("15"), _("20"), _("25"), _("30"), _("35"), _("40"), _("45"), _("50"), }
}
2) At the end of updateFn, add:
if params.capacity and params.capacity > 0 then
result.personCapacity = {
type = ({"RESIDENTIAL", "COMMERCIAL", "INDUSTRIAL"})[(params.resComInd or 0) + 1],
capacity = params.capacity * 5
}
else
result.personCapacity = {}
end