diff --git a/Aquaria/Game.cpp b/Aquaria/Game.cpp index 1f30472..277589a 100644 --- a/Aquaria/Game.cpp +++ b/Aquaria/Game.cpp @@ -1543,7 +1543,7 @@ void Game::pickupIngredientEffects(IngredientData *data) ingOffYTimer = 2; } -void Game::hideInGameMenu(bool effects) +void Game::hideInGameMenu(bool effects, bool cancel) { if (isCooking) return; if (FoodSlot::foodSlotIndex != -1) return; @@ -1577,8 +1577,11 @@ void Game::hideInGameMenu(bool effects) } dsq->continuity.lastMenuPage = currentMenuPage; + if(cancel && (optionsMenu || keyConfigMenu)) + onOptionsCancel(); + else + toggleOptionsMenu(false); - toggleOptionsMenu(false); if (!optionsOnly) { toggleFoodMenu(false); diff --git a/Aquaria/Game.h b/Aquaria/Game.h index 0cdf44f..dc2f7cf 100644 --- a/Aquaria/Game.h +++ b/Aquaria/Game.h @@ -786,7 +786,7 @@ public: void loadEntityTypeList(); std::vector entitySaveData; int getIdxForEntityType(std::string type); - void hideInGameMenu(bool effects=true); + void hideInGameMenu(bool effects=true, bool cancel=false); void showInGameMenu(bool force=false, bool optionsOnly=false, MenuPage menuPage = MENUPAGE_NONE); bool optionsOnly; diff --git a/Aquaria/ScriptInterface.cpp b/Aquaria/ScriptInterface.cpp index 8ee0dc9..96753e1 100644 --- a/Aquaria/ScriptInterface.cpp +++ b/Aquaria/ScriptInterface.cpp @@ -3349,7 +3349,9 @@ luaFunc(showInGameMenu) luaFunc(hideInGameMenu) { - dsq->game->hideInGameMenu(); + bool skipEffect = getBool(L, 1); + bool cancel = getBool(L, 2); + dsq->game->hideInGameMenu(!skipEffect, cancel); luaReturnNil(); }