8#include <filedialog/filedialog.h>
9#include <imgui/imgui.h>
10#include <imgui/imgui_internal.h>
19 auto& settings = pm.get_editor_settings();
21 ImGui::PushItemWidth(150.0f);
23 if(
inspect(ctx, settings.external_tools).edit_finished)
25 pm.save_project_settings(ctx);
28 ImGui::PopItemWidth();
34 auto& settings = pm.get_editor_settings();
36 ImGui::PushItemWidth(150.0f);
38 if(
inspect(ctx, settings.debugger).edit_finished)
40 pm.save_project_settings(ctx);
43 ImGui::TextColored(ImVec4(1.0f, 1.0f, 0.0f, 1.0f),
"%s",
"Requires an editor restart to apply changes.");
45 ImGui::PopItemWidth();
51 auto& settings = pm.get_editor_settings();
53 ImGui::PushItemWidth(150.0f);
55 if(
inspect(ctx, settings.scripting).edit_finished)
57 settings.scripting.reload_app_domain =
true;
58 pm.save_editor_settings();
61 ImGui::PopItemWidth();
77 ImGui::OpenPopup(
name);
78 show_request_ =
false;
81 ImGui::SetNextWindowSize(ImGui::GetMainViewport()->Size * 0.5f);
83 if(ImGui::BeginPopupModal(
name, &
show))
95 auto avail = ImGui::GetContentRegionAvail();
96 if(avail.x < 1.0f || avail.y < 1.0f)
101 static std::vector<setting_entry> categories{
102 {
"External Tools", &draw_external_tools_settings},
103 {
"Scripting", &draw_scripting_settings},
104#if DOTNETPP_BACKEND_MONO
105 {
"Debugger", &draw_debugger_settings},
110 ImGui::BeginChild(
"##LeftSidebar", avail * ImVec2(0.15f, 1.0f), ImGuiChildFlags_Borders | ImGuiChildFlags_ResizeX);
113 for(
const auto& category : categories)
116 if(ImGui::Selectable(category.id.c_str(), (selected_entry_.id == category.id)))
118 selected_entry_ = category;
128 ImGui::BeginChild(
"##RightContent");
130 if(selected_entry_.callback)
132 selected_entry_.callback(ctx);
editor_settings_panel(imgui_panels *parent)
void on_frame_ui_render(rtti::context &ctx, const char *name)
std::vector< size_t > parent_
auto inspect(rtti::context &ctx, T &obj, const std::string &name={}) -> inspect_result
Convenience template function for inspecting objects of known type.