예제 #1
0
        public void OnAddMod(object sender, RoutedEventArgs e)
        {
            string path = OpenFolderDialog();

            guiHandler.AddMod(path);
            AddItemToList(this.ModList, ConfigHolder.ShortenModPath(path));
        }
예제 #2
0
        public void LoadAllModsInDirectory()
        {
            var directories = Directory.GetDirectories(Path.GetDirectoryName(ConfigHolder.GetProcessPath()));

            foreach (string s in directories)
            {
                if (ConfigHolder.IsModFolder(ConfigHolder.ShortenModPath(s)))
                {
                    if (AddMod(s))
                    {
                        window.AddItemToList(window.ModList, ConfigHolder.ShortenModPath(s));
                    }
                }
            }
        }
예제 #3
0
        public void LoadGUI()
        {
            window.ProcessTextBox.Text              = ConfigHolder.GetProcessPath();
            window.KillNonRespProcessBox.IsChecked  = ConfigHolder.killNonRespProcess;
            window.StartServerWithToolBox.IsChecked = ConfigHolder.startServerOnStartup;

            foreach (string s in ConfigHolder.GetParameters())
            {
                window.AddItemToList(window.ParameterList, s);
            }
            foreach (string s in ConfigHolder.GetMods())
            {
                window.AddItemToList(window.ModList, ConfigHolder.ShortenModPath(s));
            }
            WriteToConsole("Config files loaded");
        }
예제 #4
0
        private static string ReadMods()
        {
            string parameter = "\"-mod=";

            for (int i = 0; i < ConfigHolder.GetMods().Count; i++)
            {
                string mod = ConfigHolder.GetMods()[i].ToString();
                if (i != ConfigHolder.GetMods().Count - 1)
                {
                    parameter += ConfigHolder.ShortenModPath(mod) + ";";
                }
                else
                {
                    parameter += ConfigHolder.ShortenModPath(mod);
                }
            }
            return(parameter += "\"");
        }