コード例 #1
0
 public void ConfigurationChanged(FormFleet parent)
 {
     Name.Font             = parent.MainFont;
     StateMain.Font        = parent.MainFont;
     AirSuperiority.Font   = parent.MainFont;
     AirSuperiority.Font   = parent.MainFont;
     SearchingAbility.Font = parent.MainFont;
 }
コード例 #2
0
            public TableFleetControl(FormFleet parent)
            {
                #region Initialize

                Name           = new Label();
                Name.Text      = "[" + parent.FleetID.ToString() + "]";
                Name.Anchor    = AnchorStyles.Left;
                Name.ForeColor = parent.MainFontColor;
                Name.Padding   = new Padding(0, 1, 0, 1);
                Name.Margin    = new Padding(2, 0, 2, 0);
                Name.AutoSize  = true;
                //Name.Visible = false;
                Name.Cursor = Cursors.Help;

                StateMain           = new ImageLabel();
                StateMain.Anchor    = AnchorStyles.Left;
                StateMain.ForeColor = parent.MainFontColor;
                StateMain.ImageList = ResourceManager.Instance.Icons;
                StateMain.Padding   = new Padding(2, 2, 2, 2);
                StateMain.Margin    = new Padding(2, 0, 2, 0);
                StateMain.AutoSize  = true;

                AirSuperiority            = new ImageLabel();
                AirSuperiority.Anchor     = AnchorStyles.Left;
                AirSuperiority.ForeColor  = parent.MainFontColor;
                AirSuperiority.ImageList  = ResourceManager.Instance.Equipments;
                AirSuperiority.ImageIndex = (int)ResourceManager.EquipmentContent.CarrierBasedFighter;
                AirSuperiority.Padding    = new Padding(2, 2, 2, 2);
                AirSuperiority.Margin     = new Padding(2, 0, 2, 0);
                AirSuperiority.AutoSize   = true;

                SearchingAbility            = new ImageLabel();
                SearchingAbility.Anchor     = AnchorStyles.Left;
                SearchingAbility.ForeColor  = parent.MainFontColor;
                SearchingAbility.ImageList  = ResourceManager.Instance.Equipments;
                SearchingAbility.ImageIndex = (int)ResourceManager.EquipmentContent.CarrierBasedRecon;
                SearchingAbility.Padding    = new Padding(2, 2, 2, 2);
                SearchingAbility.Margin     = new Padding(2, 0, 2, 0);
                SearchingAbility.AutoSize   = true;

                AntiAirPower            = new ImageLabel();
                AntiAirPower.Anchor     = AnchorStyles.Left;
                AntiAirPower.ForeColor  = parent.MainFontColor;
                AntiAirPower.ImageList  = ResourceManager.Instance.Equipments;
                AntiAirPower.ImageIndex = (int)ResourceManager.EquipmentContent.HighAngleGun;
                AntiAirPower.Padding    = new Padding(2, 2, 2, 2);
                AntiAirPower.Margin     = new Padding(2, 0, 2, 0);
                AntiAirPower.AutoSize   = true;


                ConfigurationChanged(parent);

                ToolTipInfo = parent.ToolTipInfo;
                State       = FleetData.FleetStates.NoShip;
                Timer       = DateTime.Now;

                #endregion
            }
コード例 #3
0
 public void ConfigurationChanged(FormFleet parent)
 {
     Name.Font       = parent.MainFont;
     Level.MainFont  = parent.MainFont;
     Level.SubFont   = parent.SubFont;
     HP.MainFont     = parent.MainFont;
     HP.SubFont      = parent.SubFont;
     Condition.Font  = parent.MainFont;
     Equipments.Font = parent.SubFont;
 }
コード例 #4
0
 public void ConfigurationChanged(FormFleet parent)
 {
     Name.Font      = parent.MainFont;
     Level.MainFont = parent.MainFont;
     Level.SubFont  = parent.SubFont;
     HP.MainFont    = parent.MainFont;
     HP.SubFont     = parent.SubFont;
     Condition.Font = parent.MainFont;
     SetConditionDesign((Condition.Tag as int?) ?? 49);
     Equipments.Font = parent.SubFont;
 }
コード例 #5
0
			public TableFleetControl( FormFleet parent ) {

				#region Initialize

				Name = new Label();
				Name.Text = "[" + parent.FleetID.ToString() + "]";
				Name.Anchor = AnchorStyles.Left;
				Name.ForeColor = parent.MainFontColor;
                Name.BackColor = parent.BackColor;
				Name.Padding = new Padding( 0, 1, 0, 1 );
				Name.Margin = new Padding( 2, 0, 2, 0 );
				Name.AutoSize = true;
				//Name.Visible = false;

				StateMain = new ImageLabel();
				StateMain.Anchor = AnchorStyles.Left;
				StateMain.ForeColor = parent.MainFontColor;
                StateMain.BackColor = parent.BackColor;
				StateMain.ImageList = ResourceManager.Instance.Icons;
				StateMain.Padding = new Padding( 2, 2, 2, 2 );
				StateMain.Margin = new Padding( 2, 0, 2, 0 );
				StateMain.AutoSize = true;

				AirSuperiority = new ImageLabel();
				AirSuperiority.Anchor = AnchorStyles.Left;
				AirSuperiority.ForeColor = parent.MainFontColor;
                AirSuperiority.BackColor = parent.BackColor;
				AirSuperiority.ImageList = ResourceManager.Instance.Equipments;
				AirSuperiority.ImageIndex = (int)ResourceManager.EquipmentContent.CarrierBasedFighter;
				AirSuperiority.Padding = new Padding( 2, 2, 2, 2 );
				AirSuperiority.Margin = new Padding( 2, 0, 2, 0 );
				AirSuperiority.AutoSize = true;

				SearchingAbility = new ImageLabel();
				SearchingAbility.Anchor = AnchorStyles.Left;
				SearchingAbility.ForeColor = parent.MainFontColor;
                SearchingAbility.BackColor = parent.BackColor;
				SearchingAbility.ImageList = ResourceManager.Instance.Equipments;
				SearchingAbility.ImageIndex = (int)ResourceManager.EquipmentContent.CarrierBasedRecon;
				SearchingAbility.Padding = new Padding( 2, 2, 2, 2 );
				SearchingAbility.Margin = new Padding( 2, 0, 2, 0 );
				SearchingAbility.AutoSize = true;

				ConfigurationChanged( parent );

				ToolTipInfo = parent.ToolTipInfo;
				State = FleetData.FleetStates.NoShip;
				Timer = DateTime.Now;

				#endregion

			}
コード例 #6
0
		private async void FormMain_Load( object sender, EventArgs e ) {

			if ( !Directory.Exists( "Settings" ) )
				Directory.CreateDirectory( "Settings" );


			Utility.Configuration.Instance.Load( this );


			Utility.Logger.Instance.LogAdded += new Utility.LogAddedEventHandler( ( Utility.Logger.LogData data ) => {
				if ( InvokeRequired ) {
					// Invokeはメッセージキューにジョブを投げて待つので、別のBeginInvokeされたジョブが既にキューにあると、
					// それを実行してしまい、BeginInvokeされたジョブの順番が保てなくなる
					// GUIスレッドによる処理は、順番が重要なことがあるので、GUIスレッドからInvokeを呼び出してはいけない
					Invoke( new Utility.LogAddedEventHandler( Logger_LogAdded ), data );
				} else {
					Logger_LogAdded( data );
				}
			} );
			Utility.Configuration.Instance.ConfigurationChanged += ConfigurationChanged;

			Utility.Logger.Add( 2, SoftwareInformation.SoftwareNameJapanese + " を起動しています…" );


			this.Text = SoftwareInformation.VersionJapanese;

			ResourceManager.Instance.Load();
			RecordManager.Instance.Load();
			KCDatabase.Instance.Load();
			NotifierManager.Instance.Initialize( this );
			SyncBGMPlayer.Instance.ConfigurationChanged();

			#region Icon settings
			Icon = ResourceManager.Instance.AppIcon;

			StripMenu_File_Configuration.Image = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormConfiguration];

			StripMenu_View_Fleet.Image = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormFleet];
			StripMenu_View_FleetOverview.Image = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormFleet];
			StripMenu_View_ShipGroup.Image = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormShipGroup];
			StripMenu_View_Dock.Image = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormDock];
			StripMenu_View_Arsenal.Image = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormArsenal];
			StripMenu_View_Headquarters.Image = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormHeadQuarters];
			StripMenu_View_Quest.Image = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormQuest];
			StripMenu_View_Information.Image = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormInformation];
			StripMenu_View_Compass.Image = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormCompass];
			StripMenu_View_Battle.Image = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormBattle];
			StripMenu_View_Browser.Image = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormBrowser];
			StripMenu_View_Log.Image = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormLog];
			StripMenu_WindowCapture.Image = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormWindowCapture];

			StripMenu_Tool_EquipmentList.Image = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormEquipmentList];
			StripMenu_Tool_DropRecord.Image = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormDropRecord];
			StripMenu_Tool_DevelopmentRecord.Image = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormDevelopmentRecord];
			StripMenu_Tool_ConstructionRecord.Image = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormConstructionRecord];
			StripMenu_Tool_ResourceChart.Image = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormResourceChart];
			StripMenu_Tool_AlbumMasterShip.Image = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormAlbumShip];
			StripMenu_Tool_AlbumMasterEquipment.Image = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormAlbumEquipment];

			StripMenu_Help_Version.Image = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.AppIcon];
			#endregion


			APIObserver.Instance.Start( Utility.Configuration.Config.Connection.Port, this );


			MainDockPanel.Extender.FloatWindowFactory = new CustomFloatWindowFactory();


			SubForms = new List<DockContent>();

			//form init
			//注:一度全てshowしないとイベントを受け取れないので注意	
			fFleet = new FormFleet[4];
			for ( int i = 0; i < fFleet.Length; i++ ) {
				SubForms.Add( fFleet[i] = new FormFleet( this, i + 1 ) );
			}

			SubForms.Add( fDock = new FormDock( this ) );
			SubForms.Add( fArsenal = new FormArsenal( this ) );
			SubForms.Add( fHeadquarters = new FormHeadquarters( this ) );
			SubForms.Add( fInformation = new FormInformation( this ) );
			SubForms.Add( fCompass = new FormCompass( this ) );
			SubForms.Add( fLog = new FormLog( this ) );
			SubForms.Add( fQuest = new FormQuest( this ) );
			SubForms.Add( fBattle = new FormBattle( this ) );
			SubForms.Add( fFleetOverview = new FormFleetOverview( this ) );
			SubForms.Add( fShipGroup = new FormShipGroup( this ) );
			SubForms.Add( fBrowser = new FormBrowserHost( this ) );
			SubForms.Add( fWindowCapture = new FormWindowCapture( this ) );


			ConfigurationChanged();		//設定から初期化

			LoadLayout( Configuration.Config.Life.LayoutFilePath );



			SoftwareInformation.CheckUpdate();

			// デバッグ: 開始時にAPIリストを読み込む
			if ( Configuration.Config.Debug.LoadAPIListOnLoad ) {

				try {

					await Task.Factory.StartNew( () => LoadAPIList( Configuration.Config.Debug.APIListPath ) );

				} catch ( Exception ex ) {

					Utility.Logger.Add( 3, "API読み込みに失敗しました。" + ex.Message );
				}
			}


			// 🎃
			if ( DateTime.Now.Month == 10 && DateTime.Now.Day == 31 ) {
				APIObserver.Instance.APIList["api_port/port"].ResponseReceived += CallPumpkinHead;
			}

			// 完了通知(ログインページを開く)
			fBrowser.InitializeApiCompleted();

			UIUpdateTimer.Start();


			Utility.Logger.Add( 3, "起動処理が完了しました。" );

		}
コード例 #7
0
 public void ConfigurationChanged( FormFleet parent )
 {
     Name.Font = parent.MainFont;
     Level.MainFont = parent.MainFont;
     Level.SubFont = parent.SubFont;
     HP.MainFont = parent.MainFont;
     HP.SubFont = parent.SubFont;
     Condition.Font = parent.MainFont;
     Equipments.Font = parent.SubFont;
 }
コード例 #8
0
            public void Update(int presetID)
            {
                var preset = KCDatabase.Instance.FleetPreset[presetID];

                if (preset == null)
                {
                    Name.Text = "----";
                    _tooltip.SetToolTip(Name, null);

                    foreach (var ship in Ships)
                    {
                        ship.Text = string.Empty;
                        _tooltip.SetToolTip(ship, null);
                    }
                    return;
                }


                Name.Text = preset.Name;

                int lowestCondition = preset.MembersInstance.Select(s => s?.Condition ?? 49).DefaultIfEmpty(49).Min();

                FormFleet.SetConditionDesign(Name, lowestCondition);

                _tooltip.SetToolTip(Name, $"最低cond: {lowestCondition}");

                for (int i = 0; i < Ships.Length; i++)
                {
                    var ship  = i >= preset.Members.Count ? null : preset.MembersInstance.ElementAt(i);
                    var label = Ships[i];

                    Ships[i].Text = ship?.Name ?? "-";

                    if (ship == null)
                    {
                        _tooltip.SetToolTip(Ships[i], null);
                    }
                    else
                    {
                        var sb = new StringBuilder();
                        sb.AppendLine($"{ship.MasterShip.ShipTypeName} {ship.NameWithLevel}");
                        sb.AppendLine($"HP: {ship.HPCurrent} / {ship.HPMax} ({ship.HPRate:p1}) [{Constants.GetDamageState(ship.HPRate)}]");
                        sb.AppendLine($"cond: {ship.Condition}");
                        sb.AppendLine();

                        var slot = ship.AllSlotInstance;
                        for (int e = 0; e < slot.Count; e++)
                        {
                            if (slot[e] == null)
                            {
                                continue;
                            }

                            if (e < ship.MasterShip.Aircraft.Count)
                            {
                                sb.AppendLine($"[{ship.Aircraft[e]}/{ship.MasterShip.Aircraft[e]}] {slot[e].NameWithLevel}");
                            }
                            else
                            {
                                sb.AppendLine(slot[e].NameWithLevel);
                            }
                        }

                        _tooltip.SetToolTip(Ships[i], sb.ToString());
                    }
                }
            }
コード例 #9
0
            public TableMemberControl( FormFleet parent )
            {
                #region Initialize

                Name = new ImageLabel();
                Name.SuspendLayout();
                Name.Text = "*nothing*";
                Name.Anchor = AnchorStyles.Left;
                Name.TextAlign = ContentAlignment.MiddleLeft;
                Name.ImageAlign = ContentAlignment.MiddleCenter;
                Name.ForeColor = parent.MainFontColor;
                Name.Padding = new Padding( 0, 1, 0, 1 );
                Name.Margin = new Padding( 2, 0, 2, 0 );
                Name.AutoSize = true;
                //Name.AutoEllipsis = true;
                Name.Visible = false;
                Name.Cursor = Cursors.Help;
                Name.MouseDown += Name_MouseDown;
                Name.ResumeLayout();

                Level = new ShipStatusLevel();
                Level.SuspendLayout();
                Level.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
                Level.Value = 0;
                Level.MaximumValue = ExpTable.ShipMaximumLevel;
                Level.ValueNext = 0;
                Level.MainFontColor = parent.MainFontColor;
                Level.SubFontColor = parent.SubFontColor;
                //Level.TextNext = "n.";
                Level.Padding = new Padding( 0, 0, 0, 0 );
                Level.Margin = new Padding( 2, 0, 2, 1 );
                Level.AutoSize = true;
                Level.Visible = false;
                Level.ResumeLayout();

                HP = new ShipStatusHP();
                HP.SuspendLayout();
                HP.Anchor = AnchorStyles.Left;
                HP.Value = 0;
                HP.MaximumValue = 0;
                HP.MaximumDigit = 999;
                HP.UsePrevValue = false;
                HP.MainFontColor = parent.MainFontColor;
                HP.SubFontColor = parent.SubFontColor;
                HP.Padding = new Padding( 0, 0, 0, 0 );
                HP.Margin = new Padding( 2, 1, 2, 2 );
                HP.AutoSize = true;
                HP.Visible = false;
                HP.ResumeLayout();

                Condition = new ImageLabel();
                Condition.SuspendLayout();
                Condition.Text = "*";
                Condition.Anchor = AnchorStyles.Left | AnchorStyles.Right;
                Condition.ForeColor = parent.MainFontColor;
                Condition.TextAlign = ContentAlignment.BottomRight;
                Condition.ImageAlign = ContentAlignment.MiddleLeft;
                Condition.ImageList = ResourceManager.Instance.Icons;
                Condition.Padding = new Padding( 2, 2, 2, 2 );
                Condition.Margin = new Padding( 2, 0, 2, 0 );
                Condition.Size = new Size( 40, 20 );
                Condition.AutoSize = true;
                Condition.Visible = false;
                Condition.ResumeLayout();

                ShipResource = new ShipStatusResource( parent.ToolTipInfo );
                ShipResource.SuspendLayout();
                ShipResource.FuelCurrent = 0;
                ShipResource.FuelMax = 0;
                ShipResource.AmmoCurrent = 0;
                ShipResource.AmmoMax = 0;
                ShipResource.Anchor = AnchorStyles.Left;
                ShipResource.Padding = new Padding( 0, 2, 0, 1 );
                ShipResource.Margin = new Padding( 2, 0, 2, 0 );
                ShipResource.Size = new Size( 30, 20 );
                ShipResource.AutoSize = false;
                ShipResource.Visible = false;
                ShipResource.ResumeLayout();

                Equipments = new ShipStatusEquipment();
                Equipments.SuspendLayout();
                Equipments.Anchor = AnchorStyles.Left;
                Equipments.Padding = new Padding( 0, 2, 0, 1 );
                Equipments.Margin = new Padding( 2, 0, 2, 0 );
                Equipments.Size = new Size( 40, 20 );
                Equipments.AutoSize = true;
                Equipments.Visible = false;
                Equipments.ResumeLayout();

                ConfigurationChanged( parent );

                ToolTipInfo = parent.ToolTipInfo;
                Parent = parent;
                #endregion
            }
コード例 #10
0
 public TableMemberControl( FormFleet parent, TableLayoutPanel table, int row )
     : this(parent)
 {
     AddToTable( table, row );
 }
コード例 #11
0
 public TableFleetControl( FormFleet parent, TableLayoutPanel table )
     : this(parent)
 {
     AddToTable( table );
 }
コード例 #12
0
            public void ConfigurationChanged( FormFleet parent )
            {
                Name.Font = parent.MainFont;
                StateMain.Font = parent.MainFont;
                StateMain.BackColor = Color.Transparent;
                AirSuperiority.Font = parent.MainFont;
                AirSuperiority.Font = parent.MainFont;
                SearchingAbility.Font = parent.MainFont;

                DrumCanister.Font = parent.MainFont;
                LandingCraft.Font = parent.MainFont;
                ConditionSparkle.Font = parent.MainFont;
            }
コード例 #13
0
 public TableFleetControl(FormFleet parent, TableLayoutPanel table)
     : this( parent ) {
     AddToTable(table);
 }
コード例 #14
0
		private async void FormMain_Load( object sender, EventArgs e ) {

			Utility.Configuration.Instance.Load();


			Utility.Logger.Instance.LogAdded += new Utility.LogAddedEventHandler( ( Utility.Logger.LogData data ) => {
				if ( InvokeRequired ) {
					// Invokeはメッセージキューにジョブを投げて待つので、別のBeginInvokeされたジョブが既にキューにあると、
					// それを実行してしまい、BeginInvokeされたジョブの順番が保てなくなる
					// GUIスレッドによる処理は、順番が重要なことがあるので、GUIスレッドからInvokeを呼び出してはいけない
					Invoke( new Utility.LogAddedEventHandler( Logger_LogAdded ), data );
				} else {
					Logger_LogAdded( data );
				}
			} );
			Utility.Configuration.Instance.ConfigurationChanged += ConfigurationChanged;

			Utility.Logger.Add( 2, SoftwareInformation.SoftwareNameJapanese + " を起動しています…" );


			this.Text = SoftwareInformation.VersionJapanese;

			ResourceManager.Instance.Load();
			RecordManager.Instance.Load();
			KCDatabase.Instance.Load();
			NotifierManager.Instance.Initialize( this );


			Icon = ResourceManager.Instance.AppIcon;

			APIObserver.Instance.Start( Utility.Configuration.Config.Connection.Port, this );


			MainDockPanel.Extender.FloatWindowFactory = new CustomFloatWindowFactory();


			SubForms = new List<DockContent>();

			//form init
			//注:一度全てshowしないとイベントを受け取れないので注意	
			fFleet = new FormFleet[4];
			for ( int i = 0; i < fFleet.Length; i++ ) {
				SubForms.Add( fFleet[i] = new FormFleet( this, i + 1 ) );
			}

			SubForms.Add( fDock = new FormDock( this ) );
			SubForms.Add( fArsenal = new FormArsenal( this ) );
			SubForms.Add( fHeadquarters = new FormHeadquarters( this ) );
			SubForms.Add( fInformation = new FormInformation( this ) );
			SubForms.Add( fCompass = new FormCompass( this ) );
			SubForms.Add( fLog = new FormLog( this ) );
			SubForms.Add( fQuest = new FormQuest( this ) );
			SubForms.Add( fBattle = new FormBattle( this ) );
			SubForms.Add( fFleetOverview = new FormFleetOverview( this ) );
			SubForms.Add( fShipGroup = new FormShipGroup( this ) );
			SubForms.Add( fBrowser = new FormBrowserHost( this ) );
			SubForms.Add( fWindowCapture = new FormWindowCapture( this ) );

			LoadLayout( Configuration.Config.Life.LayoutFilePath );

			ConfigurationChanged();		//設定から初期化

			SoftwareInformation.CheckUpdate();

			// デバッグ: 開始時にAPIリストを読み込む
			if ( Configuration.Config.Debug.LoadAPIListOnLoad ) {

				try {

					await Task.Factory.StartNew( () => LoadAPIList( Configuration.Config.Debug.APIListPath ) );

				} catch ( Exception ex ) {

					Utility.Logger.Add( 3, "API読み込みに失敗しました。" + ex.Message );
				}
			}

			// 完了通知(ログインページを開く)
			fBrowser.InitializeApiCompleted();

			UIUpdateTimer.Start();

			Utility.Logger.Add( 2, "起動処理が完了しました。" );
		}
コード例 #15
0
 public void ConfigurationChanged( FormFleet parent )
 {
     Name.Font = parent.MainFont;
     StateMain.Font = parent.MainFont;
     AirSuperiority.Font = parent.MainFont;
     AirSuperiority.Font = parent.MainFont;
     SearchingAbility.Font = parent.MainFont;
 }
コード例 #16
0
 public TableMemberControl(FormFleet parent, TableLayoutPanel table, int row)
     : this( parent ) {
     AddToTable(table, row);
 }
コード例 #17
0
            public TableMemberControl(FormFleet parent)
            {
                #region Initialize

                Name = new ImageLabel();
                Name.SuspendLayout();
                Name.Text       = "*nothing*";
                Name.Anchor     = AnchorStyles.Left;
                Name.TextAlign  = ContentAlignment.MiddleLeft;
                Name.ImageAlign = ContentAlignment.MiddleCenter;
                Name.ForeColor  = parent.MainFontColor;
                Name.Padding    = new Padding(0, 1, 0, 1);
                Name.Margin     = new Padding(2, 0, 2, 0);
                Name.AutoSize   = true;
                //Name.AutoEllipsis = true;
                Name.Visible    = false;
                Name.Cursor     = Cursors.Help;
                Name.MouseDown += Name_MouseDown;
                Name.ResumeLayout();

                Level = new ShipStatusLevel();
                Level.SuspendLayout();
                Level.Anchor        = AnchorStyles.Left | AnchorStyles.Bottom;
                Level.Value         = 0;
                Level.MaximumValue  = ExpTable.ShipMaximumLevel;
                Level.ValueNext     = 0;
                Level.MainFontColor = parent.MainFontColor;
                Level.SubFontColor  = parent.SubFontColor;
                //Level.TextNext = "n.";
                Level.Padding  = new Padding(0, 0, 0, 0);
                Level.Margin   = new Padding(2, 0, 2, 1);
                Level.AutoSize = true;
                Level.Visible  = false;
                Level.ResumeLayout();

                HP = new ShipStatusHP();
                HP.SuspendLayout();
                HP.Anchor        = AnchorStyles.Left;
                HP.Value         = 0;
                HP.MaximumValue  = 0;
                HP.MaximumDigit  = 999;
                HP.UsePrevValue  = false;
                HP.MainFontColor = parent.MainFontColor;
                HP.SubFontColor  = parent.SubFontColor;
                HP.Padding       = new Padding(0, 0, 0, 0);
                HP.Margin        = new Padding(2, 1, 2, 2);
                HP.AutoSize      = true;
                HP.Visible       = false;
                HP.ResumeLayout();

                Condition = new ImageLabel();
                Condition.SuspendLayout();
                Condition.Text       = "*";
                Condition.Anchor     = AnchorStyles.Left | AnchorStyles.Right;
                Condition.ForeColor  = parent.MainFontColor;
                Condition.TextAlign  = ContentAlignment.BottomRight;
                Condition.ImageAlign = ContentAlignment.MiddleLeft;
                Condition.ImageList  = ResourceManager.Instance.Icons;
                Condition.Padding    = new Padding(2, 2, 2, 2);
                Condition.Margin     = new Padding(2, 0, 2, 0);
                Condition.Size       = new Size(40, 20);
                Condition.AutoSize   = true;
                Condition.Visible    = false;
                Condition.ResumeLayout();

                ShipResource = new ShipStatusResource(parent.ToolTipInfo);
                ShipResource.SuspendLayout();
                ShipResource.FuelCurrent = 0;
                ShipResource.FuelMax     = 0;
                ShipResource.AmmoCurrent = 0;
                ShipResource.AmmoMax     = 0;
                ShipResource.Anchor      = AnchorStyles.Left;
                ShipResource.Padding     = new Padding(0, 2, 0, 1);
                ShipResource.Margin      = new Padding(2, 0, 2, 0);
                ShipResource.Size        = new Size(30, 20);
                ShipResource.AutoSize    = false;
                ShipResource.Visible     = false;
                ShipResource.ResumeLayout();

                Equipments = new ShipStatusEquipment();
                Equipments.SuspendLayout();
                Equipments.Anchor   = AnchorStyles.Left;
                Equipments.Padding  = new Padding(0, 2, 0, 1);
                Equipments.Margin   = new Padding(2, 0, 2, 0);
                Equipments.Size     = new Size(40, 20);
                Equipments.AutoSize = true;
                Equipments.Visible  = false;
                Equipments.ResumeLayout();

                ConfigurationChanged(parent);

                ToolTipInfo = parent.ToolTipInfo;
                Parent      = parent;
                #endregion
            }
コード例 #18
0
        private async void FormMain_Load(object sender, EventArgs e)
        {
            Utility.Configuration.Instance.Load();


            Utility.Logger.Instance.LogAdded += new Utility.LogAddedEventHandler((Utility.Logger.LogData data) => {
                if (InvokeRequired)
                {
                    // Invokeはメッセージキューにジョブを投げて待つので、別のBeginInvokeされたジョブが既にキューにあると、
                    // それを実行してしまい、BeginInvokeされたジョブの順番が保てなくなる
                    // GUIスレッドによる処理は、順番が重要なことがあるので、GUIスレッドからInvokeを呼び出してはいけない
                    Invoke(new Utility.LogAddedEventHandler(Logger_LogAdded), data);
                }
                else
                {
                    Logger_LogAdded(data);
                }
            });
            Utility.Configuration.Instance.ConfigurationChanged += ConfigurationChanged;

            Utility.Logger.Add(2, SoftwareInformation.SoftwareNameJapanese + " を起動しています…");


            this.Text = SoftwareInformation.VersionJapanese;

            ResourceManager.Instance.Load();
            RecordManager.Instance.Load();
            KCDatabase.Instance.Load();
            NotifierManager.Instance.Initialize(this);


            Icon = ResourceManager.Instance.AppIcon;

            APIObserver.Instance.Start(Utility.Configuration.Config.Connection.Port, this);


            MainDockPanel.Extender.FloatWindowFactory = new CustomFloatWindowFactory();


            SubForms = new List <DockContent>();

            //form init
            //注:一度全てshowしないとイベントを受け取れないので注意
            fFleet = new FormFleet[4];
            for (int i = 0; i < fFleet.Length; i++)
            {
                SubForms.Add(fFleet[i] = new FormFleet(this, i + 1));
            }

            SubForms.Add(fDock          = new FormDock(this));
            SubForms.Add(fArsenal       = new FormArsenal(this));
            SubForms.Add(fHeadquarters  = new FormHeadquarters(this));
            SubForms.Add(fInformation   = new FormInformation(this));
            SubForms.Add(fCompass       = new FormCompass(this));
            SubForms.Add(fLog           = new FormLog(this));
            SubForms.Add(fQuest         = new FormQuest(this));
            SubForms.Add(fBattle        = new FormBattle(this));
            SubForms.Add(fFleetOverview = new FormFleetOverview(this));
            SubForms.Add(fShipGroup     = new FormShipGroup(this));
            SubForms.Add(fBrowser       = new FormBrowserHost(this));
            SubForms.Add(fWindowCapture = new FormWindowCapture(this));

            LoadLayout(Configuration.Config.Life.LayoutFilePath);

            ConfigurationChanged();                     //設定から初期化

            SoftwareInformation.CheckUpdate();

            // デバッグ: 開始時にAPIリストを読み込む
            if (Configuration.Config.Debug.LoadAPIListOnLoad)
            {
                try {
                    await Task.Factory.StartNew(() => LoadAPIList( Configuration.Config.Debug.APIListPath ));
                } catch (Exception ex) {
                    Utility.Logger.Add(3, "API読み込みに失敗しました。" + ex.Message);
                }
            }

            // 完了通知(ログインページを開く)
            fBrowser.InitializeApiCompleted();

            UIUpdateTimer.Start();

            Utility.Logger.Add(2, "起動処理が完了しました。");
        }
コード例 #19
0
        private async void FormMain_Load(object sender, EventArgs e)
        {
            if (!Directory.Exists("Settings"))
            {
                Directory.CreateDirectory("Settings");
            }


            Utility.Configuration.Instance.Load(this);


            Utility.Logger.Instance.LogAdded += new Utility.LogAddedEventHandler((Utility.Logger.LogData data) => {
                if (InvokeRequired)
                {
                    // Invokeはメッセージキューにジョブを投げて待つので、別のBeginInvokeされたジョブが既にキューにあると、
                    // それを実行してしまい、BeginInvokeされたジョブの順番が保てなくなる
                    // GUIスレッドによる処理は、順番が重要なことがあるので、GUIスレッドからInvokeを呼び出してはいけない
                    Invoke(new Utility.LogAddedEventHandler(Logger_LogAdded), data);
                }
                else
                {
                    Logger_LogAdded(data);
                }
            });
            Utility.Configuration.Instance.ConfigurationChanged += ConfigurationChanged;

            Utility.Logger.Add(2, SoftwareInformation.SoftwareNameJapanese + " を起動しています…");


            this.Text = SoftwareInformation.VersionJapanese;

            ResourceManager.Instance.Load();
            RecordManager.Instance.Load();
            KCDatabase.Instance.Load();
            NotifierManager.Instance.Initialize(this);
            SyncBGMPlayer.Instance.ConfigurationChanged();

            #region Icon settings
            Icon = ResourceManager.Instance.AppIcon;

            StripMenu_File_Configuration.Image = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormConfiguration];

            StripMenu_View_Fleet.Image         = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormFleet];
            StripMenu_View_FleetOverview.Image = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormFleet];
            StripMenu_View_ShipGroup.Image     = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormShipGroup];
            StripMenu_View_Dock.Image          = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormDock];
            StripMenu_View_Arsenal.Image       = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormArsenal];
            StripMenu_View_Headquarters.Image  = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormHeadQuarters];
            StripMenu_View_Quest.Image         = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormQuest];
            StripMenu_View_Information.Image   = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormInformation];
            StripMenu_View_Compass.Image       = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormCompass];
            StripMenu_View_Battle.Image        = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormBattle];
            StripMenu_View_Browser.Image       = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormBrowser];
            StripMenu_View_Log.Image           = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormLog];
            StripMenu_WindowCapture.Image      = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormWindowCapture];
            StripMenu_View_BaseAirCorps.Image  = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormBaseAirCorps];
            StripMenu_View_Json.Image          = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormJson];

            StripMenu_Tool_EquipmentList.Image        = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormEquipmentList];
            StripMenu_Tool_DropRecord.Image           = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormDropRecord];
            StripMenu_Tool_DevelopmentRecord.Image    = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormDevelopmentRecord];
            StripMenu_Tool_ConstructionRecord.Image   = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormConstructionRecord];
            StripMenu_Tool_ResourceChart.Image        = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormResourceChart];
            StripMenu_Tool_AlbumMasterShip.Image      = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormAlbumShip];
            StripMenu_Tool_AlbumMasterEquipment.Image = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormAlbumEquipment];

            StripMenu_Help_Version.Image = ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.AppIcon];
            #endregion


            APIObserver.Instance.Start(Utility.Configuration.Config.Connection.Port, this);


            MainDockPanel.Extender.FloatWindowFactory = new CustomFloatWindowFactory();


            SubForms = new List <DockContent>();

            //form init
            //注:一度全てshowしないとイベントを受け取れないので注意
            fFleet = new FormFleet[4];
            for (int i = 0; i < fFleet.Length; i++)
            {
                SubForms.Add(fFleet[i] = new FormFleet(this, i + 1));
            }

            SubForms.Add(fDock          = new FormDock(this));
            SubForms.Add(fArsenal       = new FormArsenal(this));
            SubForms.Add(fHeadquarters  = new FormHeadquarters(this));
            SubForms.Add(fInformation   = new FormInformation(this));
            SubForms.Add(fCompass       = new FormCompass(this));
            SubForms.Add(fLog           = new FormLog(this));
            SubForms.Add(fQuest         = new FormQuest(this));
            SubForms.Add(fBattle        = new FormBattle(this));
            SubForms.Add(fFleetOverview = new FormFleetOverview(this));
            SubForms.Add(fShipGroup     = new FormShipGroup(this));
            SubForms.Add(fBrowser       = new FormBrowserHost(this));
            SubForms.Add(fWindowCapture = new FormWindowCapture(this));
            SubForms.Add(fBaseAirCorps  = new FormBaseAirCorps(this));
            SubForms.Add(fJson          = new FormJson(this));

            ConfigurationChanged();                     //設定から初期化

            LoadLayout(Configuration.Config.Life.LayoutFilePath);



            SoftwareInformation.CheckUpdate();

            // デバッグ: 開始時にAPIリストを読み込む
            if (Configuration.Config.Debug.LoadAPIListOnLoad)
            {
                try {
                    await Task.Factory.StartNew(() => LoadAPIList( Configuration.Config.Debug.APIListPath ));
                } catch (Exception ex) {
                    Utility.Logger.Add(3, "API読み込みに失敗しました。" + ex.Message);
                }
            }

            APIObserver.Instance.ResponseReceived += (a, b) => UpdatePlayTime();


            // 🎃
            if (DateTime.Now.Month == 10 && DateTime.Now.Day == 31)
            {
                APIObserver.Instance.APIList["api_port/port"].ResponseReceived += CallPumpkinHead;
            }

            // 完了通知(ログインページを開く)
            fBrowser.InitializeApiCompleted();

            UIUpdateTimer.Start();


            Utility.Logger.Add(3, "起動処理が完了しました。");
        }