Fix a help dialog that appears in the top-left
This commit is contained in:
@@ -533,6 +533,13 @@ void cDialog::run(std::function<void(cDialog&)> onopen){
|
||||
makeFrontWindow(*parentWin);
|
||||
}
|
||||
|
||||
void cDialog::runWithHelp(short help1, short help2) {
|
||||
extern void give_help(short help1, short help2, cDialog& parent);
|
||||
run([help1, help2](cDialog& me) -> void {
|
||||
give_help(help1, help2, me);
|
||||
});
|
||||
}
|
||||
|
||||
// This method is a main event event loop of the dialog.
|
||||
void cDialog::handle_events() {
|
||||
sf::Event currentEvent;
|
||||
|
@@ -115,6 +115,8 @@ public:
|
||||
/// Show the dialog and start its event loop. All dialogs are modal.
|
||||
/// @param onopen A function to be called after the dialog is displayed but before the event loop starts.
|
||||
void run(std::function<void(cDialog&)> onopen = nullptr); // cd_run_dialog
|
||||
/// Show this dialog. Before starting its event loop, show a help window if it hasn't been shown before.
|
||||
void runWithHelp(short help1, short help2);
|
||||
/// Get the result of the dialog.
|
||||
/// @tparam type The result type.
|
||||
/// @throw boost::bad_any_cast if the provided result type is different from the type set by setResult().
|
||||
|
Reference in New Issue
Block a user