diff options
Diffstat (limited to 'editor')
| -rw-r--r-- | editor/editor.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/editor/editor.cpp b/editor/editor.cpp index 9257f6a..c8b69df 100644 --- a/editor/editor.cpp +++ b/editor/editor.cpp @@ -1264,7 +1264,7 @@ void RecordImGuiUITree() { } void RecordImGuiUIEdit() { const ImGuiInputTextFlags text_flags = ImGuiInputTextFlags_AllowTabInput; - bool changed; + bool changed, changed_sub; if (!ImGui::Begin("pke_ui_edit")) { ImGui::End(); return; @@ -1275,6 +1275,7 @@ void RecordImGuiUIEdit() { } changed = false; + changed_sub = false; ImGui::Text("Position Type:"); ImGui::BeginDisabled(PK_HAS_FLAG(selected_ui_box->flags, PKE_UI_BOX_FLAG_POSITION_TYPE_FLEX)); @@ -1318,6 +1319,10 @@ void RecordImGuiUIEdit() { changed = ImGui::InputScalarN("flex_weight", ImGuiDataType_Float, &selected_ui_box->flex_weight, 1, nullptr, nullptr, nullptr, 0) || changed; changed = ImGui::InputScalarN("flex_direction", ImGuiDataType_U8, &selected_ui_box->flex_direction, 1, nullptr, nullptr, nullptr, 0) || changed; changed = ImGui::InputScalarN("layer", ImGuiDataType_U8, &selected_ui_box->layer, 1, nullptr, nullptr, nullptr, 0) || changed; + if (PK_HAS_FLAG(selected_ui_box->flags, PKE_UI_BOX_FLAG_VISIBILITY_INVISIBLE) == false) { + changed = ImGui::ColorEdit4("color_border", &selected_ui_box->color_border[0]) || changed; + changed = ImGui::ColorEdit4("color_background", &selected_ui_box->color_background[0]) || changed; + } if (selected_ui_box->type == PKE_UI_BOX_TYPE_TEXT) { assert(selected_ui_box->type_data != NULL); @@ -1343,6 +1348,12 @@ void RecordImGuiUIEdit() { } ImGui::SameLine(); ImGui::Text("(%.4zu/%4i)", len, buffer_len); + changed_sub = ImGui::ColorEdit4("color_foreground(txt)", &fr.settings.color_foreground[0]) || changed_sub; + changed_sub = ImGui::ColorEdit4("color_background(txt)", &fr.settings.color_background[0]) || changed_sub; + if (changed_sub) { + FontType_UpdateStringRender(fr.fr_handle, &fr.settings); + } + changed |= changed_sub; } if (changed) { |
