11 | bool is_green_slot = IsEditable((CompanyID)(this->selected_slot)) && Company::IsValidID(this->selected_slot) && Company::IsValidAiID(this->selected_slot) && !Company::Get(this->selected_slot)->ai_instance->IsDead();
| 11 | bool is_green_slot = Company::IsValidAiID(this->selected_slot) && !Company::Get(this->selected_slot)->ai_instance->IsDead();
|
---|
12 | bool is_silver_slot_above = !IsEditable((CompanyID)(this->selected_slot - 1));
| 12 | this->SetWidgetDisabledState(WID_AIC_CHANGE, invalid_slot || (_game_mode == GM_NORMAL && (is_gs_slot || (IsEditable(this->selected_slot) && is_green_slot))));
|
---|
13 | bool is_silver_slot_below = !IsEditable((CompanyID)(this->selected_slot + 1));
| | |
---|
14 | bool is_green_slot_above = IsEditable((CompanyID)(this->selected_slot - 1)) && Company::IsValidID(this->selected_slot - 1) && Company::IsValidAiID(this->selected_slot - 1) && !Company::Get(this->selected_slot - 1)->ai_instance->IsDead();
| | |
---|
15 | bool is_green_slot_below = IsEditable((CompanyID)(this->selected_slot + 1)) && Company::IsValidID(this->selected_slot + 1) && Company::IsValidAiID(this->selected_slot + 1) && !Company::Get(this->selected_slot + 1)->ai_instance->IsDead();
| | |
---|
16 |
| | |
---|
17 | this->SetWidgetDisabledState(WID_AIC_DECREASE, GetGameSettings().difficulty.max_no_competitors == 0);
| | |
---|
18 | this->SetWidgetDisabledState(WID_AIC_INCREASE, GetGameSettings().difficulty.max_no_competitors == MAX_COMPANIES);
| | |
---|
19 | this->SetWidgetDisabledState(WID_AIC_CHANGE, _game_mode == GM_NORMAL && (is_gs_slot || is_green_slot) || invalid_slot);
| | |
---|
32 | this->SetWidgetDisabledState(WID_AIC_MOVE_UP, is_gs_slot || invalid_slot || is_green_slot || is_silver_slot_above || is_green_slot_above);
| 26 | bool is_silver_slot_above = !IsEditable((CompanyID)(this->selected_slot - 1));
|
---|
33 | this->SetWidgetDisabledState(WID_AIC_MOVE_DOWN, is_gs_slot || invalid_slot || is_green_slot || is_silver_slot_below || is_green_slot_below);
| 27 | bool is_green_slot_above = IsEditable((CompanyID)(this->selected_slot - 1)) && Company::IsValidAiID(this->selected_slot - 1) && !Company::Get(this->selected_slot - 1)->ai_instance->IsDead();
|
---|
| | 28 | this->SetWidgetDisabledState(WID_AIC_MOVE_UP, is_gs_slot || invalid_slot || (IsEditable(this->selected_slot) && is_green_slot) || is_silver_slot_above || is_green_slot_above);
|
---|
| | 29 |
|
---|
| | 30 | bool is_silver_slot_below = !IsEditable((CompanyID)(this->selected_slot + 1));
|
---|
| | 31 | bool is_green_slot_below = IsEditable((CompanyID)(this->selected_slot + 1)) && Company::IsValidAiID(this->selected_slot + 1) && !Company::Get(this->selected_slot + 1)->ai_instance->IsDead();
|
---|
| | 32 | this->SetWidgetDisabledState(WID_AIC_MOVE_DOWN, is_gs_slot || invalid_slot || (IsEditable(this->selected_slot) && is_green_slot) || is_silver_slot_below || is_green_slot_below);
|
---|