Old revision #pwldz1rs3 | New revision #pmsvkvyjl | ||
---|---|---|---|
1 | bool is_gs_slot = this->selected_slot == OWNER_DEITY; | 1 | bool is_gs_slot = this->selected_slot == OWNER_DEITY; |
2 | bool invalid_slot = this->selected_slot == INVALID_COMPANY; | 2 | bool invalid_slot = this->selected_slot == INVALID_COMPANY; |
3 | |||
4 | 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(); | 3 | 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(); |
5 | |||
6 | bool is_silver_slot_above = !IsEditable((CompanyID)(this->selected_slot - 1)); | 4 | bool is_silver_slot_above = !IsEditable((CompanyID)(this->selected_slot - 1)); |
7 | bool is_silver_slot_below = !IsEditable((CompanyID)(this->selected_slot + 1)); | 5 | bool is_silver_slot_below = !IsEditable((CompanyID)(this->selected_slot + 1)); |
8 | |||
9 | |||
10 | 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(); | 6 | 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(); |
11 | 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(); | 7 | 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(); |
12 | bool is_red_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(); | 8 | |
13 | bool is_red_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(); | 9 | this->SetWidgetDisabledState(WID_AIC_MOVE_UP, is_gs_slot || invalid_slot || is_green_slot || is_silver_slot_above || is_green_slot_above); |
10 | this->SetWidgetDisabledState(WID_AIC_MOVE_DOWN, is_gs_slot || invalid_slot || is_green_slot || is_silver_slot_below || is_green_slot_below); | ||
14 | 11 | ||
15 | 12 | ||
16 | Check first slot: Check second slot: | 13 | Check first slot: Check second slot: |