|
|
@ -772,7 +772,7 @@ struct AIConfigWindow : public Window {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
static bool IsEditable(CompanyID slot)
|
|
|
|
static bool IsEditable(CompanyID slot)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (slot == OWNER_DEITY) return _game_mode != GM_NORMAL;
|
|
|
|
if (slot == OWNER_DEITY) return _game_mode != GM_NORMAL || Game::GetInstance() != NULL;
|
|
|
|
|
|
|
|
|
|
|
|
if (_game_mode != GM_NORMAL) {
|
|
|
|
if (_game_mode != GM_NORMAL) {
|
|
|
|
return slot > 0 && slot <= GetGameSettings().difficulty.max_no_competitors;
|
|
|
|
return slot > 0 && slot <= GetGameSettings().difficulty.max_no_competitors;
|
|
|
@ -920,7 +920,7 @@ struct AIConfigWindow : public Window {
|
|
|
|
|
|
|
|
|
|
|
|
this->SetWidgetDisabledState(WID_AIC_DECREASE, GetGameSettings().difficulty.max_no_competitors == 0);
|
|
|
|
this->SetWidgetDisabledState(WID_AIC_DECREASE, GetGameSettings().difficulty.max_no_competitors == 0);
|
|
|
|
this->SetWidgetDisabledState(WID_AIC_INCREASE, GetGameSettings().difficulty.max_no_competitors == MAX_COMPANIES - 1);
|
|
|
|
this->SetWidgetDisabledState(WID_AIC_INCREASE, GetGameSettings().difficulty.max_no_competitors == MAX_COMPANIES - 1);
|
|
|
|
this->SetWidgetDisabledState(WID_AIC_CHANGE, this->selected_slot == INVALID_COMPANY);
|
|
|
|
this->SetWidgetDisabledState(WID_AIC_CHANGE, (this->selected_slot == OWNER_DEITY && _game_mode == GM_NORMAL) || this->selected_slot == INVALID_COMPANY);
|
|
|
|
this->SetWidgetDisabledState(WID_AIC_CONFIGURE, this->selected_slot == INVALID_COMPANY || GetConfig(this->selected_slot)->GetConfigList()->size() == 0);
|
|
|
|
this->SetWidgetDisabledState(WID_AIC_CONFIGURE, this->selected_slot == INVALID_COMPANY || GetConfig(this->selected_slot)->GetConfigList()->size() == 0);
|
|
|
|
this->SetWidgetDisabledState(WID_AIC_MOVE_UP, this->selected_slot == OWNER_DEITY || this->selected_slot == INVALID_COMPANY || !IsEditable((CompanyID)(this->selected_slot - 1)));
|
|
|
|
this->SetWidgetDisabledState(WID_AIC_MOVE_UP, this->selected_slot == OWNER_DEITY || this->selected_slot == INVALID_COMPANY || !IsEditable((CompanyID)(this->selected_slot - 1)));
|
|
|
|
this->SetWidgetDisabledState(WID_AIC_MOVE_DOWN, this->selected_slot == OWNER_DEITY || this->selected_slot == INVALID_COMPANY || !IsEditable((CompanyID)(this->selected_slot + 1)));
|
|
|
|
this->SetWidgetDisabledState(WID_AIC_MOVE_DOWN, this->selected_slot == OWNER_DEITY || this->selected_slot == INVALID_COMPANY || !IsEditable((CompanyID)(this->selected_slot + 1)));
|
|
|
|