Old revision #pdn5yogmn | New revision #pyni4xdxb | ||
---|---|---|---|
1 | /// Somewhere in english.txt | ||
2 | STR_AI_SETTINGS_CAPTION :{WHITE}{STRING} Parameters of {RAW_STRING} | ||
3 | |||
4 | /// Somewhere in AI Settings Window widget construction | ||
5 | NWidget(WWT_CAPTION, COLOUR_MAUVE, WID_AIS_CAPTION), SetDataTip(STR_AI_SETTINGS_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS), | ||
6 | |||
7 | /// Somewhere in AI Settings Window | ||
1 | virtual void SetStringParameters(int widget) const | 8 | virtual void SetStringParameters(int widget) const |
2 | { | 9 | { |
3 | switch (widget) { | 10 | switch (widget) { |
4 | case WID_AIS_CAPTION: | 11 | case WID_AIS_CAPTION: |
5 | SetDParam(0, (this->slot == OWNER_DEITY) ? STR_AI_SETTINGS_CAPTION_GAMESCRIPT : STR_AI_SETTINGS_CAPTION_AI); | 12 | SetDParam(0, (this->slot == OWNER_DEITY) ? STR_AI_SETTINGS_CAPTION_GAMESCRIPT : STR_AI_SETTINGS_CAPTION_AI); |
6 | 13 | ||
7 | |||
8 | if (GetConfig(this->slot)->GetInfo() != NULL) { | 14 | if (GetConfig(this->slot)->GetInfo() != NULL) { |
9 | SetDParamStr(1, GetConfig(this->slot)->GetInfo()->GetName()); | 15 | SetDParamStr(1, GetConfig(this->slot)->GetInfo()->GetName()); |
10 | |||
11 | } else { | 16 | } else { |
12 | text = (slot == OWNER_DEITY) ? STR_AI_CONFIG_NONE : STR_AI_CONFIG_RANDOM_AI; | 12 | char name[1024]; |
13 | // char name[1024]; | 13 | GetString(name, (slot == OWNER_DEITY) ? STR_AI_CONFIG_NONE : STR_AI_CONFIG_RANDOM_AI, lastof(name)); |
14 | // GetString(name, (slot == OWNER_DEITY) ? STR_AI_CONFIG_NONE : STR_AI_CONFIG_RANDOM_AI, lastof(name)); | 14 | const char *script_name = stredup(name); |
15 | // const char *script_name = stredup(name); | 15 | SetDParamStr(1, script_name); |
16 | // SetDParam(1, (slot == OWNER_DEITY) ? STR_AI_CONFIG_NONE : STR_AI_CONFIG_RANDOM_AI); | ||
17 | } | 21 | } |
18 | } | 22 | } |
19 | } | 23 | } |