MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / configUi

Function configUi

TheForceEngine/TFE_Editor/editorConfig.cpp:180–249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178 }
179
180 bool configUi()
181 {
182 pushFont(TFE_Editor::FONT_SMALL);
183 s32 menuHeight = 6 + (s32)ImGui::GetFontSize();
184
185 bool finished = false;
186 ImGui::SetWindowSize("Editor Config", { UI_SCALE(550), 70.0f + UI_SCALE(100) });
187 ImGuiWindowFlags window_flags = ImGuiWindowFlags_NoResize;
188
189 if (ImGui::BeginPopupModal("Editor Config", nullptr, window_flags))
190 {
191 s32 browseWinOpen = -1;
192 ImGui::Text("Editor Path:"); ImGui::SameLine(UI_SCALE(120));
193 ImGui::InputText("##EditorPath", s_editorConfig.editorPath, TFE_MAX_PATH);
194 ImGui::SameLine();
195 if (ImGui::Button("Browse##EditorPath"))
196 {
197 browseWinOpen = 0;
198 }
199
200 ImGui::Text("Export Path:"); ImGui::SameLine(UI_SCALE(120));
201 ImGui::InputText("##ExportPath", s_editorConfig.exportPath, TFE_MAX_PATH);
202 ImGui::SameLine();
203 if (ImGui::Button("Browse##ExportPath"))
204 {
205 browseWinOpen = 1;
206 }
207
208 fontScaleControl();
209 thumbnailSizeControl();
210 ImGui::Separator();
211
212 if (ImGui::Button("Save Config"))
213 {
214 saveConfig();
215 finished = true;
216 ImGui::CloseCurrentPopup();
217 }
218
219 ImGui::SameLine();
220 if (ImGui::Button("Close"))
221 {
222 finished = true;
223 ImGui::CloseCurrentPopup();
224 }
225
226 // File dialogs...
227 if (browseWinOpen == 0)
228 {
229 FileResult res = TFE_Ui::directorySelectDialog("Editor Path", s_editorConfig.editorPath);
230 if (!res.empty())
231 {
232 strcpy(s_editorConfig.editorPath, res[0].c_str());
233 }
234 }
235 else if (browseWinOpen == 1)
236 {
237 FileResult res = TFE_Ui::directorySelectDialog("Export Path", s_editorConfig.exportPath);

Callers 1

handlePopupEndFunction · 0.85

Calls 9

pushFontFunction · 0.85
ButtonEnum · 0.85
fontScaleControlFunction · 0.85
thumbnailSizeControlFunction · 0.85
saveConfigFunction · 0.85
directorySelectDialogFunction · 0.85
popFontFunction · 0.85
c_strMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected