mirror of https://github.com/OpenTTD/OpenTTD
(svn r14978) -Codechange: simplify the control flow of the OnClick of the settings window
parent
e1a351cb1a
commit
238c0a5d1f
|
@ -1269,8 +1269,8 @@ struct PatchesSelectionWindow : Window {
|
||||||
|
|
||||||
virtual void OnClick(Point pt, int widget)
|
virtual void OnClick(Point pt, int widget)
|
||||||
{
|
{
|
||||||
switch (widget) {
|
if (widget != PATCHSEL_OPTIONSPANEL) return;
|
||||||
case PATCHSEL_OPTIONSPANEL: {
|
|
||||||
int y = pt.y - SETTINGTREE_TOP_OFFSET; // Shift y coordinate
|
int y = pt.y - SETTINGTREE_TOP_OFFSET; // Shift y coordinate
|
||||||
if (y < 0) return; // Clicked above first entry
|
if (y < 0) return; // Clicked above first entry
|
||||||
|
|
||||||
|
@ -1347,6 +1347,7 @@ struct PatchesSelectionWindow : Window {
|
||||||
_left_button_clicked = false;
|
_left_button_clicked = false;
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
default: NOT_REACHED();
|
default: NOT_REACHED();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1365,8 +1366,6 @@ struct PatchesSelectionWindow : Window {
|
||||||
ShowQueryString(STR_CONFIG_PATCHES_INT32, STR_CONFIG_PATCHES_QUERY_CAPT, 10, 100, this, CS_NUMERAL, QSF_NONE);
|
ShowQueryString(STR_CONFIG_PATCHES_INT32, STR_CONFIG_PATCHES_QUERY_CAPT, 10, 100, this, CS_NUMERAL, QSF_NONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void OnTimeout()
|
virtual void OnTimeout()
|
||||||
|
|
Loading…
Reference in New Issue