Squashed 'deps/nostalgia/' changes from 04f3d6b4..6a523191

6a523191 [turbine] Cleanup applicationData
205f2a69 [turbine] Fix applicationData to properly return null
82f02896 [turbine] Cleanup type safety code for application data
aa43cb3d [turbine] Add some type safety to application data
05d08a76 Merge commit 'd6403991d49292d4f2b7d441636949472ca2b249'
c6750d50 [studio/modlib] Add ig::ChildStackItem
dade484d [olympic/studio] Make StudioContext::ui a ref instead of ptr
b015fe88 [ox/std] Make ranges predicates const refs

git-subtree-dir: deps/nostalgia
git-subtree-split: 6a523191561cf76db3d734e42199aaae0af7d21b
This commit is contained in:
2024-03-20 21:37:42 -05:00
parent d6403991d4
commit 5627a63572
13 changed files with 110 additions and 29 deletions

View File

@@ -12,11 +12,14 @@
namespace studio {
class StudioUI;
struct StudioContext {
class StudioUI *ui = nullptr;
StudioUI &ui;
Project *project = nullptr;
turbine::Context &tctx;
inline explicit StudioContext(turbine::Context &pTctx) noexcept: tctx(pTctx) {}
inline StudioContext(StudioUI &pUi, turbine::Context &pTctx) noexcept:
ui(pUi), tctx(pTctx) {}
};
}

View File

@@ -15,6 +15,12 @@ namespace studio::ig {
inline constexpr auto BtnSz = ImVec2{52, 22};
class ChildStackItem {
public:
explicit ChildStackItem(ox::CStringView id, ImVec2 const&sz = {}) noexcept;
~ChildStackItem() noexcept;
};
class IDStackItem {
public:
explicit IDStackItem(int id) noexcept;
@@ -98,4 +104,4 @@ class FilePicker {
};
}
}

View File

@@ -10,6 +10,14 @@
namespace studio::ig {
ChildStackItem::ChildStackItem(ox::CStringView id, ImVec2 const&sz) noexcept {
ImGui::BeginChild(id.c_str(), sz);
}
ChildStackItem::~ChildStackItem() noexcept {
ImGui::EndChild();
}
IDStackItem::IDStackItem(int id) noexcept {
ImGui::PushID(id);
}