void ConfigurationChanged()
        {
            var c = Utility.Configuration.Config;

            MainFont = Font = c.UI.MainFont;
            SubFont  = c.UI.SubFont;

            AutoScroll = c.FormFleet.IsScrollable;


            if (ControlFleet != null && KCDatabase.Instance.Fleet[FleetID] != null)
            {
                ControlFleet.ConfigurationChanged(this);
                ControlFleet.Update(KCDatabase.Instance.Fleet[FleetID]);
            }

            if (ControlMember != null)
            {
                bool    showAircraft              = c.FormFleet.ShowAircraft;
                bool    fixShipNameWidth          = c.FormFleet.FixShipNameWidth;
                bool    shortHPBar                = c.FormFleet.ShortenHPBar;
                bool    colorMorphing             = c.UI.BarColorMorphing;
                Color[] colorScheme               = c.UI.BarColorScheme.Select(col => col.ColorData).ToArray();
                bool    showNext                  = c.FormFleet.ShowNextExp;
                bool    showConditionIcon         = c.FormFleet.ShowConditionIcon;
                var     levelVisibility           = c.FormFleet.EquipmentLevelVisibility;
                bool    showAircraftLevelByNumber = c.FormFleet.ShowAircraftLevelByNumber;
                int     fixedShipNameWidth        = c.FormFleet.FixedShipNameWidth;

                for (int i = 0; i < ControlMember.Length; i++)
                {
                    ControlMember[i].Equipments.ShowAircraft = showAircraft;
                    if (fixShipNameWidth)
                    {
                        ControlMember[i].Name.AutoSize = false;
                        ControlMember[i].Name.Size     = new Size(fixedShipNameWidth, 20);
                    }
                    else
                    {
                        ControlMember[i].Name.AutoSize = true;
                    }

                    ControlMember[i].HP.Text = shortHPBar ? "" : "HP:";
                    ControlMember[i].HP.HPBar.ColorMorphing = colorMorphing;
                    ControlMember[i].HP.HPBar.SetBarColorScheme(colorScheme);
                    ControlMember[i].Level.TextNext                         = showNext ? "next:" : null;
                    ControlMember[i].Condition.ImageAlign                   = showConditionIcon ? ContentAlignment.MiddleLeft : ContentAlignment.MiddleCenter;
                    ControlMember[i].Equipments.LevelVisibility             = levelVisibility;
                    ControlMember[i].Equipments.ShowAircraftLevelByNumber   = showAircraftLevelByNumber;
                    ControlMember[i].ShipResource.BarFuel.ColorMorphing     =
                        ControlMember[i].ShipResource.BarAmmo.ColorMorphing = colorMorphing;
                    ControlMember[i].ShipResource.BarFuel.SetBarColorScheme(colorScheme);
                    ControlMember[i].ShipResource.BarAmmo.SetBarColorScheme(colorScheme);

                    ControlMember[i].ConfigurationChanged(this);
                }
            }
            TableMember.PerformLayout();                        //fixme:サイズ変更に親パネルが追随しない
        }
Beispiel #2
0
        void ConfigurationChanged()
        {
            var c = Utility.Configuration.Config;

            MainFont      = Font = c.UI.MainFont;
            SubFont       = c.UI.SubFont;
            BackColor     = Utility.ThemeManager.GetColor(Utility.Configuration.Config.UI.Theme, Utility.ThemeColors.BackgroundColor);
            ForeColor     = Utility.ThemeManager.GetColor(Utility.Configuration.Config.UI.Theme, Utility.ThemeColors.MainFontColor);
            MainFontColor = Utility.ThemeManager.GetColor(Utility.Configuration.Config.UI.Theme, Utility.ThemeColors.MainFontColor);
            SubFontColor  = Utility.ThemeManager.GetColor(Utility.Configuration.Config.UI.Theme, Utility.ThemeColors.SubFontColor);
            AutoScroll    = ContextMenuFleet_IsScrollable.Checked = c.FormFleet.IsScrollable;
            ContextMenuFleet_FixShipNameWidth.Checked = c.FormFleet.FixShipNameWidth;

            if (ControlFleet != null && KCDatabase.Instance.Fleet[FleetID] != null)
            {
                ControlFleet.ConfigurationChanged(this);
                ControlFleet.Update(KCDatabase.Instance.Fleet[FleetID]);
            }

            if (ControlMember != null)
            {
                bool    showAircraft       = c.FormFleet.ShowAircraft;
                bool    fixShipNameWidth   = c.FormFleet.FixShipNameWidth;
                bool    shortHPBar         = c.FormFleet.ShortenHPBar;
                bool    colorMorphing      = c.UI.BarColorMorphing;
                Color[] colorScheme        = c.UI.BarColorScheme.Select(col => col.ColorData).ToArray();
                bool    showNext           = c.FormFleet.ShowNextExp;
                bool    showEquipmentLevel = c.FormFleet.ShowEquipmentLevel;

                for (int i = 0; i < ControlMember.Length; i++)
                {
                    ControlMember[i].Equipments.ShowAircraft = showAircraft;
                    if (fixShipNameWidth)
                    {
                        ControlMember[i].Name.AutoSize = false;
                        ControlMember[i].Name.Size     = new Size(40, 20);
                    }
                    else
                    {
                        ControlMember[i].Name.AutoSize = true;
                    }

                    ControlMember[i].HP.Text = shortHPBar ? "" : "HP:";
                    ControlMember[i].HP.HPBar.ColorMorphing = colorMorphing;
                    ControlMember[i].HP.HPBar.SetBarColorScheme(colorScheme);
                    ControlMember[i].Level.TextNext = showNext ? "next:" : null;
                    ControlMember[i].Equipments.ShowEquipmentLevel          = showEquipmentLevel;
                    ControlMember[i].ShipResource.BarFuel.ColorMorphing     =
                        ControlMember[i].ShipResource.BarAmmo.ColorMorphing = colorMorphing;
                    ControlMember[i].ShipResource.BarFuel.SetBarColorScheme(colorScheme);
                    ControlMember[i].ShipResource.BarAmmo.SetBarColorScheme(colorScheme);

                    ControlMember[i].ConfigurationChanged(this);
                }
            }
            TableMember.PerformLayout();                        //fixme:サイズ変更に親パネルが追随しない
        }
Beispiel #3
0
        void ConfigurationChanged()
        {
            var c = Utility.Configuration.Config;

            MainFont = Font = c.UI.MainFont;
            SubFont  = c.UI.SubFont;

            AutoScroll = ContextMenuFleet_IsScrollable.Checked = c.FormFleet.IsScrollable;
            ContextMenuFleet_FixShipNameWidth.Checked = c.FormFleet.FixShipNameWidth;

            if (ControlFleet != null && KCDatabase.Instance.Fleet[FleetID] != null)
            {
                ControlFleet.Update(KCDatabase.Instance.Fleet[FleetID]);
            }

            if (ControlMember != null)
            {
                bool showAircraft       = c.FormFleet.ShowAircraft;
                bool fixShipNameWidth   = c.FormFleet.FixShipNameWidth;
                bool shortHPBar         = c.FormFleet.ShortenHPBar;
                bool showNext           = c.FormFleet.ShowNextExp;
                bool showEquipmentLevel = c.FormFleet.ShowEquipmentLevel;

                for (int i = 0; i < ControlMember.Length; i++)
                {
                    ControlMember[i].Equipments.ShowAircraft = showAircraft;
                    if (fixShipNameWidth)
                    {
                        ControlMember[i].Name.AutoSize = false;
                        ControlMember[i].Name.Size     = new Size(40, 20);
                    }
                    else
                    {
                        ControlMember[i].Name.AutoSize = true;
                    }

                    ControlMember[i].HP.Text        = shortHPBar ? "" : "HP:";
                    ControlMember[i].Level.TextNext = showNext ? "next:" : null;
                    ControlMember[i].Equipments.ShowEquipmentLevel = showEquipmentLevel;
                }
            }
            TableMember.PerformLayout();                        //fixme:サイズ変更に親パネルが追随しない
        }