[olympic/studio/modlib] East const Studio
This commit is contained in:
@ -10,6 +10,6 @@
|
||||
|
||||
namespace studio {
|
||||
|
||||
void registerModule(const studio::Module*) noexcept;
|
||||
void registerModule(studio::Module const*) noexcept;
|
||||
|
||||
}
|
||||
|
@ -14,7 +14,6 @@ ClawEditor::ClawEditor(ox::CRStringView path, ox::ModelObject obj) noexcept:
|
||||
}
|
||||
|
||||
void ClawEditor::draw(turbine::Context&) noexcept {
|
||||
//const auto paneSize = ImGui::GetContentRegionAvail();
|
||||
ImGui::BeginChild("PaletteEditor");
|
||||
static constexpr auto flags = ImGuiTableFlags_RowBg | ImGuiTableFlags_NoBordersInBody;
|
||||
if (ImGui::BeginTable("ObjTree", 3, flags)) {
|
||||
@ -23,13 +22,13 @@ void ClawEditor::draw(turbine::Context&) noexcept {
|
||||
ImGui::TableSetupColumn("Value", ImGuiTableColumnFlags_NoHide);
|
||||
ImGui::TableHeadersRow();
|
||||
ObjPath objPath;
|
||||
drawTree(&objPath, m_obj);
|
||||
drawTree(objPath, m_obj);
|
||||
ImGui::EndTable();
|
||||
}
|
||||
ImGui::EndChild();
|
||||
}
|
||||
|
||||
void ClawEditor::drawRow(const ox::ModelValue &value) noexcept {
|
||||
void ClawEditor::drawRow(ox::ModelValue const&value) noexcept {
|
||||
using Str = ox::BasicString<100>;
|
||||
Str val, type;
|
||||
switch (value.type()) {
|
||||
@ -93,56 +92,56 @@ void ClawEditor::drawRow(const ox::ModelValue &value) noexcept {
|
||||
ImGui::Text("%s", val.c_str());
|
||||
}
|
||||
|
||||
void ClawEditor::drawVar(ObjPath *path, ox::CRStringView name, const ox::ModelValue &value) noexcept {
|
||||
void ClawEditor::drawVar(ObjPath &path, ox::CRStringView name, ox::ModelValue const&value) noexcept {
|
||||
using Str = ox::BasicString<100>;
|
||||
path->push_back(name);
|
||||
path.push_back(name);
|
||||
if (value.type() == ox::ModelValue::Type::Object) {
|
||||
drawTree(path, value.get<ox::ModelObject>());
|
||||
} else if (value.type() == ox::ModelValue::Type::Vector) {
|
||||
const auto &vec = value.get<ox::ModelValueVector>();
|
||||
const auto pathStr = ox::join<Str>("##", *path).unwrap();
|
||||
const auto lbl = ox::sfmt<Str>("{}##{}", name, pathStr);
|
||||
const auto flags = ImGuiTreeNodeFlags_SpanFullWidth
|
||||
auto const&vec = value.get<ox::ModelValueVector>();
|
||||
auto const pathStr = ox::join<Str>("##", path).unwrap();
|
||||
auto const lbl = ox::sfmt<Str>("{}##{}", name, pathStr);
|
||||
auto const flags = ImGuiTreeNodeFlags_SpanFullWidth
|
||||
| ImGuiTreeNodeFlags_OpenOnArrow
|
||||
| (vec.size() ? 0 : ImGuiTreeNodeFlags_Leaf)
|
||||
| (false ? ImGuiTreeNodeFlags_Selected : 0);
|
||||
const auto open = ImGui::TreeNodeEx(lbl.c_str(), flags);
|
||||
auto const open = ImGui::TreeNodeEx(lbl.c_str(), flags);
|
||||
ImGui::SameLine();
|
||||
drawRow(value);
|
||||
if (open) {
|
||||
for (auto i = 0lu; const auto &e: vec) {
|
||||
const auto iStr = ox::sfmt<Str>("{}", i);
|
||||
path->push_back(iStr);
|
||||
for (auto i = 0lu; auto const&e: vec) {
|
||||
auto const iStr = ox::sfmt<Str>("{}", i);
|
||||
path.push_back(iStr);
|
||||
ImGui::TableNextRow(0, 5);
|
||||
ImGui::TableNextColumn();
|
||||
drawVar(path, ox::sfmt<Str>("[{}]", i), e);
|
||||
path->pop_back();
|
||||
path.pop_back();
|
||||
++i;
|
||||
}
|
||||
ImGui::TreePop();
|
||||
}
|
||||
} else {
|
||||
const auto pathStr = ox::join<Str>("##", *path).unwrap();
|
||||
const auto lbl = ox::sfmt<Str>("{}##{}", name, pathStr);
|
||||
const auto flags = ImGuiTreeNodeFlags_SpanFullWidth
|
||||
auto const pathStr = ox::join<Str>("##", path).unwrap();
|
||||
auto const lbl = ox::sfmt<Str>("{}##{}", name, pathStr);
|
||||
auto const flags = ImGuiTreeNodeFlags_SpanFullWidth
|
||||
| ImGuiTreeNodeFlags_OpenOnArrow
|
||||
| ImGuiTreeNodeFlags_Leaf
|
||||
| (false ? ImGuiTreeNodeFlags_Selected : 0);
|
||||
const auto open = ImGui::TreeNodeEx(lbl.c_str(), flags);
|
||||
auto const open = ImGui::TreeNodeEx(lbl.c_str(), flags);
|
||||
ImGui::SameLine();
|
||||
drawRow(value);
|
||||
if (open) {
|
||||
ImGui::TreePop();
|
||||
}
|
||||
}
|
||||
path->pop_back();
|
||||
path.pop_back();
|
||||
}
|
||||
|
||||
void ClawEditor::drawTree(ObjPath *path, const ox::ModelObject &obj) noexcept {
|
||||
void ClawEditor::drawTree(ObjPath &path, ox::ModelObject const&obj) noexcept {
|
||||
using Str = ox::BasicString<100>;
|
||||
for (const auto &c : obj) {
|
||||
ImGui::TableNextRow(0, 5);
|
||||
auto pathStr = ox::join<Str>("##", *path).unwrap();
|
||||
auto pathStr = ox::join<Str>("##", path).unwrap();
|
||||
auto lbl = ox::sfmt<Str>("{}##{}", c->name, pathStr);
|
||||
const auto rowSelected = false;
|
||||
const auto hasChildren = c->value.type() == ox::ModelValue::Type::Object
|
||||
@ -152,13 +151,11 @@ void ClawEditor::drawTree(ObjPath *path, const ox::ModelObject &obj) noexcept {
|
||||
| (hasChildren ? 0 : ImGuiTreeNodeFlags_Leaf)
|
||||
| (rowSelected ? ImGuiTreeNodeFlags_Selected : 0);
|
||||
ImGui::TableNextColumn();
|
||||
if (ImGui::IsItemClicked()) {
|
||||
//model()->setActiveSubsheet(*path);
|
||||
}
|
||||
if (ImGui::IsMouseDoubleClicked(0) && ImGui::IsItemHovered()) {
|
||||
//showSubsheetEditor();
|
||||
}
|
||||
path->push_back(c->name);
|
||||
//if (ImGui::IsItemClicked()) {
|
||||
//}
|
||||
//if (ImGui::IsMouseDoubleClicked(0) && ImGui::IsItemHovered()) {
|
||||
//}
|
||||
path.push_back(c->name);
|
||||
if (c->value.type() == ox::ModelValue::Type::Object) {
|
||||
const auto open = ImGui::TreeNodeEx(lbl.c_str(), flags);
|
||||
ImGui::SameLine();
|
||||
@ -170,7 +167,7 @@ void ClawEditor::drawTree(ObjPath *path, const ox::ModelObject &obj) noexcept {
|
||||
} else {
|
||||
drawVar(path, c->name, c->value);
|
||||
}
|
||||
path->pop_back();
|
||||
path.pop_back();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -21,11 +21,11 @@ class ClawEditor: public studio::Editor {
|
||||
void draw(turbine::Context&) noexcept final;
|
||||
|
||||
private:
|
||||
static void drawRow(const ox::ModelValue &value) noexcept;
|
||||
static void drawRow(ox::ModelValue const&value) noexcept;
|
||||
|
||||
void drawVar(ObjPath *path, ox::CRStringView name, const ox::ModelValue &value) noexcept;
|
||||
void drawVar(ObjPath &path, ox::CRStringView name, ox::ModelValue const&value) noexcept;
|
||||
|
||||
void drawTree(ObjPath *path, const ox::ModelObject &obj) noexcept;
|
||||
void drawTree(ObjPath &path, ox::ModelObject const&obj) noexcept;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
namespace studio {
|
||||
|
||||
class FileDialogManager : public studio::Task {
|
||||
class FileDialogManager: public studio::Task {
|
||||
private:
|
||||
enum class UpdateProjectPathState {
|
||||
None,
|
||||
@ -36,7 +36,7 @@ class FileDialogManager : public studio::Task {
|
||||
studio::TaskState update(turbine::Context &ctx) noexcept final;
|
||||
|
||||
// signals
|
||||
ox::Signal<ox::Error(const ox::String &)> pathChosen;
|
||||
ox::Signal<ox::Error(ox::String const&)> pathChosen;
|
||||
|
||||
};
|
||||
|
||||
|
@ -57,7 +57,7 @@ static ox::Error runApp(
|
||||
studioCtx.ui = &ui;
|
||||
StudioUIDrawer drawer(ui);
|
||||
turbine::gl::addDrawer(*ctx, &drawer);
|
||||
const auto err = turbine::run(*ctx);
|
||||
auto const err = turbine::run(*ctx);
|
||||
turbine::gl::removeDrawer(*ctx, &drawer);
|
||||
return err;
|
||||
}
|
||||
@ -66,15 +66,15 @@ ox::Error run(
|
||||
ox::CRStringView appName,
|
||||
ox::CRStringView projectDataDir,
|
||||
int,
|
||||
const char**) {
|
||||
char const**) {
|
||||
// seed UUID generator
|
||||
const auto time = std::time(nullptr);
|
||||
auto const time = std::time(nullptr);
|
||||
ox::UUID::seedGenerator({
|
||||
static_cast<uint64_t>(time),
|
||||
static_cast<uint64_t>(time << 1)
|
||||
});
|
||||
// run app
|
||||
const auto err = runApp(appName, projectDataDir, ox::UniquePtr<ox::FileSystem>(nullptr));
|
||||
auto const err = runApp(appName, projectDataDir, ox::UniquePtr<ox::FileSystem>(nullptr));
|
||||
oxAssert(err, "Something went wrong...");
|
||||
return err;
|
||||
}
|
||||
@ -88,7 +88,7 @@ ox::Error run(
|
||||
ox::StringView appName,
|
||||
ox::StringView projectDataDir,
|
||||
int argc,
|
||||
const char **argv) noexcept {
|
||||
char const**argv) noexcept {
|
||||
return studio::run(ox::sfmt("{} {}", project, appName), projectDataDir, argc, argv);
|
||||
}
|
||||
|
||||
|
@ -61,8 +61,8 @@ void NewMenu::addItemMaker(ox::UniquePtr<studio::ItemMaker> im) noexcept {
|
||||
|
||||
void NewMenu::drawNewItemType(turbine::Context &ctx) noexcept {
|
||||
drawWindow(ctx, &m_open, [this] {
|
||||
auto items = ox_malloca(m_types.size() * sizeof(const char*), const char*, nullptr);
|
||||
for (auto i = 0u; const auto &im : m_types) {
|
||||
auto items = ox_malloca(m_types.size() * sizeof(char const*), char const*, nullptr);
|
||||
for (auto i = 0u; auto const&im : m_types) {
|
||||
items.get()[i] = im->name.c_str();
|
||||
++i;
|
||||
}
|
||||
@ -73,7 +73,7 @@ void NewMenu::drawNewItemType(turbine::Context &ctx) noexcept {
|
||||
|
||||
void NewMenu::drawNewItemName(turbine::Context &ctx) noexcept {
|
||||
drawWindow(ctx, &m_open, [this, &ctx] {
|
||||
const auto typeIdx = static_cast<std::size_t>(m_selectedType);
|
||||
auto const typeIdx = static_cast<std::size_t>(m_selectedType);
|
||||
if (typeIdx < m_types.size()) {
|
||||
ImGui::InputText("Name", m_itemName.data(), m_itemName.cap());
|
||||
}
|
||||
@ -113,7 +113,7 @@ void NewMenu::drawLastPageButtons(turbine::Context &ctx) noexcept {
|
||||
}
|
||||
|
||||
void NewMenu::finish(turbine::Context &ctx) noexcept {
|
||||
const auto err = m_types[static_cast<std::size_t>(m_selectedType)]->write(ctx, m_itemName);
|
||||
auto const err = m_types[static_cast<std::size_t>(m_selectedType)]->write(ctx, m_itemName);
|
||||
if (err) {
|
||||
oxLogError(err);
|
||||
return;
|
||||
|
@ -11,17 +11,17 @@
|
||||
namespace studio {
|
||||
|
||||
static ox::Result<ox::UniquePtr<ProjectTreeModel>>
|
||||
buildProjectTreeModel(ProjectExplorer *explorer, ox::StringView name, ox::CRStringView path, ProjectTreeModel *parent) noexcept {
|
||||
const auto fs = explorer->romFs();
|
||||
buildProjectTreeModel(ProjectExplorer &explorer, ox::StringView name, ox::CRStringView path, ProjectTreeModel *parent) noexcept {
|
||||
auto const fs = explorer.romFs();
|
||||
oxRequire(stat, fs->stat(path));
|
||||
auto out = ox::make_unique<ProjectTreeModel>(explorer, ox::String(name), parent);
|
||||
if (stat.fileType == ox::FileType::Directory) {
|
||||
oxRequireM(children, fs->ls(path));
|
||||
std::sort(children.begin(), children.end());
|
||||
ox::Vector<ox::UniquePtr<ProjectTreeModel>> outChildren;
|
||||
for (const auto &childName : children) {
|
||||
for (auto const&childName : children) {
|
||||
if (childName[0] != '.') {
|
||||
const auto childPath = ox::sfmt("{}/{}", path, childName);
|
||||
auto const childPath = ox::sfmt("{}/{}", path, childName);
|
||||
oxRequireM(child, buildProjectTreeModel(explorer, childName, childPath, out.get()));
|
||||
outChildren.emplace_back(std::move(child));
|
||||
}
|
||||
@ -35,7 +35,7 @@ ProjectExplorer::ProjectExplorer(turbine::Context &ctx) noexcept: m_ctx(ctx) {
|
||||
}
|
||||
|
||||
void ProjectExplorer::draw(turbine::Context &ctx) noexcept {
|
||||
const auto viewport = ImGui::GetContentRegionAvail();
|
||||
auto const viewport = ImGui::GetContentRegionAvail();
|
||||
ImGui::BeginChild("ProjectExplorer", ImVec2(300, viewport.y), true);
|
||||
ImGui::SetNextItemOpen(true);
|
||||
if (m_treeModel) {
|
||||
@ -44,12 +44,12 @@ void ProjectExplorer::draw(turbine::Context &ctx) noexcept {
|
||||
ImGui::EndChild();
|
||||
}
|
||||
|
||||
void ProjectExplorer::setModel(ox::UniquePtr<ProjectTreeModel> model) noexcept {
|
||||
void ProjectExplorer::setModel(ox::UPtr<ProjectTreeModel> model) noexcept {
|
||||
m_treeModel = std::move(model);
|
||||
}
|
||||
|
||||
ox::Error ProjectExplorer::refreshProjectTreeModel(ox::CRStringView) noexcept {
|
||||
oxRequireM(model, buildProjectTreeModel(this, "Project", "/", nullptr));
|
||||
oxRequireM(model, buildProjectTreeModel(*this, "Project", "/", nullptr));
|
||||
setModel(std::move(model));
|
||||
return OxError(0);
|
||||
}
|
||||
|
@ -14,14 +14,14 @@ namespace studio {
|
||||
|
||||
class ProjectExplorer: public studio::Widget {
|
||||
private:
|
||||
ox::UniquePtr<ProjectTreeModel> m_treeModel;
|
||||
ox::UPtr<ProjectTreeModel> m_treeModel;
|
||||
turbine::Context &m_ctx;
|
||||
public:
|
||||
explicit ProjectExplorer(turbine::Context &ctx) noexcept;
|
||||
|
||||
void draw(turbine::Context &ctx) noexcept override;
|
||||
|
||||
void setModel(ox::UniquePtr<ProjectTreeModel> model) noexcept;
|
||||
void setModel(ox::UPtr<ProjectTreeModel> model) noexcept;
|
||||
|
||||
ox::Error refreshProjectTreeModel(ox::CRStringView = {}) noexcept;
|
||||
|
||||
@ -32,7 +32,7 @@ class ProjectExplorer: public studio::Widget {
|
||||
|
||||
// slots
|
||||
public:
|
||||
ox::Signal<ox::Error(const ox::StringView&)> fileChosen;
|
||||
ox::Signal<ox::Error(ox::StringView const&)> fileChosen;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
namespace studio {
|
||||
|
||||
ProjectTreeModel::ProjectTreeModel(ProjectExplorer *explorer, ox::String name,
|
||||
ProjectTreeModel::ProjectTreeModel(ProjectExplorer &explorer, ox::String name,
|
||||
ProjectTreeModel *parent) noexcept:
|
||||
m_explorer(explorer),
|
||||
m_parent(parent),
|
||||
@ -27,17 +27,17 @@ void ProjectTreeModel::draw(turbine::Context &ctx) const noexcept {
|
||||
constexpr auto dirFlags = ImGuiTreeNodeFlags_OpenOnArrow | ImGuiTreeNodeFlags_OpenOnDoubleClick;
|
||||
if (!m_children.empty()) {
|
||||
if (ImGui::TreeNodeEx(m_name.c_str(), dirFlags)) {
|
||||
for (const auto &child : m_children) {
|
||||
for (auto const&child : m_children) {
|
||||
child->draw(ctx);
|
||||
}
|
||||
ImGui::TreePop();
|
||||
}
|
||||
} else {
|
||||
const auto path = fullPath();
|
||||
const auto name = ox::sfmt<ox::BasicString<255>>("{}##{}", m_name, path);
|
||||
auto const path = fullPath();
|
||||
auto const name = ox::sfmt<ox::BasicString<255>>("{}##{}", m_name, path);
|
||||
if (ImGui::TreeNodeEx(name.c_str(), ImGuiTreeNodeFlags_Leaf)) {
|
||||
if (ImGui::IsItemHovered() && ImGui::IsMouseDoubleClicked(0)) {
|
||||
m_explorer->fileChosen.emit(path);
|
||||
m_explorer.fileChosen.emit(path);
|
||||
}
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
@ -13,12 +13,12 @@ namespace studio {
|
||||
|
||||
class ProjectTreeModel {
|
||||
private:
|
||||
class ProjectExplorer *m_explorer = nullptr;
|
||||
class ProjectExplorer &m_explorer;
|
||||
ProjectTreeModel *m_parent = nullptr;
|
||||
ox::String m_name;
|
||||
ox::Vector<ox::UniquePtr<ProjectTreeModel>> m_children;
|
||||
public:
|
||||
explicit ProjectTreeModel(class ProjectExplorer *explorer, ox::String name,
|
||||
explicit ProjectTreeModel(class ProjectExplorer &explorer, ox::String name,
|
||||
ProjectTreeModel *parent = nullptr) noexcept;
|
||||
|
||||
ProjectTreeModel(ProjectTreeModel &&other) noexcept;
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
namespace studio {
|
||||
|
||||
static ox::Vector<const studio::Module*> modules;
|
||||
static ox::Vector<studio::Module const*> modules;
|
||||
|
||||
void registerModule(studio::Module const*mod) noexcept {
|
||||
modules.emplace_back(mod);
|
||||
@ -52,7 +52,7 @@ StudioUI::StudioUI(turbine::Context &ctx, ox::StringView projectDataDir) noexcep
|
||||
if (!err) {
|
||||
auto const openProjErr = openProject(config.projectPath);
|
||||
if (!openProjErr) {
|
||||
for (const auto &f: config.openFiles) {
|
||||
for (auto const&f: config.openFiles) {
|
||||
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));
|
||||
@ -75,7 +75,7 @@ void StudioUI::update() noexcept {
|
||||
}
|
||||
|
||||
void StudioUI::handleKeyEvent(turbine::Key key, bool down) noexcept {
|
||||
const auto ctrlDown = turbine::buttonDown(m_ctx, turbine::Key::Mod_Ctrl);
|
||||
auto const ctrlDown = turbine::buttonDown(m_ctx, turbine::Key::Mod_Ctrl);
|
||||
for (auto p : m_popups) {
|
||||
if (p->isOpen()) {
|
||||
if (key == turbine::Key::Escape) {
|
||||
@ -136,7 +136,7 @@ void StudioUI::handleKeyEvent(turbine::Key key, bool down) noexcept {
|
||||
void StudioUI::draw() noexcept {
|
||||
glutils::clearScreen();
|
||||
drawMenu();
|
||||
const auto viewport = ImGui::GetMainViewport();
|
||||
auto const viewport = ImGui::GetMainViewport();
|
||||
constexpr auto menuHeight = 18;
|
||||
ImGui::SetNextWindowPos(ImVec2(viewport->Pos.x, viewport->Pos.y + menuHeight));
|
||||
ImGui::SetNextWindowSize(ImVec2(viewport->Size.x, viewport->Size.y - menuHeight));
|
||||
@ -216,7 +216,7 @@ void StudioUI::drawMenu() noexcept {
|
||||
}
|
||||
|
||||
void StudioUI::drawTabBar() noexcept {
|
||||
const auto viewport = ImGui::GetContentRegionAvail();
|
||||
auto const viewport = ImGui::GetContentRegionAvail();
|
||||
ImGui::BeginChild("TabWindow##MainWindow##Studio", ImVec2(viewport.x, viewport.y));
|
||||
constexpr auto tabBarFlags = ImGuiTabBarFlags_Reorderable | ImGuiTabBarFlags_TabListPopupButton;
|
||||
if (ImGui::BeginTabBar("TabBar##TabWindow##MainWindow##Studio", tabBarFlags)) {
|
||||
@ -230,9 +230,9 @@ void StudioUI::drawTabs() noexcept {
|
||||
for (auto it = m_editors.begin(); it != m_editors.end();) {
|
||||
auto const &e = *it;
|
||||
auto open = true;
|
||||
const auto unsavedChanges = e->unsavedChanges() ? ImGuiTabItemFlags_UnsavedDocument : 0;
|
||||
const auto selected = m_activeEditorUpdatePending == e.get() ? ImGuiTabItemFlags_SetSelected : 0;
|
||||
const auto flags = unsavedChanges | selected;
|
||||
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()) {
|
||||
m_activeEditor = e.get();
|
||||
@ -258,9 +258,9 @@ void StudioUI::drawTabs() noexcept {
|
||||
}
|
||||
try {
|
||||
oxThrowError(m_editors.erase(it).moveTo(it));
|
||||
} catch (const ox::Exception &ex) {
|
||||
} catch (ox::Exception const&ex) {
|
||||
oxErrf("Editor tab deletion failed: {} ({}:{})\n", ex.what(), ex.file, ex.line);
|
||||
} catch (const std::exception &ex) {
|
||||
} catch (std::exception const&ex) {
|
||||
oxErrf("Editor tab deletion failed: {}\n", ex.what());
|
||||
}
|
||||
} else {
|
||||
@ -275,8 +275,8 @@ void StudioUI::loadEditorMaker(studio::EditorMaker const&editorMaker) noexcept {
|
||||
}
|
||||
}
|
||||
|
||||
void StudioUI::loadModule(const studio::Module *mod) noexcept {
|
||||
for (const auto &editorMaker : mod->editors(m_ctx)) {
|
||||
void StudioUI::loadModule(studio::Module const*mod) noexcept {
|
||||
for (auto const&editorMaker : mod->editors(m_ctx)) {
|
||||
loadEditorMaker(editorMaker);
|
||||
}
|
||||
for (auto &im : mod->itemMakers(m_ctx)) {
|
||||
@ -363,7 +363,7 @@ ox::Error StudioUI::openFileActiveTab(ox::CRStringView path, bool makeActiveTab)
|
||||
}
|
||||
editor = ox::make<ClawEditor>(path, std::move(obj));
|
||||
} else {
|
||||
const auto err = m_editorMakers[ext](path).moveTo(editor);
|
||||
auto const err = m_editorMakers[ext](path).moveTo(editor);
|
||||
if (err) {
|
||||
if constexpr(!ox::defines::Debug) {
|
||||
oxErrf("Could not open Editor: {}\n", toStr(err));
|
||||
|
Reference in New Issue
Block a user