diff options
Diffstat (limited to 'editor')
| -rw-r--r-- | editor/editor.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/editor/editor.cpp b/editor/editor.cpp index e67ee12..a15c838 100644 --- a/editor/editor.cpp +++ b/editor/editor.cpp @@ -483,7 +483,8 @@ void RecordImGui_AssetPicker(AssetPickerSearchStruct &apss) { for (pk_handle_item_index_T i = 0; i < iCount; ++i) { const Asset &a = assets[i]; assetLabel &al = assetEntries.Push(); - memcpy(al.key, a.key, AssetKeyLength); + strncpy(al.key, a.key, AssetKeyLength); + al.key[AssetKeyLength-1] = '\0'; al.handle = a.handle; al.type = a.type; } @@ -538,6 +539,10 @@ void RecordImGuiModalCreateAsset() { assetTypeMask = assetTypeMask & (1U << static_cast<AssetType_T>(PKE_ASSET_TYPE_AUDIO)); type = PKE_ASSET_TYPE_AUDIO; } + if (ImGui::CheckboxFlags("Font", &assetTypeMask, 1U << static_cast<AssetType_T>(PKE_ASSET_TYPE_FONT))) { + assetTypeMask = assetTypeMask & (1U << static_cast<AssetType_T>(PKE_ASSET_TYPE_FONT)); + type = PKE_ASSET_TYPE_FONT; + } if (ImGui::Button("Select File")) { const char * patterns[1] = {"*.*"}; @@ -556,6 +561,7 @@ void RecordImGuiModalCreateAsset() { if (ImGui::Button("Create")) { AM_Register(assetKey, type, assetPath); shouldRebuildAssetList = true; + assetEntries.Resize(0); shouldClose = true; } ImGui::SameLine(); |
