Split play into body, items, interactions, autofeed and camera, with events, commands and literal strings
This commit is contained in:
1 parent
167f1a5ddd
commit
3e9a0cbd34
21 files changed
+2504
-2431
No files matched your search
@@ -18,52 +18,63 @@ enum Direction
|
||||
DIRECTION_RIGHT
|
||||
};
|
||||
|
||||
// Hover and select sounds (from the character being played, or none) and the pulsing border on hovered widgets.
|
||||
void widget_sounds_set(Audio* audio, const Sounds* hover, const Sounds* select);
|
||||
void widget_fx();
|
||||
|
||||
// Passes a widget's result through after giving it its sounds and hover border.
|
||||
inline bool is_fx(bool result)
|
||||
enum CommandType
|
||||
{
|
||||
widget_fx();
|
||||
return result;
|
||||
}
|
||||
COMMAND_CONTINUE,
|
||||
COMMAND_NEW_GAME,
|
||||
COMMAND_MENU,
|
||||
COMMAND_SAVE,
|
||||
COMMAND_RELOAD,
|
||||
COMMAND_FULLSCREEN
|
||||
};
|
||||
|
||||
inline ImVec4 imvec4_get(Color color)
|
||||
// A request, from the UI or the console, for the game to change what's running. Character names a character's folder.
|
||||
struct Command
|
||||
{
|
||||
return {color.r, color.g, color.b, color.a};
|
||||
}
|
||||
std::string character;
|
||||
CommandType type = COMMAND_MENU;
|
||||
};
|
||||
|
||||
using Commands = std::vector<Command>;
|
||||
|
||||
void style_set(Color color, float rounding = 0);
|
||||
float row_width_get(int count);
|
||||
void tooltip_set(const char* text, float size = FONT_NORMAL);
|
||||
void triangle_draw(ImVec2 position, ImVec2 size, Direction direction);
|
||||
|
||||
// The menus, tools, toasts and select screen.
|
||||
// The menus, tools, dialogue box, toasts and select screen.
|
||||
class Ui
|
||||
{
|
||||
public:
|
||||
std::vector<Actor> itemActors;
|
||||
std::vector<Canvas> itemCanvases;
|
||||
std::vector<ImVec2> itemSizes;
|
||||
Actor previewActor;
|
||||
Canvas previewCanvas;
|
||||
Progress selectedProgress;
|
||||
Stats selectedStats;
|
||||
Audio* audio = nullptr;
|
||||
Character* catalogCharacter = nullptr;
|
||||
Character* character = nullptr;
|
||||
Commands* commands = nullptr;
|
||||
Renderer* renderer = nullptr;
|
||||
float menuSlide = 1;
|
||||
float toolsSlide = 0;
|
||||
int characterIndex = 0;
|
||||
int progressIndex = -1;
|
||||
int selectedIndex = -1;
|
||||
int selectedItem = -1;
|
||||
bool isContinue = false;
|
||||
bool isFullscreen = false;
|
||||
bool isFullscreenToggled = false;
|
||||
bool isNewGame = false;
|
||||
bool isNewGameWarning = false;
|
||||
bool isPreview = false;
|
||||
bool isRefresh = false;
|
||||
bool isReturn = false;
|
||||
bool isSave = false;
|
||||
bool isSelectedSaved = false;
|
||||
|
||||
void play_update(Play& play, Settings& settings, Renderer& renderer, Audio& audio);
|
||||
void select_update(std::vector<Character>& characters, Settings& settings, Renderer& renderer, Audio& audio);
|
||||
void settings_update(Settings& settings, Audio& audio, const Character* character);
|
||||
void play_update(Play& play, Settings& settings);
|
||||
void select_update(std::vector<Character>& characters, Settings& settings);
|
||||
|
||||
private:
|
||||
bool is_fx(bool result);
|
||||
void command_add(CommandType type, const std::string& key = "");
|
||||
void settings_draw(Settings& settings);
|
||||
void interact_tab_draw(Play& play, Settings& settings);
|
||||
void catalog_tab_draw(Play& play);
|
||||
void cheats_tab_draw(Play& play);
|
||||
void tools_draw(Play& play, ImVec2 position, ImVec2 size);
|
||||
void bar_draw(Play& play, bool& isOpen, float slide, ImVec2 position, ImVec2 size, Direction direction,
|
||||
const char* openTooltip, const char* closeTooltip);
|
||||
void text_draw(Play& play, ImVec2 screen);
|
||||
void toasts_draw(Play& play);
|
||||
};
|
||||
Reference in new issue
Block a user