From 4c2cc3aa03576b8f5a6f75a216a4d4926ff87225 Mon Sep 17 00:00:00 2001 From: RainbowMage Date: Sat, 6 Dec 2014 01:01:40 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=BB=E5=90=84=E3=82=AA=E3=83=BC=E3=83=90?= =?UTF-8?q?=E3=83=BC=E3=83=AC=E3=82=A4=E3=81=AE=20HTML=20=E5=86=85?= =?UTF-8?q?=E3=81=A7=20onOverlayDataUpdate=20=E3=82=A4=E3=83=99=E3=83=B3?= =?UTF-8?q?=E3=83=88=E3=82=92=E7=99=BA=E8=A1=8C=E3=81=99=E3=82=8B=E3=81=93?= =?UTF-8?q?=E3=81=A8=E3=81=AB=E3=82=88=E3=82=8A=E3=80=81=E3=82=A4=E3=83=99?= =?UTF-8?q?=E3=83=B3=E3=83=88=E3=83=89=E3=83=AA=E3=83=96=E3=83=B3=E3=81=AA?= =?UTF-8?q?=E5=8B=95=E4=BD=9C=E3=82=92=E5=8F=AF=E8=83=BD=E3=81=AB=E3=81=97?= =?UTF-8?q?=E3=81=9F=20=E3=83=BB=E3=83=AD=E3=82=B0=E3=83=93=E3=83=A5?= =?UTF-8?q?=E3=83=BC=E3=82=92=20ListView=20=E3=81=AB=E5=88=87=E3=82=8A?= =?UTF-8?q?=E6=9B=BF=E3=81=88=E3=80=81=E8=AD=A6=E5=91=8A=E3=82=84=E3=82=A8?= =?UTF-8?q?=E3=83=A9=E3=83=BC=E3=81=AF=E8=89=B2=E4=BB=98=E3=81=8D=E3=81=A7?= =?UTF-8?q?=E8=A1=A8=E7=A4=BA=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= =?UTF-8?q?=E3=81=97=E3=81=9F=20=E3=83=BB=E3=83=AD=E3=82=B0=E3=83=93?= =?UTF-8?q?=E3=83=A5=E3=83=BC=E3=81=AE=E3=82=B3=E3=83=B3=E3=83=86=E3=82=AD?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=83=A1=E3=83=8B=E3=83=A5=E3=83=BC=E3=81=AB?= =?UTF-8?q?=E3=80=8C=E3=81=99=E3=81=B9=E3=81=A6=E3=81=AE=E3=83=AD=E3=82=B0?= =?UTF-8?q?=E3=82=92=E3=82=B3=E3=83=94=E3=83=BC=E3=80=8D=E3=80=8C=E5=B8=B8?= =?UTF-8?q?=E3=81=AB=E6=9C=80=E6=96=B0=E3=81=AE=E3=83=AD=E3=82=B0=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E8=B7=A1=E3=80=8D=E3=80=8C=E3=83=AD=E3=82=B0=E3=82=92?= =?UTF-8?q?=E3=82=AF=E3=83=AA=E3=82=A2=E3=80=8D=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=E3=81=97=E3=81=9F=20=E3=83=BBCEF=20=E3=81=8B=E3=82=89=E5=87=BA?= =?UTF-8?q?=E5=8A=9B=E3=81=95=E3=82=8C=E3=82=8B=E3=82=B3=E3=83=B3=E3=82=BD?= =?UTF-8?q?=E3=83=BC=E3=83=AB=E3=83=A1=E3=83=83=E3=82=BB=E3=83=BC=E3=82=B8?= =?UTF-8?q?=E3=82=92=E3=83=AD=E3=82=B0=E3=81=AB=E8=A1=A8=E7=A4=BA=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=97=E3=81=9F=20?= =?UTF-8?q?=E3=83=BB=E3=83=9F=E3=83=8B=E3=83=91=E3=83=BC=E3=82=B9=E3=82=AA?= =?UTF-8?q?=E3=83=BC=E3=83=90=E3=83=BC=E3=83=AC=E3=82=A4=E7=94=A8=20HTML?= =?UTF-8?q?=20=E3=81=AE=E3=83=87=E3=83=95=E3=82=A9=E3=83=AB=E3=83=88?= =?UTF-8?q?=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E5=90=8D=E3=82=92=20defaul?= =?UTF-8?q?t.html=20=E3=81=8B=E3=82=89=20miniparse.html=20=E3=81=AB?= =?UTF-8?q?=E5=A4=89=E6=9B=B4=E3=81=97=E3=81=9F=20=E3=83=BBminiparse.html?= =?UTF-8?q?=20=E3=81=AB=E3=81=8A=E3=81=84=E3=81=A6=E3=80=81=E3=82=A4?= =?UTF-8?q?=E3=83=99=E3=83=B3=E3=83=88=E3=83=89=E3=83=AA=E3=83=96=E3=83=B3?= =?UTF-8?q?=E3=81=AA=E5=8B=95=E4=BD=9C=E3=82=92=E8=A1=8C=E3=81=86=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E5=A4=89=E6=9B=B4=E3=81=97=E3=81=9F=20?= =?UTF-8?q?=E3=83=BBminiparse.html=20=E3=81=AB=E3=81=8A=E3=81=84=E3=81=A6?= =?UTF-8?q?=E3=80=81=E5=90=84=E9=A0=85=E7=9B=AE=E3=81=AB=20HTML=20?= =?UTF-8?q?=E3=82=92=E6=8C=87=E5=AE=9A=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E6=94=B9=E8=89=AF=E3=81=97=E3=81=9F=20?= =?UTF-8?q?=E3=83=BBminiparse.html=20=E3=81=AB=E3=81=8A=E3=81=84=E3=81=A6?= =?UTF-8?q?=E3=80=81=E3=83=87=E3=83=BC=E3=82=BF=E5=AE=9A=E7=BE=A9=E3=81=AE?= =?UTF-8?q?=20text=E3=80=81html=20=E3=83=97=E3=83=AD=E3=83=91=E3=83=86?= =?UTF-8?q?=E3=82=A3=E3=81=AB=E9=96=A2=E6=95=B0=E3=82=92=E6=8C=87=E5=AE=9A?= =?UTF-8?q?=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E6=94=B9?= =?UTF-8?q?=E8=89=AF=E3=81=97=E3=81=9F=20=E3=83=BBminiparse.html=20?= =?UTF-8?q?=E3=81=AB=E3=81=8A=E3=81=84=E3=81=A6=E3=80=81=E3=83=87=E3=83=BC?= =?UTF-8?q?=E3=82=BF=E5=AE=9A=E7=BE=A9=E3=81=AE=E3=83=97=E3=83=AD=E3=83=91?= =?UTF-8?q?=E3=83=86=E3=82=A3=E3=81=AB=20effect=20=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0=E3=81=97=E3=81=9F=20=E3=83=BB=E9=85=8D=E5=B8=83?= =?UTF-8?q?=E3=83=90=E3=82=A4=E3=83=8A=E3=83=AA=E3=81=AB=E3=81=A4=E3=81=84?= =?UTF-8?q?=E3=81=A6=E3=80=81-update=20=E3=81=AE=E3=81=BB=E3=81=86?= =?UTF-8?q?=E3=81=AB=20resources=20=E3=83=95=E3=82=A9=E3=83=AB=E3=83=80?= =?UTF-8?q?=E3=82=92=E6=AF=8E=E5=9B=9E=E5=90=AB=E3=82=81=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HtmlRenderer/Client.cs | 7 + HtmlRenderer/DisplayHandler.cs | 26 +++ HtmlRenderer/HtmlRenderer.csproj | 1 + HtmlRenderer/Properties/AssemblyInfo.cs | 7 +- HtmlRenderer/Renderer.cs | 25 ++- OverlayPlugin/ControlPanel.Designer.cs | 112 ++++++++++-- OverlayPlugin/ControlPanel.cs | 103 ++++++++--- OverlayPlugin/MiniParseOverlay.cs | 50 ++++- OverlayPlugin/OverlayBase.cs | 101 +++++++---- OverlayPlugin/OverlayPlugin.csproj | 2 +- OverlayPlugin/PluginConfig.cs | 4 + OverlayPlugin/PluginMain.cs | 110 ++++++----- OverlayPlugin/Properties/AssemblyInfo.cs | 2 +- OverlayPlugin/SpellTimerOverlay.cs | 14 +- .../{default.html => miniparse.html} | 171 ++++++++++++++---- OverlayPlugin/resources/spelltimer.html | 4 - distribute.ps1 | 1 + 17 files changed, 552 insertions(+), 188 deletions(-) create mode 100644 HtmlRenderer/DisplayHandler.cs rename OverlayPlugin/resources/{default.html => miniparse.html} (53%) diff --git a/HtmlRenderer/Client.cs b/HtmlRenderer/Client.cs index 60d7faf75..7feba82e6 100644 --- a/HtmlRenderer/Client.cs +++ b/HtmlRenderer/Client.cs @@ -13,6 +13,7 @@ class Client : CefClient private readonly RenderHandler renderHandler; private readonly LifeSpanHandler lifeSpanHandler; private readonly LoadHandler loadHandler; + private readonly DisplayHandler displayHandler; public Client(Renderer renderer, int windowWidth, int windowHeight) { @@ -20,6 +21,7 @@ public Client(Renderer renderer, int windowWidth, int windowHeight) this.renderHandler = new RenderHandler(renderer, windowWidth, windowHeight); this.lifeSpanHandler = new LifeSpanHandler(renderer); this.loadHandler = new LoadHandler(renderer); + this.displayHandler = new DisplayHandler(renderer); } protected override CefRenderHandler GetRenderHandler() @@ -37,6 +39,11 @@ protected override CefLoadHandler GetLoadHandler() return loadHandler; } + protected override CefDisplayHandler GetDisplayHandler() + { + return displayHandler; + } + public void ResizeView(int width, int height) { renderHandler.Width = width; diff --git a/HtmlRenderer/DisplayHandler.cs b/HtmlRenderer/DisplayHandler.cs new file mode 100644 index 000000000..1c558e7b5 --- /dev/null +++ b/HtmlRenderer/DisplayHandler.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Xilium.CefGlue; + +namespace RainbowMage.HtmlRenderer +{ + class DisplayHandler : CefDisplayHandler + { + private Renderer renderer; + + public DisplayHandler(Renderer renderer) + { + this.renderer = renderer; + } + + protected override bool OnConsoleMessage(CefBrowser browser, string message, string source, int line) + { + this.renderer.OnConsoleLog(browser, message, source, line); + + return base.OnConsoleMessage(browser, message, source, line); + } + } +} diff --git a/HtmlRenderer/HtmlRenderer.csproj b/HtmlRenderer/HtmlRenderer.csproj index 423992462..025929afb 100644 --- a/HtmlRenderer/HtmlRenderer.csproj +++ b/HtmlRenderer/HtmlRenderer.csproj @@ -45,6 +45,7 @@ + diff --git a/HtmlRenderer/Properties/AssemblyInfo.cs b/HtmlRenderer/Properties/AssemblyInfo.cs index 42362ccef..0df66a5fc 100644 --- a/HtmlRenderer/Properties/AssemblyInfo.cs +++ b/HtmlRenderer/Properties/AssemblyInfo.cs @@ -6,11 +6,11 @@ // アセンブリに関連付けられている情報を変更するには、 // これらの属性値を変更してください。 [assembly: AssemblyTitle("HtmlRenderer")] -[assembly: AssemblyDescription("")] +[assembly: AssemblyDescription("HTML based offscreen rendering library for the OverlayPlugin.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("HtmlRenderer")] -[assembly: AssemblyCopyright("Copyright © 2014")] +[assembly: AssemblyCopyright("Copyright © RainbowMage 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -32,5 +32,4 @@ // すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を // 既定値にすることができます: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.0.0.1")] diff --git a/HtmlRenderer/Renderer.cs b/HtmlRenderer/Renderer.cs index 8a800afd5..cef67daaa 100644 --- a/HtmlRenderer/Renderer.cs +++ b/HtmlRenderer/Renderer.cs @@ -12,6 +12,7 @@ public class Renderer : IDisposable public event EventHandler Render; public event EventHandler BrowserError; public event EventHandler BrowserLoad; + public event EventHandler BrowserConsoleLog; public CefBrowser Browser { get; private set; } private Client Client { get; set; } @@ -101,6 +102,14 @@ internal void OnLoad(CefBrowser browser, CefFrame frame, int httpStatusCode) } } + internal void OnConsoleLog(CefBrowser browser, string message, string source, int line) + { + if (BrowserConsoleLog != null) + { + BrowserConsoleLog(this, new BrowserConsoleLogEventArgs(message, source, line)); + } + } + public void Dispose() { var host = Browser.GetHost(); @@ -129,7 +138,8 @@ public static void Initialize() var cefSettings = new CefSettings { SingleProcess = true, - MultiThreadedMessageLoop = true + MultiThreadedMessageLoop = true, + LogSeverity = CefLogSeverity.Disable }; CefRuntime.Initialize(cefMainArgs, cefSettings, cefApp, IntPtr.Zero); @@ -170,4 +180,17 @@ public BrowserLoadEventArgs(int httpStatusCode, string url) this.Url = url; } } + + public class BrowserConsoleLogEventArgs : EventArgs + { + public string Message { get; private set; } + public string Source { get; private set; } + public int Line { get; private set; } + public BrowserConsoleLogEventArgs(string message, string source, int line) + { + this.Message = message; + this.Source = source; + this.Line = line; + } + } } diff --git a/OverlayPlugin/ControlPanel.Designer.cs b/OverlayPlugin/ControlPanel.Designer.cs index 31144d158..e06582d83 100644 --- a/OverlayPlugin/ControlPanel.Designer.cs +++ b/OverlayPlugin/ControlPanel.Designer.cs @@ -46,7 +46,6 @@ private void InitializeComponent() this.textMiniParseUrl = new System.Windows.Forms.TextBox(); this.buttonMiniParseSelectFile = new System.Windows.Forms.Button(); this.comboMiniParseSortType = new System.Windows.Forms.ComboBox(); - this.listLog = new System.Windows.Forms.ListBox(); this.contextMenuLogList = new System.Windows.Forms.ContextMenuStrip(this.components); this.menuLogCopy = new System.Windows.Forms.ToolStripMenuItem(); this.tabControl1 = new System.Windows.Forms.TabControl(); @@ -72,6 +71,15 @@ private void InitializeComponent() this.nudSpellTimerMaxFrameRate = new System.Windows.Forms.NumericUpDown(); this.label12 = new System.Windows.Forms.Label(); this.label13 = new System.Windows.Forms.Label(); + this.listViewLog = new System.Windows.Forms.ListView(); + this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator(); + this.menuFollowLatestLog = new System.Windows.Forms.ToolStripMenuItem(); + this.menuClearLog = new System.Windows.Forms.ToolStripMenuItem(); + this.menuCopyLogAll = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); @@ -105,7 +113,7 @@ private void InitializeComponent() // // splitContainer1.Panel2 // - this.splitContainer1.Panel2.Controls.Add(this.listLog); + this.splitContainer1.Panel2.Controls.Add(this.listViewLog); this.splitContainer1.Size = new System.Drawing.Size(602, 412); this.splitContainer1.SplitterDistance = 276; this.splitContainer1.TabIndex = 0; @@ -311,31 +319,22 @@ private void InitializeComponent() this.comboMiniParseSortType.Size = new System.Drawing.Size(431, 20); this.comboMiniParseSortType.TabIndex = 11; // - // listLog - // - this.listLog.ContextMenuStrip = this.contextMenuLogList; - this.listLog.Dock = System.Windows.Forms.DockStyle.Fill; - this.listLog.FormattingEnabled = true; - this.listLog.HorizontalScrollbar = true; - this.listLog.ItemHeight = 12; - this.listLog.Location = new System.Drawing.Point(0, 0); - this.listLog.Name = "listLog"; - this.listLog.ScrollAlwaysVisible = true; - this.listLog.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended; - this.listLog.Size = new System.Drawing.Size(602, 132); - this.listLog.TabIndex = 0; - // // contextMenuLogList // this.contextMenuLogList.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.menuLogCopy}); + this.menuCopyLogAll, + this.menuLogCopy, + this.toolStripMenuItem1, + this.menuFollowLatestLog, + this.toolStripMenuItem2, + this.menuClearLog}); this.contextMenuLogList.Name = "contextMenuLogList"; - this.contextMenuLogList.Size = new System.Drawing.Size(177, 26); + this.contextMenuLogList.Size = new System.Drawing.Size(181, 104); // // menuLogCopy // this.menuLogCopy.Name = "menuLogCopy"; - this.menuLogCopy.Size = new System.Drawing.Size(176, 22); + this.menuLogCopy.Size = new System.Drawing.Size(180, 22); this.menuLogCopy.Text = "選択した項目をコピー"; this.menuLogCopy.Click += new System.EventHandler(this.menuLogCopy_Click); // @@ -649,6 +648,71 @@ private void InitializeComponent() this.label13.Text = "※最大フレームレートの変更を有効にするためには再起動が必要です"; this.label13.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // + // listViewLog + // + this.listViewLog.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnHeader1, + this.columnHeader2, + this.columnHeader3}); + this.listViewLog.ContextMenuStrip = this.contextMenuLogList; + this.listViewLog.Dock = System.Windows.Forms.DockStyle.Fill; + this.listViewLog.FullRowSelect = true; + this.listViewLog.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; + this.listViewLog.HideSelection = false; + this.listViewLog.Location = new System.Drawing.Point(0, 0); + this.listViewLog.Name = "listViewLog"; + this.listViewLog.Size = new System.Drawing.Size(602, 132); + this.listViewLog.TabIndex = 0; + this.listViewLog.UseCompatibleStateImageBehavior = false; + this.listViewLog.View = System.Windows.Forms.View.Details; + this.listViewLog.VirtualMode = true; + this.listViewLog.RetrieveVirtualItem += new System.Windows.Forms.RetrieveVirtualItemEventHandler(this.listViewLog_RetrieveVirtualItem); + // + // columnHeader1 + // + this.columnHeader1.Text = "Time"; + // + // columnHeader2 + // + this.columnHeader2.Text = "Level"; + // + // columnHeader3 + // + this.columnHeader3.Text = "Message"; + this.columnHeader3.Width = 451; + // + // toolStripMenuItem1 + // + this.toolStripMenuItem1.Name = "toolStripMenuItem1"; + this.toolStripMenuItem1.Size = new System.Drawing.Size(177, 6); + // + // menuFollowLatestLog + // + this.menuFollowLatestLog.CheckOnClick = true; + this.menuFollowLatestLog.Name = "menuFollowLatestLog"; + this.menuFollowLatestLog.Size = new System.Drawing.Size(180, 22); + this.menuFollowLatestLog.Text = "常に最新のログを追跡"; + this.menuFollowLatestLog.Click += new System.EventHandler(this.menuFollowLatestLog_Click); + // + // menuClearLog + // + this.menuClearLog.Name = "menuClearLog"; + this.menuClearLog.Size = new System.Drawing.Size(180, 22); + this.menuClearLog.Text = "ログをクリア"; + this.menuClearLog.Click += new System.EventHandler(this.menuClearLog_Click); + // + // menuCopyLogAll + // + this.menuCopyLogAll.Name = "menuCopyLogAll"; + this.menuCopyLogAll.Size = new System.Drawing.Size(180, 22); + this.menuCopyLogAll.Text = "全てのログをコピー"; + this.menuCopyLogAll.Click += new System.EventHandler(this.menuCopyLogAll_Click); + // + // toolStripMenuItem2 + // + this.toolStripMenuItem2.Name = "toolStripMenuItem2"; + this.toolStripMenuItem2.Size = new System.Drawing.Size(177, 6); + // // ControlPanel // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -695,7 +759,6 @@ private void InitializeComponent() private System.Windows.Forms.TextBox textMiniParseUrl; private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Button buttonMiniParseReloadBrowser; - internal System.Windows.Forms.ListBox listLog; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; private System.Windows.Forms.Button buttonMiniParseSelectFile; private System.Windows.Forms.ContextMenuStrip contextMenuLogList; @@ -728,5 +791,14 @@ private void InitializeComponent() private System.Windows.Forms.NumericUpDown nudSpellTimerMaxFrameRate; private System.Windows.Forms.Label label13; private System.Windows.Forms.Label label12; + private System.Windows.Forms.ListView listViewLog; + private System.Windows.Forms.ColumnHeader columnHeader1; + private System.Windows.Forms.ColumnHeader columnHeader2; + private System.Windows.Forms.ColumnHeader columnHeader3; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1; + private System.Windows.Forms.ToolStripMenuItem menuFollowLatestLog; + private System.Windows.Forms.ToolStripMenuItem menuCopyLogAll; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem2; + private System.Windows.Forms.ToolStripMenuItem menuClearLog; } } diff --git a/OverlayPlugin/ControlPanel.cs b/OverlayPlugin/ControlPanel.cs index 05ea75113..e8f3fd2f4 100644 --- a/OverlayPlugin/ControlPanel.cs +++ b/OverlayPlugin/ControlPanel.cs @@ -37,9 +37,21 @@ public ControlPanel(PluginMain pluginMain, PluginConfig config) SetupMiniParseTab(); SetupSpellTimerTab(); - this.listLog.DataSource = pluginMain.Logs; + this.menuFollowLatestLog.Checked = this.config.FollowLatestLog; + this.listViewLog.VirtualListSize = pluginMain.Logs.Count; + this.pluginMain.Logs.ListChanged += (o, e) => + { + this.listViewLog.BeginUpdate(); + this.listViewLog.VirtualListSize = pluginMain.Logs.Count; + if (this.config.FollowLatestLog && this.pluginMain.Logs.Count > 0) + { + this.listViewLog.EnsureVisible(this.pluginMain.Logs.Count - 1); + } + this.listViewLog.EndUpdate(); + }; } + private void SetupMiniParseTab() { this.checkMiniParseVisible.Checked = config.MiniParseOverlay.IsVisible; @@ -169,14 +181,7 @@ private void textUrl_TextChanged(object sender, EventArgs e) private void buttonReloadBrowser_Click(object sender, EventArgs e) { - if (pluginMain.MiniParseOverlay.Overlay.Url != config.MiniParseOverlay.Url) - { - pluginMain.MiniParseOverlay.Overlay.Url = config.MiniParseOverlay.Url; - } - else - { - pluginMain.MiniParseOverlay.Overlay.Reload(); - } + pluginMain.MiniParseOverlay.Navigate(config.MiniParseOverlay.Url); } private void buttonSelectFile_Click(object sender, EventArgs e) @@ -191,12 +196,17 @@ private void buttonSelectFile_Click(object sender, EventArgs e) private void menuLogCopy_Click(object sender, EventArgs e) { - if (listLog.SelectedItems != null) + if (listViewLog.SelectedIndices.Count > 0) { var sb = new StringBuilder(); - foreach (var item in listLog.SelectedItems) + foreach (int index in listViewLog.SelectedIndices) { - sb.AppendLine(item.ToString()); + sb.AppendFormat( + "{0}: {1}: {2}", + pluginMain.Logs[index].Time, + pluginMain.Logs[index].Level, + pluginMain.Logs[index].Message); + sb.AppendLine(); } Clipboard.SetText(sb.ToString()); } @@ -204,10 +214,10 @@ private void menuLogCopy_Click(object sender, EventArgs e) private void buttonCopyActXiv_Click(object sender, EventArgs e) { - var updateScript = pluginMain.MiniParseOverlay.CreateUpdateScript(); - if (!string.IsNullOrWhiteSpace(updateScript)) + var json = pluginMain.MiniParseOverlay.CreateJsonData(); + if (!string.IsNullOrWhiteSpace(json)) { - Clipboard.SetText("var " + updateScript); + Clipboard.SetText("var ActXiv = " + json + ";"); } } @@ -254,28 +264,75 @@ private void buttonSpellTimerSelectFile_Click(object sender, EventArgs e) private void buttonSpellTimerCopyActXiv_Click(object sender, EventArgs e) { - var updateScript = pluginMain.SpellTimerOverlay.CreateUpdateString(); - if (!string.IsNullOrWhiteSpace(updateScript)) + var json = pluginMain.SpellTimerOverlay.CreateJsonData(); + if (!string.IsNullOrWhiteSpace(json)) { - Clipboard.SetText("var " + updateScript); + Clipboard.SetText("var ActXiv = " + json + ";"); } } private void buttonSpellTimerReloadBrowser_Click(object sender, EventArgs e) { - if (pluginMain.SpellTimerOverlay.Overlay.Url != config.SpellTimerOverlay.Url) + pluginMain.SpellTimerOverlay.Navigate(config.SpellTimerOverlay.Url); + } + + private void nudSpellTimerMaxFrameRate_ValueChanged(object sender, EventArgs e) + { + this.config.SpellTimerOverlay.MaxFrameRate = (int)nudSpellTimerMaxFrameRate.Value; + } + + private void listViewLog_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e) + { + if (e.ItemIndex >= pluginMain.Logs.Count) + { + e.Item = new ListViewItem(); + return; + }; + + var log = this.pluginMain.Logs[e.ItemIndex]; + e.Item = new ListViewItem(log.Time.ToString()); + e.Item.UseItemStyleForSubItems = true; + e.Item.SubItems.Add(log.Level.ToString()); + e.Item.SubItems.Add(log.Message); + + e.Item.ForeColor = Color.Black; + if (log.Level == LogLevel.Warning) { - pluginMain.SpellTimerOverlay.Overlay.Url = config.SpellTimerOverlay.Url; + e.Item.BackColor = Color.LightYellow; + } + else if (log.Level == LogLevel.Error) + { + e.Item.BackColor = Color.LightPink; } else { - pluginMain.SpellTimerOverlay.Overlay.Reload(); + e.Item.BackColor = Color.White; } } - private void nudSpellTimerMaxFrameRate_ValueChanged(object sender, EventArgs e) + private void menuFollowLatestLog_Click(object sender, EventArgs e) { - this.config.SpellTimerOverlay.MaxFrameRate = (int)nudSpellTimerMaxFrameRate.Value; + this.config.FollowLatestLog = menuFollowLatestLog.Checked; + } + + private void menuClearLog_Click(object sender, EventArgs e) + { + this.pluginMain.Logs.Clear(); + } + + private void menuCopyLogAll_Click(object sender, EventArgs e) + { + var sb = new StringBuilder(); + foreach (var log in this.pluginMain.Logs) + { + sb.AppendFormat( + "{0}: {1}: {2}", + log.Time, + log.Level, + log.Message); + sb.AppendLine(); + } + Clipboard.SetText(sb.ToString()); } } } diff --git a/OverlayPlugin/MiniParseOverlay.cs b/OverlayPlugin/MiniParseOverlay.cs index 8aac772a6..f3c5d7d54 100644 --- a/OverlayPlugin/MiniParseOverlay.cs +++ b/OverlayPlugin/MiniParseOverlay.cs @@ -12,24 +12,54 @@ namespace RainbowMage.OverlayPlugin { class MiniParseOverlay : OverlayBase { + private string prevEncounterId { get; set; } + private DateTime prevEndDateTime { get; set; } + public MiniParseOverlay(MiniParseOverlayConfig config) : base(config, "MiniParseOverlay") { } - protected override void Update() + public override void Navigate(string url) { - var updateScript = CreateUpdateScript(); + base.Navigate(url); + + this.prevEncounterId = null; + this.prevEndDateTime = DateTime.MinValue; + } - if (this.Overlay != null && - this.Overlay.Renderer != null && - this.Overlay.Renderer.Browser != null) + protected override void Update() + { + if (CheckIsActReady()) { - this.Overlay.Renderer.Browser.GetMainFrame().ExecuteJavaScript(updateScript, null, 0); + // 最終更新時刻に変化がないなら更新を行わない + if (this.prevEncounterId == ActGlobals.oFormActMain.ActiveZone.ActiveEncounter.EncId && + this.prevEndDateTime == ActGlobals.oFormActMain.ActiveZone.ActiveEncounter.EndTime) + { + return; + } + + this.prevEncounterId = ActGlobals.oFormActMain.ActiveZone.ActiveEncounter.EncId; + this.prevEndDateTime = ActGlobals.oFormActMain.ActiveZone.ActiveEncounter.EndTime; + + var updateScript = CreateEventDispatcherScript(); + + if (this.Overlay != null && + this.Overlay.Renderer != null && + this.Overlay.Renderer.Browser != null) + { + this.Overlay.Renderer.Browser.GetMainFrame().ExecuteJavaScript(updateScript, null, 0); + } } } - public string CreateUpdateScript() + private string CreateEventDispatcherScript() + { + return "var ActXiv = " + this.CreateJsonData() + ";\n" + + "document.dispatchEvent(new CustomEvent('onOverlayDataUpdate', { detail: ActXiv }));"; + } + + internal string CreateJsonData() { if (!CheckIsActReady()) { @@ -49,7 +79,7 @@ public string CreateUpdateScript() SortCombatantList(combatant); var builder = new StringBuilder(); - builder.Append("ActXiv = {"); + builder.Append("{"); builder.Append("\"Encounter\": {"); var isFirst1 = true; foreach (var pair in encounter) @@ -95,11 +125,11 @@ public string CreateUpdateScript() } builder.Append("},"); builder.AppendFormat("\"isActive\": {0}", ActGlobals.oFormActMain.ActiveZone.ActiveEncounter.Active ? "true" : "false"); - builder.Append("};"); + builder.Append("}"); #if DEBUG stopwatch.Stop(); - Log("Debug: MiniParseOverlayUpdater: GetUpdateScript: {0} msec", stopwatch.Elapsed.TotalMilliseconds); + Log(LogLevel.Trace, "CreateUpdateScript: {0} msec", stopwatch.Elapsed.TotalMilliseconds); #endif return builder.ToString(); diff --git a/OverlayPlugin/OverlayBase.cs b/OverlayPlugin/OverlayBase.cs index bbdd8df1b..ed453a861 100644 --- a/OverlayPlugin/OverlayBase.cs +++ b/OverlayPlugin/OverlayBase.cs @@ -14,7 +14,6 @@ public abstract class OverlayBase : IDisposable { public event EventHandler OnLog; - //protected PluginMain pluginMain; protected System.Timers.Timer timer; public string Name { get; private set; } @@ -46,34 +45,7 @@ protected virtual void InitializeOverlay() { try { - Uri uri = null; - try - { - uri = new System.Uri(this.Config.Url); - - // ローカルファイルの場合はファイルが存在するかチェックし、存在しなければ警告を出力 - if (uri.Scheme == "file") - { - if (!File.Exists(uri.LocalPath)) - { - Log("Warn: {0}: InitializeOverlay: Local file {1} is not exist!", - this.Name, - uri.LocalPath); - } - } - } - catch (Exception ex) - { - // URL パースエラー - Log("Error: {0}: InitializeOverlay: URI parse error! (Config.Url = {1}): {2}", - this.Name, - this.Config.Url, - ex); - Log("Error: {0}: InitializeOverlay: Please reconfigure URL.", this.Name); - uri = new System.Uri("about:blank"); // 空白ページを表示 - } - - this.Overlay = new OverlayForm(uri.AbsoluteUri, this.Config.MaxFrameRate); + this.Overlay = new OverlayForm("about:blank", this.Config.MaxFrameRate); // 画面外にウィンドウがある場合は、初期表示位置をシステムに設定させる if (!Util.IsOnScreen(this.Overlay)) @@ -88,23 +60,60 @@ protected virtual void InitializeOverlay() this.Overlay.IsClickThru = this.Config.IsClickThru; this.Overlay.Renderer.BrowserError += (o, e) => { - Log("Error: {0}: Overlay: {1}, {2}, {3}", this.Name, e.ErrorCode, e.ErrorText, e.Url); + Log(LogLevel.Error, "BrowserError: {0}, {1}, {2}", e.ErrorCode, e.ErrorText, e.Url); }; this.Overlay.Renderer.BrowserLoad += (o, e) => { - Log("Info: {0}: Overlay: {1}: {2}", this.Name, e.HttpStatusCode, e.Url); + Log(LogLevel.Debug, "BrowserLoad: {0}: {1}", e.HttpStatusCode, e.Url); + }; + this.Overlay.Renderer.BrowserConsoleLog += (o, e) => + { + Log(LogLevel.Info, "BrowserConsole: {0} (Source: {1}, Line: {2})", e.Message, e.Source, e.Line); }; + Navigate(this.Config.Url); + this.Overlay.Show(); this.Overlay.Visible = this.Config.IsVisible; } catch (Exception ex) { - Log("Error: {0}: InitializeOverlay: {1}", this.Name, ex); + Log(LogLevel.Error, "InitializeOverlay: {0}", this.Name, ex); } } + private bool CheckUrl(string url) + { + try + { + var uri = new System.Uri(url); + + // ローカルファイルの場合はファイルが存在するかチェックし、存在しなければ警告を出力 + if (uri.Scheme == "file") + { + if (!File.Exists(uri.LocalPath)) + { + Log(LogLevel.Warning, + "InitializeOverlay: Local file {0} does not exist!", + uri.LocalPath); + return false; + } + } + } + catch (Exception ex) + { + // URL パースエラー + Log(LogLevel.Error, + "InitializeOverlay: URI parse error! Please reconfigure the URL. (Config.Url = {0}): {1}", + this.Config.Url, + ex); + return false; + } + + return true; + } + protected virtual void InitializeTimer() { timer = new System.Timers.Timer(); @@ -117,7 +126,7 @@ protected virtual void InitializeTimer() } catch (Exception ex) { - Log("Error: {0}: Update: {0}", this.Name, ex.ToString()); + Log(LogLevel.Error, "Update: {0}", ex.ToString()); } }; } @@ -147,30 +156,44 @@ public void Dispose() } catch (Exception ex) { - Log("Error: {0}: Dispose: {1}", this.Name, ex); + Log(LogLevel.Error, "Dispose: {0}", ex); + } + } + + public virtual void Navigate(string url) + { + if (this.Overlay.Url != url) + { + this.Overlay.Url = url; + } + else + { + this.Overlay.Reload(); } } public class LogEventArgs : EventArgs { public string Message { get; private set; } - public LogEventArgs(string message) + public LogLevel Level { get; private set; } + public LogEventArgs(LogLevel level, string message) { this.Message = message; + this.Level = level; } } - protected void Log(string message) + protected void Log(LogLevel level, string message) { if (OnLog != null) { - OnLog(this, new LogEventArgs(message)); + OnLog(this, new LogEventArgs(level, string.Format("{0}: {1}", this.Name, message))); } } - protected void Log(string format, params object[] args) + protected void Log(LogLevel level, string format, params object[] args) { - Log(string.Format(format, args)); + Log(level, string.Format(format, args)); } } } diff --git a/OverlayPlugin/OverlayPlugin.csproj b/OverlayPlugin/OverlayPlugin.csproj index 1509a75e8..a452a5b63 100644 --- a/OverlayPlugin/OverlayPlugin.csproj +++ b/OverlayPlugin/OverlayPlugin.csproj @@ -83,7 +83,7 @@ - + Always diff --git a/OverlayPlugin/PluginConfig.cs b/OverlayPlugin/PluginConfig.cs index e5215dcdf..666691bb7 100644 --- a/OverlayPlugin/PluginConfig.cs +++ b/OverlayPlugin/PluginConfig.cs @@ -162,6 +162,9 @@ public MiniParseSortType SortTypeObsolete [XmlElement("SpellTimerOverlay")] public OverlayConfig SpellTimerOverlay { get; set; } + [XmlElement("FollowLatestLog")] + public bool FollowLatestLog { get; set; } + [XmlElement("Version")] public Version Version { get; set; } @@ -190,6 +193,7 @@ public PluginConfig() this.SpellTimerOverlay.Size = new Size(200, 300); this.SpellTimerOverlay.IsVisible = false; this.SpellTimerOverlay.MaxFrameRate = 5; + this.FollowLatestLog = false; this.IsFirstLaunch = true; } diff --git a/OverlayPlugin/PluginMain.cs b/OverlayPlugin/PluginMain.cs index cdb9b8aed..5b20e10cd 100644 --- a/OverlayPlugin/PluginMain.cs +++ b/OverlayPlugin/PluginMain.cs @@ -24,11 +24,11 @@ public class PluginMain : IActPluginV1 internal PluginConfig Config { get; private set; } internal MiniParseOverlay MiniParseOverlay { get; private set; } internal SpellTimerOverlay SpellTimerOverlay { get; private set; } - internal BindingList Logs { get; private set; } + internal BindingList Logs { get; private set; } public PluginMain() { - this.Logs = new BindingList(); + this.Logs = new BindingList(); } @@ -40,12 +40,12 @@ public void InitPlugin(TabPage pluginScreenSpace, Label pluginStatusText) this.label = pluginStatusText; #if DEBUG - Log("Warn: ##################################"); - Log("Warn: DEBUG BUILD"); - Log("Warn: ##################################"); + Log(LogLevel.Debug, "##################################"); + Log(LogLevel.Debug, " DEBUG BUILD"); + Log(LogLevel.Debug, "##################################"); #endif this.pluginDirectory = GetPluginDirectory(); - Log("Info: InitPlugin: PluginDirectory = {0}", this.pluginDirectory); + Log(LogLevel.Info, "InitPlugin: PluginDirectory = {0}", this.pluginDirectory); // プラグインの配置してあるフォルダを検索するカスタムリゾルバーでアセンブリを解決する AppDomain.CurrentDomain.AssemblyResolve += CustomAssemblyResolve; @@ -65,22 +65,22 @@ public void InitPlugin(TabPage pluginScreenSpace, Label pluginStatusText) // オーバーレイ初期化 this.MiniParseOverlay = new OverlayPlugin.MiniParseOverlay(this.Config.MiniParseOverlay); - this.MiniParseOverlay.OnLog += (o, e) => Log(e.Message); + this.MiniParseOverlay.OnLog += (o, e) => Log(e.Level, e.Message); this.MiniParseOverlay.Start(); this.SpellTimerOverlay = new OverlayPlugin.SpellTimerOverlay(this.Config.SpellTimerOverlay); - this.SpellTimerOverlay.OnLog += (o, e) => Log(e.Message); + this.SpellTimerOverlay.OnLog += (o, e) => Log(e.Level, e.Message); this.SpellTimerOverlay.Start(); // ショートカットキー設定 ActGlobals.oFormActMain.KeyPreview = true; ActGlobals.oFormActMain.KeyDown += oFormActMain_KeyDown; - Log("Info: InitPlugin: Initialized."); + Log(LogLevel.Info, "InitPlugin: Initialized."); this.label.Text = "Initialized."; } catch (Exception e) { - Log("Error: InitPlugin: {0}", e.ToString()); + Log(LogLevel.Error, "InitPlugin: {0}", e.ToString()); throw; } @@ -95,7 +95,7 @@ public void DeInitPlugin() AppDomain.CurrentDomain.AssemblyResolve -= CustomAssemblyResolve; - Log("Info: DeInitPlugin: Finalized."); + Log(LogLevel.Info, "DeInitPlugin: Finalized."); this.label.Text = "Finalized."; } @@ -107,9 +107,7 @@ public void DeInitPlugin() private Assembly CustomAssemblyResolve(object sender, ResolveEventArgs e) { -#if DEBUG - Log("Info: AssemblyResolve: Resolving assembly for '{0}'...", e.Name); -#endif + Log(LogLevel.Debug, "AssemblyResolve: Resolving assembly for '{0}'...", e.Name); Assembly result = null; foreach (var pair in assemblyTable) @@ -121,59 +119,55 @@ private Assembly CustomAssemblyResolve(object sender, ResolveEventArgs e) { asmPath = Path.Combine(pluginDirectory, pair.Value); result = Assembly.LoadFile(asmPath); -#if DEBUG - Log("Info: AssemblyResolve: => Found assembly in {0}.", asmPath); -#endif + Log(LogLevel.Debug, "AssemblyResolve: => Found assembly in {0}.", asmPath); break; } catch (FileNotFoundException ex) { var message = string.Format( - "エラー:必要なアセンブリ {0} が存在しません。", + "必要なアセンブリ {0} が存在しません。", asmPath ); - Log("Error: AssemblyResolve: => {0}", message); - Log("Error: AssemblyResolve: => {0}", ex); - MessageBox.Show(message); + Log(LogLevel.Error, "AssemblyResolve: => {0}", message); + Log(LogLevel.Error, "AssemblyResolve: => {0}", ex); + MessageBox.Show(message, "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (FileLoadException ex) { var message = string.Format( - "エラー:必要なアセンブリ {0} は存在しますが、読み込めません。", + "必要なアセンブリ {0} は存在しますが、読み込めません。", asmPath ); - Log("Error: AssemblyResolve: => {0}", message); - Log("Error: AssemblyResolve: => {0}", ex); - MessageBox.Show(message); + Log(LogLevel.Error, "AssemblyResolve: => {0}", message); + Log(LogLevel.Error, "AssemblyResolve: => {0}", ex); + MessageBox.Show(message, "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (NotSupportedException ex) { var message = string.Format( - "エラー:アセンブリ {0} がネットワーク上にあるか、またはブロックされている可能性があります。", + "アセンブリ {0} がネットワーク上にあるか、またはブロックされている可能性があります。", asmPath ); - Log("Error: AssemblyResolve: => {0}", message); - Log("Error: AssemblyResolve: => {0}", ex); - MessageBox.Show(message); + Log(LogLevel.Error, "AssemblyResolve: => {0}", message); + Log(LogLevel.Error, "AssemblyResolve: => {0}", ex); + MessageBox.Show(message, "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception ex) { var message = string.Format( - "エラー:アセンブリ {0}の読み込み時に例外が発生しました。\n{0}", + "アセンブリ {0}の読み込み時に例外が発生しました。\n{0}", asmPath ); - Log("Error: AssemblyResolve: => {0}", ex); - MessageBox.Show(message); + Log(LogLevel.Error, "AssemblyResolve: => {0}", ex); + MessageBox.Show(message, "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } -#if DEBUG if (result == null) { - Log("Info: AssemblyResolve: => Not found in plugin directory."); + Log(LogLevel.Debug, "AssemblyResolve: => Not found in plugin directory."); } -#endif return result; } @@ -204,8 +198,8 @@ private void LoadConfig() } catch (Exception e) { - Log("Error: LoadConfig: {0}", e); - Log("Creating new configuration."); + Log(LogLevel.Warning, "LoadConfig: {0}", e); + Log(LogLevel.Info, "LoadConfig: Creating new configuration."); Config = new PluginConfig(); } finally @@ -213,7 +207,7 @@ private void LoadConfig() if (string.IsNullOrWhiteSpace(Config.MiniParseOverlay.Url)) { Config.MiniParseOverlay.Url = - new Uri(Path.Combine(pluginDirectory, "resources", "default.html")).ToString(); + new Uri(Path.Combine(pluginDirectory, "resources", "miniparse.html")).ToString(); } if (string.IsNullOrWhiteSpace(Config.SpellTimerOverlay.Url)) { @@ -236,7 +230,7 @@ private void SaveConfig() } catch (Exception e) { - Log("Error: SaveConfig: {0}", e); + Log(LogLevel.Error, "SaveConfig: {0}", e); } } @@ -263,14 +257,44 @@ private string GetPluginDirectory() } } - internal void Log(string message) + internal void Log(LogLevel level, string message) { - this.Logs.Add(DateTime.Now.ToString() + "|" + message); +#if !DEBUG + if (level == LogLevel.Trace || level == LogLevel.Debug) + { + return; + } +#endif + + this.Logs.Add(new LogEntry(level, DateTime.Now, message)); } - internal void Log(string format, params object[] args) + internal void Log(LogLevel level, string format, params object[] args) { - Log(string.Format(format, args)); + Log(level, string.Format(format, args)); } } + + internal class LogEntry + { + public string Message { get; set; } + public LogLevel Level { get; set; } + public DateTime Time { get; set; } + + public LogEntry(LogLevel level, DateTime time, string message) + { + this.Message = message; + this.Level = level; + this.Time = time; + } + } + + public enum LogLevel + { + Trace, + Debug, + Info, + Warning, + Error + } } diff --git a/OverlayPlugin/Properties/AssemblyInfo.cs b/OverlayPlugin/Properties/AssemblyInfo.cs index ef25783b3..e05491b30 100644 --- a/OverlayPlugin/Properties/AssemblyInfo.cs +++ b/OverlayPlugin/Properties/AssemblyInfo.cs @@ -32,4 +32,4 @@ // すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を // 既定値にすることができます: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.2.1.2")] +[assembly: AssemblyVersion("0.2.2.0")] diff --git a/OverlayPlugin/SpellTimerOverlay.cs b/OverlayPlugin/SpellTimerOverlay.cs index 82ed61fda..5638124f2 100644 --- a/OverlayPlugin/SpellTimerOverlay.cs +++ b/OverlayPlugin/SpellTimerOverlay.cs @@ -57,7 +57,7 @@ protected override void Update() { try { - var updateScript = CreateUpdateString(); + var updateScript = CreateEventDispatcherScript(); if (this.Overlay != null && this.Overlay.Renderer != null && @@ -69,7 +69,7 @@ protected override void Update() } catch (Exception ex) { - Log("Error: {0}: Update: {1}", this.Name, ex); + Log(LogLevel.Error, "Update: {1}", this.Name, ex); } } @@ -110,7 +110,7 @@ private void RemoveExpiredEntries() } } - internal string CreateUpdateString() + internal string CreateJsonData() { lock (this.activatedTimers) { @@ -129,7 +129,7 @@ internal string CreateUpdateString() if (!string.IsNullOrWhiteSpace(result)) { - return string.Format("{0}{1}{2}", "ActXiv = { timerFrames: ", result, "};"); + return string.Format("{0}{1}{2}", "{ timerFrames: ", result, "}"); } else { @@ -137,5 +137,11 @@ internal string CreateUpdateString() } } } + + private string CreateEventDispatcherScript() + { + return "var ActXiv = " + this.CreateJsonData() + ";\n" + + "document.dispatchEvent(new CustomEvent('onOverlayDataUpdate', ActXiv));"; + } } } diff --git a/OverlayPlugin/resources/default.html b/OverlayPlugin/resources/miniparse.html similarity index 53% rename from OverlayPlugin/resources/default.html rename to OverlayPlugin/resources/miniparse.html index c8cd21f24..0d919b18d 100644 --- a/OverlayPlugin/resources/default.html +++ b/OverlayPlugin/resources/miniparse.html @@ -4,6 +4,10 @@ - +
+ No data to show.
diff --git a/OverlayPlugin/resources/spelltimer.html b/OverlayPlugin/resources/spelltimer.html index 53111036d..201bc50d3 100644 --- a/OverlayPlugin/resources/spelltimer.html +++ b/OverlayPlugin/resources/spelltimer.html @@ -46,10 +46,6 @@ border-bottom: 1px solid #DED7BE; } - #combatantTableBody tr:not(:last-child) { - /*border-bottom: 1px solid rgba(192, 192, 192, 0.25);*/ - } - /* バーを囲う要素の設定 */ .progress-outer { box-sizing: border-box; diff --git a/distribute.ps1 b/distribute.ps1 index a10a3a748..f14a00ee0 100644 --- a/distribute.ps1 +++ b/distribute.ps1 @@ -32,6 +32,7 @@ xcopy /Y /R "$buildFolder\HtmlRenderer.dll" "$updateFolder" xcopy /Y /R "$buildFolder\OverlayPlugin.dll" "$updateFolder" xcopy /Y /R "$buildFolder\README.md" "$updateFolder" xcopy /Y /R "$buildFolder\LICENSE.txt" "$updateFolder" +xcopy /Y /R /S "$buildFolder\resources\*" "$updateFolder\resources\" # アーカイブ New-ZipCompress -source $fullFolder -destination "$fullFolder.zip"