mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
Remove v1 UI Widgets (#62)
This commit is contained in:
@@ -297,7 +297,7 @@ void DrawDeveloperToolsMenu() {
|
||||
.tooltip = "Holding L makes you float into the air"
|
||||
});
|
||||
if (gPlayState != NULL) {
|
||||
UIWidgets::PaddedSeparator();
|
||||
ImGui::Separator();
|
||||
UIWidgets::Checkbox("Frame Advance", (bool*)&gPlayState->frameAdvCtx.enabled, {
|
||||
.tooltip = "This allows you to advance through the game one frame at a time on command. "
|
||||
"To advance a frame, hold Z and tap R on the second controller. Holding Z "
|
||||
@@ -314,7 +314,7 @@ void DrawDeveloperToolsMenu() {
|
||||
}
|
||||
}
|
||||
}
|
||||
UIWidgets::PaddedSeparator();
|
||||
ImGui::Separator();
|
||||
if (mStatsWindow) {
|
||||
UIWidgets::WindowButton("Stats", "gWindows.Stats", mStatsWindow, {
|
||||
.tooltip = "Shows the stats window, with your FPS and frametimes, and the OS you're playing on"
|
||||
|
||||
@@ -353,7 +353,7 @@ void DrawSlot(InventorySlot slot) {
|
||||
Inventory_DeleteItem(gSaveContext.save.saveInfo.inventory.items[selectedInventorySlot], selectedInventorySlot);
|
||||
ImGui::CloseCurrentPopup();
|
||||
}
|
||||
UIWidgets::SetLastItemHoverText("None");
|
||||
UIWidgets::Tooltip("None");
|
||||
|
||||
size_t availableItems = safeMode ? safeItemsForInventorySlot[selectedInventorySlot].size() : ITEM_FISHING_ROD;
|
||||
for (int32_t pickerIndex = 0; pickerIndex < availableItems; pickerIndex++) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+1
-70
@@ -1,10 +1,3 @@
|
||||
//
|
||||
// UIWidgets.hpp
|
||||
// soh
|
||||
//
|
||||
// Created by David Chavez on 25.08.22.
|
||||
//
|
||||
|
||||
#ifndef UIWidgets_hpp
|
||||
#define UIWidgets_hpp
|
||||
|
||||
@@ -34,73 +27,11 @@ namespace UIWidgets {
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// MARK: - Enums
|
||||
|
||||
enum class CheckboxGraphics {
|
||||
Cross,
|
||||
Checkmark,
|
||||
None
|
||||
};
|
||||
constexpr float maxSliderWidth = 260.0f;
|
||||
#ifdef __SWITCH__
|
||||
constexpr float sliderButtonWidth = 42.0f;
|
||||
#elif defined(__WIIU__)
|
||||
constexpr float sliderButtonWidth = 60.0f;
|
||||
#else
|
||||
constexpr float sliderButtonWidth = 30.0f;
|
||||
#endif
|
||||
|
||||
char* WrappedText(const char* text, unsigned int charactersPerLine = 60);
|
||||
char* WrappedText(const std::string& text, unsigned int charactersPerLine);
|
||||
|
||||
void SetLastItemHoverText(const std::string& text);
|
||||
void SetLastItemHoverText(const char* text);
|
||||
|
||||
void InsertHelpHoverText(const std::string& text);
|
||||
void InsertHelpHoverText(const char* text);
|
||||
|
||||
char* WrappedText(const std::string& text, unsigned int charactersPerLine = 60);
|
||||
void Tooltip(const char* text);
|
||||
void Spacer(float height);
|
||||
void PaddedSeparator(bool padTop = true, bool padBottom = true, float extraVerticalTopPadding = 0.0f, float extraVerticalBottomPadding = 0.0f);
|
||||
|
||||
void RenderCross(ImDrawList* draw_list, ImVec2 pos, ImU32 col, float sz);
|
||||
bool CustomCheckbox(const char* label, bool* v, bool disabled, CheckboxGraphics disabledGraphic);
|
||||
|
||||
void ReEnableComponent(const char* disabledTooltipText);
|
||||
void DisableComponent(const float alpha);
|
||||
|
||||
bool EnhancementCheckbox(const char* text, const char* cvarName, bool disabled = false, const char* disabledTooltipText = "", CheckboxGraphics disabledGraphic = CheckboxGraphics::Cross, bool defaultValue = false);
|
||||
bool PaddedEnhancementCheckbox(const char* text, const char* cvarName, bool padTop = true, bool padBottom = true, bool disabled = false, const char* disabledTooltipText = "", CheckboxGraphics disabledGraphic = CheckboxGraphics::Cross, bool defaultValue = false);
|
||||
|
||||
bool EnhancementCombobox(const char* cvarName, std::span<const char*, std::dynamic_extent> comboArray, uint8_t defaultIndex, bool disabled = false, const char* disabledTooltipText = "", uint8_t disabledValue = -1);
|
||||
bool LabeledRightAlignedEnhancementCombobox(const char* label, const char* cvarName, std::span<const char*, std::dynamic_extent> comboArray, uint8_t defaultIndex, bool disabled = false, const char* disabledTooltipText = "", uint8_t disabledValue = -1);
|
||||
|
||||
void PaddedText(const char* text, bool padTop = true, bool padBottom = true);
|
||||
|
||||
bool EnhancementSliderInt(const char* text, const char* id, const char* cvarName, int min, int max, const char* format, int defaultValue = 0, bool PlusMinusButton = true, bool disabled = false, const char* disabledTooltipText = "");
|
||||
bool PaddedEnhancementSliderInt(const char* text, const char* id, const char* cvarName, int min, int max, const char* format, int defaultValue = 0, bool PlusMinusButton = true, bool padTop = true, bool padBottom = true, bool disabled = false, const char* disabledTooltipText = "");
|
||||
bool EnhancementSliderFloat(const char* text, const char* id, const char* cvarName, float min, float max, const char* format, float defaultValue, bool isPercentage, bool PlusMinusButton = true, bool disabled = false, const char* disabledTooltipText = "");
|
||||
bool PaddedEnhancementSliderFloat(const char* text, const char* id, const char* cvarName, float min, float max, const char* format, float defaultValue, bool isPercentage, bool PlusMinusButton = true, bool padTop = true, bool padBottom = true, bool disabled = false, const char* disabledTooltipText = "");
|
||||
|
||||
bool EnhancementRadioButton(const char* text, const char* cvarName, int id);
|
||||
|
||||
bool DrawResetColorButton(const char* cvarName, ImVec4* colors, ImVec4 defaultcolors, bool has_alpha);
|
||||
bool DrawRandomizeColorButton(const char* cvarName, ImVec4* colors);
|
||||
void DrawLockColorCheckbox(const char* cvarName);
|
||||
void RainbowColor(const char* cvarName, ImVec4* colors);
|
||||
|
||||
void LoadPickersColors(ImVec4& ColorArray, const char* cvarname, const ImVec4& default_colors, bool has_alpha);
|
||||
bool EnhancementColor(const char* text, const char* cvarName, ImVec4 ColorRGBA, ImVec4 default_colors, bool allow_rainbow = true, bool has_alpha = false, bool TitleSameLine = false);
|
||||
|
||||
void DrawFlagArray32(const std::string& name, uint32_t& flags);
|
||||
void DrawFlagArray16(const std::string& name, uint16_t& flags);
|
||||
void DrawFlagArray8(const std::string& name, uint8_t& flags);
|
||||
bool StateButton(const char* str_id, const char* label);
|
||||
|
||||
// UIWidgets V2
|
||||
|
||||
namespace Colors {
|
||||
const ImVec4 White = ImVec4(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
|
||||
Reference in New Issue
Block a user