mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-23 07:43:01 +01:00
Use enum values for the savePromptMode
This commit is contained in:
@@ -468,7 +468,7 @@ static void window_editor_object_selection_mouseup(rct_window* w, rct_widgetinde
|
|||||||
case WIDX_CLOSE:
|
case WIDX_CLOSE:
|
||||||
if (gScreenFlags & SCREEN_FLAGS_EDITOR)
|
if (gScreenFlags & SCREEN_FLAGS_EDITOR)
|
||||||
{
|
{
|
||||||
auto loadOrQuitAction = LoadOrQuitAction(LoadOrQuitModes::OpenSavePrompt, 1);
|
auto loadOrQuitAction = LoadOrQuitAction(LoadOrQuitModes::OpenSavePrompt, PM_SAVE_BEFORE_QUIT);
|
||||||
GameActions::Execute(&loadOrQuitAction);
|
GameActions::Execute(&loadOrQuitAction);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -627,7 +627,7 @@ static void window_top_toolbar_dropdown(rct_window* w, rct_widgetindex widgetInd
|
|||||||
{
|
{
|
||||||
window_close_by_class(WC_MANAGE_TRACK_DESIGN);
|
window_close_by_class(WC_MANAGE_TRACK_DESIGN);
|
||||||
window_close_by_class(WC_TRACK_DELETE_PROMPT);
|
window_close_by_class(WC_TRACK_DELETE_PROMPT);
|
||||||
auto loadOrQuitAction = LoadOrQuitAction(LoadOrQuitModes::OpenSavePrompt, 1);
|
auto loadOrQuitAction = LoadOrQuitAction(LoadOrQuitModes::OpenSavePrompt, PM_SAVE_BEFORE_QUIT);
|
||||||
GameActions::Execute(&loadOrQuitAction);
|
GameActions::Execute(&loadOrQuitAction);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Copyright (c) 2014-2018 OpenRCT2 developers
|
* Copyright (c) 2014-2019 OpenRCT2 developers
|
||||||
*
|
*
|
||||||
* For a complete list of all authors, please refer to contributors.md
|
* For a complete list of all authors, please refer to contributors.md
|
||||||
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
|
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
|
||||||
@@ -23,14 +23,14 @@ DEFINE_GAME_ACTION(LoadOrQuitAction, GAME_COMMAND_LOAD_OR_QUIT, GameActionResult
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
uint8_t _mode{ 0 };
|
uint8_t _mode{ 0 };
|
||||||
uint8_t _savePromptMode{ 0 };
|
uint8_t _savePromptMode{ PM_SAVE_BEFORE_LOAD };
|
||||||
|
|
||||||
public:
|
public:
|
||||||
LoadOrQuitAction()
|
LoadOrQuitAction()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
LoadOrQuitAction(LoadOrQuitModes mode, uint8_t savePromptMode = 0)
|
LoadOrQuitAction(LoadOrQuitModes mode, uint8_t savePromptMode = PM_SAVE_BEFORE_LOAD)
|
||||||
: _mode(static_cast<uint8_t>(mode))
|
: _mode(static_cast<uint8_t>(mode))
|
||||||
, _savePromptMode(savePromptMode)
|
, _savePromptMode(savePromptMode)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2552,7 +2552,7 @@ void Network::Client_Handle_MAP([[maybe_unused]] NetworkConnection& connection,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Something went wrong, game is not loaded. Return to main screen.
|
// Something went wrong, game is not loaded. Return to main screen.
|
||||||
auto loadOrQuitAction = LoadOrQuitAction(LoadOrQuitModes::OpenSavePrompt, 1);
|
auto loadOrQuitAction = LoadOrQuitAction(LoadOrQuitModes::OpenSavePrompt, PM_SAVE_BEFORE_QUIT);
|
||||||
GameActions::Execute(&loadOrQuitAction);
|
GameActions::Execute(&loadOrQuitAction);
|
||||||
}
|
}
|
||||||
if (has_to_free)
|
if (has_to_free)
|
||||||
|
|||||||
Reference in New Issue
Block a user