Display "Configure" or "Settings" button: _game_mode != GM_NORMAL // not in a game, and thus, display the "Configure" button _game_mode == GM_NORMAL // in a game, check if something is selected or not this->selected_slot == INVALID_COMPANY // nothing is selected, and thus, display the "Configure" button this->selected_slot != INVALID_COMPANY // something is selected, check IsEditable /* all slots are editable in a normal game, except invalid, human companies or when no gs script is running */ IsEditable(this->selected_slot) = false // invalid, or human company or (none) gs script in this slot, and thus, display the "Configure" button IsEditable(this->selected_slot) = true // slot is either orange, red or green, check if it's AI or GS slot this->selected_slot != OWNER_DEITY // it's an AI slot, check IsValidAiID this->selected_slot == OWNER_DEITY // it's a GS slot, and thus, display the "Settings" button /* Check for orange and red AI slots */ IsValidAiID = false // AI slot is orange, and thus, "Configure" IsValidAiID = true // AI slot is either red or green, check IsDead Company::Get(selected_slot)->ai_instance->IsDead() = true // AI slot is red, and thus, display the "Configure" button Company::Get(selected_slot)->ai_instance->IsDead() = false // AI slot is green, and thus, display the "Settings" button