Taskbar with icon buttons, stat bars and modal stats, catalog and settings windows
This commit is contained in:
1 parent
f900a0d01f
commit
37e87f168a
15 files changed
+500
-445
No files matched your search
@@ -4,18 +4,32 @@
|
||||
#include "save.h"
|
||||
#include <imgui.h>
|
||||
|
||||
constexpr float FONT_NORMAL = 20;
|
||||
constexpr float FONT_HEADER_3 = 24;
|
||||
constexpr float FONT_HEADER_2 = 30;
|
||||
constexpr float FONT_HEADER_1 = 40;
|
||||
constexpr float FONT_HUGE = 80;
|
||||
constexpr float FONT_NORMAL = 26;
|
||||
constexpr float FONT_HEADER_3 = 30;
|
||||
constexpr float FONT_HEADER_2 = 34;
|
||||
constexpr float FONT_DIALOGUE = 32;
|
||||
|
||||
class Play;
|
||||
|
||||
enum Direction
|
||||
{
|
||||
DIRECTION_LEFT,
|
||||
DIRECTION_RIGHT
|
||||
DIRECTION_UP,
|
||||
DIRECTION_DOWN
|
||||
};
|
||||
|
||||
enum Panel
|
||||
{
|
||||
PANEL_NONE,
|
||||
PANEL_STATS,
|
||||
PANEL_CATALOG,
|
||||
PANEL_SETTINGS
|
||||
};
|
||||
|
||||
enum ButtonState
|
||||
{
|
||||
BUTTON_NORMAL,
|
||||
BUTTON_ACTIVE,
|
||||
BUTTON_DISABLED
|
||||
};
|
||||
|
||||
enum CommandType
|
||||
@@ -39,7 +53,7 @@ using Commands = std::vector<Command>;
|
||||
|
||||
void style_set(Color color, float rounding = 0);
|
||||
|
||||
// The menus, tools, dialogue box, toasts and select screen.
|
||||
// The taskbar, its windows, the dialogue box, toasts and the select screen.
|
||||
class Ui
|
||||
{
|
||||
public:
|
||||
@@ -52,12 +66,13 @@ public:
|
||||
Character* catalogCharacter = nullptr;
|
||||
Character* character = nullptr;
|
||||
Commands* commands = nullptr;
|
||||
Measurement* measurement = nullptr;
|
||||
Renderer* renderer = nullptr;
|
||||
float menuSlide = 1;
|
||||
float toolsSlide = 0;
|
||||
float taskbarSlide = 1;
|
||||
int characterIndex = 0;
|
||||
int selectedIndex = -1;
|
||||
int selectedItem = -1;
|
||||
Panel panel = PANEL_NONE;
|
||||
bool isFullscreen = false;
|
||||
bool isNewGameWarning = false;
|
||||
bool isSelectedSaved = false;
|
||||
@@ -67,14 +82,15 @@ public:
|
||||
|
||||
private:
|
||||
bool is_fx(bool result);
|
||||
bool icon_button(const char* icon, const char* tooltip, ButtonState state);
|
||||
void icon_draw(const char* name, ImVec2 position, float size, ImU32 tint);
|
||||
void command_add(CommandType type, const std::string& key = "");
|
||||
void window_open(Play& play, Panel next);
|
||||
void taskbar_draw(Play& play, ImVec2 screen);
|
||||
void window_draw(Play& play, Settings& settings, ImVec2 screen);
|
||||
void stats_draw(Play& play);
|
||||
void catalog_draw(Play& play);
|
||||
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