private void SaveSettings() { if (MarkChangedDirs != Settings.Default.bDirviewMarkChanged || HideIcons != Settings.Default.bDirViewHideIcons) { RefreshView |= true; } Settings.Default.bDirViewHideIcons = HideIcons; Settings.Default.bDirviewMarkChanged = MarkChangedDirs; Settings.Default.sSteamExecutable = SteamExecutable; if (m_radUseDoW2.Checked) { Settings.Default.sSteamAppID = GameConstants.DOW2_APP_ID; } else if (m_radUseChaosRising.Checked) { Settings.Default.sSteamAppID = GameConstants.CR_APP_ID; } else { Settings.Default.sSteamAppID = GameConstants.RETRIBUTION_APP_ID; } Settings.Default.bAppMarkChanged = MarkChangedTabs; MainManager.SetAllowOpeningFilesTwice(AllowOpeningTwice); Settings.Default.sTestParams = TestParameters; Settings.Default.bTestDebugWin = ShowDebugWindow; Settings.Default.bTestWindowed = StartWindowed; Settings.Default.bTestNoMovies = NoMovies; Settings.Default.sLanguage = Language; if (User.IsCurrentUserAdministrator()) { Settings.Default.bUseAdvancedDebug = AdvancedDebugMode; } else { if (AdvancedDebugMode) { UIHelper.ShowError( "Could not activate advanced debugging because the current user is not an administrator!"); } Settings.Default.bUseAdvancedDebug = false; } }
private void TestModToolStripMenuItemClick(object sender, EventArgs e) { MainManager.TestMod(); }
private void OpenDoW2LogDirectoryToolStripMenuItemClick(object sender, EventArgs e) { MainManager.OpenLogfileDirectory(); }
static void Main(string[] args) { if (!SetUpLoggingSystem()) { UIHelper.ShowError("Could not set up logging system!"); } if (!ConfigManager.SetupConfigSystem(Application.StartupPath + "\\plugins.config")) { UIHelper.ShowError("Could not set up config system! Make sure '" + Application.StartupPath + "\\plugins.config' exists."); } LoggingManager.SendMessage("Tool starting..."); if (args.Length > 0) { var arguments = new StringBuilder(); foreach (string arg in args) { arguments.Append(' '); arguments.Append(arg); } LoggingManager.SendMessage("Arguments: " + arguments); } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); AppDomain.CurrentDomain.UnhandledException += LogException; Application.ApplicationExit += OnApplicationExit; ModManager.ApplicationExitRequested += ModManagerApplicationExitRequested; // determine last used directory string lastPath = Properties.Settings.Default.sLastPath; string steamPath = null; if (string.IsNullOrEmpty(lastPath)) { LoggingManager.SendMessage("Could not determine last used path, setting it to default path."); steamPath = MainManager.GetSteamPath(); if (steamPath == null) { AppEnd("User failed to provide a valid Steam path."); return; } if (Directory.Exists(steamPath + GameConstants.RETRIBUTION_PATH_FROM_STEAM)) { lastPath = steamPath + GameConstants.RETRIBUTION_PATH_FROM_STEAM; } else if (Directory.Exists(steamPath + GameConstants.DOW2_PATH_FROM_STEAM)) { lastPath = steamPath + GameConstants.DOW2_PATH_FROM_STEAM; } else { LoggingManager.SendWarning("Could neither find Retribution nor DoW2 directory; searched for " + steamPath + GameConstants.RETRIBUTION_PATH_FROM_STEAM + " and " + steamPath + GameConstants.DOW2_PATH_FROM_STEAM); //AppEnd("Could neither find DoW2 nor Retribution"); lastPath = steamPath; } } ModManager.GameDirectory = lastPath; // get path to steam executable if (string.IsNullOrEmpty(Properties.Settings.Default.sSteamExecutable)) { if (steamPath == null) { steamPath = MainManager.GetSteamPath(); if (steamPath == null) { AppEnd("User failed to provide a valid Steam path."); return; } } Properties.Settings.Default.sSteamExecutable = steamPath + "\\steam.exe"; } MainManager.SetAllowOpeningFilesTwice(Properties.Settings.Default.bAppAllowOpeningTwice); // create FrontEnd var mainDialog = new MainDialog(); // load plugins // IMPORTANT: Create the FrontEnd BEFORE loading the plugins PluginManager.Path = Application.StartupPath + "\\plugins\\"; PluginManager.LoadPlugins(); PluginManager.LoadFileTypeSettings(Properties.Settings.Default.sFileTypes); if (string.IsNullOrEmpty(Properties.Settings.Default.sLanguage)) { LoggingManager.SendMessage("No DoW2 language found, setting it to default (English)"); MainManager.SetModLanguage("English"); } else { MainManager.SetModLanguage(Properties.Settings.Default.sLanguage); } UCSManager.Init(); mainDialog.HandleArgs(args); Application.Run(mainDialog); }