mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-09 23:50:25 +00:00
parent
c3d1264a4b
commit
fc9afb2d32
@ -517,7 +517,8 @@ void AskExitGame()
|
||||
STR_QUIT_CAPTION,
|
||||
STR_QUIT_ARE_YOU_SURE_YOU_WANT_TO_EXIT_OPENTTD,
|
||||
nullptr,
|
||||
AskExitGameCallback
|
||||
AskExitGameCallback,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
@ -536,6 +537,7 @@ void AskExitToGameMenu()
|
||||
STR_ABANDON_GAME_CAPTION,
|
||||
(_game_mode != GM_EDITOR) ? STR_ABANDON_GAME_QUERY : STR_ABANDON_SCENARIO_QUERY,
|
||||
nullptr,
|
||||
AskExitToGameMenuCallback
|
||||
AskExitToGameMenuCallback,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
@ -1218,15 +1218,16 @@ static WindowDesc _query_desc(
|
||||
);
|
||||
|
||||
/**
|
||||
* Show a modal confirmation window with standard 'yes' and 'no' buttons
|
||||
* Show a confirmation window with standard 'yes' and 'no' buttons
|
||||
* The window is aligned to the centre of its parent.
|
||||
* @param caption string shown as window caption
|
||||
* @param message string that will be shown for the window
|
||||
* @param parent pointer to parent window, if this pointer is nullptr the parent becomes
|
||||
* the main window WC_MAIN_WINDOW
|
||||
* @param callback callback function pointer to set in the window descriptor
|
||||
* @param focus whether the window should be focussed (by default false)
|
||||
*/
|
||||
void ShowQuery(StringID caption, StringID message, Window *parent, QueryCallbackProc *callback)
|
||||
void ShowQuery(StringID caption, StringID message, Window *parent, QueryCallbackProc *callback, bool focus)
|
||||
{
|
||||
if (parent == nullptr) parent = GetMainWindow();
|
||||
|
||||
@ -1240,5 +1241,6 @@ void ShowQuery(StringID caption, StringID message, Window *parent, QueryCallback
|
||||
break;
|
||||
}
|
||||
|
||||
new QueryWindow(&_query_desc, caption, message, parent, callback);
|
||||
QueryWindow *q = new QueryWindow(&_query_desc, caption, message, parent, callback);
|
||||
if (focus) SetFocusedWindow(q);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ DECLARE_ENUM_AS_BIT_SET(QueryStringFlags)
|
||||
typedef void QueryCallbackProc(Window*, bool);
|
||||
|
||||
void ShowQueryString(StringID str, StringID caption, uint max_len, Window *parent, CharSetFilter afilter, QueryStringFlags flags);
|
||||
void ShowQuery(StringID caption, StringID message, Window *w, QueryCallbackProc *callback);
|
||||
void ShowQuery(StringID caption, StringID message, Window *w, QueryCallbackProc *callback, bool focus = false);
|
||||
|
||||
/** The number of 'characters' on the on-screen keyboard. */
|
||||
static const uint OSK_KEYBOARD_ENTRIES = 50;
|
||||
|
Loading…
Reference in New Issue
Block a user