diff options
Diffstat (limited to 'editor/editor.cpp')
| -rw-r--r-- | editor/editor.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/editor/editor.cpp b/editor/editor.cpp index df5724c..2c66c8c 100644 --- a/editor/editor.cpp +++ b/editor/editor.cpp @@ -1423,10 +1423,10 @@ void RecordImGuiUITree() { selected_ui_box = box; FontRenderSettings frs{}; if (type == PKE_UI_BOX_TYPE_TEXT) { - box->type_data->text.font_render_handle = FontType_AddStringRender(FontTypeIndex(0), std::move(cstring_to_pk_cstr("")), &frs, box); + box->type_data->text.font_type_render = FontType_AddStringRender(FontTypeIndex(0), std::move(cstring_to_pk_cstr("")), &frs, box); } if (type == PKE_UI_BOX_TYPE_BUTTON_TEXT) { - box->type_data->button_text.font_render_handle = FontType_AddStringRender(FontTypeIndex(0), std::move(cstring_to_pk_cstr("")), &frs, box); + box->type_data->button_text.font_type_render = FontType_AddStringRender(FontTypeIndex(0), std::move(cstring_to_pk_cstr("")), &frs, box); } is_creating_new_box = false; is_child = false; @@ -1532,7 +1532,8 @@ void RecordImGuiUIEdit() { assert(selected_ui_box->type_data != NULL); ImGui::Text("Type: Text"); ImGui::Separator(); - FontRender fr = *FontType_GetFontRender(selected_ui_box->type_data->text.font_render_handle); + FontRender fr = *FontType_GetFontRender(selected_ui_box->type_data->text.font_type_render); + ImGui::Text("FontRender: %.4hu:%.4hu", fr.fr_handle.b, fr.fr_handle.i); const int buffer_len = 1024; char *text_buffer = pk_new_arr<char>(buffer_len, pkeSettings.mem_bkt.game_transient); size_t len = fr.text.length; @@ -1546,14 +1547,14 @@ void RecordImGuiUIEdit() { cstr.reserved = len+1; cstr.length = len; cstr.val = s; - FontType_UpdateStringRenderText(fr.fr_handle, std::move(cstr)); + FontType_UpdateStringRenderText({fr.index_ft, {fr.fr_handle}}, std::move(cstr)); changed = true; } ImGui::SameLine(); ImGui::Text("(%.4zu/%4i)", len, buffer_len); changed_sub = RecordImGui_FontRenderSettings(fr.settings, false); if (changed_sub) { - FontType_UpdateStringRender(fr.fr_handle, &fr.settings); + FontType_UpdateStringRender({fr.index_ft, {fr.fr_handle}}, &fr.settings); } changed |= changed_sub; } @@ -1622,7 +1623,8 @@ void RecordImGuiUIEdit() { assert(selected_ui_box->type_data != NULL); ImGui::Text("Type: Button Text"); ImGui::Separator(); - FontRender fr = *FontType_GetFontRender(selected_ui_box->type_data->button_text.font_render_handle); + FontRender fr = *FontType_GetFontRender(selected_ui_box->type_data->button_text.font_type_render); + ImGui::Text("FontRender: %.4hu:%.4hu", fr.fr_handle.b, fr.fr_handle.i); const int buffer_len = 1024; char *text_buffer = pk_new_arr<char>(buffer_len, pkeSettings.mem_bkt.game_transient); size_t len = fr.text.length; @@ -1636,14 +1638,14 @@ void RecordImGuiUIEdit() { cstr.reserved = len+1; cstr.length = len; cstr.val = s; - FontType_UpdateStringRenderText(fr.fr_handle, std::move(cstr)); + FontType_UpdateStringRenderText({fr.index_ft, {fr.fr_handle}}, std::move(cstr)); changed = true; } ImGui::SameLine(); ImGui::Text("(%.4zu/%4i)", len, buffer_len); changed_sub = RecordImGui_FontRenderSettings(fr.settings, false); if (changed_sub) { - FontType_UpdateStringRender(fr.fr_handle, &fr.settings); + FontType_UpdateStringRender({fr.index_ft, {fr.fr_handle}}, &fr.settings); } changed |= changed_sub; } |
