コード例 #1
0
 private void PopulateAvailableThoughts()
 {
     DefDumper.DumpThoughts();
     foreach (string defName in DefDumper.defList.Keys)
     {
         availableThoughtBox.Items.Add(DefDumper.defList[defName]);
     }
 }
コード例 #2
0
        private void openFileButton_Click(object sender, EventArgs e)
        {
            OpenFileDialog fileDialog = new OpenFileDialog();

            fileDialog.Title            = "Select Save File to Open";
            fileDialog.Filter           = "RWM files|*.rwm";
            fileDialog.InitialDirectory = Settings.Default.lastUsedPath;
            if (fileDialog.ShowDialog() == DialogResult.OK)
            {
                Settings.Default.lastUsedPath = Path.GetDirectoryName(fileDialog.FileName);
                Settings.Default.Save();

                handler = new XmlHandler(fileDialog.FileName);
                if (backupCheck.Checked == false)
                {
                    handler.ToggleBackup();
                }
                nodeMap = handler.Populate();
                colonistListBox.DataSource    = nodeMap.pawnNodeList;
                colonistListBox.DisplayMember = "fullName";
                DefDumper.DumpBackstories();
                PopulateBackstories();


                if (!toggleOnce)
                {
                    ToggleControls();
                    toggleOnce = true;
                }
            }
            if (!Settings.Default.rimworldDirSet)
            {
                FolderBrowserDialog folderSelector = new FolderBrowserDialog();
                folderSelector.Description = "Please find the path to your rimworld directory. This is important for thoughtDefs and traitDefs to function.";
                if (folderSelector.ShowDialog() == DialogResult.OK)
                {
                    Settings.Default.rimworldDir    = folderSelector.SelectedPath;
                    Settings.Default.rimworldDirSet = true;
                    Settings.Default.Save();
                }
            }
            if (Settings.Default.rimworldDirSet)
            {
                PopulateAvailableThoughts();
            }
        }