RemoteTech.UI.OptionWindow.drawPresetsContent C# (CSharp) Method

drawPresetsContent() private method

Draws the content of the Presets section
private drawPresetsContent ( ) : void
return void
        private void drawPresetsContent()
        {
            GUILayout.Label("A third-party mod can replace your current RemoteTech settings with its own settings (GameData/ExampleMod/RemoteTechSettings.cfg).\nAlso, you can revert to RemoteTech's default settings.\nHere you can see what presets are available:", this.mGuiRunningText);
            GUILayout.Space(15);

            List<String> presetList = this.mSettings.PreSets;

            if(this.mSettings.PreSets.Count <= 0)
            {
                GUILayout.Label("No presets are found", this.mGuiRunningText);
            }

            for(int i = presetList.Count - 1; i >= 0; --i)
            {
                GUILayout.BeginHorizontal("box", GUILayout.MaxHeight(15));
                {
                    string folderName = presetList[i];
                    int index = folderName.LastIndexOf("/RemoteTechSettings");
                    folderName = folderName.Substring(0, index) + folderName.Substring(index).Replace("/RemoteTechSettings", ".cfg").Trim();

                    GUILayout.Space(15);
                    GUILayout.Label("- " + folderName, this.mGuiListText, GUILayout.ExpandWidth(true));
                    if(GUILayout.Button("Overwrite", this.mGuiListButton, GUILayout.Width(70), GUILayout.Height(20)))
                    {
                        RTSettings.ReloadSettings(this.mSettings, presetList[i]);
                        ScreenMessages.PostScreenMessage(string.Format("Your RemoteTech settings are set to {0}", folderName), 15);
                        RTLog.Notify("Overwrote current settings with this cfg {0}", RTLogLevel.LVL3, presetList[i]);
                    }
                }
                GUILayout.EndHorizontal();
            }
        }