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); } 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]); }
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(); } }
private void NextEnemyFleetCandidate(int offset) { if (_enemyFleetCandidate != null && _enemyFleetCandidate.Count != 0) { _enemyFleetCandidateIndex += offset; if (_enemyFleetCandidateIndex < 0) { _enemyFleetCandidateIndex = (_enemyFleetCandidate.Count - 1) - (_enemyFleetCandidate.Count - 1) % _candidatesDisplayCount; } else if (_enemyFleetCandidateIndex >= _enemyFleetCandidate.Count) { _enemyFleetCandidateIndex = 0; } var candidate = _enemyFleetCandidate[_enemyFleetCandidateIndex]; TextEventDetail.Text = TextEnemyFleetName.Text = candidate.FleetName; if (_enemyFleetCandidate.Count > _candidatesDisplayCount) { TextEventDetail.Text += " ▼"; ToolTipInfo.SetToolTip(TextEventDetail, string.Format("候補: {0} / {1}\r\n(左右クリックでページめくり)\r\n", _enemyFleetCandidateIndex + 1, _enemyFleetCandidate.Count)); } else { ToolTipInfo.SetToolTip(TextEventDetail, string.Format("候補: {0}\r\n", _enemyFleetCandidate.Count)); } TableEnemyCandidate.SuspendLayout(); for (int i = 0; i < ControlCandidates.Length; i++) { if (i + _enemyFleetCandidateIndex >= _enemyFleetCandidate.Count || i >= _candidatesDisplayCount) { ControlCandidates[i].Update(null); continue; } ControlCandidates[i].Update(_enemyFleetCandidate[i + _enemyFleetCandidateIndex]); } TableEnemyCandidate.ResumeLayout(); TableEnemyCandidate.Visible = true; PanelEnemyCandidate.Visible = true; } }
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]); }