Shipwright/libultraship/libultraship/SohImGuiImpl.h

90 lines
2.5 KiB
C
Raw Normal View History

#pragma once
#include "GameOverlay.h"
#include "Lib/ImGui/imgui.h"
#include "SohConsole.h"
struct GameAsset {
uint32_t textureId;
int width;
int height;
};
namespace SohImGui {
enum class Backend {
DX11,
SDL
};
enum class Dialogues {
dConsole,
dMenubar,
dLoadSettings,
};
typedef struct {
Backend backend;
union {
struct {
void* window;
void* device_context;
void* device;
} dx11;
struct {
void* window;
void* context;
} sdl;
};
} WindowImpl;
typedef union {
struct {
void* handle;
int msg;
int wparam;
int lparam;
} win32;
struct {
void* event;
} sdl;
} EventImpl;
2022-04-03 15:47:24 -04:00
extern WindowImpl impl;
using WindowDrawFunc = void(*)(bool& enabled);
typedef struct {
bool enabled;
WindowDrawFunc drawFunc;
} CustomWindow;
extern Console* console;
extern Ship::GameOverlay* overlay;
extern bool needs_save;
void Init(WindowImpl window_impl);
void Update(EventImpl event);
void EnhancementRadioButton(const char* text, const char* cvarName, int id);
void EnhancementCheckbox(const char* text, const char* cvarName);
void EnhancementButton(const char* text, const char* cvarName);
void EnhancementSliderInt(const char* text, const char* id, const char* cvarName, int min, int max, const char* format);
void EnhancementSliderFloat(const char* text, const char* id, const char* cvarName, float min, float max, const char* format, float defaultValue, bool isPercentage);
void Tooltip(const char* text);
void EnhancementColor3(const char* text, const char* cvarName, float defaultColors[3], bool TitleSameLine);
void DrawMainMenuAndCalculateGameSize(void);
void DrawFramebufferAndGameInput(void);
void Render(void);
void CancelFrame(void);
void ShowCursor(bool hide, Dialogues w);
void BindCmd(const std::string& cmd, CommandEntry entry);
2022-04-03 15:47:24 -04:00
void AddWindow(const std::string& category, const std::string& name, WindowDrawFunc drawFunc);
void LoadResource(const std::string& name, const std::string& path, const ImVec4& tint = ImVec4(1, 1, 1, 1));
[Mod]HUD Editor - Color Scheme incl. N64 colors. (#202) * Update SohImGuiImpl.cpp * Add int variant of CVar_ Get/Set/Register * Add variant of CVar_ Get/Set/Register * Add LoadHUDColors() * Added temporary menu for custom colors * vars added * added section load * variables save/load * register boolean for colors radiobox * Minimap recolor * Hearts (top left) color, incl. DD variant * Add A/B/C/Start btn colors and rupee * A & C button icon and save prompt cursor. * A & C notes and cursor * Some notes I forgot tbh was open since hours. * Shops cursor color with included pulse * Wrong section was added * Fixed some logic there and removed an unused if * Moved a condition to make it better. * That what happen when you left it open for hours * Update z_message_PAL.c * Added color array for A button * Get/Set/Register Int not needed anymore * Update Cvar.h * Update Cvar.cpp * Removed HUDCOLOR_SECTION moved it to cosmetics Updated Tunics and navi mod too. * changed categorie name and updated * Updated Cosmetics menu and add colors there * Update GameSettings.cpp * Update GameSettings.h * A more generic name * Update SohImGuiImpl.cpp * Update bootcommands.c * update var name * var name update * var name update (creative name I know...) * Updated variables names to match gHudColors * to lazy to name this one * gHudColors renaming stuff there too * guess what, variable renaming. * Update Tunic/Navi mods with new variable name. * Updated Links tunic variable names * Fix condition for Right C button * Add condition to check if the button is on * Added system to check if color tunics is turned on. * Added empty C button colors * Add ability to move Hearts * Ability to move minimap (incl. dgn one) Add Dungeon icon fix requirement. once merged I will fix conflict with this one. * Compass icon move with the minimap * Added several button move function * stone of agony folly the interface too. * fix minimap alpha * Fixes notes env color (was showing incorrectly) * PR repo mass update, cleaning incoming * Clean_PR stuff * useless there ... * Properly load the function. Imagine creating a pseudo function to load load of colour and you actually forgot to add it, could not be me right , RIGHT ? * fix conflict and useless edit * Fix default color for A/B and C btns * Fix Rupee default color in ImGUI * Reworked Tunics handling, much better this way * Fix minimap default color * C button default color fix * better behavior and default color fix * Fixed every default color to match gamecube style * Fix dungeon entrance icon n.2 it was not using margin and always show icon system * This need a scene else it show everywhere oof
2022-05-21 13:16:28 -04:00
void LoadInterfaceEditor();
2022-04-03 15:47:24 -04:00
ImTextureID GetTextureByID(int id);
ImTextureID GetTextureByName(const std::string& name);
}