2016-06-30 00:58:55 +00:00
|
|
|
#ifndef IN_GAME_MENU_H
|
|
|
|
#define IN_GAME_MENU_H
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "ActionMapper.h"
|
|
|
|
|
|
|
|
class BitmapText;
|
|
|
|
class ToolTip;
|
|
|
|
class Quad;
|
|
|
|
class AquariaMenuItem;
|
|
|
|
class RenderObject;
|
|
|
|
class SongSlot;
|
|
|
|
class FoodSlot;
|
|
|
|
class TreasureSlot;
|
|
|
|
class IngredientData;
|
|
|
|
class AquariaKeyConfig;
|
|
|
|
class AquariaCheckBox;
|
|
|
|
class AquariaSlider;
|
|
|
|
class AquariaComboBox;
|
|
|
|
class RecipeMenuEntry;
|
|
|
|
class Recipe;
|
2016-07-13 03:00:19 +00:00
|
|
|
class RoundedRect;
|
|
|
|
class DebugButton;
|
2016-07-17 03:54:09 +00:00
|
|
|
class TTFText;
|
2016-08-02 02:15:04 +00:00
|
|
|
class AquariaButton;
|
2016-06-30 00:58:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
enum MenuPage
|
|
|
|
{
|
|
|
|
MENUPAGE_NONE = -1,
|
|
|
|
MENUPAGE_SONGS = 0,
|
|
|
|
MENUPAGE_FOOD = 1,
|
|
|
|
MENUPAGE_TREASURES = 2,
|
|
|
|
MENUPAGE_PETS = 3
|
|
|
|
};
|
|
|
|
|
|
|
|
struct RecipeMenu
|
|
|
|
{
|
|
|
|
RecipeMenu();
|
|
|
|
Quad *scroll;
|
|
|
|
Quad *scrollEnd;
|
|
|
|
BitmapText *header, *page, *description;
|
|
|
|
AquariaMenuItem *nextPage, *prevPage;
|
|
|
|
|
|
|
|
|
|
|
|
void toggle(bool on, bool watch=false);
|
|
|
|
void createPage(int p);
|
|
|
|
void slide(RenderObject *r, bool in, float t);
|
|
|
|
void destroyPage();
|
|
|
|
void goNextPage();
|
|
|
|
void goPrevPage();
|
2017-01-17 10:15:47 +00:00
|
|
|
size_t getNumPages();
|
|
|
|
size_t getNumKnown();
|
2016-06-30 00:58:55 +00:00
|
|
|
|
|
|
|
int currentPage;
|
|
|
|
|
|
|
|
bool on;
|
|
|
|
|
|
|
|
std::vector<RecipeMenuEntry*> recipeMenuEntries;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class InGameMenu : public ActionMapper
|
|
|
|
{
|
|
|
|
// These are defined in the cpp file and are exclusively used in menu code
|
|
|
|
friend class FoodSlot;
|
|
|
|
friend class PetSlot;
|
|
|
|
friend class TreasureSlot;
|
|
|
|
friend class SongSlot;
|
|
|
|
friend class FoodHolder;
|
2016-07-13 03:00:19 +00:00
|
|
|
friend class KeyConfigMenuReceiver;
|
|
|
|
enum { NUM_KEY_CONFIG_PAGES = 3 };
|
2016-06-30 00:58:55 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
InGameMenu();
|
|
|
|
~InGameMenu();
|
|
|
|
|
|
|
|
void create();
|
|
|
|
void update(float dt);
|
|
|
|
void hide(bool effects=true, bool cancel=false);
|
|
|
|
void show(bool force=false, bool optionsOnly=false, MenuPage menuPage = MENUPAGE_NONE);
|
|
|
|
bool isInGameMenu() const { return inGameMenu; }
|
|
|
|
bool isFoodMenuOpen() const { return foodMenu; }
|
|
|
|
MenuPage getCurrentMenuPage() const { return currentMenuPage; }
|
|
|
|
void reset();
|
|
|
|
void onContinuityReset();
|
|
|
|
|
|
|
|
void bindInput();
|
2017-01-14 21:53:20 +00:00
|
|
|
virtual void action(int actionID, int state, int source, InputDevice device);
|
2016-06-30 00:58:55 +00:00
|
|
|
|
|
|
|
void refreshFoodSlots(bool effects);
|
2016-07-09 02:18:40 +00:00
|
|
|
|
2016-06-30 00:58:55 +00:00
|
|
|
RecipeMenu recipeMenu;
|
|
|
|
|
2016-07-09 02:18:40 +00:00
|
|
|
float menuSelectDelay;
|
|
|
|
|
2019-03-24 18:45:52 +00:00
|
|
|
bool isInKeyConfigMenu() const { return keyConfigMenu; }
|
|
|
|
|
2016-06-30 00:58:55 +00:00
|
|
|
private:
|
|
|
|
void updateOptionsMenu(float dt);
|
2016-07-16 20:08:39 +00:00
|
|
|
void updateKeyConfigMenu(float dt);
|
2016-06-30 00:58:55 +00:00
|
|
|
|
|
|
|
void sortFood();
|
|
|
|
void updatePreviewRecipe();
|
|
|
|
void adjustFoodSlotCursor();
|
|
|
|
void playSongInMenu(int songType, bool override=false);
|
|
|
|
|
|
|
|
void refreshTreasureSlots();
|
|
|
|
|
|
|
|
Recipe *findRecipe(const std::vector<IngredientData*> &list);
|
|
|
|
void onCook();
|
|
|
|
void onRecipes();
|
|
|
|
void updateCookList();
|
|
|
|
void onUseTreasure();
|
|
|
|
void onUseTreasure(int flag);
|
|
|
|
|
|
|
|
void onPrevFoodPage();
|
|
|
|
void onNextFoodPage();
|
|
|
|
|
|
|
|
void onPrevTreasurePage();
|
|
|
|
void onNextTreasurePage();
|
|
|
|
|
|
|
|
void showInGameMenuExitCheck();
|
|
|
|
void hideInGameMenuExitCheck(bool refocus);
|
|
|
|
|
|
|
|
void setMenuDescriptionText(const std::string &text);
|
|
|
|
FoodSlot* getFoodSlotFromIndex();
|
|
|
|
|
|
|
|
BitmapText *songLabel, *foodLabel, *foodDescription, *treasureLabel;
|
|
|
|
ToolTip *treasureDescription;
|
|
|
|
Quad *treasureCloseUp;
|
|
|
|
|
|
|
|
Quad *menuBg, *menuBg2;
|
|
|
|
|
|
|
|
AquariaMenuItem *eYes, *eNo, *cook, *recipes, *nextFood, *prevFood, *nextTreasure, *prevTreasure, *use, *keyConfigButton;
|
|
|
|
AquariaMenuItem *opt_cancel, *opt_save, *foodSort;
|
|
|
|
|
|
|
|
Quad *menu_blackout;
|
|
|
|
|
|
|
|
std::vector<SongSlot*> songSlots;
|
|
|
|
std::vector<FoodSlot*> foodSlots;
|
|
|
|
std::vector<TreasureSlot*> treasureSlots;
|
|
|
|
BitmapText* songDescription;
|
|
|
|
|
|
|
|
int selectedTreasureFlag;
|
|
|
|
|
|
|
|
bool optionsOnly;
|
|
|
|
|
|
|
|
float cookDelay;
|
|
|
|
|
|
|
|
MenuPage currentMenuPage;
|
|
|
|
int currentFoodPage, currentTreasurePage;
|
|
|
|
|
|
|
|
int enqueuedPreviewRecipe;
|
|
|
|
|
|
|
|
Quad *previewRecipe;
|
|
|
|
Quad *menuIconGlow;
|
|
|
|
Quad *showRecipe;
|
|
|
|
|
|
|
|
bool isCooking;
|
|
|
|
float optsfxdly;
|
|
|
|
|
|
|
|
void doMenuSectionHighlight(int sect);
|
|
|
|
|
|
|
|
void onPrevRecipePage();
|
|
|
|
void onNextRecipePage();
|
|
|
|
void onDebugSave();
|
|
|
|
|
|
|
|
typedef std::vector<IngredientData*> CookList;
|
|
|
|
CookList cookList;
|
|
|
|
std::vector<std::string> dropIngrNames;
|
|
|
|
|
|
|
|
float songMenuPlayDelay;
|
2017-01-19 17:50:33 +00:00
|
|
|
size_t currentSongMenuNote;
|
2016-06-30 00:58:55 +00:00
|
|
|
int playingSongInMenu;
|
|
|
|
|
|
|
|
void onOptionsMenu();
|
|
|
|
bool optionsMenu, foodMenu, petMenu, treasureMenu, keyConfigMenu;
|
|
|
|
void toggleOptionsMenu(bool f, bool skipBackup=false, bool isKeyConfig=false);
|
|
|
|
void toggleFoodMenu(bool f);
|
|
|
|
void toggleMainMenu(bool f);
|
|
|
|
void togglePetMenu(bool f);
|
|
|
|
void toggleTreasureMenu(bool f);
|
|
|
|
void toggleRecipeList(bool on);
|
|
|
|
void toggleKeyConfigMenu(bool f);
|
|
|
|
|
|
|
|
void enqueuePreviewRecipe();
|
|
|
|
|
|
|
|
void switchToSongMenu();
|
|
|
|
void switchToFoodMenu();
|
|
|
|
void switchToPetMenu();
|
|
|
|
void switchToTreasureMenu();
|
|
|
|
|
|
|
|
void onKeyConfig();
|
|
|
|
|
2019-03-18 00:07:14 +00:00
|
|
|
void addKeyConfigLine(RenderObject *group, const std::string &label, const std::string &actionInputName, int x, int y, bool rejectJoyAxis = false);
|
2016-06-30 00:58:55 +00:00
|
|
|
|
2016-07-13 03:00:19 +00:00
|
|
|
AquariaKeyConfig *addAxesConfigLine(RenderObject *group, const std::string &label, const std::string &actionInputName, int offx, int y);
|
2016-06-30 00:58:55 +00:00
|
|
|
|
|
|
|
void onOptionsSave();
|
|
|
|
void onOptionsCancel();
|
|
|
|
AquariaSlider *sfxslider, *musslider, *voxslider;
|
2016-07-09 17:42:33 +00:00
|
|
|
AquariaCheckBox *autoAimCheck, *targetingCheck, *toolTipsCheck, *flipInputButtonsCheck, *blurEffectsCheck;
|
2016-06-30 00:58:55 +00:00
|
|
|
AquariaCheckBox *subtitlesCheck, *fullscreenCheck, *ripplesCheck;
|
|
|
|
AquariaComboBox *resBox;
|
|
|
|
Quad *songBubbles, *energyIdol, *liCrystal;
|
|
|
|
|
2016-07-13 03:00:19 +00:00
|
|
|
RenderObject *group_keyConfig[NUM_KEY_CONFIG_PAGES];
|
|
|
|
RoundedRect *keyConfigBg;
|
2016-08-02 02:15:04 +00:00
|
|
|
std::vector<AquariaButton*> keyCategoryButtons;
|
2016-07-16 20:08:39 +00:00
|
|
|
std::vector<AquariaKeyConfig*> keyConfigs;
|
2016-07-13 03:00:19 +00:00
|
|
|
RenderObject *createBasicKeyConfig();
|
|
|
|
void switchToKeyConfigPage(int page);
|
2016-08-02 02:15:04 +00:00
|
|
|
void switchToKeyConfigPage1();
|
|
|
|
void switchToKeyConfigPage2();
|
|
|
|
void switchToKeyConfigPage3();
|
2016-06-30 00:58:55 +00:00
|
|
|
Quad *options;
|
2016-07-16 20:08:39 +00:00
|
|
|
AquariaComboBox *actionSetBox;
|
|
|
|
AquariaCheckBox *actionSetCheck;
|
|
|
|
int selectedActionSetIdx;
|
2020-07-07 14:24:03 +00:00
|
|
|
TTFText *joystickNameText, *joystickGUIDText, *joystickButtonsText;
|
2021-01-12 16:30:23 +00:00
|
|
|
TTFText *keyConfigInstructions;
|
2016-07-16 20:08:39 +00:00
|
|
|
void updateActionSetComboBox();
|
|
|
|
void switchToActionSet(int idx);
|
2016-07-17 03:54:09 +00:00
|
|
|
void nextJoystick();
|
|
|
|
void updateJoystickText();
|
2016-06-30 00:58:55 +00:00
|
|
|
|
|
|
|
void onExitCheckNo();
|
|
|
|
void onExitCheckYes();
|
|
|
|
void onInGameMenuContinue();
|
|
|
|
void onInGameMenuOptions();
|
|
|
|
void onInGameMenuExit();
|
|
|
|
|
|
|
|
BitmapText *circlePageNum;
|
|
|
|
|
|
|
|
std::vector<ToolTip*> foodTips, songTips, petTips, treasureTips;
|
|
|
|
|
|
|
|
Quad *eAre;
|
|
|
|
int inGameMenuExitState;
|
|
|
|
|
|
|
|
BitmapText *menuDescription;
|
|
|
|
|
|
|
|
std::vector<AquariaMenuItem*> menu;
|
|
|
|
|
|
|
|
bool inGameMenu;
|
|
|
|
float menuOpenTimer;
|
|
|
|
|
|
|
|
FoodSlot *moveFoodSlotToFront;
|
|
|
|
AquariaMenuItem *lips;
|
|
|
|
|
|
|
|
MenuPage lastMenuPage, lastOptionsMenuPage;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|