* Update state of game script button. */
| 956 | * Update state of game script button. |
| 957 | */ |
| 958 | void UpdateGSButtonState() |
| 959 | { |
| 960 | GameInstance *game = Game::GetInstance(); |
| 961 | bool valid = game != nullptr; |
| 962 | bool dead = valid && game->IsDead(); |
| 963 | bool paused = valid && game->IsPaused(); |
| 964 | |
| 965 | NWidgetCore *button = this->GetWidget<NWidgetCore>(WID_SCRD_SCRIPT_GAME); |
| 966 | button->SetDisabled(!valid); |
| 967 | button->SetLowered(this->filter.script_debug_company == OWNER_DEITY); |
| 968 | SetScriptButtonColour(*button, dead, paused); |
| 969 | } |
| 970 | |
| 971 | /** |
| 972 | * Change all settings to select another Script. |
no test coverage detected