0xc3 1 месяц назад
Родитель
Сommit
ae7dded2b0
1 измененных файлов с 7 добавлено и 3 удалено
  1. 7 3
      src/saura/cmd/sandbox/sandbox.cpp

+ 7 - 3
src/saura/cmd/sandbox/sandbox.cpp

@@ -7,6 +7,7 @@
 
 #include <imgui.h>
 #include <imgui_internal.h>
+#include <string>
 #include <vector>
 
 #include "saura/cmd/sandbox/client/client.hpp"
@@ -223,6 +224,7 @@ struct SandboxApp : AppBase {
 
         if (ImGui::BeginPopupModal("CreateClientPopup", NULL,
                                    ImGuiWindowFlags_AlwaysAutoResize)) {
+          ClientInfo tmp_client;
           // Тип
           {
             static const char *items[] = {"Вариант 1", "Вариант 2",
@@ -269,14 +271,16 @@ struct SandboxApp : AppBase {
 
           // ФИО
           this->mem_arena_temp->begin(this->def_mem_arena.get());
-          uint8_t *buf = this->mem_arena_temp->push(1024);
+          uint64_t full_name_size = 65;
+          uint8_t *full_name = this->mem_arena_temp->push(full_name_size);
           {
 
-            ImGui::InputText("ФИО", (char *)buf, sizeof(buf));
+            ImGui::InputText("ФИО", (char *)full_name, full_name_size);
           }
 
           if (ImGui::Button("Close", ImVec2(120, 0))) {
-            spdlog::info("ФИО: {}", (char *)buf);
+            tmp_client.full_name = (char *)full_name;
+            spdlog::info("ФИО: {}", tmp_client.full_name.c_str());
             this->mem_arena_temp->pop_zero();
             ImGui::CloseCurrentPopup();
           }