Ejemplo n.º 1
0
 private void LoadStatusSymbols()
 {
     _SessionStatusNone     = ConfigSettings.GetConfigString("SessionStatusNone", "🎻");
     _SessionStatusStarting = ConfigSettings.GetConfigString("SessionStatusStarting", "=");
     _SessionStatusRunning  = ConfigSettings.GetConfigString("SessionStatusRunning", "✔");
     _SessionStatusWarning  = ConfigSettings.GetConfigString("SessionStatusWarning", "☔");
 }
Ejemplo n.º 2
0
        private static Regex GetGameWindowCaptionRegex()
        {
            string gameCaptionPattern = ConfigSettings.GetConfigString("GameCaptionPattern", null);

            if (gameCaptionPattern != null)
            {
                var regex = new System.Text.RegularExpressions.Regex(gameCaptionPattern);
                return(regex);
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 3
0
        private void LookForGameWindow(GameSession session)
        {
            var    finder = new ThwargUtils.WindowFinder();
            IntPtr hwnd   = finder.FindWindowByCaptionAndProcessId(regex: null, newWindow: false, processId: session.ProcessId);

            if (hwnd != (IntPtr)0)
            {
                // Only save hwnd if window has been renamed, meaning launch completed
                string gameCaptionPattern = ConfigSettings.GetConfigString("GameCaptionPattern", null);
                string caption            = ThwargUtils.WindowFinder.GetWindowTextString(hwnd);
                if (caption != gameCaptionPattern)
                {
                    session.WindowHwnd = hwnd;
                }
            }
        }
Ejemplo n.º 4
0
        private string GetNewGameTitle(LaunchItem launchItem)
        {
            string pattern = ConfigSettings.GetConfigString("NewGameTitle", "");

            if (launchItem.CharacterSelected == "None")
            {
                pattern = ConfigSettings.GetConfigString("NewGameTitleNoChar", "");
            }
            string alias = launchItem.Alias;

            if (string.IsNullOrEmpty(alias))
            {
                alias = launchItem.AccountName;
            }                                                                    // fall back to account if no alias
            pattern = pattern.Replace("%ALIAS%", alias);
            pattern = pattern.Replace("%ACCOUNT%", launchItem.AccountName);
            pattern = pattern.Replace("%SERVER%", launchItem.ServerName);
            if (launchItem.CharacterSelected != "None")
            {
                pattern = pattern.Replace("%CHARACTER%", launchItem.CharacterSelected);
            }
            return(pattern);
        }