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

View File

@@ -189,19 +189,17 @@ static void ChangeTimetableStartCallback(const Window *w, TimerGameEconomy::Date
struct TimetableWindow : Window {
int sel_index;
VehicleTimetableWidgets query_widget; ///< Which button was clicked to open the query text input?
const Vehicle *vehicle; ///< Vehicle monitored by the window.
bool show_expected; ///< Whether we show expected arrival or scheduled.
Scrollbar *vscroll; ///< The scrollbar.
bool set_start_date_all; ///< Set start date using minutes text entry for all timetable entries (ctrl-click) action.
bool change_timetable_all; ///< Set wait time or speed for all timetable entries (ctrl-click) action.
int sel_index = -1;
VehicleTimetableWidgets query_widget{}; ///< Which button was clicked to open the query text input?
const Vehicle *vehicle = nullptr; ///< Vehicle monitored by the window.
bool show_expected = true; ///< Whether we show expected arrival or scheduled.
Scrollbar *vscroll = nullptr; ///< The scrollbar.
bool set_start_date_all = false; ///< Set start date using minutes text entry for all timetable entries (ctrl-click) action.
bool change_timetable_all = false; ///< Set wait time or speed for all timetable entries (ctrl-click) action.
TimetableWindow(WindowDesc &desc, WindowNumber window_number) :
Window(desc),
sel_index(-1),
vehicle(Vehicle::Get(window_number)),
show_expected(true)
vehicle(Vehicle::Get(window_number))
{
this->CreateNestedTree();
this->vscroll = this->GetScrollbar(WID_VT_SCROLLBAR);