@@ -492,8 +492,11 @@ void Menu::Draw()
492
492
#endif
493
493
494
494
// unit switch
495
- static char * unit = nullptr ;
496
- if (ImGui::BeginCombo (" ##Unit" , unit))
495
+ static char unit[MAX_UNIT_LEN] = " " ;
496
+ ImGui::InputText (" ##unit" , unit, MAX_UNIT_LEN);
497
+ ImGui::SameLine ();
498
+
499
+ if (ImGui::BeginCombo (" ##Unit" , nullptr , ImGuiComboFlags_NoPreview))
497
500
{
498
501
auto unitList = gUnitList ;
499
502
@@ -506,7 +509,7 @@ void Menu::Draw()
506
509
bool selected = unit == x->name ;
507
510
508
511
if (ImGui::Selectable (x->name , selected))
509
- unit = x->name ;
512
+ strcpy_s ( unit, x->name ) ;
510
513
511
514
if (selected)
512
515
ImGui::SetItemDefaultFocus ();
@@ -614,8 +617,11 @@ void Menu::Draw()
614
617
#endif
615
618
616
619
// object select for birthing
617
- static char * name = nullptr ;
618
- if (ImGui::BeginCombo (" ##Instance" , name))
620
+ static char name[100 ] = " " ;
621
+ ImGui::InputText (" ##object" , name, 100 );
622
+ ImGui::SameLine ();
623
+
624
+ if (ImGui::BeginCombo (" ##Instance" , nullptr , ImGuiComboFlags_NoPreview))
619
625
{
620
626
auto objectList = gObjectList ;
621
627
@@ -625,7 +631,7 @@ void Menu::Draw()
625
631
auto selected = object->name == name;
626
632
627
633
if (ImGui::Selectable (object->name , selected))
628
- name = object->name ;
634
+ strcpy_s ( name, object->name ) ;
629
635
630
636
if (selected)
631
637
ImGui::SetItemDefaultFocus ();
0 commit comments