Loading

Paste #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
  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.                 if (GetConfig(this->slot)->GetInfo() != NULL) {
  15.                     SetDParamStr(1, GetConfig(this->slot)->GetInfo()->GetName());
  16.                 } else {
  17.                     char name[1024];
  18.                     GetString(name, (slot == OWNER_DEITY) ? STR_AI_CONFIG_NONE : STR_AI_CONFIG_RANDOM_AI, lastof(name));
  19.                     const char *script_name = stredup(name);
  20.                     SetDParamStr(1, script_name);
  21.                 }
  22.         }
  23.     }

Version history

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

Comments