Codechange: explicitly initialise member variables of Windows

This commit is contained in:
Rubidium
2025-02-22 20:52:38 +01:00
committed by rubidium42
parent 8813a798e7
commit fd8c33d051
8 changed files with 74 additions and 84 deletions
+2 -8
View File
@@ -155,18 +155,13 @@ void PlaceProc_DemolishArea(TileIndex tile)
/** Terra form toolbar managing class. */
struct TerraformToolbarWindow : Window {
int last_user_action; ///< Last started user action.
int last_user_action = INVALID_WID_TT; ///< Last started user action.
TerraformToolbarWindow(WindowDesc &desc, WindowNumber window_number) : Window(desc)
{
/* This is needed as we like to have the tree available on OnInit. */
this->CreateNestedTree();
this->FinishInitNested(window_number);
this->last_user_action = INVALID_WID_TT;
}
~TerraformToolbarWindow()
{
}
void OnInit() override
@@ -534,7 +529,7 @@ static void ResetLandscapeConfirmationCallback(Window *, bool confirmed)
/** Landscape generation window handler in the scenario editor. */
struct ScenarioEditorLandscapeGenerationWindow : Window {
int last_user_action; ///< Last started user action.
int last_user_action = INVALID_WID_ETT; ///< Last started user action.
ScenarioEditorLandscapeGenerationWindow(WindowDesc &desc, WindowNumber window_number) : Window(desc)
{
@@ -542,7 +537,6 @@ struct ScenarioEditorLandscapeGenerationWindow : Window {
NWidgetStacked *show_desert = this->GetWidget<NWidgetStacked>(WID_ETT_SHOW_PLACE_DESERT);
show_desert->SetDisplayedPlane(_settings_game.game_creation.landscape == LandscapeType::Tropic ? 0 : SZSP_NONE);
this->FinishInitNested(window_number);
this->last_user_action = INVALID_WID_ETT;
}
void OnPaint() override