コード例 #1
0
        public Queue <EventArgs> GetBaseManagerSettings(string PlayerName)
        {
            Queue <EventArgs> reply = new Queue <EventArgs>();

            reply.Enqueue(msg.pm(PlayerName, "Base Manager Settings -----------------------"));
            reply.Enqueue(msg.pm(PlayerName, ("Loading Mode").PadRight(35) + m_Mode.ToString().PadLeft(10)));
            reply.Enqueue(msg.pm(PlayerName, ("Size Limit").PadRight(35) + m_SizeMode.ToString().PadLeft(10)));
            reply.Enqueue(msg.pm(PlayerName, ("Shuffle Q Min").PadRight(35) + m_ShuffleModeQCount.ToString().PadLeft(10)));
            reply.Enqueue(msg.pm(PlayerName, ("Bases Currently in Shuffle Q").PadRight(35) + m_ShuffleModeQ.Count.ToString().PadLeft(10)));
            reply.Enqueue(msg.pm(PlayerName, ("Round Robin Mode Count").PadRight(35) + m_RoundRobinCount.ToString().PadLeft(10)));

            return(reply);
        }
コード例 #2
0
        public void Load()
        {
            Reset();

            if (File.Exists(SettingsPath))
            {
                Log.Debug("SettingsPath", SettingsPath);

                try
                {
                    using (var reader = new StreamReader(SettingsPath))
                    {
                        string line = null;
                        while ((line = reader.ReadLine()) != null)
                        {
                            var value = ReadValue(line, "FontFamily");
                            if (value != null)
                            {
                                FontFamily = value;
                                var index = Array.IndexOf(FontFamilies, FontFamily);
                                if (index == -1)
                                {
                                    FontFamily = DefaultFontFamily;
                                }
                            }

                            value = ReadValue(line, "BaseSize");
                            if (value != null)
                            {
                                int result = 0;
                                if (int.TryParse(value, out result))
                                {
                                    BaseSize = result;
                                    var index = Array.IndexOf(BaseSizes, BaseSize.ToString());
                                    if (index == -1)
                                    {
                                        BaseSize = DefaultBaseSize;
                                    }
                                }
                                else
                                {
                                    BaseSize = DefaultBaseSize;
                                }
                            }

                            value = ReadValue(line, "IncreaseSmallText");
                            if (value != null)
                            {
                                bool result = false;
                                if (bool.TryParse(value, out result))
                                {
                                    IncreaseSmallText = result;
                                }
                                else
                                {
                                    IncreaseSmallText = DefaultIncreaseSmallText;
                                }
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    Log.Error("Settings", ex.Message);
                    Reset();
                }
            }

            Game.UpdateUI(this);
            Log.Debug("Settings", "Loaded");
        }