Add setting description help text for extra asymmetric linkgraph modes

See also: #321
This commit is contained in:
Jonathan G Rennison
2021-09-29 19:34:36 +01:00
parent 47156122fa
commit db11c1d927
3 changed files with 21 additions and 1 deletions

View File

@@ -2061,6 +2061,7 @@ STR_CONFIG_SETTING_DISTRIBUTION_PER_CARGO :Distribution mo
STR_CONFIG_SETTING_DISTRIBUTION_PER_CARGO_PARAM :Distribution mode override for {STRING}: {STRING2} STR_CONFIG_SETTING_DISTRIBUTION_PER_CARGO_PARAM :Distribution mode override for {STRING}: {STRING2}
STR_CONFIG_SETTING_DISTRIBUTION_PER_CARGO_HELPTEXT :"(default)" means that the distribution mode is the default for the class of this cargo. "symmetric" means that roughly the same number of cargo will go from a station A to a station B as from B to A. "asymmetric" means that arbitrary amounts of cargo can be sent in either direction. "manual" means that no automatic distribution will take place for this cargo. STR_CONFIG_SETTING_DISTRIBUTION_PER_CARGO_HELPTEXT :"(default)" means that the distribution mode is the default for the class of this cargo. "symmetric" means that roughly the same number of cargo will go from a station A to a station B as from B to A. "asymmetric" means that arbitrary amounts of cargo can be sent in either direction. "manual" means that no automatic distribution will take place for this cargo.
STR_CONFIG_SETTING_DISTRIBUTION_PER_CARGO_DEFAULT :(default) STR_CONFIG_SETTING_DISTRIBUTION_PER_CARGO_DEFAULT :(default)
STR_CONFIG_SETTING_DISTRIBUTION_HELPTEXT_EXTRA :{STRING}{}"asymmetric (equal distribution)" means that cargo will be distributed such that each accepting station receives approximately the same amount of cargo in total. "asymmetric (nearest)" means that cargo is sent to whichever accepting station is nearest.
STR_CONFIG_SETTING_LINKGRAPH_ACCURACY :Distribution accuracy: {STRING2} STR_CONFIG_SETTING_LINKGRAPH_ACCURACY :Distribution accuracy: {STRING2}
STR_CONFIG_SETTING_LINKGRAPH_ACCURACY_HELPTEXT :The higher you set this the more CPU time the calculation of the link graph will take. If it takes too long you may notice lag. If you set it to a low value, however, the distribution will be inaccurate, and you may notice cargo not being sent to the places you expect it to go. STR_CONFIG_SETTING_LINKGRAPH_ACCURACY_HELPTEXT :The higher you set this the more CPU time the calculation of the link graph will take. If it takes too long you may notice lag. If you set it to a low value, however, the distribution will be inaccurate, and you may notice cargo not being sent to the places you expect it to go.
STR_CONFIG_SETTING_DEMAND_DISTANCE :Effect of distance on demands: {STRING2} STR_CONFIG_SETTING_DEMAND_DISTANCE :Effect of distance on demands: {STRING2}

View File

@@ -1881,6 +1881,19 @@ static int64 LinkGraphDistModeXrefChillPP(int64 val)
/* Begin - GUI callbacks */ /* Begin - GUI callbacks */
static bool LinkGraphDistributionSettingGUI(SettingOnGuiCtrlData &data)
{
switch (data.type) {
case SOGCT_DESCRIPTION_TEXT:
SetDParam(0, data.text);
data.text = STR_CONFIG_SETTING_DISTRIBUTION_HELPTEXT_EXTRA;
return true;
default:
return false;
}
}
/* End - GUI callbacks */ /* End - GUI callbacks */
/** /**

View File

@@ -77,6 +77,8 @@ static bool CheckSharingRoad(int32 p1);
static bool CheckSharingWater(int32 p1); static bool CheckSharingWater(int32 p1);
static bool CheckSharingAir(int32 p1); static bool CheckSharingAir(int32 p1);
static bool LinkGraphDistributionSettingGUI(SettingOnGuiCtrlData &data);
/* End - Callback Functions for the various settings */ /* End - Callback Functions for the various settings */
/* Begin - GUI order callbacks */ /* Begin - GUI order callbacks */
@@ -160,7 +162,7 @@ SDT_NULL = SDT_NULL($length, $from, $to, $extver),
SDT_XREF = SDT_XREF( $from, $to, $extver, $xref, $xrefcvt), SDT_XREF = SDT_XREF( $from, $to, $extver, $xref, $xrefcvt),
SDT_END = SDT_END() SDT_END = SDT_END()
SDT_LINKGRAPH_PER_CARGO = SDT_ENUM(GameSettings, linkgraph.distribution_per_cargo[$linkgraph_cargo], SLE_UINT8, $flags | SLF_NOT_IN_CONFIG, $guiflags | SGF_NO_NEWGAME, DT_PER_CARGO_DEFAULT, STR_CONFIG_SETTING_DISTRIBUTION_PER_CARGO, STR_CONFIG_SETTING_DISTRIBUTION_PER_CARGO_HELPTEXT, $proc, $guiproc, $from, $to, SC_EXPERT, false, SlXvFeatureTest(XSLFTO_AND, XSLFI_LINKGRAPH_MODES), nullptr, _linkgraph_mode_per_cargo), SDT_LINKGRAPH_PER_CARGO = SDT_ENUM(GameSettings, linkgraph.distribution_per_cargo[$linkgraph_cargo], SLE_UINT8, $flags | SLF_NOT_IN_CONFIG, $guiflags | SGF_NO_NEWGAME, DT_PER_CARGO_DEFAULT, STR_CONFIG_SETTING_DISTRIBUTION_PER_CARGO, STR_CONFIG_SETTING_DISTRIBUTION_PER_CARGO_HELPTEXT, $proc, LinkGraphDistributionSettingGUI, $from, $to, SC_EXPERT, false, SlXvFeatureTest(XSLFTO_AND, XSLFI_LINKGRAPH_MODES), nullptr, _linkgraph_mode_per_cargo),
[validation] [validation]
SDTG_VAR = static_assert($max <= MAX_$type, "Maximum value for $var exceeds storage size"); SDTG_VAR = static_assert($max <= MAX_$type, "Maximum value for $var exceeds storage size");
@@ -1007,6 +1009,7 @@ def = DT_MANUAL
enumlist = _linkgraph_mode_symmetric enumlist = _linkgraph_mode_symmetric
str = STR_CONFIG_SETTING_DISTRIBUTION_PAX str = STR_CONFIG_SETTING_DISTRIBUTION_PAX
strhelp = STR_CONFIG_SETTING_DISTRIBUTION_PAX_HELPTEXT strhelp = STR_CONFIG_SETTING_DISTRIBUTION_PAX_HELPTEXT
guiproc = LinkGraphDistributionSettingGUI
[SDT_ENUM] [SDT_ENUM]
base = GameSettings base = GameSettings
@@ -1017,6 +1020,7 @@ def = DT_MANUAL
enumlist = _linkgraph_mode_symmetric enumlist = _linkgraph_mode_symmetric
str = STR_CONFIG_SETTING_DISTRIBUTION_MAIL str = STR_CONFIG_SETTING_DISTRIBUTION_MAIL
strhelp = STR_CONFIG_SETTING_DISTRIBUTION_MAIL_HELPTEXT strhelp = STR_CONFIG_SETTING_DISTRIBUTION_MAIL_HELPTEXT
guiproc = LinkGraphDistributionSettingGUI
[SDT_ENUM] [SDT_ENUM]
base = GameSettings base = GameSettings
@@ -1027,6 +1031,7 @@ def = DT_MANUAL
enumlist = _linkgraph_mode_symmetric enumlist = _linkgraph_mode_symmetric
str = STR_CONFIG_SETTING_DISTRIBUTION_ARMOURED str = STR_CONFIG_SETTING_DISTRIBUTION_ARMOURED
strhelp = STR_CONFIG_SETTING_DISTRIBUTION_ARMOURED_HELPTEXT strhelp = STR_CONFIG_SETTING_DISTRIBUTION_ARMOURED_HELPTEXT
guiproc = LinkGraphDistributionSettingGUI
[SDT_ENUM] [SDT_ENUM]
base = GameSettings base = GameSettings
@@ -1037,6 +1042,7 @@ def = DT_MANUAL
enumlist = _linkgraph_mode_asymmetric enumlist = _linkgraph_mode_asymmetric
str = STR_CONFIG_SETTING_DISTRIBUTION_DEFAULT str = STR_CONFIG_SETTING_DISTRIBUTION_DEFAULT
strhelp = STR_CONFIG_SETTING_DISTRIBUTION_DEFAULT_HELPTEXT strhelp = STR_CONFIG_SETTING_DISTRIBUTION_DEFAULT_HELPTEXT
guiproc = LinkGraphDistributionSettingGUI
[SDT_LINKGRAPH_PER_CARGO] [SDT_LINKGRAPH_PER_CARGO]
linkgraph_cargo = 0 linkgraph_cargo = 0