예제 #1
0
        internal override void Display()
        {
            if (IsActive)
            {
                if (ImGui.Begin("Rename", ref IsActive, _flags))
                {
                    //TODO: Move this to settings
                    uint umaxnamesize = 64;

                    Array.Resize(ref nameInputBuffer, checked ((int)umaxnamesize)); //Resize the text buffer
                    ImGui.InputText("##name", nameInputBuffer, umaxnamesize);       //Gets the text from the user and stores it into the buffer

                    ImGui.SameLine();
                    if (ImGui.SmallButton("Set"))    //Gives the user the option to set the name
                    {
                        if (nameInputBuffer[0] != 0) //If the user has not entered an empty name

                        {
                            RenameCommand.CreateRenameCommand(_uiState.Game, _uiState.Faction, _entityState.Entity, nameString);
                            _entityState.Name = nameString;                //Rename the object
                            _entityState.NameIcon.NameString = nameString; //Rename the name of the object on the map
                            IsActive = false;                              //Close the window
                        }
                    }
                }
                ImGui.End();
            }
        }
예제 #2
0
 internal override void Display()
 {
     if (IsActive)
     {
         if (ImGui.Begin("Rename", ref IsActive, _flags))
         {
             ImGui.InputText("##name", nameInputBuffer, 16);
             ImGui.SameLine();
             if (ImGui.SmallButton("Set"))
             {
                 RenameCommand.CreateRenameCommand(_state.Game, _state.Faction, _entityState.Entity, nameString);
                 _entityState.Name = nameString;
                 _entityState.NameIcon.NameString = nameString;
                 IsActive = false;
             }
         }
         ImGui.End();
     }
 }