96 assert(ctx.
pathBuf &&
"DrawContext::pathBuf must not be null");
97 assert(ctx.
settings &&
"DrawContext::settings must not be null");
98 assert(ctx.
showFolderPicker &&
"DrawContext::showFolderPicker must not be null");
103 ImGui::SeparatorText(
"World of Warcraft");
105 ImGui::Text(
"Game Data Path:");
106 float browseWidth = ImGui::CalcTextSize(
"Browse...").x + ImGui::GetStyle().FramePadding.x * 2.0f;
107 ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x - browseWidth - ImGui::GetStyle().ItemSpacing.x);
108 ImGui::InputText(
"##gamepath", ctx.
pathBuf);
110 if (ImGui::Button(
"Browse..."))
111 openFolderPicker(ctx);
115 ImGui::OpenPopup(
"Select Folder##FolderPicker");
117 if (ImGui::BeginPopupModal(
"Select Folder##FolderPicker", ctx.
showFolderPicker,
118 ImGuiWindowFlags_AlwaysAutoResize))
122 ImGui::TextColored(ImVec4(0.4f, 0.8f, 1.0f, 1.0f),
"%s", curPathStr.c_str());
126 folderPickerRefresh(ctx);
134 if (!canGoUp && !canGoRoot) ImGui::BeginDisabled();
135 if (ImGui::Button(
"Up"))
143 if (!canGoUp && !canGoRoot) ImGui::EndDisabled();
150 ImGui::BeginChild(
"##FolderList", ImVec2(500, 400), ImGuiChildFlags_Borders);
151 ImGuiListClipper clipper;
153 while (clipper.Step())
155 for (
int i = clipper.DisplayStart; i < clipper.DisplayEnd; ++i)
159 ? p.string() : p.filename().string();
161 if (ImGui::Selectable(displayName.c_str(),
false, ImGuiSelectableFlags_AllowDoubleClick))
163 if (ImGui::IsMouseDoubleClicked(ImGuiMouseButton_Left))
175 if (ImGui::Button(
"Select This Folder", ImVec2(200, 0)))
181 ImGui::CloseCurrentPopup();
185 if (ImGui::Button(
"Cancel", ImVec2(120, 0)))
188 ImGui::CloseCurrentPopup();
195 ImGui::TextColored(ImVec4(0.4f, 1.0f, 0.4f, 1.0f),
"Loaded: %s (%s)",
203 ImGui::TextWrapped(
"%s", status.c_str());
209 ImGui::TextWrapped(
"%s", status.c_str());
211 ImGui::TextDisabled(
"Use File > Load WoW to load game data.");
215 ImGui::TextDisabled(
"Speeds up loading by caching the database. Takes effect on next load.");
218 ImGui::SeparatorText(
"General");
222 if (HWND hConsole = GetConsoleWindow())
226 ImGui::TextDisabled(
"Shows/hides the debug console. Useful for diagnostics.");
229 ImGui::SeparatorText(
"Appearance");
230 ImGui::Text(
"Theme:");
231 ImGui::SetNextItemWidth(-1);
237 ImGui::Text(
"Font:");
238 ImGui::SetNextItemWidth(-1);
241 if (ImGui::BeginCombo(
"##Font",
246 for (
int i = 0; i < static_cast<int>(ctx.
availableFonts->size()); ++i)
250 if (ImGui::Selectable((*ctx.
availableFonts)[i].name.c_str(), selected))
256 ImGui::SetItemDefaultFocus();
264 ImGui::TextDisabled(
"No .ttf/.otf files found in fonts/ directory.");
267 ImGui::Text(
"Font Size:");
268 ImGui::SetNextItemWidth(-1);
269 if (ImGui::SliderFloat(
"##FontSize", &ctx.
settings->
fontSize, 10.0f, 40.0f,
"%.0f px"))
271 ImGui::TextDisabled(
"Drop .ttf or .otf files into the fonts/ folder to add more.");
276 ImGui::Text(
"Camera yaw=%.1f pitch=%.1f radius=%.2f",
278 ImGui::Text(
"GL_RENDERER: %s", glGetString(GL_RENDERER));
281 ImGui::SeparatorText(
"Save");
282 if (ImGui::Button(
"Save Settings", ImVec2(-1, 0)))
287 ImGui::TextDisabled(
"Saves preferences and UI layout.");
Per-frame context for the settings panel.
std::filesystem::path * folderPickerCurrent
std::vector< std::filesystem::path > * folderPickerEntries
std::function< std::string()> getLoadStatus
bool * folderPickerNeedsRefresh
std::vector< FontEntry > * availableFonts
std::atomic< float > * loadProgress