void OnQueryTextFinished(char* str) override { /* The user pressed cancel */ if (str == nullptr) return; int32 value; if (StrEmpty(str)) { if (widget == WID_AIC_NUMBER) return; switch (GetGameSettings().script.settings_profile) { case SP_EASY: value = AI::START_DELAY_EASY; break; case SP_MEDIUM: value = AI::START_DELAY_MEDIUM; break; case SP_HARD: value = AI::START_DELAY_HARD; break; case SP_CUSTOM: value = AI::START_DELAY_CUSTOM; break; default: NOT_REACHED(); } } else { value = atoi(str); } IConsoleSetSetting(widget == WID_AIC_NUMBER ? "difficulty.max_no_competitors" : "ai.ai_start_delay", value); this->SetDirty(); }