From b04696307d0c6d0df74ea6dc73c03c507ea4d79c Mon Sep 17 00:00:00 2001 From: tsanie Date: Tue, 26 May 2015 16:39:55 +0800 Subject: [PATCH 01/26] support kancolle-db --- ElectronicObserver/ElectronicObserver.csproj | 1 + ElectronicObserver/Observer/APIKancolleDB.cs | 147 ++++++++++++++++++ ElectronicObserver/Observer/APIObserver.cs | 3 + ElectronicObserver/Utility/Configuration.cs | 19 +++ .../Dialog/DialogConfiguration.Designer.cs | 46 ++++++ .../Window/Dialog/DialogConfiguration.cs | 30 ++++ 6 files changed, 246 insertions(+) create mode 100644 ElectronicObserver/Observer/APIKancolleDB.cs diff --git a/ElectronicObserver/ElectronicObserver.csproj b/ElectronicObserver/ElectronicObserver.csproj index 87f29c4d9..041854d07 100644 --- a/ElectronicObserver/ElectronicObserver.csproj +++ b/ElectronicObserver/ElectronicObserver.csproj @@ -155,6 +155,7 @@ + diff --git a/ElectronicObserver/Observer/APIKancolleDB.cs b/ElectronicObserver/Observer/APIKancolleDB.cs new file mode 100644 index 000000000..5701bee4a --- /dev/null +++ b/ElectronicObserver/Observer/APIKancolleDB.cs @@ -0,0 +1,147 @@ +using Fiddler; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using System.Web; + +namespace ElectronicObserver.Observer { + + public class APIKancolleDB { + + public enum APIType : int { + PORT = 0, + SHIP2, + SHIP3, + KDOCK, + CHANGE, + CREATESHIP, + GETSHIP, + CREATEITEM, + START, + NEXT, + BATTLE, + BATTLE_MIDNIGHT, + BATTLE_SP_MIDNIGHT, + BATTLE_NIGHT_TO_DAY, + BATTLERESULT, + PRACTICE_BATTLE, + PRACTICE_BATTLERESULT, + COMBINED_BATTLE, + COMBINED_BATTLE_AIR, + COMBINED_BATTLE_MIDNIGHT, + COMBINED_BATTLE_RESULT + } + + /// + /// all apis + /// + private static readonly Dictionary apis = new Dictionary { + { APIType.PORT, "/kcsapi/api_port/port" }, + { APIType.SHIP2, "/kcsapi/api_get_member/ship2" }, + { APIType.SHIP3, "/kcsapi/api_get_member/ship3" }, + { APIType.KDOCK, "/kcsapi/api_get_member/kdock" }, + { APIType.CHANGE, "/kcsapi/api_req_hensei/change" }, + { APIType.CREATESHIP, "/kcsapi/api_req_kousyou/createship" }, + { APIType.GETSHIP, "/kcsapi/api_req_kousyou/getship" }, + { APIType.CREATEITEM, "/kcsapi/api_req_kousyou/createitem" }, + { APIType.START, "/kcsapi/api_req_map/start" }, + { APIType.NEXT, "/kcsapi/api_req_map/next" }, + { APIType.BATTLE, "/kcsapi/api_req_sortie/battle" }, + { APIType.BATTLE_MIDNIGHT, "/kcsapi/api_req_battle_midnight/battle" }, + { APIType.BATTLE_SP_MIDNIGHT, "/kcsapi/api_req_battle_midnight/sp_midnight" }, + { APIType.BATTLE_NIGHT_TO_DAY, "/kcsapi/api_req_sortie/night_to_day" }, + { APIType.BATTLERESULT, "/kcsapi/api_req_sortie/battleresult" }, + { APIType.PRACTICE_BATTLE, "/kcsapi/api_req_practice/battle" }, + { APIType.PRACTICE_BATTLERESULT, "/kcsapi/api_req_practice/battle_result" }, + { APIType.COMBINED_BATTLE, "/kcsapi/api_req_combined_battle/battle" }, + { APIType.COMBINED_BATTLE_AIR, "/kcsapi/api_req_combined_battle/airbattle" }, + { APIType.COMBINED_BATTLE_MIDNIGHT, "/kcsapi/api_req_combined_battle/midnight_battle"}, + { APIType.COMBINED_BATTLE_RESULT, "/kcsapi/api_req_combined_battle/battleresult" } + }; + + /// + /// read the after-session, determinate whether it will send to kancolle-db.net + /// + /// + public static void ExecuteSession( Session oSession ) { + + if ( !Utility.Configuration.Config.Connection.SendDataToKancolleDB || + Utility.Configuration.Config.Connection.SendKancolleDBApis == 0 || + string.IsNullOrEmpty( Utility.Configuration.Config.Connection.SendKancolleOAuth ) ) { + + return; + } + + // find the url in dict. + string url = oSession.PathAndQuery; + uint apiMask = Utility.Configuration.Config.Connection.SendKancolleDBApis; + + foreach ( var kv in apis ) { + if ( url == kv.Value ) { + + // if we allow to post this api. + if ( ( ( 1 << (int)kv.Key ) & apiMask ) > 0 ) { + + PostToServer( oSession ); + return; + + } + } + } + + } + + private static Regex RequestRegex = new Regex( @"&api(_|%5F)token=[0-9a-f]+|api(_|%5F)token=[0-9a-f]+&?", RegexOptions.Compiled ); + + private static void PostToServer( Session oSession ) { + + string oauth = Utility.Configuration.Config.Connection.SendKancolleOAuth; + string url = oSession.fullUrl; + string request = oSession.GetRequestBodyAsString(); + string response = oSession.GetResponseBodyAsString().Replace( "svdata=", "" ); + + request = RequestRegex.Replace( request, "" ); + + try { + + var req = WebRequest.Create( "http://api.kancolle-db.net/2/" ); + req.Method = "POST"; + req.ContentType = "application/x-www-form-urlencoded"; + + string body = + "token=" + HttpUtility.UrlEncode( oauth ) + "&" + + "agent=&" + + "url=" + HttpUtility.UrlEncode( url ) + "&" + + "requestbody=" + HttpUtility.UrlEncode( request ) + "&" + + "responsebody=" + HttpUtility.UrlEncode( response ); + byte[] data = Encoding.ASCII.GetBytes( body ); + req.ContentLength = data.Length; + + using ( var reqStream = req.GetRequestStream() ) { + reqStream.Write( data, 0, data.Length ); + reqStream.Flush(); + } + + using ( var resp = (HttpWebResponse)req.GetResponse() ) { + using ( var respReader = new StreamReader(resp.GetResponseStream()) ) + using ( var output = new StreamWriter( @"kancolle-db.log", true, Encoding.UTF8 ) ) { + + output.WriteLine( "[{0}] - {1}: {2}", DateTime.Now, resp.StatusCode, respReader.ReadToEnd() ); + + } + } + + } catch ( Exception ex ) { + + Utility.ErrorReporter.SendErrorReport( ex, "kancolle-db.netの送信中にエラーが発生しました。" ); + } + + } + + } +} diff --git a/ElectronicObserver/Observer/APIObserver.cs b/ElectronicObserver/Observer/APIObserver.cs index 6bc3edffa..50f31d24a 100644 --- a/ElectronicObserver/Observer/APIObserver.cs +++ b/ElectronicObserver/Observer/APIObserver.cs @@ -248,6 +248,9 @@ private void FiddlerApplication_AfterSessionComplete( Fiddler.Session oSession ) string body = oSession.GetResponseBodyAsString(); UIControl.BeginInvoke( (Action)( () => { LoadResponse( url, body ); } ) ); + // kancolle-db.netに送信する + Task.Run( (Action)( () => APIKancolleDB.ExecuteSession( oSession ) ) ); + } diff --git a/ElectronicObserver/Utility/Configuration.cs b/ElectronicObserver/Utility/Configuration.cs index e2a6ef63e..d128e22e4 100644 --- a/ElectronicObserver/Utility/Configuration.cs +++ b/ElectronicObserver/Utility/Configuration.cs @@ -110,6 +110,22 @@ public class ConfigConnection : ConfigPartBase { /// public string UpstreamProxyAddress { get; set; } + /// + /// kancolle-db.netに送信する + /// + public bool SendDataToKancolleDB { get; set; } + + /// + /// kancolle-db.netのOAuth認証 + /// + public string SendKancolleOAuth { get; set; } + + /// + /// APIがに送信されます + /// 21 apis which take 21 bits. + /// + public uint SendKancolleDBApis { get; set; } + public ConfigConnection() { Port = 40620; @@ -125,6 +141,9 @@ public ConfigConnection() { UseUpstreamProxy = false; UpstreamProxyPort = 0; UpstreamProxyAddress = "127.0.0.1"; + SendDataToKancolleDB = false; + SendKancolleOAuth = ""; + SendKancolleDBApis = 0x1FFFFF; } } diff --git a/ElectronicObserver/Window/Dialog/DialogConfiguration.Designer.cs b/ElectronicObserver/Window/Dialog/DialogConfiguration.Designer.cs index 9650c4765..26bc4304c 100644 --- a/ElectronicObserver/Window/Dialog/DialogConfiguration.Designer.cs +++ b/ElectronicObserver/Window/Dialog/DialogConfiguration.Designer.cs @@ -26,6 +26,10 @@ private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabPage1 = new System.Windows.Forms.TabPage(); + this.checkedListBoxKdb = new System.Windows.Forms.CheckedListBox(); + this.textBoxKdbToken = new System.Windows.Forms.TextBox(); + this.labelKdb = new System.Windows.Forms.Label(); + this.checkBoxKdb = new System.Windows.Forms.CheckBox(); this.Connection_UpstreamProxyPort = new System.Windows.Forms.NumericUpDown(); this.Connection_UseUpstreamProxy = new System.Windows.Forms.CheckBox(); this.Connection_RegisterAsSystemProxy = new System.Windows.Forms.CheckBox(); @@ -196,6 +200,10 @@ private void InitializeComponent() { // // tabPage1 // + this.tabPage1.Controls.Add(this.checkedListBoxKdb); + this.tabPage1.Controls.Add(this.textBoxKdbToken); + this.tabPage1.Controls.Add(this.labelKdb); + this.tabPage1.Controls.Add(this.checkBoxKdb); this.tabPage1.Controls.Add(this.Connection_UpstreamProxyPort); this.tabPage1.Controls.Add(this.Connection_UseUpstreamProxy); this.tabPage1.Controls.Add(this.Connection_RegisterAsSystemProxy); @@ -213,6 +221,40 @@ private void InitializeComponent() { this.tabPage1.Text = "通信"; this.tabPage1.UseVisualStyleBackColor = true; // + // checkedListBoxKdb + // + this.checkedListBoxKdb.FormattingEnabled = true; + this.checkedListBoxKdb.Location = new System.Drawing.Point(240, 183); + this.checkedListBoxKdb.Name = "checkedListBoxKdb"; + this.checkedListBoxKdb.Size = new System.Drawing.Size(208, 59); + this.checkedListBoxKdb.TabIndex = 12; + // + // textBoxKdbToken + // + this.textBoxKdbToken.Location = new System.Drawing.Point(87, 226); + this.textBoxKdbToken.Name = "textBoxKdbToken"; + this.textBoxKdbToken.Size = new System.Drawing.Size(144, 20); + this.textBoxKdbToken.TabIndex = 11; + // + // labelKdb + // + this.labelKdb.AutoSize = true; + this.labelKdb.Location = new System.Drawing.Point(8, 229); + this.labelKdb.Name = "labelKdb"; + this.labelKdb.Size = new System.Drawing.Size(73, 13); + this.labelKdb.TabIndex = 10; + this.labelKdb.Text = "OAuth認証:"; + // + // checkBoxKdb + // + this.checkBoxKdb.AutoSize = true; + this.checkBoxKdb.Location = new System.Drawing.Point(6, 208); + this.checkBoxKdb.Name = "checkBoxKdb"; + this.checkBoxKdb.Size = new System.Drawing.Size(126, 17); + this.checkBoxKdb.TabIndex = 9; + this.checkBoxKdb.Text = "kancolle-db.netに送信する"; + this.checkBoxKdb.UseVisualStyleBackColor = true; + // // Connection_UpstreamProxyPort // this.Connection_UpstreamProxyPort.Location = new System.Drawing.Point(164, 35); @@ -1615,6 +1657,10 @@ private void InitializeComponent() { private System.Windows.Forms.TabControl tabControl1; private System.Windows.Forms.TabPage tabPage1; + private System.Windows.Forms.CheckedListBox checkedListBoxKdb; + private System.Windows.Forms.TextBox textBoxKdbToken; + private System.Windows.Forms.Label labelKdb; + private System.Windows.Forms.CheckBox checkBoxKdb; private System.Windows.Forms.Label label4; private System.Windows.Forms.Panel Connection_PanelSaveData; private System.Windows.Forms.ToolTip ToolTipInfo; diff --git a/ElectronicObserver/Window/Dialog/DialogConfiguration.cs b/ElectronicObserver/Window/Dialog/DialogConfiguration.cs index 583db0864..45796dad1 100644 --- a/ElectronicObserver/Window/Dialog/DialogConfiguration.cs +++ b/ElectronicObserver/Window/Dialog/DialogConfiguration.cs @@ -112,6 +112,16 @@ private void DialogConfiguration_Load( object sender, EventArgs e ) { this.Icon = ResourceManager.ImageToIcon( ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormConfiguration] ); + checkedListBoxKdb.Items.AddRange( Enum.GetNames( typeof( APIKancolleDB.APIType ) ) ); + // kancolle-db settings + { + uint apiMask = Utility.Configuration.Config.Connection.SendKancolleDBApis; + + for ( int i = 0; i < checkedListBoxKdb.Items.Count; i++ ) { + checkedListBoxKdb.SetItemChecked( i, ( ( ( 1 << i ) & apiMask ) > 0 ) ); + } + } + } private void DialogConfiguration_FormClosed( object sender, FormClosedEventArgs e ) { @@ -268,6 +278,8 @@ public void FromConfiguration( Configuration.ConfigurationData config ) { Connection_RegisterAsSystemProxy.Checked = config.Connection.RegisterAsSystemProxy; Connection_UseUpstreamProxy.Checked = config.Connection.UseUpstreamProxy; Connection_UpstreamProxyPort.Value = config.Connection.UpstreamProxyPort; + checkBoxKdb.Checked = config.Connection.SendDataToKancolleDB; + textBoxKdbToken.Text = config.Connection.SendKancolleOAuth; //[UI] UI_MainFont.Font = config.UI.MainFont.FontData; @@ -400,6 +412,24 @@ public void ToConfiguration( Configuration.ConfigurationData config ) { APIObserver.Instance.Stop(); APIObserver.Instance.Start( config.Connection.Port, this ); } + + // kancolle-db settings + { + config.Connection.SendDataToKancolleDB = checkBoxKdb.Checked; + config.Connection.SendKancolleOAuth = textBoxKdbToken.Text; + + uint apiMask = 0; + for ( int i = checkedListBoxKdb.Items.Count - 1; i >= 0; i-- ) { + + apiMask <<= 1; + + if ( checkedListBoxKdb.GetItemChecked( i ) ) { + apiMask |= 1; + } + } + + config.Connection.SendKancolleDBApis = apiMask; + } } //[UI] From 2fd6b9d64de1716470c252f7ce97f95bca8e69b6 Mon Sep 17 00:00:00 2001 From: tsanie Date: Tue, 26 May 2015 17:24:45 +0800 Subject: [PATCH 02/26] fix format --- ElectronicObserver/Observer/APIKancolleDB.cs | 27 +++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/ElectronicObserver/Observer/APIKancolleDB.cs b/ElectronicObserver/Observer/APIKancolleDB.cs index 5701bee4a..fbe1ce840 100644 --- a/ElectronicObserver/Observer/APIKancolleDB.cs +++ b/ElectronicObserver/Observer/APIKancolleDB.cs @@ -103,22 +103,42 @@ private static void PostToServer( Session oSession ) { string oauth = Utility.Configuration.Config.Connection.SendKancolleOAuth; string url = oSession.fullUrl; string request = oSession.GetRequestBodyAsString(); - string response = oSession.GetResponseBodyAsString().Replace( "svdata=", "" ); + string response = oSession.GetResponseBodyAsString(); request = RequestRegex.Replace( request, "" ); try { + using ( System.Net.WebClient wc = new System.Net.WebClient() ) { + System.Collections.Specialized.NameValueCollection post = new System.Collections.Specialized.NameValueCollection(); + post.Add( "token", oauth ); + post.Add( "agent", "LZXNXVGPejgSnEXLH2ur" ); // TODO: now it means 'KanColleViewer' + post.Add( "url", url ); + post.Add( "requestbody", request ); + post.Add( "responsebody", response ); + + wc.UploadValuesCompleted += ( sender, e ) => { + using ( var output = new StreamWriter( @"kancolle-db.log", true, Encoding.UTF8 ) ) { + + output.WriteLine( "[{0}] - {1}", DateTime.Now, Encoding.UTF8.GetString( e.Result ) ); + + } + }; + + wc.UploadValuesAsync( new Uri( "http://api.kancolle-db.net/2/" ), post ); + } + + /* var req = WebRequest.Create( "http://api.kancolle-db.net/2/" ); req.Method = "POST"; req.ContentType = "application/x-www-form-urlencoded"; string body = "token=" + HttpUtility.UrlEncode( oauth ) + "&" + - "agent=&" + + "agent=LZXNXVGPejgSnEXLH2ur&" + // TODO: now it means 'KanColleViewer' "url=" + HttpUtility.UrlEncode( url ) + "&" + "requestbody=" + HttpUtility.UrlEncode( request ) + "&" + - "responsebody=" + HttpUtility.UrlEncode( response ); + "responsebody=" + HttpUtility.UrlEncode( response.Replace( "svdata=", "" ) ); byte[] data = Encoding.ASCII.GetBytes( body ); req.ContentLength = data.Length; @@ -135,6 +155,7 @@ private static void PostToServer( Session oSession ) { } } + //*/ } catch ( Exception ex ) { From 28aa559ed705ac66519c80d5b25006d6507472ca Mon Sep 17 00:00:00 2001 From: tsanie Date: Wed, 27 May 2015 08:31:46 +0800 Subject: [PATCH 03/26] change agent key --- ElectronicObserver/Observer/APIKancolleDB.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ElectronicObserver/Observer/APIKancolleDB.cs b/ElectronicObserver/Observer/APIKancolleDB.cs index fbe1ce840..f48a08956 100644 --- a/ElectronicObserver/Observer/APIKancolleDB.cs +++ b/ElectronicObserver/Observer/APIKancolleDB.cs @@ -112,7 +112,9 @@ private static void PostToServer( Session oSession ) { using ( System.Net.WebClient wc = new System.Net.WebClient() ) { System.Collections.Specialized.NameValueCollection post = new System.Collections.Specialized.NameValueCollection(); post.Add( "token", oauth ); - post.Add( "agent", "LZXNXVGPejgSnEXLH2ur" ); // TODO: now it means 'KanColleViewer' + // agent key for 'ElectronicObserver' + // https://github.com/about518/kanColleDbPost/issues/3#issuecomment-105534030 + post.Add( "agent", "L57Mi4hJeCYinbbBSH5K" ); post.Add( "url", url ); post.Add( "requestbody", request ); post.Add( "responsebody", response ); @@ -135,7 +137,7 @@ private static void PostToServer( Session oSession ) { string body = "token=" + HttpUtility.UrlEncode( oauth ) + "&" + - "agent=LZXNXVGPejgSnEXLH2ur&" + // TODO: now it means 'KanColleViewer' + "agent=L57Mi4hJeCYinbbBSH5K&" + // agent key for 'ElectronicObserver' "url=" + HttpUtility.UrlEncode( url ) + "&" + "requestbody=" + HttpUtility.UrlEncode( request ) + "&" + "responsebody=" + HttpUtility.UrlEncode( response.Replace( "svdata=", "" ) ); From d896e95892b670c0dd46344cccc5ba2814118718 Mon Sep 17 00:00:00 2001 From: tsanie Date: Wed, 27 May 2015 09:32:55 +0800 Subject: [PATCH 04/26] tiny fix. --- ElectronicObserver/Observer/APIKancolleDB.cs | 19 +++++++++++++------ ElectronicObserver/Observer/APIObserver.cs | 4 +++- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/ElectronicObserver/Observer/APIKancolleDB.cs b/ElectronicObserver/Observer/APIKancolleDB.cs index f48a08956..a47ee337e 100644 --- a/ElectronicObserver/Observer/APIKancolleDB.cs +++ b/ElectronicObserver/Observer/APIKancolleDB.cs @@ -1,4 +1,5 @@ -using Fiddler; +using ElectronicObserver.Utility; +using Fiddler; using System; using System.Collections.Generic; using System.IO; @@ -70,8 +71,7 @@ public enum APIType : int { /// public static void ExecuteSession( Session oSession ) { - if ( !Utility.Configuration.Config.Connection.SendDataToKancolleDB || - Utility.Configuration.Config.Connection.SendKancolleDBApis == 0 || + if ( Utility.Configuration.Config.Connection.SendKancolleDBApis == 0 || string.IsNullOrEmpty( Utility.Configuration.Config.Connection.SendKancolleOAuth ) ) { return; @@ -109,6 +109,7 @@ private static void PostToServer( Session oSession ) { try { + /* using ( System.Net.WebClient wc = new System.Net.WebClient() ) { System.Collections.Specialized.NameValueCollection post = new System.Collections.Specialized.NameValueCollection(); post.Add( "token", oauth ); @@ -129,11 +130,13 @@ private static void PostToServer( Session oSession ) { wc.UploadValuesAsync( new Uri( "http://api.kancolle-db.net/2/" ), post ); } + //*/ - /* - var req = WebRequest.Create( "http://api.kancolle-db.net/2/" ); + //* + var req = (HttpWebRequest)WebRequest.Create( "http://api.kancolle-db.net/2/" ); req.Method = "POST"; req.ContentType = "application/x-www-form-urlencoded"; + req.UserAgent = "ElectronicObserver/v" + SoftwareInformation.VersionEnglish; string body = "token=" + HttpUtility.UrlEncode( oauth ) + "&" + @@ -150,12 +153,16 @@ private static void PostToServer( Session oSession ) { } using ( var resp = (HttpWebResponse)req.GetResponse() ) { + +#if DEBUG using ( var respReader = new StreamReader(resp.GetResponseStream()) ) using ( var output = new StreamWriter( @"kancolle-db.log", true, Encoding.UTF8 ) ) { - output.WriteLine( "[{0}] - {1}: {2}", DateTime.Now, resp.StatusCode, respReader.ReadToEnd() ); + output.WriteLine( "[{0}] - {1}: {2}", DateTime.Now, url, respReader.ReadToEnd() ); } +#endif + Utility.Logger.Add( 1, string.Format( "{0}のデータを送信しました。", url.Substring( url.IndexOf( "kcsapi/" ) + 1 ) ) ); } //*/ diff --git a/ElectronicObserver/Observer/APIObserver.cs b/ElectronicObserver/Observer/APIObserver.cs index 50f31d24a..fc0dbe9cc 100644 --- a/ElectronicObserver/Observer/APIObserver.cs +++ b/ElectronicObserver/Observer/APIObserver.cs @@ -249,7 +249,9 @@ private void FiddlerApplication_AfterSessionComplete( Fiddler.Session oSession ) UIControl.BeginInvoke( (Action)( () => { LoadResponse( url, body ); } ) ); // kancolle-db.netに送信する - Task.Run( (Action)( () => APIKancolleDB.ExecuteSession( oSession ) ) ); + if ( Utility.Configuration.Config.Connection.SendDataToKancolleDB ) { + Task.Run( (Action)( () => APIKancolleDB.ExecuteSession( oSession ) ) ); + } } From f5d17191f39f8fb2501772d4a02eb56b64bf2221 Mon Sep 17 00:00:00 2001 From: tsanie Date: Thu, 28 May 2015 16:14:12 +0800 Subject: [PATCH 05/26] =?UTF-8?q?Http=20417=E3=82=A8=E3=83=A9=E3=83=BC?= =?UTF-8?q?=E3=82=92=E5=9B=9E=E9=81=BF=E3=81=99=E3=82=8B=E3=80=82=E3=81=9D?= =?UTF-8?q?=E3=81=97=E3=81=A6=E3=80=81=E3=83=97=E3=83=AD=E3=82=AD=E3=82=B7?= =?UTF-8?q?=E3=82=92=E4=BD=BF=E7=94=A8=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ElectronicObserver/Observer/APIKancolleDB.cs | 90 ++++++++++---------- ElectronicObserver/Observer/APIObserver.cs | 5 +- 2 files changed, 50 insertions(+), 45 deletions(-) diff --git a/ElectronicObserver/Observer/APIKancolleDB.cs b/ElectronicObserver/Observer/APIKancolleDB.cs index a47ee337e..fc5f89f20 100644 --- a/ElectronicObserver/Observer/APIKancolleDB.cs +++ b/ElectronicObserver/Observer/APIKancolleDB.cs @@ -65,21 +65,45 @@ public enum APIType : int { { APIType.COMBINED_BATTLE_RESULT, "/kcsapi/api_req_combined_battle/battleresult" } }; + public APIKancolleDB() { + + Utility.Configuration.Instance.ConfigurationChanged += ConfigurationChanged; + ConfigurationChanged(); + + // to avoid http 417 error + ServicePointManager.Expect100Continue = false; + + } + + private void ConfigurationChanged() { + SendDBApis = Utility.Configuration.Config.Connection.SendKancolleDBApis; + OAuth = Utility.Configuration.Config.Connection.SendKancolleOAuth; + + if ( Utility.Configuration.Config.Connection.UseUpstreamProxy ) { + Proxy = new WebProxy( "127.0.0.1", Utility.Configuration.Config.Connection.Port ); + }else { + Proxy = null; + } + } + + private uint SendDBApis; + private string OAuth; + private WebProxy Proxy; + + /// /// read the after-session, determinate whether it will send to kancolle-db.net /// /// - public static void ExecuteSession( Session oSession ) { - - if ( Utility.Configuration.Config.Connection.SendKancolleDBApis == 0 || - string.IsNullOrEmpty( Utility.Configuration.Config.Connection.SendKancolleOAuth ) ) { + public void ExecuteSession( Session oSession ) { + if ( SendDBApis == 0 || string.IsNullOrEmpty( OAuth ) ) { return; } // find the url in dict. string url = oSession.PathAndQuery; - uint apiMask = Utility.Configuration.Config.Connection.SendKancolleDBApis; + uint apiMask = SendDBApis; foreach ( var kv in apis ) { if ( url == kv.Value ) { @@ -98,9 +122,9 @@ public static void ExecuteSession( Session oSession ) { private static Regex RequestRegex = new Regex( @"&api(_|%5F)token=[0-9a-f]+|api(_|%5F)token=[0-9a-f]+&?", RegexOptions.Compiled ); - private static void PostToServer( Session oSession ) { + private void PostToServer( Session oSession ) { - string oauth = Utility.Configuration.Config.Connection.SendKancolleOAuth; + string oauth = OAuth; string url = oSession.fullUrl; string request = oSession.GetRequestBodyAsString(); string response = oSession.GetResponseBodyAsString(); @@ -109,8 +133,14 @@ private static void PostToServer( Session oSession ) { try { - /* + //* using ( System.Net.WebClient wc = new System.Net.WebClient() ) { + wc.Headers["User-Agent"] = "ElectronicObserver/v" + SoftwareInformation.VersionEnglish; + + if ( Proxy != null ) { + wc.Proxy = Proxy; + } + System.Collections.Specialized.NameValueCollection post = new System.Collections.Specialized.NameValueCollection(); post.Add( "token", oauth ); // agent key for 'ElectronicObserver' @@ -121,10 +151,16 @@ private static void PostToServer( Session oSession ) { post.Add( "responsebody", response ); wc.UploadValuesCompleted += ( sender, e ) => { - using ( var output = new StreamWriter( @"kancolle-db.log", true, Encoding.UTF8 ) ) { + if ( e.Error != null ) { + using ( var output = new StreamWriter( @"kancolle-db.log", true, Encoding.UTF8 ) ) { - output.WriteLine( "[{0}] - {1}", DateTime.Now, Encoding.UTF8.GetString( e.Result ) ); + output.WriteLine( "[{0}] - {1}: {2}", DateTime.Now, + url.Substring( url.IndexOf( "/api" ) + 1 ), + e.Error ); + } + } else { + Utility.Logger.Add( 1, string.Format( "{0}のデータを送信しました。", url.Substring( url.IndexOf( "/api" ) + 1 ) ) ); } }; @@ -132,40 +168,6 @@ private static void PostToServer( Session oSession ) { } //*/ - //* - var req = (HttpWebRequest)WebRequest.Create( "http://api.kancolle-db.net/2/" ); - req.Method = "POST"; - req.ContentType = "application/x-www-form-urlencoded"; - req.UserAgent = "ElectronicObserver/v" + SoftwareInformation.VersionEnglish; - - string body = - "token=" + HttpUtility.UrlEncode( oauth ) + "&" + - "agent=L57Mi4hJeCYinbbBSH5K&" + // agent key for 'ElectronicObserver' - "url=" + HttpUtility.UrlEncode( url ) + "&" + - "requestbody=" + HttpUtility.UrlEncode( request ) + "&" + - "responsebody=" + HttpUtility.UrlEncode( response.Replace( "svdata=", "" ) ); - byte[] data = Encoding.ASCII.GetBytes( body ); - req.ContentLength = data.Length; - - using ( var reqStream = req.GetRequestStream() ) { - reqStream.Write( data, 0, data.Length ); - reqStream.Flush(); - } - - using ( var resp = (HttpWebResponse)req.GetResponse() ) { - -#if DEBUG - using ( var respReader = new StreamReader(resp.GetResponseStream()) ) - using ( var output = new StreamWriter( @"kancolle-db.log", true, Encoding.UTF8 ) ) { - - output.WriteLine( "[{0}] - {1}: {2}", DateTime.Now, url, respReader.ReadToEnd() ); - - } -#endif - Utility.Logger.Add( 1, string.Format( "{0}のデータを送信しました。", url.Substring( url.IndexOf( "kcsapi/" ) + 1 ) ) ); - } - //*/ - } catch ( Exception ex ) { Utility.ErrorReporter.SendErrorReport( ex, "kancolle-db.netの送信中にエラーが発生しました。" ); diff --git a/ElectronicObserver/Observer/APIObserver.cs b/ElectronicObserver/Observer/APIObserver.cs index fc0dbe9cc..76e243282 100644 --- a/ElectronicObserver/Observer/APIObserver.cs +++ b/ElectronicObserver/Observer/APIObserver.cs @@ -38,6 +38,7 @@ public static APIObserver Instance { public event ProxyStartedEventHandler ProxyStarted = delegate { }; private Control UIControl; + private APIKancolleDB DBSender; private APIObserver() { @@ -101,6 +102,8 @@ private APIObserver() { ServerAddress = null; + DBSender = new APIKancolleDB(); + Fiddler.FiddlerApplication.BeforeRequest += FiddlerApplication_BeforeRequest; Fiddler.FiddlerApplication.BeforeResponse += FiddlerApplication_BeforeResponse; Fiddler.FiddlerApplication.AfterSessionComplete += FiddlerApplication_AfterSessionComplete; @@ -250,7 +253,7 @@ private void FiddlerApplication_AfterSessionComplete( Fiddler.Session oSession ) // kancolle-db.netに送信する if ( Utility.Configuration.Config.Connection.SendDataToKancolleDB ) { - Task.Run( (Action)( () => APIKancolleDB.ExecuteSession( oSession ) ) ); + Task.Run( (Action)( () => DBSender.ExecuteSession( oSession ) ) ); } } From 59a6ed57eafaeacb7c2efafa0034891c195d0864 Mon Sep 17 00:00:00 2001 From: tsanie Date: Fri, 29 May 2015 15:06:19 +0800 Subject: [PATCH 06/26] =?UTF-8?q?WM=5FERASEBKGND=E3=83=A1=E3=83=83?= =?UTF-8?q?=E3=82=BB=E3=83=BC=E3=82=B8=E3=82=92=E7=84=A1=E8=A6=96=E3=81=97?= =?UTF-8?q?=E3=80=81=E3=81=9D=E3=82=8C=E3=81=AB=E3=82=88=E3=81=A3=E3=81=A6?= =?UTF-8?q?=E5=9B=9E=E9=81=BF=E3=81=A1=E3=82=89=E3=81=A4=E3=81=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Browser/FormBrowser.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Browser/FormBrowser.cs b/Browser/FormBrowser.cs index 4b94ad966..e110938a1 100644 --- a/Browser/FormBrowser.cs +++ b/Browser/FormBrowser.cs @@ -715,7 +715,7 @@ private void ToolMenu_Other_NavigateToLogInPage_Click( object sender, EventArgs } private void ToolMenu_Other_Navigate_Click( object sender, EventArgs e ) { - BrowserHost.AsyncRemoteRun( () => BrowserHost.Proxy.RequestNavigation( Browser.Url.ToString() ) ); + BrowserHost.AsyncRemoteRun( () => BrowserHost.Proxy.RequestNavigation( Browser.Url == null ? null : Browser.Url.ToString() ) ); } private void ToolMenu_Other_AppliesStyleSheet_Click( object sender, EventArgs e ) { @@ -855,6 +855,14 @@ private void ToolMenu_Other_Alignment_DropDownOpening( object sender, EventArgs ToolMenu_Other_Alignment_Invisible.Checked = !Configuration.IsToolMenuVisible; } + protected override void WndProc( ref Message m ) { + + if ( m.Msg == WM_ERASEBKGND ) + // ignore this message + return; + + base.WndProc( ref m ); + } #region 呪文 @@ -868,6 +876,7 @@ private void ToolMenu_Other_Alignment_DropDownOpening( object sender, EventArgs private const int GWL_STYLE = ( -16 ); private const uint WS_CHILD = 0x40000000; private const uint WS_VISIBLE = 0x10000000; + private const int WM_ERASEBKGND = 0x14; //以下キャッシュ削除用呪文 From 2fade1998d02bc701a9158273841402f38e9e2e8 Mon Sep 17 00:00:00 2001 From: vanishcrow Date: Sun, 31 May 2015 01:21:30 +0900 Subject: [PATCH 07/26] =?UTF-8?q?ResourceRecord=E3=81=AE=E6=A4=9C=E7=B4=A2?= =?UTF-8?q?=E6=99=82=E3=81=AB=E3=80=81=E6=A4=9C=E7=B4=A2=E6=97=A5=E6=99=82?= =?UTF-8?q?=E3=82=88=E3=82=8A=E3=82=82=EF=BC=91=E3=81=A4=E5=8F=A4=E3=81=84?= =?UTF-8?q?=E3=83=AC=E3=82=B3=E3=83=BC=E3=83=89=E3=82=92=E8=BF=94=E5=8D=B4?= =?UTF-8?q?=E3=81=99=E3=82=8B=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 戦果計算でResourceRecordを検索するとき、指定した検索日時よりも1つ古いレコードを返却する問題を修正しました。 --- ElectronicObserver/Resource/Record/ResourceRecord.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ElectronicObserver/Resource/Record/ResourceRecord.cs b/ElectronicObserver/Resource/Record/ResourceRecord.cs index 7fa827c3c..90d3cb112 100644 --- a/ElectronicObserver/Resource/Record/ResourceRecord.cs +++ b/ElectronicObserver/Resource/Record/ResourceRecord.cs @@ -189,9 +189,14 @@ public ResourceElement GetRecord( DateTime target ) { int i; for ( i = Record.Count - 1; i >= 0; i-- ) { - if ( Record[i].Date < target ) + if ( Record[i].Date < target ) { + i++; break; + } } + // Record内の全ての記録がtarget以降だった + if ( i < 0 ) + i = 0; if ( 0 <= i && i < Record.Count ) { return Record[i]; From b9be54611e9564eb9508fee198e1de968496877f Mon Sep 17 00:00:00 2001 From: vanishcrow Date: Sun, 31 May 2015 21:01:29 +0900 Subject: [PATCH 08/26] =?UTF-8?q?=E8=89=A6=E8=88=B9=E5=9B=B3=E9=91=91?= =?UTF-8?q?=E3=81=AE=E5=8F=97=E4=BF=A1=E8=89=A6=E8=88=B9=E6=95=B070?= =?UTF-8?q?=E9=9A=BB=E3=81=B8=E3=81=AE=E6=8B=A1=E5=BC=B5=E3=81=AB=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2015/5/29のアップデートで、艦船図鑑のページ選択時に受信する艦船が50隻から70隻に拡張されたため対応しました。 --- ElectronicObserver/Window/FormInformation.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ElectronicObserver/Window/FormInformation.cs b/ElectronicObserver/Window/FormInformation.cs index 81a470801..0388b4859 100644 --- a/ElectronicObserver/Window/FormInformation.cs +++ b/ElectronicObserver/Window/FormInformation.cs @@ -121,12 +121,13 @@ private string GetAlbumInfo( dynamic data ) { StringBuilder sb = new StringBuilder(); if ( data.api_list != null ) { - const int bound = 50; - int startIndex = ( ( (int)data.api_list[0].api_index_no - 1 ) / bound ) * bound + 1; - bool[] flags = Enumerable.Repeat( false, bound ).ToArray(); if ( data.api_list[0].api_yomi() ) { //艦娘図鑑 + const int bound = 70; // 図鑑1ページあたりの艦船数 + int startIndex = ( ( (int)data.api_list[0].api_index_no - 1 ) / bound ) * bound + 1; + bool[] flags = Enumerable.Repeat( false, bound ).ToArray(); + sb.AppendLine( "[中破絵未回収]" ); foreach ( dynamic elem in data.api_list ) { @@ -154,6 +155,10 @@ private string GetAlbumInfo( dynamic data ) { } else { //装備図鑑 + const int bound = 50; // 図鑑1ページあたりの装備数 + int startIndex = ( ( (int)data.api_list[0].api_index_no - 1 ) / bound ) * bound + 1; + bool[] flags = Enumerable.Repeat( false, bound ).ToArray(); + foreach ( dynamic elem in data.api_list ) { flags[(int)elem.api_index_no - startIndex] = true; From 03c33667af4b3c026fcdf57a90765839c727dd70 Mon Sep 17 00:00:00 2001 From: brunei_admiral Date: Tue, 26 May 2015 01:17:52 +0900 Subject: [PATCH 09/26] =?UTF-8?q?=E3=81=82=E5=8F=B7=E4=BD=9C=E6=88=A6?= =?UTF-8?q?=E3=81=AE=E9=80=B2=E6=8D=97=E8=A1=A8=E7=A4=BA=E3=81=AE=E8=A9=B3?= =?UTF-8?q?=E7=B4=B0=E3=82=92=E3=80=81=E9=80=B2=E6=8D=97=E3=81=AE=E6=82=AA?= =?UTF-8?q?=E3=81=84=E8=A6=81=E7=B4=A0=E9=A0=86=E3=81=AB=E3=81=97=E3=81=A6?= =?UTF-8?q?=E3=81=BF=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ElectronicObserver/Data/Quest/ProgressAGo.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ElectronicObserver/Data/Quest/ProgressAGo.cs b/ElectronicObserver/Data/Quest/ProgressAGo.cs index ae6d43ee0..5cb451a2d 100644 --- a/ElectronicObserver/Data/Quest/ProgressAGo.cs +++ b/ElectronicObserver/Data/Quest/ProgressAGo.cs @@ -6,6 +6,7 @@ using System.Threading.Tasks; namespace ElectronicObserver.Data.Quest { + using DSPair = KeyValuePair; /// /// 任務「あ号作戦」の進捗を管理します。 @@ -209,14 +210,13 @@ public void IncrementBattle( string rank, bool isBoss ) { public override string ToString() { - return string.Format( "{0:p1} (出撃 {1}/{2}, S勝利 {3}/{4}, ボス {5}/{6}, ボス勝利 {7}/{8})", - ProgressPercentage, - sortieCount, sortieMax, - sWinCount, sWinMax, - bossCount, bossMax, - bossWinCount, bossWinMax ); + var list = new List(); + list.Add( new DSPair( Math.Min((double)sortieCount / sortieMax, 1.0 ), string.Format( "出撃 {0}/{1}", sortieCount, sortieMax ) ) ); + list.Add( new DSPair( Math.Min((double)sWinCount / sWinMax, 1.0 ), string.Format( "S勝利 {0}/{1}", sWinCount, sWinMax ) ) ); + list.Add( new DSPair( Math.Min((double)bossCount / bossMax, 1.0 ), string.Format( "ボス {0}/{1}", bossCount, bossMax ) ) ); + list.Add( new DSPair( Math.Min((double)bossWinCount / bossWinMax, 1.0 ), string.Format( "ボス勝利 {0}/{1}", bossWinCount, bossWinMax ) ) ); + return string.Format( "{0:p1} ({1})", ProgressPercentage, string.Join( ", ", list.OrderBy( elem => elem.Key ).Select( elem => elem.Value ) ) ); } - } } From e023299c837a8bec4bd0471beae7e66ebc4e96b9 Mon Sep 17 00:00:00 2001 From: Andante Date: Tue, 2 Jun 2015 11:13:47 +0900 Subject: [PATCH 10/26] =?UTF-8?q?=E8=B3=87=E6=BA=90=E3=83=81=E3=83=A3?= =?UTF-8?q?=E3=83=BC=E3=83=88=E3=81=AE=E8=BF=BD=E5=8A=A0(=E5=BB=BA?= =?UTF-8?q?=E9=80=A0=E4=B8=AD)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ElectronicObserver/ElectronicObserver.csproj | 10 + .../Other/Information/apilist.txt | 13 +- .../Other/Information/kcmemo.md | 125 ++++++- .../Dialog/DialogLocalAPILoader2.Designer.cs | 116 +++---- .../Window/Dialog/DialogLocalAPILoader2.cs | 4 +- .../Window/Dialog/DialogLocalAPILoader2.resx | 2 +- .../Dialog/DialogResourceChart.Designer.cs | 113 +++++++ .../Window/Dialog/DialogResourceChart.cs | 265 +++++++++++++++ .../Window/Dialog/DialogResourceChart.resx | 123 +++++++ .../Window/FormMain.Designer.cs | 314 ++++++++++-------- ElectronicObserver/Window/FormMain.cs | 6 + 11 files changed, 865 insertions(+), 226 deletions(-) create mode 100644 ElectronicObserver/Window/Dialog/DialogResourceChart.Designer.cs create mode 100644 ElectronicObserver/Window/Dialog/DialogResourceChart.cs create mode 100644 ElectronicObserver/Window/Dialog/DialogResourceChart.resx diff --git a/ElectronicObserver/ElectronicObserver.csproj b/ElectronicObserver/ElectronicObserver.csproj index 87f29c4d9..1838b0d34 100644 --- a/ElectronicObserver/ElectronicObserver.csproj +++ b/ElectronicObserver/ElectronicObserver.csproj @@ -73,6 +73,7 @@ + @@ -328,6 +329,12 @@ DialogNotifier.cs + + Form + + + DialogResourceChart.cs + Form @@ -519,6 +526,9 @@ DialogNotifier.cs + + DialogResourceChart.cs + DialogShipGroupColumnFilter.cs diff --git a/ElectronicObserver/Other/Information/apilist.txt b/ElectronicObserver/Other/Information/apilist.txt index 9adf37992..14e1dd5f8 100644 --- a/ElectronicObserver/Other/Information/apilist.txt +++ b/ElectronicObserver/Other/Information/apilist.txt @@ -224,6 +224,7 @@ api_start2 :艦娘・装備固有データその他 39=水上艦要員 40=大型ソナー 41=大型飛行艇 + 42=大型探照灯 [3]:アイコンID 1=小口径主砲 @@ -711,14 +712,14 @@ api_get_member/questlist :任務 api_list :任務一覧 存在しないエリアはオブジェクトではなく-1になる; 任務完遂時, ページ遷移時はnull api_no :任務ID api_category :任務カテゴリ 1=編成, 2=出撃, 3=演習, 4=遠征, 5=補給/入渠, 6=工廠, 7=改装, 8=その他? - api_type :任務出現タイプ? 1=一回限り, 2=デイリー, 3=ウィークリー, 4=敵空母を3隻撃沈せよ!(日付下一桁0|3|7), 5=敵輸送船団を叩け!(日付下一桁2|8), 6=マンスリー + api_type :任務出現タイプ 1=一回限り, 2=デイリー, 3=ウィークリー, 4=敵空母を3隻撃沈せよ!(日付下一桁0|3|7), 5=敵輸送船団を叩け!(日付下一桁2|8), 6=マンスリー api_state :状態 1=未受領, 2=遂行中, 3=達成 api_title :タイトル api_detail :説明 api_get_material :獲得資材 - api_bonus_flag :1=通常, 2=艦娘? - api_progress_flag :進捗 0=空白(達成含む), 1=50%以上達成, 2=80%以上達成? - api_invalid_flag : + api_bonus_flag :1=通常, 2=艦娘 + api_progress_flag :進捗 0=空白(達成含む), 1=50%以上達成, 2=80%以上達成 + api_invalid_flag :機種転換不能フラグ? api_exec_count :受領任務数 api_exec_type :? @@ -756,7 +757,7 @@ Request.api_get_member/picture_book :図鑑 api_no :ページ api_get_member/picture_book :艦船図鑑 図鑑登録済みのもののみ送られてくるので注意 - api_list :リスト + api_list :リスト 登録艦が0隻の場合は存在しない(api_data=nullになる) api_index_no :図鑑No. api_state :取得フラグ? 二重配列になっており、未改造・改造後が同じ項目で登録されている艦娘は以下データが2つ(以上)存在する @@ -1270,7 +1271,7 @@ api_req_sortie/battleresult :戦闘結果 api_get_exmap_useitem_id:EO海域攻略時:取得アイテムID(文字列) "57"=勲章 それ以外は0(数値) -api_get_member/ship2 :進撃中 2015/05/18廃止? +api_get_member/ship2 :旧進撃中(現在はケッコンカッコカリ・給糧艦使用(未確認)のみだと思われる) api_data :portに同じ api_data_deck :deckに同じ diff --git a/ElectronicObserver/Other/Information/kcmemo.md b/ElectronicObserver/Other/Information/kcmemo.md index 41b2ca661..8bddde1a2 100644 --- a/ElectronicObserver/Other/Information/kcmemo.md +++ b/ElectronicObserver/Other/Information/kcmemo.md @@ -84,6 +84,14 @@ value = min + ceil( ( max - min ) * ( 0.4 or 0.8 ) * Lv / 99 ) #### ダメコン処理の優先度 ダメコンの種類にかかわらず、スロットの上にあるほうから使われる。   +#### 探照灯の優先度 +発動条件(HP>1)を満たす艦が複数いた場合は、 + +* (大型探照灯>探照灯)>旗艦に近いほう + +の優先度で発動させる(1隻のみ)。 +条件を満たしていれば確実に発動するため、戦闘APIに対応する値は存在しない。 + #### 挟叉 命中フラグは以下のようになっている。 @@ -190,9 +198,15 @@ else 攻撃種別 = 0(砲撃); * 11:高角砲/集中機銃 * 12:集中機銃/機銃/電探 - (個艦については)固有優先、他はID昇順優先で判定される? +(個艦については)固有優先、他はID昇順優先で判定される? なお、1-3は秋月(改)専用、10-11は摩耶改二専用。 -秋月(改)のみ対空電探でなくても可。 +秋月(改)のみ対空電探(対空値が1以上の電探)でなくても可。 + +以下の装備は「高角砲+高射装置」として扱われる: + +* 122 : 10cm連装高角砲+高射装置 +* 130 : 12.7cm高角砲+高射装置 +* 135 : 90mm単装高角砲 #### 敵ボイス `areaID` `mapNo` `index` `shipID` @@ -207,11 +221,10 @@ else 攻撃種別 = 0(砲撃); #### 夜戦魚雷連撃 一応実装されているらしい。 -連撃フラグが立っており、かつ攻撃表示装備[0]が主砲/副砲( EquipmentType[1] == ( 1 | 2 ) )でないときに発動する。 +連撃フラグが立っており、かつ攻撃表示装備[0]が( 小口径主砲/中口径主砲/大口径主砲/大口径主砲(II)/副砲 )でないときに発動する。 そういったデータが送られてくることはないので通常の手段では見ることはできない。 #### 対空能力の優先度? - ある部分で使われている処理。何かの助けになるかもしれない ``` @@ -341,11 +354,12 @@ C敗北判定の 敵損害率 >= 50 は試験実装。 * E-6 : 3405 (旗艦HP500; 最低7回撃破) #### 海域HPゲージ -わずかでもダメージを与えないと正常な値にならない。 -(ex. 初期は300/300でも、30ダメージ与えると2370/2400になる、など) -と思ったが、最大HPが1000以上だと正しく取得できる? -'15冬イベ以前は初期値300、'15冬イベ以降は9999 -'15春イベでは難易度を選択した時点で決定される? +* わずかでもダメージを与えないと正常な値にならない。 + (ex. 初期は300/300でも、30ダメージ与えると2370/2400になる、など) + 最大HPが1000以上だと正しく取得できる? +* '15冬イベ以前は初期値300、'15冬イベ以降は9999 +* '15春イベでは難易度を選択した時点で決定される? +* '15春イベにて、司令部Lvによって海域HPが変化する仕様が確認されている。 #### 猫った時のAPIレスポンス 練習巡洋艦旗艦で開発すると落ちる不具合を利用したもの。(2015/02/08) @@ -434,10 +448,18 @@ Bismarck dreiに対する魚雷装備・試製51cm連装砲といったものの #### EnemySlotItemImage -敵艦装備グラフィックの置換処理?@commonAssets -550(ツ級砲)は10cm連装高角砲、551(戦艦水鬼砲)は試製51cm連装砲になる? +CommonAssetsに存在する、敵艦装備グラフィックの置換処理らしきもの。 + +敵艦装備のグラフィックはカットイン発動時に確認することができるが、特に指定のない場合 `EquipmentID-500` 、すなわちIDインデックスの同じ味方側装備が表示される。 +(ex. 507: 14inch連装砲 = 7 : 35.6cm連装砲) +しかし、以下の装備は特定の装備グラフィックを持つよう指定されている(ように見える)。 -なお、上記のような特別指定がない限り、id-500(味方装備)のグラフィックが用いられる。 +|装備ID|装備名|置換装備ID|置換装備名| +|--:|:--|--:|:--| +|550|5inch連装両用莢砲|3|10cm連装高角砲| +|551|20inch連装砲|128|試製51cm連装砲| + +なお、2015/05/30現在これらを装備している艦はカットイン攻撃を行わないため、実際に確認することはできない。 #### オンメンテで実装された艦娘の扱い @@ -541,3 +563,82 @@ Bismarck dreiに対する魚雷装備・試製51cm連装砲といったものの この不具合があるため、第二艦隊五番艦と六番艦は退避発動中は経験値を得ることができない。4隻以上退避した場合は未確認であるが、同様に経験値の不審な増減が発生するものと思われる。 育成においては注意が必要である。 +なお、連合艦隊でなくても轟沈艦が存在した場合に同様の現象が起こる、との噂がある。 + + +#### 演習経験値バグ + +演習で撃沈判定を受けた艦娘の経験値が減少するバグ。 + +上記経験値バグの検証の一環で、演習で撃沈判定を発生させて実験してみたところ、上に挙げたような経験値のずれは確認されなかった。 +しかし、撃沈判定を受けた艦の累積取得経験値が -1 されるという現象が発生した(戦闘結果での表示上は `+ 0 exp`)。 +確かに戦闘結果のAPIの取得経験値の項目は -1 になっていたが、直接適用されたのは予想外。 + +Lv. 99の艦を以上の状態におき経験値を -1 させたところ、 Lv. 99 / 999999 exp. / next. 0 になった。 +この状態で別の戦闘を行ったところ、「次のレベルまで」は何も表示されなかった(通常のLv99と同じ扱い)が、実経験値は 1000000 exp.に戻っていた。 +exp を -1 した状態でもケッコンカッコカリを行うことができる。この場合は、 Lv. 100 / 999999 exp. / next. 10001 となった。 +また、Lv. 1 / 0 exp. / next. 100 の状態でこの現象を発生させたところ、 Lv. 1 / -1 exp. / next. 101 となった。 + +> 注: 経験値0の大破艦は、単艦で5-5に出撃した後戦闘結果を見る前に再読み込みすると入手することができる。 + +以上をまとめるとこのようになる。 + +* 演習で撃沈判定を受けると累積経験値が -1 される +* これによってレベルが下がる・レベルが上げられなくなる・ケッコンできなくなるといったことはない +* 減少した経験値はLv99でも(おそらくLv150でも)上限まで再入手できる +* Lv99で減少した経験値はケッコン後も引き継がれる(100万に補正されない) +* 累積経験値は負値にすることができる + +これによって何らかの不具合が出るかは未確認。 +経験値計算に艦の累積経験値を利用しているらしい演習において、経験値が負値の艦隊と演習したらどうなるのだろうか… + +#### MVPの優先度 + +``` +与ダメージ > 後に攻撃したほう > 6番艦に近いほう +``` + +と推測している。確認中である。 +与ダメージが同じ場合の判定では、少なくとも、 + +* 先に攻撃したほう +* 旗艦に近いほう +* 6番艦に近いほう + +については反例が存在する。 + +与ダメージが同じ場合の判定をこのように推測した理由を以下に示す。 +オリョクル時には6番艦側の艦がMVPを取っている。 +オリョクル(潜水艦のみの編成/昼戦のみ)の場合はダメージソースが雷撃戦のみであり、雷撃戦には攻撃順が存在しない。 +そのため、そのような場合には6番艦側が優先されると推測する。 +ただこれには反例が存在し、水上艦隊では旗艦に近い側の艦もMVPを取ることがあるという情報がある。 +よって、条件はこれだけでは不足であることが分かる。 +このことから、「後から攻撃したほう」という条件が存在し(「先に攻撃したほう」については反例があるため)、このほうが優先度が高いのではないか、と推測した。 + +また、MVPになる条件として「与ダメージが1以上」が存在する。D敗北以上の判定で条件を満たす艦が1隻も存在しない場合(全員の与ダメージが0の場合)、後続条件にかかわらず旗艦がMVPとなる。 + +#### 突然の入渠API + +2015/05/28(暁改二アップデート前日)、シーンにかかわらず(図鑑や出撃・戦闘中ですら)突然入渠APIが呼び出される現象が発生した。 +タイミングとしては「入渠中の艦の待ち時間が00:00:00になった瞬間」である。[画面下部の通信プログレスバー(?)が表示されたため](https://twitter.com/andanteyk/status/603934695819083777/photo/1)、正規クライアントによる通信であることは明らかである。 +起動直後は発生せず、しばらく経過すると発生していた。特定の操作をトリガーにしていた可能性がある。 +なお、その際「2回連続でndockリクエストを送る」現象も確認されている。例えば、 + +``` +battle.request +battle.response +ndock.request +ndock.request +ndock.response +ndock.response +battleresult.request +battleresult.response +``` + +といった通信が行われていたことを確認している。 +時間経過とともに通信回数が増える(最初は0回(発生しない)→1回→2回(上記))。 +このような冗長な通信を正規に行うとは考えにくいため、クライアントに何らかの不具合が発生しているものと推察される。 +通信中はUI操作がブロックされるため、地味に厄介。 + +[twitter](https://twitter.com/RizaSTAR/status/601763671119831041)にて、5/22時点ですでに発生していたらしき報告有。 + diff --git a/ElectronicObserver/Window/Dialog/DialogLocalAPILoader2.Designer.cs b/ElectronicObserver/Window/Dialog/DialogLocalAPILoader2.Designer.cs index 017c0ce8a..d8c375a95 100644 --- a/ElectronicObserver/Window/Dialog/DialogLocalAPILoader2.Designer.cs +++ b/ElectronicObserver/Window/Dialog/DialogLocalAPILoader2.Designer.cs @@ -26,22 +26,22 @@ private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.APIView = new System.Windows.Forms.DataGridView(); this.APIView_FileName = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components); - this.ContextMenu_Execute = new System.Windows.Forms.ToolStripMenuItem(); - this.ContextMenu_Delete = new System.Windows.Forms.ToolStripMenuItem(); + this.ViewMenu = new System.Windows.Forms.ContextMenuStrip(this.components); + this.ViewMenu_Execute = new System.Windows.Forms.ToolStripMenuItem(); + this.ViewMenu_Delete = new System.Windows.Forms.ToolStripMenuItem(); this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.Menu_File = new System.Windows.Forms.ToolStripMenuItem(); this.Menu_File_OpenFolder = new System.Windows.Forms.ToolStripMenuItem(); + this.Menu_File_Reload = new System.Windows.Forms.ToolStripMenuItem(); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.ButtonSearch = new System.Windows.Forms.Button(); + this.TextFilter = new System.Windows.Forms.TextBox(); this.ButtonExecuteNext = new System.Windows.Forms.Button(); this.ButtonExecute = new System.Windows.Forms.Button(); this.FolderBrowser = new System.Windows.Forms.FolderBrowserDialog(); this.APICaller = new System.ComponentModel.BackgroundWorker(); - this.Menu_File_Reload = new System.Windows.Forms.ToolStripMenuItem(); - this.TextFilter = new System.Windows.Forms.TextBox(); - this.ButtonSearch = new System.Windows.Forms.Button(); ((System.ComponentModel.ISupportInitialize)(this.APIView)).BeginInit(); - this.ContextMenu.SuspendLayout(); + this.ViewMenu.SuspendLayout(); this.menuStrip1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); @@ -57,7 +57,7 @@ private void InitializeComponent() { this.APIView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.APIView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.APIView_FileName}); - this.APIView.ContextMenuStrip = this.ContextMenu; + this.APIView.ContextMenuStrip = this.ViewMenu; this.APIView.Dock = System.Windows.Forms.DockStyle.Fill; this.APIView.Location = new System.Drawing.Point(0, 0); this.APIView.Name = "APIView"; @@ -76,29 +76,29 @@ private void InitializeComponent() { this.APIView_FileName.ReadOnly = true; this.APIView_FileName.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; // - // ContextMenu + // ViewMenu // - this.ContextMenu.ImageScalingSize = new System.Drawing.Size(32, 32); - this.ContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.ContextMenu_Execute, - this.ContextMenu_Delete}); - this.ContextMenu.Name = "ContextMenu"; - this.ContextMenu.Size = new System.Drawing.Size(226, 72); + this.ViewMenu.ImageScalingSize = new System.Drawing.Size(32, 32); + this.ViewMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.ViewMenu_Execute, + this.ViewMenu_Delete}); + this.ViewMenu.Name = "ContextMenu"; + this.ViewMenu.Size = new System.Drawing.Size(226, 72); // - // ContextMenu_Execute + // ViewMenu_Execute // - this.ContextMenu_Execute.Name = "ContextMenu_Execute"; - this.ContextMenu_Execute.Size = new System.Drawing.Size(225, 34); - this.ContextMenu_Execute.Text = "実行(&E)"; - this.ContextMenu_Execute.Click += new System.EventHandler(this.ContextMenu_Execute_Click); + this.ViewMenu_Execute.Name = "ViewMenu_Execute"; + this.ViewMenu_Execute.Size = new System.Drawing.Size(225, 34); + this.ViewMenu_Execute.Text = "実行(&E)"; + this.ViewMenu_Execute.Click += new System.EventHandler(this.ViewMenu_Execute_Click); // - // ContextMenu_Delete + // ViewMenu_Delete // - this.ContextMenu_Delete.Name = "ContextMenu_Delete"; - this.ContextMenu_Delete.ShortcutKeys = System.Windows.Forms.Keys.Delete; - this.ContextMenu_Delete.Size = new System.Drawing.Size(225, 34); - this.ContextMenu_Delete.Text = "削除(&D)"; - this.ContextMenu_Delete.Click += new System.EventHandler(this.ContextMenu_Delete_Click); + this.ViewMenu_Delete.Name = "ViewMenu_Delete"; + this.ViewMenu_Delete.ShortcutKeys = System.Windows.Forms.Keys.Delete; + this.ViewMenu_Delete.Size = new System.Drawing.Size(225, 34); + this.ViewMenu_Delete.Text = "削除(&D)"; + this.ViewMenu_Delete.Click += new System.EventHandler(this.ViewMenu_Delete_Click); // // menuStrip1 // @@ -127,6 +127,13 @@ private void InitializeComponent() { this.Menu_File_OpenFolder.Text = "フォルダを開く(&O)..."; this.Menu_File_OpenFolder.Click += new System.EventHandler(this.Menu_File_OpenFolder_Click); // + // Menu_File_Reload + // + this.Menu_File_Reload.Name = "Menu_File_Reload"; + this.Menu_File_Reload.Size = new System.Drawing.Size(273, 34); + this.Menu_File_Reload.Text = "再読み込み(&R)"; + this.Menu_File_Reload.Click += new System.EventHandler(this.Menu_File_Reload_Click); + // // splitContainer1 // this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; @@ -148,6 +155,26 @@ private void InitializeComponent() { this.splitContainer1.SplitterDistance = 320; this.splitContainer1.TabIndex = 2; // + // ButtonSearch + // + this.ButtonSearch.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.ButtonSearch.Location = new System.Drawing.Point(537, 31); + this.ButtonSearch.Name = "ButtonSearch"; + this.ButtonSearch.Size = new System.Drawing.Size(75, 23); + this.ButtonSearch.TabIndex = 3; + this.ButtonSearch.Text = "検索"; + this.ButtonSearch.UseVisualStyleBackColor = true; + this.ButtonSearch.Click += new System.EventHandler(this.ButtonSearch_Click); + // + // TextFilter + // + this.TextFilter.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.TextFilter.Location = new System.Drawing.Point(12, 32); + this.TextFilter.Name = "TextFilter"; + this.TextFilter.Size = new System.Drawing.Size(519, 23); + this.TextFilter.TabIndex = 2; + // // ButtonExecuteNext // this.ButtonExecuteNext.Location = new System.Drawing.Point(93, 3); @@ -166,40 +193,13 @@ private void InitializeComponent() { this.ButtonExecute.TabIndex = 0; this.ButtonExecute.Text = "実行"; this.ButtonExecute.UseVisualStyleBackColor = true; - this.ButtonExecute.Click += new System.EventHandler(this.ContextMenu_Execute_Click); + this.ButtonExecute.Click += new System.EventHandler(this.ViewMenu_Execute_Click); // // APICaller // this.APICaller.WorkerSupportsCancellation = true; this.APICaller.DoWork += new System.ComponentModel.DoWorkEventHandler(this.APICaller_DoWork); // - // Menu_File_Reload - // - this.Menu_File_Reload.Name = "Menu_File_Reload"; - this.Menu_File_Reload.Size = new System.Drawing.Size(273, 34); - this.Menu_File_Reload.Text = "再読み込み(&R)"; - this.Menu_File_Reload.Click += new System.EventHandler(this.Menu_File_Reload_Click); - // - // TextFilter - // - this.TextFilter.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.TextFilter.Location = new System.Drawing.Point(12, 32); - this.TextFilter.Name = "TextFilter"; - this.TextFilter.Size = new System.Drawing.Size(519, 23); - this.TextFilter.TabIndex = 2; - // - // ButtonSearch - // - this.ButtonSearch.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.ButtonSearch.Location = new System.Drawing.Point(537, 31); - this.ButtonSearch.Name = "ButtonSearch"; - this.ButtonSearch.Size = new System.Drawing.Size(75, 23); - this.ButtonSearch.TabIndex = 3; - this.ButtonSearch.Text = "検索"; - this.ButtonSearch.UseVisualStyleBackColor = true; - this.ButtonSearch.Click += new System.EventHandler(this.ButtonSearch_Click); - // // DialogLocalAPILoader2 // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; @@ -212,7 +212,7 @@ private void InitializeComponent() { this.Text = "ファイルからAPIをロード"; this.Load += new System.EventHandler(this.DialogLocalAPILoader2_Load); ((System.ComponentModel.ISupportInitialize)(this.APIView)).EndInit(); - this.ContextMenu.ResumeLayout(false); + this.ViewMenu.ResumeLayout(false); this.menuStrip1.ResumeLayout(false); this.menuStrip1.PerformLayout(); this.splitContainer1.Panel1.ResumeLayout(false); @@ -234,9 +234,9 @@ private void InitializeComponent() { private System.Windows.Forms.ToolStripMenuItem Menu_File_OpenFolder; private System.Windows.Forms.Button ButtonExecuteNext; private System.Windows.Forms.Button ButtonExecute; - private System.Windows.Forms.ContextMenuStrip ContextMenu; - private System.Windows.Forms.ToolStripMenuItem ContextMenu_Execute; - private System.Windows.Forms.ToolStripMenuItem ContextMenu_Delete; + private System.Windows.Forms.ContextMenuStrip ViewMenu; + private System.Windows.Forms.ToolStripMenuItem ViewMenu_Execute; + private System.Windows.Forms.ToolStripMenuItem ViewMenu_Delete; private System.Windows.Forms.FolderBrowserDialog FolderBrowser; private System.Windows.Forms.DataGridViewTextBoxColumn APIView_FileName; private System.ComponentModel.BackgroundWorker APICaller; diff --git a/ElectronicObserver/Window/Dialog/DialogLocalAPILoader2.cs b/ElectronicObserver/Window/Dialog/DialogLocalAPILoader2.cs index 41d6640ad..ac7671aa4 100644 --- a/ElectronicObserver/Window/Dialog/DialogLocalAPILoader2.cs +++ b/ElectronicObserver/Window/Dialog/DialogLocalAPILoader2.cs @@ -43,7 +43,7 @@ private void Menu_File_Reload_Click( object sender, EventArgs e ) { MessageBox.Show( "フォルダが指定されていないか存在しません。", "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error ); } - private void ContextMenu_Execute_Click( object sender, EventArgs e ) { + private void ViewMenu_Execute_Click( object sender, EventArgs e ) { /*/ var rows = APIView.SelectedRows.Cast().OrderBy( r => r.Cells[APIView_FileName.Index].Value ); @@ -62,7 +62,7 @@ private void ContextMenu_Execute_Click( object sender, EventArgs e ) { //*/ } - private void ContextMenu_Delete_Click( object sender, EventArgs e ) { + private void ViewMenu_Delete_Click( object sender, EventArgs e ) { foreach ( DataGridViewRow row in APIView.SelectedRows ) { APIView.Rows.Remove( row ); diff --git a/ElectronicObserver/Window/Dialog/DialogLocalAPILoader2.resx b/ElectronicObserver/Window/Dialog/DialogLocalAPILoader2.resx index dc5aa57d8..0ed049a6e 100644 --- a/ElectronicObserver/Window/Dialog/DialogLocalAPILoader2.resx +++ b/ElectronicObserver/Window/Dialog/DialogLocalAPILoader2.resx @@ -120,7 +120,7 @@ True - + 139, 17 diff --git a/ElectronicObserver/Window/Dialog/DialogResourceChart.Designer.cs b/ElectronicObserver/Window/Dialog/DialogResourceChart.Designer.cs new file mode 100644 index 000000000..0e73649e1 --- /dev/null +++ b/ElectronicObserver/Window/Dialog/DialogResourceChart.Designer.cs @@ -0,0 +1,113 @@ +namespace ElectronicObserver.Window.Dialog { + partial class DialogResourceChart { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose( bool disposing ) { + if ( disposing && ( components != null ) ) { + components.Dispose(); + } + base.Dispose( disposing ); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() { + this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.ResourceChart = new System.Windows.Forms.DataVisualization.Charting.Chart(); + this.Menu_Graph = new System.Windows.Forms.ToolStripMenuItem(); + this.Menu_Graph_Resource = new System.Windows.Forms.ToolStripMenuItem(); + this.Menu_Graph_Material = new System.Windows.Forms.ToolStripMenuItem(); + this.Menu_Graph_Experience = new System.Windows.Forms.ToolStripMenuItem(); + this.menuStrip1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.ResourceChart)).BeginInit(); + this.SuspendLayout(); + // + // menuStrip1 + // + this.menuStrip1.ImageScalingSize = new System.Drawing.Size(32, 32); + this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.Menu_Graph}); + this.menuStrip1.Location = new System.Drawing.Point(0, 0); + this.menuStrip1.Name = "menuStrip1"; + this.menuStrip1.Size = new System.Drawing.Size(774, 38); + this.menuStrip1.TabIndex = 0; + this.menuStrip1.Text = "menuStrip1"; + // + // ResourceChart + // + this.ResourceChart.Dock = System.Windows.Forms.DockStyle.Fill; + this.ResourceChart.Location = new System.Drawing.Point(0, 38); + this.ResourceChart.Name = "ResourceChart"; + this.ResourceChart.Size = new System.Drawing.Size(774, 491); + this.ResourceChart.TabIndex = 1; + this.ResourceChart.Text = "資源チャート"; + this.ResourceChart.GetToolTipText += new System.EventHandler(this.ResourceChart_GetToolTipText); + // + // Menu_Graph + // + this.Menu_Graph.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.Menu_Graph_Resource, + this.Menu_Graph_Material, + this.Menu_Graph_Experience}); + this.Menu_Graph.Name = "Menu_Graph"; + this.Menu_Graph.Size = new System.Drawing.Size(183, 34); + this.Menu_Graph.Text = "グラフの選択(&G)"; + // + // Menu_Graph_Resource + // + this.Menu_Graph_Resource.Name = "Menu_Graph_Resource"; + this.Menu_Graph_Resource.Size = new System.Drawing.Size(244, 34); + this.Menu_Graph_Resource.Text = "資源(&R)"; + // + // Menu_Graph_Material + // + this.Menu_Graph_Material.Name = "Menu_Graph_Material"; + this.Menu_Graph_Material.Size = new System.Drawing.Size(244, 34); + this.Menu_Graph_Material.Text = "資材(&M)"; + // + // Menu_Graph_Experience + // + this.Menu_Graph_Experience.Name = "Menu_Graph_Experience"; + this.Menu_Graph_Experience.Size = new System.Drawing.Size(244, 34); + this.Menu_Graph_Experience.Text = "経験値(&E)"; + // + // DialogResourceChart + // + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.ClientSize = new System.Drawing.Size(774, 529); + this.Controls.Add(this.ResourceChart); + this.Controls.Add(this.menuStrip1); + this.Font = new System.Drawing.Font("Meiryo UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); + this.MainMenuStrip = this.menuStrip1; + this.Name = "DialogResourceChart"; + this.Text = "資源チャート"; + this.Load += new System.EventHandler(this.DialogResourceChart_Load); + this.menuStrip1.ResumeLayout(false); + this.menuStrip1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.ResourceChart)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.MenuStrip menuStrip1; + private System.Windows.Forms.ToolStripMenuItem Menu_Graph; + private System.Windows.Forms.ToolStripMenuItem Menu_Graph_Resource; + private System.Windows.Forms.ToolStripMenuItem Menu_Graph_Material; + private System.Windows.Forms.ToolStripMenuItem Menu_Graph_Experience; + private System.Windows.Forms.DataVisualization.Charting.Chart ResourceChart; + } +} \ No newline at end of file diff --git a/ElectronicObserver/Window/Dialog/DialogResourceChart.cs b/ElectronicObserver/Window/Dialog/DialogResourceChart.cs new file mode 100644 index 000000000..900f6f4ae --- /dev/null +++ b/ElectronicObserver/Window/Dialog/DialogResourceChart.cs @@ -0,0 +1,265 @@ +using ElectronicObserver.Resource.Record; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using System.Windows.Forms.DataVisualization.Charting; + +namespace ElectronicObserver.Window.Dialog { + + public partial class DialogResourceChart : Form { + public DialogResourceChart() { + InitializeComponent(); + } + + private void DialogResourceChart_Load( object sender, EventArgs e ) { + + //checkme: if レコードが未ロード or 0個の項目 then throw + SetResourceDiffChart( ChartSpan.Week ); + } + + + + private void SetResourceChart( ChartSpan cspan ) { + + ResourceChart.ChartAreas.Clear(); + var area = ResourceChart.ChartAreas.Add( "ResourceChartArea" ); + area.AxisX = CreateAxisX( cspan ); + area.AxisY = CreateAxisY( 2000 ); + + ResourceChart.Legends.Clear(); + var legend = ResourceChart.Legends.Add( "ResourceLegend" ); + legend.Font = Font; + + + ResourceChart.Series.Clear(); + + var fuel = ResourceChart.Series.Add( "ResourceSeries_Fuel" ); + var ammo = ResourceChart.Series.Add( "ResourceSeries_Ammo" ); + var steel = ResourceChart.Series.Add( "ResourceSeries_Steel" ); + var bauxite = ResourceChart.Series.Add( "ResourceSeries_Bauxite" ); + + var setSeries = new Action( s => { + s.ChartType = SeriesChartType.Line; + s.Font = Font; + s.XValueType = ChartValueType.DateTime; + } ); + + setSeries( fuel ); + fuel.Color = Color.FromArgb( 0, 128, 0 ); + fuel.LegendText = "燃料"; + + setSeries( ammo ); + ammo.Color = Color.FromArgb( 255, 128, 0 ); + ammo.LegendText = "弾薬"; + + setSeries( steel ); + steel.Color = Color.FromArgb( 64, 64, 64 ); + steel.LegendText = "鋼材"; + + setSeries( bauxite ); + bauxite.Color = Color.FromArgb( 255, 0, 0 ); + bauxite.LegendText = "ボーキ"; + + + //データ設定 + { + var record = RecordManager.Instance.Resource.Record.AsEnumerable(); + + switch ( cspan ) { + case ChartSpan.Day: + record = record.Where( r => r.Date >= DateTime.Now.AddDays( -1 ) ); + break; + case ChartSpan.Week: + record = record.Where( r => r.Date >= DateTime.Now.AddDays( -7 ) ); + break; + case ChartSpan.Month: + record = record.Where( r => r.Date >= DateTime.Now.AddMonths( -1 ) ); + break; + case ChartSpan.Year: + record = record.Where( r => r.Date >= DateTime.Now.AddYears( -1 ) ); + break; + } + + foreach ( var r in record ) { + + fuel.Points.AddXY( r.Date.ToOADate(), r.Fuel ); + ammo.Points.AddXY( r.Date.ToOADate(), r.Ammo ); + steel.Points.AddXY( r.Date.ToOADate(), r.Steel ); + bauxite.Points.AddXY( r.Date.ToOADate(), r.Bauxite ); + + } + + int min = (int)new[] { fuel.Points.Min( p => p.YValues[0] ), ammo.Points.Min( p => p.YValues[0] ), steel.Points.Min( p => p.YValues[0] ), bauxite.Points.Min( p => p.YValues[0] ) }.Min(); + area.AxisY.Minimum = Math.Floor( min / 1000.0 ) * 1000; + + int max = (int)new[] { fuel.Points.Max( p => p.YValues[0] ), ammo.Points.Max( p => p.YValues[0] ), steel.Points.Max( p => p.YValues[0] ), bauxite.Points.Max( p => p.YValues[0] ) }.Max(); + area.AxisY.Maximum = Math.Ceiling( max / 1000.0 ) * 1000; + } + + } + + + private void SetResourceDiffChart( ChartSpan cspan ) { + + ResourceChart.ChartAreas.Clear(); + var area = ResourceChart.ChartAreas.Add( "ResourceChartArea" ); + area.AxisX = CreateAxisX( cspan ); + area.AxisY = CreateAxisY( 200 ); + + ResourceChart.Legends.Clear(); + var legend = ResourceChart.Legends.Add( "ResourceLegend" ); + legend.Font = Font; + + + ResourceChart.Series.Clear(); + + var fuel = ResourceChart.Series.Add( "ResourceSeries_Fuel" ); + var ammo = ResourceChart.Series.Add( "ResourceSeries_Ammo" ); + var steel = ResourceChart.Series.Add( "ResourceSeries_Steel" ); + var bauxite = ResourceChart.Series.Add( "ResourceSeries_Bauxite" ); + + var setSeries = new Action( s => { + s.ChartType = SeriesChartType.Area; + //s.SetCustomProperty( "PointWidth", "1.0" ); //棒グラフの幅 + //s.Enabled = false; //表示するか + s.Font = Font; + s.XValueType = ChartValueType.DateTime; + } ); + + setSeries( fuel ); + fuel.Color = Color.FromArgb( 64, 0, 128, 0 ); + fuel.LegendText = "燃料"; + + setSeries( ammo ); + ammo.Color = Color.FromArgb( 64, 255, 128, 0 ); + ammo.LegendText = "弾薬"; + + setSeries( steel ); + steel.Color = Color.FromArgb( 64, 64, 64, 64 ); + steel.LegendText = "鋼材"; + + setSeries( bauxite ); + bauxite.Color = Color.FromArgb( 64, 255, 0, 0 ); + bauxite.LegendText = "ボーキ"; + + + //データ設定 + { + var record = RecordManager.Instance.Resource.Record.AsEnumerable(); + + switch ( cspan ) { + case ChartSpan.Day: + record = record.Where( r => r.Date >= DateTime.Now.AddDays( -1 ) ); + break; + case ChartSpan.Week: + record = record.Where( r => r.Date >= DateTime.Now.AddDays( -7 ) ); + break; + case ChartSpan.Month: + record = record.Where( r => r.Date >= DateTime.Now.AddMonths( -1 ) ); + break; + case ChartSpan.Year: + record = record.Where( r => r.Date >= DateTime.Now.AddYears( -1 ) ); + break; + } + + + var prev = record.First(); + foreach ( var r in record ) { + + fuel.Points.AddXY( r.Date.ToOADate(), r.Fuel - prev.Fuel ); + ammo.Points.AddXY( r.Date.ToOADate(), r.Ammo - prev.Ammo ); + steel.Points.AddXY( r.Date.ToOADate(), r.Steel - prev.Steel ); + bauxite.Points.AddXY( r.Date.ToOADate(), r.Bauxite - prev.Bauxite ); + + prev = r; + } + + int min = (int)new[] { fuel.Points.Min( p => p.YValues[0] ), ammo.Points.Min( p => p.YValues[0] ), steel.Points.Min( p => p.YValues[0] ), bauxite.Points.Min( p => p.YValues[0] ) }.Min(); + area.AxisY.Minimum = Math.Floor( min / 1000.0 ) * 1000; + + int max = (int)new[] { fuel.Points.Max( p => p.YValues[0] ), ammo.Points.Max( p => p.YValues[0] ), steel.Points.Max( p => p.YValues[0] ), bauxite.Points.Max( p => p.YValues[0] ) }.Max(); + area.AxisY.Maximum = Math.Ceiling( max / 1000.0 ) * 1000; + + } + + } + + + private Axis CreateAxisX( ChartSpan span ) { + + Axis axis = new Axis(); + + switch ( span ) { + case ChartSpan.Day: + axis.Interval = 2; + axis.IntervalOffsetType = DateTimeIntervalType.Hours; + axis.IntervalType = DateTimeIntervalType.Hours; + break; + case ChartSpan.Week: + axis.Interval = 12; + axis.IntervalOffsetType = DateTimeIntervalType.Hours; + axis.IntervalType = DateTimeIntervalType.Hours; + break; + case ChartSpan.Month: + axis.Interval = 3; + axis.IntervalOffsetType = DateTimeIntervalType.Days; + axis.IntervalType = DateTimeIntervalType.Days; + break; + case ChartSpan.Year: + case ChartSpan.All: + axis.Interval = 1; + axis.IntervalOffsetType = DateTimeIntervalType.Months; + axis.IntervalType = DateTimeIntervalType.Months; + break; + } + + axis.LabelStyle.Format = "MM/dd HH:mm"; + axis.LabelStyle.Font = Font; + axis.MajorGrid.LineColor = Color.FromArgb( 192, 192, 192 ); + + return axis; + } + + private Axis CreateAxisY( int interval ) { + + Axis axis = new Axis(); + + axis.LabelStyle.Font = Font; + axis.IsStartedFromZero = true; + axis.Interval = interval * 5; + axis.MajorGrid.LineColor = Color.FromArgb( 192, 192, 192 ); + axis.MinorGrid.Enabled = true; + axis.MinorGrid.Interval = interval; + axis.MinorGrid.LineDashStyle = ChartDashStyle.Dash; + axis.MinorGrid.LineColor = Color.FromArgb( 224, 224, 224 ); + + return axis; + } + + + + private void ResourceChart_GetToolTipText( object sender, ToolTipEventArgs e ) { + + if ( e.HitTestResult.ChartElementType == ChartElementType.DataPoint ) { + var dp = e.HitTestResult.Series.Points[e.HitTestResult.PointIndex]; + e.Text = string.Format( "{0:MM/dd HH:mm}\n{1} {2}", DateTime.FromOADate( dp.XValue ), e.HitTestResult.Series.LegendText, dp.YValues[0] ); + } + + } + } + + + public enum ChartSpan { + Day, + Week, + Month, + Year, + All + } +} diff --git a/ElectronicObserver/Window/Dialog/DialogResourceChart.resx b/ElectronicObserver/Window/Dialog/DialogResourceChart.resx new file mode 100644 index 000000000..d5494e305 --- /dev/null +++ b/ElectronicObserver/Window/Dialog/DialogResourceChart.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/ElectronicObserver/Window/FormMain.Designer.cs b/ElectronicObserver/Window/FormMain.Designer.cs index c293b0449..373a84af6 100644 --- a/ElectronicObserver/Window/FormMain.Designer.cs +++ b/ElectronicObserver/Window/FormMain.Designer.cs @@ -24,21 +24,21 @@ protected override void Dispose( bool disposing ) { /// private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - WeifenLuo.WinFormsUI.Docking.DockPanelSkin dockPanelSkin2 = new WeifenLuo.WinFormsUI.Docking.DockPanelSkin(); - WeifenLuo.WinFormsUI.Docking.AutoHideStripSkin autoHideStripSkin2 = new WeifenLuo.WinFormsUI.Docking.AutoHideStripSkin(); - WeifenLuo.WinFormsUI.Docking.DockPanelGradient dockPanelGradient4 = new WeifenLuo.WinFormsUI.Docking.DockPanelGradient(); - WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient8 = new WeifenLuo.WinFormsUI.Docking.TabGradient(); - WeifenLuo.WinFormsUI.Docking.DockPaneStripSkin dockPaneStripSkin2 = new WeifenLuo.WinFormsUI.Docking.DockPaneStripSkin(); - WeifenLuo.WinFormsUI.Docking.DockPaneStripGradient dockPaneStripGradient2 = new WeifenLuo.WinFormsUI.Docking.DockPaneStripGradient(); - WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient9 = new WeifenLuo.WinFormsUI.Docking.TabGradient(); - WeifenLuo.WinFormsUI.Docking.DockPanelGradient dockPanelGradient5 = new WeifenLuo.WinFormsUI.Docking.DockPanelGradient(); - WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient10 = new WeifenLuo.WinFormsUI.Docking.TabGradient(); - WeifenLuo.WinFormsUI.Docking.DockPaneStripToolWindowGradient dockPaneStripToolWindowGradient2 = new WeifenLuo.WinFormsUI.Docking.DockPaneStripToolWindowGradient(); - WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient11 = new WeifenLuo.WinFormsUI.Docking.TabGradient(); - WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient12 = new WeifenLuo.WinFormsUI.Docking.TabGradient(); - WeifenLuo.WinFormsUI.Docking.DockPanelGradient dockPanelGradient6 = new WeifenLuo.WinFormsUI.Docking.DockPanelGradient(); - WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient13 = new WeifenLuo.WinFormsUI.Docking.TabGradient(); - WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient14 = new WeifenLuo.WinFormsUI.Docking.TabGradient(); + WeifenLuo.WinFormsUI.Docking.DockPanelSkin dockPanelSkin1 = new WeifenLuo.WinFormsUI.Docking.DockPanelSkin(); + WeifenLuo.WinFormsUI.Docking.AutoHideStripSkin autoHideStripSkin1 = new WeifenLuo.WinFormsUI.Docking.AutoHideStripSkin(); + WeifenLuo.WinFormsUI.Docking.DockPanelGradient dockPanelGradient1 = new WeifenLuo.WinFormsUI.Docking.DockPanelGradient(); + WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient1 = new WeifenLuo.WinFormsUI.Docking.TabGradient(); + WeifenLuo.WinFormsUI.Docking.DockPaneStripSkin dockPaneStripSkin1 = new WeifenLuo.WinFormsUI.Docking.DockPaneStripSkin(); + WeifenLuo.WinFormsUI.Docking.DockPaneStripGradient dockPaneStripGradient1 = new WeifenLuo.WinFormsUI.Docking.DockPaneStripGradient(); + WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient2 = new WeifenLuo.WinFormsUI.Docking.TabGradient(); + WeifenLuo.WinFormsUI.Docking.DockPanelGradient dockPanelGradient2 = new WeifenLuo.WinFormsUI.Docking.DockPanelGradient(); + WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient3 = new WeifenLuo.WinFormsUI.Docking.TabGradient(); + WeifenLuo.WinFormsUI.Docking.DockPaneStripToolWindowGradient dockPaneStripToolWindowGradient1 = new WeifenLuo.WinFormsUI.Docking.DockPaneStripToolWindowGradient(); + WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient4 = new WeifenLuo.WinFormsUI.Docking.TabGradient(); + WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient5 = new WeifenLuo.WinFormsUI.Docking.TabGradient(); + WeifenLuo.WinFormsUI.Docking.DockPanelGradient dockPanelGradient3 = new WeifenLuo.WinFormsUI.Docking.DockPanelGradient(); + WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient6 = new WeifenLuo.WinFormsUI.Docking.TabGradient(); + WeifenLuo.WinFormsUI.Docking.TabGradient tabGradient7 = new WeifenLuo.WinFormsUI.Docking.TabGradient(); this.StripMenu = new System.Windows.Forms.MenuStrip(); this.StripMenu_File = new System.Windows.Forms.ToolStripMenuItem(); this.StripMenu_File_Record = new System.Windows.Forms.ToolStripMenuItem(); @@ -124,12 +124,15 @@ private void InitializeComponent() { this.StripStatus_Clock = new System.Windows.Forms.ToolStripStatusLabel(); this.UIUpdateTimer = new System.Windows.Forms.Timer(this.components); this.MainDockPanel = new WeifenLuo.WinFormsUI.Docking.DockPanel(); + this.StripMenu_Tool_ResourceChart = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator15 = new System.Windows.Forms.ToolStripSeparator(); this.StripMenu.SuspendLayout(); this.StripStatus.SuspendLayout(); this.SuspendLayout(); // // StripMenu // + this.StripMenu.ImageScalingSize = new System.Drawing.Size(32, 32); this.StripMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.StripMenu_File, this.StripMenu_View, @@ -139,7 +142,7 @@ private void InitializeComponent() { this.StripMenu_Help}); this.StripMenu.Location = new System.Drawing.Point(0, 0); this.StripMenu.Name = "StripMenu"; - this.StripMenu.Size = new System.Drawing.Size(640, 26); + this.StripMenu.Size = new System.Drawing.Size(640, 42); this.StripMenu.TabIndex = 2; this.StripMenu.Text = "menuStrip1"; // @@ -153,7 +156,7 @@ private void InitializeComponent() { this.toolStripSeparator5, this.StripMenu_File_Close}); this.StripMenu_File.Name = "StripMenu_File"; - this.StripMenu_File.Size = new System.Drawing.Size(85, 22); + this.StripMenu_File.Size = new System.Drawing.Size(128, 38); this.StripMenu_File.Text = "ファイル(&F)"; // // StripMenu_File_Record @@ -162,20 +165,20 @@ private void InitializeComponent() { this.StripMenu_File_Record_Save, this.StripMenu_File_Record_Load}); this.StripMenu_File_Record.Name = "StripMenu_File_Record"; - this.StripMenu_File_Record.Size = new System.Drawing.Size(153, 22); + this.StripMenu_File_Record.Size = new System.Drawing.Size(209, 34); this.StripMenu_File_Record.Text = "レコード(&R)"; // // StripMenu_File_Record_Save // this.StripMenu_File_Record_Save.Name = "StripMenu_File_Record_Save"; - this.StripMenu_File_Record_Save.Size = new System.Drawing.Size(130, 22); + this.StripMenu_File_Record_Save.Size = new System.Drawing.Size(181, 34); this.StripMenu_File_Record_Save.Text = "セーブ(&S)"; this.StripMenu_File_Record_Save.Click += new System.EventHandler(this.StripMenu_File_SaveData_Save_Click); // // StripMenu_File_Record_Load // this.StripMenu_File_Record_Load.Name = "StripMenu_File_Record_Load"; - this.StripMenu_File_Record_Load.Size = new System.Drawing.Size(130, 22); + this.StripMenu_File_Record_Load.Size = new System.Drawing.Size(181, 34); this.StripMenu_File_Record_Load.Text = "ロード(&L)"; this.StripMenu_File_Record_Load.Click += new System.EventHandler(this.StripMenu_File_SaveData_Load_Click); // @@ -186,51 +189,51 @@ private void InitializeComponent() { this.StripMenu_File_Layout_Save, this.StripMenu_File_Layout_Open}); this.StripMenu_File_Layout.Name = "StripMenu_File_Layout"; - this.StripMenu_File_Layout.Size = new System.Drawing.Size(153, 22); + this.StripMenu_File_Layout.Size = new System.Drawing.Size(209, 34); this.StripMenu_File_Layout.Text = "レイアウト(&L)"; // // StripMenu_File_Layout_Load // this.StripMenu_File_Layout_Load.Name = "StripMenu_File_Layout_Load"; - this.StripMenu_File_Layout_Load.Size = new System.Drawing.Size(239, 22); + this.StripMenu_File_Layout_Load.Size = new System.Drawing.Size(352, 34); this.StripMenu_File_Layout_Load.Text = "復元(&L)"; this.StripMenu_File_Layout_Load.Click += new System.EventHandler(this.StripMenu_File_Layout_Load_Click); // // StripMenu_File_Layout_Save // this.StripMenu_File_Layout_Save.Name = "StripMenu_File_Layout_Save"; - this.StripMenu_File_Layout_Save.Size = new System.Drawing.Size(239, 22); + this.StripMenu_File_Layout_Save.Size = new System.Drawing.Size(352, 34); this.StripMenu_File_Layout_Save.Text = "保存(&S)"; this.StripMenu_File_Layout_Save.Click += new System.EventHandler(this.StripMenu_File_Layout_Save_Click); // // StripMenu_File_Layout_Open // this.StripMenu_File_Layout_Open.Name = "StripMenu_File_Layout_Open"; - this.StripMenu_File_Layout_Open.Size = new System.Drawing.Size(239, 22); + this.StripMenu_File_Layout_Open.Size = new System.Drawing.Size(352, 34); this.StripMenu_File_Layout_Open.Text = "別のファイルからロード(&O)..."; this.StripMenu_File_Layout_Open.Click += new System.EventHandler(this.StripMenu_File_Layout_Open_Click); // // toolStripSeparator6 // this.toolStripSeparator6.Name = "toolStripSeparator6"; - this.toolStripSeparator6.Size = new System.Drawing.Size(150, 6); + this.toolStripSeparator6.Size = new System.Drawing.Size(206, 6); // // StripMenu_File_Configuration // this.StripMenu_File_Configuration.Name = "StripMenu_File_Configuration"; - this.StripMenu_File_Configuration.Size = new System.Drawing.Size(153, 22); + this.StripMenu_File_Configuration.Size = new System.Drawing.Size(209, 34); this.StripMenu_File_Configuration.Text = "設定(&C)..."; this.StripMenu_File_Configuration.Click += new System.EventHandler(this.StripMenu_File_Configuration_Click); // // toolStripSeparator5 // this.toolStripSeparator5.Name = "toolStripSeparator5"; - this.toolStripSeparator5.Size = new System.Drawing.Size(150, 6); + this.toolStripSeparator5.Size = new System.Drawing.Size(206, 6); // // StripMenu_File_Close // this.StripMenu_File_Close.Name = "StripMenu_File_Close"; - this.StripMenu_File_Close.Size = new System.Drawing.Size(153, 22); + this.StripMenu_File_Close.Size = new System.Drawing.Size(209, 34); this.StripMenu_File_Close.Text = "終了(&X)"; this.StripMenu_File_Close.Click += new System.EventHandler(this.StripMenu_File_Close_Click); // @@ -255,7 +258,7 @@ private void InitializeComponent() { this.StripMenu_View_Log, this.StripMenu_WindowCapture}); this.StripMenu_View.Name = "StripMenu_View"; - this.StripMenu_View.Size = new System.Drawing.Size(62, 22); + this.StripMenu_View.Size = new System.Drawing.Size(111, 38); this.StripMenu_View.Text = "表示(&V)"; // // StripMenu_View_Fleet @@ -266,131 +269,131 @@ private void InitializeComponent() { this.StripMenu_View_Fleet_3, this.StripMenu_View_Fleet_4}); this.StripMenu_View_Fleet.Name = "StripMenu_View_Fleet"; - this.StripMenu_View_Fleet.Size = new System.Drawing.Size(218, 22); + this.StripMenu_View_Fleet.Size = new System.Drawing.Size(306, 34); this.StripMenu_View_Fleet.Text = "艦隊(&F)"; // // StripMenu_View_Fleet_1 // this.StripMenu_View_Fleet_1.Name = "StripMenu_View_Fleet_1"; - this.StripMenu_View_Fleet_1.Size = new System.Drawing.Size(93, 22); + this.StripMenu_View_Fleet_1.Size = new System.Drawing.Size(120, 34); this.StripMenu_View_Fleet_1.Text = "#&1"; this.StripMenu_View_Fleet_1.Click += new System.EventHandler(this.StripMenu_View_Fleet_1_Click); // // StripMenu_View_Fleet_2 // this.StripMenu_View_Fleet_2.Name = "StripMenu_View_Fleet_2"; - this.StripMenu_View_Fleet_2.Size = new System.Drawing.Size(93, 22); + this.StripMenu_View_Fleet_2.Size = new System.Drawing.Size(120, 34); this.StripMenu_View_Fleet_2.Text = "#&2"; this.StripMenu_View_Fleet_2.Click += new System.EventHandler(this.StripMenu_View_Fleet_2_Click); // // StripMenu_View_Fleet_3 // this.StripMenu_View_Fleet_3.Name = "StripMenu_View_Fleet_3"; - this.StripMenu_View_Fleet_3.Size = new System.Drawing.Size(93, 22); + this.StripMenu_View_Fleet_3.Size = new System.Drawing.Size(120, 34); this.StripMenu_View_Fleet_3.Text = "#&3"; this.StripMenu_View_Fleet_3.Click += new System.EventHandler(this.StripMenu_View_Fleet_3_Click); // // StripMenu_View_Fleet_4 // this.StripMenu_View_Fleet_4.Name = "StripMenu_View_Fleet_4"; - this.StripMenu_View_Fleet_4.Size = new System.Drawing.Size(93, 22); + this.StripMenu_View_Fleet_4.Size = new System.Drawing.Size(120, 34); this.StripMenu_View_Fleet_4.Text = "#&4"; this.StripMenu_View_Fleet_4.Click += new System.EventHandler(this.StripMenu_View_Fleet_4_Click); // // StripMenu_View_FleetOverview // this.StripMenu_View_FleetOverview.Name = "StripMenu_View_FleetOverview"; - this.StripMenu_View_FleetOverview.Size = new System.Drawing.Size(218, 22); + this.StripMenu_View_FleetOverview.Size = new System.Drawing.Size(306, 34); this.StripMenu_View_FleetOverview.Text = "艦隊一覧(&O)"; this.StripMenu_View_FleetOverview.Click += new System.EventHandler(this.StripMenu_View_FleetOverview_Click); // // StripMenu_View_ShipGroup // this.StripMenu_View_ShipGroup.Name = "StripMenu_View_ShipGroup"; - this.StripMenu_View_ShipGroup.Size = new System.Drawing.Size(218, 22); + this.StripMenu_View_ShipGroup.Size = new System.Drawing.Size(306, 34); this.StripMenu_View_ShipGroup.Text = "艦船グループ(&G)"; this.StripMenu_View_ShipGroup.Click += new System.EventHandler(this.StripMenu_View_ShipGroup_Click); // // toolStripSeparator1 // this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(215, 6); + this.toolStripSeparator1.Size = new System.Drawing.Size(303, 6); // // StripMenu_View_Dock // this.StripMenu_View_Dock.Name = "StripMenu_View_Dock"; - this.StripMenu_View_Dock.Size = new System.Drawing.Size(218, 22); + this.StripMenu_View_Dock.Size = new System.Drawing.Size(306, 34); this.StripMenu_View_Dock.Text = "入渠(&D)"; this.StripMenu_View_Dock.Click += new System.EventHandler(this.StripMenu_View_Dock_Click); // // StripMenu_View_Arsenal // this.StripMenu_View_Arsenal.Name = "StripMenu_View_Arsenal"; - this.StripMenu_View_Arsenal.Size = new System.Drawing.Size(218, 22); + this.StripMenu_View_Arsenal.Size = new System.Drawing.Size(306, 34); this.StripMenu_View_Arsenal.Text = "工廠(&A)"; this.StripMenu_View_Arsenal.Click += new System.EventHandler(this.StripMenu_View_Arsenal_Click); // // toolStripSeparator2 // this.toolStripSeparator2.Name = "toolStripSeparator2"; - this.toolStripSeparator2.Size = new System.Drawing.Size(215, 6); + this.toolStripSeparator2.Size = new System.Drawing.Size(303, 6); // // StripMenu_View_Headquarters // this.StripMenu_View_Headquarters.Name = "StripMenu_View_Headquarters"; - this.StripMenu_View_Headquarters.Size = new System.Drawing.Size(218, 22); + this.StripMenu_View_Headquarters.Size = new System.Drawing.Size(306, 34); this.StripMenu_View_Headquarters.Text = "司令部(&H)"; this.StripMenu_View_Headquarters.Click += new System.EventHandler(this.StripMenu_View_Headquarters_Click); // // StripMenu_View_Quest // this.StripMenu_View_Quest.Name = "StripMenu_View_Quest"; - this.StripMenu_View_Quest.Size = new System.Drawing.Size(218, 22); + this.StripMenu_View_Quest.Size = new System.Drawing.Size(306, 34); this.StripMenu_View_Quest.Text = "任務(&Q)"; this.StripMenu_View_Quest.Click += new System.EventHandler(this.StripMenu_View_Quest_Click); // // StripMenu_View_Information // this.StripMenu_View_Information.Name = "StripMenu_View_Information"; - this.StripMenu_View_Information.Size = new System.Drawing.Size(218, 22); + this.StripMenu_View_Information.Size = new System.Drawing.Size(306, 34); this.StripMenu_View_Information.Text = "情報(&I)"; this.StripMenu_View_Information.Click += new System.EventHandler(this.StripMenu_View_Information_Click); // // toolStripSeparator3 // this.toolStripSeparator3.Name = "toolStripSeparator3"; - this.toolStripSeparator3.Size = new System.Drawing.Size(215, 6); + this.toolStripSeparator3.Size = new System.Drawing.Size(303, 6); // // StripMenu_View_Compass // this.StripMenu_View_Compass.Name = "StripMenu_View_Compass"; - this.StripMenu_View_Compass.Size = new System.Drawing.Size(218, 22); + this.StripMenu_View_Compass.Size = new System.Drawing.Size(306, 34); this.StripMenu_View_Compass.Text = "羅針盤(&C)"; this.StripMenu_View_Compass.Click += new System.EventHandler(this.StripMenu_View_Compass_Click); // // StripMenu_View_Battle // this.StripMenu_View_Battle.Name = "StripMenu_View_Battle"; - this.StripMenu_View_Battle.Size = new System.Drawing.Size(218, 22); + this.StripMenu_View_Battle.Size = new System.Drawing.Size(306, 34); this.StripMenu_View_Battle.Text = "戦闘(&B)"; this.StripMenu_View_Battle.Click += new System.EventHandler(this.StripMenu_View_Battle_Click); // // toolStripSeparator4 // this.toolStripSeparator4.Name = "toolStripSeparator4"; - this.toolStripSeparator4.Size = new System.Drawing.Size(215, 6); + this.toolStripSeparator4.Size = new System.Drawing.Size(303, 6); // // StripMenu_View_Browser // this.StripMenu_View_Browser.Name = "StripMenu_View_Browser"; - this.StripMenu_View_Browser.Size = new System.Drawing.Size(218, 22); + this.StripMenu_View_Browser.Size = new System.Drawing.Size(306, 34); this.StripMenu_View_Browser.Text = "ブラウザ(&M)"; this.StripMenu_View_Browser.Click += new System.EventHandler(this.StripMenu_View_Browser_Click); // // StripMenu_View_Log // this.StripMenu_View_Log.Name = "StripMenu_View_Log"; - this.StripMenu_View_Log.Size = new System.Drawing.Size(218, 22); + this.StripMenu_View_Log.Size = new System.Drawing.Size(306, 34); this.StripMenu_View_Log.Text = "ログ(&L)"; this.StripMenu_View_Log.Click += new System.EventHandler(this.StripMenu_View_Log_Click); // @@ -401,27 +404,27 @@ private void InitializeComponent() { this.StripMenu_WindowCapture_AttachAll, this.StripMenu_WindowCapture_DetachAll}); this.StripMenu_WindowCapture.Name = "StripMenu_WindowCapture"; - this.StripMenu_WindowCapture.Size = new System.Drawing.Size(218, 22); + this.StripMenu_WindowCapture.Size = new System.Drawing.Size(306, 34); this.StripMenu_WindowCapture.Text = "ウィンドウキャプチャ(&W)"; // // StripMenu_WindowCapture_SubWindow // this.StripMenu_WindowCapture_SubWindow.Name = "StripMenu_WindowCapture_SubWindow"; - this.StripMenu_WindowCapture_SubWindow.Size = new System.Drawing.Size(226, 22); + this.StripMenu_WindowCapture_SubWindow.Size = new System.Drawing.Size(357, 34); this.StripMenu_WindowCapture_SubWindow.Text = "コントロールウィンドウ(&C)"; this.StripMenu_WindowCapture_SubWindow.Click += new System.EventHandler(this.StripMenu_WindowCapture_SubWindow_Click); // // StripMenu_WindowCapture_AttachAll // this.StripMenu_WindowCapture_AttachAll.Name = "StripMenu_WindowCapture_AttachAll"; - this.StripMenu_WindowCapture_AttachAll.Size = new System.Drawing.Size(226, 22); + this.StripMenu_WindowCapture_AttachAll.Size = new System.Drawing.Size(357, 34); this.StripMenu_WindowCapture_AttachAll.Text = "全て再検索して取り込む(&S)"; this.StripMenu_WindowCapture_AttachAll.Click += new System.EventHandler(this.StripMenu_WindowCapture_AttachAll_Click); // // StripMenu_WindowCapture_DetachAll // this.StripMenu_WindowCapture_DetachAll.Name = "StripMenu_WindowCapture_DetachAll"; - this.StripMenu_WindowCapture_DetachAll.Size = new System.Drawing.Size(226, 22); + this.StripMenu_WindowCapture_DetachAll.Size = new System.Drawing.Size(357, 34); this.StripMenu_WindowCapture_DetachAll.Text = "全てのウィンドウを開放(&R)"; this.StripMenu_WindowCapture_DetachAll.Click += new System.EventHandler(this.StripMenu_WindowCapture_DetachAll_Click); // @@ -438,7 +441,7 @@ private void InitializeComponent() { this.StripMenu_Browser_Navigate}); this.StripMenu_Browser.Enabled = false; this.StripMenu_Browser.Name = "StripMenu_Browser"; - this.StripMenu_Browser.Size = new System.Drawing.Size(86, 22); + this.StripMenu_Browser.Size = new System.Drawing.Size(136, 38); this.StripMenu_Browser.Text = "ブラウザ(&B)"; this.StripMenu_Browser.Visible = false; this.StripMenu_Browser.DropDownOpening += new System.EventHandler(this.StripMenu_Browser_DropDownOpening); @@ -448,14 +451,14 @@ private void InitializeComponent() { this.StripMenu_Browser_ScreenShot.Enabled = false; this.StripMenu_Browser_ScreenShot.Name = "StripMenu_Browser_ScreenShot"; this.StripMenu_Browser_ScreenShot.ShortcutKeys = System.Windows.Forms.Keys.F2; - this.StripMenu_Browser_ScreenShot.Size = new System.Drawing.Size(238, 22); + this.StripMenu_Browser_ScreenShot.Size = new System.Drawing.Size(356, 34); this.StripMenu_Browser_ScreenShot.Text = "スクリーンショット(&S)"; this.StripMenu_Browser_ScreenShot.Click += new System.EventHandler(this.StripMenu_Browser_ScreenShot_Click); // // toolStripSeparator9 // this.toolStripSeparator9.Name = "toolStripSeparator9"; - this.toolStripSeparator9.Size = new System.Drawing.Size(235, 6); + this.toolStripSeparator9.Size = new System.Drawing.Size(353, 6); // // StripMenu_Browser_Zoom // @@ -477,7 +480,7 @@ private void InitializeComponent() { this.StripMenu_Browser_Zoom_300, this.StripMenu_Browser_Zoom_400}); this.StripMenu_Browser_Zoom.Name = "StripMenu_Browser_Zoom"; - this.StripMenu_Browser_Zoom.Size = new System.Drawing.Size(238, 22); + this.StripMenu_Browser_Zoom.Size = new System.Drawing.Size(356, 34); this.StripMenu_Browser_Zoom.Text = "ズーム(&Z)"; this.StripMenu_Browser_Zoom.DropDownOpening += new System.EventHandler(this.StripMenu_Browser_Zoom_DropDownOpening); // @@ -485,103 +488,103 @@ private void InitializeComponent() { // this.StripMenu_Browser_Zoom_Current.Enabled = false; this.StripMenu_Browser_Zoom_Current.Name = "StripMenu_Browser_Zoom_Current"; - this.StripMenu_Browser_Zoom_Current.Size = new System.Drawing.Size(112, 22); + this.StripMenu_Browser_Zoom_Current.Size = new System.Drawing.Size(160, 34); this.StripMenu_Browser_Zoom_Current.Text = "現在%"; // // toolStripSeparator14 // this.toolStripSeparator14.Name = "toolStripSeparator14"; - this.toolStripSeparator14.Size = new System.Drawing.Size(109, 6); + this.toolStripSeparator14.Size = new System.Drawing.Size(157, 6); // // StripMenu_Browser_Zoom_Decr20 // this.StripMenu_Browser_Zoom_Decr20.Name = "StripMenu_Browser_Zoom_Decr20"; - this.StripMenu_Browser_Zoom_Decr20.Size = new System.Drawing.Size(112, 22); + this.StripMenu_Browser_Zoom_Decr20.Size = new System.Drawing.Size(160, 34); this.StripMenu_Browser_Zoom_Decr20.Text = "-20%"; this.StripMenu_Browser_Zoom_Decr20.Click += new System.EventHandler(this.StripMenu_Browser_Zoom_Decr20_Click); // // StripMenu_Browser_Zoom_Incr20 // this.StripMenu_Browser_Zoom_Incr20.Name = "StripMenu_Browser_Zoom_Incr20"; - this.StripMenu_Browser_Zoom_Incr20.Size = new System.Drawing.Size(112, 22); + this.StripMenu_Browser_Zoom_Incr20.Size = new System.Drawing.Size(160, 34); this.StripMenu_Browser_Zoom_Incr20.Text = "+20%"; this.StripMenu_Browser_Zoom_Incr20.Click += new System.EventHandler(this.StripMenu_Browser_Zoom_Incr20_Click); // // toolStripSeparator13 // this.toolStripSeparator13.Name = "toolStripSeparator13"; - this.toolStripSeparator13.Size = new System.Drawing.Size(109, 6); + this.toolStripSeparator13.Size = new System.Drawing.Size(157, 6); // // StripMenu_Browser_Zoom_25 // this.StripMenu_Browser_Zoom_25.Name = "StripMenu_Browser_Zoom_25"; - this.StripMenu_Browser_Zoom_25.Size = new System.Drawing.Size(112, 22); + this.StripMenu_Browser_Zoom_25.Size = new System.Drawing.Size(160, 34); this.StripMenu_Browser_Zoom_25.Text = "25%"; this.StripMenu_Browser_Zoom_25.Click += new System.EventHandler(this.StripMenu_Browser_Zoom_Click); // // StripMenu_Browser_Zoom_50 // this.StripMenu_Browser_Zoom_50.Name = "StripMenu_Browser_Zoom_50"; - this.StripMenu_Browser_Zoom_50.Size = new System.Drawing.Size(112, 22); + this.StripMenu_Browser_Zoom_50.Size = new System.Drawing.Size(160, 34); this.StripMenu_Browser_Zoom_50.Text = "50%"; this.StripMenu_Browser_Zoom_50.Click += new System.EventHandler(this.StripMenu_Browser_Zoom_Click); // // StripMenu_Browser_Zoom_75 // this.StripMenu_Browser_Zoom_75.Name = "StripMenu_Browser_Zoom_75"; - this.StripMenu_Browser_Zoom_75.Size = new System.Drawing.Size(112, 22); + this.StripMenu_Browser_Zoom_75.Size = new System.Drawing.Size(160, 34); this.StripMenu_Browser_Zoom_75.Text = "75%"; this.StripMenu_Browser_Zoom_75.Click += new System.EventHandler(this.StripMenu_Browser_Zoom_Click); // // toolStripSeparator11 // this.toolStripSeparator11.Name = "toolStripSeparator11"; - this.toolStripSeparator11.Size = new System.Drawing.Size(109, 6); + this.toolStripSeparator11.Size = new System.Drawing.Size(157, 6); // // StripMenu_Browser_Zoom_100 // this.StripMenu_Browser_Zoom_100.Name = "StripMenu_Browser_Zoom_100"; - this.StripMenu_Browser_Zoom_100.Size = new System.Drawing.Size(112, 22); + this.StripMenu_Browser_Zoom_100.Size = new System.Drawing.Size(160, 34); this.StripMenu_Browser_Zoom_100.Text = "100%"; this.StripMenu_Browser_Zoom_100.Click += new System.EventHandler(this.StripMenu_Browser_Zoom_Click); // // toolStripSeparator12 // this.toolStripSeparator12.Name = "toolStripSeparator12"; - this.toolStripSeparator12.Size = new System.Drawing.Size(109, 6); + this.toolStripSeparator12.Size = new System.Drawing.Size(157, 6); // // StripMenu_Browser_Zoom_150 // this.StripMenu_Browser_Zoom_150.Name = "StripMenu_Browser_Zoom_150"; - this.StripMenu_Browser_Zoom_150.Size = new System.Drawing.Size(112, 22); + this.StripMenu_Browser_Zoom_150.Size = new System.Drawing.Size(160, 34); this.StripMenu_Browser_Zoom_150.Text = "150%"; this.StripMenu_Browser_Zoom_150.Click += new System.EventHandler(this.StripMenu_Browser_Zoom_Click); // // StripMenu_Browser_Zoom_200 // this.StripMenu_Browser_Zoom_200.Name = "StripMenu_Browser_Zoom_200"; - this.StripMenu_Browser_Zoom_200.Size = new System.Drawing.Size(112, 22); + this.StripMenu_Browser_Zoom_200.Size = new System.Drawing.Size(160, 34); this.StripMenu_Browser_Zoom_200.Text = "200%"; this.StripMenu_Browser_Zoom_200.Click += new System.EventHandler(this.StripMenu_Browser_Zoom_Click); // // StripMenu_Browser_Zoom_250 // this.StripMenu_Browser_Zoom_250.Name = "StripMenu_Browser_Zoom_250"; - this.StripMenu_Browser_Zoom_250.Size = new System.Drawing.Size(112, 22); + this.StripMenu_Browser_Zoom_250.Size = new System.Drawing.Size(160, 34); this.StripMenu_Browser_Zoom_250.Text = "250%"; this.StripMenu_Browser_Zoom_250.Click += new System.EventHandler(this.StripMenu_Browser_Zoom_Click); // // StripMenu_Browser_Zoom_300 // this.StripMenu_Browser_Zoom_300.Name = "StripMenu_Browser_Zoom_300"; - this.StripMenu_Browser_Zoom_300.Size = new System.Drawing.Size(112, 22); + this.StripMenu_Browser_Zoom_300.Size = new System.Drawing.Size(160, 34); this.StripMenu_Browser_Zoom_300.Text = "300%"; this.StripMenu_Browser_Zoom_300.Click += new System.EventHandler(this.StripMenu_Browser_Zoom_Click); // // StripMenu_Browser_Zoom_400 // this.StripMenu_Browser_Zoom_400.Name = "StripMenu_Browser_Zoom_400"; - this.StripMenu_Browser_Zoom_400.Size = new System.Drawing.Size(112, 22); + this.StripMenu_Browser_Zoom_400.Size = new System.Drawing.Size(160, 34); this.StripMenu_Browser_Zoom_400.Text = "400%"; this.StripMenu_Browser_Zoom_400.Click += new System.EventHandler(this.StripMenu_Browser_Zoom_Click); // @@ -589,35 +592,35 @@ private void InitializeComponent() { // this.StripMenu_Browser_AppliesStyleSheet.CheckOnClick = true; this.StripMenu_Browser_AppliesStyleSheet.Name = "StripMenu_Browser_AppliesStyleSheet"; - this.StripMenu_Browser_AppliesStyleSheet.Size = new System.Drawing.Size(238, 22); + this.StripMenu_Browser_AppliesStyleSheet.Size = new System.Drawing.Size(356, 34); this.StripMenu_Browser_AppliesStyleSheet.Text = "スタイルシートを適用する(&S)"; this.StripMenu_Browser_AppliesStyleSheet.CheckedChanged += new System.EventHandler(this.StripMenu_Browser_AppliesStyleSheet_CheckedChanged); // // toolStripSeparator10 // this.toolStripSeparator10.Name = "toolStripSeparator10"; - this.toolStripSeparator10.Size = new System.Drawing.Size(235, 6); + this.toolStripSeparator10.Size = new System.Drawing.Size(353, 6); // // StripMenu_Browser_Refresh // this.StripMenu_Browser_Refresh.Enabled = false; this.StripMenu_Browser_Refresh.Name = "StripMenu_Browser_Refresh"; this.StripMenu_Browser_Refresh.ShortcutKeys = System.Windows.Forms.Keys.F5; - this.StripMenu_Browser_Refresh.Size = new System.Drawing.Size(238, 22); + this.StripMenu_Browser_Refresh.Size = new System.Drawing.Size(356, 34); this.StripMenu_Browser_Refresh.Text = "更新(&R)"; this.StripMenu_Browser_Refresh.Click += new System.EventHandler(this.StripMenu_Browser_Refresh_Click); // // StripMenu_Browser_NavigateToLogInPage // this.StripMenu_Browser_NavigateToLogInPage.Name = "StripMenu_Browser_NavigateToLogInPage"; - this.StripMenu_Browser_NavigateToLogInPage.Size = new System.Drawing.Size(238, 22); + this.StripMenu_Browser_NavigateToLogInPage.Size = new System.Drawing.Size(356, 34); this.StripMenu_Browser_NavigateToLogInPage.Text = "ログインページへ移動(&L)"; this.StripMenu_Browser_NavigateToLogInPage.Click += new System.EventHandler(this.StripMenu_Browser_NavigateToLogInPage_Click); // // StripMenu_Browser_Navigate // this.StripMenu_Browser_Navigate.Name = "StripMenu_Browser_Navigate"; - this.StripMenu_Browser_Navigate.Size = new System.Drawing.Size(238, 22); + this.StripMenu_Browser_Navigate.Size = new System.Drawing.Size(356, 34); this.StripMenu_Browser_Navigate.Text = "移動(&M)..."; this.StripMenu_Browser_Navigate.Click += new System.EventHandler(this.StripMenu_Browser_Navigate_Click); // @@ -626,35 +629,37 @@ private void InitializeComponent() { this.StripMenu_Tool.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.StripMenu_Tool_EquipmentList, this.toolStripSeparator7, + this.StripMenu_Tool_ResourceChart, + this.toolStripSeparator15, this.StripMenu_Tool_AlbumMasterShip, this.StripMenu_Tool_AlbumMasterEquipment}); this.StripMenu_Tool.Name = "StripMenu_Tool"; - this.StripMenu_Tool.Size = new System.Drawing.Size(74, 22); + this.StripMenu_Tool.Size = new System.Drawing.Size(120, 38); this.StripMenu_Tool.Text = "ツール(&T)"; // // StripMenu_Tool_EquipmentList // this.StripMenu_Tool_EquipmentList.Name = "StripMenu_Tool_EquipmentList"; - this.StripMenu_Tool_EquipmentList.Size = new System.Drawing.Size(143, 22); + this.StripMenu_Tool_EquipmentList.Size = new System.Drawing.Size(244, 34); this.StripMenu_Tool_EquipmentList.Text = "装備一覧(&Q)"; this.StripMenu_Tool_EquipmentList.Click += new System.EventHandler(this.StripMenu_Tool_EquipmentList_Click); // // toolStripSeparator7 // this.toolStripSeparator7.Name = "toolStripSeparator7"; - this.toolStripSeparator7.Size = new System.Drawing.Size(140, 6); + this.toolStripSeparator7.Size = new System.Drawing.Size(241, 6); // // StripMenu_Tool_AlbumMasterShip // this.StripMenu_Tool_AlbumMasterShip.Name = "StripMenu_Tool_AlbumMasterShip"; - this.StripMenu_Tool_AlbumMasterShip.Size = new System.Drawing.Size(143, 22); + this.StripMenu_Tool_AlbumMasterShip.Size = new System.Drawing.Size(244, 34); this.StripMenu_Tool_AlbumMasterShip.Text = "艦船図鑑(&S)"; this.StripMenu_Tool_AlbumMasterShip.Click += new System.EventHandler(this.StripMenu_Tool_AlbumMasterShip_Click); // // StripMenu_Tool_AlbumMasterEquipment // this.StripMenu_Tool_AlbumMasterEquipment.Name = "StripMenu_Tool_AlbumMasterEquipment"; - this.StripMenu_Tool_AlbumMasterEquipment.Size = new System.Drawing.Size(143, 22); + this.StripMenu_Tool_AlbumMasterEquipment.Size = new System.Drawing.Size(244, 34); this.StripMenu_Tool_AlbumMasterEquipment.Text = "装備図鑑(&E)"; this.StripMenu_Tool_AlbumMasterEquipment.Click += new System.EventHandler(this.StripMenu_Tool_AlbumMasterEquipment_Click); // @@ -668,46 +673,46 @@ private void InitializeComponent() { this.StripMenu_Debug_DeleteOldAPI, this.StripMenu_Debug_RenameShipResource}); this.StripMenu_Debug.Name = "StripMenu_Debug"; - this.StripMenu_Debug.Size = new System.Drawing.Size(87, 22); + this.StripMenu_Debug.Size = new System.Drawing.Size(137, 38); this.StripMenu_Debug.Text = "デバッグ(&D)"; // // StripMenu_Debug_LoadAPIFromFile // this.StripMenu_Debug_LoadAPIFromFile.Name = "StripMenu_Debug_LoadAPIFromFile"; - this.StripMenu_Debug_LoadAPIFromFile.Size = new System.Drawing.Size(294, 22); + this.StripMenu_Debug_LoadAPIFromFile.Size = new System.Drawing.Size(484, 34); this.StripMenu_Debug_LoadAPIFromFile.Text = "ファイルからAPIをロード(&L)..."; this.StripMenu_Debug_LoadAPIFromFile.Click += new System.EventHandler(this.StripMenu_Debug_LoadAPIFromFile_Click); // // StripMenu_Debug_LoadInitialAPI // this.StripMenu_Debug_LoadInitialAPI.Name = "StripMenu_Debug_LoadInitialAPI"; - this.StripMenu_Debug_LoadInitialAPI.Size = new System.Drawing.Size(294, 22); + this.StripMenu_Debug_LoadInitialAPI.Size = new System.Drawing.Size(484, 34); this.StripMenu_Debug_LoadInitialAPI.Text = "APIリストをロード(&I)..."; this.StripMenu_Debug_LoadInitialAPI.Click += new System.EventHandler(this.StripMenu_Debug_LoadInitialAPI_Click); // // toolStripSeparator8 // this.toolStripSeparator8.Name = "toolStripSeparator8"; - this.toolStripSeparator8.Size = new System.Drawing.Size(291, 6); + this.toolStripSeparator8.Size = new System.Drawing.Size(481, 6); // // StripMenu_Debug_LoadRecordFromOld // this.StripMenu_Debug_LoadRecordFromOld.Name = "StripMenu_Debug_LoadRecordFromOld"; - this.StripMenu_Debug_LoadRecordFromOld.Size = new System.Drawing.Size(294, 22); + this.StripMenu_Debug_LoadRecordFromOld.Size = new System.Drawing.Size(484, 34); this.StripMenu_Debug_LoadRecordFromOld.Text = "旧 api_start2 からレコードを構築(&O)..."; this.StripMenu_Debug_LoadRecordFromOld.Click += new System.EventHandler(this.StripMenu_Debug_LoadRecordFromOld_Click); // // StripMenu_Debug_DeleteOldAPI // this.StripMenu_Debug_DeleteOldAPI.Name = "StripMenu_Debug_DeleteOldAPI"; - this.StripMenu_Debug_DeleteOldAPI.Size = new System.Drawing.Size(294, 22); + this.StripMenu_Debug_DeleteOldAPI.Size = new System.Drawing.Size(484, 34); this.StripMenu_Debug_DeleteOldAPI.Text = "古いAPIデータを削除(&D)"; this.StripMenu_Debug_DeleteOldAPI.Click += new System.EventHandler(this.StripMenu_Debug_DeleteOldAPI_Click); // // StripMenu_Debug_RenameShipResource // this.StripMenu_Debug_RenameShipResource.Name = "StripMenu_Debug_RenameShipResource"; - this.StripMenu_Debug_RenameShipResource.Size = new System.Drawing.Size(294, 22); + this.StripMenu_Debug_RenameShipResource.Size = new System.Drawing.Size(484, 34); this.StripMenu_Debug_RenameShipResource.Text = "艦船リソースをリネーム(&R)..."; this.StripMenu_Debug_RenameShipResource.Click += new System.EventHandler(this.StripMenu_Debug_RenameShipResource_Click); // @@ -718,56 +723,57 @@ private void InitializeComponent() { this.SeparatorWhitecap, this.StripMenu_Help_Version}); this.StripMenu_Help.Name = "StripMenu_Help"; - this.StripMenu_Help.Size = new System.Drawing.Size(75, 22); + this.StripMenu_Help.Size = new System.Drawing.Size(123, 38); this.StripMenu_Help.Text = "ヘルプ(&H)"; // // StripMenu_Help_Help // this.StripMenu_Help_Help.Name = "StripMenu_Help_Help"; - this.StripMenu_Help_Help.Size = new System.Drawing.Size(203, 22); + this.StripMenu_Help_Help.Size = new System.Drawing.Size(296, 34); this.StripMenu_Help_Help.Text = "オンラインヘルプ(&H)..."; this.StripMenu_Help_Help.Click += new System.EventHandler(this.StripMenu_Help_Help_Click); // // SeparatorWhitecap // this.SeparatorWhitecap.Name = "SeparatorWhitecap"; - this.SeparatorWhitecap.Size = new System.Drawing.Size(200, 6); + this.SeparatorWhitecap.Size = new System.Drawing.Size(293, 6); this.SeparatorWhitecap.Click += new System.EventHandler(this.SeparatorWhitecap_Click); // // StripMenu_Help_Version // this.StripMenu_Help_Version.Name = "StripMenu_Help_Version"; - this.StripMenu_Help_Version.Size = new System.Drawing.Size(203, 22); + this.StripMenu_Help_Version.Size = new System.Drawing.Size(296, 34); this.StripMenu_Help_Version.Text = "バージョン情報(&V)"; this.StripMenu_Help_Version.Click += new System.EventHandler(this.StripMenu_Help_Version_Click); // // StripStatus // + this.StripStatus.ImageScalingSize = new System.Drawing.Size(32, 32); this.StripStatus.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.StripStatus_Information, this.StripStatus_Padding, this.StripStatus_Clock}); - this.StripStatus.Location = new System.Drawing.Point(0, 457); + this.StripStatus.Location = new System.Drawing.Point(0, 445); this.StripStatus.Name = "StripStatus"; - this.StripStatus.Size = new System.Drawing.Size(640, 23); + this.StripStatus.Size = new System.Drawing.Size(640, 35); this.StripStatus.TabIndex = 3; // // StripStatus_Information // this.StripStatus_Information.Name = "StripStatus_Information"; - this.StripStatus_Information.Size = new System.Drawing.Size(105, 18); + this.StripStatus_Information.Size = new System.Drawing.Size(210, 30); this.StripStatus_Information.Text = "Now Preparing..."; // // StripStatus_Padding // this.StripStatus_Padding.Name = "StripStatus_Padding"; - this.StripStatus_Padding.Size = new System.Drawing.Size(450, 18); + this.StripStatus_Padding.Size = new System.Drawing.Size(341, 30); this.StripStatus_Padding.Spring = true; // // StripStatus_Clock // this.StripStatus_Clock.Name = "StripStatus_Clock"; - this.StripStatus_Clock.Size = new System.Drawing.Size(39, 18); + this.StripStatus_Clock.Size = new System.Drawing.Size(74, 30); this.StripStatus_Clock.Text = "Clock"; // // UIUpdateTimer @@ -784,58 +790,70 @@ private void InitializeComponent() { this.MainDockPanel.DockRightPortion = 150D; this.MainDockPanel.DockTopPortion = 150D; this.MainDockPanel.DocumentStyle = WeifenLuo.WinFormsUI.Docking.DocumentStyle.DockingWindow; - this.MainDockPanel.Location = new System.Drawing.Point(0, 26); + this.MainDockPanel.Location = new System.Drawing.Point(0, 42); this.MainDockPanel.Name = "MainDockPanel"; this.MainDockPanel.ShowDocumentIcon = true; - this.MainDockPanel.Size = new System.Drawing.Size(640, 431); - dockPanelGradient4.EndColor = System.Drawing.SystemColors.ControlLight; - dockPanelGradient4.StartColor = System.Drawing.SystemColors.ControlLight; - autoHideStripSkin2.DockStripGradient = dockPanelGradient4; - tabGradient8.EndColor = System.Drawing.SystemColors.Control; - tabGradient8.StartColor = System.Drawing.SystemColors.Control; - tabGradient8.TextColor = System.Drawing.SystemColors.ControlDarkDark; - autoHideStripSkin2.TabGradient = tabGradient8; - autoHideStripSkin2.TextFont = new System.Drawing.Font("メイリオ", 9F); - dockPanelSkin2.AutoHideStripSkin = autoHideStripSkin2; - tabGradient9.EndColor = System.Drawing.SystemColors.ControlLightLight; - tabGradient9.StartColor = System.Drawing.SystemColors.ControlLightLight; - tabGradient9.TextColor = System.Drawing.SystemColors.ControlText; - dockPaneStripGradient2.ActiveTabGradient = tabGradient9; - dockPanelGradient5.EndColor = System.Drawing.SystemColors.Control; - dockPanelGradient5.StartColor = System.Drawing.SystemColors.Control; - dockPaneStripGradient2.DockStripGradient = dockPanelGradient5; - tabGradient10.EndColor = System.Drawing.SystemColors.ControlLight; - tabGradient10.StartColor = System.Drawing.SystemColors.ControlLight; - tabGradient10.TextColor = System.Drawing.SystemColors.ControlText; - dockPaneStripGradient2.InactiveTabGradient = tabGradient10; - dockPaneStripSkin2.DocumentGradient = dockPaneStripGradient2; - dockPaneStripSkin2.TextFont = new System.Drawing.Font("メイリオ", 9F); - tabGradient11.EndColor = System.Drawing.SystemColors.ActiveCaption; - tabGradient11.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical; - tabGradient11.StartColor = System.Drawing.SystemColors.GradientActiveCaption; - tabGradient11.TextColor = System.Drawing.SystemColors.ActiveCaptionText; - dockPaneStripToolWindowGradient2.ActiveCaptionGradient = tabGradient11; - tabGradient12.EndColor = System.Drawing.SystemColors.Control; - tabGradient12.StartColor = System.Drawing.SystemColors.Control; - tabGradient12.TextColor = System.Drawing.SystemColors.ControlText; - dockPaneStripToolWindowGradient2.ActiveTabGradient = tabGradient12; - dockPanelGradient6.EndColor = System.Drawing.SystemColors.ControlLight; - dockPanelGradient6.StartColor = System.Drawing.SystemColors.ControlLight; - dockPaneStripToolWindowGradient2.DockStripGradient = dockPanelGradient6; - tabGradient13.EndColor = System.Drawing.SystemColors.InactiveCaption; - tabGradient13.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical; - tabGradient13.StartColor = System.Drawing.SystemColors.GradientInactiveCaption; - tabGradient13.TextColor = System.Drawing.SystemColors.InactiveCaptionText; - dockPaneStripToolWindowGradient2.InactiveCaptionGradient = tabGradient13; - tabGradient14.EndColor = System.Drawing.Color.Transparent; - tabGradient14.StartColor = System.Drawing.Color.Transparent; - tabGradient14.TextColor = System.Drawing.SystemColors.ControlDarkDark; - dockPaneStripToolWindowGradient2.InactiveTabGradient = tabGradient14; - dockPaneStripSkin2.ToolWindowGradient = dockPaneStripToolWindowGradient2; - dockPanelSkin2.DockPaneStripSkin = dockPaneStripSkin2; - this.MainDockPanel.Skin = dockPanelSkin2; + this.MainDockPanel.Size = new System.Drawing.Size(640, 403); + dockPanelGradient1.EndColor = System.Drawing.SystemColors.ControlLight; + dockPanelGradient1.StartColor = System.Drawing.SystemColors.ControlLight; + autoHideStripSkin1.DockStripGradient = dockPanelGradient1; + tabGradient1.EndColor = System.Drawing.SystemColors.Control; + tabGradient1.StartColor = System.Drawing.SystemColors.Control; + tabGradient1.TextColor = System.Drawing.SystemColors.ControlDarkDark; + autoHideStripSkin1.TabGradient = tabGradient1; + autoHideStripSkin1.TextFont = new System.Drawing.Font("メイリオ", 9F); + dockPanelSkin1.AutoHideStripSkin = autoHideStripSkin1; + tabGradient2.EndColor = System.Drawing.SystemColors.ControlLightLight; + tabGradient2.StartColor = System.Drawing.SystemColors.ControlLightLight; + tabGradient2.TextColor = System.Drawing.SystemColors.ControlText; + dockPaneStripGradient1.ActiveTabGradient = tabGradient2; + dockPanelGradient2.EndColor = System.Drawing.SystemColors.Control; + dockPanelGradient2.StartColor = System.Drawing.SystemColors.Control; + dockPaneStripGradient1.DockStripGradient = dockPanelGradient2; + tabGradient3.EndColor = System.Drawing.SystemColors.ControlLight; + tabGradient3.StartColor = System.Drawing.SystemColors.ControlLight; + tabGradient3.TextColor = System.Drawing.SystemColors.ControlText; + dockPaneStripGradient1.InactiveTabGradient = tabGradient3; + dockPaneStripSkin1.DocumentGradient = dockPaneStripGradient1; + dockPaneStripSkin1.TextFont = new System.Drawing.Font("メイリオ", 9F); + tabGradient4.EndColor = System.Drawing.SystemColors.ActiveCaption; + tabGradient4.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical; + tabGradient4.StartColor = System.Drawing.SystemColors.GradientActiveCaption; + tabGradient4.TextColor = System.Drawing.SystemColors.ActiveCaptionText; + dockPaneStripToolWindowGradient1.ActiveCaptionGradient = tabGradient4; + tabGradient5.EndColor = System.Drawing.SystemColors.Control; + tabGradient5.StartColor = System.Drawing.SystemColors.Control; + tabGradient5.TextColor = System.Drawing.SystemColors.ControlText; + dockPaneStripToolWindowGradient1.ActiveTabGradient = tabGradient5; + dockPanelGradient3.EndColor = System.Drawing.SystemColors.ControlLight; + dockPanelGradient3.StartColor = System.Drawing.SystemColors.ControlLight; + dockPaneStripToolWindowGradient1.DockStripGradient = dockPanelGradient3; + tabGradient6.EndColor = System.Drawing.SystemColors.InactiveCaption; + tabGradient6.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical; + tabGradient6.StartColor = System.Drawing.SystemColors.GradientInactiveCaption; + tabGradient6.TextColor = System.Drawing.SystemColors.InactiveCaptionText; + dockPaneStripToolWindowGradient1.InactiveCaptionGradient = tabGradient6; + tabGradient7.EndColor = System.Drawing.Color.Transparent; + tabGradient7.StartColor = System.Drawing.Color.Transparent; + tabGradient7.TextColor = System.Drawing.SystemColors.ControlDarkDark; + dockPaneStripToolWindowGradient1.InactiveTabGradient = tabGradient7; + dockPaneStripSkin1.ToolWindowGradient = dockPaneStripToolWindowGradient1; + dockPanelSkin1.DockPaneStripSkin = dockPaneStripSkin1; + this.MainDockPanel.Skin = dockPanelSkin1; this.MainDockPanel.TabIndex = 0; // + // StripMenu_Tool_ResourceChart + // + this.StripMenu_Tool_ResourceChart.Name = "StripMenu_Tool_ResourceChart"; + this.StripMenu_Tool_ResourceChart.Size = new System.Drawing.Size(244, 34); + this.StripMenu_Tool_ResourceChart.Text = "資源チャート(&C)"; + this.StripMenu_Tool_ResourceChart.Click += new System.EventHandler(this.StripMenu_Tool_ResourceChart_Click); + // + // toolStripSeparator15 + // + this.toolStripSeparator15.Name = "toolStripSeparator15"; + this.toolStripSeparator15.Size = new System.Drawing.Size(241, 6); + // // FormMain // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; @@ -947,5 +965,7 @@ private void InitializeComponent() { private System.Windows.Forms.ToolStripMenuItem StripMenu_WindowCapture_SubWindow; private System.Windows.Forms.ToolStripMenuItem StripMenu_WindowCapture_AttachAll; private System.Windows.Forms.ToolStripMenuItem StripMenu_WindowCapture_DetachAll; + private System.Windows.Forms.ToolStripMenuItem StripMenu_Tool_ResourceChart; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator15; } } diff --git a/ElectronicObserver/Window/FormMain.cs b/ElectronicObserver/Window/FormMain.cs index a7e0e0276..ae9df7633 100644 --- a/ElectronicObserver/Window/FormMain.cs +++ b/ElectronicObserver/Window/FormMain.cs @@ -873,6 +873,11 @@ private void StripMenu_File_Layout_Open_Click( object sender, EventArgs e ) { } + private void StripMenu_Tool_ResourceChart_Click( object sender, EventArgs e ) { + + new Dialog.DialogResourceChart().Show( this ); + + } @@ -1052,6 +1057,7 @@ private void StripMenu_WindowCapture_SubWindow_Click( object sender, EventArgs e #endregion + From 9727267d25146d84b9b53fd07ea805e0593a9ef3 Mon Sep 17 00:00:00 2001 From: Andante Date: Tue, 2 Jun 2015 15:38:44 +0900 Subject: [PATCH 11/26] =?UTF-8?q?UI=E3=81=9D=E3=81=AE=E4=BB=96=E3=81=AE?= =?UTF-8?q?=E5=BE=AE=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ElectronicObserver/Observer/APIKancolleDB.cs | 20 +-- .../Dialog/DialogConfiguration.Designer.cs | 161 ++++++++++++------ .../Window/Dialog/DialogConfiguration.cs | 62 ++++--- .../Window/Dialog/DialogConfiguration.resx | 6 + 4 files changed, 162 insertions(+), 87 deletions(-) diff --git a/ElectronicObserver/Observer/APIKancolleDB.cs b/ElectronicObserver/Observer/APIKancolleDB.cs index fc5f89f20..f2a8e2ee6 100644 --- a/ElectronicObserver/Observer/APIKancolleDB.cs +++ b/ElectronicObserver/Observer/APIKancolleDB.cs @@ -11,7 +11,11 @@ using System.Web; namespace ElectronicObserver.Observer { - + + /// + /// 艦これ統計データベースへのデータ送信処理を行います。 + /// + /// http://kancolle-db.net/ public class APIKancolleDB { public enum APIType : int { @@ -65,6 +69,7 @@ public enum APIType : int { { APIType.COMBINED_BATTLE_RESULT, "/kcsapi/api_req_combined_battle/battleresult" } }; + public APIKancolleDB() { Utility.Configuration.Instance.ConfigurationChanged += ConfigurationChanged; @@ -81,7 +86,7 @@ private void ConfigurationChanged() { if ( Utility.Configuration.Config.Connection.UseUpstreamProxy ) { Proxy = new WebProxy( "127.0.0.1", Utility.Configuration.Config.Connection.Port ); - }else { + } else { Proxy = null; } } @@ -94,7 +99,6 @@ private void ConfigurationChanged() { /// /// read the after-session, determinate whether it will send to kancolle-db.net /// - /// public void ExecuteSession( Session oSession ) { if ( SendDBApis == 0 || string.IsNullOrEmpty( OAuth ) ) { @@ -152,15 +156,11 @@ private void PostToServer( Session oSession ) { wc.UploadValuesCompleted += ( sender, e ) => { if ( e.Error != null ) { - using ( var output = new StreamWriter( @"kancolle-db.log", true, Encoding.UTF8 ) ) { - output.WriteLine( "[{0}] - {1}: {2}", DateTime.Now, - url.Substring( url.IndexOf( "/api" ) + 1 ), - e.Error ); + Utility.ErrorReporter.SendErrorReport( e.Error, string.Format( "艦これ統計データベースへの {0} の送信に失敗しました。", url.Substring( url.IndexOf( "/api" ) + 1 ) ) ); - } } else { - Utility.Logger.Add( 1, string.Format( "{0}のデータを送信しました。", url.Substring( url.IndexOf( "/api" ) + 1 ) ) ); + Utility.Logger.Add( 1, string.Format( "艦これ統計データベースへ {0} を送信しました。", url.Substring( url.IndexOf( "/api" ) + 1 ) ) ); } }; @@ -170,7 +170,7 @@ private void PostToServer( Session oSession ) { } catch ( Exception ex ) { - Utility.ErrorReporter.SendErrorReport( ex, "kancolle-db.netの送信中にエラーが発生しました。" ); + Utility.ErrorReporter.SendErrorReport( ex, "艦これ統計データベースへの送信中にエラーが発生しました。" ); } } diff --git a/ElectronicObserver/Window/Dialog/DialogConfiguration.Designer.cs b/ElectronicObserver/Window/Dialog/DialogConfiguration.Designer.cs index 26bc4304c..a0ca32d2a 100644 --- a/ElectronicObserver/Window/Dialog/DialogConfiguration.Designer.cs +++ b/ElectronicObserver/Window/Dialog/DialogConfiguration.Designer.cs @@ -26,10 +26,6 @@ private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabPage1 = new System.Windows.Forms.TabPage(); - this.checkedListBoxKdb = new System.Windows.Forms.CheckedListBox(); - this.textBoxKdbToken = new System.Windows.Forms.TextBox(); - this.labelKdb = new System.Windows.Forms.Label(); - this.checkBoxKdb = new System.Windows.Forms.CheckBox(); this.Connection_UpstreamProxyPort = new System.Windows.Forms.NumericUpDown(); this.Connection_UseUpstreamProxy = new System.Windows.Forms.CheckBox(); this.Connection_RegisterAsSystemProxy = new System.Windows.Forms.CheckBox(); @@ -142,6 +138,14 @@ private void InitializeComponent() { this.Notification_Repair = new System.Windows.Forms.Button(); this.Notification_Construction = new System.Windows.Forms.Button(); this.Notification_Expedition = new System.Windows.Forms.Button(); + this.tabPage15 = new System.Windows.Forms.TabPage(); + this.label23 = new System.Windows.Forms.Label(); + this.Database_LinkKCDB = new System.Windows.Forms.LinkLabel(); + this.label22 = new System.Windows.Forms.Label(); + this.Database_SendKancolleDBApis = new System.Windows.Forms.CheckedListBox(); + this.Database_SendKancolleOAuth = new System.Windows.Forms.TextBox(); + this.labelKdb = new System.Windows.Forms.Label(); + this.Database_SendDataToKancolleDB = new System.Windows.Forms.CheckBox(); this.ToolTipInfo = new System.Windows.Forms.ToolTip(this.components); this.ButtonOK = new System.Windows.Forms.Button(); this.ButtonCancel = new System.Windows.Forms.Button(); @@ -176,6 +180,7 @@ private void InitializeComponent() { this.tabPage14.SuspendLayout(); this.groupBox4.SuspendLayout(); this.tabPage11.SuspendLayout(); + this.tabPage15.SuspendLayout(); this.SuspendLayout(); // // tabControl1 @@ -191,6 +196,7 @@ private void InitializeComponent() { this.tabControl1.Controls.Add(this.tabPage6); this.tabControl1.Controls.Add(this.tabPage7); this.tabControl1.Controls.Add(this.tabPage11); + this.tabControl1.Controls.Add(this.tabPage15); this.tabControl1.Location = new System.Drawing.Point(0, 0); this.tabControl1.Multiline = true; this.tabControl1.Name = "tabControl1"; @@ -200,10 +206,6 @@ private void InitializeComponent() { // // tabPage1 // - this.tabPage1.Controls.Add(this.checkedListBoxKdb); - this.tabPage1.Controls.Add(this.textBoxKdbToken); - this.tabPage1.Controls.Add(this.labelKdb); - this.tabPage1.Controls.Add(this.checkBoxKdb); this.tabPage1.Controls.Add(this.Connection_UpstreamProxyPort); this.tabPage1.Controls.Add(this.Connection_UseUpstreamProxy); this.tabPage1.Controls.Add(this.Connection_RegisterAsSystemProxy); @@ -213,48 +215,14 @@ private void InitializeComponent() { this.tabPage1.Controls.Add(this.Connection_SaveReceivedData); this.tabPage1.Controls.Add(this.Connection_Port); this.tabPage1.Controls.Add(this.label1); - this.tabPage1.Location = new System.Drawing.Point(4, 24); + this.tabPage1.Location = new System.Drawing.Point(4, 44); this.tabPage1.Name = "tabPage1"; this.tabPage1.Padding = new System.Windows.Forms.Padding(3); - this.tabPage1.Size = new System.Drawing.Size(456, 253); + this.tabPage1.Size = new System.Drawing.Size(456, 233); this.tabPage1.TabIndex = 0; this.tabPage1.Text = "通信"; this.tabPage1.UseVisualStyleBackColor = true; // - // checkedListBoxKdb - // - this.checkedListBoxKdb.FormattingEnabled = true; - this.checkedListBoxKdb.Location = new System.Drawing.Point(240, 183); - this.checkedListBoxKdb.Name = "checkedListBoxKdb"; - this.checkedListBoxKdb.Size = new System.Drawing.Size(208, 59); - this.checkedListBoxKdb.TabIndex = 12; - // - // textBoxKdbToken - // - this.textBoxKdbToken.Location = new System.Drawing.Point(87, 226); - this.textBoxKdbToken.Name = "textBoxKdbToken"; - this.textBoxKdbToken.Size = new System.Drawing.Size(144, 20); - this.textBoxKdbToken.TabIndex = 11; - // - // labelKdb - // - this.labelKdb.AutoSize = true; - this.labelKdb.Location = new System.Drawing.Point(8, 229); - this.labelKdb.Name = "labelKdb"; - this.labelKdb.Size = new System.Drawing.Size(73, 13); - this.labelKdb.TabIndex = 10; - this.labelKdb.Text = "OAuth認証:"; - // - // checkBoxKdb - // - this.checkBoxKdb.AutoSize = true; - this.checkBoxKdb.Location = new System.Drawing.Point(6, 208); - this.checkBoxKdb.Name = "checkBoxKdb"; - this.checkBoxKdb.Size = new System.Drawing.Size(126, 17); - this.checkBoxKdb.TabIndex = 9; - this.checkBoxKdb.Text = "kancolle-db.netに送信する"; - this.checkBoxKdb.UseVisualStyleBackColor = true; - // // Connection_UpstreamProxyPort // this.Connection_UpstreamProxyPort.Location = new System.Drawing.Point(164, 35); @@ -1399,10 +1367,10 @@ private void InitializeComponent() { // tabPage14 // this.tabPage14.Controls.Add(this.groupBox4); - this.tabPage14.Location = new System.Drawing.Point(4, 24); + this.tabPage14.Location = new System.Drawing.Point(4, 34); this.tabPage14.Name = "tabPage14"; this.tabPage14.Padding = new System.Windows.Forms.Padding(3); - this.tabPage14.Size = new System.Drawing.Size(442, 219); + this.tabPage14.Size = new System.Drawing.Size(442, 209); this.tabPage14.TabIndex = 5; this.tabPage14.Text = "ブラウザ2"; this.tabPage14.UseVisualStyleBackColor = true; @@ -1539,6 +1507,93 @@ private void InitializeComponent() { this.Notification_Expedition.UseVisualStyleBackColor = true; this.Notification_Expedition.Click += new System.EventHandler(this.Notification_Expedition_Click); // + // tabPage15 + // + this.tabPage15.Controls.Add(this.label23); + this.tabPage15.Controls.Add(this.Database_LinkKCDB); + this.tabPage15.Controls.Add(this.label22); + this.tabPage15.Controls.Add(this.Database_SendKancolleDBApis); + this.tabPage15.Controls.Add(this.Database_SendKancolleOAuth); + this.tabPage15.Controls.Add(this.labelKdb); + this.tabPage15.Controls.Add(this.Database_SendDataToKancolleDB); + this.tabPage15.Location = new System.Drawing.Point(4, 44); + this.tabPage15.Name = "tabPage15"; + this.tabPage15.Padding = new System.Windows.Forms.Padding(3); + this.tabPage15.Size = new System.Drawing.Size(456, 233); + this.tabPage15.TabIndex = 8; + this.tabPage15.Text = "データベース"; + this.tabPage15.UseVisualStyleBackColor = true; + // + // label23 + // + this.label23.AutoSize = true; + this.label23.Location = new System.Drawing.Point(8, 101); + this.label23.Name = "label23"; + this.label23.Size = new System.Drawing.Size(52, 15); + this.label23.TabIndex = 18; + this.label23.Text = "フィルタ:"; + this.ToolTipInfo.SetToolTip(this.label23, "チェックしたAPIのみ送信します。"); + // + // Database_LinkKCDB + // + this.Database_LinkKCDB.AutoSize = true; + this.Database_LinkKCDB.Location = new System.Drawing.Point(8, 35); + this.Database_LinkKCDB.Name = "Database_LinkKCDB"; + this.Database_LinkKCDB.Size = new System.Drawing.Size(141, 15); + this.Database_LinkKCDB.TabIndex = 17; + this.Database_LinkKCDB.TabStop = true; + this.Database_LinkKCDB.Text = "http://kancolle-db.net/"; + this.Database_LinkKCDB.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.Database_LinkKCDB_LinkClicked); + // + // label22 + // + this.label22.AutoSize = true; + this.label22.Location = new System.Drawing.Point(8, 3); + this.label22.Name = "label22"; + this.label22.Size = new System.Drawing.Size(414, 30); + this.label22.TabIndex = 16; + this.label22.Text = "「艦これ統計データベース」へデータを送信できます。\r\n詳細やアクセスキーの取得は以下のサイトを参照してください。(外部ブラウザが開きます)"; + // + // Database_SendKancolleDBApis + // + this.Database_SendKancolleDBApis.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left))); + this.Database_SendKancolleDBApis.CheckOnClick = true; + this.Database_SendKancolleDBApis.FormattingEnabled = true; + this.Database_SendKancolleDBApis.IntegralHeight = false; + this.Database_SendKancolleDBApis.Location = new System.Drawing.Point(6, 119); + this.Database_SendKancolleDBApis.Name = "Database_SendKancolleDBApis"; + this.Database_SendKancolleDBApis.Size = new System.Drawing.Size(212, 108); + this.Database_SendKancolleDBApis.TabIndex = 15; + // + // Database_SendKancolleOAuth + // + this.Database_SendKancolleOAuth.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.Database_SendKancolleOAuth.Location = new System.Drawing.Point(89, 75); + this.Database_SendKancolleOAuth.Name = "Database_SendKancolleOAuth"; + this.Database_SendKancolleOAuth.Size = new System.Drawing.Size(359, 23); + this.Database_SendKancolleOAuth.TabIndex = 14; + // + // labelKdb + // + this.labelKdb.AutoSize = true; + this.labelKdb.Location = new System.Drawing.Point(8, 78); + this.labelKdb.Name = "labelKdb"; + this.labelKdb.Size = new System.Drawing.Size(75, 15); + this.labelKdb.TabIndex = 13; + this.labelKdb.Text = "アクセスキー:"; + // + // Database_SendDataToKancolleDB + // + this.Database_SendDataToKancolleDB.AutoSize = true; + this.Database_SendDataToKancolleDB.Location = new System.Drawing.Point(6, 53); + this.Database_SendDataToKancolleDB.Name = "Database_SendDataToKancolleDB"; + this.Database_SendDataToKancolleDB.Size = new System.Drawing.Size(203, 27); + this.Database_SendDataToKancolleDB.TabIndex = 12; + this.Database_SendDataToKancolleDB.Text = "艦これ統計データベースに送信する"; + this.Database_SendDataToKancolleDB.UseVisualStyleBackColor = true; + // // ToolTipInfo // this.ToolTipInfo.AutoPopDelay = 60000; @@ -1649,6 +1704,8 @@ private void InitializeComponent() { this.groupBox4.PerformLayout(); this.tabPage11.ResumeLayout(false); this.tabPage11.PerformLayout(); + this.tabPage15.ResumeLayout(false); + this.tabPage15.PerformLayout(); this.ResumeLayout(false); } @@ -1657,10 +1714,6 @@ private void InitializeComponent() { private System.Windows.Forms.TabControl tabControl1; private System.Windows.Forms.TabPage tabPage1; - private System.Windows.Forms.CheckedListBox checkedListBoxKdb; - private System.Windows.Forms.TextBox textBoxKdbToken; - private System.Windows.Forms.Label labelKdb; - private System.Windows.Forms.CheckBox checkBoxKdb; private System.Windows.Forms.Label label4; private System.Windows.Forms.Panel Connection_PanelSaveData; private System.Windows.Forms.ToolTip ToolTipInfo; @@ -1780,5 +1833,13 @@ private void InitializeComponent() { private System.Windows.Forms.ComboBox FormBrowser_FlashWMode; private System.Windows.Forms.Label label20; private System.Windows.Forms.ComboBox FormBrowser_FlashQuality; + private System.Windows.Forms.TabPage tabPage15; + private System.Windows.Forms.Label label23; + private System.Windows.Forms.LinkLabel Database_LinkKCDB; + private System.Windows.Forms.Label label22; + private System.Windows.Forms.CheckedListBox Database_SendKancolleDBApis; + private System.Windows.Forms.TextBox Database_SendKancolleOAuth; + private System.Windows.Forms.Label labelKdb; + private System.Windows.Forms.CheckBox Database_SendDataToKancolleDB; } } \ No newline at end of file diff --git a/ElectronicObserver/Window/Dialog/DialogConfiguration.cs b/ElectronicObserver/Window/Dialog/DialogConfiguration.cs index 45796dad1..645a78fa6 100644 --- a/ElectronicObserver/Window/Dialog/DialogConfiguration.cs +++ b/ElectronicObserver/Window/Dialog/DialogConfiguration.cs @@ -112,15 +112,7 @@ private void DialogConfiguration_Load( object sender, EventArgs e ) { this.Icon = ResourceManager.ImageToIcon( ResourceManager.Instance.Icons.Images[(int)ResourceManager.IconContent.FormConfiguration] ); - checkedListBoxKdb.Items.AddRange( Enum.GetNames( typeof( APIKancolleDB.APIType ) ) ); - // kancolle-db settings - { - uint apiMask = Utility.Configuration.Config.Connection.SendKancolleDBApis; - for ( int i = 0; i < checkedListBoxKdb.Items.Count; i++ ) { - checkedListBoxKdb.SetItemChecked( i, ( ( ( 1 << i ) & apiMask ) > 0 ) ); - } - } } @@ -278,8 +270,6 @@ public void FromConfiguration( Configuration.ConfigurationData config ) { Connection_RegisterAsSystemProxy.Checked = config.Connection.RegisterAsSystemProxy; Connection_UseUpstreamProxy.Checked = config.Connection.UseUpstreamProxy; Connection_UpstreamProxyPort.Value = config.Connection.UpstreamProxyPort; - checkBoxKdb.Checked = config.Connection.SendDataToKancolleDB; - textBoxKdbToken.Text = config.Connection.SendKancolleOAuth; //[UI] UI_MainFont.Font = config.UI.MainFont.FontData; @@ -375,6 +365,19 @@ public void FromConfiguration( Configuration.ConfigurationData config ) { FormBrowser_FlashQuality.Text = config.FormBrowser.FlashQuality; FormBrowser_FlashWMode.Text = config.FormBrowser.FlashWMode; + //[データベース] + Database_SendDataToKancolleDB.Checked = config.Connection.SendDataToKancolleDB; + Database_SendKancolleOAuth.Text = config.Connection.SendKancolleOAuth; + Database_SendKancolleDBApis.Items.Clear(); + Database_SendKancolleDBApis.Items.AddRange( Enum.GetNames( typeof( APIKancolleDB.APIType ) ) ); + { + uint apiMask = Utility.Configuration.Config.Connection.SendKancolleDBApis; + + for ( int i = 0; i < Database_SendKancolleDBApis.Items.Count; i++ ) { + Database_SendKancolleDBApis.SetItemChecked( i, ( ( ( 1 << i ) & apiMask ) > 0 ) ); + } + } + //finalize UpdateParameter(); } @@ -413,23 +416,6 @@ public void ToConfiguration( Configuration.ConfigurationData config ) { APIObserver.Instance.Start( config.Connection.Port, this ); } - // kancolle-db settings - { - config.Connection.SendDataToKancolleDB = checkBoxKdb.Checked; - config.Connection.SendKancolleOAuth = textBoxKdbToken.Text; - - uint apiMask = 0; - for ( int i = checkedListBoxKdb.Items.Count - 1; i >= 0; i-- ) { - - apiMask <<= 1; - - if ( checkedListBoxKdb.GetItemChecked( i ) ) { - apiMask |= 1; - } - } - - config.Connection.SendKancolleDBApis = apiMask; - } } //[UI] @@ -491,6 +477,23 @@ public void ToConfiguration( Configuration.ConfigurationData config ) { config.FormBrowser.FlashQuality = FormBrowser_FlashQuality.Text; config.FormBrowser.FlashWMode = FormBrowser_FlashWMode.Text; + //[データベース] + { + config.Connection.SendDataToKancolleDB = Database_SendDataToKancolleDB.Checked; + config.Connection.SendKancolleOAuth = Database_SendKancolleOAuth.Text; + + uint apiMask = 0; + for ( int i = Database_SendKancolleDBApis.Items.Count - 1; i >= 0; i-- ) { + + apiMask <<= 1; + + if ( Database_SendKancolleDBApis.GetItemChecked( i ) ) { + apiMask |= 1; + } + } + + config.Connection.SendKancolleDBApis = apiMask; + } } @@ -553,5 +556,10 @@ private void FormBrowser_DeleteRegistry_Click( object sender, EventArgs e ) { } } + + private void Database_LinkKCDB_LinkClicked( object sender, LinkLabelLinkClickedEventArgs e ) { + System.Diagnostics.Process.Start( "http://kancolle-db.net/" ); + } + } } diff --git a/ElectronicObserver/Window/Dialog/DialogConfiguration.resx b/ElectronicObserver/Window/Dialog/DialogConfiguration.resx index 5087138c2..65863a39c 100644 --- a/ElectronicObserver/Window/Dialog/DialogConfiguration.resx +++ b/ElectronicObserver/Window/Dialog/DialogConfiguration.resx @@ -120,6 +120,12 @@ 17, 17 + + 17, 17 + + + 17, 17 + 137, 17 From 93953b61ad1a9fae6dd05aa820a4acbe8d7065f1 Mon Sep 17 00:00:00 2001 From: Andante Date: Tue, 2 Jun 2015 21:59:09 +0900 Subject: [PATCH 12/26] =?UTF-8?q?=E5=9B=B3=E9=91=91=E3=81=AE=E7=A9=BA?= =?UTF-8?q?=E3=83=9A=E3=83=BC=E3=82=B8=E3=81=A7=E3=82=A8=E3=83=A9=E3=83=BC?= =?UTF-8?q?=E3=81=8C=E5=87=BA=E3=82=8B=E4=B8=8D=E5=85=B7=E5=90=88=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Observer/kcsapi/api_get_member/picture_book.cs | 5 +---- ElectronicObserver/Resource/Record/ShipParameterRecord.cs | 3 +++ ElectronicObserver/Window/FormInformation.cs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ElectronicObserver/Observer/kcsapi/api_get_member/picture_book.cs b/ElectronicObserver/Observer/kcsapi/api_get_member/picture_book.cs index 266e13f60..0a4d72d71 100644 --- a/ElectronicObserver/Observer/kcsapi/api_get_member/picture_book.cs +++ b/ElectronicObserver/Observer/kcsapi/api_get_member/picture_book.cs @@ -5,11 +5,8 @@ using System.Threading.Tasks; namespace ElectronicObserver.Observer.kcsapi.api_get_member { - - public class picture_book : APIBase { - - + public class picture_book : APIBase { public override string APIName { get { return "api_get_member/picture_book"; } diff --git a/ElectronicObserver/Resource/Record/ShipParameterRecord.cs b/ElectronicObserver/Resource/Record/ShipParameterRecord.cs index 262460329..ad40d7cf9 100644 --- a/ElectronicObserver/Resource/Record/ShipParameterRecord.cs +++ b/ElectronicObserver/Resource/Record/ShipParameterRecord.cs @@ -457,6 +457,9 @@ void ParameterLoaded( string apiname, dynamic data ) { /// private void AlbumOpened( string apiname, dynamic data ) { + if ( data == null || !data.api_list() ) //空のページ + return; + foreach ( dynamic elem in data.api_list ) { if ( !elem.api_yomi() ) break; //装備図鑑だった場合終了 diff --git a/ElectronicObserver/Window/FormInformation.cs b/ElectronicObserver/Window/FormInformation.cs index 0388b4859..8db4d1439 100644 --- a/ElectronicObserver/Window/FormInformation.cs +++ b/ElectronicObserver/Window/FormInformation.cs @@ -120,7 +120,7 @@ private string GetAlbumInfo( dynamic data ) { StringBuilder sb = new StringBuilder(); - if ( data.api_list != null ) { + if ( data != null && data.api_list() && data.api_list != null ) { if ( data.api_list[0].api_yomi() ) { //艦娘図鑑 From 084c9f69d6fce8ca2c78bcd1b2042d3bf7545b5e Mon Sep 17 00:00:00 2001 From: Andante Date: Tue, 2 Jun 2015 23:14:29 +0900 Subject: [PATCH 13/26] =?UTF-8?q?=E3=81=82=E5=8F=B7=EF=BC=9A=E9=81=94?= =?UTF-8?q?=E6=88=90=E6=B8=88=E3=81=BF=E3=81=AE=E6=9D=A1=E4=BB=B6=E3=82=92?= =?UTF-8?q?=E9=9D=9E=E8=A1=A8=E7=A4=BA=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ElectronicObserver/Data/Quest/ProgressAGo.cs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/ElectronicObserver/Data/Quest/ProgressAGo.cs b/ElectronicObserver/Data/Quest/ProgressAGo.cs index 5cb451a2d..cdf192006 100644 --- a/ElectronicObserver/Data/Quest/ProgressAGo.cs +++ b/ElectronicObserver/Data/Quest/ProgressAGo.cs @@ -19,13 +19,13 @@ public class ProgressAGo : ProgressData { /// [IgnoreDataMember] private int sortieMax { get { return 36; } } - + /// /// 達成に必要なS勝利回数 /// [IgnoreDataMember] private int sWinMax { get { return 6; } } - + /// /// 達成に必要なボス戦闘回数 /// @@ -211,11 +211,13 @@ public void IncrementBattle( string rank, bool isBoss ) { public override string ToString() { var list = new List(); - list.Add( new DSPair( Math.Min((double)sortieCount / sortieMax, 1.0 ), string.Format( "出撃 {0}/{1}", sortieCount, sortieMax ) ) ); - list.Add( new DSPair( Math.Min((double)sWinCount / sWinMax, 1.0 ), string.Format( "S勝利 {0}/{1}", sWinCount, sWinMax ) ) ); - list.Add( new DSPair( Math.Min((double)bossCount / bossMax, 1.0 ), string.Format( "ボス {0}/{1}", bossCount, bossMax ) ) ); - list.Add( new DSPair( Math.Min((double)bossWinCount / bossWinMax, 1.0 ), string.Format( "ボス勝利 {0}/{1}", bossWinCount, bossWinMax ) ) ); - return string.Format( "{0:p1} ({1})", ProgressPercentage, string.Join( ", ", list.OrderBy( elem => elem.Key ).Select( elem => elem.Value ) ) ); + list.Add( new DSPair( Math.Min( (double)sortieCount / sortieMax, 1.0 ), string.Format( "出撃 {0}/{1}", sortieCount, sortieMax ) ) ); + list.Add( new DSPair( Math.Min( (double)sWinCount / sWinMax, 1.0 ), string.Format( "S勝利 {0}/{1}", sWinCount, sWinMax ) ) ); + list.Add( new DSPair( Math.Min( (double)bossCount / bossMax, 1.0 ), string.Format( "ボス {0}/{1}", bossCount, bossMax ) ) ); + list.Add( new DSPair( Math.Min( (double)bossWinCount / bossWinMax, 1.0 ), string.Format( "ボス勝利 {0}/{1}", bossWinCount, bossWinMax ) ) ); + + var slist = list.Where( elem => elem.Key < 1.0 ).OrderBy( elem => elem.Key ).Select( elem => elem.Value ); + return string.Format( "{0:p1} ({1})", ProgressPercentage, slist.Count() > 0 ? string.Join( ", ", slist ) : "達成" ); } } From 3a8013fab105be6783fb3472c6a46c9dc3578831 Mon Sep 17 00:00:00 2001 From: Andante Date: Wed, 3 Jun 2015 00:11:32 +0900 Subject: [PATCH 14/26] =?UTF-8?q?=E8=88=AA=E7=A9=BA=E6=88=A6=E3=81=AEMVP?= =?UTF-8?q?=E8=A8=88=E7=AE=97=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ・任務進捗バグ対応 --- .../Data/Battle/Phase/PhaseAirBattle.cs | 34 ++++++++++++++----- ElectronicObserver/Data/QuestManager.cs | 12 +++++++ ElectronicObserver/Observer/APIObserver.cs | 2 +- 3 files changed, 39 insertions(+), 9 deletions(-) diff --git a/ElectronicObserver/Data/Battle/Phase/PhaseAirBattle.cs b/ElectronicObserver/Data/Battle/Phase/PhaseAirBattle.cs index 7be854765..c683b79d4 100644 --- a/ElectronicObserver/Data/Battle/Phase/PhaseAirBattle.cs +++ b/ElectronicObserver/Data/Battle/Phase/PhaseAirBattle.cs @@ -84,7 +84,7 @@ private void CalculateAttackDamage( int[] damages ) { } int totalFirepower = firepower.Sum(); - int totalDamage = Damages.Sum(); + int totalDamage = Damages.Skip( 6 ).Take( 6 ).Sum(); for ( int i = 0; i < 6; i++ ) { damages[i] += (int)( (double)totalDamage * firepower[i] / Math.Max( totalFirepower, 1 ) ); @@ -220,14 +220,32 @@ public ShipData AACutInShip { public int[] Damages { get { if ( AirBattleData.api_stage3_combined() ) { - return ( (int[])AirBattleData.api_stage3.api_fdam ).Skip( 1 ) - .Concat( ( (int[])AirBattleData.api_stage3.api_edam ).Skip( 1 ) ) - .Concat( ( (int[])AirBattleData.api_stage3_combined.api_fdam ).Skip( 1 ) ) - .ToArray(); + int[] ret = new int[18]; + + int[] friend = (int[])AirBattleData.api_stage3.api_fdam; + int[] enemy = (int[])AirBattleData.api_stage3.api_edam; + int[] escort = (int[])AirBattleData.api_stage3_combined.api_fdam; + + for ( int i = 0; i < 6; i++ ) { + ret[i] = friend[i]; + ret[i + 6] = enemy[i]; + ret[i + 12] = escort[i]; + } + + return ret; + } else { - return ( (int[])AirBattleData.api_stage3.api_fdam ).Skip( 1 ) - .Concat( ( (int[])AirBattleData.api_stage3.api_edam ).Skip( 1 ) ) - .ToArray(); + int[] ret = new int[12]; + + int[] friend = (int[])AirBattleData.api_stage3.api_fdam; + int[] enemy = (int[])AirBattleData.api_stage3.api_edam; + + for ( int i = 0; i < 6; i++ ) { + ret[i] = friend[i]; + ret[i + 6] = enemy[i]; + } + + return ret; } } } diff --git a/ElectronicObserver/Data/QuestManager.cs b/ElectronicObserver/Data/QuestManager.cs index 9a269da6c..29690d210 100644 --- a/ElectronicObserver/Data/QuestManager.cs +++ b/ElectronicObserver/Data/QuestManager.cs @@ -65,12 +65,24 @@ public override void LoadFromResponse( string apiname, dynamic data ) { //周期任務削除 if ( DateTimeHelper.IsCrossedDay( _prevTime, 5, 0, 0 ) ) { + KCDatabase.Instance.QuestProgress.Progresses.RemoveAll( p => { + var q = Quests[p.QuestID]; + return q != null && ( q.Type == 2 || q.Type == 4 || q.Type == 5 ); + } ); Quests.RemoveAll( q => q.Type == 2 || q.Type == 4 || q.Type == 5 ); } if ( DateTimeHelper.IsCrossedWeek( _prevTime, DayOfWeek.Monday, 5, 0, 0 ) ) { + KCDatabase.Instance.QuestProgress.Progresses.RemoveAll( p => { + var q = Quests[p.QuestID]; + return q != null && ( q.Type == 3 ); + } ); Quests.RemoveAll( q => q.Type == 3 ); } if ( DateTimeHelper.IsCrossedMonth( _prevTime, 1, 5, 0, 0 ) ) { + KCDatabase.Instance.QuestProgress.Progresses.RemoveAll( p => { + var q = Quests[p.QuestID]; + return q != null && ( q.Type == 6 ); + } ); Quests.RemoveAll( q => q.Type == 6 ); } diff --git a/ElectronicObserver/Observer/APIObserver.cs b/ElectronicObserver/Observer/APIObserver.cs index 76e243282..124705fc6 100644 --- a/ElectronicObserver/Observer/APIObserver.cs +++ b/ElectronicObserver/Observer/APIObserver.cs @@ -29,7 +29,7 @@ public static APIObserver Instance { #endregion - public APIDictionary APIList; + public APIDictionary APIList { get; private set; } public string ServerAddress { get; private set; } public int ProxyPort { get { return Fiddler.FiddlerApplication.oProxy.ListenPort; } } From a94da28db88daf3fa7dcf74d64e76a3671a2b3a3 Mon Sep 17 00:00:00 2001 From: Andante Date: Wed, 3 Jun 2015 09:06:15 +0900 Subject: [PATCH 15/26] =?UTF-8?q?=E8=88=AA=E7=A9=BA=E6=88=A6=E5=87=A6?= =?UTF-8?q?=E7=90=86=E3=81=AE=E8=AA=A4=E3=82=8A=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Data/Battle/Phase/PhaseAirBattle.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ElectronicObserver/Data/Battle/Phase/PhaseAirBattle.cs b/ElectronicObserver/Data/Battle/Phase/PhaseAirBattle.cs index c683b79d4..da99a8a20 100644 --- a/ElectronicObserver/Data/Battle/Phase/PhaseAirBattle.cs +++ b/ElectronicObserver/Data/Battle/Phase/PhaseAirBattle.cs @@ -87,7 +87,7 @@ private void CalculateAttackDamage( int[] damages ) { int totalDamage = Damages.Skip( 6 ).Take( 6 ).Sum(); for ( int i = 0; i < 6; i++ ) { - damages[i] += (int)( (double)totalDamage * firepower[i] / Math.Max( totalFirepower, 1 ) ); + damages[i] += (int)Math.Round( (double)totalDamage * firepower[i] / Math.Max( totalFirepower, 1 ) ); } } @@ -227,9 +227,9 @@ public int[] Damages { int[] escort = (int[])AirBattleData.api_stage3_combined.api_fdam; for ( int i = 0; i < 6; i++ ) { - ret[i] = friend[i]; - ret[i + 6] = enemy[i]; - ret[i + 12] = escort[i]; + ret[i] = Math.Max( friend[i + 1], 0 ); + ret[i + 6] = Math.Max( enemy[i + 1], 0 ); + ret[i + 12] = Math.Max( escort[i + 1], 0 ); } return ret; @@ -241,8 +241,8 @@ public int[] Damages { int[] enemy = (int[])AirBattleData.api_stage3.api_edam; for ( int i = 0; i < 6; i++ ) { - ret[i] = friend[i]; - ret[i + 6] = enemy[i]; + ret[i] = Math.Max( friend[i + 1], 0 ); + ret[i + 6] = Math.Max( enemy[i + 1], 0 ); } return ret; From 3cadd12044bb49caf255e60ef38bca41e81cea1c Mon Sep 17 00:00:00 2001 From: Andante Date: Wed, 3 Jun 2015 10:02:24 +0900 Subject: [PATCH 16/26] =?UTF-8?q?=E8=89=A6=E3=81=93=E3=82=8CDB=E3=81=AE?= =?UTF-8?q?=E3=82=A8=E3=83=A9=E3=83=BC=E3=83=AC=E3=83=9D=E3=83=BC=E3=83=88?= =?UTF-8?q?=E3=82=92=E6=8A=91=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ・結構な頻度で発生するためログに置換 --- ElectronicObserver/Observer/APIKancolleDB.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ElectronicObserver/Observer/APIKancolleDB.cs b/ElectronicObserver/Observer/APIKancolleDB.cs index f2a8e2ee6..4d793b133 100644 --- a/ElectronicObserver/Observer/APIKancolleDB.cs +++ b/ElectronicObserver/Observer/APIKancolleDB.cs @@ -157,7 +157,10 @@ private void PostToServer( Session oSession ) { wc.UploadValuesCompleted += ( sender, e ) => { if ( e.Error != null ) { - Utility.ErrorReporter.SendErrorReport( e.Error, string.Format( "艦これ統計データベースへの {0} の送信に失敗しました。", url.Substring( url.IndexOf( "/api" ) + 1 ) ) ); + // 結構頻繁に出るのでレポートは残さない方針で 申し訳ないです + //Utility.ErrorReporter.SendErrorReport( e.Error, string.Format( "艦これ統計データベースへの {0} の送信に失敗しました。", url.Substring( url.IndexOf( "/api" ) + 1 ) ) ); + + Utility.Logger.Add( 3, string.Format( "艦これ統計データベースへの {0} の送信に失敗しました。{1}", url.Substring( url.IndexOf( "/api" ) + 1 ), e.Error.Message ) ); } else { Utility.Logger.Add( 1, string.Format( "艦これ統計データベースへ {0} を送信しました。", url.Substring( url.IndexOf( "/api" ) + 1 ) ) ); From 59a847335f007224c3e2c96da8983c916157f488 Mon Sep 17 00:00:00 2001 From: Andante Date: Thu, 11 Jun 2015 19:36:31 +0900 Subject: [PATCH 17/26] =?UTF-8?q?=E8=B3=87=E6=BA=90=E3=83=81=E3=83=A3?= =?UTF-8?q?=E3=83=BC=E3=83=88=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dialog/DialogResourceChart.Designer.cs | 156 ++++- .../Window/Dialog/DialogResourceChart.cs | 540 ++++++++++++++++-- 2 files changed, 627 insertions(+), 69 deletions(-) diff --git a/ElectronicObserver/Window/Dialog/DialogResourceChart.Designer.cs b/ElectronicObserver/Window/Dialog/DialogResourceChart.Designer.cs index 0e73649e1..94d29f8f1 100644 --- a/ElectronicObserver/Window/Dialog/DialogResourceChart.Designer.cs +++ b/ElectronicObserver/Window/Dialog/DialogResourceChart.Designer.cs @@ -24,63 +24,169 @@ protected override void Dispose( bool disposing ) { /// private void InitializeComponent() { this.menuStrip1 = new System.Windows.Forms.MenuStrip(); - this.ResourceChart = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.Menu_Graph = new System.Windows.Forms.ToolStripMenuItem(); this.Menu_Graph_Resource = new System.Windows.Forms.ToolStripMenuItem(); + this.Menu_Graph_ResourceDiff = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.Menu_Graph_Material = new System.Windows.Forms.ToolStripMenuItem(); + this.Menu_Graph_MaterialDiff = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.Menu_Graph_Experience = new System.Windows.Forms.ToolStripMenuItem(); + this.Menu_Graph_ExperienceDiff = new System.Windows.Forms.ToolStripMenuItem(); + this.Menu_Span = new System.Windows.Forms.ToolStripMenuItem(); + this.Menu_Span_Day = new System.Windows.Forms.ToolStripMenuItem(); + this.Menu_Span_Week = new System.Windows.Forms.ToolStripMenuItem(); + this.Menu_Span_Month = new System.Windows.Forms.ToolStripMenuItem(); + this.Menu_Span_Season = new System.Windows.Forms.ToolStripMenuItem(); + this.Menu_Span_Year = new System.Windows.Forms.ToolStripMenuItem(); + this.Menu_Span_All = new System.Windows.Forms.ToolStripMenuItem(); + this.ResourceChart = new System.Windows.Forms.DataVisualization.Charting.Chart(); this.menuStrip1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.ResourceChart)).BeginInit(); this.SuspendLayout(); // // menuStrip1 // - this.menuStrip1.ImageScalingSize = new System.Drawing.Size(32, 32); this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.Menu_Graph}); + this.Menu_Graph, + this.Menu_Span}); this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Name = "menuStrip1"; - this.menuStrip1.Size = new System.Drawing.Size(774, 38); + this.menuStrip1.Size = new System.Drawing.Size(774, 42); this.menuStrip1.TabIndex = 0; this.menuStrip1.Text = "menuStrip1"; // - // ResourceChart - // - this.ResourceChart.Dock = System.Windows.Forms.DockStyle.Fill; - this.ResourceChart.Location = new System.Drawing.Point(0, 38); - this.ResourceChart.Name = "ResourceChart"; - this.ResourceChart.Size = new System.Drawing.Size(774, 491); - this.ResourceChart.TabIndex = 1; - this.ResourceChart.Text = "資源チャート"; - this.ResourceChart.GetToolTipText += new System.EventHandler(this.ResourceChart_GetToolTipText); - // // Menu_Graph // this.Menu_Graph.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.Menu_Graph_Resource, + this.Menu_Graph_ResourceDiff, + this.toolStripSeparator1, this.Menu_Graph_Material, - this.Menu_Graph_Experience}); + this.Menu_Graph_MaterialDiff, + this.toolStripSeparator2, + this.Menu_Graph_Experience, + this.Menu_Graph_ExperienceDiff}); this.Menu_Graph.Name = "Menu_Graph"; - this.Menu_Graph.Size = new System.Drawing.Size(183, 34); + this.Menu_Graph.Size = new System.Drawing.Size(183, 38); this.Menu_Graph.Text = "グラフの選択(&G)"; // // Menu_Graph_Resource // this.Menu_Graph_Resource.Name = "Menu_Graph_Resource"; - this.Menu_Graph_Resource.Size = new System.Drawing.Size(244, 34); + this.Menu_Graph_Resource.Size = new System.Drawing.Size(266, 34); this.Menu_Graph_Resource.Text = "資源(&R)"; + this.Menu_Graph_Resource.Click += new System.EventHandler(this.Menu_Graph_Resource_Click); + // + // Menu_Graph_ResourceDiff + // + this.Menu_Graph_ResourceDiff.Name = "Menu_Graph_ResourceDiff"; + this.Menu_Graph_ResourceDiff.Size = new System.Drawing.Size(266, 34); + this.Menu_Graph_ResourceDiff.Text = "資源(差分)(&E)"; + this.Menu_Graph_ResourceDiff.Click += new System.EventHandler(this.Menu_Graph_ResourceDiff_Click); + // + // toolStripSeparator1 + // + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(263, 6); // // Menu_Graph_Material // this.Menu_Graph_Material.Name = "Menu_Graph_Material"; - this.Menu_Graph_Material.Size = new System.Drawing.Size(244, 34); + this.Menu_Graph_Material.Size = new System.Drawing.Size(266, 34); this.Menu_Graph_Material.Text = "資材(&M)"; + this.Menu_Graph_Material.Click += new System.EventHandler(this.Menu_Graph_Material_Click); + // + // Menu_Graph_MaterialDiff + // + this.Menu_Graph_MaterialDiff.Name = "Menu_Graph_MaterialDiff"; + this.Menu_Graph_MaterialDiff.Size = new System.Drawing.Size(266, 34); + this.Menu_Graph_MaterialDiff.Text = "資材(差分)(&A)"; + this.Menu_Graph_MaterialDiff.Click += new System.EventHandler(this.Menu_Graph_MaterialDiff_Click); + // + // toolStripSeparator2 + // + this.toolStripSeparator2.Name = "toolStripSeparator2"; + this.toolStripSeparator2.Size = new System.Drawing.Size(263, 6); // // Menu_Graph_Experience // this.Menu_Graph_Experience.Name = "Menu_Graph_Experience"; - this.Menu_Graph_Experience.Size = new System.Drawing.Size(244, 34); + this.Menu_Graph_Experience.Size = new System.Drawing.Size(266, 34); this.Menu_Graph_Experience.Text = "経験値(&E)"; + this.Menu_Graph_Experience.Click += new System.EventHandler(this.Menu_Graph_Experience_Click); + // + // Menu_Graph_ExperienceDiff + // + this.Menu_Graph_ExperienceDiff.Name = "Menu_Graph_ExperienceDiff"; + this.Menu_Graph_ExperienceDiff.Size = new System.Drawing.Size(266, 34); + this.Menu_Graph_ExperienceDiff.Text = "経験値(差分)(&X)"; + this.Menu_Graph_ExperienceDiff.Click += new System.EventHandler(this.Menu_Graph_ExperienceDiff_Click); + // + // Menu_Span + // + this.Menu_Span.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.Menu_Span_Day, + this.Menu_Span_Week, + this.Menu_Span_Month, + this.Menu_Span_Season, + this.Menu_Span_Year, + this.Menu_Span_All}); + this.Menu_Span.Name = "Menu_Span"; + this.Menu_Span.Size = new System.Drawing.Size(110, 38); + this.Menu_Span.Text = "範囲(&S)"; + // + // Menu_Span_Day + // + this.Menu_Span_Day.Name = "Menu_Span_Day"; + this.Menu_Span_Day.Size = new System.Drawing.Size(183, 34); + this.Menu_Span_Day.Text = "日(&D)"; + this.Menu_Span_Day.Click += new System.EventHandler(this.Menu_Span_Day_Click); + // + // Menu_Span_Week + // + this.Menu_Span_Week.Name = "Menu_Span_Week"; + this.Menu_Span_Week.Size = new System.Drawing.Size(183, 34); + this.Menu_Span_Week.Text = "週(&W)"; + this.Menu_Span_Week.Click += new System.EventHandler(this.Menu_Span_Week_Click); + // + // Menu_Span_Month + // + this.Menu_Span_Month.Name = "Menu_Span_Month"; + this.Menu_Span_Month.Size = new System.Drawing.Size(183, 34); + this.Menu_Span_Month.Text = "月(&M)"; + this.Menu_Span_Month.Click += new System.EventHandler(this.Menu_Span_Month_Click); + // + // Menu_Span_Season + // + this.Menu_Span_Season.Name = "Menu_Span_Season"; + this.Menu_Span_Season.Size = new System.Drawing.Size(183, 34); + this.Menu_Span_Season.Text = "3ヵ月(&S)"; + this.Menu_Span_Season.Click += new System.EventHandler(this.Menu_Span_Season_Click); + // + // Menu_Span_Year + // + this.Menu_Span_Year.Name = "Menu_Span_Year"; + this.Menu_Span_Year.Size = new System.Drawing.Size(183, 34); + this.Menu_Span_Year.Text = "年(&Y)"; + this.Menu_Span_Year.Click += new System.EventHandler(this.Menu_Span_Year_Click); + // + // Menu_Span_All + // + this.Menu_Span_All.Name = "Menu_Span_All"; + this.Menu_Span_All.Size = new System.Drawing.Size(183, 34); + this.Menu_Span_All.Text = "すべて(&A)"; + this.Menu_Span_All.Click += new System.EventHandler(this.Menu_Span_All_Click); + // + // ResourceChart + // + this.ResourceChart.Dock = System.Windows.Forms.DockStyle.Fill; + this.ResourceChart.Location = new System.Drawing.Point(0, 42); + this.ResourceChart.Name = "ResourceChart"; + this.ResourceChart.Size = new System.Drawing.Size(774, 487); + this.ResourceChart.TabIndex = 1; + this.ResourceChart.Text = "資源チャート"; + this.ResourceChart.GetToolTipText += new System.EventHandler(this.ResourceChart_GetToolTipText); // // DialogResourceChart // @@ -109,5 +215,17 @@ private void InitializeComponent() { private System.Windows.Forms.ToolStripMenuItem Menu_Graph_Material; private System.Windows.Forms.ToolStripMenuItem Menu_Graph_Experience; private System.Windows.Forms.DataVisualization.Charting.Chart ResourceChart; + private System.Windows.Forms.ToolStripMenuItem Menu_Graph_ResourceDiff; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; + private System.Windows.Forms.ToolStripMenuItem Menu_Graph_MaterialDiff; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; + private System.Windows.Forms.ToolStripMenuItem Menu_Graph_ExperienceDiff; + private System.Windows.Forms.ToolStripMenuItem Menu_Span; + private System.Windows.Forms.ToolStripMenuItem Menu_Span_Day; + private System.Windows.Forms.ToolStripMenuItem Menu_Span_Month; + private System.Windows.Forms.ToolStripMenuItem Menu_Span_Week; + private System.Windows.Forms.ToolStripMenuItem Menu_Span_Year; + private System.Windows.Forms.ToolStripMenuItem Menu_Span_All; + private System.Windows.Forms.ToolStripMenuItem Menu_Span_Season; } } \ No newline at end of file diff --git a/ElectronicObserver/Window/Dialog/DialogResourceChart.cs b/ElectronicObserver/Window/Dialog/DialogResourceChart.cs index 900f6f4ae..fa18098f3 100644 --- a/ElectronicObserver/Window/Dialog/DialogResourceChart.cs +++ b/ElectronicObserver/Window/Dialog/DialogResourceChart.cs @@ -13,23 +13,63 @@ namespace ElectronicObserver.Window.Dialog { public partial class DialogResourceChart : Form { + + + private enum ChartType { + Resource, + ResourceDiff, + Material, + MaterialDiff, + Experience, + ExperienceDiff + } + + private enum ChartSpan { + Day, + Week, + Month, + Season, + Year, + All + } + + + + private ChartType SelectedChartType { + get { return (ChartType)GetSelectedMenuStripIndex( Menu_Graph ); } + } + + private ChartSpan SelectedChartSpan { + get { return (ChartSpan)GetSelectedMenuStripIndex( Menu_Span ); } + } + + + + public DialogResourceChart() { InitializeComponent(); } + + private void DialogResourceChart_Load( object sender, EventArgs e ) { + SwitchMenuStrip( Menu_Graph, 0 ); + SwitchMenuStrip( Menu_Span, 2 ); + //checkme: if レコードが未ロード or 0個の項目 then throw - SetResourceDiffChart( ChartSpan.Week ); + //SetResourceChart( _currentChartSpan ); + + UpdateChart(); } - private void SetResourceChart( ChartSpan cspan ) { + private void SetResourceChart() { ResourceChart.ChartAreas.Clear(); var area = ResourceChart.ChartAreas.Add( "ResourceChartArea" ); - area.AxisX = CreateAxisX( cspan ); + area.AxisX = CreateAxisX( SelectedChartSpan ); area.AxisY = CreateAxisY( 2000 ); ResourceChart.Legends.Clear(); @@ -69,47 +109,37 @@ private void SetResourceChart( ChartSpan cspan ) { //データ設定 { - var record = RecordManager.Instance.Resource.Record.AsEnumerable(); - - switch ( cspan ) { - case ChartSpan.Day: - record = record.Where( r => r.Date >= DateTime.Now.AddDays( -1 ) ); - break; - case ChartSpan.Week: - record = record.Where( r => r.Date >= DateTime.Now.AddDays( -7 ) ); - break; - case ChartSpan.Month: - record = record.Where( r => r.Date >= DateTime.Now.AddMonths( -1 ) ); - break; - case ChartSpan.Year: - record = record.Where( r => r.Date >= DateTime.Now.AddYears( -1 ) ); - break; - } + var record = GetRecords(); + var prev = record.First(); foreach ( var r in record ) { + if ( ShouldSkipRecord( r.Date - prev.Date ) ) + continue; + fuel.Points.AddXY( r.Date.ToOADate(), r.Fuel ); ammo.Points.AddXY( r.Date.ToOADate(), r.Ammo ); steel.Points.AddXY( r.Date.ToOADate(), r.Steel ); bauxite.Points.AddXY( r.Date.ToOADate(), r.Bauxite ); + prev = r; } int min = (int)new[] { fuel.Points.Min( p => p.YValues[0] ), ammo.Points.Min( p => p.YValues[0] ), steel.Points.Min( p => p.YValues[0] ), bauxite.Points.Min( p => p.YValues[0] ) }.Min(); - area.AxisY.Minimum = Math.Floor( min / 1000.0 ) * 1000; + area.AxisY.Minimum = Math.Floor( min / 10000.0 ) * 10000; int max = (int)new[] { fuel.Points.Max( p => p.YValues[0] ), ammo.Points.Max( p => p.YValues[0] ), steel.Points.Max( p => p.YValues[0] ), bauxite.Points.Max( p => p.YValues[0] ) }.Max(); - area.AxisY.Maximum = Math.Ceiling( max / 1000.0 ) * 1000; + area.AxisY.Maximum = Math.Ceiling( max / 10000.0 ) * 10000; } } - private void SetResourceDiffChart( ChartSpan cspan ) { + private void SetResourceDiffChart() { ResourceChart.ChartAreas.Clear(); var area = ResourceChart.ChartAreas.Add( "ResourceChartArea" ); - area.AxisX = CreateAxisX( cspan ); + area.AxisX = CreateAxisX( SelectedChartSpan ); area.AxisY = CreateAxisY( 200 ); ResourceChart.Legends.Clear(); @@ -151,27 +181,15 @@ private void SetResourceDiffChart( ChartSpan cspan ) { //データ設定 { - var record = RecordManager.Instance.Resource.Record.AsEnumerable(); - - switch ( cspan ) { - case ChartSpan.Day: - record = record.Where( r => r.Date >= DateTime.Now.AddDays( -1 ) ); - break; - case ChartSpan.Week: - record = record.Where( r => r.Date >= DateTime.Now.AddDays( -7 ) ); - break; - case ChartSpan.Month: - record = record.Where( r => r.Date >= DateTime.Now.AddMonths( -1 ) ); - break; - case ChartSpan.Year: - record = record.Where( r => r.Date >= DateTime.Now.AddYears( -1 ) ); - break; - } + var record = GetRecords(); + - var prev = record.First(); foreach ( var r in record ) { + if ( ShouldSkipRecord( r.Date - prev.Date ) ) + continue; + fuel.Points.AddXY( r.Date.ToOADate(), r.Fuel - prev.Fuel ); ammo.Points.AddXY( r.Date.ToOADate(), r.Ammo - prev.Ammo ); steel.Points.AddXY( r.Date.ToOADate(), r.Steel - prev.Steel ); @@ -191,6 +209,259 @@ record = record.Where( r => r.Date >= DateTime.Now.AddYears( -1 ) ); } + + private void SetMaterialChart() { + + ResourceChart.ChartAreas.Clear(); + var area = ResourceChart.ChartAreas.Add( "ResourceChartArea" ); + area.AxisX = CreateAxisX( SelectedChartSpan ); + area.AxisY = CreateAxisY( 50, 200 ); + + ResourceChart.Legends.Clear(); + var legend = ResourceChart.Legends.Add( "ResourceLegend" ); + legend.Font = Font; + + + ResourceChart.Series.Clear(); + + var instantConstruction = ResourceChart.Series.Add( "ResourceSeries_InstantConstruction" ); + var instantRepair = ResourceChart.Series.Add( "ResourceSeries_InstantRepair" ); + var developmentMaterial = ResourceChart.Series.Add( "ResourceSeries_DevelopmentMaterial" ); + var moddingMaterial = ResourceChart.Series.Add( "ResourceSeries_ModdingMaterial" ); + + var setSeries = new Action( s => { + s.ChartType = SeriesChartType.Line; + s.Font = Font; + s.XValueType = ChartValueType.DateTime; + } ); + + setSeries( instantConstruction ); + instantConstruction.Color = Color.FromArgb( 255, 128, 0 ); + instantConstruction.LegendText = "高速建造材"; + + setSeries( instantRepair ); + instantRepair.Color = Color.FromArgb( 0, 128, 0 ); + instantRepair.LegendText = "高速修復材"; + + setSeries( developmentMaterial ); + developmentMaterial.Color = Color.FromArgb( 0, 0, 255 ); + developmentMaterial.LegendText = "開発資材"; + + setSeries( moddingMaterial ); + moddingMaterial.Color = Color.FromArgb( 64, 64, 64 ); + moddingMaterial.LegendText = "改修資材"; + + + //データ設定 + { + var record = GetRecords(); + + var prev = record.First(); + foreach ( var r in record ) { + + if ( ShouldSkipRecord( r.Date - prev.Date ) ) + continue; + + instantConstruction.Points.AddXY( r.Date.ToOADate(), r.InstantConstruction ); + instantRepair.Points.AddXY( r.Date.ToOADate(), r.InstantRepair ); + developmentMaterial.Points.AddXY( r.Date.ToOADate(), r.DevelopmentMaterial ); + moddingMaterial.Points.AddXY( r.Date.ToOADate(), r.ModdingMaterial ); + + prev = r; + } + + int min = (int)new[] { instantConstruction.Points.Min( p => p.YValues[0] ), instantRepair.Points.Min( p => p.YValues[0] ), developmentMaterial.Points.Min( p => p.YValues[0] ), moddingMaterial.Points.Min( p => p.YValues[0] ) }.Min(); + area.AxisY.Minimum = Math.Floor( min / 200.0 ) * 200; + + int max = (int)new[] { instantConstruction.Points.Max( p => p.YValues[0] ), instantRepair.Points.Max( p => p.YValues[0] ), developmentMaterial.Points.Max( p => p.YValues[0] ), moddingMaterial.Points.Max( p => p.YValues[0] ) }.Max(); + area.AxisY.Maximum = Math.Ceiling( max / 200.0 ) * 200; + } + + } + + + private void SetMateialDiffChart() { + + ResourceChart.ChartAreas.Clear(); + var area = ResourceChart.ChartAreas.Add( "ResourceChartArea" ); + area.AxisX = CreateAxisX( SelectedChartSpan ); + area.AxisY = CreateAxisY( 5, 20 ); + + ResourceChart.Legends.Clear(); + var legend = ResourceChart.Legends.Add( "ResourceLegend" ); + legend.Font = Font; + + + ResourceChart.Series.Clear(); + + var instantConstruction = ResourceChart.Series.Add( "ResourceSeries_InstantConstruction" ); + var instantRepair = ResourceChart.Series.Add( "ResourceSeries_InstantRepair" ); + var developmentMaterial = ResourceChart.Series.Add( "ResourceSeries_DevelopmentMaterial" ); + var moddingMaterial = ResourceChart.Series.Add( "ResourceSeries_ModdingMaterial" ); + + var setSeries = new Action( s => { + s.ChartType = SeriesChartType.Area; + //s.SetCustomProperty( "PointWidth", "1.0" ); //棒グラフの幅 + //s.Enabled = false; //表示するか + s.Font = Font; + s.XValueType = ChartValueType.DateTime; + } ); + + setSeries( instantConstruction ); + instantConstruction.Color = Color.FromArgb( 64, 255, 128, 0 ); + instantConstruction.LegendText = "高速建造材"; + + setSeries( instantRepair ); + instantRepair.Color = Color.FromArgb( 64, 0, 128, 0 ); + instantRepair.LegendText = "高速修復材"; + + setSeries( developmentMaterial ); + developmentMaterial.Color = Color.FromArgb( 64, 0, 0, 255 ); + developmentMaterial.LegendText = "開発資材"; + + setSeries( moddingMaterial ); + moddingMaterial.Color = Color.FromArgb( 64, 64, 64, 64 ); + moddingMaterial.LegendText = "改修資材"; + + + //データ設定 + { + var record = GetRecords(); + + + var prev = record.First(); + foreach ( var r in record ) { + + if ( ShouldSkipRecord( r.Date - prev.Date ) ) + continue; + + instantConstruction.Points.AddXY( r.Date.ToOADate(), r.InstantConstruction - prev.InstantConstruction ); + instantRepair.Points.AddXY( r.Date.ToOADate(), r.InstantRepair - prev.InstantRepair ); + developmentMaterial.Points.AddXY( r.Date.ToOADate(), r.DevelopmentMaterial - prev.DevelopmentMaterial ); + moddingMaterial.Points.AddXY( r.Date.ToOADate(), r.ModdingMaterial - prev.ModdingMaterial ); + + prev = r; + } + + int min = (int)new[] { instantConstruction.Points.Min( p => p.YValues[0] ), instantRepair.Points.Min( p => p.YValues[0] ), developmentMaterial.Points.Min( p => p.YValues[0] ), moddingMaterial.Points.Min( p => p.YValues[0] ) }.Min(); + area.AxisY.Minimum = Math.Floor( min / 20.0 ) * 20; + + int max = (int)new[] { instantConstruction.Points.Max( p => p.YValues[0] ), instantRepair.Points.Max( p => p.YValues[0] ), developmentMaterial.Points.Max( p => p.YValues[0] ), moddingMaterial.Points.Max( p => p.YValues[0] ) }.Max(); + area.AxisY.Maximum = Math.Ceiling( max / 20.0 ) * 20; + + } + + } + + + + private void SetExperienceChart() { + + ResourceChart.ChartAreas.Clear(); + var area = ResourceChart.ChartAreas.Add( "ResourceChartArea" ); + area.AxisX = CreateAxisX( SelectedChartSpan ); + area.AxisY = CreateAxisY( 20000 ); + + ResourceChart.Legends.Clear(); + var legend = ResourceChart.Legends.Add( "ResourceLegend" ); + legend.Font = Font; + + + ResourceChart.Series.Clear(); + + var exp = ResourceChart.Series.Add( "ResourceSeries_Experience" ); + + var setSeries = new Action( s => { + s.ChartType = SeriesChartType.Line; + s.Font = Font; + s.XValueType = ChartValueType.DateTime; + } ); + + setSeries( exp ); + exp.Color = Color.FromArgb( 0, 0, 255 ); + exp.LegendText = "提督経験値"; + + + //データ設定 + { + var record = GetRecords(); + + var prev = record.First(); + foreach ( var r in record ) { + + if ( ShouldSkipRecord( r.Date - prev.Date ) ) + continue; + + exp.Points.AddXY( r.Date.ToOADate(), r.HQExp ); + prev = r; + } + + int min = (int)exp.Points.Min( p => p.YValues[0] ); + area.AxisY.Minimum = Math.Floor( min / 100000.0 ) * 100000; + + int max = (int)exp.Points.Max( p => p.YValues[0] ); + area.AxisY.Maximum = Math.Ceiling( max / 100000.0 ) * 100000; + } + + } + + + private void SetExperienceDiffChart() { + + ResourceChart.ChartAreas.Clear(); + var area = ResourceChart.ChartAreas.Add( "ResourceChartArea" ); + area.AxisX = CreateAxisX( SelectedChartSpan ); + area.AxisY = CreateAxisY( 2000 ); + + ResourceChart.Legends.Clear(); + var legend = ResourceChart.Legends.Add( "ResourceLegend" ); + legend.Font = Font; + + + ResourceChart.Series.Clear(); + + var exp = ResourceChart.Series.Add( "ResourceSeries_Experience" ); + + + var setSeries = new Action( s => { + s.ChartType = SeriesChartType.Area; + //s.SetCustomProperty( "PointWidth", "1.0" ); //棒グラフの幅 + //s.Enabled = false; //表示するか + s.Font = Font; + s.XValueType = ChartValueType.DateTime; + } ); + + setSeries( exp ); + exp.Color = Color.FromArgb( 192, 0, 0, 255 ); + exp.LegendText = "提督経験値"; + + + //データ設定 + { + var record = GetRecords(); + + var prev = record.First(); + foreach ( var r in record ) { + + if ( ShouldSkipRecord( r.Date - prev.Date ) ) + continue; + + exp.Points.AddXY( r.Date.ToOADate(), r.HQExp - prev.HQExp ); + + prev = r; + } + + int min = (int)exp.Points.Min( p => p.YValues[0] ); + area.AxisY.Minimum = Math.Floor( min / 10000.0 ) * 10000; + + int max = (int)exp.Points.Max( p => p.YValues[0] ); + area.AxisY.Maximum = Math.Ceiling( max / 10000.0 ) * 10000; + + } + + } + + private Axis CreateAxisX( ChartSpan span ) { Axis axis = new Axis(); @@ -211,6 +482,11 @@ private Axis CreateAxisX( ChartSpan span ) { axis.IntervalOffsetType = DateTimeIntervalType.Days; axis.IntervalType = DateTimeIntervalType.Days; break; + case ChartSpan.Season: + axis.Interval = 7; + axis.IntervalOffsetType = DateTimeIntervalType.Days; + axis.IntervalType = DateTimeIntervalType.Days; + break; case ChartSpan.Year: case ChartSpan.All: axis.Interval = 1; @@ -226,22 +502,27 @@ private Axis CreateAxisX( ChartSpan span ) { return axis; } - private Axis CreateAxisY( int interval ) { + + private Axis CreateAxisY( int minorInterval, int majorInterval ) { Axis axis = new Axis(); axis.LabelStyle.Font = Font; axis.IsStartedFromZero = true; - axis.Interval = interval * 5; + axis.Interval = majorInterval; axis.MajorGrid.LineColor = Color.FromArgb( 192, 192, 192 ); axis.MinorGrid.Enabled = true; - axis.MinorGrid.Interval = interval; + axis.MinorGrid.Interval = minorInterval; axis.MinorGrid.LineDashStyle = ChartDashStyle.Dash; axis.MinorGrid.LineColor = Color.FromArgb( 224, 224, 224 ); return axis; } + private Axis CreateAxisY( int interval ) { + return CreateAxisY( interval, interval * 5 ); + } + private void ResourceChart_GetToolTipText( object sender, ToolTipEventArgs e ) { @@ -252,14 +533,173 @@ private void ResourceChart_GetToolTipText( object sender, ToolTipEventArgs e ) { } } - } - public enum ChartSpan { - Day, - Week, - Month, - Year, - All + private void SwitchMenuStrip( ToolStripMenuItem parent, int index ) { + + //すべての子アイテムに対して + var items = parent.DropDownItems.Cast().Where( i => i is ToolStripMenuItem ).Select( i => i as ToolStripMenuItem ); + int c = 0; + + foreach ( var item in items ) { + if ( index == c ) { + + item.Checked = true; + + } else { + + item.Checked = false; + } + + c++; + } + + parent.Tag = index; + } + + + private int GetSelectedMenuStripIndex( ToolStripMenuItem parent ) { + + return parent.Tag as int? ?? -1; + } + + + private void UpdateChart() { + + switch ( SelectedChartType ) { + case ChartType.Resource: + SetResourceChart(); + break; + case ChartType.ResourceDiff: + SetResourceDiffChart(); + break; + case ChartType.Material: + SetMaterialChart(); + break; + case ChartType.MaterialDiff: + SetMateialDiffChart(); + break; + case ChartType.Experience: + SetExperienceChart(); + break; + case ChartType.ExperienceDiff: + SetExperienceDiffChart(); + break; + } + + } + + private IEnumerable GetRecords() { + + var record = RecordManager.Instance.Resource.Record.AsEnumerable(); + + switch ( SelectedChartSpan ) { + case ChartSpan.Day: + record = record.Where( r => r.Date >= DateTime.Now.AddDays( -1 ) ); + break; + case ChartSpan.Week: + record = record.Where( r => r.Date >= DateTime.Now.AddDays( -7 ) ); + break; + case ChartSpan.Month: + record = record.Where( r => r.Date >= DateTime.Now.AddMonths( -1 ) ); + break; + case ChartSpan.Season: + record = record.Where( r => r.Date >= DateTime.Now.AddMonths( -3 ) ); + break; + case ChartSpan.Year: + record = record.Where( r => r.Date >= DateTime.Now.AddYears( -1 ) ); + break; + } + + return record; + } + + + private bool ShouldSkipRecord( TimeSpan span ) { + + switch ( SelectedChartSpan ) { + case ChartSpan.Day: + case ChartSpan.Week: + default: + return false; + + case ChartSpan.Month: + return span.TotalHours < 12.0; + + case ChartSpan.Season: + case ChartSpan.Year: + case ChartSpan.All: + return span.TotalDays < 1.0; + } + + } + + + private void Menu_Graph_Resource_Click( object sender, EventArgs e ) { + SwitchMenuStrip( Menu_Graph, 0 ); + UpdateChart(); + } + + private void Menu_Graph_ResourceDiff_Click( object sender, EventArgs e ) { + SwitchMenuStrip( Menu_Graph, 1 ); + UpdateChart(); + } + + private void Menu_Graph_Material_Click( object sender, EventArgs e ) { + SwitchMenuStrip( Menu_Graph, 2 ); + UpdateChart(); + } + + private void Menu_Graph_MaterialDiff_Click( object sender, EventArgs e ) { + SwitchMenuStrip( Menu_Graph, 3 ); + UpdateChart(); + } + + private void Menu_Graph_Experience_Click( object sender, EventArgs e ) { + SwitchMenuStrip( Menu_Graph, 4 ); + UpdateChart(); + } + + private void Menu_Graph_ExperienceDiff_Click( object sender, EventArgs e ) { + SwitchMenuStrip( Menu_Graph, 5 ); + UpdateChart(); + } + + + private void Menu_Span_Day_Click( object sender, EventArgs e ) { + SwitchMenuStrip( Menu_Span, 0 ); + UpdateChart(); + } + + private void Menu_Span_Week_Click( object sender, EventArgs e ) { + SwitchMenuStrip( Menu_Span, 1 ); + UpdateChart(); + } + + private void Menu_Span_Month_Click( object sender, EventArgs e ) { + SwitchMenuStrip( Menu_Span, 2 ); + UpdateChart(); + } + + private void Menu_Span_Season_Click( object sender, EventArgs e ) { + SwitchMenuStrip( Menu_Span, 3 ); + UpdateChart(); + } + + private void Menu_Span_Year_Click( object sender, EventArgs e ) { + SwitchMenuStrip( Menu_Span, 4 ); + UpdateChart(); + } + + private void Menu_Span_All_Click( object sender, EventArgs e ) { + SwitchMenuStrip( Menu_Span, 5 ); + UpdateChart(); + } + + + + + } + } From 866187260b7b585a2fbe58bf7b9aa6db12de051f Mon Sep 17 00:00:00 2001 From: Andante Date: Thu, 11 Jun 2015 23:59:46 +0900 Subject: [PATCH 18/26] =?UTF-8?q?=E5=90=84=E7=A8=AE=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=E3=81=A8=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ・司令部:出撃中に艦船数/装備数の背景表示が変わらなかった不具合を修正 ・司令部:資源の増減ツールチップ表示を実装. ・艦隊:Lvツールチップを調整 ・羅針盤:索敵アイコンが残る不具合を修正 ・環境によって艦これDB設定が読み込まれない不具合に対応? --- .../Other/Information/kcmemo.md | 8 ++- ElectronicObserver/Utility/Configuration.cs | 5 +- .../Utility/SoftwareInformation.cs | 6 +- ElectronicObserver/Window/FormCompass.cs | 3 + ElectronicObserver/Window/FormFleet.cs | 8 +-- .../Window/FormHeadQuarters.Designer.cs | 4 ++ ElectronicObserver/Window/FormHeadquarters.cs | 58 +++++++++++++++---- 7 files changed, 68 insertions(+), 24 deletions(-) diff --git a/ElectronicObserver/Other/Information/kcmemo.md b/ElectronicObserver/Other/Information/kcmemo.md index 8bddde1a2..a4efa8524 100644 --- a/ElectronicObserver/Other/Information/kcmemo.md +++ b/ElectronicObserver/Other/Information/kcmemo.md @@ -565,7 +565,6 @@ CommonAssetsに存在する、敵艦装備グラフィックの置換処理ら なお、連合艦隊でなくても轟沈艦が存在した場合に同様の現象が起こる、との噂がある。 - #### 演習経験値バグ 演習で撃沈判定を受けた艦娘の経験値が減少するバグ。 @@ -575,11 +574,11 @@ CommonAssetsに存在する、敵艦装備グラフィックの置換処理ら 確かに戦闘結果のAPIの取得経験値の項目は -1 になっていたが、直接適用されたのは予想外。 Lv. 99の艦を以上の状態におき経験値を -1 させたところ、 Lv. 99 / 999999 exp. / next. 0 になった。 -この状態で別の戦闘を行ったところ、「次のレベルまで」は何も表示されなかった(通常のLv99と同じ扱い)が、実経験値は 1000000 exp.に戻っていた。 +この状態で別の戦闘を行ったところ、戦闘結果では「次のレベルまで」に何も表示されなかった(通常のLv99と同じ扱い)が、実経験値は 1000000 exp.に戻っていた。 exp を -1 した状態でもケッコンカッコカリを行うことができる。この場合は、 Lv. 100 / 999999 exp. / next. 10001 となった。 また、Lv. 1 / 0 exp. / next. 100 の状態でこの現象を発生させたところ、 Lv. 1 / -1 exp. / next. 101 となった。 -> 注: 経験値0の大破艦は、単艦で5-5に出撃した後戦闘結果を見る前に再読み込みすると入手することができる。 +> 注: 経験値0の大破艦は、単艦で5-5に出撃した後戦闘結果を見る前に再読み込みするとほぼ確実に入手することができる。 以上をまとめるとこのようになる。 @@ -615,6 +614,9 @@ exp を -1 した状態でもケッコンカッコカリを行うことができ よって、条件はこれだけでは不足であることが分かる。 このことから、「後から攻撃したほう」という条件が存在し(「先に攻撃したほう」については反例があるため)、このほうが優先度が高いのではないか、と推測した。 +> 雷撃戦においても「旗艦から順に雷撃している」と考えれば、6番艦に近いほう=後から攻撃したほうが優先されるのと辻褄が合う。 +> もっとも検証不足で推測の域を出ないが… + また、MVPになる条件として「与ダメージが1以上」が存在する。D敗北以上の判定で条件を満たす艦が1隻も存在しない場合(全員の与ダメージが0の場合)、後続条件にかかわらず旗艦がMVPとなる。 #### 突然の入渠API diff --git a/ElectronicObserver/Utility/Configuration.cs b/ElectronicObserver/Utility/Configuration.cs index d128e22e4..c01e826f8 100644 --- a/ElectronicObserver/Utility/Configuration.cs +++ b/ElectronicObserver/Utility/Configuration.cs @@ -794,9 +794,10 @@ internal void OnConfigurationChanged() { public void Load() { var temp = (ConfigurationData)_config.Load( SaveFileName ); - if ( temp != null ) + if ( temp != null ) { _config = temp; - else { + OnConfigurationChanged(); + } else { MessageBox.Show( SoftwareInformation.SoftwareNameJapanese + " をご利用いただきありがとうございます。\r\n設定や使用方法については「ヘルプ」→「オンラインヘルプ」を参照してください。\r\nご使用の前に必ずご一読ください。", "初回起動メッセージ", MessageBoxButtons.OK, MessageBoxIcon.Information ); } diff --git a/ElectronicObserver/Utility/SoftwareInformation.cs b/ElectronicObserver/Utility/SoftwareInformation.cs index 8499952ec..b9235a650 100644 --- a/ElectronicObserver/Utility/SoftwareInformation.cs +++ b/ElectronicObserver/Utility/SoftwareInformation.cs @@ -35,7 +35,7 @@ public static string SoftwareNameEnglish { /// public static string VersionJapanese { get { - return SoftwareNameJapanese + "一三型"; + return SoftwareNameJapanese + "一四型"; } } @@ -44,7 +44,7 @@ public static string VersionJapanese { /// public static string VersionEnglish { get { - return "1.3.0"; + return "1.4.0"; } } @@ -54,7 +54,7 @@ public static string VersionEnglish { /// public static DateTime UpdateTime { get { - return DateTimeHelper.CSVStringToTime( "2015/05/26 00:00:00" ); + return DateTimeHelper.CSVStringToTime( "2015/06/12 00:00:00" ); } } diff --git a/ElectronicObserver/Window/FormCompass.cs b/ElectronicObserver/Window/FormCompass.cs index de011580c..9db45db36 100644 --- a/ElectronicObserver/Window/FormCompass.cs +++ b/ElectronicObserver/Window/FormCompass.cs @@ -369,6 +369,9 @@ private void Updated( string apiname, dynamic data ) { TextMapArea.Text = "演習"; TextDestination.Text = string.Format( "{0} {1}", data.api_nickname, Constants.GetAdmiralRank( (int)data.api_rank ) ); + TextDestination.ImageAlign = ContentAlignment.MiddleCenter; + TextDestination.ImageIndex = -1; + ToolTipInfo.SetToolTip( TextDestination, null ); TextEventKind.Text = data.api_cmt; TextEventKind.ForeColor = getColorFromEventKind( 0 ); TextEventDetail.Text = string.Format( "Lv. {0} / {1} exp.", data.api_level, data.api_experience[0] ); diff --git a/ElectronicObserver/Window/FormFleet.cs b/ElectronicObserver/Window/FormFleet.cs index 9c42bc48c..9a5909ee7 100644 --- a/ElectronicObserver/Window/FormFleet.cs +++ b/ElectronicObserver/Window/FormFleet.cs @@ -363,16 +363,16 @@ public void Update( int shipMasterID ) { { StringBuilder tip = new StringBuilder(); if ( !Utility.Configuration.Config.FormFleet.ShowNextExp ) - tip.AppendFormat( "次のレベルまで: {0}\n", ship.ExpNext ); + tip.AppendFormat( "次のレベルまで: {0} exp.\n", ship.ExpNext ); if ( ship.MasterShip.RemodelAfterShipID != 0 && ship.Level < ship.MasterShip.RemodelAfterLevel ) { - tip.AppendFormat( "改装まで: {0}", ship.ExpNextRemodel ); + tip.AppendFormat( "改装まで: Lv. {0} / {1} exp.", ship.MasterShip.RemodelAfterLevel - ship.Level, ship.ExpNextRemodel ); } else if ( ship.Level <= 99 ) { - tip.AppendFormat( "Lv99まで: {0}", Math.Max( ExpTable.GetExpToLevelShip( ship.ExpTotal, 99 ), 0 ) ); + tip.AppendFormat( "Lv99まで: {0} exp.", Math.Max( ExpTable.GetExpToLevelShip( ship.ExpTotal, 99 ), 0 ) ); } else { - tip.AppendFormat( "Lv150まで: {0}", Math.Max( ExpTable.GetExpToLevelShip( ship.ExpTotal, 150 ), 0 ) ); + tip.AppendFormat( "Lv150まで: {0} exp.", Math.Max( ExpTable.GetExpToLevelShip( ship.ExpTotal, 150 ), 0 ) ); } diff --git a/ElectronicObserver/Window/FormHeadQuarters.Designer.cs b/ElectronicObserver/Window/FormHeadQuarters.Designer.cs index 59bb42cbc..655570b2d 100644 --- a/ElectronicObserver/Window/FormHeadQuarters.Designer.cs +++ b/ElectronicObserver/Window/FormHeadQuarters.Designer.cs @@ -238,6 +238,7 @@ private void InitializeComponent() { this.Fuel.Size = new System.Drawing.Size(54, 20); this.Fuel.TabIndex = 1; this.Fuel.Text = "(燃料)"; + this.Fuel.MouseClick += new System.Windows.Forms.MouseEventHandler(this.Resource_MouseClick); // // Ammo // @@ -249,6 +250,7 @@ private void InitializeComponent() { this.Ammo.Size = new System.Drawing.Size(54, 20); this.Ammo.TabIndex = 2; this.Ammo.Text = "(弾薬)"; + this.Ammo.MouseClick += new System.Windows.Forms.MouseEventHandler(this.Resource_MouseClick); // // Steel // @@ -260,6 +262,7 @@ private void InitializeComponent() { this.Steel.Size = new System.Drawing.Size(54, 20); this.Steel.TabIndex = 3; this.Steel.Text = "(鋼材)"; + this.Steel.MouseClick += new System.Windows.Forms.MouseEventHandler(this.Resource_MouseClick); // // Bauxite // @@ -271,6 +274,7 @@ private void InitializeComponent() { this.Bauxite.Size = new System.Drawing.Size(54, 20); this.Bauxite.TabIndex = 4; this.Bauxite.Text = "(軽銀)"; + this.Bauxite.MouseClick += new System.Windows.Forms.MouseEventHandler(this.Resource_MouseClick); // // ToolTipInfo // diff --git a/ElectronicObserver/Window/FormHeadquarters.cs b/ElectronicObserver/Window/FormHeadquarters.cs index de887929e..0413ee4e0 100644 --- a/ElectronicObserver/Window/FormHeadquarters.cs +++ b/ElectronicObserver/Window/FormHeadquarters.cs @@ -164,21 +164,15 @@ void Updated( string apiname, dynamic data ) { //Fleet FlowPanelFleet.SuspendLayout(); { - int dropShips = 0; - int dropEqps = 0; - if ( db.Battle != null ) { - dropShips = db.Battle.DroppedShipCount; - dropEqps = db.Battle.DroppedEquipmentCount; - } - ShipCount.Text = string.Format( "{0}/{1}", db.Ships.Count + dropShips, db.Admiral.MaxShipCount ); - if ( db.Ships.Count > db.Admiral.MaxShipCount - 5 ) + ShipCount.Text = string.Format( "{0}/{1}", RealShipCount, db.Admiral.MaxShipCount ); + if ( RealShipCount > db.Admiral.MaxShipCount - 5 ) ShipCount.BackColor = Color.LightCoral; else ShipCount.BackColor = Color.Transparent; - EquipmentCount.Text = string.Format( "{0}/{1}", db.Equipments.Count + dropEqps, db.Admiral.MaxEquipmentCount ); - if ( db.Equipments.Count > db.Admiral.MaxEquipmentCount + 3 - 20 ) + EquipmentCount.Text = string.Format( "{0}/{1}", RealEquipmentCount, db.Admiral.MaxEquipmentCount ); + if ( RealEquipmentCount > db.Admiral.MaxEquipmentCount + 3 - 20 ) EquipmentCount.BackColor = Color.LightCoral; else EquipmentCount.BackColor = Color.Transparent; @@ -199,17 +193,31 @@ void Updated( string apiname, dynamic data ) { FlowPanelResource.SuspendLayout(); { Color overcolor = Color.Moccasin; + + var resday = RecordManager.Instance.Resource.GetRecord( DateTime.Now.Date.AddHours( 5 ) ); + var resweek = RecordManager.Instance.Resource.GetRecord( DateTime.Now.Date.AddDays( -( ( (int)DateTime.Now.DayOfWeek + 6 ) % 7 ) ).AddHours( 5 ) ); //月曜日起点 + var resmonth = RecordManager.Instance.Resource.GetRecord( new DateTime( DateTime.Now.Year, DateTime.Now.Month, 1 ).AddHours( 5 ) ); + Fuel.Text = db.Material.Fuel.ToString(); Fuel.BackColor = db.Material.Fuel < db.Admiral.MaxResourceRegenerationAmount ? Color.Transparent : overcolor; + ToolTipInfo.SetToolTip( Fuel, string.Format( "今日: {0:+##;-##;±0}\n今週: {1:+##;-##;±0}\n今月: {2:+##;-##;±0}", + db.Material.Fuel - resday.Fuel, db.Material.Fuel - resweek.Fuel, db.Material.Fuel - resmonth.Fuel ) ); Ammo.Text = db.Material.Ammo.ToString(); Ammo.BackColor = db.Material.Ammo < db.Admiral.MaxResourceRegenerationAmount ? Color.Transparent : overcolor; + ToolTipInfo.SetToolTip( Ammo, string.Format( "今日: {0:+##;-##;±0}\n今週: {1:+##;-##;±0}\n今月: {2:+##;-##;±0}", + db.Material.Ammo - resday.Ammo, db.Material.Ammo - resweek.Ammo, db.Material.Ammo - resmonth.Ammo ) ); Steel.Text = db.Material.Steel.ToString(); Steel.BackColor = db.Material.Steel < db.Admiral.MaxResourceRegenerationAmount ? Color.Transparent : overcolor; + ToolTipInfo.SetToolTip( Steel, string.Format( "今日: {0:+##;-##;±0}\n今週: {1:+##;-##;±0}\n今月: {2:+##;-##;±0}", + db.Material.Steel - resday.Steel, db.Material.Steel - resweek.Steel, db.Material.Steel - resmonth.Steel ) ); Bauxite.Text = db.Material.Bauxite.ToString(); Bauxite.BackColor = db.Material.Bauxite < db.Admiral.MaxResourceRegenerationAmount ? Color.Transparent : overcolor; + ToolTipInfo.SetToolTip( Bauxite, string.Format( "今日: {0:+##;-##;±0}\n今週: {1:+##;-##;±0}\n今月: {2:+##;-##;±0}", + db.Material.Bauxite - resday.Bauxite, db.Material.Bauxite - resweek.Bauxite, db.Material.Bauxite - resmonth.Bauxite ) ); + } FlowPanelResource.ResumeLayout(); @@ -228,16 +236,42 @@ void SystemEvents_UpdateTimerTick() { if ( db.Ships.Count <= 0 ) return; - if ( db.Ships.Count >= db.Admiral.MaxShipCount ) { + if ( RealShipCount >= db.Admiral.MaxShipCount ) { ShipCount.BackColor = DateTime.Now.Second % 2 == 0 ? Color.LightCoral : Color.Transparent; } - if ( db.Equipments.Count >= db.Admiral.MaxEquipmentCount ) { + if ( RealEquipmentCount >= db.Admiral.MaxEquipmentCount ) { EquipmentCount.BackColor = DateTime.Now.Second % 2 == 0 ? Color.LightCoral : Color.Transparent; } } + private void Resource_MouseClick( object sender, MouseEventArgs e ) { + + new Dialog.DialogResourceChart().Show( this ); + + } + + + private int RealShipCount { + get { + if ( KCDatabase.Instance.Battle != null ) + return KCDatabase.Instance.Ships.Count + KCDatabase.Instance.Battle.DroppedShipCount; + + return KCDatabase.Instance.Ships.Count; + } + } + + private int RealEquipmentCount { + get { + if ( KCDatabase.Instance.Battle != null ) + return KCDatabase.Instance.Equipments.Count + KCDatabase.Instance.Battle.DroppedEquipmentCount; + + return KCDatabase.Instance.Equipments.Count; + } + } + + protected override string GetPersistString() { return "HeadQuarters"; } From 7fee55286a7fe82c60a9c1459d96a8a5409aaa96 Mon Sep 17 00:00:00 2001 From: Andante Date: Fri, 12 Jun 2015 00:33:06 +0900 Subject: [PATCH 19/26] =?UTF-8?q?=E3=83=AC=E3=82=B3=E3=83=BC=E3=83=89?= =?UTF-8?q?=E5=87=A6=E7=90=86=E3=81=AE=E3=83=9F=E3=82=B9=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ElectronicObserver/Window/FormHeadquarters.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ElectronicObserver/Window/FormHeadquarters.cs b/ElectronicObserver/Window/FormHeadquarters.cs index 0413ee4e0..d3bb6ec1b 100644 --- a/ElectronicObserver/Window/FormHeadquarters.cs +++ b/ElectronicObserver/Window/FormHeadquarters.cs @@ -194,9 +194,10 @@ void Updated( string apiname, dynamic data ) { { Color overcolor = Color.Moccasin; - var resday = RecordManager.Instance.Resource.GetRecord( DateTime.Now.Date.AddHours( 5 ) ); - var resweek = RecordManager.Instance.Resource.GetRecord( DateTime.Now.Date.AddDays( -( ( (int)DateTime.Now.DayOfWeek + 6 ) % 7 ) ).AddHours( 5 ) ); //月曜日起点 + var resday = RecordManager.Instance.Resource.GetRecord( DateTime.Now.AddHours( -5 ).Date.AddHours( 5 ) ); + var resweek = RecordManager.Instance.Resource.GetRecord( DateTime.Now.AddHours( -5 ).Date.AddDays( -( ( (int)DateTime.Now.AddHours( -5 ).DayOfWeek + 6 ) % 7 ) ).AddHours( 5 ) ); //月曜日起点 var resmonth = RecordManager.Instance.Resource.GetRecord( new DateTime( DateTime.Now.Year, DateTime.Now.Month, 1 ).AddHours( 5 ) ); + Fuel.Text = db.Material.Fuel.ToString(); Fuel.BackColor = db.Material.Fuel < db.Admiral.MaxResourceRegenerationAmount ? Color.Transparent : overcolor; From b5508c17c9a4bdad339404cf51146d4cca65f3b6 Mon Sep 17 00:00:00 2001 From: Andante Date: Fri, 12 Jun 2015 23:33:26 +0900 Subject: [PATCH 20/26] =?UTF-8?q?=E5=8F=B8=E4=BB=A4=E9=83=A8=EF=BC=9A?= =?UTF-8?q?=E3=83=AC=E3=82=B3=E3=83=BC=E3=83=89=E3=81=8C=E3=81=AA=E3=81=84?= =?UTF-8?q?=E3=81=A8=E3=81=8D=E8=90=BD=E3=81=A1=E3=82=8B=E4=B8=8D=E5=85=B7?= =?UTF-8?q?=E5=90=88=E3=81=AB=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ・資源チャート:レコードがないとき落ちる不具合に対応 ・ファイルからAPIをロード:ディレクトリがないと落ちる不具合を修正 ・〃:検索バーでEnterを押すだけで検索できるように --- .../Dialog/DialogLocalAPILoader2.Designer.cs | 1 + .../Window/Dialog/DialogLocalAPILoader2.cs | 11 +++++++++++ .../Window/Dialog/DialogResourceChart.cs | 9 ++++++--- ElectronicObserver/Window/FormHeadquarters.cs | 18 +++++++++++++----- 4 files changed, 31 insertions(+), 8 deletions(-) diff --git a/ElectronicObserver/Window/Dialog/DialogLocalAPILoader2.Designer.cs b/ElectronicObserver/Window/Dialog/DialogLocalAPILoader2.Designer.cs index d8c375a95..cccdc2254 100644 --- a/ElectronicObserver/Window/Dialog/DialogLocalAPILoader2.Designer.cs +++ b/ElectronicObserver/Window/Dialog/DialogLocalAPILoader2.Designer.cs @@ -174,6 +174,7 @@ private void InitializeComponent() { this.TextFilter.Name = "TextFilter"; this.TextFilter.Size = new System.Drawing.Size(519, 23); this.TextFilter.TabIndex = 2; + this.TextFilter.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TextFilter_KeyDown); // // ButtonExecuteNext // diff --git a/ElectronicObserver/Window/Dialog/DialogLocalAPILoader2.cs b/ElectronicObserver/Window/Dialog/DialogLocalAPILoader2.cs index ac7671aa4..c47a0f303 100644 --- a/ElectronicObserver/Window/Dialog/DialogLocalAPILoader2.cs +++ b/ElectronicObserver/Window/Dialog/DialogLocalAPILoader2.cs @@ -95,6 +95,8 @@ private void ButtonExecuteNext_Click( object sender, EventArgs e ) { private void LoadFiles( string path ) { + if ( !Directory.Exists( path ) ) return; + CurrentPath = path; APIView.Rows.Clear(); @@ -209,5 +211,14 @@ private void ButtonSearch_Click( object sender, EventArgs e ) { } } + + + private void TextFilter_KeyDown( object sender, KeyEventArgs e ) { + if ( e.KeyCode == Keys.Enter ) { + e.SuppressKeyPress = true; + ButtonSearch.PerformClick(); + } + } + } } diff --git a/ElectronicObserver/Window/Dialog/DialogResourceChart.cs b/ElectronicObserver/Window/Dialog/DialogResourceChart.cs index fa18098f3..97cc5c05f 100644 --- a/ElectronicObserver/Window/Dialog/DialogResourceChart.cs +++ b/ElectronicObserver/Window/Dialog/DialogResourceChart.cs @@ -54,12 +54,15 @@ public DialogResourceChart() { private void DialogResourceChart_Load( object sender, EventArgs e ) { + if ( RecordManager.Instance.Resource.Record.Count == 0 ) { + MessageBox.Show( "レコードが存在しません。", "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error ); + Close(); + return; + } + SwitchMenuStrip( Menu_Graph, 0 ); SwitchMenuStrip( Menu_Span, 2 ); - //checkme: if レコードが未ロード or 0個の項目 then throw - //SetResourceChart( _currentChartSpan ); - UpdateChart(); } diff --git a/ElectronicObserver/Window/FormHeadquarters.cs b/ElectronicObserver/Window/FormHeadquarters.cs index d3bb6ec1b..f7f67f007 100644 --- a/ElectronicObserver/Window/FormHeadquarters.cs +++ b/ElectronicObserver/Window/FormHeadquarters.cs @@ -197,27 +197,35 @@ void Updated( string apiname, dynamic data ) { var resday = RecordManager.Instance.Resource.GetRecord( DateTime.Now.AddHours( -5 ).Date.AddHours( 5 ) ); var resweek = RecordManager.Instance.Resource.GetRecord( DateTime.Now.AddHours( -5 ).Date.AddDays( -( ( (int)DateTime.Now.AddHours( -5 ).DayOfWeek + 6 ) % 7 ) ).AddHours( 5 ) ); //月曜日起点 var resmonth = RecordManager.Instance.Resource.GetRecord( new DateTime( DateTime.Now.Year, DateTime.Now.Month, 1 ).AddHours( 5 ) ); - + Fuel.Text = db.Material.Fuel.ToString(); Fuel.BackColor = db.Material.Fuel < db.Admiral.MaxResourceRegenerationAmount ? Color.Transparent : overcolor; ToolTipInfo.SetToolTip( Fuel, string.Format( "今日: {0:+##;-##;±0}\n今週: {1:+##;-##;±0}\n今月: {2:+##;-##;±0}", - db.Material.Fuel - resday.Fuel, db.Material.Fuel - resweek.Fuel, db.Material.Fuel - resmonth.Fuel ) ); + resday == null ? 0 : ( db.Material.Fuel - resday.Fuel ), + resweek == null ? 0 : ( db.Material.Fuel - resweek.Fuel ), + resmonth == null ? 0 : ( db.Material.Fuel - resmonth.Fuel ) ) ); Ammo.Text = db.Material.Ammo.ToString(); Ammo.BackColor = db.Material.Ammo < db.Admiral.MaxResourceRegenerationAmount ? Color.Transparent : overcolor; ToolTipInfo.SetToolTip( Ammo, string.Format( "今日: {0:+##;-##;±0}\n今週: {1:+##;-##;±0}\n今月: {2:+##;-##;±0}", - db.Material.Ammo - resday.Ammo, db.Material.Ammo - resweek.Ammo, db.Material.Ammo - resmonth.Ammo ) ); + resday == null ? 0 : ( db.Material.Ammo - resday.Ammo ), + resweek == null ? 0 : ( db.Material.Ammo - resweek.Ammo ), + resmonth == null ? 0 : ( db.Material.Ammo - resmonth.Ammo ) ) ); Steel.Text = db.Material.Steel.ToString(); Steel.BackColor = db.Material.Steel < db.Admiral.MaxResourceRegenerationAmount ? Color.Transparent : overcolor; ToolTipInfo.SetToolTip( Steel, string.Format( "今日: {0:+##;-##;±0}\n今週: {1:+##;-##;±0}\n今月: {2:+##;-##;±0}", - db.Material.Steel - resday.Steel, db.Material.Steel - resweek.Steel, db.Material.Steel - resmonth.Steel ) ); + resday == null ? 0 : ( db.Material.Steel - resday.Steel ), + resweek == null ? 0 : ( db.Material.Steel - resweek.Steel ), + resmonth == null ? 0 : ( db.Material.Steel - resmonth.Steel ) ) ); Bauxite.Text = db.Material.Bauxite.ToString(); Bauxite.BackColor = db.Material.Bauxite < db.Admiral.MaxResourceRegenerationAmount ? Color.Transparent : overcolor; ToolTipInfo.SetToolTip( Bauxite, string.Format( "今日: {0:+##;-##;±0}\n今週: {1:+##;-##;±0}\n今月: {2:+##;-##;±0}", - db.Material.Bauxite - resday.Bauxite, db.Material.Bauxite - resweek.Bauxite, db.Material.Bauxite - resmonth.Bauxite ) ); + resday == null ? 0 : ( db.Material.Bauxite - resday.Bauxite ), + resweek == null ? 0 : ( db.Material.Bauxite - resweek.Bauxite ), + resmonth == null ? 0 : ( db.Material.Bauxite - resmonth.Bauxite ) ) ); } FlowPanelResource.ResumeLayout(); From be448763114d5e97689397d3f318f6999266d0a8 Mon Sep 17 00:00:00 2001 From: vanishcrow Date: Sat, 13 Jun 2015 08:24:36 +0900 Subject: [PATCH 21/26] =?UTF-8?q?=E8=B3=87=E6=BA=90=E3=83=81=E3=83=A3?= =?UTF-8?q?=E3=83=BC=E3=83=88:=20=E6=8C=87=E5=AE=9A=E6=9C=9F=E9=96=93?= =?UTF-8?q?=E5=86=85=E3=81=AE=E3=83=AC=E3=82=B3=E3=83=BC=E3=83=89=E3=81=8C?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E3=81=97=E3=81=AA=E3=81=84=E5=A0=B4=E5=90=88?= =?UTF-8?q?=E3=81=AB=E3=82=A8=E3=83=A9=E3=83=BC=E3=81=A8=E3=81=AA=E3=82=8B?= =?UTF-8?q?=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 期間内にレコードが存在しない場合、GetRecords()で空集合が返却されてエラーとなっていた問題を修正しました。 また、グラフのプロットが1個も存在しない場合max,minの計算でエラーになるため、グラフの最後に現在の資源量を挿入するよう変更しました。 --- .../Window/Dialog/DialogResourceChart.cs | 154 +++++++++++------- 1 file changed, 98 insertions(+), 56 deletions(-) diff --git a/ElectronicObserver/Window/Dialog/DialogResourceChart.cs b/ElectronicObserver/Window/Dialog/DialogResourceChart.cs index 97cc5c05f..57b911f0d 100644 --- a/ElectronicObserver/Window/Dialog/DialogResourceChart.cs +++ b/ElectronicObserver/Window/Dialog/DialogResourceChart.cs @@ -1,4 +1,5 @@ -using ElectronicObserver.Resource.Record; +using ElectronicObserver.Data; +using ElectronicObserver.Resource.Record; using System; using System.Collections.Generic; using System.ComponentModel; @@ -53,13 +54,7 @@ public DialogResourceChart() { private void DialogResourceChart_Load( object sender, EventArgs e ) { - - if ( RecordManager.Instance.Resource.Record.Count == 0 ) { - MessageBox.Show( "レコードが存在しません。", "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error ); - Close(); - return; - } - + SwitchMenuStrip( Menu_Graph, 0 ); SwitchMenuStrip( Menu_Span, 2 ); @@ -114,25 +109,34 @@ private void SetResourceChart() { { var record = GetRecords(); - var prev = record.First(); - foreach ( var r in record ) { + if ( record.Any() ) { + var prev = record.First(); + foreach ( var r in record ) { - if ( ShouldSkipRecord( r.Date - prev.Date ) ) - continue; + if ( ShouldSkipRecord( r.Date - prev.Date ) ) + continue; - fuel.Points.AddXY( r.Date.ToOADate(), r.Fuel ); - ammo.Points.AddXY( r.Date.ToOADate(), r.Ammo ); - steel.Points.AddXY( r.Date.ToOADate(), r.Steel ); - bauxite.Points.AddXY( r.Date.ToOADate(), r.Bauxite ); + fuel.Points.AddXY( r.Date.ToOADate(), r.Fuel ); + ammo.Points.AddXY( r.Date.ToOADate(), r.Ammo ); + steel.Points.AddXY( r.Date.ToOADate(), r.Steel ); + bauxite.Points.AddXY( r.Date.ToOADate(), r.Bauxite ); - prev = r; + prev = r; + } } + double now = DateTime.Now.ToOADate(); + fuel.Points.AddXY( now, KCDatabase.Instance.Material.Fuel ); + ammo.Points.AddXY( now, KCDatabase.Instance.Material.Ammo ); + steel.Points.AddXY( now, KCDatabase.Instance.Material.Steel ); + bauxite.Points.AddXY( now, KCDatabase.Instance.Material.Bauxite ); + int min = (int)new[] { fuel.Points.Min( p => p.YValues[0] ), ammo.Points.Min( p => p.YValues[0] ), steel.Points.Min( p => p.YValues[0] ), bauxite.Points.Min( p => p.YValues[0] ) }.Min(); area.AxisY.Minimum = Math.Floor( min / 10000.0 ) * 10000; int max = (int)new[] { fuel.Points.Max( p => p.YValues[0] ), ammo.Points.Max( p => p.YValues[0] ), steel.Points.Max( p => p.YValues[0] ), bauxite.Points.Max( p => p.YValues[0] ) }.Max(); area.AxisY.Maximum = Math.Ceiling( max / 10000.0 ) * 10000; + } } @@ -186,21 +190,30 @@ private void SetResourceDiffChart() { { var record = GetRecords(); + ResourceRecord.ResourceElement prev = null; - var prev = record.First(); - foreach ( var r in record ) { + if ( record.Any() ) { + prev = record.First(); + foreach ( var r in record ) { - if ( ShouldSkipRecord( r.Date - prev.Date ) ) - continue; + if ( ShouldSkipRecord( r.Date - prev.Date ) ) + continue; - fuel.Points.AddXY( r.Date.ToOADate(), r.Fuel - prev.Fuel ); - ammo.Points.AddXY( r.Date.ToOADate(), r.Ammo - prev.Ammo ); - steel.Points.AddXY( r.Date.ToOADate(), r.Steel - prev.Steel ); - bauxite.Points.AddXY( r.Date.ToOADate(), r.Bauxite - prev.Bauxite ); + fuel.Points.AddXY( r.Date.ToOADate(), r.Fuel - prev.Fuel ); + ammo.Points.AddXY( r.Date.ToOADate(), r.Ammo - prev.Ammo ); + steel.Points.AddXY( r.Date.ToOADate(), r.Steel - prev.Steel ); + bauxite.Points.AddXY( r.Date.ToOADate(), r.Bauxite - prev.Bauxite ); - prev = r; + prev = r; + } } + double now = DateTime.Now.ToOADate(); + fuel.Points.AddXY( now, prev == null ? 0 : KCDatabase.Instance.Material.Fuel - prev.Fuel ); + ammo.Points.AddXY( now, prev == null ? 0 : KCDatabase.Instance.Material.Ammo - prev.Ammo ); + steel.Points.AddXY( now, prev == null ? 0 : KCDatabase.Instance.Material.Steel - prev.Steel ); + bauxite.Points.AddXY( now, prev == null ? 0 : KCDatabase.Instance.Material.Bauxite - prev.Bauxite ); + int min = (int)new[] { fuel.Points.Min( p => p.YValues[0] ), ammo.Points.Min( p => p.YValues[0] ), steel.Points.Min( p => p.YValues[0] ), bauxite.Points.Min( p => p.YValues[0] ) }.Min(); area.AxisY.Minimum = Math.Floor( min / 1000.0 ) * 1000; @@ -259,20 +272,28 @@ private void SetMaterialChart() { { var record = GetRecords(); - var prev = record.First(); - foreach ( var r in record ) { + if ( record.Any() ) { + var prev = record.First(); + foreach ( var r in record ) { - if ( ShouldSkipRecord( r.Date - prev.Date ) ) - continue; + if ( ShouldSkipRecord( r.Date - prev.Date ) ) + continue; - instantConstruction.Points.AddXY( r.Date.ToOADate(), r.InstantConstruction ); - instantRepair.Points.AddXY( r.Date.ToOADate(), r.InstantRepair ); - developmentMaterial.Points.AddXY( r.Date.ToOADate(), r.DevelopmentMaterial ); - moddingMaterial.Points.AddXY( r.Date.ToOADate(), r.ModdingMaterial ); + instantConstruction.Points.AddXY( r.Date.ToOADate(), r.InstantConstruction ); + instantRepair.Points.AddXY( r.Date.ToOADate(), r.InstantRepair ); + developmentMaterial.Points.AddXY( r.Date.ToOADate(), r.DevelopmentMaterial ); + moddingMaterial.Points.AddXY( r.Date.ToOADate(), r.ModdingMaterial ); - prev = r; + prev = r; + } } + double now = DateTime.Now.ToOADate(); + instantConstruction.Points.AddXY( now, KCDatabase.Instance.Material.InstantConstruction ); + instantRepair.Points.AddXY( now, KCDatabase.Instance.Material.InstantRepair ); + developmentMaterial.Points.AddXY( now, KCDatabase.Instance.Material.DevelopmentMaterial ); + moddingMaterial.Points.AddXY( now, KCDatabase.Instance.Material.ModdingMaterial ); + int min = (int)new[] { instantConstruction.Points.Min( p => p.YValues[0] ), instantRepair.Points.Min( p => p.YValues[0] ), developmentMaterial.Points.Min( p => p.YValues[0] ), moddingMaterial.Points.Min( p => p.YValues[0] ) }.Min(); area.AxisY.Minimum = Math.Floor( min / 200.0 ) * 200; @@ -331,21 +352,30 @@ private void SetMateialDiffChart() { { var record = GetRecords(); + ResourceRecord.ResourceElement prev = null; - var prev = record.First(); - foreach ( var r in record ) { + if ( record.Any() ) { + prev = record.First(); + foreach ( var r in record ) { - if ( ShouldSkipRecord( r.Date - prev.Date ) ) - continue; + if ( ShouldSkipRecord( r.Date - prev.Date ) ) + continue; - instantConstruction.Points.AddXY( r.Date.ToOADate(), r.InstantConstruction - prev.InstantConstruction ); - instantRepair.Points.AddXY( r.Date.ToOADate(), r.InstantRepair - prev.InstantRepair ); - developmentMaterial.Points.AddXY( r.Date.ToOADate(), r.DevelopmentMaterial - prev.DevelopmentMaterial ); - moddingMaterial.Points.AddXY( r.Date.ToOADate(), r.ModdingMaterial - prev.ModdingMaterial ); + instantConstruction.Points.AddXY( r.Date.ToOADate(), r.InstantConstruction - prev.InstantConstruction ); + instantRepair.Points.AddXY( r.Date.ToOADate(), r.InstantRepair - prev.InstantRepair ); + developmentMaterial.Points.AddXY( r.Date.ToOADate(), r.DevelopmentMaterial - prev.DevelopmentMaterial ); + moddingMaterial.Points.AddXY( r.Date.ToOADate(), r.ModdingMaterial - prev.ModdingMaterial ); - prev = r; + prev = r; + } } + double now = DateTime.Now.ToOADate(); + instantConstruction.Points.AddXY( now, prev == null ? 0 : KCDatabase.Instance.Material.InstantConstruction - prev.InstantConstruction ); + instantRepair.Points.AddXY( now, prev == null ? 0 : KCDatabase.Instance.Material.InstantRepair - prev.InstantRepair ); + developmentMaterial.Points.AddXY( now, prev == null ? 0 : KCDatabase.Instance.Material.DevelopmentMaterial - prev.DevelopmentMaterial ); + moddingMaterial.Points.AddXY( now, prev == null ? 0 : KCDatabase.Instance.Material.ModdingMaterial - prev.ModdingMaterial ); + int min = (int)new[] { instantConstruction.Points.Min( p => p.YValues[0] ), instantRepair.Points.Min( p => p.YValues[0] ), developmentMaterial.Points.Min( p => p.YValues[0] ), moddingMaterial.Points.Min( p => p.YValues[0] ) }.Min(); area.AxisY.Minimum = Math.Floor( min / 20.0 ) * 20; @@ -389,16 +419,21 @@ private void SetExperienceChart() { { var record = GetRecords(); - var prev = record.First(); - foreach ( var r in record ) { + if ( record.Any() ) { + var prev = record.First(); + foreach ( var r in record ) { - if ( ShouldSkipRecord( r.Date - prev.Date ) ) - continue; + if ( ShouldSkipRecord( r.Date - prev.Date ) ) + continue; - exp.Points.AddXY( r.Date.ToOADate(), r.HQExp ); - prev = r; + exp.Points.AddXY( r.Date.ToOADate(), r.HQExp ); + prev = r; + } } + double now = DateTime.Now.ToOADate(); + exp.Points.AddXY( now, KCDatabase.Instance.Admiral.Exp ); + int min = (int)exp.Points.Min( p => p.YValues[0] ); area.AxisY.Minimum = Math.Floor( min / 100000.0 ) * 100000; @@ -443,17 +478,24 @@ private void SetExperienceDiffChart() { { var record = GetRecords(); - var prev = record.First(); - foreach ( var r in record ) { + ResourceRecord.ResourceElement prev = null; - if ( ShouldSkipRecord( r.Date - prev.Date ) ) - continue; + if ( record.Any() ) { + prev = record.First(); + foreach ( var r in record ) { - exp.Points.AddXY( r.Date.ToOADate(), r.HQExp - prev.HQExp ); + if ( ShouldSkipRecord( r.Date - prev.Date ) ) + continue; - prev = r; + exp.Points.AddXY( r.Date.ToOADate(), r.HQExp - prev.HQExp ); + + prev = r; + } } + double now = DateTime.Now.ToOADate(); + exp.Points.AddXY( now, prev == null ? 0 : KCDatabase.Instance.Admiral.Exp - prev.HQExp ); + int min = (int)exp.Points.Min( p => p.YValues[0] ); area.AxisY.Minimum = Math.Floor( min / 10000.0 ) * 10000; From 55a767eca13b4465145ff34bb56cf974e2841d85 Mon Sep 17 00:00:00 2001 From: Andante Date: Sun, 14 Jun 2015 15:24:14 +0900 Subject: [PATCH 22/26] =?UTF-8?q?=E8=89=A6=E3=81=93=E3=82=8CDB=E3=81=AEAPI?= =?UTF-8?q?=E9=81=B8=E6=8A=9E=E6=A9=9F=E8=83=BD=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ・司令部:点滅タイミングを調整 --- ElectronicObserver/Observer/APIKancolleDB.cs | 18 ++---------- .../Other/Information/kcmemo.md | 2 +- ElectronicObserver/Utility/Configuration.cs | 7 +---- .../Dialog/DialogConfiguration.Designer.cs | 28 ------------------- .../Window/Dialog/DialogConfiguration.cs | 25 ++--------------- .../Window/Dialog/DialogConfiguration.resx | 6 ---- ElectronicObserver/Window/FormHeadquarters.cs | 17 +++++++---- 7 files changed, 18 insertions(+), 85 deletions(-) diff --git a/ElectronicObserver/Observer/APIKancolleDB.cs b/ElectronicObserver/Observer/APIKancolleDB.cs index 4d793b133..951f2dea9 100644 --- a/ElectronicObserver/Observer/APIKancolleDB.cs +++ b/ElectronicObserver/Observer/APIKancolleDB.cs @@ -81,7 +81,6 @@ public APIKancolleDB() { } private void ConfigurationChanged() { - SendDBApis = Utility.Configuration.Config.Connection.SendKancolleDBApis; OAuth = Utility.Configuration.Config.Connection.SendKancolleOAuth; if ( Utility.Configuration.Config.Connection.UseUpstreamProxy ) { @@ -91,7 +90,6 @@ private void ConfigurationChanged() { } } - private uint SendDBApis; private string OAuth; private WebProxy Proxy; @@ -101,25 +99,15 @@ private void ConfigurationChanged() { /// public void ExecuteSession( Session oSession ) { - if ( SendDBApis == 0 || string.IsNullOrEmpty( OAuth ) ) { + if ( string.IsNullOrEmpty( OAuth ) ) { return; } // find the url in dict. string url = oSession.PathAndQuery; - uint apiMask = SendDBApis; - foreach ( var kv in apis ) { - if ( url == kv.Value ) { - - // if we allow to post this api. - if ( ( ( 1 << (int)kv.Key ) & apiMask ) > 0 ) { - - PostToServer( oSession ); - return; - - } - } + if ( apis.Values.Contains( url ) ) { + PostToServer( oSession ); } } diff --git a/ElectronicObserver/Other/Information/kcmemo.md b/ElectronicObserver/Other/Information/kcmemo.md index a4efa8524..734b839d8 100644 --- a/ElectronicObserver/Other/Information/kcmemo.md +++ b/ElectronicObserver/Other/Information/kcmemo.md @@ -407,7 +407,7 @@ Bismarck dreiに対する魚雷装備・試製51cm連装砲といったものの |220|い号作戦|空母20 |221|ろ号作戦|輸送50 |228|海上護衛戦|潜水15 -|229|敵東方艦隊を撃滅せよ!|4-(1~4)ボス勝利12 +|229|敵東方艦隊を撃滅せよ!|4-(1~5)ボス勝利12 |242|敵東方中枢艦隊を撃破せよ!|4-4ボス勝利1 |243|南方海域珊瑚諸島沖の制空権を握れ!|5-2ボスS勝利2 |261|海上輸送路の安全確保に努めよ!|1-5ボスA勝利3 diff --git a/ElectronicObserver/Utility/Configuration.cs b/ElectronicObserver/Utility/Configuration.cs index c01e826f8..0f0e4614b 100644 --- a/ElectronicObserver/Utility/Configuration.cs +++ b/ElectronicObserver/Utility/Configuration.cs @@ -120,11 +120,6 @@ public class ConfigConnection : ConfigPartBase { /// public string SendKancolleOAuth { get; set; } - /// - /// APIがに送信されます - /// 21 apis which take 21 bits. - /// - public uint SendKancolleDBApis { get; set; } public ConfigConnection() { @@ -143,7 +138,7 @@ public ConfigConnection() { UpstreamProxyAddress = "127.0.0.1"; SendDataToKancolleDB = false; SendKancolleOAuth = ""; - SendKancolleDBApis = 0x1FFFFF; + } } diff --git a/ElectronicObserver/Window/Dialog/DialogConfiguration.Designer.cs b/ElectronicObserver/Window/Dialog/DialogConfiguration.Designer.cs index a0ca32d2a..aa9d7ce0b 100644 --- a/ElectronicObserver/Window/Dialog/DialogConfiguration.Designer.cs +++ b/ElectronicObserver/Window/Dialog/DialogConfiguration.Designer.cs @@ -139,10 +139,8 @@ private void InitializeComponent() { this.Notification_Construction = new System.Windows.Forms.Button(); this.Notification_Expedition = new System.Windows.Forms.Button(); this.tabPage15 = new System.Windows.Forms.TabPage(); - this.label23 = new System.Windows.Forms.Label(); this.Database_LinkKCDB = new System.Windows.Forms.LinkLabel(); this.label22 = new System.Windows.Forms.Label(); - this.Database_SendKancolleDBApis = new System.Windows.Forms.CheckedListBox(); this.Database_SendKancolleOAuth = new System.Windows.Forms.TextBox(); this.labelKdb = new System.Windows.Forms.Label(); this.Database_SendDataToKancolleDB = new System.Windows.Forms.CheckBox(); @@ -1509,10 +1507,8 @@ private void InitializeComponent() { // // tabPage15 // - this.tabPage15.Controls.Add(this.label23); this.tabPage15.Controls.Add(this.Database_LinkKCDB); this.tabPage15.Controls.Add(this.label22); - this.tabPage15.Controls.Add(this.Database_SendKancolleDBApis); this.tabPage15.Controls.Add(this.Database_SendKancolleOAuth); this.tabPage15.Controls.Add(this.labelKdb); this.tabPage15.Controls.Add(this.Database_SendDataToKancolleDB); @@ -1524,16 +1520,6 @@ private void InitializeComponent() { this.tabPage15.Text = "データベース"; this.tabPage15.UseVisualStyleBackColor = true; // - // label23 - // - this.label23.AutoSize = true; - this.label23.Location = new System.Drawing.Point(8, 101); - this.label23.Name = "label23"; - this.label23.Size = new System.Drawing.Size(52, 15); - this.label23.TabIndex = 18; - this.label23.Text = "フィルタ:"; - this.ToolTipInfo.SetToolTip(this.label23, "チェックしたAPIのみ送信します。"); - // // Database_LinkKCDB // this.Database_LinkKCDB.AutoSize = true; @@ -1554,18 +1540,6 @@ private void InitializeComponent() { this.label22.TabIndex = 16; this.label22.Text = "「艦これ統計データベース」へデータを送信できます。\r\n詳細やアクセスキーの取得は以下のサイトを参照してください。(外部ブラウザが開きます)"; // - // Database_SendKancolleDBApis - // - this.Database_SendKancolleDBApis.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left))); - this.Database_SendKancolleDBApis.CheckOnClick = true; - this.Database_SendKancolleDBApis.FormattingEnabled = true; - this.Database_SendKancolleDBApis.IntegralHeight = false; - this.Database_SendKancolleDBApis.Location = new System.Drawing.Point(6, 119); - this.Database_SendKancolleDBApis.Name = "Database_SendKancolleDBApis"; - this.Database_SendKancolleDBApis.Size = new System.Drawing.Size(212, 108); - this.Database_SendKancolleDBApis.TabIndex = 15; - // // Database_SendKancolleOAuth // this.Database_SendKancolleOAuth.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) @@ -1834,10 +1808,8 @@ private void InitializeComponent() { private System.Windows.Forms.Label label20; private System.Windows.Forms.ComboBox FormBrowser_FlashQuality; private System.Windows.Forms.TabPage tabPage15; - private System.Windows.Forms.Label label23; private System.Windows.Forms.LinkLabel Database_LinkKCDB; private System.Windows.Forms.Label label22; - private System.Windows.Forms.CheckedListBox Database_SendKancolleDBApis; private System.Windows.Forms.TextBox Database_SendKancolleOAuth; private System.Windows.Forms.Label labelKdb; private System.Windows.Forms.CheckBox Database_SendDataToKancolleDB; diff --git a/ElectronicObserver/Window/Dialog/DialogConfiguration.cs b/ElectronicObserver/Window/Dialog/DialogConfiguration.cs index 645a78fa6..1280ece16 100644 --- a/ElectronicObserver/Window/Dialog/DialogConfiguration.cs +++ b/ElectronicObserver/Window/Dialog/DialogConfiguration.cs @@ -368,15 +368,7 @@ public void FromConfiguration( Configuration.ConfigurationData config ) { //[データベース] Database_SendDataToKancolleDB.Checked = config.Connection.SendDataToKancolleDB; Database_SendKancolleOAuth.Text = config.Connection.SendKancolleOAuth; - Database_SendKancolleDBApis.Items.Clear(); - Database_SendKancolleDBApis.Items.AddRange( Enum.GetNames( typeof( APIKancolleDB.APIType ) ) ); - { - uint apiMask = Utility.Configuration.Config.Connection.SendKancolleDBApis; - for ( int i = 0; i < Database_SendKancolleDBApis.Items.Count; i++ ) { - Database_SendKancolleDBApis.SetItemChecked( i, ( ( ( 1 << i ) & apiMask ) > 0 ) ); - } - } //finalize UpdateParameter(); @@ -478,22 +470,9 @@ public void ToConfiguration( Configuration.ConfigurationData config ) { config.FormBrowser.FlashWMode = FormBrowser_FlashWMode.Text; //[データベース] - { - config.Connection.SendDataToKancolleDB = Database_SendDataToKancolleDB.Checked; - config.Connection.SendKancolleOAuth = Database_SendKancolleOAuth.Text; - - uint apiMask = 0; - for ( int i = Database_SendKancolleDBApis.Items.Count - 1; i >= 0; i-- ) { + config.Connection.SendDataToKancolleDB = Database_SendDataToKancolleDB.Checked; + config.Connection.SendKancolleOAuth = Database_SendKancolleOAuth.Text; - apiMask <<= 1; - - if ( Database_SendKancolleDBApis.GetItemChecked( i ) ) { - apiMask |= 1; - } - } - - config.Connection.SendKancolleDBApis = apiMask; - } } diff --git a/ElectronicObserver/Window/Dialog/DialogConfiguration.resx b/ElectronicObserver/Window/Dialog/DialogConfiguration.resx index 65863a39c..5087138c2 100644 --- a/ElectronicObserver/Window/Dialog/DialogConfiguration.resx +++ b/ElectronicObserver/Window/Dialog/DialogConfiguration.resx @@ -120,12 +120,6 @@ 17, 17 - - 17, 17 - - - 17, 17 - 137, 17 diff --git a/ElectronicObserver/Window/FormHeadquarters.cs b/ElectronicObserver/Window/FormHeadquarters.cs index f7f67f007..640beaac0 100644 --- a/ElectronicObserver/Window/FormHeadquarters.cs +++ b/ElectronicObserver/Window/FormHeadquarters.cs @@ -166,16 +166,21 @@ void Updated( string apiname, dynamic data ) { { ShipCount.Text = string.Format( "{0}/{1}", RealShipCount, db.Admiral.MaxShipCount ); - if ( RealShipCount > db.Admiral.MaxShipCount - 5 ) + if ( RealShipCount > db.Admiral.MaxShipCount - 5 ) { ShipCount.BackColor = Color.LightCoral; - else + } else { ShipCount.BackColor = Color.Transparent; + } + ShipCount.Tag = RealShipCount >= db.Admiral.MaxShipCount; EquipmentCount.Text = string.Format( "{0}/{1}", RealEquipmentCount, db.Admiral.MaxEquipmentCount ); - if ( RealEquipmentCount > db.Admiral.MaxEquipmentCount + 3 - 20 ) + if ( RealEquipmentCount > db.Admiral.MaxEquipmentCount + 3 - 20 ) { EquipmentCount.BackColor = Color.LightCoral; - else + } else { EquipmentCount.BackColor = Color.Transparent; + } + EquipmentCount.Tag = RealEquipmentCount >= db.Admiral.MaxEquipmentCount; + } FlowPanelFleet.ResumeLayout(); @@ -245,11 +250,11 @@ void SystemEvents_UpdateTimerTick() { if ( db.Ships.Count <= 0 ) return; - if ( RealShipCount >= db.Admiral.MaxShipCount ) { + if ( ShipCount.Tag as bool? ?? false ) { ShipCount.BackColor = DateTime.Now.Second % 2 == 0 ? Color.LightCoral : Color.Transparent; } - if ( RealEquipmentCount >= db.Admiral.MaxEquipmentCount ) { + if ( EquipmentCount.Tag as bool? ?? false ) { EquipmentCount.BackColor = DateTime.Now.Second % 2 == 0 ? Color.LightCoral : Color.Transparent; } } From b17c3b4bcdfd8f982c6c1a32051eb5c17a59fc5c Mon Sep 17 00:00:00 2001 From: Andante Date: Sun, 14 Jun 2015 21:28:00 +0900 Subject: [PATCH 23/26] =?UTF-8?q?=E8=B3=87=E6=BA=90=E3=83=81=E3=83=A3?= =?UTF-8?q?=E3=83=BC=E3=83=88=EF=BC=9A=E7=89=B9=E5=AE=9A=E3=81=AE=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=E3=81=A7=E8=90=BD=E3=81=A1=E3=82=8B=E4=B8=8D=E5=85=B7?= =?UTF-8?q?=E5=90=88=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Window/Dialog/DialogResourceChart.cs | 136 +++++++++++------- 1 file changed, 83 insertions(+), 53 deletions(-) diff --git a/ElectronicObserver/Window/Dialog/DialogResourceChart.cs b/ElectronicObserver/Window/Dialog/DialogResourceChart.cs index 57b911f0d..aa636b736 100644 --- a/ElectronicObserver/Window/Dialog/DialogResourceChart.cs +++ b/ElectronicObserver/Window/Dialog/DialogResourceChart.cs @@ -54,7 +54,14 @@ public DialogResourceChart() { private void DialogResourceChart_Load( object sender, EventArgs e ) { - + + if ( !RecordManager.Instance.Resource.Record.Any() ) { + MessageBox.Show( "レコード データが存在しません。\n一度母港に移動してください。", "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error ); + Close(); + return; + } + + SwitchMenuStrip( Menu_Graph, 0 ); SwitchMenuStrip( Menu_Span, 2 ); @@ -125,18 +132,21 @@ private void SetResourceChart() { } } - double now = DateTime.Now.ToOADate(); - fuel.Points.AddXY( now, KCDatabase.Instance.Material.Fuel ); - ammo.Points.AddXY( now, KCDatabase.Instance.Material.Ammo ); - steel.Points.AddXY( now, KCDatabase.Instance.Material.Steel ); - bauxite.Points.AddXY( now, KCDatabase.Instance.Material.Bauxite ); + if ( KCDatabase.Instance.Material.IsAvailable ) { + double now = DateTime.Now.ToOADate(); + fuel.Points.AddXY( now, KCDatabase.Instance.Material.Fuel ); + ammo.Points.AddXY( now, KCDatabase.Instance.Material.Ammo ); + steel.Points.AddXY( now, KCDatabase.Instance.Material.Steel ); + bauxite.Points.AddXY( now, KCDatabase.Instance.Material.Bauxite ); + } - int min = (int)new[] { fuel.Points.Min( p => p.YValues[0] ), ammo.Points.Min( p => p.YValues[0] ), steel.Points.Min( p => p.YValues[0] ), bauxite.Points.Min( p => p.YValues[0] ) }.Min(); - area.AxisY.Minimum = Math.Floor( min / 10000.0 ) * 10000; + if ( fuel.Points.Count > 0 ) { + int min = (int)new[] { fuel.Points.Min( p => p.YValues[0] ), ammo.Points.Min( p => p.YValues[0] ), steel.Points.Min( p => p.YValues[0] ), bauxite.Points.Min( p => p.YValues[0] ) }.Min(); + area.AxisY.Minimum = Math.Floor( min / 10000.0 ) * 10000; - int max = (int)new[] { fuel.Points.Max( p => p.YValues[0] ), ammo.Points.Max( p => p.YValues[0] ), steel.Points.Max( p => p.YValues[0] ), bauxite.Points.Max( p => p.YValues[0] ) }.Max(); - area.AxisY.Maximum = Math.Ceiling( max / 10000.0 ) * 10000; - + int max = (int)new[] { fuel.Points.Max( p => p.YValues[0] ), ammo.Points.Max( p => p.YValues[0] ), steel.Points.Max( p => p.YValues[0] ), bauxite.Points.Max( p => p.YValues[0] ) }.Max(); + area.AxisY.Maximum = Math.Ceiling( max / 10000.0 ) * 10000; + } } } @@ -208,18 +218,21 @@ private void SetResourceDiffChart() { } } - double now = DateTime.Now.ToOADate(); - fuel.Points.AddXY( now, prev == null ? 0 : KCDatabase.Instance.Material.Fuel - prev.Fuel ); - ammo.Points.AddXY( now, prev == null ? 0 : KCDatabase.Instance.Material.Ammo - prev.Ammo ); - steel.Points.AddXY( now, prev == null ? 0 : KCDatabase.Instance.Material.Steel - prev.Steel ); - bauxite.Points.AddXY( now, prev == null ? 0 : KCDatabase.Instance.Material.Bauxite - prev.Bauxite ); - - int min = (int)new[] { fuel.Points.Min( p => p.YValues[0] ), ammo.Points.Min( p => p.YValues[0] ), steel.Points.Min( p => p.YValues[0] ), bauxite.Points.Min( p => p.YValues[0] ) }.Min(); - area.AxisY.Minimum = Math.Floor( min / 1000.0 ) * 1000; + if ( KCDatabase.Instance.Material.IsAvailable ) { + double now = DateTime.Now.ToOADate(); + fuel.Points.AddXY( now, prev == null ? 0 : KCDatabase.Instance.Material.Fuel - prev.Fuel ); + ammo.Points.AddXY( now, prev == null ? 0 : KCDatabase.Instance.Material.Ammo - prev.Ammo ); + steel.Points.AddXY( now, prev == null ? 0 : KCDatabase.Instance.Material.Steel - prev.Steel ); + bauxite.Points.AddXY( now, prev == null ? 0 : KCDatabase.Instance.Material.Bauxite - prev.Bauxite ); + } - int max = (int)new[] { fuel.Points.Max( p => p.YValues[0] ), ammo.Points.Max( p => p.YValues[0] ), steel.Points.Max( p => p.YValues[0] ), bauxite.Points.Max( p => p.YValues[0] ) }.Max(); - area.AxisY.Maximum = Math.Ceiling( max / 1000.0 ) * 1000; + if ( fuel.Points.Count > 0 ) { + int min = (int)new[] { fuel.Points.Min( p => p.YValues[0] ), ammo.Points.Min( p => p.YValues[0] ), steel.Points.Min( p => p.YValues[0] ), bauxite.Points.Min( p => p.YValues[0] ) }.Min(); + area.AxisY.Minimum = Math.Floor( min / 1000.0 ) * 1000; + int max = (int)new[] { fuel.Points.Max( p => p.YValues[0] ), ammo.Points.Max( p => p.YValues[0] ), steel.Points.Max( p => p.YValues[0] ), bauxite.Points.Max( p => p.YValues[0] ) }.Max(); + area.AxisY.Maximum = Math.Ceiling( max / 1000.0 ) * 1000; + } } } @@ -288,17 +301,21 @@ private void SetMaterialChart() { } } - double now = DateTime.Now.ToOADate(); - instantConstruction.Points.AddXY( now, KCDatabase.Instance.Material.InstantConstruction ); - instantRepair.Points.AddXY( now, KCDatabase.Instance.Material.InstantRepair ); - developmentMaterial.Points.AddXY( now, KCDatabase.Instance.Material.DevelopmentMaterial ); - moddingMaterial.Points.AddXY( now, KCDatabase.Instance.Material.ModdingMaterial ); + if ( KCDatabase.Instance.Material.IsAvailable ) { + double now = DateTime.Now.ToOADate(); + instantConstruction.Points.AddXY( now, KCDatabase.Instance.Material.InstantConstruction ); + instantRepair.Points.AddXY( now, KCDatabase.Instance.Material.InstantRepair ); + developmentMaterial.Points.AddXY( now, KCDatabase.Instance.Material.DevelopmentMaterial ); + moddingMaterial.Points.AddXY( now, KCDatabase.Instance.Material.ModdingMaterial ); + } - int min = (int)new[] { instantConstruction.Points.Min( p => p.YValues[0] ), instantRepair.Points.Min( p => p.YValues[0] ), developmentMaterial.Points.Min( p => p.YValues[0] ), moddingMaterial.Points.Min( p => p.YValues[0] ) }.Min(); - area.AxisY.Minimum = Math.Floor( min / 200.0 ) * 200; + if ( instantConstruction.Points.Count > 0 ) { + int min = (int)new[] { instantConstruction.Points.Min( p => p.YValues[0] ), instantRepair.Points.Min( p => p.YValues[0] ), developmentMaterial.Points.Min( p => p.YValues[0] ), moddingMaterial.Points.Min( p => p.YValues[0] ) }.Min(); + area.AxisY.Minimum = Math.Floor( min / 200.0 ) * 200; - int max = (int)new[] { instantConstruction.Points.Max( p => p.YValues[0] ), instantRepair.Points.Max( p => p.YValues[0] ), developmentMaterial.Points.Max( p => p.YValues[0] ), moddingMaterial.Points.Max( p => p.YValues[0] ) }.Max(); - area.AxisY.Maximum = Math.Ceiling( max / 200.0 ) * 200; + int max = (int)new[] { instantConstruction.Points.Max( p => p.YValues[0] ), instantRepair.Points.Max( p => p.YValues[0] ), developmentMaterial.Points.Max( p => p.YValues[0] ), moddingMaterial.Points.Max( p => p.YValues[0] ) }.Max(); + area.AxisY.Maximum = Math.Ceiling( max / 200.0 ) * 200; + } } } @@ -370,18 +387,21 @@ private void SetMateialDiffChart() { } } - double now = DateTime.Now.ToOADate(); - instantConstruction.Points.AddXY( now, prev == null ? 0 : KCDatabase.Instance.Material.InstantConstruction - prev.InstantConstruction ); - instantRepair.Points.AddXY( now, prev == null ? 0 : KCDatabase.Instance.Material.InstantRepair - prev.InstantRepair ); - developmentMaterial.Points.AddXY( now, prev == null ? 0 : KCDatabase.Instance.Material.DevelopmentMaterial - prev.DevelopmentMaterial ); - moddingMaterial.Points.AddXY( now, prev == null ? 0 : KCDatabase.Instance.Material.ModdingMaterial - prev.ModdingMaterial ); - - int min = (int)new[] { instantConstruction.Points.Min( p => p.YValues[0] ), instantRepair.Points.Min( p => p.YValues[0] ), developmentMaterial.Points.Min( p => p.YValues[0] ), moddingMaterial.Points.Min( p => p.YValues[0] ) }.Min(); - area.AxisY.Minimum = Math.Floor( min / 20.0 ) * 20; + if ( KCDatabase.Instance.Material.IsAvailable ) { + double now = DateTime.Now.ToOADate(); + instantConstruction.Points.AddXY( now, prev == null ? 0 : KCDatabase.Instance.Material.InstantConstruction - prev.InstantConstruction ); + instantRepair.Points.AddXY( now, prev == null ? 0 : KCDatabase.Instance.Material.InstantRepair - prev.InstantRepair ); + developmentMaterial.Points.AddXY( now, prev == null ? 0 : KCDatabase.Instance.Material.DevelopmentMaterial - prev.DevelopmentMaterial ); + moddingMaterial.Points.AddXY( now, prev == null ? 0 : KCDatabase.Instance.Material.ModdingMaterial - prev.ModdingMaterial ); + } - int max = (int)new[] { instantConstruction.Points.Max( p => p.YValues[0] ), instantRepair.Points.Max( p => p.YValues[0] ), developmentMaterial.Points.Max( p => p.YValues[0] ), moddingMaterial.Points.Max( p => p.YValues[0] ) }.Max(); - area.AxisY.Maximum = Math.Ceiling( max / 20.0 ) * 20; + if ( instantConstruction.Points.Count > 0 ) { + int min = (int)new[] { instantConstruction.Points.Min( p => p.YValues[0] ), instantRepair.Points.Min( p => p.YValues[0] ), developmentMaterial.Points.Min( p => p.YValues[0] ), moddingMaterial.Points.Min( p => p.YValues[0] ) }.Min(); + area.AxisY.Minimum = Math.Floor( min / 20.0 ) * 20; + int max = (int)new[] { instantConstruction.Points.Max( p => p.YValues[0] ), instantRepair.Points.Max( p => p.YValues[0] ), developmentMaterial.Points.Max( p => p.YValues[0] ), moddingMaterial.Points.Max( p => p.YValues[0] ) }.Max(); + area.AxisY.Maximum = Math.Ceiling( max / 20.0 ) * 20; + } } } @@ -431,14 +451,18 @@ private void SetExperienceChart() { } } - double now = DateTime.Now.ToOADate(); - exp.Points.AddXY( now, KCDatabase.Instance.Admiral.Exp ); + if ( KCDatabase.Instance.Admiral.IsAvailable ) { + double now = DateTime.Now.ToOADate(); + exp.Points.AddXY( now, KCDatabase.Instance.Admiral.Exp ); + } - int min = (int)exp.Points.Min( p => p.YValues[0] ); - area.AxisY.Minimum = Math.Floor( min / 100000.0 ) * 100000; + if ( exp.Points.Count > 0 ) { + int min = (int)exp.Points.Min( p => p.YValues[0] ); + area.AxisY.Minimum = Math.Floor( min / 100000.0 ) * 100000; - int max = (int)exp.Points.Max( p => p.YValues[0] ); - area.AxisY.Maximum = Math.Ceiling( max / 100000.0 ) * 100000; + int max = (int)exp.Points.Max( p => p.YValues[0] ); + area.AxisY.Maximum = Math.Ceiling( max / 100000.0 ) * 100000; + } } } @@ -493,15 +517,18 @@ private void SetExperienceDiffChart() { } } - double now = DateTime.Now.ToOADate(); - exp.Points.AddXY( now, prev == null ? 0 : KCDatabase.Instance.Admiral.Exp - prev.HQExp ); - - int min = (int)exp.Points.Min( p => p.YValues[0] ); - area.AxisY.Minimum = Math.Floor( min / 10000.0 ) * 10000; + if ( KCDatabase.Instance.Admiral.IsAvailable ) { + double now = DateTime.Now.ToOADate(); + exp.Points.AddXY( now, prev == null ? 0 : KCDatabase.Instance.Admiral.Exp - prev.HQExp ); + } - int max = (int)exp.Points.Max( p => p.YValues[0] ); - area.AxisY.Maximum = Math.Ceiling( max / 10000.0 ) * 10000; + if ( exp.Points.Count > 0 ) { + int min = (int)exp.Points.Min( p => p.YValues[0] ); + area.AxisY.Minimum = Math.Floor( min / 10000.0 ) * 10000; + int max = (int)exp.Points.Max( p => p.YValues[0] ); + area.AxisY.Maximum = Math.Ceiling( max / 10000.0 ) * 10000; + } } } @@ -662,6 +689,9 @@ record = record.Where( r => r.Date >= DateTime.Now.AddYears( -1 ) ); private bool ShouldSkipRecord( TimeSpan span ) { + if ( span.Ticks == 0 ) //初回のデータ( prev == First )は無視しない + return false; + switch ( SelectedChartSpan ) { case ChartSpan.Day: case ChartSpan.Week: From b09220a87a5d9accd5a0f023c069247fa4821441 Mon Sep 17 00:00:00 2001 From: Andante Date: Mon, 15 Jun 2015 00:14:33 +0900 Subject: [PATCH 24/26] =?UTF-8?q?=E8=89=A6=E3=81=93=E3=82=8CDB=E3=81=B8?= =?UTF-8?q?=E3=81=AE=E9=80=81=E4=BF=A1API=E3=82=92=E5=89=8A=E6=B8=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ElectronicObserver/Observer/APIKancolleDB.cs | 61 ++++---------------- 1 file changed, 12 insertions(+), 49 deletions(-) diff --git a/ElectronicObserver/Observer/APIKancolleDB.cs b/ElectronicObserver/Observer/APIKancolleDB.cs index 951f2dea9..fd9d71f58 100644 --- a/ElectronicObserver/Observer/APIKancolleDB.cs +++ b/ElectronicObserver/Observer/APIKancolleDB.cs @@ -18,55 +18,18 @@ namespace ElectronicObserver.Observer { /// http://kancolle-db.net/ public class APIKancolleDB { - public enum APIType : int { - PORT = 0, - SHIP2, - SHIP3, - KDOCK, - CHANGE, - CREATESHIP, - GETSHIP, - CREATEITEM, - START, - NEXT, - BATTLE, - BATTLE_MIDNIGHT, - BATTLE_SP_MIDNIGHT, - BATTLE_NIGHT_TO_DAY, - BATTLERESULT, - PRACTICE_BATTLE, - PRACTICE_BATTLERESULT, - COMBINED_BATTLE, - COMBINED_BATTLE_AIR, - COMBINED_BATTLE_MIDNIGHT, - COMBINED_BATTLE_RESULT - } - /// - /// all apis - /// - private static readonly Dictionary apis = new Dictionary { - { APIType.PORT, "/kcsapi/api_port/port" }, - { APIType.SHIP2, "/kcsapi/api_get_member/ship2" }, - { APIType.SHIP3, "/kcsapi/api_get_member/ship3" }, - { APIType.KDOCK, "/kcsapi/api_get_member/kdock" }, - { APIType.CHANGE, "/kcsapi/api_req_hensei/change" }, - { APIType.CREATESHIP, "/kcsapi/api_req_kousyou/createship" }, - { APIType.GETSHIP, "/kcsapi/api_req_kousyou/getship" }, - { APIType.CREATEITEM, "/kcsapi/api_req_kousyou/createitem" }, - { APIType.START, "/kcsapi/api_req_map/start" }, - { APIType.NEXT, "/kcsapi/api_req_map/next" }, - { APIType.BATTLE, "/kcsapi/api_req_sortie/battle" }, - { APIType.BATTLE_MIDNIGHT, "/kcsapi/api_req_battle_midnight/battle" }, - { APIType.BATTLE_SP_MIDNIGHT, "/kcsapi/api_req_battle_midnight/sp_midnight" }, - { APIType.BATTLE_NIGHT_TO_DAY, "/kcsapi/api_req_sortie/night_to_day" }, - { APIType.BATTLERESULT, "/kcsapi/api_req_sortie/battleresult" }, - { APIType.PRACTICE_BATTLE, "/kcsapi/api_req_practice/battle" }, - { APIType.PRACTICE_BATTLERESULT, "/kcsapi/api_req_practice/battle_result" }, - { APIType.COMBINED_BATTLE, "/kcsapi/api_req_combined_battle/battle" }, - { APIType.COMBINED_BATTLE_AIR, "/kcsapi/api_req_combined_battle/airbattle" }, - { APIType.COMBINED_BATTLE_MIDNIGHT, "/kcsapi/api_req_combined_battle/midnight_battle"}, - { APIType.COMBINED_BATTLE_RESULT, "/kcsapi/api_req_combined_battle/battleresult" } + private static readonly HashSet apis = new HashSet() { + "/kcsapi/api_port/port" , + "/kcsapi/api_get_member/ship2" , + "/kcsapi/api_get_member/ship3" , + "/kcsapi/api_get_member/kdock" , + "/kcsapi/api_req_hensei/change" , + "/kcsapi/api_req_kousyou/createship" , + "/kcsapi/api_req_kousyou/getship" , + "/kcsapi/api_req_kousyou/createitem" , + "/kcsapi/api_req_sortie/battleresult" , + "/kcsapi/api_req_combined_battle/battleresult", }; @@ -106,7 +69,7 @@ public void ExecuteSession( Session oSession ) { // find the url in dict. string url = oSession.PathAndQuery; - if ( apis.Values.Contains( url ) ) { + if ( apis.Contains( url ) ) { PostToServer( oSession ); } From ea51e91a862c5d1cbd627981ad4adf1aa8562d80 Mon Sep 17 00:00:00 2001 From: Andante Date: Wed, 17 Jun 2015 00:23:08 +0900 Subject: [PATCH 25/26] =?UTF-8?q?=E3=82=B0=E3=83=AB=E3=83=BC=E3=83=97?= =?UTF-8?q?=EF=BC=9A=E3=82=BF=E3=83=96=E3=81=AE=E9=A0=86=E5=BA=8F=E3=81=8C?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E3=81=95=E3=82=8C=E3=81=AA=E3=81=84=E4=B8=8D?= =?UTF-8?q?=E5=85=B7=E5=90=88=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ログ:装備改修時のログを追加 司令部:満タン時に点滅するかの設定を追加 --- ElectronicObserver/Data/ShipGroupManager.cs | 2 +- .../kcsapi/api_req_kousyou/remodel_slot.cs | 13 +++- ElectronicObserver/Utility/Configuration.cs | 7 ++ .../Dialog/DialogConfiguration.Designer.cs | 65 ++++++++++++++----- .../Window/Dialog/DialogConfiguration.cs | 4 ++ ElectronicObserver/Window/FormHeadquarters.cs | 12 ++-- 6 files changed, 77 insertions(+), 26 deletions(-) diff --git a/ElectronicObserver/Data/ShipGroupManager.cs b/ElectronicObserver/Data/ShipGroupManager.cs index f24c86e98..d12116c41 100644 --- a/ElectronicObserver/Data/ShipGroupManager.cs +++ b/ElectronicObserver/Data/ShipGroupManager.cs @@ -28,7 +28,7 @@ public class ShipGroupManager : DataStorage { [DataMember] private IEnumerable ShipGroupsSerializer { - get { return ShipGroups.Values; } + get { return ShipGroups.Values.OrderBy( g => g.ID ); } set { ShipGroups = new IDDictionary( value ); } } diff --git a/ElectronicObserver/Observer/kcsapi/api_req_kousyou/remodel_slot.cs b/ElectronicObserver/Observer/kcsapi/api_req_kousyou/remodel_slot.cs index 9e202bde2..92f18e44a 100644 --- a/ElectronicObserver/Observer/kcsapi/api_req_kousyou/remodel_slot.cs +++ b/ElectronicObserver/Observer/kcsapi/api_req_kousyou/remodel_slot.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; namespace ElectronicObserver.Observer.kcsapi.api_req_kousyou { - + public class remodel_slot : APIBase { public override void OnResponseReceived( dynamic data ) { @@ -15,12 +15,21 @@ public override void OnResponseReceived( dynamic data ) { db.Material.LoadFromResponse( APIName, data.api_after_material ); + if ( data.api_after_slot() ) { //改修成功時のみ存在 EquipmentData eq = db.Equipments[(int)data.api_after_slot.api_id]; - if ( eq != null ) + if ( eq != null ) { eq.LoadFromResponse( APIName, data.api_after_slot ); + + if ( Utility.Configuration.Config.Log.ShowSpoiler ) + Utility.Logger.Add( 2, string.Format( "{0} の改修に成功しました。", eq.NameWithLevel ) ); + } + + } else if ( Utility.Configuration.Config.Log.ShowSpoiler ) { + Utility.Logger.Add( 2, string.Format( "{0} の改修に失敗しました。", db.Equipments[(int)data.api_remodel_id[0]].NameWithLevel ) ); } + if ( data.api_use_slot_id() ) { foreach ( int id in data.api_use_slot_id ) { db.Equipments.Remove( id ); diff --git a/ElectronicObserver/Utility/Configuration.cs b/ElectronicObserver/Utility/Configuration.cs index 0f0e4614b..2e8fc14b5 100644 --- a/ElectronicObserver/Utility/Configuration.cs +++ b/ElectronicObserver/Utility/Configuration.cs @@ -358,7 +358,14 @@ public ConfigFormArsenal() { /// public class ConfigFormHeadquarters : ConfigPartBase { + /// + /// 艦船/装備が満タンの時点滅するか + /// + public bool BlinkAtMaximum { get; set; } + + public ConfigFormHeadquarters() { + BlinkAtMaximum = true; } } /// [司令部]ウィンドウ diff --git a/ElectronicObserver/Window/Dialog/DialogConfiguration.Designer.cs b/ElectronicObserver/Window/Dialog/DialogConfiguration.Designer.cs index aa9d7ce0b..391757c05 100644 --- a/ElectronicObserver/Window/Dialog/DialogConfiguration.Designer.cs +++ b/ElectronicObserver/Window/Dialog/DialogConfiguration.Designer.cs @@ -151,6 +151,8 @@ private void InitializeComponent() { this.FontSelector = new System.Windows.Forms.FontDialog(); this.LayoutFileBrowser = new System.Windows.Forms.OpenFileDialog(); this.APIListBrowser = new System.Windows.Forms.OpenFileDialog(); + this.tabPage16 = new System.Windows.Forms.TabPage(); + this.FormHeadquarters_BlinkAtMaximum = new System.Windows.Forms.CheckBox(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.Connection_UpstreamProxyPort)).BeginInit(); @@ -179,6 +181,7 @@ private void InitializeComponent() { this.groupBox4.SuspendLayout(); this.tabPage11.SuspendLayout(); this.tabPage15.SuspendLayout(); + this.tabPage16.SuspendLayout(); this.SuspendLayout(); // // tabControl1 @@ -661,10 +664,10 @@ private void InitializeComponent() { // this.tabPage4.Controls.Add(this.Control_ConditionBorder); this.tabPage4.Controls.Add(this.label7); - this.tabPage4.Location = new System.Drawing.Point(4, 24); + this.tabPage4.Location = new System.Drawing.Point(4, 44); this.tabPage4.Name = "tabPage4"; this.tabPage4.Padding = new System.Windows.Forms.Padding(3); - this.tabPage4.Size = new System.Drawing.Size(456, 253); + this.tabPage4.Size = new System.Drawing.Size(456, 233); this.tabPage4.TabIndex = 3; this.tabPage4.Text = "動作"; this.tabPage4.UseVisualStyleBackColor = true; @@ -767,10 +770,10 @@ private void InitializeComponent() { this.tabPage6.Controls.Add(this.label14); this.tabPage6.Controls.Add(this.Life_TopMost); this.tabPage6.Controls.Add(this.Life_ConfirmOnClosing); - this.tabPage6.Location = new System.Drawing.Point(4, 24); + this.tabPage6.Location = new System.Drawing.Point(4, 44); this.tabPage6.Name = "tabPage6"; this.tabPage6.Padding = new System.Windows.Forms.Padding(3); - this.tabPage6.Size = new System.Drawing.Size(456, 253); + this.tabPage6.Size = new System.Drawing.Size(456, 233); this.tabPage6.TabIndex = 5; this.tabPage6.Text = "ウィンドウ"; this.tabPage6.UseVisualStyleBackColor = true; @@ -847,10 +850,10 @@ private void InitializeComponent() { // tabPage7 // this.tabPage7.Controls.Add(this.tabControl2); - this.tabPage7.Location = new System.Drawing.Point(4, 24); + this.tabPage7.Location = new System.Drawing.Point(4, 44); this.tabPage7.Name = "tabPage7"; this.tabPage7.Padding = new System.Windows.Forms.Padding(3); - this.tabPage7.Size = new System.Drawing.Size(456, 253); + this.tabPage7.Size = new System.Drawing.Size(456, 233); this.tabPage7.TabIndex = 6; this.tabPage7.Text = "サブウィンドウ"; this.tabPage7.UseVisualStyleBackColor = true; @@ -859,6 +862,7 @@ private void InitializeComponent() { // this.tabControl2.Controls.Add(this.tabPage8); this.tabControl2.Controls.Add(this.tabPage9); + this.tabControl2.Controls.Add(this.tabPage16); this.tabControl2.Controls.Add(this.tabPage10); this.tabControl2.Controls.Add(this.tabPage13); this.tabControl2.Controls.Add(this.tabPage12); @@ -867,7 +871,7 @@ private void InitializeComponent() { this.tabControl2.Location = new System.Drawing.Point(3, 3); this.tabControl2.Name = "tabControl2"; this.tabControl2.SelectedIndex = 0; - this.tabControl2.Size = new System.Drawing.Size(450, 247); + this.tabControl2.Size = new System.Drawing.Size(450, 227); this.tabControl2.TabIndex = 0; // // tabPage8 @@ -882,7 +886,7 @@ private void InitializeComponent() { this.tabPage8.Location = new System.Drawing.Point(4, 24); this.tabPage8.Name = "tabPage8"; this.tabPage8.Padding = new System.Windows.Forms.Padding(3); - this.tabPage8.Size = new System.Drawing.Size(442, 219); + this.tabPage8.Size = new System.Drawing.Size(442, 199); this.tabPage8.TabIndex = 0; this.tabPage8.Text = "艦隊"; this.tabPage8.UseVisualStyleBackColor = true; @@ -966,10 +970,10 @@ private void InitializeComponent() { // tabPage9 // this.tabPage9.Controls.Add(this.FormArsenal_ShowShipName); - this.tabPage9.Location = new System.Drawing.Point(4, 34); + this.tabPage9.Location = new System.Drawing.Point(4, 24); this.tabPage9.Name = "tabPage9"; this.tabPage9.Padding = new System.Windows.Forms.Padding(3); - this.tabPage9.Size = new System.Drawing.Size(442, 209); + this.tabPage9.Size = new System.Drawing.Size(442, 199); this.tabPage9.TabIndex = 1; this.tabPage9.Text = "工廠"; this.tabPage9.UseVisualStyleBackColor = true; @@ -988,10 +992,10 @@ private void InitializeComponent() { // this.tabPage10.Controls.Add(this.groupBox1); this.tabPage10.Controls.Add(this.FormQuest_ShowRunningOnly); - this.tabPage10.Location = new System.Drawing.Point(4, 34); + this.tabPage10.Location = new System.Drawing.Point(4, 24); this.tabPage10.Name = "tabPage10"; this.tabPage10.Padding = new System.Windows.Forms.Padding(3); - this.tabPage10.Size = new System.Drawing.Size(442, 209); + this.tabPage10.Size = new System.Drawing.Size(442, 199); this.tabPage10.TabIndex = 2; this.tabPage10.Text = "任務"; this.tabPage10.UseVisualStyleBackColor = true; @@ -1063,10 +1067,10 @@ private void InitializeComponent() { // this.tabPage13.Controls.Add(this.FormShipGroup_ShowStatusBar); this.tabPage13.Controls.Add(this.FormShipGroup_AutoUpdate); - this.tabPage13.Location = new System.Drawing.Point(4, 34); + this.tabPage13.Location = new System.Drawing.Point(4, 24); this.tabPage13.Name = "tabPage13"; this.tabPage13.Padding = new System.Windows.Forms.Padding(3); - this.tabPage13.Size = new System.Drawing.Size(442, 209); + this.tabPage13.Size = new System.Drawing.Size(442, 199); this.tabPage13.TabIndex = 4; this.tabPage13.Text = "グループ"; this.tabPage13.UseVisualStyleBackColor = true; @@ -1106,10 +1110,10 @@ private void InitializeComponent() { this.tabPage12.Controls.Add(this.FormBrowser_LogInPageURL); this.tabPage12.Controls.Add(this.FormBrowser_ZoomRate); this.tabPage12.Controls.Add(this.label15); - this.tabPage12.Location = new System.Drawing.Point(4, 34); + this.tabPage12.Location = new System.Drawing.Point(4, 24); this.tabPage12.Name = "tabPage12"; this.tabPage12.Padding = new System.Windows.Forms.Padding(3); - this.tabPage12.Size = new System.Drawing.Size(442, 209); + this.tabPage12.Size = new System.Drawing.Size(442, 199); this.tabPage12.TabIndex = 3; this.tabPage12.Text = "ブラウザ"; this.tabPage12.UseVisualStyleBackColor = true; @@ -1365,10 +1369,10 @@ private void InitializeComponent() { // tabPage14 // this.tabPage14.Controls.Add(this.groupBox4); - this.tabPage14.Location = new System.Drawing.Point(4, 34); + this.tabPage14.Location = new System.Drawing.Point(4, 24); this.tabPage14.Name = "tabPage14"; this.tabPage14.Padding = new System.Windows.Forms.Padding(3); - this.tabPage14.Size = new System.Drawing.Size(442, 209); + this.tabPage14.Size = new System.Drawing.Size(442, 199); this.tabPage14.TabIndex = 5; this.tabPage14.Text = "ブラウザ2"; this.tabPage14.UseVisualStyleBackColor = true; @@ -1615,6 +1619,27 @@ private void InitializeComponent() { this.APIListBrowser.Filter = "Text File|*.txt|File|*"; this.APIListBrowser.Title = "API リストを開く"; // + // tabPage16 + // + this.tabPage16.Controls.Add(this.FormHeadquarters_BlinkAtMaximum); + this.tabPage16.Location = new System.Drawing.Point(4, 24); + this.tabPage16.Name = "tabPage16"; + this.tabPage16.Padding = new System.Windows.Forms.Padding(3); + this.tabPage16.Size = new System.Drawing.Size(442, 199); + this.tabPage16.TabIndex = 6; + this.tabPage16.Text = "司令部"; + this.tabPage16.UseVisualStyleBackColor = true; + // + // FormHeadquarters_BlinkAtMaximum + // + this.FormHeadquarters_BlinkAtMaximum.AutoSize = true; + this.FormHeadquarters_BlinkAtMaximum.Location = new System.Drawing.Point(6, 6); + this.FormHeadquarters_BlinkAtMaximum.Name = "FormHeadquarters_BlinkAtMaximum"; + this.FormHeadquarters_BlinkAtMaximum.Size = new System.Drawing.Size(196, 27); + this.FormHeadquarters_BlinkAtMaximum.TabIndex = 0; + this.FormHeadquarters_BlinkAtMaximum.Text = "艦船/装備が満タンの時点滅する"; + this.FormHeadquarters_BlinkAtMaximum.UseVisualStyleBackColor = true; + // // DialogConfiguration // this.AcceptButton = this.ButtonOK; @@ -1680,6 +1705,8 @@ private void InitializeComponent() { this.tabPage11.PerformLayout(); this.tabPage15.ResumeLayout(false); this.tabPage15.PerformLayout(); + this.tabPage16.ResumeLayout(false); + this.tabPage16.PerformLayout(); this.ResumeLayout(false); } @@ -1813,5 +1840,7 @@ private void InitializeComponent() { private System.Windows.Forms.TextBox Database_SendKancolleOAuth; private System.Windows.Forms.Label labelKdb; private System.Windows.Forms.CheckBox Database_SendDataToKancolleDB; + private System.Windows.Forms.TabPage tabPage16; + private System.Windows.Forms.CheckBox FormHeadquarters_BlinkAtMaximum; } } \ No newline at end of file diff --git a/ElectronicObserver/Window/Dialog/DialogConfiguration.cs b/ElectronicObserver/Window/Dialog/DialogConfiguration.cs index 1280ece16..476c68329 100644 --- a/ElectronicObserver/Window/Dialog/DialogConfiguration.cs +++ b/ElectronicObserver/Window/Dialog/DialogConfiguration.cs @@ -309,6 +309,8 @@ public void FromConfiguration( Configuration.ConfigurationData config ) { FormFleet_ShortenHPBar.Checked = config.FormFleet.ShortenHPBar; FormFleet_ShowNextExp.Checked = config.FormFleet.ShowNextExp; + FormHeadquarters_BlinkAtMaximum.Checked = config.FormHeadquarters.BlinkAtMaximum; + FormQuest_ShowRunningOnly.Checked = config.FormQuest.ShowRunningOnly; FormQuest_ShowOnce.Checked = config.FormQuest.ShowOnce; FormQuest_ShowDaily.Checked = config.FormQuest.ShowDaily; @@ -446,6 +448,8 @@ public void ToConfiguration( Configuration.ConfigurationData config ) { config.FormFleet.ShortenHPBar = FormFleet_ShortenHPBar.Checked; config.FormFleet.ShowNextExp = FormFleet_ShowNextExp.Checked; + config.FormHeadquarters.BlinkAtMaximum = FormHeadquarters_BlinkAtMaximum.Checked; + config.FormQuest.ShowRunningOnly = FormQuest_ShowRunningOnly.Checked; config.FormQuest.ShowOnce = FormQuest_ShowOnce.Checked; config.FormQuest.ShowDaily = FormQuest_ShowDaily.Checked; diff --git a/ElectronicObserver/Window/FormHeadquarters.cs b/ElectronicObserver/Window/FormHeadquarters.cs index 640beaac0..138f9f0ff 100644 --- a/ElectronicObserver/Window/FormHeadquarters.cs +++ b/ElectronicObserver/Window/FormHeadquarters.cs @@ -250,12 +250,14 @@ void SystemEvents_UpdateTimerTick() { if ( db.Ships.Count <= 0 ) return; - if ( ShipCount.Tag as bool? ?? false ) { - ShipCount.BackColor = DateTime.Now.Second % 2 == 0 ? Color.LightCoral : Color.Transparent; - } + if ( Utility.Configuration.Config.FormHeadquarters.BlinkAtMaximum ) { + if ( ShipCount.Tag as bool? ?? false ) { + ShipCount.BackColor = DateTime.Now.Second % 2 == 0 ? Color.LightCoral : Color.Transparent; + } - if ( EquipmentCount.Tag as bool? ?? false ) { - EquipmentCount.BackColor = DateTime.Now.Second % 2 == 0 ? Color.LightCoral : Color.Transparent; + if ( EquipmentCount.Tag as bool? ?? false ) { + EquipmentCount.BackColor = DateTime.Now.Second % 2 == 0 ? Color.LightCoral : Color.Transparent; + } } } From 6eb020a095786597629ece789fea6bd66229ba90 Mon Sep 17 00:00:00 2001 From: Andante Date: Wed, 17 Jun 2015 23:58:01 +0900 Subject: [PATCH 26/26] Version 1.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ・ログ:改修のログが間違えていたのを修正 ・司令部:設定変更時に表示が崩れるのを修正 --- .../Observer/kcsapi/api_req_kousyou/remodel_slot.cs | 2 +- ElectronicObserver/Utility/SoftwareInformation.cs | 2 +- ElectronicObserver/Window/FormHeadquarters.cs | 11 +++++++++++ README.md | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ElectronicObserver/Observer/kcsapi/api_req_kousyou/remodel_slot.cs b/ElectronicObserver/Observer/kcsapi/api_req_kousyou/remodel_slot.cs index 92f18e44a..9db1b3b70 100644 --- a/ElectronicObserver/Observer/kcsapi/api_req_kousyou/remodel_slot.cs +++ b/ElectronicObserver/Observer/kcsapi/api_req_kousyou/remodel_slot.cs @@ -26,7 +26,7 @@ public override void OnResponseReceived( dynamic data ) { } } else if ( Utility.Configuration.Config.Log.ShowSpoiler ) { - Utility.Logger.Add( 2, string.Format( "{0} の改修に失敗しました。", db.Equipments[(int)data.api_remodel_id[0]].NameWithLevel ) ); + Utility.Logger.Add( 2, string.Format( "{0} の改修に失敗しました。", db.MasterEquipments[(int)data.api_remodel_id[0]].Name ) ); } diff --git a/ElectronicObserver/Utility/SoftwareInformation.cs b/ElectronicObserver/Utility/SoftwareInformation.cs index b9235a650..e57c6e027 100644 --- a/ElectronicObserver/Utility/SoftwareInformation.cs +++ b/ElectronicObserver/Utility/SoftwareInformation.cs @@ -54,7 +54,7 @@ public static string VersionEnglish { /// public static DateTime UpdateTime { get { - return DateTimeHelper.CSVStringToTime( "2015/06/12 00:00:00" ); + return DateTimeHelper.CSVStringToTime( "2015/06/17 23:00:00" ); } } diff --git a/ElectronicObserver/Window/FormHeadquarters.cs b/ElectronicObserver/Window/FormHeadquarters.cs index 138f9f0ff..690544edc 100644 --- a/ElectronicObserver/Window/FormHeadquarters.cs +++ b/ElectronicObserver/Window/FormHeadquarters.cs @@ -106,6 +106,17 @@ void ConfigurationChanged() { Font = FlowPanelMaster.Font = Utility.Configuration.Config.UI.MainFont; HQLevel.MainFont = Utility.Configuration.Config.UI.MainFont; HQLevel.SubFont = Utility.Configuration.Config.UI.SubFont; + + // 点滅しない設定にしたときに消灯状態で固定されるのを防ぐ + if ( !Utility.Configuration.Config.FormHeadquarters.BlinkAtMaximum ) { + if ( ShipCount.Tag as bool? ?? false ) { + ShipCount.BackColor = Color.LightCoral; + } + + if ( EquipmentCount.Tag as bool? ?? false ) { + EquipmentCount.BackColor = Color.LightCoral; + } + } } void Updated( string apiname, dynamic data ) { diff --git a/README.md b/README.md index af6730dba..002287a1c 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ *このリンクの更新は遅れる可能性があります。最新版は[こちら](http://electronicobserver.blog.fc2.com/)で確認してください。* -[ver. 1.3.0 (2015/05/26)](http://bit.ly/1HsatH4) +[ver. 1.4.0 (2015/06/17)](http://bit.ly/1GOwsMb) 更新内容・履歴は[こちら](https://github.com/andanteyk/ElectronicObserver/wiki/ChangeLog)で確認できます。