Compare commits
No commits in common. "1ba64cb5d87d5e4dabdb42aec9eb0beb7154b0f0" and "6837a0556d179a1ae0d7ef64b990b73b1ce821b1" have entirely different histories.
1ba64cb5d8
...
6837a0556d
@ -102,6 +102,8 @@ OX_MODEL_BEGIN(TileSheetSet)
|
||||
OX_MODEL_FIELD(entries)
|
||||
OX_MODEL_END()
|
||||
|
||||
void addEntry(TileSheetSet &set, ox::FileAddress path, int32_t begin = 0, int32_t size = -1) noexcept;
|
||||
|
||||
[[nodiscard]]
|
||||
int tileColumns(Context&) noexcept;
|
||||
|
||||
|
@ -66,9 +66,7 @@ StudioUI::StudioUI(turbine::Context &ctx, ox::StringParam projectDataDir) noexce
|
||||
auto openFileErr = openFileActiveTab(f, config.activeTabItemName == f);
|
||||
if (openFileErr) {
|
||||
oxErrorf("\nCould not open editor for file:\n\t{}\nReason:\n\t{}\n", f, toStr(openFileErr));
|
||||
continue;
|
||||
}
|
||||
m_activeEditor = m_editors.back().value->get();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -196,27 +194,26 @@ void StudioUI::drawTabBar() noexcept {
|
||||
|
||||
void StudioUI::drawTabs() noexcept {
|
||||
for (auto it = m_editors.begin(); it != m_editors.end();) {
|
||||
auto const&e = *it;
|
||||
auto const &e = *it;
|
||||
auto open = true;
|
||||
auto const unsavedChanges = e->unsavedChanges() ? ImGuiTabItemFlags_UnsavedDocument : 0;
|
||||
auto const selected = m_activeEditorUpdatePending == e.get() ? ImGuiTabItemFlags_SetSelected : 0;
|
||||
auto const flags = unsavedChanges | selected;
|
||||
if (ImGui::BeginTabItem(e->itemDisplayName().c_str(), &open, flags)) {
|
||||
if (m_activeEditor != e.get()) [[unlikely]] {
|
||||
if (m_activeEditor != e.get()) {
|
||||
m_activeEditor = e.get();
|
||||
studio::editConfig<StudioConfig>(keelCtx(m_ctx), [&](StudioConfig &config) {
|
||||
config.activeTabItemName = m_activeEditor->itemPath();
|
||||
});
|
||||
} else [[likely]] {
|
||||
if (m_activeEditorUpdatePending == e.get()) [[unlikely]] {
|
||||
m_activeEditorUpdatePending = nullptr;
|
||||
}
|
||||
if (m_activeEditorOnLastDraw != e.get()) [[unlikely]] {
|
||||
m_activeEditor->onActivated();
|
||||
}
|
||||
e->draw(m_sctx);
|
||||
m_activeEditorOnLastDraw = e.get();
|
||||
}
|
||||
if (m_activeEditorUpdatePending == e.get()) {
|
||||
m_activeEditorUpdatePending = nullptr;
|
||||
}
|
||||
if (m_activeEditorOnLastDraw != e.get()) [[unlikely]] {
|
||||
m_activeEditor->onActivated();
|
||||
}
|
||||
e->draw(m_sctx);
|
||||
m_activeEditorOnLastDraw = e.get();
|
||||
ImGui::EndTabItem();
|
||||
}
|
||||
if (!open) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user