Loading

Paste #pjkzbg4qk

  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
  8.     virtual void SetStringParameters(int widget) const
  9.     {
  10.         switch (widget) {
  11.             case WID_AIS_CAPTION:
  12.                 SetDParam(0, (this->slot == OWNER_DEITY) ? STR_AI_SETTINGS_CAPTION_GAMESCRIPT : STR_AI_SETTINGS_CAPTION_AI);
  13.  
  14.                 StringID text;
  15.                 if (GetConfig(this->slot)->GetInfo() != NULL) {
  16.                     SetDParamStr(1, GetConfig(this->slot)->GetInfo()->GetName());
  17.                     text = STR_JUST_RAW_STRING;
  18.                 } else {
  19.                     char name[1024];
  20.                     GetString(name, (slot == OWNER_DEITY) ? STR_AI_CONFIG_NONE : STR_AI_CONFIG_RANDOM_AI, lastof(name));
  21.                     const char *script_name = stredup(name);
  22.                     SetDParamStr(1, script_name);
  23.                 }
  24.         }
  25.     }

Version history

Revision # Author Created at
pvaqviyqt Anonymous 29 Jan 2019, 18:06:23 UTC Diff
pdn5yogmn Anonymous 29 Jan 2019, 17:49:37 UTC Diff

Comments