Loading

Paste #pvaqviyqt

  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(2, GetConfig(this->slot)->GetInfo()->GetName());
  17.                     text = STR_JUST_RAW_STRING;
  18.                 } else {
  19.                     text = (slot == OWNER_DEITY) ? STR_AI_CONFIG_NONE : STR_AI_CONFIG_RANDOM_AI;
  20. //                  char name[1024];
  21. //                  GetString(name, (slot == OWNER_DEITY) ? STR_AI_CONFIG_NONE : STR_AI_CONFIG_RANDOM_AI, lastof(name));
  22. //                  const char *script_name = stredup(name);
  23. //                  SetDParamStr(1, (slot == OWNER_DEITY) ? STR_AI_CONFIG_NONE : STR_AI_CONFIG_RANDOM_AI);
  24.                 }
  25.                 SetDParam(1, text);
  26.         }
  27.     }

Version history

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

Comments