コード例 #1
0
        public static void SaveSettings(List <string> BIOGames)
        {
            try
            {
                if (!String.IsNullOrEmpty(BIOGames[0]))
                {
                    Properties.Settings.Default.ME1Directory = BIOGames[0];
                    ME1Directory.GamePath(BIOGames[0]);
                }

                if (!String.IsNullOrEmpty(BIOGames[1]))
                {
                    Properties.Settings.Default.ME2Directory = BIOGames[1];
                    ME2Directory.GamePath(BIOGames[1]);
                }

                if (!String.IsNullOrEmpty(BIOGames[2]))
                {
                    Properties.Settings.Default.ME3Directory = BIOGames[2];
                    ME3Directory.GamePath(BIOGames[2]);
                }

                Properties.Settings.Default.Save();
            }
            catch (Exception e)
            {
                DebugOutput.PrintLn("Error saving pathing: " + e.Message);
            }
        }
コード例 #2
0
        public int SetupPaths(int whichgame)
        {
            string tempgamepath         = "";
            string PropertiesPathString = "";
            //WhichGame = whichgame;
            int status = -1;

            switch (whichgame)
            {
            case 1:
                tempgamepath         = ME1Directory.GamePath();
                PropertiesPathString = Properties.Settings.Default.ME1Directory;
                break;

            case 2:
                tempgamepath         = ME2Directory.GamePath();
                PropertiesPathString = Properties.Settings.Default.ME2Directory;
                break;

            case 3:
                tempgamepath         = ME3Directory.GamePath();
                PropertiesPathString = Properties.Settings.Default.ME3Directory;
                break;
            }

            // Heff: prioritized the global setting for now, was there a purpose to having texplorer/tpftools/modmaker paths separate?
            if (tempgamepath != null)
            {
                status = 1;
                if (!tempgamepath.ToLower().Contains("biogame"))
                {
                    tempgamepath = Path.Combine(tempgamepath, (whichgame == 3 ? "BIOGame" : "BioGame"));
                }
                BIOGames[whichgame - 1] = tempgamepath;
            }
            else if (!String.IsNullOrEmpty(PropertiesPathString))
            {
                BIOGames[whichgame - 1] = PropertiesPathString;
                status = 0;
            }
            else
            {
                DebugOutput.PrintLn("ME" + whichgame + " game files not found.");
            }

            return(status);
        }