[nostalgia/core] Cleanup TileSheetEditor with new ImGui util functions
All checks were successful
Build / build (push) Successful in 2m21s

This commit is contained in:
2024-01-20 14:59:43 -06:00
parent c2e34b6456
commit 5d1f680a51
4 changed files with 71 additions and 69 deletions

View File

@@ -10,26 +10,30 @@
namespace studio::ig {
inline constexpr auto BtnSz = ImVec2{50, 22};
inline constexpr auto BtnSz = ImVec2{52, 22};
template<typename T>
class IDStackItem {
private:
T m_id;
public:
explicit IDStackItem(T id) noexcept: m_id(id) {
ImGui::PushID(m_id);
}
~IDStackItem() noexcept {
ImGui::PopID();
}
explicit IDStackItem(int id) noexcept;
explicit IDStackItem(const char *id) noexcept;
explicit IDStackItem(ox::CStringView id) noexcept;
~IDStackItem() noexcept;
};
void centerNextWindow(turbine::Context &ctx) noexcept;
bool PushButton(ox::CStringView lbl, ImVec2 const&btnSz = BtnSz) noexcept;
void PopupBtns(float popupWidth, bool &popupOpen);
enum class PopupResponse {
None,
OK,
Cancel,
};
PopupResponse PopupControlsOkCancel(float popupWidth, bool &popupOpen);
[[nodiscard]]
bool BeginPopup(turbine::Context &ctx, ox::CStringView popupName, bool &show, ImVec2 const&sz = {285, 0});
/**
*