Exemple #1
0
        private void SGChangeButton_Click(object sender, EventArgs e)
        {
            var textInput = new GenericTextInput("Enter the name of the Semi-Global IFF. (without .iff)", SemiglobalName);

            textInput.ShowDialog();
            if (textInput.DialogResult == DialogResult.OK && ActiveObj != null)
            {
                var name = textInput.StringResult;
                SemiglobalName = name;
                var sgs = ActiveObj.Resource.List <GLOB>();
                if (sgs != null && sgs.Count > 0)
                {
                    //modify existing
                    GameContent.Get.Changes.BlockingResMod(new ResAction(() =>
                    {
                        sgs[0].Name = name;
                    }, sgs[0]));
                }
                else
                {
                    //make one!

                    GameContent.Get.Changes.BlockingResMod(new ResAction(() =>
                    {
                        var glob = new GLOB()
                        {
                            ChunkID        = 1,
                            ChunkLabel     = "Semi-Globals",
                            AddedByPatch   = true,
                            ChunkProcessed = true,
                            ChunkType      = "GLOB",
                            RuntimeInfo    = ChunkRuntimeState.Modified,
                            Name           = name
                        };

                        ActiveObj.Resource.MainIff.AddChunk(glob);
                        GameContent.Get.Changes.ChunkChanged(glob);
                    }));
                }

                if (SemiglobalName != "")
                {
                    SemiGlobalButton.Text    = "Semi-Global (" + SemiglobalName + ")";
                    SemiGlobalButton.Enabled = true;
                }
                else
                {
                    SemiGlobalButton.Text    = "Semi-Global";
                    SemiGlobalButton.Enabled = false;
                }
            }
        }
Exemple #2
0
        private void ParamRenameBtn_Click(object sender, EventArgs e)
        {
            if (ParamList.SelectedIndex == -1 || ActiveMeta == null)
            {
                return;
            }
            int index = ParamList.SelectedIndex;
            var input = new GenericTextInput("Enter a new name for this Parameter.", ParamList.Items[index].ToString());

            input.ShowDialog();
            if (input.DialogResult == DialogResult.OK)
            {
                string name = input.StringResult;
                GameContent.Get.Changes.BlockingResMod(new ResAction(() =>
                {
                    ActiveMeta.ParamNames[index] = name;
                }, ActiveMeta));
                RefreshDisplay();
            }
        }
 private void ParamRenameBtn_Click(object sender, EventArgs e)
 {
     if (ParamList.SelectedIndex == -1 || ActiveMeta == null) return;
     int index = ParamList.SelectedIndex;
     var input = new GenericTextInput("Enter a new name for this Parameter.", ParamList.Items[index].ToString());
     input.ShowDialog();
     if (input.DialogResult == DialogResult.OK) {
         string name = input.StringResult;
         Content.Content.Get().Changes.BlockingResMod(new ResAction(() =>
         {
             ActiveMeta.ParamNames[index] = name;
         }, ActiveMeta));
         RefreshDisplay();
     }
 }