MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / UpdateGSButtonState

Method UpdateGSButtonState

src/script/script_gui.cpp:958–969  ·  view source on GitHub ↗

* Update state of game script button. */

Source from the content-addressed store, hash-verified

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.

Callers 1

OnInvalidateDataMethod · 0.95

Calls 5

SetScriptButtonColourFunction · 0.85
SetDisabledMethod · 0.80
SetLoweredMethod · 0.80
IsDeadMethod · 0.45
IsPausedMethod · 0.45

Tested by

no test coverage detected