コード例 #1
0
        public FormCompass(FormMain parent)
        {
            InitializeComponent();


            ConfigurationChanged();

            MainFontColor = Color.FromArgb(0x00, 0x00, 0x00);
            SubFontColor  = Color.FromArgb(0x88, 0x88, 0x88);


            ControlHelper.SetDoubleBuffered(BasePanel);
            ControlHelper.SetDoubleBuffered(TableEnemyFleet);
            ControlHelper.SetDoubleBuffered(TableEnemyMember);


            TableEnemyMember.SuspendLayout();
            ControlMember = new TableEnemyMemberControl[6];
            for (int i = 0; i < ControlMember.Length; i++)
            {
                ControlMember[i] = new TableEnemyMemberControl(this, TableEnemyMember, i);
            }
            TableEnemyMember.ResumeLayout();


            //BasePanel.SetFlowBreak( TextMapArea, true );
            BasePanel.SetFlowBreak(TextDestination, true);
            //BasePanel.SetFlowBreak( TextEventKind, true );
            BasePanel.SetFlowBreak(TextEventDetail, true);

            TextDestination.ImageList = ResourceManager.Instance.Equipments;
            Icon = ResourceManager.ImageToIcon(ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormCompass]);
        }
コード例 #2
0
        private void NextEnemyFleetCandidate(int offset = 1)
        {
            if (_enemyFleetCandidate != null && _enemyFleetCandidate.Count != 0)
            {
                _enemyFleetCandidateIndex = (_enemyFleetCandidateIndex + offset) % _enemyFleetCandidate.Count;
                if (_enemyFleetCandidateIndex < 0)
                {
                    _enemyFleetCandidateIndex += _enemyFleetCandidate.Count;
                }


                var candidate = _enemyFleetCandidate[_enemyFleetCandidateIndex];


                TextEventDetail.Text = string.Format("敵艦隊候補 : {0} / {1}", _enemyFleetCandidateIndex + 1, _enemyFleetCandidate.Count);

                TextEnemyFleetName.Text = candidate.FleetName;
                TextFormation.Text      = Constants.GetFormationShort(candidate.Formation);
                TextAirSuperiority.Text = Calculator.GetAirSuperiority(candidate.FleetMember).ToString();

                TableEnemyMember.SuspendLayout();
                for (int i = 0; i < ControlMember.Length; i++)
                {
                    ControlMember[i].Update(candidate.FleetMember[i]);
                }
                TableEnemyMember.ResumeLayout();

                TextFormation.Visible      = true;
                TextAirSuperiority.Visible = true;
                TableEnemyMember.Visible   = true;


                PanelEnemyFleet.Visible = true;
            }
        }
コード例 #3
0
        void ConfigurationChanged()
        {
            Font    = PanelEnemyFleet.Font = MainFont = Utility.Configuration.Config.UI.MainFont;
            SubFont = Utility.Configuration.Config.UI.SubFont;

            TextMapArea.Font                 =
                TextDestination.Font         =
                    TextEventKind.Font       =
                        TextEventDetail.Font = Font;

            BasePanel.AutoScroll = Utility.Configuration.Config.FormCompass.IsScrollable;

            _candidatesDisplayCount   = Utility.Configuration.Config.FormCompass.CandidateDisplayCount;
            _enemyFleetCandidateIndex = 0;
            if (PanelEnemyCandidate.Visible)
            {
                NextEnemyFleetCandidate(0);
            }

            if (ControlMembers != null)
            {
                TableEnemyMember.SuspendLayout();

                TableEnemyMember.Location = new Point(TableEnemyMember.Location.X, TableEnemyFleet.Bottom + 6);

                bool flag = Utility.Configuration.Config.FormFleet.ShowAircraft;
                for (int i = 0; i < ControlMembers.Length; i++)
                {
                    ControlMembers[i].Equipments.ShowAircraft = flag;
                    ControlMembers[i].ConfigurationChanged();
                }

                ControlHelper.SetTableRowStyles(TableEnemyMember, ControlHelper.GetDefaultRowStyle());
                TableEnemyMember.ResumeLayout();
            }


            if (ControlCandidates != null)
            {
                TableEnemyCandidate.SuspendLayout();

                for (int i = 0; i < ControlCandidates.Length; i++)
                {
                    ControlCandidates[i].ConfigurationChanged();
                }

                ControlHelper.SetTableRowStyles(TableEnemyCandidate, new RowStyle(SizeType.AutoSize));
                ControlHelper.SetTableColumnStyles(TableEnemyCandidate, ControlHelper.GetDefaultColumnStyle());
                TableEnemyCandidate.ResumeLayout();
            }
        }
コード例 #4
0
        public FormCompass(FormMain parent)
        {
            InitializeComponent();



            MainFontColor = Color.FromArgb(0xFF, 0xFF, 0xFF);
            SubFontColor  = Color.FromArgb(0x88, 0x88, 0x88);


            ControlHelper.SetDoubleBuffered(BasePanel);
            ControlHelper.SetDoubleBuffered(TableEnemyFleet);
            ControlHelper.SetDoubleBuffered(TableEnemyMember);


            TableEnemyMember.SuspendLayout();
            ControlMembers = new TableEnemyMemberControl[6];
            for (int i = 0; i < ControlMembers.Length; i++)
            {
                ControlMembers[i] = new TableEnemyMemberControl(this, TableEnemyMember, i);
            }
            TableEnemyMember.ResumeLayout();

            TableEnemyCandidate.SuspendLayout();
            ControlCandidates = new TableEnemyCandidateControl[6];
            for (int i = 0; i < ControlCandidates.Length; i++)
            {
                ControlCandidates[i] = new TableEnemyCandidateControl(this, TableEnemyCandidate, i);
            }
            TableEnemyCandidate.ResumeLayout();


            //BasePanel.SetFlowBreak( TextMapArea, true );
            BasePanel.SetFlowBreak(TextDestination, true);
            //BasePanel.SetFlowBreak( TextEventKind, true );
            BasePanel.SetFlowBreak(TextEventDetail, true);


            TextDestination.ImageList     = ResourceManager.Instance.Equipments;
            TextEventKind.ImageList       = ResourceManager.Instance.Equipments;
            TextEventDetail.ImageList     = ResourceManager.Instance.Equipments;
            TextFormation.ImageList       = ResourceManager.Instance.Icons;
            TextAirSuperiority.ImageList  = ResourceManager.Instance.Equipments;
            TextAirSuperiority.ImageIndex = (int)ResourceManager.EquipmentContent.CarrierBasedFighter;



            ConfigurationChanged();

            Icon = ResourceManager.ImageToIcon(ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormCompass]);
        }
コード例 #5
0
        private void UpdateEnemyFleetInstant()
        {
            BattleManager bm = KCDatabase.Instance.Battle;
            BattleData    bd;

            switch (bm.BattleMode & BattleManager.BattleModes.BattlePhaseMask)
            {
            case BattleManager.BattleModes.NightOnly:
            case BattleManager.BattleModes.NightDay:
                bd = bm.BattleNight;
                break;

            default:
                bd = bm.BattleDay;
                break;
            }

            int[]   enemies    = bd.Initial.EnemyMembers;
            int[][] slots      = bd.Initial.EnemySlots;
            int[]   levels     = bd.Initial.EnemyLevels;
            int[][] parameters = bd.Initial.EnemyParameters;
            int[]   hps        = bd.Initial.MaxHPs;

            TextFormation.Text         = Constants.GetFormationShort((int)bd.Searching.FormationEnemy);
            TextFormation.Visible      = true;
            TextAirSuperiority.Text    = Calculator.GetAirSuperiority(enemies, slots).ToString();
            TextAirSuperiority.Visible = true;

            TableEnemyMember.SuspendLayout();
            for (int i = 0; i < ControlMember.Length; i++)
            {
                int shipID = enemies[i];
                ControlMember[i].Update(shipID, shipID != -1 ? slots[i] : null);

                if (shipID != -1)
                {
                    ControlMember[i].UpdateEquipmentToolTip(shipID, slots[i], levels[i], hps[i + 6], parameters[i][0], parameters[i][1], parameters[i][2], parameters[i][3]);
                }
            }
            TableEnemyMember.ResumeLayout();
            TableEnemyMember.Visible = true;

            PanelEnemyFleet.Visible = true;
            BasePanel.Visible       = true;                             //checkme
        }
コード例 #6
0
        private void UpdateEnemyFleetInstant()
        {
            BattleManager bm = KCDatabase.Instance.Battle;
            BattleData    bd;

            switch (bm.BattleMode & BattleManager.BattleModes.BattlePhaseMask)
            {
            case BattleManager.BattleModes.NightOnly:
            case BattleManager.BattleModes.NightDay:
                bd = bm.BattleNight;
                break;

            default:
                bd = bm.BattleDay;
                break;
            }

            TextFormation.Text         = Constants.GetFormationShort((int)bd.Data.api_formation[1]);
            TextFormation.Visible      = true;
            TextAirSuperiority.Text    = Calculator.GetAirSuperiority(((int[])bd.Data.api_ship_ke).Skip(1).ToArray(), (int[][])bd.Data.api_eSlot).ToString();
            TextAirSuperiority.Visible = true;

            TableEnemyMember.SuspendLayout();
            for (int i = 0; i < ControlMember.Length; i++)
            {
                int shipID = (int)bd.Data.api_ship_ke[i + 1];
                ControlMember[i].Update(shipID, shipID != -1 ? (int[])bd.Data.api_eSlot[i] : null);

                if (shipID != -1)
                {
                    ControlMember[i].UpdateEquipmentToolTip(shipID, (int[])bd.Data.api_eSlot[i], (int)bd.Data.api_ship_lv[i + 1],
                                                            (int)bd.Data.api_eParam[i][0], (int)bd.Data.api_eParam[i][1], (int)bd.Data.api_eParam[i][2], (int)bd.Data.api_eParam[i][3]);
                }
            }
            TableEnemyMember.ResumeLayout();
            TableEnemyMember.Visible = true;

            PanelEnemyFleet.Visible = true;
            BasePanel.Visible       = true;                             //checkme
        }
コード例 #7
0
        private void UpdateEnemyFleet(int fleetID)
        {
            TextEventDetail.Text = string.Format("敵艦隊ID : {0}", fleetID);


            var efleet = RecordManager.Instance.EnemyFleet;

            if (!efleet.Record.ContainsKey(fleetID))
            {
                //unknown
                TextEnemyFleetName.Text    = "(敵艦隊情報不明)";
                TextFormation.Visible      = false;
                TextAirSuperiority.Visible = false;
                TableEnemyMember.Visible   = false;
            }
            else
            {
                var fdata = efleet[fleetID];

                TextEnemyFleetName.Text    = fdata.FleetName;
                TextFormation.Text         = Constants.GetFormationShort(fdata.Formation);
                TextFormation.Visible      = true;
                TextAirSuperiority.Text    = Calculator.GetAirSuperiority(fdata.FleetMember).ToString();
                TextAirSuperiority.Visible = true;

                TableEnemyMember.SuspendLayout();
                for (int i = 0; i < ControlMember.Length; i++)
                {
                    ControlMember[i].Update(fdata.FleetMember[i]);
                }
                TableEnemyMember.ResumeLayout();
                TableEnemyMember.Visible = true;
            }

            PanelEnemyFleet.Visible = true;
        }
コード例 #8
0
        public FormCompass(FormMain parent)
        {
            InitializeComponent();



            MainFontColor = Color.FromArgb(0x00, 0x00, 0x00);
            SubFontColor  = Color.FromArgb(0x88, 0x88, 0x88);


            ControlHelper.SetDoubleBuffered(BasePanel);
            ControlHelper.SetDoubleBuffered(TableEnemyFleet);
            ControlHelper.SetDoubleBuffered(TableEnemyMember);


            TableEnemyMember.SuspendLayout();
            ControlMembers = new TableEnemyMemberControl[6];
            for (int i = 0; i < ControlMembers.Length; i++)
            {
                ControlMembers[i] = new TableEnemyMemberControl(this, TableEnemyMember, i);
            }
            TableEnemyMember.ResumeLayout();

            TableEnemyCandidate.SuspendLayout();
            ControlCandidates = new TableEnemyCandidateControl[6];
            for (int i = 0; i < ControlCandidates.Length; i++)
            {
                ControlCandidates[i] = new TableEnemyCandidateControl(this, TableEnemyCandidate, i);
            }
            //row/column style init
            for (int y = 0; y < TableEnemyCandidate.RowCount; y++)
            {
                var rs = new RowStyle(SizeType.AutoSize);
                if (TableEnemyCandidate.RowStyles.Count <= y)
                {
                    TableEnemyCandidate.RowStyles.Add(rs);
                }
                else
                {
                    TableEnemyCandidate.RowStyles[y] = rs;
                }
            }
            for (int x = 0; x < TableEnemyCandidate.ColumnCount; x++)
            {
                var cs = new ColumnStyle(SizeType.AutoSize);
                if (TableEnemyCandidate.ColumnStyles.Count <= x)
                {
                    TableEnemyCandidate.ColumnStyles.Add(cs);
                }
                else
                {
                    TableEnemyCandidate.ColumnStyles[x] = cs;
                }
            }
            TableEnemyCandidate.ResumeLayout();


            //BasePanel.SetFlowBreak( TextMapArea, true );
            BasePanel.SetFlowBreak(TextDestination, true);
            //BasePanel.SetFlowBreak( TextEventKind, true );
            BasePanel.SetFlowBreak(TextEventDetail, true);


            TextDestination.ImageList     = ResourceManager.Instance.Equipments;
            TextEventKind.ImageList       = ResourceManager.Instance.Equipments;
            TextEventDetail.ImageList     = ResourceManager.Instance.Equipments;
            TextFormation.ImageList       = ResourceManager.Instance.Icons;
            TextAirSuperiority.ImageList  = ResourceManager.Instance.Equipments;
            TextAirSuperiority.ImageIndex = (int)ResourceManager.EquipmentContent.CarrierBasedFighter;



            ConfigurationChanged();

            Icon = ResourceManager.ImageToIcon(ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormCompass]);
        }
コード例 #9
0
        private void UpdateEnemyFleetInstant(bool isPractice = false)
        {
            BattleManager bm = KCDatabase.Instance.Battle;
            BattleData    bd;

            switch (bm.BattleMode & BattleManager.BattleModes.BattlePhaseMask)
            {
            case BattleManager.BattleModes.NightOnly:
            case BattleManager.BattleModes.NightDay:
                bd = bm.BattleNight;
                break;

            default:
                bd = bm.BattleDay;
                break;
            }

            int[]   enemies    = bd.Initial.EnemyMembers;
            int[][] slots      = bd.Initial.EnemySlots;
            int[]   levels     = bd.Initial.EnemyLevels;
            int[][] parameters = bd.Initial.EnemyParameters;
            int[]   hps        = bd.Initial.MaxHPs;


            _enemyFleetCandidate      = null;
            _enemyFleetCandidateIndex = -1;



            if ((bm.BattleMode & BattleManager.BattleModes.BattlePhaseMask) != BattleManager.BattleModes.Practice)
            {
                var efcurrent = EnemyFleetRecord.EnemyFleetElement.CreateFromCurrentState();
                var efrecord  = RecordManager.Instance.EnemyFleet[efcurrent.FleetID];
                if (efrecord != null)
                {
                    TextEnemyFleetName.Text = efrecord.FleetName;
                }
                TextEventDetail.Text = "敵艦隊ID: " + efcurrent.FleetID.ToString("x8");
                ToolTipInfo.SetToolTip(TextEventDetail, null);
            }

            TextFormation.Text = Constants.GetFormationShort((int)bd.Searching.FormationEnemy);
            //TextFormation.ImageIndex = (int)ResourceManager.IconContent.BattleFormationEnemyLineAhead + bd.Searching.FormationEnemy - 1;
            TextFormation.Visible = true;
            {
                int air = Calculator.GetAirSuperiority(enemies, slots);
                TextAirSuperiority.Text = isPractice ?
                                          air.ToString() + " ~ " + Calculator.GetAirSuperiorityAtMaxLevel(enemies, slots).ToString() :
                                          air.ToString();
                ToolTipInfo.SetToolTip(TextAirSuperiority, GetAirSuperiorityString(isPractice ? 0 : air));
                TextAirSuperiority.Visible = true;
            }

            TableEnemyMember.SuspendLayout();
            for (int i = 0; i < ControlMembers.Length; i++)
            {
                int shipID = enemies[i];
                ControlMembers[i].Update(shipID, shipID != -1 ? slots[i] : null);

                if (shipID != -1)
                {
                    ControlMembers[i].UpdateEquipmentToolTip(shipID, slots[i], levels[i], hps[i + 6], parameters[i][0], parameters[i][1], parameters[i][2], parameters[i][3]);
                }
            }
            TableEnemyMember.ResumeLayout();
            TableEnemyMember.Visible = true;

            PanelEnemyFleet.Visible = true;

            PanelEnemyCandidate.Visible = false;

            BasePanel.Visible = true;                                   //checkme
        }
コード例 #10
0
		private void UpdateEnemyFleetInstant(bool isPractice = false)
		{

			BattleManager bm = KCDatabase.Instance.Battle;
			BattleData bd = bm.FirstBattle;

			int[] enemies = bd.Initial.EnemyMembers;
			int[][] slots = bd.Initial.EnemySlots;
			int[] levels = bd.Initial.EnemyLevels;
			int[][] parameters = bd.Initial.EnemyParameters;
			int[] hps = bd.Initial.EnemyMaxHPs;


			_enemyFleetCandidate = null;
			_enemyFleetCandidateIndex = -1;



			if (!bm.IsPractice)
			{
				var efcurrent = EnemyFleetRecord.EnemyFleetElement.CreateFromCurrentState();
				var efrecord = RecordManager.Instance.EnemyFleet[efcurrent.FleetID];
				if (efrecord != null)
				{
					TextEnemyFleetName.Text = efrecord.FleetName;
					TextEnemyFleetName.Font = Utility.Configuration.Config.UI.JapFont;
					TextEventDetail.Text = "Exp: " + efrecord.ExpShip;
				}
				ToolTipInfo.SetToolTip(TextEventDetail, "敌舰队 ID: " + efcurrent.FleetID.ToString("x16"));
			}

			TextFormation.Text = Constants.GetFormationShort((int)bd.Searching.FormationEnemy);
			//TextFormation.ImageIndex = (int)ResourceManager.IconContent.BattleFormationEnemyLineAhead + bd.Searching.FormationEnemy - 1;
			TextFormation.Visible = true;
			{
				int air = Calculator.GetAirSuperiority(enemies, slots);
				TextAirSuperiority.Text = isPractice ?
					air.ToString() + " ~ " + Calculator.GetAirSuperiorityAtMaxLevel(enemies, slots).ToString() :
					air.ToString();
				ToolTipInfo.SetToolTip(TextAirSuperiority, GetAirSuperiorityString(isPractice ? 0 : air));
				TextAirSuperiority.Visible = true;
			}

			TableEnemyMember.SuspendLayout();
			for (int i = 0; i < ControlMembers.Length; i++)
			{
				int shipID = enemies[i];
				ControlMembers[i].Update(shipID, shipID != -1 ? slots[i] : null);

				if (shipID != -1)
					ControlMembers[i].UpdateEquipmentToolTip(shipID, slots[i], levels[i], hps[i], parameters[i][0], parameters[i][1], parameters[i][2], parameters[i][3]);
			}
			TableEnemyMember.ResumeLayout();
			TableEnemyMember.Visible = true;

			PanelEnemyFleet.Visible = true;

			PanelEnemyCandidate.Visible = false;

			BasePanel.Visible = true;           //checkme

		}