10 assert(ctx.
presetPath &&
"DrawContext::presetPath must not be null");
11 assert(ctx.
presetStatus &&
"DrawContext::presetStatus must not be null");
13 ImGui::SeparatorText(
"Character Preset");
15 ImGui::SetNextItemWidth(-1);
16 ImGui::InputText(
"##presetPath", ctx.
presetPath);
20 if (!canSave) ImGui::BeginDisabled();
22 if (ImGui::Button(
"Save Preset", ImVec2(-1, 0)))
25 if (!canSave) ImGui::EndDisabled();
30 if (!canLoad) ImGui::BeginDisabled();
32 if (ImGui::Button(
"Load Preset", ImVec2(-1, 0)))
35 if (!canLoad) ImGui::EndDisabled();
40 bool isError = ctx.
presetStatus->find(
"not found") != std::string::npos ||
43 ImGui::TextColored(ImVec4(1.0f, 0.4f, 0.4f, 1.0f),
"%s", ctx.
presetStatus->c_str());
45 ImGui::TextColored(ImVec4(0.4f, 1.0f, 0.4f, 1.0f),
"%s", ctx.
presetStatus->c_str());
49 ImGui::TextDisabled(
"Load a character model first.");
Per-frame context for the presets panel.
std::function< void(const char *)> loadPreset
std::function< void(const char *)> savePreset
std::string * presetStatus