From 9bb68a715108feb78c859bd552f260eba0565214 Mon Sep 17 00:00:00 2001 From: Richard Fine Date: Sat, 5 Jan 2019 13:14:57 +0000 Subject: [PATCH] Pull window width into temporary variable As suggested in review, it's a little easier to read this way. --- src/openrct2-ui/windows/Guest.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index df7bdef750..3ea426786e 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -563,8 +563,11 @@ rct_window* window_guest_open(Peep* peep) window = window_bring_to_front_by_number(WC_PEEP, peep->sprite_index); if (window == nullptr) { - window = window_create_auto_pos( - 192 + (gConfigGeneral.debugging_tools ? TabWidth : 0), 157, &window_guest_overview_events, WC_PEEP, WF_RESIZABLE); + int32_t windowWidth = 192; + if (gConfigGeneral.debugging_tools) + windowWidth += TabWidth; + + window = window_create_auto_pos(windowWidth, 157, &window_guest_overview_events, WC_PEEP, WF_RESIZABLE); window->widgets = window_guest_overview_widgets; window->enabled_widgets = window_guest_page_enabled_widgets[0]; window->number = peep->sprite_index; @@ -575,7 +578,7 @@ rct_window* window_guest_open(Peep* peep) window->picked_peep_frame = 0; window->highlighted_item = 0; window_guest_disable_widgets(window); - window->min_width = 192 + (gConfigGeneral.debugging_tools ? TabWidth : 0); + window->min_width = windowWidth; window->min_height = 157; window->max_width = 500; window->max_height = 450;