[nostalgia,olympic] Further reduce use of applicationData

This commit is contained in:
2024-03-23 16:07:49 -05:00
parent a4f0c7cdb5
commit 27f1df8f33
20 changed files with 62 additions and 60 deletions
@@ -42,7 +42,7 @@ void PaletteEditorImGui::keyStateChanged(turbine::Key key, bool down) {
}
void PaletteEditorImGui::draw(turbine::Context&) noexcept {
void PaletteEditorImGui::draw(studio::StudioContext&) noexcept {
auto const paneSize = ImGui::GetContentRegionAvail();
{
ImGui::BeginChild("Pages", ImVec2(250, paneSize.y), true);
@@ -25,7 +25,7 @@ class PaletteEditorImGui: public studio::Editor {
void keyStateChanged(turbine::Key key, bool down) override;
void draw(turbine::Context&) noexcept final;
void draw(studio::StudioContext&) noexcept final;
protected:
ox::Error saveItem() noexcept final;
@@ -157,7 +157,7 @@ void TileSheetEditorImGui::keyStateChanged(turbine::Key key, bool down) {
}
}
void TileSheetEditorImGui::draw(turbine::Context&) noexcept {
void TileSheetEditorImGui::draw(studio::StudioContext&) noexcept {
auto const paneSize = ImGui::GetContentRegionAvail();
auto const tileSheetParentSize = ImVec2(paneSize.x - m_palViewWidth, paneSize.y);
auto const fbSize = ox::Vec2(tileSheetParentSize.x - 16, tileSheetParentSize.y - 16);
@@ -237,7 +237,7 @@ void TileSheetEditorImGui::draw(turbine::Context&) noexcept {
}
ImGui::EndChild();
m_subsheetEditor.draw(m_tctx);
m_exportMenu.draw(m_tctx);
m_exportMenu.draw(m_sctx);
}
void TileSheetEditorImGui::drawSubsheetSelector(
@@ -481,7 +481,7 @@ ox::Error TileSheetEditorImGui::markUnsavedChanges(studio::UndoCommand const*) n
return {};
}
void TileSheetEditorImGui::SubSheetEditor::draw(turbine::Context &ctx) noexcept {
void TileSheetEditorImGui::SubSheetEditor::draw(turbine::Context &sctx) noexcept {
constexpr auto popupName = "Edit Subsheet";
if (!m_show) {
return;
@@ -490,7 +490,7 @@ void TileSheetEditorImGui::SubSheetEditor::draw(turbine::Context &ctx) noexcept
auto constexpr popupWidth = 235.f;
auto const popupHeight = modSize ? 130.f : 85.f;
auto const popupSz = ImVec2(popupWidth, popupHeight);
if (ig::BeginPopup(ctx, popupName, m_show, popupSz)) {
if (ig::BeginPopup(sctx, popupName, m_show, popupSz)) {
ImGui::InputText("Name", m_name.data(), m_name.cap());
if (modSize) {
ImGui::InputInt("Columns", &m_cols);
@@ -507,7 +507,7 @@ void TileSheetEditorImGui::SubSheetEditor::close() noexcept {
m_show = false;
}
void TileSheetEditorImGui::ExportMenu::draw(turbine::Context &ctx) noexcept {
void TileSheetEditorImGui::ExportMenu::draw(studio::StudioContext &sctx) noexcept {
constexpr auto popupName = "Export Tile Sheet";
if (!m_show) {
return;
@@ -515,7 +515,7 @@ void TileSheetEditorImGui::ExportMenu::draw(turbine::Context &ctx) noexcept {
constexpr auto popupWidth = 235.f;
constexpr auto popupHeight = 85.f;
constexpr auto popupSz = ImVec2(popupWidth, popupHeight);
if (ig::BeginPopup(ctx, popupName, m_show, popupSz)) {
if (ig::BeginPopup(sctx.tctx, popupName, m_show, popupSz)) {
ImGui::InputInt("Scale", &m_scale);
m_scale = ox::clamp(m_scale, 1, 50);
if (ig::PopupControlsOkCancel(popupWidth, m_show) == ig::PopupResponse::OK) {
@@ -40,7 +40,7 @@ class TileSheetEditorImGui: public studio::Editor {
m_cols = cols;
m_rows = rows;
}
void draw(turbine::Context &ctx) noexcept;
void draw(turbine::Context &sctx) noexcept;
void close() noexcept;
[[nodiscard]]
inline bool isOpen() const noexcept { return m_show; }
@@ -55,7 +55,7 @@ class TileSheetEditorImGui: public studio::Editor {
m_show = true;
m_scale = 5;
}
void draw(turbine::Context &ctx) noexcept;
void draw(studio::StudioContext &sctx) noexcept;
void close() noexcept;
[[nodiscard]]
inline bool isOpen() const noexcept { return m_show; }
@@ -88,7 +88,7 @@ class TileSheetEditorImGui: public studio::Editor {
void keyStateChanged(turbine::Key key, bool down) override;
void draw(turbine::Context&) noexcept override;
void draw(studio::StudioContext&) noexcept override;
void drawSubsheetSelector(TileSheet::SubSheet&, TileSheet::SubSheetIdx &path);
@@ -18,7 +18,7 @@ SceneEditorImGui::SceneEditorImGui(studio::StudioContext &ctx, ox::StringView pa
setRequiresConstantRefresh(false);
}
void SceneEditorImGui::draw(turbine::Context&) noexcept {
void SceneEditorImGui::draw(studio::StudioContext&) noexcept {
auto const paneSize = ImGui::GetContentRegionAvail();
m_view.draw(ox::Size{static_cast<int>(paneSize.x), static_cast<int>(paneSize.y)});
auto &fb = m_view.framebuffer();
@@ -23,7 +23,7 @@ class SceneEditorImGui: public studio::Editor {
public:
SceneEditorImGui(studio::StudioContext &ctx, ox::StringView path);
void draw(turbine::Context&) noexcept final;
void draw(studio::StudioContext&) noexcept final;
void onActivated() noexcept override;