Changeset - r27721:7ae6afecc948
[Not reviewed]
master
0 3 0
merni-ns - 10 months ago 2023-07-14 11:57:45
66267867+merni-ns@users.noreply.github.com
Fix #11115: Focus the abandon game/exit game windows (#11125)
3 files changed with 10 insertions and 6 deletions:
0 comments (0 inline, 0 general)
src/intro_gui.cpp
Show inline comments
 
@@ -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
 
	);
 
}
src/misc_gui.cpp
Show inline comments
 
@@ -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, StringI
 
		break;
 
	}
 

	
 
	new QueryWindow(&_query_desc, caption, message, parent, callback);
 
	QueryWindow *q = new QueryWindow(&_query_desc, caption, message, parent, callback);
 
	if (focus) SetFocusedWindow(q);
 
}
src/textbuf_gui.h
Show inline comments
 
@@ -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;
0 comments (0 inline, 0 general)