diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..9412b20da --- /dev/null +++ b/.editorconfig @@ -0,0 +1,81 @@ +# https://github.com/dotnet/roslyn/blob/master/.editorconfig +# EditorConfig is awesome:http://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Don't use tabs for indentation. +[*] +indent_style = space +# (Please don't specify an indent_size here; that has too many unintended consequences.) + +# Code files +[*.{cs,csx,vb,vbx}] +indent_size = 4 +insert_final_newline = true +charset = utf-8-bom + +# Xml project files +[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}] +indent_size = 2 + +# Xml config files +[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}] +indent_size = 2 + +# JSON files +[*.json] +indent_size = 2 + +# Dotnet code style settings: +[*.{cs,vb}] +# Sort using and Import directives with System.* appearing first +dotnet_sort_system_directives_first = true +# Avoid "this." and "Me." if not necessary +dotnet_style_qualification_for_field = false:suggestion +dotnet_style_qualification_for_property = false:suggestion +dotnet_style_qualification_for_method = false:suggestion +dotnet_style_qualification_for_event = false:suggestion + +# Use language keywords instead of framework type names for type references +dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion +dotnet_style_predefined_type_for_member_access = true:suggestion + +# Suggest more modern language features when available +dotnet_style_object_initializer = true:suggestion +dotnet_style_collection_initializer = true:suggestion +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_null_propagation = true:suggestion +dotnet_style_explicit_tuple_names = true:suggestion + +# CSharp code style settings: +[*.cs] +# Prefer "var" everywhere +csharp_style_var_for_built_in_types = true:suggestion +csharp_style_var_when_type_is_apparent = true:suggestion +csharp_style_var_elsewhere = true:suggestion + +# Prefer method-like constructs to have a block body +csharp_style_expression_bodied_methods = false:none +csharp_style_expression_bodied_constructors = false:none +csharp_style_expression_bodied_operators = false:none + +# Prefer property-like constructs to have an expression-body +csharp_style_expression_bodied_properties = true:none +csharp_style_expression_bodied_indexers = true:none +csharp_style_expression_bodied_accessors = true:none + +# Suggest more modern language features when available +csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion +csharp_style_pattern_matching_over_as_with_null_check = true:suggestion +csharp_style_inlined_variable_declaration = true:suggestion +csharp_style_throw_expression = true:suggestion +csharp_style_conditional_delegate_call = true:suggestion + +# Newline settings +csharp_new_line_before_open_brace = all +csharp_new_line_before_else = true +csharp_new_line_before_catch = true +csharp_new_line_before_finally = true +csharp_new_line_before_members_in_object_initializers = true +csharp_new_line_before_members_in_anonymous_types = true \ No newline at end of file diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..1ff0c4230 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore index 553fcb70b..04b131df9 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,10 @@ bld/ [Oo]bj/ [Bb]uildX86/ [Bb]uildX64/ +[Rr]eleasex64/ +[Rr]eleasex86/ +[Rr]elease_x86/ +[Rr]elease_x64/ # Roslyn cache directories *.ide/ @@ -189,4 +193,5 @@ UpgradeLog*.htm *.bim_*.settings # Microsoft Fakes -FakesAssemblies/ \ No newline at end of file +FakesAssemblies/ +.vscode/settings.json \ No newline at end of file diff --git a/AddonExample/AddonExample.csproj b/AddonExample/AddonExample.csproj index 9fe7d7a1b..2022a6664 100644 --- a/AddonExample/AddonExample.csproj +++ b/AddonExample/AddonExample.csproj @@ -96,4 +96,4 @@ --> - \ No newline at end of file + diff --git a/AddonExample/Properties/AssemblyInfo.cs b/AddonExample/Properties/AssemblyInfo.cs index 885aff95f..a03847511 100644 --- a/AddonExample/Properties/AssemblyInfo.cs +++ b/AddonExample/Properties/AssemblyInfo.cs @@ -33,4 +33,4 @@ // 既定値にすることができます: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] \ No newline at end of file +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/HtmlRenderer/App.cs b/HtmlRenderer/App.cs index ecc022ba3..076e394bb 100644 --- a/HtmlRenderer/App.cs +++ b/HtmlRenderer/App.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Xilium.CefGlue; +using Xilium.CefGlue; namespace RainbowMage.HtmlRenderer { diff --git a/HtmlRenderer/Args/BroadcastMessageEventArgs.cs b/HtmlRenderer/Args/BroadcastMessageEventArgs.cs new file mode 100644 index 000000000..31bc84f5f --- /dev/null +++ b/HtmlRenderer/Args/BroadcastMessageEventArgs.cs @@ -0,0 +1,14 @@ +using System; + +namespace RainbowMage.HtmlRenderer +{ + public class BroadcastMessageEventArgs : EventArgs + { + public string Message { get; private set; } + + public BroadcastMessageEventArgs(string message) + { + this.Message = message; + } + } +} diff --git a/HtmlRenderer/Args/EndEncounterEventArgs.cs b/HtmlRenderer/Args/EndEncounterEventArgs.cs new file mode 100644 index 000000000..ec8a4d449 --- /dev/null +++ b/HtmlRenderer/Args/EndEncounterEventArgs.cs @@ -0,0 +1,12 @@ +using System; + +namespace RainbowMage.HtmlRenderer +{ + public class EndEncounterEventArgs : EventArgs + { + public EndEncounterEventArgs() + { + + } + } +} diff --git a/HtmlRenderer/Args/SendMessageEventArgs.cs b/HtmlRenderer/Args/SendMessageEventArgs.cs new file mode 100644 index 000000000..e1ca009ee --- /dev/null +++ b/HtmlRenderer/Args/SendMessageEventArgs.cs @@ -0,0 +1,16 @@ +using System; + +namespace RainbowMage.HtmlRenderer +{ + public class SendMessageEventArgs : EventArgs + { + public string Target { get; private set; } + public string Message { get; private set; } + + public SendMessageEventArgs(string target, string message) + { + this.Target = target; + this.Message = message; + } + } +} diff --git a/HtmlRenderer/Args/TakeScreenshotEventArgs.cs b/HtmlRenderer/Args/TakeScreenshotEventArgs.cs new file mode 100644 index 000000000..effa3e4bd --- /dev/null +++ b/HtmlRenderer/Args/TakeScreenshotEventArgs.cs @@ -0,0 +1,14 @@ +using System; + +namespace RainbowMage.HtmlRenderer +{ + public class TakeScreenshotEventArgs : EventArgs + { + public string Message { get; private set; } + + public TakeScreenshotEventArgs(string message) + { + this.Message = message; + } + } +} diff --git a/HtmlRenderer/Client.cs b/HtmlRenderer/Client.cs index 05a4150b6..3e68e4c92 100644 --- a/HtmlRenderer/Client.cs +++ b/HtmlRenderer/Client.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Xilium.CefGlue; +using Xilium.CefGlue; namespace RainbowMage.HtmlRenderer { diff --git a/HtmlRenderer/BuiltinFunctionHandler.cs b/HtmlRenderer/Handlers/BuiltinFunctionHandler.cs similarity index 52% rename from HtmlRenderer/BuiltinFunctionHandler.cs rename to HtmlRenderer/Handlers/BuiltinFunctionHandler.cs index c34f331a2..b16723943 100644 --- a/HtmlRenderer/BuiltinFunctionHandler.cs +++ b/HtmlRenderer/Handlers/BuiltinFunctionHandler.cs @@ -1,19 +1,17 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Xilium.CefGlue; namespace RainbowMage.HtmlRenderer { - class BuiltinFunctionHandler : CefV8Handler + class BuiltinFunctionHandler : CefV8Handler { + public event EventHandler TakeScreenshot; public event EventHandler BroadcastMessage; public event EventHandler SendMessage; public event EventHandler OverlayMessage; public event EventHandler EndEncounter; + public const string TakeScreenshotFunctionName = "takeScreenshot"; public const string BroadcastMessageFunctionName = "broadcastMessage"; public const string SendMessageFunctionName = "sendMessage"; public const string OverlayMessageFunctionName = "overlayMessage"; @@ -24,14 +22,15 @@ protected override bool Execute(string name, CefV8Value obj, CefV8Value[] argume exception = ""; returnValue = CefV8Value.CreateUndefined(); - if (name == BroadcastMessageFunctionName) + if (name == EndEncounterFunctionName) + { + EndEncounter?.Invoke(obj, new EndEncounterEventArgs()); + } + else if (name == TakeScreenshotFunctionName) { if (arguments.Length > 0) { - if (BroadcastMessage != null) - { - BroadcastMessage(obj, new BroadcastMessageEventArgs(arguments[0].GetStringValue())); - } + TakeScreenshot?.Invoke(obj, new TakeScreenshotEventArgs(arguments[0].GetStringValue())); } else { @@ -40,14 +39,11 @@ protected override bool Execute(string name, CefV8Value obj, CefV8Value[] argume return true; } - else if (name == SendMessageFunctionName) + else if (name == BroadcastMessageFunctionName) { - if (arguments.Length > 1) + if (arguments.Length > 0) { - if (SendMessage != null) - { - SendMessage(obj, new SendMessageEventArgs(arguments[0].GetStringValue(), arguments[1].GetStringValue())); - } + BroadcastMessage?.Invoke(obj, new BroadcastMessageEventArgs(arguments[0].GetStringValue())); } else { @@ -56,14 +52,11 @@ protected override bool Execute(string name, CefV8Value obj, CefV8Value[] argume return true; } - else if (name == OverlayMessageFunctionName) + else if (name == SendMessageFunctionName) { if (arguments.Length > 1) { - if (OverlayMessage != null) - { - OverlayMessage(obj, new SendMessageEventArgs(arguments[0].GetStringValue(), arguments[1].GetStringValue())); - } + SendMessage?.Invoke(obj, new SendMessageEventArgs(arguments[0].GetStringValue(), arguments[1].GetStringValue())); } else { @@ -72,45 +65,21 @@ protected override bool Execute(string name, CefV8Value obj, CefV8Value[] argume return true; } - else if (name == EndEncounterFunctionName) + else if (name == OverlayMessageFunctionName) { - if (EndEncounter != null) + if (arguments.Length > 1) { - EndEncounter(obj, new EndEncounterEventArgs()); + OverlayMessage?.Invoke(obj, new SendMessageEventArgs(arguments[0].GetStringValue(), arguments[1].GetStringValue())); } + else + { + exception = "Invalid argument count."; + } + + return true; } return false; } } - - public class BroadcastMessageEventArgs : EventArgs - { - public string Message { get; private set; } - - public BroadcastMessageEventArgs(string message) - { - this.Message = message; - } - } - - public class SendMessageEventArgs : EventArgs - { - public string Target { get; private set; } - public string Message { get; private set; } - - public SendMessageEventArgs(string target, string message) - { - this.Target = target; - this.Message = message; - } - } - - public class EndEncounterEventArgs : EventArgs - { - public EndEncounterEventArgs() - { - - } - } } diff --git a/HtmlRenderer/DisplayHandler.cs b/HtmlRenderer/Handlers/DisplayHandler.cs similarity index 78% rename from HtmlRenderer/DisplayHandler.cs rename to HtmlRenderer/Handlers/DisplayHandler.cs index 1c558e7b5..a95776ee7 100644 --- a/HtmlRenderer/DisplayHandler.cs +++ b/HtmlRenderer/Handlers/DisplayHandler.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Xilium.CefGlue; +using Xilium.CefGlue; namespace RainbowMage.HtmlRenderer { diff --git a/HtmlRenderer/LifeSpanHandler.cs b/HtmlRenderer/Handlers/LifeSpanHandler.cs similarity index 81% rename from HtmlRenderer/LifeSpanHandler.cs rename to HtmlRenderer/Handlers/LifeSpanHandler.cs index 86049a682..6aa636778 100644 --- a/HtmlRenderer/LifeSpanHandler.cs +++ b/HtmlRenderer/Handlers/LifeSpanHandler.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Xilium.CefGlue; +using Xilium.CefGlue; namespace RainbowMage.HtmlRenderer { diff --git a/HtmlRenderer/LoadHandler.cs b/HtmlRenderer/Handlers/LoadHandler.cs similarity index 90% rename from HtmlRenderer/LoadHandler.cs rename to HtmlRenderer/Handlers/LoadHandler.cs index 7c49ce715..82ac2de6e 100644 --- a/HtmlRenderer/LoadHandler.cs +++ b/HtmlRenderer/Handlers/LoadHandler.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Xilium.CefGlue; +using Xilium.CefGlue; namespace RainbowMage.HtmlRenderer { diff --git a/HtmlRenderer/MenuHandler.cs b/HtmlRenderer/Handlers/MenuHandler.cs similarity index 71% rename from HtmlRenderer/MenuHandler.cs rename to HtmlRenderer/Handlers/MenuHandler.cs index 3601dd518..c5076c814 100644 --- a/HtmlRenderer/MenuHandler.cs +++ b/HtmlRenderer/Handlers/MenuHandler.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Xilium.CefGlue; +using Xilium.CefGlue; namespace RainbowMage.HtmlRenderer { diff --git a/HtmlRenderer/RenderHandler.cs b/HtmlRenderer/Handlers/RenderHandler.cs similarity index 95% rename from HtmlRenderer/RenderHandler.cs rename to HtmlRenderer/Handlers/RenderHandler.cs index 1cf6d8cb2..b5f2179c2 100644 --- a/HtmlRenderer/RenderHandler.cs +++ b/HtmlRenderer/Handlers/RenderHandler.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Xilium.CefGlue; namespace RainbowMage.HtmlRenderer diff --git a/HtmlRenderer/RenderProcessHandler.cs b/HtmlRenderer/Handlers/RenderProcessHandler.cs similarity index 80% rename from HtmlRenderer/RenderProcessHandler.cs rename to HtmlRenderer/Handlers/RenderProcessHandler.cs index 96f6f74cd..1af0a920b 100644 --- a/HtmlRenderer/RenderProcessHandler.cs +++ b/HtmlRenderer/Handlers/RenderProcessHandler.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Xilium.CefGlue; +using Xilium.CefGlue; namespace RainbowMage.HtmlRenderer { @@ -26,10 +21,19 @@ public RenderProcessHandler() { Renderer.OnOverlayMessage(o, e); }; - this.builtinFunctionHandler.EndEncounter += (o, e) => - { - Renderer.OnRendererFeatureRequest(o, new RendererFeatureRequestEventArgs("EndEncounter")); - }; + + this.builtinFunctionHandler.EndEncounter += EndEncounterEvent; + this.builtinFunctionHandler.TakeScreenshot += TakeScreenshotEvent; + } + + private void EndEncounterEvent(object sender, EndEncounterEventArgs e) + { + Renderer.OnRendererFeatureRequest(sender, new RendererFeatureRequestEventArgs("EndEncounter")); + } + + private void TakeScreenshotEvent(object sender, TakeScreenshotEventArgs e) + { + Renderer.OnTakeScreenshot(sender, e); } protected override bool OnProcessMessageReceived(CefBrowser browser, CefProcessId sourceProcess, CefProcessMessage message) @@ -47,6 +51,10 @@ protected override bool OnProcessMessageReceived(CefBrowser browser, CefProcessI { var apiObject = CefV8Value.CreateObject(null); + var takeScreenshotFunction = CefV8Value.CreateFunction( + BuiltinFunctionHandler.TakeScreenshotFunctionName, + builtinFunctionHandler); + var broadcastMessageFunction = CefV8Value.CreateFunction( BuiltinFunctionHandler.BroadcastMessageFunctionName, builtinFunctionHandler); @@ -63,6 +71,11 @@ protected override bool OnProcessMessageReceived(CefBrowser browser, CefProcessI apiObject.SetValue("version", CefV8Value.CreateString(overlayVersion), CefV8PropertyAttribute.ReadOnly); apiObject.SetValue("overlayName", CefV8Value.CreateString(overlayName), CefV8PropertyAttribute.ReadOnly); + apiObject.SetValue( + BuiltinFunctionHandler.TakeScreenshotFunctionName, + takeScreenshotFunction, + CefV8PropertyAttribute.ReadOnly); + apiObject.SetValue( BuiltinFunctionHandler.BroadcastMessageFunctionName, broadcastMessageFunction, diff --git a/HtmlRenderer/HtmlRenderer.csproj b/HtmlRenderer/HtmlRenderer.csproj index c2299090d..f3d5b425d 100644 --- a/HtmlRenderer/HtmlRenderer.csproj +++ b/HtmlRenderer/HtmlRenderer.csproj @@ -33,6 +33,7 @@ + @@ -46,16 +47,20 @@ - + + + - - - - + + + + + - - + + + diff --git a/HtmlRenderer/Properties/AssemblyInfo.cs b/HtmlRenderer/Properties/AssemblyInfo.cs index ee5e386f6..048b2495d 100644 --- a/HtmlRenderer/Properties/AssemblyInfo.cs +++ b/HtmlRenderer/Properties/AssemblyInfo.cs @@ -1,5 +1,4 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // アセンブリに関する一般情報は以下の属性セットをとおして制御されます。 @@ -7,12 +6,8 @@ // これらの属性値を変更してください。 [assembly: AssemblyTitle("HtmlRenderer")] [assembly: AssemblyDescription("HTML based offscreen rendering library for the OverlayPlugin.")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] [assembly: AssemblyProduct("HtmlRenderer")] [assembly: AssemblyCopyright("Copyright © RainbowMage 2014, Kuriyama hibiya 2016")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] // ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから // 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、 diff --git a/HtmlRenderer/Renderer.cs b/HtmlRenderer/Renderer.cs index 48d2e8811..395787ff6 100644 --- a/HtmlRenderer/Renderer.cs +++ b/HtmlRenderer/Renderer.cs @@ -1,8 +1,7 @@ using System; using System.Collections.Generic; +using System.Drawing; using System.Linq; -using System.Text; -using System.Threading.Tasks; using Xilium.CefGlue; namespace RainbowMage.HtmlRenderer @@ -18,6 +17,7 @@ public class Renderer : IDisposable public static event EventHandler SendMessage; public static event EventHandler OverlayMessage; public static event EventHandler RendererFeatureRequest; + public static event EventHandler TakeScreenshotHandler; // Guards access to |allBrowsers| across threads. private System.Threading.SemaphoreSlim allBrowsersSemaphore = new System.Threading.SemaphoreSlim(1); @@ -38,18 +38,20 @@ public CefBrowser Browser get { allBrowsersSemaphore.Wait(); - CefBrowser b = this.allBrowsers.FirstOrDefault(); + var b = this.allBrowsers.FirstOrDefault(); allBrowsersSemaphore.Release(); return b; } } - public string OverlayVersion { + public string OverlayVersion + { get { return overlayVersion; } } - public string OverlayName { - get { return overlayName; } + public string OverlayName + { + get { return overlayName; } } private Client Client { get; set; } @@ -215,13 +217,13 @@ public void SendKeyEvent(CefKeyEvent keyEvent) } } - public void showDevTools(bool firstwindow = true) + public void ShowDevTools(bool firstwindow = true) { this.allBrowsersSemaphore.Wait(); if (this.allBrowsers.Count > 0) { - CefBrowser b = firstwindow ? this.allBrowsers.First() : this.allBrowsers.Last(); - CefWindowInfo wi = CefWindowInfo.Create(); + var b = firstwindow ? this.allBrowsers.First() : this.allBrowsers.Last(); + var wi = CefWindowInfo.Create(); wi.SetAsPopup(b.GetHost().GetWindowHandle(), "DevTools"); b.GetHost().ShowDevTools(wi, this.Client, new CefBrowserSettings(), new CefPoint()); } @@ -241,7 +243,7 @@ internal void OnCreated(CefBrowser browser) internal void OnBeforeClose(CefBrowser browser) { this.allBrowsersSemaphore.Wait(); - int index = this.allBrowsers.FindIndex((b) => b.Identifier == browser.Identifier); + var index = this.allBrowsers.FindIndex((b) => b.Identifier == browser.Identifier); if (index > 0) { // The first browser window is only removed from the list on the main thread. System.Diagnostics.Debug.Assert(index > 0); @@ -252,64 +254,46 @@ internal void OnBeforeClose(CefBrowser browser) internal void OnPaint(CefBrowser browser, IntPtr buffer, int width, int height, CefRectangle[] dirtyRects) { - if (Render != null) - { - Render(this, new RenderEventArgs(buffer, width, height, dirtyRects)); - } + Render?.Invoke(this, new RenderEventArgs(buffer, width, height, dirtyRects)); } internal void OnError(CefErrorCode errorCode, string errorText, string failedUrl) { - if (BrowserError != null) - { - BrowserError(this, new BrowserErrorEventArgs(errorCode, errorText, failedUrl)); - } + BrowserError?.Invoke(this, new BrowserErrorEventArgs(errorCode, errorText, failedUrl)); } internal void OnLoad(CefBrowser browser, CefFrame frame, int httpStatusCode) { - if (BrowserLoad != null) - { - BrowserLoad(this, new BrowserLoadEventArgs(httpStatusCode, frame.Url)); - } + BrowserLoad?.Invoke(this, new BrowserLoadEventArgs(httpStatusCode, frame.Url)); } internal void OnConsoleLog(CefBrowser browser, string message, string source, int line) { - if (BrowserConsoleLog != null) - { - BrowserConsoleLog(this, new BrowserConsoleLogEventArgs(message, source, line)); - } + BrowserConsoleLog?.Invoke(this, new BrowserConsoleLogEventArgs(message, source, line)); } internal static void OnBroadcastMessage(object sender, BroadcastMessageEventArgs e) { - if (BroadcastMessage != null) - { - BroadcastMessage(sender, e); - } + BroadcastMessage?.Invoke(sender, e); } internal static void OnSendMessage(object sender, SendMessageEventArgs e) { - if (SendMessage != null) - { - SendMessage(sender, e); - } + SendMessage?.Invoke(sender, e); } internal static void OnOverlayMessage(object sender, SendMessageEventArgs e) { - if (OverlayMessage != null) { - OverlayMessage(sender, e); - } + OverlayMessage?.Invoke(sender, e); } internal static void OnRendererFeatureRequest(object sender, RendererFeatureRequestEventArgs e) { - if (RendererFeatureRequest != null) - { - RendererFeatureRequest(sender, e); - } + RendererFeatureRequest?.Invoke(sender, e); + } + + internal static void OnTakeScreenshot(object sender, TakeScreenshotEventArgs e) + { + TakeScreenshotHandler?.Invoke(sender, e); } public void Dispose() @@ -320,13 +304,42 @@ public void Dispose() static bool initialized = false; public static void Initialize() + { + Initialize(""); + } + + public static void Initialize(string MainApplicationPath) { if (!initialized) { CefRuntime.Load(); + var Cache = "Cache"; + var Userdata = "UserData"; + + if(MainApplicationPath != "") + { + Cache = System.IO.Path.Combine(MainApplicationPath, "Cache"); + Userdata = System.IO.Path.Combine(MainApplicationPath, "UserData"); + } + + // for under 0.3.4.0 users + if (System.IO.Directory.Exists("cache")) + { + try + { + var di = new System.IO.DirectoryInfo("cache"); + di.MoveTo(Cache); + } + catch + { + Cache = "cache"; + } + } + var cefMainArgs = new CefMainArgs(new string[0]); var cefApp = new App(); + if (CefRuntime.ExecuteProcess(cefMainArgs, cefApp, IntPtr.Zero) != -1) { Console.Error.WriteLine("Couldn't execute secondary process."); @@ -334,15 +347,15 @@ public static void Initialize() var cefSettings = new CefSettings { + CachePath = Cache, Locale = System.Globalization.CultureInfo.CurrentCulture.Name, - CachePath = "cache", + UserDataPath = Userdata, SingleProcess = true, MultiThreadedMessageLoop = true, LogSeverity = CefLogSeverity.Disable }; CefRuntime.Initialize(cefMainArgs, cefSettings, cefApp, IntPtr.Zero); - initialized = true; } } diff --git a/OverlayPlugin.Common/Args/LogEventArgs.cs b/OverlayPlugin.Common/Args/LogEventArgs.cs new file mode 100644 index 000000000..3aa93a741 --- /dev/null +++ b/OverlayPlugin.Common/Args/LogEventArgs.cs @@ -0,0 +1,15 @@ +using System; + +namespace RainbowMage.OverlayPlugin +{ + public class LogEventArgs : EventArgs + { + public string Message { get; private set; } + public LogLevel Level { get; private set; } + public LogEventArgs(LogLevel level, string message) + { + this.Message = message; + this.Level = level; + } + } +} diff --git a/OverlayPlugin.Common/Enums/LogLevel.cs b/OverlayPlugin.Common/Enums/LogLevel.cs new file mode 100644 index 000000000..3a1de8cbf --- /dev/null +++ b/OverlayPlugin.Common/Enums/LogLevel.cs @@ -0,0 +1,11 @@ +namespace RainbowMage.OverlayPlugin +{ + public enum LogLevel + { + Trace, + Debug, + Info, + Warning, + Error + } +} diff --git a/OverlayPlugin.Common/Enums/ScreenshotBackgroundMode.cs b/OverlayPlugin.Common/Enums/ScreenshotBackgroundMode.cs new file mode 100644 index 000000000..a0be08a23 --- /dev/null +++ b/OverlayPlugin.Common/Enums/ScreenshotBackgroundMode.cs @@ -0,0 +1,12 @@ +namespace RainbowMage.OverlayPlugin +{ + public enum ScreenshotBackgroundMode + { + Hide = 0, + Normal = 1, + Center = 2, + Fill = 3, + Uniform = 4, + UniformToFill = 5, + } +} diff --git a/OverlayPlugin.Common/IOverlay.cs b/OverlayPlugin.Common/Interfaces/IOverlay.cs similarity index 91% rename from OverlayPlugin.Common/IOverlay.cs rename to OverlayPlugin.Common/Interfaces/IOverlay.cs index a94eda2d9..91d3fa389 100644 --- a/OverlayPlugin.Common/IOverlay.cs +++ b/OverlayPlugin.Common/Interfaces/IOverlay.cs @@ -1,9 +1,4 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace RainbowMage.OverlayPlugin { @@ -63,5 +58,11 @@ public interface IOverlay : IDisposable /// /// A string message created by the plugin javascript. void OverlayMessage(string message); + + /// + /// Take Overlay Renderer PNG Image (Offscreen?) + /// + /// + void TakeScreenshot(ScreenshotConfig config); } } diff --git a/OverlayPlugin.Common/IOverlayAddon.cs b/OverlayPlugin.Common/Interfaces/IOverlayAddon.cs similarity index 96% rename from OverlayPlugin.Common/IOverlayAddon.cs rename to OverlayPlugin.Common/Interfaces/IOverlayAddon.cs index 1586b2638..a7afdb5d0 100644 --- a/OverlayPlugin.Common/IOverlayAddon.cs +++ b/OverlayPlugin.Common/Interfaces/IOverlayAddon.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; namespace RainbowMage.OverlayPlugin diff --git a/OverlayPlugin.Common/IOverlayConfig.cs b/OverlayPlugin.Common/Interfaces/IOverlayConfig.cs similarity index 89% rename from OverlayPlugin.Common/IOverlayConfig.cs rename to OverlayPlugin.Common/Interfaces/IOverlayConfig.cs index 9e88bf8ec..7a604037b 100644 --- a/OverlayPlugin.Common/IOverlayConfig.cs +++ b/OverlayPlugin.Common/Interfaces/IOverlayConfig.cs @@ -1,10 +1,5 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; namespace RainbowMage.OverlayPlugin diff --git a/OverlayPlugin.Common/IPluginConfig.cs b/OverlayPlugin.Common/Interfaces/IPluginConfig.cs similarity index 59% rename from OverlayPlugin.Common/IPluginConfig.cs rename to OverlayPlugin.Common/Interfaces/IPluginConfig.cs index f9fc7f03d..10d6a7f54 100644 --- a/OverlayPlugin.Common/IPluginConfig.cs +++ b/OverlayPlugin.Common/Interfaces/IPluginConfig.cs @@ -1,9 +1,4 @@ using System; -using System.Collections.Generic; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace RainbowMage.OverlayPlugin { @@ -14,5 +9,10 @@ public interface IPluginConfig bool HideOverlaysWhenNotActive { get; set; } Version Version { get; set; } bool IsFirstLaunch { get; set; } + string ScreenshotSavePath { get; } + string ScreenshotBackgroundPath { get; } + int ScreenshotBackgroundMode { get; } + bool ScreenshotAutoClipping { get; } + int ScreenshotMargin { get; } } } diff --git a/OverlayPlugin.Common/LogEntry.cs b/OverlayPlugin.Common/LogEntry.cs new file mode 100644 index 000000000..bd037b7d0 --- /dev/null +++ b/OverlayPlugin.Common/LogEntry.cs @@ -0,0 +1,18 @@ +using System; + +namespace RainbowMage.OverlayPlugin +{ + public 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; + } + } +} diff --git a/OverlayPlugin.Common/Logger.cs b/OverlayPlugin.Common/Logger.cs index 981c00c6b..b1c824cc0 100644 --- a/OverlayPlugin.Common/Logger.cs +++ b/OverlayPlugin.Common/Logger.cs @@ -1,9 +1,5 @@ using System; -using System.Collections.Generic; using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace RainbowMage.OverlayPlugin { @@ -38,7 +34,6 @@ public void Log(LogLevel level, string message) #if DEBUG System.Diagnostics.Trace.WriteLine(string.Format("{0}: {1}: {2}", level, DateTime.Now, message)); #endif - this.Logs.Add(new LogEntry(level, DateTime.Now, message)); } @@ -53,38 +48,4 @@ public void Log(LogLevel level, string format, params object[] args) Log(level, string.Format(format, args)); } } - - public 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 class LogEventArgs : EventArgs - { - public string Message { get; private set; } - public LogLevel Level { get; private set; } - public LogEventArgs(LogLevel level, string message) - { - this.Message = message; - this.Level = level; - } - } - - public enum LogLevel - { - Trace, - Debug, - Info, - Warning, - Error - } } diff --git a/OverlayPlugin.Common/OverlayConfigList.cs b/OverlayPlugin.Common/OverlayConfigList.cs index 406c54d9b..b7cfac4fd 100644 --- a/OverlayPlugin.Common/OverlayConfigList.cs +++ b/OverlayPlugin.Common/OverlayConfigList.cs @@ -1,9 +1,5 @@ using System; -using System.Collections.Generic; using System.Collections.ObjectModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Xml.Serialization; namespace RainbowMage.OverlayPlugin diff --git a/OverlayPlugin.Common/OverlayPlugin.Common.csproj b/OverlayPlugin.Common/OverlayPlugin.Common.csproj index e2d0c7486..443e4b9f2 100644 --- a/OverlayPlugin.Common/OverlayPlugin.Common.csproj +++ b/OverlayPlugin.Common/OverlayPlugin.Common.csproj @@ -41,14 +41,20 @@ - - - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - - Meiryo UI, 9pt - - - 削除 - - - 追加 - - - [追加] バートンを押して、オーバーレイを設定してください - - - 非アクティブのときに自動的にオーバーレイを隠す - - - 設定 - - - 時間 - - - レベル - - - メッセージ - - - - 180, 22 - - - 全てのログをコピー - - - 180, 22 - - - 選択されたログをコピー - - - 177, 6 - - - 180, 22 - - - 最新のログを常に表示 - - - 177, 6 - - - 180, 22 - - - ログをクリア - - - 181, 104 - - \ No newline at end of file diff --git a/OverlayPlugin.Core/ControlPanel.resx b/OverlayPlugin.Core/ControlPanel.resx deleted file mode 100644 index 66e4589e3..000000000 --- a/OverlayPlugin.Core/ControlPanel.resx +++ /dev/null @@ -1,582 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - - - Segoe UI, 9pt - - - 3, 223 - - - splitContainer1.Panel2 - - - columnHeader3 - - - 6, 18 - - - 0 - - - 3, 3 - - - columnHeader1 - - - 1 - - - 0 - - - System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - New - - - - NoControl - - - tableLayoutPanel1 - - - 580, 274 - - - 4, 22 - - - System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - listViewLog - - - Fill - - - Fill - - - menuClearLog - - - tabControl - - - columnHeader4 - - - 2 - - - - 0 - - - Message - - - splitContainer1 - - - 580, 410 - - - 179, 6 - - - 183, 104 - - - 144 - - - splitContainer1.Panel1 - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 1 - - - 274 - - - System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Bottom, Left - - - Level - - - Time - - - 0 - - - menuFollowLatestLog - - - toolStripMenuItem2 - - - listViewOverlay - - - System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Copy all logs - - - toolStripMenuItem1 - - - tabControl - - - NoControl - - - ControlPanel - - - $this - - - menuCopyLogAll - - - General - - - groupBox2 - - - Name - - - 1 - - - 75, 23 - - - 1 - - - tableLayoutPanel1 - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Fill - - - System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPageMain - - - columnHeader2 - - - splitContainer1 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="tabControl" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="flowLayoutPanel" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,100" /><Rows Styles="Percent,100,Absolute,28" /></TableLayoutSettings> - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="groupBox2" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkBoxAutoHide" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,100" /><Rows Styles="Percent,100,Absolute,22" /></TableLayoutSettings> - - - groupBox2 - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 560, 16 - - - 0, 0 - - - splitContainer1 - - - 451 - - - 0 - - - 548, 161 - - - 572, 248 - - - System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tabPageMain - - - True - - - Click [Add] button to configure overlays. - - - Clear logs - - - 3, 3, 3, 3 - - - 2 - - - 87, 185 - - - 182, 22 - - - Fill - - - Automatically hide overlays - - - Bottom, Left - - - 0 - - - 182, 22 - - - buttonRemoveOverlay - - - Remove - - - System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 580, 132 - - - 179, 6 - - - 6, 185 - - - 580, 410 - - - splitContainer1.Panel2 - - - System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Follow latest log - - - 1 - - - 2 - - - 1 - - - 0, 0 - - - groupBox2 - - - System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 182, 22 - - - 2 - - - checkBoxAutoHide - - - splitContainer1.Panel1 - - - 566, 242 - - - Fill - - - 2 - - - 182, 22 - - - 251 - - - 0 - - - System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 3, 3 - - - 0 - - - 0, 0 - - - 6, 12 - - - System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - columnHeader5 - - - System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel1 - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Top, Bottom, Left, Right - - - 0 - - - menuLogCopy - - - buttonNewOverlay - - - Horizontal - - - System.Windows.Forms.SplitContainer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Fill - - - 2 - - - 0 - - - Copy selected logs - - - contextMenuLogList - - - Add/Remove overlays - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Type - - - 560, 214 - - - System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - groupBox2 - - - 1 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 75, 23 - - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 1 - - - ja-JP - - - True - - - 17, 17 - - \ No newline at end of file diff --git a/OverlayPlugin.Core/Enums/GlobalHotkeyType.cs b/OverlayPlugin.Core/Enums/GlobalHotkeyType.cs new file mode 100644 index 000000000..7fcba41cc --- /dev/null +++ b/OverlayPlugin.Core/Enums/GlobalHotkeyType.cs @@ -0,0 +1,10 @@ +namespace RainbowMage.OverlayPlugin +{ + public enum GlobalHotkeyType + { + ToggleVisible, + ToggleClickthru, + ToggleLock, + Screenshot + } +} diff --git a/OverlayPlugin.Core/Enums/MessageType.cs b/OverlayPlugin.Core/Enums/MessageType.cs new file mode 100644 index 000000000..a443b8bbb --- /dev/null +++ b/OverlayPlugin.Core/Enums/MessageType.cs @@ -0,0 +1,37 @@ +namespace RainbowMage.OverlayPlugin +{ + // Part of ACTWebSocket + // Copyright (c) 2016 ZCube; Licensed under MIT license. + public enum MessageType + { + LogLine = 0, + ChangeZone = 1, + ChangePrimaryPlayer = 2, + AddCombatant = 3, + RemoveCombatant = 4, + AddBuff = 5, + RemoveBuff = 6, + FlyingText = 7, + OutgoingAbility = 8, + IncomingAbility = 10, + PartyList = 11, + PlayerStats = 12, + CombatantHP = 13, + NetworkStartsCasting = 20, + NetworkAbility = 21, + NetworkAOEAbility = 22, + NetworkCancelAbility = 23, + NetworkDoT = 24, + NetworkDeath = 25, + NetworkBuff = 26, + NetworkTargetIcon = 27, + NetworkRaidMarker = 28, + NetworkTargetMarker = 29, + NetworkBuffRemove = 30, + Debug = 251, + PacketDump = 252, + Version = 253, + Error = 254, + Timer = 255 + } +} diff --git a/OverlayPlugin.Core/Enums/ModifierKeys.cs b/OverlayPlugin.Core/Enums/ModifierKeys.cs new file mode 100644 index 000000000..54b3703d6 --- /dev/null +++ b/OverlayPlugin.Core/Enums/ModifierKeys.cs @@ -0,0 +1,16 @@ +using System; + +namespace RainbowMage.OverlayPlugin +{ + /// + /// The enumeration of possible modifiers. + /// + [Flags] + public enum ModifierKeys : uint + { + Alt = 1, + Control = 2, + Shift = 4, + Win = 8 + } +} diff --git a/OverlayPlugin.Core/Enums/TextItem.cs b/OverlayPlugin.Core/Enums/TextItem.cs new file mode 100644 index 000000000..71bb58654 --- /dev/null +++ b/OverlayPlugin.Core/Enums/TextItem.cs @@ -0,0 +1,20 @@ +namespace RainbowMage.OverlayPlugin +{ + public enum TextItem + { + ErrorTitle, + RequiredAssemblyFileNotFound, + RequiredAssemblyFileCannotRead, + RequiredAssemblyFileBlocked, + RequiredAssemblyFileException, + DoNotSort, + SortStringAscending, + SortStringDescending, + SortNumberAscending, + SortNumberDescending, + ToggleVisible, + ToggleClickthru, + ToggleLock, + Screenshot + } +} diff --git a/OverlayPlugin.Core/KeyboardHook.cs b/OverlayPlugin.Core/KeyboardHook.cs index cfe8ff192..823304626 100644 --- a/OverlayPlugin.Core/KeyboardHook.cs +++ b/OverlayPlugin.Core/KeyboardHook.cs @@ -1,6 +1,7 @@ using System; using System.Runtime.InteropServices; using System.Windows.Forms; + namespace RainbowMage.OverlayPlugin { public sealed class KeyboardHook : IDisposable @@ -12,52 +13,6 @@ public sealed class KeyboardHook : IDisposable [DllImport("user32.dll")] private static extern bool UnregisterHotKey(IntPtr hWnd, int id); - /// - /// Represents the window that is used internally to get the messages. - /// - private class Window : NativeWindow, IDisposable - { - private static int WM_HOTKEY = 0x0312; - - public Window() - { - // create the handle for the window. - this.CreateHandle(new CreateParams()); - } - - /// - /// Overridden to get the notifications. - /// - /// - protected override void WndProc(ref Message m) - { - base.WndProc(ref m); - - // check if we got a hot key pressed. - if (m.Msg == WM_HOTKEY) - { - // get the keys. - Keys key = (Keys)(((int)m.LParam >> 16) & 0xFFFF); - ModifierKeys modifier = (ModifierKeys)((int)m.LParam & 0xFFFF); - - // invoke the event to notify the parent. - if (KeyPressed != null) - KeyPressed(this, new KeyPressedEventArgs(modifier, key)); - } - } - - public event EventHandler KeyPressed; - - #region IDisposable Members - - public void Dispose() - { - this.DestroyHandle(); - } - - #endregion - } - private Window _window = new Window(); private int _currentId; @@ -66,8 +21,7 @@ public KeyboardHook() // register the event of the inner native window. _window.KeyPressed += delegate(object sender, KeyPressedEventArgs args) { - if (KeyPressed != null) - KeyPressed(this, args); + KeyPressed?.Invoke(this, args); }; } @@ -96,7 +50,7 @@ public void RegisterHotKey(ModifierKeys modifier, Keys key) public void Dispose() { // unregister all the registered hot keys. - for (int i = _currentId; i > 0; i--) + for (var i = _currentId; i > 0; i--) { UnregisterHotKey(_window.Handle, i); } @@ -107,41 +61,4 @@ public void Dispose() #endregion } - - /// - /// Event Args for the event that is fired after the hot key has been pressed. - /// - public class KeyPressedEventArgs : EventArgs - { - private ModifierKeys _modifier; - private Keys _key; - - internal KeyPressedEventArgs(ModifierKeys modifier, Keys key) - { - _modifier = modifier; - _key = key; - } - - public ModifierKeys Modifier - { - get { return _modifier; } - } - - public Keys Key - { - get { return _key; } - } - } - - /// - /// The enumeration of possible modifiers. - /// - [Flags] - public enum ModifierKeys : uint - { - Alt = 1, - Control = 2, - Shift = 4, - Win = 8 - } -} \ No newline at end of file +} diff --git a/OverlayPlugin.Core/Localization.cs b/OverlayPlugin.Core/Localization.cs index 61db2d922..0bc277570 100644 --- a/OverlayPlugin.Core/Localization.cs +++ b/OverlayPlugin.Core/Localization.cs @@ -1,28 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Collections.Generic; namespace RainbowMage.OverlayPlugin { - public enum TextItem - { - ErrorTitle, - RequiredAssemblyFileNotFound, - RequiredAssemblyFileCannotRead, - RequiredAssemblyFileBlocked, - RequiredAssemblyFileException, - DoNotSort, - SortStringAscending, - SortStringDescending, - SortNumberAscending, - SortNumberDescending, - ToggleVisible, - ToggleClickthru, - ToggleLock - } - public static class Localization { private static LocalizationDict dict; @@ -65,13 +44,16 @@ static Localization() dict[TextItem.ToggleVisible, ""] = "Toggle visible/hide"; dict[TextItem.ToggleVisible, "ja"] = "表示/非表示の切り替え"; - dict[TextItem.ToggleVisible, "ko"] = "표시 / 숨기기 토글"; + dict[TextItem.ToggleVisible, "ko"] = "표시 / 숨기기"; dict[TextItem.ToggleClickthru, ""] = "Toggle clickthru"; dict[TextItem.ToggleClickthru, "ja"] = "クリック透過の切り替え"; - dict[TextItem.ToggleClickthru, "ko"] = "Toggle clickthru"; + dict[TextItem.ToggleClickthru, "ko"] = "마우스 통과 끄기 / 켜기"; dict[TextItem.ToggleLock, ""] = "Toggle lock"; dict[TextItem.ToggleLock, "ja"] = "移動/リサイズ制限の切り替え"; - dict[TextItem.ToggleLock, "ko"] = "Toggle lock"; + dict[TextItem.ToggleLock, "ko"] = "위치 잠금 끄기 / 켜기"; + dict[TextItem.Screenshot, ""] = "Screenshot"; + dict[TextItem.Screenshot, "ja"] = "Screenshot"; + dict[TextItem.Screenshot, "ko"] = "오버레이 스크린샷 촬영"; } public static string GetText(TextItem item) @@ -85,52 +67,4 @@ private static string GetCurrentLocale() return culture.TwoLetterISOLanguageName.ToLower(); } } - - class LocalizationDict - { - IDictionary> dict; - - public LocalizationDict() - { - this.dict = new Dictionary>(); - } - - public string this[TextItem item, string locale] - { - get - { - if (dict.ContainsKey(item)) - { - if (dict[item].ContainsKey(locale)) - { - return dict[item][locale]; - } - else if (dict[item].ContainsKey("")) - { - return dict[item][""]; - } - else - { - throw new KeyNotFoundException(); - } - } - throw new KeyNotFoundException(); - } - set - { - if (!dict.ContainsKey(item)) - { - dict.Add(item, new Dictionary()); - } - if (!dict[item].ContainsKey(locale)) - { - dict[item].Add(locale, value); - } - else - { - dict[item][locale] = value; - } - } - } - } -} \ No newline at end of file +} diff --git a/OverlayPlugin.Core/LocalizationDict.cs b/OverlayPlugin.Core/LocalizationDict.cs new file mode 100644 index 000000000..fbdd248bc --- /dev/null +++ b/OverlayPlugin.Core/LocalizationDict.cs @@ -0,0 +1,52 @@ +using System.Collections.Generic; + +namespace RainbowMage.OverlayPlugin +{ + class LocalizationDict + { + IDictionary> dict; + + public LocalizationDict() + { + this.dict = new Dictionary>(); + } + + public string this[TextItem item, string locale] + { + get + { + if (dict.ContainsKey(item)) + { + if (dict[item].ContainsKey(locale)) + { + return dict[item][locale]; + } + else if (dict[item].ContainsKey("")) + { + return dict[item][""]; + } + else + { + throw new KeyNotFoundException(); + } + } + throw new KeyNotFoundException(); + } + set + { + if (!dict.ContainsKey(item)) + { + dict.Add(item, new Dictionary()); + } + if (!dict[item].ContainsKey(locale)) + { + dict[item].Add(locale, value); + } + else + { + dict[item][locale] = value; + } + } + } + } +} diff --git a/OverlayPlugin.Core/OverlayBase.cs b/OverlayPlugin.Core/OverlayBase.cs index c8b35dfee..c764c66d2 100644 --- a/OverlayPlugin.Core/OverlayBase.cs +++ b/OverlayPlugin.Core/OverlayBase.cs @@ -1,13 +1,6 @@ using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Drawing; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; -using Xilium.CefGlue; namespace RainbowMage.OverlayPlugin { @@ -16,7 +9,9 @@ public abstract class OverlayBase : IOverlay { private KeyboardHook hook = new KeyboardHook(); protected System.Timers.Timer timer; - protected System.Timers.Timer xivWindowTimer; + + public System.Timers.Timer UpdateTimer { get { return timer; } } + /// /// オーバーレイがログを出力したときに発生します。 /// @@ -50,6 +45,8 @@ protected OverlayBase(TConfig config, string name) InitializeOverlay(); InitializeTimer(); InitializeConfigHandlers(); + + Update(); } /// @@ -58,7 +55,7 @@ protected OverlayBase(TConfig config, string name) public void Start() { timer.Start(); - xivWindowTimer.Start(); + AutoHide.AddOverlay(this.Config, this.Overlay); } /// @@ -67,7 +64,7 @@ public void Start() public void Stop() { timer.Stop(); - xivWindowTimer.Stop(); + AutoHide.RemoveOverlay(this.Config); } /// @@ -99,6 +96,9 @@ protected virtual void InitializeOverlay() case GlobalHotkeyType.ToggleLock: hook.KeyPressed += (o, e) => this.Config.IsLocked = !this.Config.IsLocked; break; + case GlobalHotkeyType.Screenshot: + hook.KeyPressed += (o, e) => this.TakeScreenshot(); + break; default: hook.KeyPressed += (o, e) => this.Config.IsVisible = !this.Config.IsVisible; break; @@ -164,7 +164,7 @@ protected virtual void InitializeOverlay() private ModifierKeys GetModifierKey(Keys modifier) { - ModifierKeys modifiers = new ModifierKeys(); + var modifiers = new ModifierKeys(); if ((modifier & Keys.Shift) == Keys.Shift) { modifiers |= ModifierKeys.Shift; @@ -238,41 +238,6 @@ protected virtual void InitializeTimer() Log(LogLevel.Error, "Update: {0}", ex.ToString()); } }; - - xivWindowTimer = new System.Timers.Timer(); - xivWindowTimer.Interval = 1000; - xivWindowTimer.Elapsed += (o, e) => - { - try - { - if (Config.IsVisible && PluginConfig.HideOverlaysWhenNotActive) - { - uint pid; - var hWndFg = NativeMethods.GetForegroundWindow(); - if (hWndFg == IntPtr.Zero) - { - return; - } - NativeMethods.GetWindowThreadProcessId(hWndFg, out pid); - var exePath = Process.GetProcessById((int)pid).MainModule.FileName; - - if (Path.GetFileName(exePath.ToString()) == "ffxiv.exe" || - Path.GetFileName(exePath.ToString()) == "ffxiv_dx11.exe" || - exePath.ToString() == Process.GetCurrentProcess().MainModule.FileName) - { - this.Overlay.Visible = true; - } - else - { - this.Overlay.Visible = false; - } - } - } - catch (Exception ex) - { - Log(LogLevel.Error, "XivWindowWatcher: {0}", ex.ToString()); - } - }; } /// @@ -312,10 +277,6 @@ public virtual void Dispose() { this.timer.Stop(); } - if (this.xivWindowTimer != null) - { - this.xivWindowTimer.Stop(); - } if (this.Overlay != null) { this.Overlay.Close(); @@ -325,6 +286,7 @@ public virtual void Dispose() { this.hook.Dispose(); } + AutoHide.RemoveOverlay(this.Config); } catch (Exception ex) { @@ -334,15 +296,18 @@ public virtual void Dispose() public virtual void Navigate(string url) { - this.Overlay.Url = url; + this.Overlay.Url = url; + try + { + this.Update(); + } + catch + { } } protected void Log(LogLevel level, string message) { - if (OnLog != null) - { - OnLog(this, new LogEventArgs(level, string.Format("{0}: {1}", this.Name, message))); - } + OnLog?.Invoke(this, new LogEventArgs(level, string.Format("{0}: {1}", this.Name, message))); } protected void Log(LogLevel level, string format, params object[] args) @@ -363,9 +328,7 @@ private void NotifyOverlayState() "document.dispatchEvent(new CustomEvent('onOverlayStateUpdate', {{ detail: {{ isLocked: {0} }} }}));", this.Config.IsLocked ? "true" : "false"); - if (this.Overlay != null && - this.Overlay.Renderer != null && - this.Overlay.Renderer.Browser != null) + if (BrowserVerifiedCheck()) { this.Overlay.Renderer.ExecuteScript(updateScript); } @@ -377,16 +340,37 @@ public void SendMessage(string message) "document.dispatchEvent(new CustomEvent('onBroadcastMessageReceive', {{ detail: {{ message: \"{0}\" }} }}));", Util.CreateJsonSafeString(message)); - if (this.Overlay != null && - this.Overlay.Renderer != null && - this.Overlay.Renderer.Browser != null) + if (BrowserVerifiedCheck()) { this.Overlay.Renderer.ExecuteScript(script); } } + private bool BrowserVerifiedCheck() + { + return Overlay != null && Overlay.Renderer != null && Overlay.Renderer.Browser != null; + } + public virtual void OverlayMessage(string message) { + + } + + public void TakeScreenshot() + { + TakeScreenshot(new ScreenshotConfig + { + SavePath = PluginConfig.ScreenshotSavePath, + AutoClipping = PluginConfig.ScreenshotAutoClipping, + BackgroundImagePath = PluginConfig.ScreenshotBackgroundPath, + BackgroundMode = (ScreenshotBackgroundMode)PluginConfig.ScreenshotBackgroundMode, + Margin = PluginConfig.ScreenshotMargin, + }); + } + + public void TakeScreenshot(ScreenshotConfig config) + { + Screenshot.SaveScreenshot(this.Overlay.SurfaceBuffer, config); } } } diff --git a/OverlayPlugin.Core/OverlayConfigBase.cs b/OverlayPlugin.Core/OverlayConfigBase.cs index d72b31ded..b0b5981d7 100644 --- a/OverlayPlugin.Core/OverlayConfigBase.cs +++ b/OverlayPlugin.Core/OverlayConfigBase.cs @@ -1,9 +1,5 @@ using System; -using System.Collections.Generic; using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; using System.Xml.Serialization; @@ -275,11 +271,4 @@ protected OverlayConfigBase(string name) [XmlIgnore] public abstract Type OverlayType { get; } } - - public enum GlobalHotkeyType - { - ToggleVisible, - ToggleClickthru, - ToggleLock - } } diff --git a/OverlayPlugin.Core/OverlayPlugin.Core.csproj b/OverlayPlugin.Core/OverlayPlugin.Core.csproj index 91fccc3ca..589f801eb 100644 --- a/OverlayPlugin.Core/OverlayPlugin.Core.csproj +++ b/OverlayPlugin.Core/OverlayPlugin.Core.csproj @@ -34,6 +34,7 @@ False ..\Thirdparty\ACT\Advanced Combat Tracker.exe + False ..\Thirdparty\Newtonsoft.Json\Newtonsoft.Json.dll @@ -41,7 +42,6 @@ - @@ -54,63 +54,77 @@ - - + + + + + + + + + + + + + UserControl - + LogParseConfigPanel.cs - - - - - - Component - - + + + + + + + + + + + UserControl - + ControlPanel.cs - + - - - - - + + + + + UserControl - + LabelOverlayConfigPanel.cs - + UserControl - + MiniParseConfigPanel.cs - - - - - + + + + + Form - + NewOverlayDialog.cs - + Form - + OverlayForm.cs - + @@ -120,13 +134,13 @@ Resources.resx - - + + - + UserControl - + SpellTimerConfigPanel.cs @@ -149,65 +163,66 @@ - + ControlPanel.cs - + ControlPanel.cs - + ControlPanel.cs - + NewOverlayDialog.cs - + NewOverlayDialog.cs - + LabelOverlayConfigPanel.cs - + LabelOverlayConfigPanel.cs - + LabelOverlayConfigPanel.cs - + LogParseConfigPanel.cs - + LogParseConfigPanel.cs - + LogParseConfigPanel.cs - + MiniParseConfigPanel.cs - + MiniParseConfigPanel.cs - + MiniParseConfigPanel.cs - + NewOverlayDialog.cs - + OverlayForm.cs + Designer - + SpellTimerConfigPanel.cs ResXFileCodeGenerator Resources.Designer.cs - + SpellTimerConfigPanel.cs - + SpellTimerConfigPanel.cs diff --git a/OverlayPlugin.Core/Overlays/LabelOverlayConfigPanel.Designer.cs b/OverlayPlugin.Core/Overlays/ConfigPanels/LabelOverlayConfigPanel.Designer.cs similarity index 98% rename from OverlayPlugin.Core/Overlays/LabelOverlayConfigPanel.Designer.cs rename to OverlayPlugin.Core/Overlays/ConfigPanels/LabelOverlayConfigPanel.Designer.cs index 37d232002..159d19b05 100644 --- a/OverlayPlugin.Core/Overlays/LabelOverlayConfigPanel.Designer.cs +++ b/OverlayPlugin.Core/Overlays/ConfigPanels/LabelOverlayConfigPanel.Designer.cs @@ -29,30 +29,36 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LabelOverlayConfigPanel)); - this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.label1 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); - this.checkMiniParseVisible = new System.Windows.Forms.CheckBox(); - this.checkMiniParseClickthru = new System.Windows.Forms.CheckBox(); + this.label4 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label(); this.label8 = new System.Windows.Forms.Label(); - this.checkEnableGlobalHotkey = new System.Windows.Forms.CheckBox(); - this.textGlobalHotkey = new System.Windows.Forms.TextBox(); this.label9 = new System.Windows.Forms.Label(); - this.checkLock = new System.Windows.Forms.CheckBox(); this.label13 = new System.Windows.Forms.Label(); - this.textBox = new System.Windows.Forms.TextBox(); + + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); + + this.checkMiniParseVisible = new System.Windows.Forms.CheckBox(); + this.checkMiniParseClickthru = new System.Windows.Forms.CheckBox(); + this.checkEnableGlobalHotkey = new System.Windows.Forms.CheckBox(); + this.checkLock = new System.Windows.Forms.CheckBox(); + this.checkHTML = new System.Windows.Forms.CheckBox(); + + this.textGlobalHotkey = new System.Windows.Forms.TextBox(); + this.textBox = new System.Windows.Forms.TextBox(); + this.textUrl = new System.Windows.Forms.TextBox(); + this.buttonCopyUpdateScript = new System.Windows.Forms.Button(); this.buttonOpenDevTools = new System.Windows.Forms.Button(); this.buttonReloadBrowser = new System.Windows.Forms.Button(); - this.label4 = new System.Windows.Forms.Label(); - this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); - this.textUrl = new System.Windows.Forms.TextBox(); this.buttonSelectFile = new System.Windows.Forms.Button(); - this.label5 = new System.Windows.Forms.Label(); - this.checkHTML = new System.Windows.Forms.CheckBox(); + this.tableLayoutPanel1.SuspendLayout(); this.tableLayoutPanel3.SuspendLayout(); this.tableLayoutPanel2.SuspendLayout(); @@ -64,20 +70,21 @@ private void InitializeComponent() this.tableLayoutPanel1.Controls.Add(this.label1, 0, 7); this.tableLayoutPanel1.Controls.Add(this.label2, 0, 1); this.tableLayoutPanel1.Controls.Add(this.label3, 0, 0); - this.tableLayoutPanel1.Controls.Add(this.checkMiniParseVisible, 1, 0); - this.tableLayoutPanel1.Controls.Add(this.checkMiniParseClickthru, 1, 1); + this.tableLayoutPanel1.Controls.Add(this.label4, 0, 3); + this.tableLayoutPanel1.Controls.Add(this.label5, 0, 8); this.tableLayoutPanel1.Controls.Add(this.label7, 0, 4); this.tableLayoutPanel1.Controls.Add(this.label8, 0, 5); + this.tableLayoutPanel1.Controls.Add(this.label9, 0, 2); + this.tableLayoutPanel1.Controls.Add(this.label13, 1, 6); + + this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel2, 1, 3); + this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel3, 0, 9); + this.tableLayoutPanel1.Controls.Add(this.checkMiniParseVisible, 1, 0); + this.tableLayoutPanel1.Controls.Add(this.checkMiniParseClickthru, 1, 1); this.tableLayoutPanel1.Controls.Add(this.checkEnableGlobalHotkey, 1, 4); this.tableLayoutPanel1.Controls.Add(this.textGlobalHotkey, 1, 5); - this.tableLayoutPanel1.Controls.Add(this.label9, 0, 2); this.tableLayoutPanel1.Controls.Add(this.checkLock, 1, 2); - this.tableLayoutPanel1.Controls.Add(this.label13, 1, 6); this.tableLayoutPanel1.Controls.Add(this.textBox, 1, 7); - this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel3, 0, 9); - this.tableLayoutPanel1.Controls.Add(this.label4, 0, 3); - this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel2, 1, 3); - this.tableLayoutPanel1.Controls.Add(this.label5, 0, 8); this.tableLayoutPanel1.Controls.Add(this.checkHTML, 1, 8); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; // @@ -226,7 +233,8 @@ private void InitializeComponent() // LabelOverlayConfigPanel // resources.ApplyResources(this, "$this"); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; + this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); this.Controls.Add(this.tableLayoutPanel1); this.Name = "LabelOverlayConfigPanel"; this.tableLayoutPanel1.ResumeLayout(false); @@ -241,28 +249,32 @@ private void InitializeComponent() #endregion private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3; + private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label3; - private System.Windows.Forms.CheckBox checkMiniParseVisible; - private System.Windows.Forms.CheckBox checkMiniParseClickthru; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label label5; private System.Windows.Forms.Label label7; private System.Windows.Forms.Label label8; - private System.Windows.Forms.CheckBox checkEnableGlobalHotkey; - private System.Windows.Forms.TextBox textGlobalHotkey; private System.Windows.Forms.Label label9; - private System.Windows.Forms.CheckBox checkLock; private System.Windows.Forms.Label label13; + + private System.Windows.Forms.TextBox textGlobalHotkey; private System.Windows.Forms.TextBox textBox; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3; + private System.Windows.Forms.TextBox textUrl; + private System.Windows.Forms.Button buttonReloadBrowser; private System.Windows.Forms.Button buttonOpenDevTools; private System.Windows.Forms.Button buttonCopyUpdateScript; - private System.Windows.Forms.Label label4; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; - private System.Windows.Forms.TextBox textUrl; private System.Windows.Forms.Button buttonSelectFile; - private System.Windows.Forms.Label label5; + private System.Windows.Forms.CheckBox checkHTML; + private System.Windows.Forms.CheckBox checkMiniParseVisible; + private System.Windows.Forms.CheckBox checkMiniParseClickthru; + private System.Windows.Forms.CheckBox checkEnableGlobalHotkey; + private System.Windows.Forms.CheckBox checkLock; } } diff --git a/OverlayPlugin.Core/Overlays/LabelOverlayConfigPanel.cs b/OverlayPlugin.Core/Overlays/ConfigPanels/LabelOverlayConfigPanel.cs similarity index 85% rename from OverlayPlugin.Core/Overlays/LabelOverlayConfigPanel.cs rename to OverlayPlugin.Core/Overlays/ConfigPanels/LabelOverlayConfigPanel.cs index a926b115d..336efcea6 100644 --- a/OverlayPlugin.Core/Overlays/LabelOverlayConfigPanel.cs +++ b/OverlayPlugin.Core/Overlays/ConfigPanels/LabelOverlayConfigPanel.cs @@ -1,11 +1,4 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.Data; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; namespace RainbowMage.OverlayPlugin.Overlays @@ -43,28 +36,28 @@ private void SetupConfigEventHandlers() { this.config.VisibleChanged += (o, e) => { - this.InvokeIfRequired(() => + Invoke((MethodInvoker)delegate { this.checkMiniParseVisible.Checked = e.IsVisible; }); }; this.config.ClickThruChanged += (o, e) => { - this.InvokeIfRequired(() => + Invoke((MethodInvoker)delegate { this.checkMiniParseClickthru.Checked = e.IsClickThru; }); }; this.config.UrlChanged += (o, e) => { - this.InvokeIfRequired(() => + Invoke((MethodInvoker)delegate { this.textUrl.Text = e.NewUrl; }); }; this.config.GlobalHotkeyEnabledChanged += (o, e) => { - this.InvokeIfRequired(() => + Invoke((MethodInvoker)delegate { this.checkEnableGlobalHotkey.Checked = e.NewGlobalHotkeyEnabled; this.textGlobalHotkey.Enabled = this.checkEnableGlobalHotkey.Checked; @@ -72,53 +65,41 @@ private void SetupConfigEventHandlers() }; this.config.GlobalHotkeyChanged += (o, e) => { - this.InvokeIfRequired(() => + Invoke((MethodInvoker)delegate { this.textGlobalHotkey.Text = Util.GetHotkeyString(this.config.GlobalHotkeyModifiers, e.NewHotkey); }); }; this.config.GlobalHotkeyModifiersChanged += (o, e) => { - this.InvokeIfRequired(() => + Invoke((MethodInvoker)delegate { this.textGlobalHotkey.Text = Util.GetHotkeyString(e.NewHotkey, this.config.GlobalHotkey); }); }; this.config.LockChanged += (o, e) => { - this.InvokeIfRequired(() => + Invoke((MethodInvoker)delegate { this.checkLock.Checked = e.IsLocked; }); }; this.config.TextChanged += (o, e) => { - this.InvokeIfRequired(() => + Invoke((MethodInvoker)delegate { this.textBox.Text = e.Text; }); }; this.config.HTMLModeChanged += (o, e) => { - this.InvokeIfRequired(() => + Invoke((MethodInvoker)delegate { this.checkHTML.Checked = e.NewState; }); }; } - private void InvokeIfRequired(Action action) - { - if (this.InvokeRequired) - { - this.Invoke(action); - } - else - { - action(); - } - } - private void checkWindowVisible_CheckedChanged(object sender, EventArgs e) { this.config.IsVisible = checkMiniParseVisible.Checked; @@ -131,7 +112,7 @@ private void checkMouseClickthru_CheckedChanged(object sender, EventArgs e) private void textUrl_TextChanged(object sender, EventArgs e) { - //this.config.Url = textMiniParseUrl.Text; + } private void buttonReloadBrowser_Click(object sender, EventArgs e) @@ -141,13 +122,13 @@ private void buttonReloadBrowser_Click(object sender, EventArgs e) private void buttonOpenDevTools_Click(object sender, EventArgs e) { - this.overlay.Overlay.Renderer.showDevTools(); + this.overlay.Overlay.Renderer.ShowDevTools(); } private void buttonOpenDevTools_RClick(object sender, System.Windows.Forms.MouseEventArgs e) { if (e.Button == MouseButtons.Right) - this.overlay.Overlay.Renderer.showDevTools(false); + this.overlay.Overlay.Renderer.ShowDevTools(false); } private void buttonCopyActXiv_Click(object sender, EventArgs e) diff --git a/OverlayPlugin.Core/Overlays/LabelOverlayConfigPanel.ja-JP.resx b/OverlayPlugin.Core/Overlays/ConfigPanels/LabelOverlayConfigPanel.ja-JP.resx similarity index 100% rename from OverlayPlugin.Core/Overlays/LabelOverlayConfigPanel.ja-JP.resx rename to OverlayPlugin.Core/Overlays/ConfigPanels/LabelOverlayConfigPanel.ja-JP.resx diff --git a/OverlayPlugin.Core/Overlays/LabelOverlayConfigPanel.ko-KR.resx b/OverlayPlugin.Core/Overlays/ConfigPanels/LabelOverlayConfigPanel.ko-KR.resx similarity index 100% rename from OverlayPlugin.Core/Overlays/LabelOverlayConfigPanel.ko-KR.resx rename to OverlayPlugin.Core/Overlays/ConfigPanels/LabelOverlayConfigPanel.ko-KR.resx diff --git a/OverlayPlugin.Core/Overlays/LabelOverlayConfigPanel.resx b/OverlayPlugin.Core/Overlays/ConfigPanels/LabelOverlayConfigPanel.resx similarity index 84% rename from OverlayPlugin.Core/Overlays/LabelOverlayConfigPanel.resx rename to OverlayPlugin.Core/Overlays/ConfigPanels/LabelOverlayConfigPanel.resx index 7cbc72b43..fae80b92a 100644 --- a/OverlayPlugin.Core/Overlays/LabelOverlayConfigPanel.resx +++ b/OverlayPlugin.Core/Overlays/ConfigPanels/LabelOverlayConfigPanel.resx @@ -117,772 +117,664 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 403, 12 - - - 403, 16 - - - 149, 22 - - - 1 - - - 7 + + 2 - - 4 + + True Fill - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 6 - - - MiddleLeft + + NoControl - - 1 + + + 25 - - 28 + + Text - + MiddleLeft - - NoControl + + label1 - - 0, 0 + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + tableLayoutPanel1 - - tableLayoutPanel1 + + 0 - - tableLayoutPanel1 + + True - - 31 + + Fill - - tableLayoutPanel1 + + NoControl - - 2 + + 0 - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Enable clickthru - - 3, 44 + + MiddleLeft - - NoControl + + label2 System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 30 + + tableLayoutPanel1 - - 22 + + 1 - + + True + + Fill - + NoControl - + 0 - - tableLayoutPanel3 + + Show overlay - - 3, 259 + + MiddleLeft - - True + + label3 - - 11 + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 1, 1, 1, 1 + + tableLayoutPanel1 - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="textUrl" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="buttonSelectFile" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,100,Absolute,37" /><Rows Styles="Percent,100" /></TableLayoutSettings> + + 2 - - Open DevTools + + True - + Fill - - Reload overlay + + NoControl - - 16 + + 1 - - NoControl + + checkMiniParseVisible - - MiddleLeft + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 158, 262 + + tableLayoutPanel1 - - 0 + + 3 True - - 0 - - + Fill - - 20 + + NoControl - - True + + 2 - - 156, 67 + + checkMiniParseClickthru - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 24 + + tableLayoutPanel1 - - 6, 12 + + 4 - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + True - - 1 + + Fill - + NoControl - - tableLayoutPanel1 + + 20 - - Fill + + Enable global hotkey - - textUrl + + MiddleLeft - - tableLayoutPanel1 + + label7 - - Show overlay + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Fill + + tableLayoutPanel1 - - 1, 1, 1, 1 + + 5 - + True - - 19 + + Fill - + NoControl - - 2 + + 20 - - 403, 49 + + Global hotkey - - Fill + + MiddleLeft - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + label8 - - tableLayoutPanel1 + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 158, 25 + + tableLayoutPanel1 - - label1 + + 6 - - Vertical + + Fill - - 149, 22 + + NoControl - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 21 - - buttonCopyUpdateScript + + checkEnableGlobalHotkey - - 407, 19 + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + tableLayoutPanel1 - - True + + 7 - + Fill - - True - - - 196, 43 - - - label5 - - - 149, 22 - - - 158, 150 + + 1, 1, 1, 1 - - 407, 20 + + 22 - - tableLayoutPanel2 + + textGlobalHotkey - - 1 + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Fill + + tableLayoutPanel1 - - Fill + + 8 - - 3, 66 + + True - + Fill - - 37, 19 - - - 3, 147 - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 0, 0 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - buttonReloadBrowser - - - buttonSelectFile - - - 1 + + NoControl - - tableLayoutPanel3 + + 23 - - Display text as HTML + + Lock overlay - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + MiddleLeft - - 14 + + label9 - + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 158, 284 + + tableLayoutPanel1 - - Fill + + 9 - + True - + NoControl - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - + Fill - - 149, 22 - - - 26 - - - NoControl + + 24 - - MiddleLeft + + checkLock - - 3, 110 + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - label7 + + tableLayoutPanel1 10 - - 5 + + True - - tableLayoutPanel1 + + Fill - - MiddleLeft + + NoControl + + + 19 ※You need restarting this plugin to apply framerate and hotkey settings. - - tableLayoutPanel1 + + label13 - - 23 + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - label9 + + tableLayoutPanel1 - - 3, 3 + + 11 - - 32 + + Fill - - 13 + + Consolas, 9pt - - tableLayoutPanel2 + + True - - 403, 106 + + Vertical - - 204, 3 + + 26 - - tableLayoutPanel1 + + textBox - - $this + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + tableLayoutPanel1 - - 21 + + 12 - + 3 - - checkHTML - - - 149, 22 + + Fill - + NoControl - - True + + 1 - - tableLayoutPanel3 + + Copy the update variable to clipboard - - Fill + + buttonCopyUpdateScript System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + tableLayoutPanel3 - - Enable global hotkey + + 0 - - 158, 3 + + Fill - - Lock overlay + + 2 - - 403, 16 + + Open DevTools - - 158, 47 + + buttonOpenDevTools - - 25 + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - tableLayoutPanel2 + + tableLayoutPanel3 - - 149, 22 + + 1 - - 3, 0 + + Fill - - 0 + + NoControl - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 0 - - 2 + + Reload overlay - - 403, 16 + + buttonReloadBrowser - - 1 + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 9 + + tableLayoutPanel3 - - checkLock + + 2 - - 564, 336 + + Fill - - 12 + + 0, 0, 0, 0 - + 1 - - LabelOverlayConfigPanel + + 27 - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="buttonOpenDevTools" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="buttonReloadBrowser" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="buttonCopyUpdateScript" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,33.33,Percent,33.33,Percent,33.33" /><Rows Styles="Percent,50" /></TableLayoutSettings> + + tableLayoutPanel3 - - NoControl + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 3 - - - Copy the update variable to clipboard - - - label4 - - - 195, 43 - - - MiddleLeft - - - label13 - - + tableLayoutPanel1 - - System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 13 - + + True + + Fill - - 17 + + NoControl - - label3 + + 28 - - Enable clickthru + + URL - + MiddleLeft - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - textGlobalHotkey - - - True - - - NoControl + + label4 - + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 3, 88 + + tableLayoutPanel1 - - 564, 336 + + 14 - - label8 + + 2 - + Fill - - 2 + + 0, 0, 0, 0 - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="label1" Row="7" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label2" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label3" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkMiniParseVisible" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="checkMiniParseClickthru" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label7" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label8" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkEnableGlobalHotkey" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="textGlobalHotkey" Row="5" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label9" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkLock" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label13" Row="6" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="textBox" Row="7" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="tableLayoutPanel3" Row="9" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="label4" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="tableLayoutPanel2" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label5" Row="8" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkHTML" Row="8" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Absolute,155,Percent,100" /><Rows Styles="Absolute,22,Absolute,22,Absolute,22,Absolute,22,Absolute,22,Absolute,22,AutoSize,0,Percent,100,Absolute,22,Absolute,55" /></TableLayoutSettings> + + 3 - - 8 + + textUrl - - textBox + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel2 0 - - 370, 19 + + Fill - - 149, 112 + + Popup - + NoControl - - 15 - - - True - - - 0 - - - Fill - - - True + + 0, 0, 0, 0 - - True + + 4 - - tableLayoutPanel1 + + ... - - Text + + buttonSelectFile - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - NoControl - - - 0 - - - checkMiniParseVisible - - - Fill - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + tableLayoutPanel2 - - Fill + + 1 - + Fill - - NoControl - - - 3, 22 - - - Global hotkey + + 1, 1, 1, 1 - - label2 + + 1 - - 3, 0, 3, 3 + + 30 - - 20 + + tableLayoutPanel2 - - NoControl + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + tableLayoutPanel1 - - tableLayoutPanel1 + + 15 - - 156, 111 + + True - + Fill - - tableLayoutPanel1 + + NoControl - - 10 + + 31 - - 0, 0, 0, 0 + + Display text as HTML - - 0, 0, 0, 1 + + MiddleLeft - - 3 + + label5 - - 2 + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 370, 0 + + tableLayoutPanel1 - - 158, 132 + + 16 - - 149, 22 + + Fill - + NoControl - - Fill + + 32 - - 403, 16 + + checkHTML - - MiddleLeft + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + tableLayoutPanel1 - - checkEnableGlobalHotkey - - - NoControl + + 17 - - checkMiniParseClickthru + + Fill - - 158, 91 + + 0, 0, 0, 0 - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 10 - - 27 + + 2 - + tableLayoutPanel1 - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + $this - - ... + + 0 - + True + + + 7, 12 - - URL + + 0, 0, 0, 0 - - Consolas, 9pt + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 4 + + Microsoft NeoGothic, 9pt + + + LabelOverlayConfigPanel + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="label1" Row="7" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label2" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label3" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkMiniParseVisible" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="checkMiniParseClickthru" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label7" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label8" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkEnableGlobalHotkey" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="textGlobalHotkey" Row="5" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label9" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkLock" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label13" Row="6" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="textBox" Row="7" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="tableLayoutPanel3" Row="9" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="label4" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="tableLayoutPanel2" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label5" Row="8" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkHTML" Row="8" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Absolute,220,Percent,100" /><Rows Styles="Absolute,25,Absolute,25,Absolute,25,Absolute,25,Absolute,25,Absolute,25,AutoSize,0,Percent,100,Absolute,25,Absolute,55" /></TableLayoutSettings> + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="textUrl" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="buttonSelectFile" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,100,Absolute,50" /><Rows Styles="Percent,100" /></TableLayoutSettings> + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="buttonCopyUpdateScript" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="buttonOpenDevTools" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="buttonReloadBrowser" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /></Controls><Columns Styles="Percent,33.33,Percent,33.33,Percent,33.33" /><Rows Styles="Percent,50" /></TableLayoutSettings> - - True - - - - \ No newline at end of file diff --git a/OverlayPlugin.Core/Overlays/LogParseConfigPanel.Designer.cs b/OverlayPlugin.Core/Overlays/ConfigPanels/LogParseConfigPanel.Designer.cs similarity index 94% rename from OverlayPlugin.Core/Overlays/LogParseConfigPanel.Designer.cs rename to OverlayPlugin.Core/Overlays/ConfigPanels/LogParseConfigPanel.Designer.cs index 82c5f734b..33a0ffd3f 100644 --- a/OverlayPlugin.Core/Overlays/LogParseConfigPanel.Designer.cs +++ b/OverlayPlugin.Core/Overlays/ConfigPanels/LogParseConfigPanel.Designer.cs @@ -29,37 +29,43 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LogParseConfigPanel)); - this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); - this.label6 = new System.Windows.Forms.Label(); - //this.label5 = new System.Windows.Forms.Label(); - //this.label4 = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); - this.label1 = new System.Windows.Forms.Label(); - this.checkMiniParseVisible = new System.Windows.Forms.CheckBox(); - this.checkMiniParseClickthru = new System.Windows.Forms.CheckBox(); - this.panel1 = new System.Windows.Forms.Panel(); - this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); + this.label6 = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.label10 = new System.Windows.Forms.Label(); + this.label13 = new System.Windows.Forms.Label(); + + this.buttonLogParseSelectFile = new System.Windows.Forms.Button(); this.buttonLogParseCopyActXiv = new System.Windows.Forms.Button(); this.buttonLogParseOpenDevTools = new System.Windows.Forms.Button(); this.buttonLogParseReloadBrowser = new System.Windows.Forms.Button(); + + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); - this.textLogParseUrl = new System.Windows.Forms.TextBox(); - this.buttonLogParseSelectFile = new System.Windows.Forms.Button(); - this.nudMaxFrameRate = new System.Windows.Forms.NumericUpDown(); - this.label13 = new System.Windows.Forms.Label(); - this.label7 = new System.Windows.Forms.Label(); - this.label8 = new System.Windows.Forms.Label(); + this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); + + this.checkMiniParseVisible = new System.Windows.Forms.CheckBox(); + this.checkMiniParseClickthru = new System.Windows.Forms.CheckBox(); this.checkEnableGlobalHotkey = new System.Windows.Forms.CheckBox(); - this.textGlobalHotkey = new System.Windows.Forms.TextBox(); - this.label9 = new System.Windows.Forms.Label(); this.checkLock = new System.Windows.Forms.CheckBox(); - this.label10 = new System.Windows.Forms.Label(); + this.comboHotkeyType = new System.Windows.Forms.ComboBox(); + + this.panel1 = new System.Windows.Forms.Panel(); + + this.textGlobalHotkey = new System.Windows.Forms.TextBox(); + this.textLogParseUrl = new System.Windows.Forms.TextBox(); + + this.nudMaxFrameRate = new System.Windows.Forms.NumericUpDown(); + this.tableLayoutPanel1.SuspendLayout(); - this.panel1.SuspendLayout(); - this.tableLayoutPanel3.SuspendLayout(); this.tableLayoutPanel2.SuspendLayout(); + this.tableLayoutPanel3.SuspendLayout(); + this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.nudMaxFrameRate)).BeginInit(); this.SuspendLayout(); // @@ -67,8 +73,6 @@ private void InitializeComponent() // resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1"); this.tableLayoutPanel1.Controls.Add(this.label6, 0, 4); - //this.tableLayoutPanel1.Controls.Add(this.label5, 0, 5); - //this.tableLayoutPanel1.Controls.Add(this.label4, 0, 4); this.tableLayoutPanel1.Controls.Add(this.label2, 0, 1); this.tableLayoutPanel1.Controls.Add(this.label3, 0, 0); this.tableLayoutPanel1.Controls.Add(this.label1, 0, 3); @@ -93,16 +97,6 @@ private void InitializeComponent() resources.ApplyResources(this.label6, "label6"); this.label6.Name = "label6"; // - // label5 - // - //resources.ApplyResources(this.label5, "label5"); - //this.label5.Name = "label5"; - // - // label4 - // - //resources.ApplyResources(this.label4, "label4"); - //this.label4.Name = "label4"; - // // label2 // resources.ApplyResources(this.label2, "label2"); @@ -120,8 +114,8 @@ private void InitializeComponent() // // checkMiniParseVisible // - resources.ApplyResources(this.checkMiniParseVisible, "checkLogParseVisible"); - this.checkMiniParseVisible.Name = "checkLogParseVisible"; + resources.ApplyResources(this.checkMiniParseVisible, "checkMiniParseVisible"); + this.checkMiniParseVisible.Name = "checkMiniParseVisible"; this.checkMiniParseVisible.UseVisualStyleBackColor = true; this.checkMiniParseVisible.CheckedChanged += new System.EventHandler(this.checkWindowVisible_CheckedChanged); // @@ -134,9 +128,9 @@ private void InitializeComponent() // // panel1 // - resources.ApplyResources(this.panel1, "panel1"); this.tableLayoutPanel1.SetColumnSpan(this.panel1, 2); this.panel1.Controls.Add(this.tableLayoutPanel3); + resources.ApplyResources(this.panel1, "panel1"); this.panel1.Name = "panel1"; // // tableLayoutPanel3 @@ -259,13 +253,14 @@ private void InitializeComponent() // comboHotkeyType // resources.ApplyResources(this.comboHotkeyType, "comboHotkeyType"); + this.comboHotkeyType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboHotkeyType.FormattingEnabled = true; this.comboHotkeyType.Name = "comboHotkeyType"; // // LogParseConfigPanel // resources.ApplyResources(this, "$this"); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.BackColor = System.Drawing.Color.Transparent; this.Controls.Add(this.tableLayoutPanel1); this.Name = "LogParseConfigPanel"; @@ -283,31 +278,36 @@ private void InitializeComponent() #endregion private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; - private System.Windows.Forms.Label label13; - private System.Windows.Forms.Label label6; - //private System.Windows.Forms.Label label5; - //private System.Windows.Forms.Label label4; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3; + + private System.Windows.Forms.Panel panel1; + + private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label3; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.CheckBox checkMiniParseVisible; - private System.Windows.Forms.CheckBox checkMiniParseClickthru; - private System.Windows.Forms.Panel panel1; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.Label label13; + private System.Windows.Forms.Button buttonLogParseReloadBrowser; private System.Windows.Forms.Button buttonLogParseOpenDevTools; private System.Windows.Forms.Button buttonLogParseCopyActXiv; - private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; - private System.Windows.Forms.TextBox textLogParseUrl; private System.Windows.Forms.Button buttonLogParseSelectFile; - private System.Windows.Forms.NumericUpDown nudMaxFrameRate; - private System.Windows.Forms.Label label7; - private System.Windows.Forms.Label label8; + private System.Windows.Forms.CheckBox checkEnableGlobalHotkey; - private System.Windows.Forms.TextBox textGlobalHotkey; - private System.Windows.Forms.Label label9; private System.Windows.Forms.CheckBox checkLock; - private System.Windows.Forms.Label label10; + private System.Windows.Forms.CheckBox checkMiniParseVisible; + private System.Windows.Forms.CheckBox checkMiniParseClickthru; + private System.Windows.Forms.ComboBox comboHotkeyType; + + private System.Windows.Forms.TextBox textGlobalHotkey; + private System.Windows.Forms.TextBox textLogParseUrl; + + private System.Windows.Forms.NumericUpDown nudMaxFrameRate; } } diff --git a/OverlayPlugin.Core/Overlays/LogParseConfigPanel.cs b/OverlayPlugin.Core/Overlays/ConfigPanels/LogParseConfigPanel.cs similarity index 87% rename from OverlayPlugin.Core/Overlays/LogParseConfigPanel.cs rename to OverlayPlugin.Core/Overlays/ConfigPanels/LogParseConfigPanel.cs index 1747b06a5..480422aee 100644 --- a/OverlayPlugin.Core/Overlays/LogParseConfigPanel.cs +++ b/OverlayPlugin.Core/Overlays/ConfigPanels/LogParseConfigPanel.cs @@ -1,11 +1,5 @@ using System; using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.Data; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; namespace RainbowMage.OverlayPlugin.Overlays @@ -19,7 +13,8 @@ public partial class LogParseConfigPanel : UserControl { new KeyValuePair(Localization.GetText(TextItem.ToggleVisible), GlobalHotkeyType.ToggleVisible), new KeyValuePair(Localization.GetText(TextItem.ToggleClickthru), GlobalHotkeyType.ToggleClickthru), - new KeyValuePair(Localization.GetText(TextItem.ToggleLock), GlobalHotkeyType.ToggleLock) + new KeyValuePair(Localization.GetText(TextItem.ToggleLock), GlobalHotkeyType.ToggleLock), + new KeyValuePair(Localization.GetText(TextItem.Screenshot), GlobalHotkeyType.Screenshot) }; public LogParseConfigPanel(LogParseOverlay overlay) @@ -54,35 +49,35 @@ private void SetupConfigEventHandlers() { this.config.VisibleChanged += (o, e) => { - this.InvokeIfRequired(() => + Invoke((MethodInvoker)delegate { this.checkMiniParseVisible.Checked = e.IsVisible; }); }; this.config.ClickThruChanged += (o, e) => { - this.InvokeIfRequired(() => + Invoke((MethodInvoker)delegate { this.checkMiniParseClickthru.Checked = e.IsClickThru; }); }; this.config.UrlChanged += (o, e) => { - this.InvokeIfRequired(() => + Invoke((MethodInvoker)delegate { this.textLogParseUrl.Text = e.NewUrl; }); }; this.config.MaxFrameRateChanged += (o, e) => { - this.InvokeIfRequired(() => + Invoke((MethodInvoker)delegate { this.nudMaxFrameRate.Value = e.NewFrameRate; }); }; this.config.GlobalHotkeyEnabledChanged += (o, e) => { - this.InvokeIfRequired(() => + Invoke((MethodInvoker)delegate { this.checkEnableGlobalHotkey.Checked = e.NewGlobalHotkeyEnabled; this.textGlobalHotkey.Enabled = this.checkEnableGlobalHotkey.Checked; @@ -90,53 +85,43 @@ private void SetupConfigEventHandlers() }; this.config.GlobalHotkeyChanged += (o, e) => { - this.InvokeIfRequired(() => + Invoke((MethodInvoker)delegate { this.textGlobalHotkey.Text = Util.GetHotkeyString(this.config.GlobalHotkeyModifiers, e.NewHotkey); }); }; this.config.GlobalHotkeyModifiersChanged += (o, e) => { - this.InvokeIfRequired(() => + Invoke((MethodInvoker)delegate { this.textGlobalHotkey.Text = Util.GetHotkeyString(e.NewHotkey, this.config.GlobalHotkey); }); }; this.config.LockChanged += (o, e) => { - this.InvokeIfRequired(() => + Invoke((MethodInvoker)delegate { this.checkLock.Checked = e.IsLocked; }); }; this.config.GlobalHotkeyTypeChanged += (o, e) => { - this.InvokeIfRequired(() => + Invoke((MethodInvoker)delegate { this.comboHotkeyType.SelectedValue = e.NewHotkeyType; }); }; } - private void InvokeIfRequired(Action action) - { - if (this.InvokeRequired) - { - this.Invoke(action); - } - else - { - action(); - } - } - private void checkWindowVisible_CheckedChanged(object sender, EventArgs e) { + if (this.config.Url == "") return; this.config.IsVisible = checkMiniParseVisible.Checked; } private void checkMouseClickthru_CheckedChanged(object sender, EventArgs e) { + if (this.config.Url == "") return; this.config.IsClickThru = checkMiniParseClickthru.Checked; } @@ -178,13 +163,13 @@ private void buttonSelectFile_Click(object sender, EventArgs e) private void buttonLogParseOpenDevTools_Click(object sender, EventArgs e) { - this.overlay.Overlay.Renderer.showDevTools(); + this.overlay.Overlay.Renderer.ShowDevTools(); } private void buttonLogParseOpenDevTools_RClick(object sender, System.Windows.Forms.MouseEventArgs e) { if (e.Button == MouseButtons.Right) - this.overlay.Overlay.Renderer.showDevTools(false); + this.overlay.Overlay.Renderer.ShowDevTools(false); } private void buttonCopyActXiv_Click(object sender, EventArgs e) @@ -212,6 +197,7 @@ private void textBoxGlobalHotkey_KeyDown(object sender, KeyEventArgs e) private void checkLock_CheckedChanged(object sender, EventArgs e) { + if (this.config.Url == "") return; this.config.IsLocked = this.checkLock.Checked; } } diff --git a/OverlayPlugin.Core/Overlays/LogParseConfigPanel.ja-JP.resx b/OverlayPlugin.Core/Overlays/ConfigPanels/LogParseConfigPanel.ja-JP.resx similarity index 86% rename from OverlayPlugin.Core/Overlays/LogParseConfigPanel.ja-JP.resx rename to OverlayPlugin.Core/Overlays/ConfigPanels/LogParseConfigPanel.ja-JP.resx index 960d215bf..fe2fd934b 100644 --- a/OverlayPlugin.Core/Overlays/LogParseConfigPanel.ja-JP.resx +++ b/OverlayPlugin.Core/Overlays/ConfigPanels/LogParseConfigPanel.ja-JP.resx @@ -117,15 +117,10 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + 最大フレームレート - - ソートタイプ - - - 含めるログ - クリックを透過させる @@ -135,6 +130,17 @@ 表示するURL + + + False + + + + None + + + 13 + 変数をクリップボードにコピー @@ -144,6 +150,12 @@ オーバーレイの表示をリロード + + Popup + + + 0, 0, 0, 0 + ※最大フレームレート、およびホットキーの変更を有効にするためにはプラグインの再起動が必要です @@ -159,13 +171,7 @@ ホットキータイプ - - /echo - - - 残りの会話 - - - 残りのログ + + 7, 12 \ No newline at end of file diff --git a/OverlayPlugin.Core/Overlays/LogParseConfigPanel.ko-KR.resx b/OverlayPlugin.Core/Overlays/ConfigPanels/LogParseConfigPanel.ko-KR.resx similarity index 100% rename from OverlayPlugin.Core/Overlays/LogParseConfigPanel.ko-KR.resx rename to OverlayPlugin.Core/Overlays/ConfigPanels/LogParseConfigPanel.ko-KR.resx diff --git a/OverlayPlugin.Core/Overlays/LogParseConfigPanel.resx b/OverlayPlugin.Core/Overlays/ConfigPanels/LogParseConfigPanel.resx similarity index 71% rename from OverlayPlugin.Core/Overlays/LogParseConfigPanel.resx rename to OverlayPlugin.Core/Overlays/ConfigPanels/LogParseConfigPanel.resx index fc088c226..1efd77841 100644 --- a/OverlayPlugin.Core/Overlays/LogParseConfigPanel.resx +++ b/OverlayPlugin.Core/Overlays/ConfigPanels/LogParseConfigPanel.resx @@ -118,933 +118,666 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 4 - - - - 149, 22 - - - label6 - - - MiddleLeft - - - checkLock - - - - Fill - - - True - - - 15 - - - MiddleLeft - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 8 - - - MiddleLeft - - + 2 - - NoControl - - - 0, 0 - - + True - - tableLayoutPanel1 - - - tableLayoutPanel1 - - - 410, 0 + + + Fill - + NoControl - - 10 - - - 3, 3 - - - tableLayoutPanel1 - - - 447, 19 - - - buttonLogParseSelectFile + + + 12 Max. framerate - - 2 + + MiddleLeft - - comboHotkeyType + + label6 - + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 3, 44 - - - 4 - - - 2 - tableLayoutPanel1 - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 5 - - - 22 - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel1 - - - 8 - - + 0 - - 149, 22 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 3, 110 - - - Fill - - - Enable global hotkey - - + True - - 149, 22 - - - 13 + + Fill - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="textLogParseUrl" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="buttonLogParseSelectFile" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,100,Absolute,37" /><Rows Styles="Percent,100" /></TableLayoutSettings> + + NoControl - - 4 + + 0 Enable clickthru - - NoControl - - + MiddleLeft - - Fill + + label2 - - 6 + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - label10 + + tableLayoutPanel1 - - True + + 1 - - MiddleLeft + + True - + Fill - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + NoControl 0 - - Fill - - - Fill - - - 20 - - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Copy the update variable to clipboard - - - NoControl - - - 1, 1, 1, 1 - - - 24 - - - 6, 12 + + Show overlay - - NoControl + + MiddleLeft - - 3 + + label3 - - NoControl + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + tableLayoutPanel1 - - Fill + + 2 - + True - - panel1 - - - 3, 304 - - - buttonLogParseOpenDevTools - - - 447, 20 - - - Sort type - - - 193, 45 - - - True + + Fill - - 19 + + NoControl - - True + + 0 - - 0, 0 + + URL - - 598, 51 + + MiddleLeft - - 1 + + label1 - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + tableLayoutPanel1 - - 158, 25 - - - NoControl - - + 3 - - 149, 22 + + True - - 9 + + Fill - - 12 + + NoControl - - tableLayoutPanel1 + + 1 - - buttonLogParseReloadBrowser + + checkMiniParseVisible - - 447, 19 + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 21 + + tableLayoutPanel1 - - 12 + + 4 - + True Fill - - label5 - - - 149, 22 - - - comboLogParseSortType - - - label1 - - - 1, 1, 1, 1 - - - Fill + + NoControl - - Fill + + 2 - - 3, 88 + + checkMiniParseClickthru System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 3, 66 - - - Fill - - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 0, 0, 0, 1 - - - 1 - - + tableLayoutPanel1 - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 1 - - - tableLayoutPanel3 - - - tableLayoutPanel3 - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Fill - - - 2 + + 5 - + 3 - - 0, 0 - - - 1 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Fill - - - ... - - - Fill - - - 9 - - - Reload overlay - - + Fill - - 1, 1, 1, 1 - - - 156, 89 - - - $this - - - MiddleLeft + + NoControl 1 - - tableLayoutPanel1 + + Copy the update variable to clipboard - - label7 + + buttonLogParseCopyActXiv - - 19 + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 37, 19 + + tableLayoutPanel3 + + + 0 - - 14 + + Fill - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 2 - - 193, 45 + + Open DevTools - - MiddleLeft + + buttonLogParseOpenDevTools - - tableLayoutPanel2 + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - tableLayoutPanel1 + + tableLayoutPanel3 - - 23 + + 1 - - label9 + + Fill - - tableLayoutPanel1 + + NoControl - + 0 - - 0, 0, 0, 0 + + Reload overlay - - 10 + + buttonLogParseReloadBrowser - - textLogParseUrl + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Fill + + tableLayoutPanel3 - + 2 - - tableLayoutPanel1 - - - 11 - - - tableLayoutPanel1 - - + Fill - - 21 + + 0, 0, 0, 0 - - 3, 198 + + 1 - - 7 + + 0 - - 149, 22 + + tableLayoutPanel3 - - NoControl + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - label4 + + panel1 - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 0 - + Fill - - Fill + + 0, 0, 0, 0 - - tableLayoutPanel1 + + 4 - - 158, 3 + + panel1 - - 410, 19 + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Lock overlay + + tableLayoutPanel1 - - 443, 16 + + 6 - + 2 - - 158, 47 + + Fill - - 1, 1, 1, 1 + + 0, 0, 0, 0 - - tableLayoutPanel2 + + 3 - - 149, 22 + + textLogParseUrl - - 20 + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 3, 0 + + tableLayoutPanel2 - + 0 - - 3, 22 + + NoControl - - nudMaxFrameRate + + Popup - - 156, 67 + + 0, 0, 0, 0 - - 443, 16 + + 4 - - 1 + + ... - - 18 + + buttonLogParseSelectFile - - 447, 20 + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - tableLayoutPanel1 + + tableLayoutPanel2 - - True + + 1 - - 604, 358 + + Fill - - 202, 3 + + 1, 1, 1, 1 - - 443, 16 + + 1 - - 11 + + 5 - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + tableLayoutPanel2 - - LogParseConfigPanel + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="buttonLogParseCopyActXiv" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="buttonLogParseOpenDevTools" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="buttonLogParseReloadBrowser" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /></Controls><Columns Styles="Percent,33.33,Percent,33.33,Percent,33.33" /><Rows Styles="Percent,50" /></TableLayoutSettings> + + tableLayoutPanel1 - - 26 + + 7 - - NoControl + + Fill - + 1, 1, 1, 1 - - 3, 176 + + 13 - - MiddleLeft + + nudMaxFrameRate - - Fill + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - NoControl + + tableLayoutPanel1 - - label13 + + 8 - + True - - checkMiniParseClickthru - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Fill - - tableLayoutPanel1 + + NoControl - - System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 19 - - label3 + + ※You need restarting this plugin to apply framerate and hotkey settings. - - 149, 20 + + label13 - - True + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + tableLayoutPanel1 - - textGlobalHotkey + + 9 - + True - + Fill - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 3, 154 - - - 604, 358 - - + NoControl - - Fill - - - 1 - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="label6" Row="6" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label5" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="textLogParseSortKey" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label4" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label2" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label3" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label1" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkMiniParseVisible" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="checkMiniParseClickthru" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="panel1" Row="11" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="tableLayoutPanel2" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="comboMiniParseSortType" Row="5" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="nudMaxFrameRate" Row="6" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label13" Row="10" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label7" Row="7" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label8" Row="8" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkEnableGlobalHotkey" Row="7" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="textGlobalHotkey" Row="8" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label9" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkLock" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label10" Row="9" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="comboHotkeyType" Row="9" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Absolute,155,Percent,100" /><Rows Styles="Absolute,22,Absolute,22,Absolute,22,Absolute,22,Absolute,22,Absolute,22,Absolute,22,Absolute,22,Absolute,22,Absolute,20,Percent,100,Absolute,57" /></TableLayoutSettings> - - - 17 - - - label8 + + 20 - - Fill + + Enable global hotkey - - tableLayoutPanel3 + + MiddleLeft - - 149, 22 + + label7 - - NoControl + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + tableLayoutPanel1 - - True + + 10 - - 0 + + True - + Fill - - Hotkey Type + + NoControl - - 0 + + 20 - - 194, 45 + + Global hotkey - - Fill + + MiddleLeft - - URL + + label8 - - tableLayoutPanel1 + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 443, 83 + + tableLayoutPanel1 - - tableLayoutPanel2 + + 11 - - checkMiniParseVisible + + Fill - - tableLayoutPanel1 + + 21 - - tableLayoutPanel1 + + checkEnableGlobalHotkey - - buttonLogParseCopyActXiv + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + tableLayoutPanel1 - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 156, 133 + + 12 Fill - - MiddleLeft - - - NoControl - - - ※You need restarting this plugin to apply framerate and hotkey settings. - - - Global hotkey + + 1, 1, 1, 1 - - label2 + + 22 - - 149, 22 + + textGlobalHotkey - - 25 + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 1 + + tableLayoutPanel1 - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 13 - - 16 + + True - - panel1 + + Fill - + NoControl - - 0 + + 23 - - 20 + + Lock overlay - - 598, 51 + + MiddleLeft - - NoControl + + label9 - - 0 + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 tableLayoutPanel1 - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 401, 3 + + 14 - - 156, 177 + + True - - 447, 19 + + Fill - - 12 + + NoControl - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 24 - - Show overlay + + checkLock - - 5 + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - tableLayoutPanel3 + + tableLayoutPanel1 - - 447, 20 + + 15 - - Open DevTools + + True - - 158, 218 + + Fill - - 156, 111 + + 25 - - 0 + + Hotkey Type - + MiddleLeft - - 443, 16 - - - Fill + + label10 - - checkEnableGlobalHotkey + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - NoControl + + tableLayoutPanel1 - - 158, 157 + + 16 - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Fill - - 0 + + 1, 1, 1, 1 - - textLogParseSortKey + + 26 - - 156, 199 + + comboHotkeyType - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 1, 1, 1, 1 + + tableLayoutPanel1 - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 17 - - 3, 132 + + Fill - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 12 - - True + + 1 - - Sort key + + tableLayoutPanel1 System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Fill + + $this - - 13 + + 0 True - - ja-JP - + + 7, 12 + + + LogParseConfigPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Microsoft NeoGothic, 9pt + + + 640,360 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="label6" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label2" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label3" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label1" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkMiniParseVisible" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="checkMiniParseClickthru" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="panel1" Row="11" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="tableLayoutPanel2" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="nudMaxFrameRate" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label13" Row="8" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label7" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label8" Row="6" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkEnableGlobalHotkey" Row="5" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="textGlobalHotkey" Row="6" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label9" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkLock" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label10" Row="7" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="comboHotkeyType" Row="7" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Absolute,220,Percent,100" /><Rows Styles="Absolute,25,Absolute,25,Absolute,25,Absolute,25,Absolute,25,Absolute,25,Absolute,25,Absolute,25,Absolute,25,Absolute,25,Percent,100,Absolute,55" /></TableLayoutSettings> + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="textLogParseUrl" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="buttonLogParseSelectFile" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,100,Absolute,50" /><Rows Styles="Percent,100" /></TableLayoutSettings> + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="buttonLogParseCopyActXiv" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="buttonLogParseOpenDevTools" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="buttonLogParseReloadBrowser" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /></Controls><Columns Styles="Percent,33.33,Percent,33.33,Percent,33.33" /><Rows Styles="Percent,50" /></TableLayoutSettings> + \ No newline at end of file diff --git a/OverlayPlugin.Core/Overlays/MiniParseConfigPanel.Designer.cs b/OverlayPlugin.Core/Overlays/ConfigPanels/MiniParseConfigPanel.Designer.cs similarity index 89% rename from OverlayPlugin.Core/Overlays/MiniParseConfigPanel.Designer.cs rename to OverlayPlugin.Core/Overlays/ConfigPanels/MiniParseConfigPanel.Designer.cs index d7028a405..db4d469fd 100644 --- a/OverlayPlugin.Core/Overlays/MiniParseConfigPanel.Designer.cs +++ b/OverlayPlugin.Core/Overlays/ConfigPanels/MiniParseConfigPanel.Designer.cs @@ -29,36 +29,42 @@ protected override void Dispose(bool disposing) private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MiniParseConfigPanel)); - this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); - this.label6 = new System.Windows.Forms.Label(); - this.label5 = new System.Windows.Forms.Label(); - this.textMiniParseSortKey = new System.Windows.Forms.TextBox(); - this.label4 = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); - this.label1 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.label10 = new System.Windows.Forms.Label(); + this.label12 = new System.Windows.Forms.Label(); + this.label13 = new System.Windows.Forms.Label(); + this.checkMiniParseVisible = new System.Windows.Forms.CheckBox(); this.checkMiniParseClickthru = new System.Windows.Forms.CheckBox(); - this.panel1 = new System.Windows.Forms.Panel(); + this.checkEnableGlobalHotkey = new System.Windows.Forms.CheckBox(); + this.checkLock = new System.Windows.Forms.CheckBox(); + + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); + + this.nudUpdateInterval = new System.Windows.Forms.NumericUpDown(); + this.textMiniParseSortKey = new System.Windows.Forms.TextBox(); + this.panel1 = new System.Windows.Forms.Panel(); this.buttonMiniParseCopyActXiv = new System.Windows.Forms.Button(); this.buttonMiniParseOpenDevTools = new System.Windows.Forms.Button(); this.buttonMiniParseReloadBrowser = new System.Windows.Forms.Button(); - this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); this.textMiniParseUrl = new System.Windows.Forms.TextBox(); this.buttonMiniParseSelectFile = new System.Windows.Forms.Button(); this.comboMiniParseSortType = new System.Windows.Forms.ComboBox(); this.nudMaxFrameRate = new System.Windows.Forms.NumericUpDown(); - this.label13 = new System.Windows.Forms.Label(); - this.label7 = new System.Windows.Forms.Label(); - this.label8 = new System.Windows.Forms.Label(); - this.checkEnableGlobalHotkey = new System.Windows.Forms.CheckBox(); this.textGlobalHotkey = new System.Windows.Forms.TextBox(); - this.label9 = new System.Windows.Forms.Label(); - this.checkLock = new System.Windows.Forms.CheckBox(); - this.label10 = new System.Windows.Forms.Label(); this.comboHotkeyType = new System.Windows.Forms.ComboBox(); this.tableLayoutPanel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nudUpdateInterval)).BeginInit(); this.panel1.SuspendLayout(); this.tableLayoutPanel3.SuspendLayout(); this.tableLayoutPanel2.SuspendLayout(); @@ -68,6 +74,8 @@ private void InitializeComponent() // tableLayoutPanel1 // resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1"); + this.tableLayoutPanel1.Controls.Add(this.nudUpdateInterval, 1, 7); + this.tableLayoutPanel1.Controls.Add(this.label12, 0, 7); this.tableLayoutPanel1.Controls.Add(this.label6, 0, 6); this.tableLayoutPanel1.Controls.Add(this.label5, 0, 5); this.tableLayoutPanel1.Controls.Add(this.textMiniParseSortKey, 1, 4); @@ -77,21 +85,57 @@ private void InitializeComponent() this.tableLayoutPanel1.Controls.Add(this.label1, 0, 3); this.tableLayoutPanel1.Controls.Add(this.checkMiniParseVisible, 1, 0); this.tableLayoutPanel1.Controls.Add(this.checkMiniParseClickthru, 1, 1); - this.tableLayoutPanel1.Controls.Add(this.panel1, 0, 11); + this.tableLayoutPanel1.Controls.Add(this.panel1, 0, 12); this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel2, 1, 3); this.tableLayoutPanel1.Controls.Add(this.comboMiniParseSortType, 1, 5); this.tableLayoutPanel1.Controls.Add(this.nudMaxFrameRate, 1, 6); - this.tableLayoutPanel1.Controls.Add(this.label13, 1, 10); - this.tableLayoutPanel1.Controls.Add(this.label7, 0, 7); - this.tableLayoutPanel1.Controls.Add(this.label8, 0, 8); - this.tableLayoutPanel1.Controls.Add(this.checkEnableGlobalHotkey, 1, 7); - this.tableLayoutPanel1.Controls.Add(this.textGlobalHotkey, 1, 8); + this.tableLayoutPanel1.Controls.Add(this.label13, 1, 11); this.tableLayoutPanel1.Controls.Add(this.label9, 0, 2); this.tableLayoutPanel1.Controls.Add(this.checkLock, 1, 2); - this.tableLayoutPanel1.Controls.Add(this.label10, 0, 9); - this.tableLayoutPanel1.Controls.Add(this.comboHotkeyType, 1, 9); + this.tableLayoutPanel1.Controls.Add(this.label7, 0, 8); + this.tableLayoutPanel1.Controls.Add(this.checkEnableGlobalHotkey, 1, 8); + this.tableLayoutPanel1.Controls.Add(this.label8, 0, 9); + this.tableLayoutPanel1.Controls.Add(this.textGlobalHotkey, 1, 9); + this.tableLayoutPanel1.Controls.Add(this.label10, 0, 10); + this.tableLayoutPanel1.Controls.Add(this.comboHotkeyType, 1, 10); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; // + // nudUpdateInterval + // + resources.ApplyResources(this.nudUpdateInterval, "nudUpdateInterval"); + this.nudUpdateInterval.Increment = new decimal(new int[] { + 100, + 0, + 0, + 0}); + this.nudUpdateInterval.Maximum = new decimal(new int[] { + 2000, + 0, + 0, + 0}); + this.nudUpdateInterval.Minimum = new decimal(new int[] { + 50, + 0, + 0, + 0}); + this.nudUpdateInterval.Name = "nudUpdateInterval"; + this.nudUpdateInterval.Value = new decimal(new int[] { + 1000, + 0, + 0, + 0}); + this.nudUpdateInterval.ValueChanged += new System.EventHandler(this.nudUpdateInterval_ValueChanged); + // + // label12 + // + resources.ApplyResources(this.label12, "label12"); + this.label12.Name = "label12"; + // + // label11 + // + // resources.ApplyResources(this.label11, "label11"); + // this.label11.Name = "label11"; + // // label6 // resources.ApplyResources(this.label6, "label6"); @@ -144,9 +188,9 @@ private void InitializeComponent() // // panel1 // - resources.ApplyResources(this.panel1, "panel1"); this.tableLayoutPanel1.SetColumnSpan(this.panel1, 2); this.panel1.Controls.Add(this.tableLayoutPanel3); + resources.ApplyResources(this.panel1, "panel1"); this.panel1.Name = "panel1"; // // tableLayoutPanel3 @@ -195,6 +239,7 @@ private void InitializeComponent() // // buttonMiniParseSelectFile // + this.buttonMiniParseSelectFile.Cursor = System.Windows.Forms.Cursors.Default; resources.ApplyResources(this.buttonMiniParseSelectFile, "buttonMiniParseSelectFile"); this.buttonMiniParseSelectFile.Name = "buttonMiniParseSelectFile"; this.buttonMiniParseSelectFile.UseVisualStyleBackColor = true; @@ -276,18 +321,20 @@ private void InitializeComponent() // comboHotkeyType // resources.ApplyResources(this.comboHotkeyType, "comboHotkeyType"); + this.comboHotkeyType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboHotkeyType.FormattingEnabled = true; this.comboHotkeyType.Name = "comboHotkeyType"; // // MiniParseConfigPanel // resources.ApplyResources(this, "$this"); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.BackColor = System.Drawing.Color.Transparent; this.Controls.Add(this.tableLayoutPanel1); this.Name = "MiniParseConfigPanel"; this.tableLayoutPanel1.ResumeLayout(false); this.tableLayoutPanel1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nudUpdateInterval)).EndInit(); this.panel1.ResumeLayout(false); this.tableLayoutPanel3.ResumeLayout(false); this.tableLayoutPanel2.ResumeLayout(false); @@ -328,5 +375,7 @@ private void InitializeComponent() private System.Windows.Forms.CheckBox checkLock; private System.Windows.Forms.Label label10; private System.Windows.Forms.ComboBox comboHotkeyType; + private System.Windows.Forms.NumericUpDown nudUpdateInterval; + private System.Windows.Forms.Label label12; } } diff --git a/OverlayPlugin.Core/Overlays/MiniParseConfigPanel.cs b/OverlayPlugin.Core/Overlays/ConfigPanels/MiniParseConfigPanel.cs similarity index 84% rename from OverlayPlugin.Core/Overlays/MiniParseConfigPanel.cs rename to OverlayPlugin.Core/Overlays/ConfigPanels/MiniParseConfigPanel.cs index 822f7be29..ea9a16cf9 100644 --- a/OverlayPlugin.Core/Overlays/MiniParseConfigPanel.cs +++ b/OverlayPlugin.Core/Overlays/ConfigPanels/MiniParseConfigPanel.cs @@ -1,11 +1,5 @@ using System; using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.Data; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; namespace RainbowMage.OverlayPlugin.Overlays @@ -28,7 +22,8 @@ public partial class MiniParseConfigPanel : UserControl { new KeyValuePair(Localization.GetText(TextItem.ToggleVisible), GlobalHotkeyType.ToggleVisible), new KeyValuePair(Localization.GetText(TextItem.ToggleClickthru), GlobalHotkeyType.ToggleClickthru), - new KeyValuePair(Localization.GetText(TextItem.ToggleLock), GlobalHotkeyType.ToggleLock) + new KeyValuePair(Localization.GetText(TextItem.ToggleLock), GlobalHotkeyType.ToggleLock), + new KeyValuePair(Localization.GetText(TextItem.Screenshot), GlobalHotkeyType.Screenshot) }; public MiniParseConfigPanel(MiniParseOverlay overlay) @@ -63,109 +58,120 @@ private void SetupControlProperties() this.comboHotkeyType.DataSource = hotkeyTypeDict; this.comboHotkeyType.SelectedValue = config.GlobalHotkeyType; this.comboHotkeyType.SelectedIndexChanged += ComboHotkeyMode_SelectedIndexChanged; + this.nudUpdateInterval.Value = config.OverlayUpdateInterval; } private void SetupConfigEventHandlers() { this.config.VisibleChanged += (o, e) => { - this.InvokeIfRequired(() => + Invoke((MethodInvoker)delegate { this.checkMiniParseVisible.Checked = e.IsVisible; }); }; + this.config.ClickThruChanged += (o, e) => { - this.InvokeIfRequired(() => + Invoke((MethodInvoker)delegate { this.checkMiniParseClickthru.Checked = e.IsClickThru; }); }; + this.config.UrlChanged += (o, e) => { - this.InvokeIfRequired(() => + Invoke((MethodInvoker)delegate { this.textMiniParseUrl.Text = e.NewUrl; }); }; + this.config.SortKeyChanged += (o, e) => { - this.InvokeIfRequired(() => + Invoke((MethodInvoker)delegate { this.textMiniParseSortKey.Text = e.NewSortKey; }); }; + this.config.SortTypeChanged += (o, e) => { - this.InvokeIfRequired(() => + Invoke((MethodInvoker)delegate { this.comboMiniParseSortType.SelectedValue = e.NewSortType; }); }; + this.config.MaxFrameRateChanged += (o, e) => { - this.InvokeIfRequired(() => + Invoke((MethodInvoker)delegate { this.nudMaxFrameRate.Value = e.NewFrameRate; }); }; + this.config.GlobalHotkeyEnabledChanged += (o, e) => { - this.InvokeIfRequired(() => + Invoke((MethodInvoker)delegate { this.checkEnableGlobalHotkey.Checked = e.NewGlobalHotkeyEnabled; this.textGlobalHotkey.Enabled = this.checkEnableGlobalHotkey.Checked; }); }; + this.config.GlobalHotkeyChanged += (o, e) => { - this.InvokeIfRequired(() => + Invoke((MethodInvoker)delegate { this.textGlobalHotkey.Text = Util.GetHotkeyString(this.config.GlobalHotkeyModifiers, e.NewHotkey); }); }; + this.config.GlobalHotkeyModifiersChanged += (o, e) => { - this.InvokeIfRequired(() => + Invoke((MethodInvoker)delegate { this.textGlobalHotkey.Text = Util.GetHotkeyString(e.NewHotkey, this.config.GlobalHotkey); }); }; + this.config.LockChanged += (o, e) => { - this.InvokeIfRequired(() => + Invoke((MethodInvoker)delegate { this.checkLock.Checked = e.IsLocked; }); }; + this.config.GlobalHotkeyTypeChanged += (o, e) => { - this.InvokeIfRequired(() => + Invoke((MethodInvoker)delegate { this.comboHotkeyType.SelectedValue = e.NewHotkeyType; }); }; - } - private void InvokeIfRequired(Action action) - { - if (this.InvokeRequired) - { - this.Invoke(action); - } - else + this.config.OverlayUpdateIntervalChanged += (o, e) => { - action(); - } + Invoke((MethodInvoker)delegate + { + this.nudUpdateInterval.Value = (int)e.Interval; + this.overlay.UpdateTimer.Interval = e.Interval; + this.overlay.UpdateStringCacheExpireInterval = TimeSpan.FromMilliseconds(e.Interval / 2); + }); + }; } private void checkWindowVisible_CheckedChanged(object sender, EventArgs e) { + if (this.config.Url == "") return; this.config.IsVisible = checkMiniParseVisible.Checked; } private void checkMouseClickthru_CheckedChanged(object sender, EventArgs e) { + if (this.config.Url == "") return; this.config.IsClickThru = checkMiniParseClickthru.Checked; } @@ -218,13 +224,13 @@ private void buttonSelectFile_Click(object sender, EventArgs e) private void buttonMiniParseOpenDevTools_Click(object sender, EventArgs e) { - this.overlay.Overlay.Renderer.showDevTools(); + this.overlay.Overlay.Renderer.ShowDevTools(); } private void buttonMiniParseOpenDevTools_RClick(object sender, System.Windows.Forms.MouseEventArgs e) { if (e.Button == MouseButtons.Right) - this.overlay.Overlay.Renderer.showDevTools(false); + this.overlay.Overlay.Renderer.ShowDevTools(false); } private void buttonCopyActXiv_Click(object sender, EventArgs e) @@ -252,7 +258,13 @@ private void textBoxGlobalHotkey_KeyDown(object sender, KeyEventArgs e) private void checkLock_CheckedChanged(object sender, EventArgs e) { + if (this.config.Url == "") return; this.config.IsLocked = this.checkLock.Checked; } + + private void nudUpdateInterval_ValueChanged(object sender, EventArgs e) + { + this.config.OverlayUpdateInterval = (int)this.nudUpdateInterval.Value; + } } } diff --git a/OverlayPlugin.Core/Overlays/MiniParseConfigPanel.ja-JP.resx b/OverlayPlugin.Core/Overlays/ConfigPanels/MiniParseConfigPanel.ja-JP.resx similarity index 95% rename from OverlayPlugin.Core/Overlays/MiniParseConfigPanel.ja-JP.resx rename to OverlayPlugin.Core/Overlays/ConfigPanels/MiniParseConfigPanel.ja-JP.resx index cb7635ff1..47ede3ec0 100644 --- a/OverlayPlugin.Core/Overlays/MiniParseConfigPanel.ja-JP.resx +++ b/OverlayPlugin.Core/Overlays/ConfigPanels/MiniParseConfigPanel.ja-JP.resx @@ -117,6 +117,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + 最大フレームレート @@ -159,4 +160,10 @@ ホットキータイプ + + 7, 12 + + + データ更新周期 + \ No newline at end of file diff --git a/OverlayPlugin.Core/Overlays/MiniParseConfigPanel.ko-KR.resx b/OverlayPlugin.Core/Overlays/ConfigPanels/MiniParseConfigPanel.ko-KR.resx similarity index 98% rename from OverlayPlugin.Core/Overlays/MiniParseConfigPanel.ko-KR.resx rename to OverlayPlugin.Core/Overlays/ConfigPanels/MiniParseConfigPanel.ko-KR.resx index f5240aedb..2f163342f 100644 --- a/OverlayPlugin.Core/Overlays/MiniParseConfigPanel.ko-KR.resx +++ b/OverlayPlugin.Core/Overlays/ConfigPanels/MiniParseConfigPanel.ko-KR.resx @@ -153,4 +153,7 @@ 위치 잠금 + + 데이터 갱신 주기 + \ No newline at end of file diff --git a/OverlayPlugin.Core/Overlays/MiniParseConfigPanel.resx b/OverlayPlugin.Core/Overlays/ConfigPanels/MiniParseConfigPanel.resx similarity index 81% rename from OverlayPlugin.Core/Overlays/MiniParseConfigPanel.resx rename to OverlayPlugin.Core/Overlays/ConfigPanels/MiniParseConfigPanel.resx index 88dbcda16..f46384433 100644 --- a/OverlayPlugin.Core/Overlays/MiniParseConfigPanel.resx +++ b/OverlayPlugin.Core/Overlays/ConfigPanels/MiniParseConfigPanel.resx @@ -118,933 +118,858 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 4 + + 2 + + + + Fill - - 149, 22 + + 1, 1, 1, 1 - - label6 + + 30 - - MiddleLeft + + nudUpdateInterval - - checkLock + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Fill + + tableLayoutPanel1 - + + 0 + + True - - 15 + + Fill - - MiddleLeft + + NoControl - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 29 - - 8 + + Data update rate - + MiddleLeft - - 2 + + label12 - - NoControl + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 0, 0 + + tableLayoutPanel1 - + + 1 + + True - - tableLayoutPanel1 + + Fill - - tableLayoutPanel1 + + NoControl - - 410, 0 + + 27 - - NoControl + + Hide player name - - 10 + + MiddleLeft - - 3, 3 + + label11 - + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + tableLayoutPanel1 - - 447, 19 + + 3 - - buttonMiniParseSelectFile + + True + + + Fill + + + NoControl + + + 12 Max. framerate - - 2 + + MiddleLeft - - comboHotkeyType + + label6 - + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 3, 44 + + tableLayoutPanel1 - + 4 - - 2 + + True - - tableLayoutPanel1 + + Fill - + + NoControl + + + 10 + + + Sort type + + + MiddleLeft + + + label5 + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + + tableLayoutPanel1 + + 5 - - 22 + + Fill - + + 1, 1, 1, 1 + + + 9 + + + textMiniParseSortKey + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + tableLayoutPanel1 - + + 6 + + + True + + + Fill + + + NoControl + + 8 - - 0 + + Sort key - - 149, 22 + + MiddleLeft - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + label4 - - 3, 110 + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Fill + + tableLayoutPanel1 - - Enable global hotkey + + 7 - + True - - 149, 22 - - - 13 + + Fill - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="textMiniParseUrl" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="buttonMiniParseSelectFile" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,100,Absolute,37" /><Rows Styles="Percent,100" /></TableLayoutSettings> + + NoControl - - 4 + + 0 Enable clickthru - - NoControl - - + MiddleLeft - - Fill + + label2 - - 6 + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - label10 + + tableLayoutPanel1 - - True + + 8 - - MiddleLeft + + True - + Fill - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + NoControl 0 - - Fill - - - Fill + + Show overlay - - 20 + + MiddleLeft - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + label3 - - Copy the update variable to clipboard + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - NoControl + + tableLayoutPanel1 - - 1, 1, 1, 1 + + 9 - - 24 + + True - - 6, 12 + + Fill - + NoControl - - 3 + + 0 - - NoControl + + URL - - tableLayoutPanel1 + + MiddleLeft - - Fill + + label1 - - True + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - panel1 + + tableLayoutPanel1 - - 3, 304 + + 10 - - buttonMiniParseOpenDevTools + + True - - 447, 20 + + Fill - - Sort type + + NoControl - - 193, 45 + + 1 - - True + + checkMiniParseVisible - - 19 + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + + tableLayoutPanel1 + + + 11 + + True - - 0, 0 + + Fill + + + NoControl - - 598, 51 + + 2 - - 1 + + checkMiniParseClickthru - + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + tableLayoutPanel1 - - 158, 25 - - - NoControl + + 12 3 - - 149, 22 - - - 9 + + Fill - - 12 + + NoControl - - tableLayoutPanel1 + + 1 - - buttonMiniParseReloadBrowser + + Copy the update variable to clipboard - - 447, 19 + + buttonMiniParseCopyActXiv - - 21 + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 12 + + tableLayoutPanel3 - - True + + 0 - + Fill - - label5 + + 2 - - 149, 22 + + Open DevTools - - comboMiniParseSortType + + buttonMiniParseOpenDevTools - - label1 + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 1, 1, 1, 1 + + tableLayoutPanel3 - - Fill + + 1 - + Fill - - 3, 88 + + NoControl - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 0 - - 3, 66 + + Reload overlay - - Fill + + buttonMiniParseReloadBrowser - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 0, 0, 0, 1 + + tableLayoutPanel3 - - 1 + + 2 - - tableLayoutPanel1 + + Fill - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 0, 0, 0, 0 1 + + 0 + tableLayoutPanel3 - - tableLayoutPanel3 + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + panel1 - - Fill + + 0 - - 2 + + Fill - - 3 + + 0, 0, 0, 0 - - 0, 0 + + 4 - - 1 + + panel1 - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + tableLayoutPanel1 - - Fill + + 13 - - ... + + 2 - + Fill - - 9 + + 0, 0, 0, 0 - - Reload overlay + + 3 - - Fill + + textMiniParseUrl - - 1, 1, 1, 1 + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 156, 89 + + tableLayoutPanel2 - - $this + + 0 - - MiddleLeft + + Fill - - 1 + + Popup - - tableLayoutPanel1 + + NoControl - - label7 + + 0, 0, 0, 0 - - 19 + + 4 - - 37, 19 + + ... - - 14 + + buttonMiniParseSelectFile System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 193, 45 - - - MiddleLeft - tableLayoutPanel2 - - tableLayoutPanel1 + + 1 - - 23 + + Fill - - label9 - - - tableLayoutPanel1 - - - 0 - - - 0, 0, 0, 0 + + 1, 1, 1, 1 - - 10 + + 1 - - textMiniParseUrl + + 5 - - Fill + + tableLayoutPanel2 - - 2 + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 tableLayoutPanel1 - - 11 - - - tableLayoutPanel1 + + 14 - + Fill - - 21 - - - 3, 198 - - - 7 - - - 149, 22 - - - NoControl - - - label4 + + 1, 1, 1, 1 - - System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 11 - - Fill + + comboMiniParseSortType - - Fill + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + tableLayoutPanel1 - - 158, 3 - - - 410, 19 - - - Lock overlay - - - 443, 16 - - - 2 + + 15 - - 158, 47 + + Fill - + 1, 1, 1, 1 - - tableLayoutPanel2 - - - 149, 22 - - - 20 - - - 3, 0 - - - 0 - - - 3, 22 + + 13 nudMaxFrameRate - - 156, 67 - - - 443, 16 - - - 1 - - - 18 - - - 447, 20 + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 tableLayoutPanel1 - + + 16 + + True - - 604, 358 + + Fill + + + NoControl - - 202, 3 + + 19 - - 443, 16 + + ※You need restarting this plugin to apply framerate and hotkey settings. - - 11 + + label13 System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - MiniParseConfigPanel - - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="buttonMiniParseCopyActXiv" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="buttonMiniParseOpenDevTools" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="buttonMiniParseReloadBrowser" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /></Controls><Columns Styles="Percent,33.33,Percent,33.33,Percent,33.33" /><Rows Styles="Percent,50" /></TableLayoutSettings> - - - 26 - - - NoControl - - - 1, 1, 1, 1 + + tableLayoutPanel1 - - 3, 176 + + 17 - - MiddleLeft + + True - + Fill - + NoControl - - label13 + + 20 - - True + + Enable global hotkey - - checkMiniParseClickthru + + MiddleLeft - + + label7 + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + tableLayoutPanel1 - - System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - label3 - - - 149, 20 - - - True - - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - textGlobalHotkey + + 18 True - + Fill - - System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 3, 154 - - - 604, 358 - - + NoControl - - Fill - - - 1 + + 20 - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="label6" Row="6" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label5" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="textMiniParseSortKey" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label4" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label2" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label3" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label1" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkMiniParseVisible" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="checkMiniParseClickthru" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="panel1" Row="11" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="tableLayoutPanel2" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="comboMiniParseSortType" Row="5" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="nudMaxFrameRate" Row="6" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label13" Row="10" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label7" Row="7" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label8" Row="8" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkEnableGlobalHotkey" Row="7" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="textGlobalHotkey" Row="8" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label9" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkLock" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label10" Row="9" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="comboHotkeyType" Row="9" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Absolute,155,Percent,100" /><Rows Styles="Absolute,22,Absolute,22,Absolute,22,Absolute,22,Absolute,22,Absolute,22,Absolute,22,Absolute,22,Absolute,22,Absolute,20,Percent,100,Absolute,57" /></TableLayoutSettings> + + Global hotkey - - 17 + + MiddleLeft label8 - - Fill - - - tableLayoutPanel3 - - - 149, 22 - - - NoControl + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + tableLayoutPanel1 - - True - - - 0 + + 19 - + Fill - - Hotkey Type - - - 0 - - - 194, 45 + + 21 - - Fill + + checkEnableGlobalHotkey - - URL + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + tableLayoutPanel1 - - 443, 83 + + 20 - - tableLayoutPanel2 + + Fill - - checkMiniParseVisible + + 1, 1, 1, 1 - - tableLayoutPanel1 + + 22 - - tableLayoutPanel1 + + textGlobalHotkey - - buttonMiniParseCopyActXiv + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + tableLayoutPanel1 - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 21 - - 156, 133 + + True - + Fill - - MiddleLeft - - + NoControl - - ※You need restarting this plugin to apply framerate and hotkey settings. + + 23 - - Global hotkey + + Lock overlay - - label2 + + MiddleLeft - - 149, 22 + + label9 - - 25 + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 1 + + tableLayoutPanel1 - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 22 - - 16 + + True - - panel1 + + Fill - + NoControl - - 0 - - - 20 - - - 598, 51 + + 24 - - NoControl + + checkLock - - 0 + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + tableLayoutPanel1 - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 23 - - 401, 3 + + True - - 156, 177 + + Fill - - 447, 19 + + 25 - - 12 + + Hotkey Type - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + MiddleLeft - - Show overlay + + label10 - - 5 + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - tableLayoutPanel3 + + tableLayoutPanel1 - - 447, 20 + + 24 - - Open DevTools + + Fill - - 158, 218 + + 1, 1, 1, 1 - - 156, 111 + + 26 - - 0 + + comboHotkeyType - - MiddleLeft + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 443, 16 + + tableLayoutPanel1 - - Fill + + 25 - - checkEnableGlobalHotkey + + Fill - - NoControl + + 0, 0, 0, 0 - - 158, 157 + + 14 - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 1 - - 0 + + tableLayoutPanel1 - - textMiniParseSortKey + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 156, 199 + + $this - - System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 0 - - 1, 1, 1, 1 + + True + + + 7, 12 - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 0, 0, 0, 0 - - 3, 132 + + MiniParseConfigPanel - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - True + + Microsoft NeoGothic, 9pt - - Sort key + + 640,360 - - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="nudUpdateInterval" Row="7" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label12" Row="7" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label6" Row="6" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label5" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="textMiniParseSortKey" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label4" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label2" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label3" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label1" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkMiniParseVisible" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="checkMiniParseClickthru" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="panel1" Row="13" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="tableLayoutPanel2" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="comboMiniParseSortType" Row="5" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="nudMaxFrameRate" Row="6" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label13" Row="12" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label7" Row="9" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label8" Row="10" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkEnableGlobalHotkey" Row="9" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="textGlobalHotkey" Row="10" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label9" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkLock" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label10" Row="11" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="comboHotkeyType" Row="11" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Absolute,220,Percent,100" /><Rows Styles="Absolute,25,Absolute,25,Absolute,25,Absolute,25,Absolute,25,Absolute,26,Absolute,25,Absolute,25,Absolute,25,Absolute,25,Absolute,25,Percent,100,Absolute,55" /></TableLayoutSettings> - - Fill + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="textMiniParseUrl" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="buttonMiniParseSelectFile" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,100,Absolute,50" /><Rows Styles="Percent,100" /></TableLayoutSettings> - - 13 + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="buttonMiniParseCopyActXiv" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="buttonMiniParseOpenDevTools" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="buttonMiniParseReloadBrowser" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /></Controls><Columns Styles="Percent,33.33,Percent,33.33,Percent,33.33" /><Rows Styles="Percent,50" /></TableLayoutSettings> - - True - - - ja-JP - \ No newline at end of file diff --git a/OverlayPlugin.Core/Overlays/SpellTimerConfigPanel.Designer.cs b/OverlayPlugin.Core/Overlays/ConfigPanels/SpellTimerConfigPanel.Designer.cs similarity index 99% rename from OverlayPlugin.Core/Overlays/SpellTimerConfigPanel.Designer.cs rename to OverlayPlugin.Core/Overlays/ConfigPanels/SpellTimerConfigPanel.Designer.cs index 0d09b2ef9..177c14580 100644 --- a/OverlayPlugin.Core/Overlays/SpellTimerConfigPanel.Designer.cs +++ b/OverlayPlugin.Core/Overlays/ConfigPanels/SpellTimerConfigPanel.Designer.cs @@ -244,13 +244,14 @@ private void InitializeComponent() // comboHotkeyType // resources.ApplyResources(this.comboHotkeyType, "comboHotkeyType"); + this.comboHotkeyType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboHotkeyType.FormattingEnabled = true; this.comboHotkeyType.Name = "comboHotkeyType"; // // SpellTimerConfigPanel // resources.ApplyResources(this, "$this"); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; this.BackColor = System.Drawing.Color.Transparent; this.Controls.Add(this.tableLayoutPanel4); this.Name = "SpellTimerConfigPanel"; diff --git a/OverlayPlugin.Core/Overlays/SpellTimerConfigPanel.cs b/OverlayPlugin.Core/Overlays/ConfigPanels/SpellTimerConfigPanel.cs similarity index 88% rename from OverlayPlugin.Core/Overlays/SpellTimerConfigPanel.cs rename to OverlayPlugin.Core/Overlays/ConfigPanels/SpellTimerConfigPanel.cs index 5d4cdd7af..06265d06a 100644 --- a/OverlayPlugin.Core/Overlays/SpellTimerConfigPanel.cs +++ b/OverlayPlugin.Core/Overlays/ConfigPanels/SpellTimerConfigPanel.cs @@ -19,7 +19,8 @@ public partial class SpellTimerConfigPanel : UserControl { new KeyValuePair(Localization.GetText(TextItem.ToggleVisible), GlobalHotkeyType.ToggleVisible), new KeyValuePair(Localization.GetText(TextItem.ToggleClickthru), GlobalHotkeyType.ToggleClickthru), - new KeyValuePair(Localization.GetText(TextItem.ToggleLock), GlobalHotkeyType.ToggleLock) + new KeyValuePair(Localization.GetText(TextItem.ToggleLock), GlobalHotkeyType.ToggleLock), + new KeyValuePair(Localization.GetText(TextItem.Screenshot), GlobalHotkeyType.Screenshot) }; public SpellTimerConfigPanel(SpellTimerOverlay overlay) @@ -60,35 +61,35 @@ private void SetupConfigEventHandlers() { this.config.VisibleChanged += (o, e) => { - this.InvokeIfRequired(() => + Invoke((MethodInvoker)delegate { this.checkBoxVisible.Checked = e.IsVisible; }); }; this.config.ClickThruChanged += (o, e) => { - this.InvokeIfRequired(() => + Invoke((MethodInvoker)delegate { this.checkBoxClickThru.Checked = e.IsClickThru; }); }; this.config.UrlChanged += (o, e) => { - this.InvokeIfRequired(() => + Invoke((MethodInvoker)delegate { this.textBoxUrl.Text = e.NewUrl; }); }; this.config.MaxFrameRateChanged += (o, e) => { - this.InvokeIfRequired(() => + Invoke((MethodInvoker)delegate { this.nudMaxFrameRate.Value = e.NewFrameRate; }); }; this.config.GlobalHotkeyEnabledChanged += (o, e) => { - this.InvokeIfRequired(() => + Invoke((MethodInvoker)delegate { this.checkEnableGlobalHotkey.Checked = e.NewGlobalHotkeyEnabled; this.textGlobalHotkey.Enabled = this.checkEnableGlobalHotkey.Checked; @@ -96,46 +97,36 @@ private void SetupConfigEventHandlers() }; this.config.GlobalHotkeyChanged += (o, e) => { - this.InvokeIfRequired(() => + Invoke((MethodInvoker)delegate { this.textGlobalHotkey.Text = Util.GetHotkeyString(this.config.GlobalHotkeyModifiers, e.NewHotkey); }); }; this.config.GlobalHotkeyModifiersChanged += (o, e) => { - this.InvokeIfRequired(() => + Invoke((MethodInvoker)delegate { this.textGlobalHotkey.Text = Util.GetHotkeyString(e.NewHotkey, this.config.GlobalHotkey); }); }; this.config.LockChanged += (o, e) => { - this.InvokeIfRequired(() => + Invoke((MethodInvoker)delegate { this.checkLock.Checked = e.IsLocked; }); }; } - - private void InvokeIfRequired(Action action) - { - if (this.InvokeRequired) - { - this.Invoke(action); - } - else - { - action(); - } - } - + private void checkBoxVisible_CheckedChanged(object sender, EventArgs e) { + if (this.config.Url == "") return; this.config.IsVisible = this.checkBoxVisible.Checked; } private void checkBoxClickThru_CheckedChanged(object sender, EventArgs e) { + if (this.config.Url == "") return; this.config.IsClickThru = this.checkBoxClickThru.Checked; } @@ -170,13 +161,13 @@ private void buttonCopyVariable_Click(object sender, EventArgs e) private void buttonOpenDevTools_Click(object sender, EventArgs e) { - this.overlay.Overlay.Renderer.showDevTools(); + this.overlay.Overlay.Renderer.ShowDevTools(); } private void buttonOpenDevTools_RClick(object sender, System.Windows.Forms.MouseEventArgs e) { if (e.Button == MouseButtons.Right) - this.overlay.Overlay.Renderer.showDevTools(false); + this.overlay.Overlay.Renderer.ShowDevTools(false); } private void buttonSpellTimerReloadBrowser_Click(object sender, EventArgs e) @@ -205,6 +196,7 @@ private void textGlobalHotkey_KeyDown(object sender, KeyEventArgs e) private void checkLock_CheckedChanged(object sender, EventArgs e) { + if (this.config.Url == "") return; this.config.IsLocked = this.checkLock.Checked; } } diff --git a/OverlayPlugin.Core/Overlays/SpellTimerConfigPanel.ja-JP.resx b/OverlayPlugin.Core/Overlays/ConfigPanels/SpellTimerConfigPanel.ja-JP.resx similarity index 100% rename from OverlayPlugin.Core/Overlays/SpellTimerConfigPanel.ja-JP.resx rename to OverlayPlugin.Core/Overlays/ConfigPanels/SpellTimerConfigPanel.ja-JP.resx diff --git a/OverlayPlugin.Core/Overlays/SpellTimerConfigPanel.ko-KR.resx b/OverlayPlugin.Core/Overlays/ConfigPanels/SpellTimerConfigPanel.ko-KR.resx similarity index 100% rename from OverlayPlugin.Core/Overlays/SpellTimerConfigPanel.ko-KR.resx rename to OverlayPlugin.Core/Overlays/ConfigPanels/SpellTimerConfigPanel.ko-KR.resx diff --git a/OverlayPlugin.Core/Overlays/SpellTimerConfigPanel.resx b/OverlayPlugin.Core/Overlays/ConfigPanels/SpellTimerConfigPanel.resx similarity index 85% rename from OverlayPlugin.Core/Overlays/SpellTimerConfigPanel.resx rename to OverlayPlugin.Core/Overlays/ConfigPanels/SpellTimerConfigPanel.resx index 4b3b5870e..320eb7070 100644 --- a/OverlayPlugin.Core/Overlays/SpellTimerConfigPanel.resx +++ b/OverlayPlugin.Core/Overlays/ConfigPanels/SpellTimerConfigPanel.resx @@ -132,12 +132,6 @@ NoControl - - 3, 88 - - - 149, 22 - 14 @@ -162,15 +156,9 @@ Fill - - 156, 89 - 1, 1, 1, 1 - - 461, 19 - 15 @@ -195,12 +183,6 @@ NoControl - - 3, 22 - - - 149, 22 - 0 @@ -231,12 +213,6 @@ NoControl - - 3, 0 - - - 149, 22 - 0 @@ -267,12 +243,6 @@ NoControl - - 3, 66 - - - 149, 22 - 0 @@ -303,12 +273,6 @@ NoControl - - 158, 3 - - - 457, 16 - 1 @@ -333,12 +297,6 @@ NoControl - - 158, 25 - - - 457, 16 - 2 @@ -363,12 +321,6 @@ NoControl - - 3, 3 - - - 198, 45 - 1 @@ -390,12 +342,6 @@ Fill - - 207, 3 - - - 198, 45 - 2 @@ -420,12 +366,6 @@ NoControl - - 411, 3 - - - 198, 45 - 0 @@ -447,15 +387,12 @@ Fill - - 0, 0 + + 0, 0, 0, 0 1 - - 612, 51 - 0 @@ -471,17 +408,11 @@ 0 - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="buttonCopyVariable" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="buttonOpenDevTools" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="buttonReloadBrowser" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /></Controls><Columns Styles="Percent,33.33,Percent,33.33,Percent,33.33" /><Rows Styles="Percent,50" /></TableLayoutSettings> - Fill - - 3, 358 - - - 612, 51 + + 0, 0, 0, 0 4 @@ -504,15 +435,9 @@ Fill - - 0, 0 - 0, 0, 0, 0 - - 424, 19 - 3 @@ -528,17 +453,14 @@ 0 + + Popup + NoControl - - 424, 0 - - 0, 0, 0, 1 - - - 37, 19 + 0, 0, 0, 0 4 @@ -561,18 +483,12 @@ Fill - - 156, 67 - 1, 1, 1, 1 1 - - 461, 20 - 5 @@ -588,9 +504,6 @@ 8 - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="textBoxUrl" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="buttonSpellTimerSelectFile" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,100,Absolute,37" /><Rows Styles="Percent,100,Absolute,20" /></TableLayoutSettings> - True @@ -600,12 +513,6 @@ NoControl - - 158, 174 - - - 457, 181 - 17 @@ -633,12 +540,6 @@ NoControl - - 3, 110 - - - 149, 22 - 21 @@ -669,12 +570,6 @@ NoControl - - 3, 132 - - - 149, 22 - 21 @@ -699,15 +594,9 @@ Fill - - 156, 133 - 1, 1, 1, 1 - - 461, 19 - 22 @@ -726,12 +615,6 @@ Fill - - 158, 113 - - - 457, 16 - 23 @@ -756,12 +639,6 @@ NoControl - - 3, 44 - - - 149, 22 - 24 @@ -792,12 +669,6 @@ NoControl - - 158, 47 - - - 457, 16 - 25 @@ -819,12 +690,6 @@ Fill - - 3, 154 - - - 149, 20 - 26 @@ -849,15 +714,9 @@ Fill - - 156, 155 - 1, 1, 1, 1 - - 461, 20 - 27 @@ -876,15 +735,12 @@ Fill - - 0, 0 + + 0, 0, 0, 0 10 - - 618, 412 - 2 @@ -900,17 +756,14 @@ 0 - - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="label7" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="nudMaxFrameRate" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label8" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label9" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label10" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkBoxVisible" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="checkBoxClickThru" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="panel2" Row="9" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="tableLayoutPanel6" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label12" Row="8" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label1" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label2" Row="6" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="textGlobalHotkey" Row="6" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="checkEnableGlobalHotkey" Row="5" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label3" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkLock" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label4" Row="7" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="comboHotkeyType" Row="7" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Absolute,155,Percent,100" /><Rows Styles="Absolute,22,Absolute,22,Absolute,22,Absolute,22,Absolute,22,Absolute,22,Absolute,22,Absolute,20,Percent,100,Absolute,57" /></TableLayoutSettings> - True - 6, 12 + 7, 12 - - 618, 412 + + 0, 0, 0, 0 SpellTimerConfigPanel @@ -918,4 +771,22 @@ System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Microsoft NeoGothic, 9pt + + + 640,360 + + + 0, 10, 0, 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="label7" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="nudMaxFrameRate" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label8" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label9" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label10" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkBoxVisible" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="checkBoxClickThru" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="panel2" Row="9" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="tableLayoutPanel6" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label12" Row="8" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label1" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label2" Row="6" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="textGlobalHotkey" Row="6" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="checkEnableGlobalHotkey" Row="5" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label3" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="checkLock" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label4" Row="7" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="comboHotkeyType" Row="7" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Absolute,220,Percent,100" /><Rows Styles="Absolute,25,Absolute,25,Absolute,25,Absolute,25,Absolute,25,Absolute,25,Absolute,25,Absolute,20,Percent,100,Absolute,55" /></TableLayoutSettings> + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="textBoxUrl" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="buttonSpellTimerSelectFile" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,100,Absolute,50" /><Rows Styles="Percent,100,Absolute,20" /></TableLayoutSettings> + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="buttonCopyVariable" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="buttonOpenDevTools" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="buttonReloadBrowser" Row="0" RowSpan="1" Column="2" ColumnSpan="1" /></Controls><Columns Styles="Percent,33.33,Percent,33.33,Percent,33.33" /><Rows Styles="Percent,50" /></TableLayoutSettings> + \ No newline at end of file diff --git a/OverlayPlugin.Core/Overlays/LabelOverlay.cs b/OverlayPlugin.Core/Overlays/LabelOverlay/LabelOverlay.cs similarity index 81% rename from OverlayPlugin.Core/Overlays/LabelOverlay.cs rename to OverlayPlugin.Core/Overlays/LabelOverlay/LabelOverlay.cs index 3227373e2..2fde9b5fe 100644 --- a/OverlayPlugin.Core/Overlays/LabelOverlay.cs +++ b/OverlayPlugin.Core/Overlays/LabelOverlay/LabelOverlay.cs @@ -15,21 +15,19 @@ public LabelOverlay(LabelOverlayConfig config) { timer.Stop(); - config.TextChanged += (o, e) => - { - UpdateOverlayText(); - }; - config.HTMLModeChanged += (o, e) => + try { - UpdateOverlayText(); - }; - this.Overlay.Renderer.BrowserLoad += (o, e) => + config.TextChanged += UpdateOverlayText; + config.HTMLModeChanged += UpdateOverlayText; + this.Overlay.Renderer.BrowserLoad += UpdateOverlayText; + } + catch(Exception ex) { - UpdateOverlayText(); - }; + Log(LogLevel.Error, "Update: {1}", this.Name, ex); + } } - private void UpdateOverlayText() + private void UpdateOverlayText(object o, EventArgs e) { try { diff --git a/OverlayPlugin.Core/Overlays/LabelOverlayAddon.cs b/OverlayPlugin.Core/Overlays/LabelOverlay/LabelOverlayAddon.cs similarity index 92% rename from OverlayPlugin.Core/Overlays/LabelOverlayAddon.cs rename to OverlayPlugin.Core/Overlays/LabelOverlay/LabelOverlayAddon.cs index ea81f3f7f..6dc741f9d 100644 --- a/OverlayPlugin.Core/Overlays/LabelOverlayAddon.cs +++ b/OverlayPlugin.Core/Overlays/LabelOverlay/LabelOverlayAddon.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace RainbowMage.OverlayPlugin.Overlays { diff --git a/OverlayPlugin.Core/Overlays/LabelOverlayConfig.cs b/OverlayPlugin.Core/Overlays/LabelOverlay/LabelOverlayConfig.cs similarity index 68% rename from OverlayPlugin.Core/Overlays/LabelOverlayConfig.cs rename to OverlayPlugin.Core/Overlays/LabelOverlay/LabelOverlayConfig.cs index e5b6b120e..cb381de2e 100644 --- a/OverlayPlugin.Core/Overlays/LabelOverlayConfig.cs +++ b/OverlayPlugin.Core/Overlays/LabelOverlay/LabelOverlayConfig.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Xml.Serialization; namespace RainbowMage.OverlayPlugin.Overlays @@ -23,10 +19,7 @@ public string Text if (this.text != value) { this.text = value; - if (TextChanged != null) - { - TextChanged(this, new TextChangedEventArgs(this.text)); - } + TextChanged?.Invoke(this, new TextChangedEventArgs(this.text)); } } } @@ -44,10 +37,7 @@ public bool HtmlModeEnabled if (this.htmlModeEnabled != value) { this.htmlModeEnabled = value; - if (HTMLModeChanged != null) - { - HTMLModeChanged(this, new StateChangedEventArgs(this.htmlModeEnabled)); - } + HTMLModeChanged?.Invoke(this, new StateChangedEventArgs(this.htmlModeEnabled)); } } } @@ -74,13 +64,4 @@ public override Type OverlayType get { return typeof(LabelOverlay); } } } - - public class TextChangedEventArgs : EventArgs - { - public string Text { get; private set; } - public TextChangedEventArgs(string text) - { - this.Text = text; - } - } } diff --git a/OverlayPlugin.Core/Overlays/LabelOverlay/TextChangedEventArgs.cs b/OverlayPlugin.Core/Overlays/LabelOverlay/TextChangedEventArgs.cs new file mode 100644 index 000000000..de91d2956 --- /dev/null +++ b/OverlayPlugin.Core/Overlays/LabelOverlay/TextChangedEventArgs.cs @@ -0,0 +1,13 @@ +using System; + +namespace RainbowMage.OverlayPlugin.Overlays +{ + public class TextChangedEventArgs : EventArgs + { + public string Text { get; private set; } + public TextChangedEventArgs(string text) + { + this.Text = text; + } + } +} diff --git a/OverlayPlugin.Core/Overlays/LogParseLoglineReader.cs b/OverlayPlugin.Core/Overlays/LogParseOverlay/LogParseLoglineReader.cs similarity index 50% rename from OverlayPlugin.Core/Overlays/LogParseLoglineReader.cs rename to OverlayPlugin.Core/Overlays/LogParseOverlay/LogParseLoglineReader.cs index 03ed8de21..a2ec0114a 100644 --- a/OverlayPlugin.Core/Overlays/LogParseLoglineReader.cs +++ b/OverlayPlugin.Core/Overlays/LogParseOverlay/LogParseLoglineReader.cs @@ -1,81 +1,41 @@ -using Advanced_Combat_Tracker; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Newtonsoft.Json.Linq; - -namespace RainbowMage.OverlayPlugin.Overlays -{ - partial class LogParseOverlay : OverlayBase - { - // Part of ACTWebSocket - // Copyright (c) 2016 ZCube; Licensed under MIT license. - public enum MessageType - { - Unknown = -1, - LogLine = 0, - ChangeZone = 1, - ChangePrimaryPlayer = 2, - AddCombatant = 3, - RemoveCombatant = 4, - AddBuff = 5, - RemoveBuff = 6, - FlyingText = 7, - OutgoingAbility = 8, - IncomingAbility = 10, - PartyList = 11, - PlayerStats = 12, - CombatantHP = 13, - NetworkStartsCasting = 20, - NetworkAbility = 21, - NetworkAOEAbility = 22, - NetworkCancelAbility = 23, - NetworkDoT = 24, - NetworkDeath = 25, - NetworkBuff = 26, - NetworkTargetIcon = 27, - NetworkRaidMarker = 28, - NetworkTargetMarker = 29, - NetworkBuffRemove = 30, - Debug = 251, - PacketDump = 252, - Version = 253, - Error = 254, - Timer = 255 - } - - private void LogLineReader(bool isImported, LogLineEventArgs e) - { - if (isImported) - { - return; - } - try - { - string[] chunk = e.logLine.Split(new[] { '|' }); - - if (chunk.Length < 3) // DataErr0r - { - return; - } - - if (this.Overlay != null && - this.Overlay.Renderer != null && - this.Overlay.Renderer.Browser != null) - { - JObject message = new JObject(); - message["opcode"] = Convert.ToInt32(chunk[0]); - message["timestamp"] = chunk[1]; - message["payload"] = JArray.FromObject(chunk.Skip(2)); - this.Overlay.Renderer.ExecuteScript( - "document.dispatchEvent(new CustomEvent('onLogLine', { detail: " + message.ToString() + " } ));" - ); - } - } - catch { } - } - - } -} +using Advanced_Combat_Tracker; +using Newtonsoft.Json.Linq; +using System; +using System.Linq; + +namespace RainbowMage.OverlayPlugin.Overlays +{ + partial class LogParseOverlay : OverlayBase + { + private void LogLineReader(bool isImported, LogLineEventArgs e) + { + if (isImported) + { + return; + } + try + { + string[] chunk = e.logLine.Split(new[] { '|' }); + + if (chunk.Length < 3) // DataErr0r + { + return; + } + + if (this.Overlay != null && + this.Overlay.Renderer != null && + this.Overlay.Renderer.Browser != null) + { + JObject message = new JObject(); + message["opcode"] = Convert.ToInt32(chunk[0]); + message["timestamp"] = chunk[1]; + message["payload"] = JArray.FromObject(chunk.Skip(2)); + this.Overlay.Renderer.ExecuteScript( + "document.dispatchEvent(new CustomEvent('onLogLine', { detail: " + message.ToString() + " } ));" + ); + } + } + catch { } + } + } +} diff --git a/OverlayPlugin.Core/Overlays/LogParseOverlay.cs b/OverlayPlugin.Core/Overlays/LogParseOverlay/LogParseOverlay.cs similarity index 91% rename from OverlayPlugin.Core/Overlays/LogParseOverlay.cs rename to OverlayPlugin.Core/Overlays/LogParseOverlay/LogParseOverlay.cs index a869dada4..f7853942d 100644 --- a/OverlayPlugin.Core/Overlays/LogParseOverlay.cs +++ b/OverlayPlugin.Core/Overlays/LogParseOverlay/LogParseOverlay.cs @@ -1,23 +1,19 @@ using Advanced_Combat_Tracker; +using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.Diagnostics; -using System.IO; using System.Linq; using System.Reflection; -using System.Text; using System.Threading.Tasks; -using System.Windows.Forms; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; namespace RainbowMage.OverlayPlugin.Overlays { public partial class LogParseOverlay : OverlayBase { - private string prevEncounterId { get; set; } - private DateTime prevEndDateTime { get; set; } - private bool prevEncounterActive { get; set; } + private string PrevEncounterId { get; set; } + private DateTime PrevEndDateTime { get; set; } + private bool PrevEncounterActive { get; set; } private static string updateStringCache = ""; private static DateTime updateStringCacheLastUpdate; @@ -38,9 +34,7 @@ public LogParseOverlay(LogParseOverlayConfig config) BindingFlags.Public | BindingFlags.Static); - var beforeLogLineReadDelegate = - fi.GetValue(ActGlobals.oFormActMain) - as Delegate; + var beforeLogLineReadDelegate = (Delegate)fi.GetValue(ActGlobals.oFormActMain); if (beforeLogLineReadDelegate != null) { @@ -72,8 +66,8 @@ public override void Navigate(string url) { base.Navigate(url); - this.prevEncounterId = null; - this.prevEndDateTime = DateTime.MinValue; + this.PrevEncounterId = null; + this.PrevEndDateTime = DateTime.MinValue; } protected override void Update() @@ -81,16 +75,16 @@ protected override void Update() if (CheckIsActReady()) { // 最終更新時刻に変化がないなら更新を行わない - if (this.prevEncounterId == ActGlobals.oFormActMain.ActiveZone.ActiveEncounter.EncId && - this.prevEndDateTime == ActGlobals.oFormActMain.ActiveZone.ActiveEncounter.EndTime && - this.prevEncounterActive == ActGlobals.oFormActMain.ActiveZone.ActiveEncounter.Active) + if (this.PrevEncounterId == ActGlobals.oFormActMain.ActiveZone.ActiveEncounter.EncId && + this.PrevEndDateTime == ActGlobals.oFormActMain.ActiveZone.ActiveEncounter.EndTime && + this.PrevEncounterActive == ActGlobals.oFormActMain.ActiveZone.ActiveEncounter.Active) { return; } - this.prevEncounterId = ActGlobals.oFormActMain.ActiveZone.ActiveEncounter.EncId; - this.prevEndDateTime = ActGlobals.oFormActMain.ActiveZone.ActiveEncounter.EndTime; - this.prevEncounterActive = ActGlobals.oFormActMain.ActiveZone.ActiveEncounter.Active; + this.PrevEncounterId = ActGlobals.oFormActMain.ActiveZone.ActiveEncounter.EncId; + this.PrevEndDateTime = ActGlobals.oFormActMain.ActiveZone.ActiveEncounter.EndTime; + this.PrevEncounterActive = ActGlobals.oFormActMain.ActiveZone.ActiveEncounter.Active; var updateScript = CreateEventDispatcherScript(); @@ -102,7 +96,7 @@ protected override void Update() } } } - + private string CreateEventDispatcherScript() { return "document.dispatchEvent(new CustomEvent('onOverlayDataUpdate', { detail: " + this.CreateJsonData() + " }));"; @@ -139,14 +133,14 @@ internal string CreateJsonData() }); Task.WaitAll(encounterTask, combatantTask); - JObject obj = new JObject(); + var obj = new JObject(); obj["Encounter"] = JObject.FromObject(encounter); obj["Combatant"] = new JObject(); foreach (var pair in combatant) { - JObject value = new JObject(); + var value = new JObject(); foreach (var pair2 in pair.Value) { value.Add(pair2.Key, Util.ReplaceNaNString(pair2.Value, "---")); diff --git a/OverlayPlugin.Core/Overlays/LogParseOverlayAddon.cs b/OverlayPlugin.Core/Overlays/LogParseOverlay/LogParseOverlayAddon.cs similarity index 92% rename from OverlayPlugin.Core/Overlays/LogParseOverlayAddon.cs rename to OverlayPlugin.Core/Overlays/LogParseOverlay/LogParseOverlayAddon.cs index bd429c18d..dd6e8ac11 100644 --- a/OverlayPlugin.Core/Overlays/LogParseOverlayAddon.cs +++ b/OverlayPlugin.Core/Overlays/LogParseOverlay/LogParseOverlayAddon.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace RainbowMage.OverlayPlugin.Overlays { diff --git a/OverlayPlugin.Core/Overlays/LogParseOverlay/LogParseOverlayConfig.cs b/OverlayPlugin.Core/Overlays/LogParseOverlay/LogParseOverlayConfig.cs new file mode 100644 index 000000000..96240f6bd --- /dev/null +++ b/OverlayPlugin.Core/Overlays/LogParseOverlay/LogParseOverlayConfig.cs @@ -0,0 +1,24 @@ +using System; + +namespace RainbowMage.OverlayPlugin.Overlays +{ + [Serializable] + public class LogParseOverlayConfig : OverlayConfigBase + { + public LogParseOverlayConfig(string name) : base(name) + { + + } + + // XmlSerializer用 + private LogParseOverlayConfig() : base(null) + { + + } + + public override Type OverlayType + { + get { return typeof(LogParseOverlay); } + } + } +} diff --git a/OverlayPlugin.Core/Overlays/LogParseOverlayConfig.cs b/OverlayPlugin.Core/Overlays/LogParseOverlayConfig.cs deleted file mode 100644 index a1d85e591..000000000 --- a/OverlayPlugin.Core/Overlays/LogParseOverlayConfig.cs +++ /dev/null @@ -1,86 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Serialization; - -namespace RainbowMage.OverlayPlugin.Overlays -{ - [Serializable] - public class LogParseOverlayConfig : OverlayConfigBase - { - /* - public event EventHandler SortKeyChanged; - public event EventHandler SortTypeChanged; - - private string sortKey; - [XmlElement("SortKey")] - public string SortKey - { - get - { - return this.sortKey; - } - set - { - if (this.sortKey != value) - { - this.sortKey = value; - if (SortKeyChanged != null) - { - SortKeyChanged(this, new SortKeyChangedEventArgs(this.sortKey)); - } - } - } - } - - private LogParseSortType sortType; - [XmlElement("SortType")] - public LogParseSortType SortType - { - get - { - return this.sortType; - } - set - { - if (this.sortType != value) - { - this.sortType = value; - if (SortTypeChanged != null) - { - SortTypeChanged(this, new SortTypeChangedEventArgs(this.sortType)); - } - } - } - } - */ - public LogParseOverlayConfig(string name) : base(name) - { - // this.sortKey = "encdps"; - // this.sortType = LogParseSortType.NumericDescending; - } - - // XmlSerializer用 - private LogParseOverlayConfig() : base(null) - { - - } - - public override Type OverlayType - { - get { return typeof(LogParseOverlay); } - } - } - /* - public enum LogParseSortType - { - None, - StringAscending, - StringDescending, - NumericAscending, - NumericDescending - } - */ -} diff --git a/OverlayPlugin.Core/Overlays/MiniParseLoglineReader.cs b/OverlayPlugin.Core/Overlays/MiniParseOverlay/MiniParseLoglineReader.cs similarity index 58% rename from OverlayPlugin.Core/Overlays/MiniParseLoglineReader.cs rename to OverlayPlugin.Core/Overlays/MiniParseOverlay/MiniParseLoglineReader.cs index ed65d3905..151ed5365 100644 --- a/OverlayPlugin.Core/Overlays/MiniParseLoglineReader.cs +++ b/OverlayPlugin.Core/Overlays/MiniParseOverlay/MiniParseLoglineReader.cs @@ -1,50 +1,11 @@ using Advanced_Combat_Tracker; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Newtonsoft.Json.Linq; +using System; namespace RainbowMage.OverlayPlugin.Overlays { partial class MiniParseOverlay : OverlayBase - { - // Part of ACTWebSocket - // Copyright (c) 2016 ZCube; Licensed under MIT license. - public enum MessageType - { - LogLine = 0, - ChangeZone = 1, - ChangePrimaryPlayer = 2, - AddCombatant = 3, - RemoveCombatant = 4, - AddBuff = 5, - RemoveBuff = 6, - FlyingText = 7, - OutgoingAbility = 8, - IncomingAbility = 10, - PartyList = 11, - PlayerStats = 12, - CombatantHP = 13, - NetworkStartsCasting = 20, - NetworkAbility = 21, - NetworkAOEAbility = 22, - NetworkCancelAbility = 23, - NetworkDoT = 24, - NetworkDeath = 25, - NetworkBuff = 26, - NetworkTargetIcon = 27, - NetworkRaidMarker = 28, - NetworkTargetMarker = 29, - NetworkBuffRemove = 30, - Debug = 251, - PacketDump = 252, - Version = 253, - Error = 254, - Timer = 255 - } - + { private void LogLineReader(bool isImported, LogLineEventArgs e) { string[] d = e.logLine.Split('|'); diff --git a/OverlayPlugin.Core/Overlays/MiniParseOverlay.cs b/OverlayPlugin.Core/Overlays/MiniParseOverlay/MiniParseOverlay.cs similarity index 88% rename from OverlayPlugin.Core/Overlays/MiniParseOverlay.cs rename to OverlayPlugin.Core/Overlays/MiniParseOverlay/MiniParseOverlay.cs index f856e630c..bd3297b11 100644 --- a/OverlayPlugin.Core/Overlays/MiniParseOverlay.cs +++ b/OverlayPlugin.Core/Overlays/MiniParseOverlay/MiniParseOverlay.cs @@ -1,14 +1,12 @@ using Advanced_Combat_Tracker; +using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.Diagnostics; -using System.IO; using System.Linq; -using System.Text; +using System.Text.RegularExpressions; +using System.Threading; using System.Threading.Tasks; -using System.Windows.Forms; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; namespace RainbowMage.OverlayPlugin.Overlays { @@ -18,14 +16,20 @@ public partial class MiniParseOverlay : OverlayBase private DateTime prevEndDateTime { get; set; } private bool prevEncounterActive { get; set; } - private static string updateStringCache = ""; - private static DateTime updateStringCacheLastUpdate; - private static readonly TimeSpan updateStringCacheExpireInterval = new TimeSpan(0, 0, 0, 0, 500); // 500 msec + private string updateStringCache = ""; + private DateTime updateStringCacheLastUpdate; + private TimeSpan updateStringCacheExpireInterval = new TimeSpan(0, 0, 0, 0, 500); // 500 msec + public TimeSpan UpdateStringCacheExpireInterval + { + get { return updateStringCacheExpireInterval; } + set { updateStringCacheExpireInterval = value; } + } public MiniParseOverlay(MiniParseOverlayConfig config) : base(config, config.Name) { ActGlobals.oFormActMain.BeforeLogLineRead += LogLineReader; + ActGlobals.oFormActMain.OnCombatStart += this.OFormActMain_OnCombatStart; } public override void Navigate(string url) @@ -36,7 +40,23 @@ public override void Navigate(string url) this.prevEndDateTime = DateTime.MinValue; } + private readonly object updateSync = new object(); protected override void Update() + { + if (!Monitor.TryEnter(updateSync, 0)) + return; + + try + { + UpdateWorker(); + } + finally + { + Monitor.Exit(updateSync); + } + } + + private void UpdateWorker() { if (CheckIsActReady()) { @@ -62,12 +82,20 @@ protected override void Update() } } } - + private string CreateEventDispatcherScript() { return "document.dispatchEvent(new CustomEvent('onOverlayDataUpdate', { detail: " + this.CreateJsonData() + " }));"; } + private readonly Dictionary tempPlayerNameDictionary = new Dictionary(); + + private void OFormActMain_OnCombatStart(bool isImport, CombatToggleEventArgs encounterInfo) + { + lock (this.tempPlayerNameDictionary) + this.tempPlayerNameDictionary.Clear(); + } + internal string CreateJsonData() { if (DateTime.Now - updateStringCacheLastUpdate < updateStringCacheExpireInterval) @@ -85,6 +113,7 @@ internal string CreateJsonData() stopwatch.Start(); #endif + var allies = ActGlobals.oFormActMain.ActiveZone.ActiveEncounter.GetAllies(); Dictionary encounter = null; List>> combatant = null; @@ -107,13 +136,18 @@ internal string CreateJsonData() foreach (var pair in combatant) { + var combatantName = pair.Key.Name; + JObject value = new JObject(); foreach (var pair2 in pair.Value) { - value.Add(pair2.Key, Util.ReplaceNaNString(pair2.Value, "---")); + var k = pair2.Key; + var v = pair2.Value; + + value.Add(k, Util.ReplaceNaNString(v, "---")); } - obj["Combatant"][pair.Key.Name] = value; + obj["Combatant"][combatantName] = value; } obj["isActive"] = ActGlobals.oFormActMain.ActiveZone.ActiveEncounter.Active ? "true" : "false"; diff --git a/OverlayPlugin.Core/Overlays/MiniParseOverlayAddon.cs b/OverlayPlugin.Core/Overlays/MiniParseOverlay/MiniParseOverlayAddon.cs similarity index 92% rename from OverlayPlugin.Core/Overlays/MiniParseOverlayAddon.cs rename to OverlayPlugin.Core/Overlays/MiniParseOverlay/MiniParseOverlayAddon.cs index cbdc0884f..25f0a4aba 100644 --- a/OverlayPlugin.Core/Overlays/MiniParseOverlayAddon.cs +++ b/OverlayPlugin.Core/Overlays/MiniParseOverlay/MiniParseOverlayAddon.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace RainbowMage.OverlayPlugin.Overlays { diff --git a/OverlayPlugin.Core/Overlays/MiniParseOverlayConfig.cs b/OverlayPlugin.Core/Overlays/MiniParseOverlay/MiniParseOverlayConfig.cs similarity index 61% rename from OverlayPlugin.Core/Overlays/MiniParseOverlayConfig.cs rename to OverlayPlugin.Core/Overlays/MiniParseOverlay/MiniParseOverlayConfig.cs index 071a0caba..cea6444dd 100644 --- a/OverlayPlugin.Core/Overlays/MiniParseOverlayConfig.cs +++ b/OverlayPlugin.Core/Overlays/MiniParseOverlay/MiniParseOverlayConfig.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Xml.Serialization; namespace RainbowMage.OverlayPlugin.Overlays @@ -12,6 +8,8 @@ public class MiniParseOverlayConfig : OverlayConfigBase { public event EventHandler SortKeyChanged; public event EventHandler SortTypeChanged; + public event EventHandler HidePlayerNameChanged; + public event EventHandler OverlayUpdateIntervalChanged; private string sortKey; [XmlElement("SortKey")] @@ -26,10 +24,7 @@ public string SortKey if (this.sortKey != value) { this.sortKey = value; - if (SortKeyChanged != null) - { - SortKeyChanged(this, new SortKeyChangedEventArgs(this.sortKey)); - } + SortKeyChanged?.Invoke(this, new SortKeyChangedEventArgs(this.sortKey)); } } } @@ -47,9 +42,27 @@ public MiniParseSortType SortType if (this.sortType != value) { this.sortType = value; - if (SortTypeChanged != null) + SortTypeChanged?.Invoke(this, new SortTypeChangedEventArgs(this.sortType)); + } + } + } + + private int overlayUpdateInterval = 1000; + [XmlElement("OverlayUpdateInterval")] + public int OverlayUpdateInterval + { + get + { + return this.overlayUpdateInterval; + } + set + { + if (this.overlayUpdateInterval != value) + { + this.overlayUpdateInterval = value; + if (HidePlayerNameChanged != null) { - SortTypeChanged(this, new SortTypeChangedEventArgs(this.sortType)); + OverlayUpdateIntervalChanged(this, new UpdateIntervalChangedEventArgs(value)); } } } @@ -72,13 +85,4 @@ public override Type OverlayType get { return typeof(MiniParseOverlay); } } } - - public enum MiniParseSortType - { - None, - StringAscending, - StringDescending, - NumericAscending, - NumericDescending - } } diff --git a/OverlayPlugin.Core/Overlays/MiniParseOverlay/MiniParseSortType.cs b/OverlayPlugin.Core/Overlays/MiniParseOverlay/MiniParseSortType.cs new file mode 100644 index 000000000..252c79052 --- /dev/null +++ b/OverlayPlugin.Core/Overlays/MiniParseOverlay/MiniParseSortType.cs @@ -0,0 +1,11 @@ +namespace RainbowMage.OverlayPlugin.Overlays +{ + public enum MiniParseSortType + { + None, + StringAscending, + StringDescending, + NumericAscending, + NumericDescending + } +} diff --git a/OverlayPlugin.Core/Overlays/SerializableSpellTimerEntry.cs b/OverlayPlugin.Core/Overlays/SerializableSpellTimerEntry.cs new file mode 100644 index 000000000..9f8c61f46 --- /dev/null +++ b/OverlayPlugin.Core/Overlays/SerializableSpellTimerEntry.cs @@ -0,0 +1,35 @@ +using Advanced_Combat_Tracker; +using Newtonsoft.Json; +using System; + +namespace RainbowMage.OverlayPlugin.Overlays +{ + [JsonObject] + class SerializableSpellTimerEntry + { + public DateTime StartTime { get; set; } + private static readonly DateTime EpochTime = new DateTime(1970, 1, 1); + + [JsonProperty(PropertyName = "startTime")] + public long StartTimeLong + { + get + { + return (this.StartTime.Ticks - EpochTime.Ticks) / 10000; + } + set + { + this.StartTime = new DateTime(EpochTime.Ticks + value * 10000); + } + } + + public SpellTimer Original { get; private set; } + + public SerializableSpellTimerEntry(SpellTimer spellTimer) + { + this.StartTime = DateTime.Now; + + this.Original = spellTimer; + } + } +} diff --git a/OverlayPlugin.Core/Overlays/SerializableTimerFrameEntry.cs b/OverlayPlugin.Core/Overlays/SerializableTimerFrameEntry.cs index 8ba817034..f4dc86be4 100644 --- a/OverlayPlugin.Core/Overlays/SerializableTimerFrameEntry.cs +++ b/OverlayPlugin.Core/Overlays/SerializableTimerFrameEntry.cs @@ -1,41 +1,38 @@ using Advanced_Combat_Tracker; +using Newtonsoft.Json; using System; using System.Collections.Generic; -using System.Linq; -using System.Runtime.Serialization; -using System.Text; -using System.Threading.Tasks; namespace RainbowMage.OverlayPlugin.Overlays { - [DataContract] + [JsonObject] class SerializableTimerFrameEntry { - [DataMember(Name = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } - [DataMember(Name = "key")] + [JsonProperty(PropertyName = "key")] public string Key { get; set; } - [DataMember(Name = "color")] + [JsonProperty(PropertyName = "color")] public int Color { get; set; } - [DataMember(Name = "startCount")] + [JsonProperty(PropertyName = "startCount")] public int StartCount { get; set; } - [DataMember(Name = "warningCount")] + [JsonProperty(PropertyName = "warningCount")] public int WarningCount { get; set; } - [DataMember(Name = "expireCount")] + [JsonProperty(PropertyName = "expireCount")] public int ExpireCount { get; set; } - [DataMember(Name = "tooltip")] + [JsonProperty(PropertyName = "tooltip")] public string Tooltip { get; set; } - [DataMember(Name = "absoluteTiming")] + [JsonProperty(PropertyName = "absoluteTiming")] public bool AbsoluteTiming { get; set; } - [DataMember(Name = "onlyMasterTicks")] + [JsonProperty(PropertyName = "onlyMasterTicks")] public bool OnlyMasterTicks { get; set; } - [DataMember(Name = "oneOnly")] + [JsonProperty(PropertyName = "oneOnly")] public bool OneOnly { get; set; } - //[DataMember(Name = "masterExists")] + //[JsonProperty(PropertyName = "masterExists")] //public bool MasterExists { get; set; } - //[DataMember(Name = "activeInList")] + //[JsonProperty(PropertyName = "activeInList")] //public bool ActiveInList { get; set; } - [DataMember(Name = "spellTimers")] + [JsonProperty(PropertyName = "spellTimers")] public IList SpellTimers { get; set; } public TimerFrame Original { get; private set; } @@ -65,33 +62,4 @@ public void Update(TimerFrame timerFrame) } } - - [DataContract] - class SerializableSpellTimerEntry - { - public DateTime StartTime { get; set; } - private static readonly DateTime EpochTime = new DateTime(1970, 1, 1); - - [DataMember(Name = "startTime")] - public long StartTimeLong - { - get - { - return (this.StartTime.Ticks - EpochTime.Ticks) / 10000; - } - set - { - this.StartTime = new DateTime(EpochTime.Ticks + value * 10000); - } - } - - public SpellTimer Original { get; private set; } - - public SerializableSpellTimerEntry(SpellTimer spellTimer) - { - this.StartTime = DateTime.Now; - - this.Original = spellTimer; - } - } } diff --git a/OverlayPlugin.Core/Overlays/SpellTimerOverlay.cs b/OverlayPlugin.Core/Overlays/SpellTimerOverlay/SpellTimerOverlay.cs similarity index 82% rename from OverlayPlugin.Core/Overlays/SpellTimerOverlay.cs rename to OverlayPlugin.Core/Overlays/SpellTimerOverlay/SpellTimerOverlay.cs index 62dc8d6aa..d72b75f29 100644 --- a/OverlayPlugin.Core/Overlays/SpellTimerOverlay.cs +++ b/OverlayPlugin.Core/Overlays/SpellTimerOverlay/SpellTimerOverlay.cs @@ -1,20 +1,15 @@ using Advanced_Combat_Tracker; +using Newtonsoft.Json; using System; using System.Collections.Generic; -using System.Diagnostics; using System.IO; using System.Linq; -using System.Runtime.Serialization.Json; using System.Text; -using System.Threading.Tasks; namespace RainbowMage.OverlayPlugin.Overlays { public class SpellTimerOverlay : OverlayBase { - static DataContractJsonSerializer jsonSerializer = - new DataContractJsonSerializer(typeof(List)); - IList activatedTimers; public SpellTimerOverlay(SpellTimerOverlayConfig config) @@ -47,6 +42,7 @@ public SpellTimerOverlay(SpellTimerOverlayConfig config) } } }; + ActGlobals.oFormSpellTimers.OnSpellTimerRemoved += (t) => { //activatedTimers.Remove(t); @@ -112,34 +108,25 @@ private void RemoveExpiredEntries() internal string CreateJsonData() { + string result; lock (this.activatedTimers) { RemoveExpiredEntries(); + result = JsonConvert.SerializeObject(this.activatedTimers); } - using (var ms = new MemoryStream()) + if (!string.IsNullOrWhiteSpace(result)) { - lock (this.activatedTimers) - { - RemoveExpiredEntries(); - jsonSerializer.WriteObject(ms, activatedTimers); - } - - var result = Encoding.UTF8.GetString(ms.ToArray()); - - if (!string.IsNullOrWhiteSpace(result)) - { - return string.Format( - "{{ timerFrames: {0} }}", - result); - } - else - { - return ""; - } + return string.Format( + "{{ timerFrames: {0} }}", + result); + } + else + { + return ""; } } - + private string CreateEventDispatcherScript() { return "var ActXiv = " + this.CreateJsonData() + ";\n" + diff --git a/OverlayPlugin.Core/Overlays/SpellTimerOverlayAddon.cs b/OverlayPlugin.Core/Overlays/SpellTimerOverlay/SpellTimerOverlayAddon.cs similarity index 92% rename from OverlayPlugin.Core/Overlays/SpellTimerOverlayAddon.cs rename to OverlayPlugin.Core/Overlays/SpellTimerOverlay/SpellTimerOverlayAddon.cs index e32807fc0..7edb4021f 100644 --- a/OverlayPlugin.Core/Overlays/SpellTimerOverlayAddon.cs +++ b/OverlayPlugin.Core/Overlays/SpellTimerOverlay/SpellTimerOverlayAddon.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace RainbowMage.OverlayPlugin.Overlays { diff --git a/OverlayPlugin.Core/Overlays/SpellTimerOverlayConfig.cs b/OverlayPlugin.Core/Overlays/SpellTimerOverlay/SpellTimerOverlayConfig.cs similarity index 100% rename from OverlayPlugin.Core/Overlays/SpellTimerOverlayConfig.cs rename to OverlayPlugin.Core/Overlays/SpellTimerOverlay/SpellTimerOverlayConfig.cs diff --git a/OverlayPlugin.Core/PluginConfig.cs b/OverlayPlugin.Core/PluginConfig.cs index de4e13f72..f19c1d319 100644 --- a/OverlayPlugin.Core/PluginConfig.cs +++ b/OverlayPlugin.Core/PluginConfig.cs @@ -1,12 +1,8 @@ using RainbowMage.OverlayPlugin.Overlays; using System; -using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Xml.Serialization; namespace RainbowMage.OverlayPlugin @@ -177,8 +173,20 @@ public MiniParseSortType SortTypeObsolete [XmlElement("FollowLatestLog")] public bool FollowLatestLog { get; set; } + private bool m_hideOverlaysWhenNotActive; [XmlElement("HideOverlaysWhenNotActive")] - public bool HideOverlaysWhenNotActive { get; set; } + public bool HideOverlaysWhenNotActive + { + get + { + return this.m_hideOverlaysWhenNotActive; + } + set + { + this.m_hideOverlaysWhenNotActive = value; + AutoHide.Enabled = value; + } + } /// /// 設定ファイルを生成したプラグインのバージョンを取得または設定します。 @@ -211,6 +219,31 @@ public Version Version } } + [XmlElement("ScreenshotSavePath")] + [EditorBrowsable(EditorBrowsableState.Never)] + [Browsable(false)] + public string ScreenshotSavePath { get; set; } + + [XmlElement("ScreenshotBackgroundPath")] + [EditorBrowsable(EditorBrowsableState.Never)] + [Browsable(false)] + public string ScreenshotBackgroundPath { get; set; } + + [XmlElement("ScreenshotBackgroundMode")] + [EditorBrowsable(EditorBrowsableState.Never)] + [Browsable(false)] + public int ScreenshotBackgroundMode { get; set; } + + [XmlElement("ScreenshotAutoClipping")] + [EditorBrowsable(EditorBrowsableState.Never)] + [Browsable(false)] + public bool ScreenshotAutoClipping { get; set; } + + [XmlElement("ScreenshotMargin")] + [EditorBrowsable(EditorBrowsableState.Never)] + [Browsable(false)] + public int ScreenshotMargin { get; set; } + [XmlElement("Version")] [EditorBrowsable(EditorBrowsableState.Never)] [Browsable(false)] @@ -256,7 +289,7 @@ public void SaveXml(string path) using (var stream = new FileStream(path, FileMode.Create, FileAccess.Write)) { - XmlSerializer serializer = new XmlSerializer(typeof(PluginConfig)); + var serializer = new XmlSerializer(typeof(PluginConfig)); serializer.Serialize(stream, this); } } @@ -276,7 +309,7 @@ public static PluginConfig LoadXml(string pluginDirectory, string path) using (var stream = new FileStream(path, FileMode.Open, FileAccess.Read)) { - XmlSerializer serializer = new XmlSerializer(typeof(PluginConfig)); + var serializer = new XmlSerializer(typeof(PluginConfig)); var result = (PluginConfig)serializer.Deserialize(stream); result.IsFirstLaunch = false; @@ -298,21 +331,30 @@ public static PluginConfig LoadXml(string pluginDirectory, string path) /// public void SetDefaultOverlayConfigs(string pluginDirectory) { - var miniparseOverlayConfig = new MiniParseOverlayConfig(DefaultMiniParseOverlayName); - miniparseOverlayConfig.Position = new Point(20, 20); - miniparseOverlayConfig.Size = new Size(500, 300); - miniparseOverlayConfig.Url = new Uri(Path.Combine(pluginDirectory, "resources", "miniparse.html")).ToString(); + var KagerouDefaultOverlay = new MiniParseOverlayConfig("Kagerou Overlay"); + KagerouDefaultOverlay.Position = new Point(20, 20); + KagerouDefaultOverlay.Size = new Size(480, 300); + KagerouDefaultOverlay.Url = new Uri("http://kagerou.hibiya.moe/overlay/").ToString(); + + var CatsEyeDefaultOverlay = new MiniParseOverlayConfig("Cat's Eye Overlay"); + CatsEyeDefaultOverlay.Position = new Point(20, 20); + CatsEyeDefaultOverlay.Size = new Size(480, 300); + CatsEyeDefaultOverlay.Url = new Uri("http://ffxiv.work/chrysoberyl/Demo/stable.html").ToString(); + /* var spellTimerOverlayConfig = new SpellTimerOverlayConfig(DefaultSpellTimerOverlayName); spellTimerOverlayConfig.Position = new Point(20, 520); spellTimerOverlayConfig.Size = new Size(200, 300); spellTimerOverlayConfig.IsVisible = true; spellTimerOverlayConfig.MaxFrameRate = 5; spellTimerOverlayConfig.Url = new Uri(Path.Combine(pluginDirectory, "resources", "spelltimer.html")).ToString(); + */ this.Overlays = new OverlayConfigList(); - this.Overlays.Add(miniparseOverlayConfig); - this.Overlays.Add(spellTimerOverlayConfig); + this.Overlays.Add(KagerouDefaultOverlay); + this.Overlays.Add(CatsEyeDefaultOverlay); + //this.Overlays.Add(spellTimerOverlayConfig); + this.ScreenshotSavePath = PluginMain.DefaultScreenshotPath; } /// diff --git a/OverlayPlugin.Core/PluginMain.cs b/OverlayPlugin.Core/PluginMain.cs index dbf3fdc1a..ef1b76a38 100644 --- a/OverlayPlugin.Core/PluginMain.cs +++ b/OverlayPlugin.Core/PluginMain.cs @@ -1,19 +1,13 @@ using Advanced_Combat_Tracker; -using System.Collections.Generic; -using System.Text; -using System.Linq; -using System.Windows.Forms; -using System.Reflection; using RainbowMage.HtmlRenderer; +using RainbowMage.OverlayPlugin.Overlays; using System; -using System.Drawing; +using System.Collections.Generic; using System.IO; -using System.ComponentModel; -using System.Diagnostics; -using System.Threading; -using System.Text.RegularExpressions; -using RainbowMage.OverlayPlugin.Overlays; +using System.Linq; +using System.Reflection; using System.Threading.Tasks; +using System.Windows.Forms; namespace RainbowMage.OverlayPlugin { @@ -23,16 +17,24 @@ public class PluginMain Label label; ControlPanel controlPanel; + internal static readonly string DefaultScreenshotPath = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "Screenshot"); internal PluginConfig Config { get; private set; } internal List Overlays { get; private set; } internal List Addons { get; set; } - internal Logger Logger { get; set; } internal string PluginDirectory { get; private set; } + private static string PrimaryUserInternal = "YOU"; + public static string PrimaryUser + { + get { return PrimaryUserInternal; } + set { PrimaryUserInternal = value; } + } + public static Logger Logger { get; set; } + public PluginMain(string pluginDirectory, Logger logger) { - this.PluginDirectory = pluginDirectory; - this.Logger = logger; + PluginDirectory = pluginDirectory; + Logger = logger; } /// @@ -44,9 +46,8 @@ public void InitPlugin(TabPage pluginScreenSpace, Label pluginStatusText) { try { - this.tabPage = pluginScreenSpace; - this.label = pluginStatusText; - + tabPage = pluginScreenSpace; + label = pluginStatusText; #if DEBUG Logger.Log(LogLevel.Warning, "##################################"); Logger.Log(LogLevel.Warning, " THIS IS THE DEBUG BUILD"); @@ -58,54 +59,16 @@ public void InitPlugin(TabPage pluginScreenSpace, Label pluginStatusText) // プラグイン読み込み LoadAddons(); - // コンフィグ系読み込み LoadConfig(); // プラグイン間のメッセージ関連 - RainbowMage.HtmlRenderer.Renderer.BroadcastMessage += (o, e) => - { - Task.Run(() => - { - foreach (var overlay in this.Overlays) - { - overlay.SendMessage(e.Message); - } - }); - }; - RainbowMage.HtmlRenderer.Renderer.SendMessage += (o, e) => - { - Task.Run(() => - { - var targetOverlay = this.Overlays.FirstOrDefault(x => x.Name == e.Target); - if (targetOverlay != null) - { - targetOverlay.SendMessage(e.Message); - } - }); - }; - RainbowMage.HtmlRenderer.Renderer.OverlayMessage += (o, e) => - { - Task.Run(() => - { - var targetOverlay = this.Overlays.FirstOrDefault(x => x.Name == e.Target); - if (targetOverlay != null) { - targetOverlay.OverlayMessage(e.Message); - } - }); - }; - RainbowMage.HtmlRenderer.Renderer.RendererFeatureRequest += (o, e) => - { - Task.Run(() => - { - if (e.Request == "EndEncounter") - { - ActGlobals.oFormActMain.EndCombat(true); - } - }); - }; - - + Renderer.BroadcastMessage += BroadcaseMessageEvent; + Renderer.SendMessage += SendMessageEvent; + Renderer.OverlayMessage += OverlayMessageEvent; + Renderer.TakeScreenshotHandler += RendererTakeScreenshotEvent; + Renderer.RendererFeatureRequest += RendererFeatureRequestEvent; + // ACT 終了時に CEF をシャットダウン(ゾンビ化防止) Application.ApplicationExit += (o, e) => { @@ -116,12 +79,12 @@ public void InitPlugin(TabPage pluginScreenSpace, Label pluginStatusText) InitializeOverlays(); // コンフィグUI系初期化 - this.controlPanel = new ControlPanel(this, this.Config); - this.controlPanel.Dock = DockStyle.Fill; - this.tabPage.Controls.Add(this.controlPanel); + controlPanel = new ControlPanel(this, Config); + controlPanel.Dock = DockStyle.Fill; + tabPage.Controls.Add(controlPanel); Logger.Log(LogLevel.Info, "InitPlugin: Initialized."); - this.label.Text = "Initialized."; + label.Text = "Initialized."; } catch (Exception e) { @@ -132,6 +95,80 @@ public void InitPlugin(TabPage pluginScreenSpace, Label pluginStatusText) } } + private void BroadcaseMessageEvent(object sender, BroadcastMessageEventArgs e) + { + Task.Run(() => + { + foreach (var overlay in Overlays) + { + overlay.SendMessage(e.Message); + } + }); + } + + private void SendMessageEvent(object sender, SendMessageEventArgs e) + { + Task.Run(() => + { + var targetOverlay = Overlays.FirstOrDefault(x => x.Name == e.Target); + if (targetOverlay != null) + { + targetOverlay.SendMessage(e.Message); + } + }); + } + + private void OverlayMessageEvent(object sender, SendMessageEventArgs e) + { + Task.Run(() => + { + var targetOverlay = Overlays.FirstOrDefault(x => x.Name == e.Target); + if (targetOverlay != null) + { + targetOverlay.OverlayMessage(e.Message); + } + }); + } + + /// + /// Take Screenshot target overlay (on HTML: window.overlayApi.takeScreenshot( window.overlayApi.overlayName )) + /// + /// + /// + private void RendererTakeScreenshotEvent(object sender, TakeScreenshotEventArgs e) + { + Task.Run(() => + { + foreach(var i in Overlays) + { + if (i.Name == e.Message) + { + i.TakeScreenshot( + new ScreenshotConfig + { + SavePath = Config.ScreenshotSavePath, + AutoClipping = Config.ScreenshotAutoClipping, + BackgroundImagePath = Config.ScreenshotBackgroundPath, + BackgroundMode = (ScreenshotBackgroundMode)Config.ScreenshotBackgroundMode, + Margin = Config.ScreenshotMargin, + }); + break; + } + } + }); + } + + private void RendererFeatureRequestEvent(object sender, RendererFeatureRequestEventArgs e) + { + Task.Run(() => + { + if (e.Request == "EndEncounter") + { + ActGlobals.oFormActMain.EndCombat(true); + } + }); + } + /// /// コンフィグのオーバーレイ設定を基に、オーバーレイを初期化・登録します。 /// @@ -269,6 +306,10 @@ private void LoadConfig() try { Config = PluginConfig.LoadXml(this.PluginDirectory, GetConfigPath()); + if(Config.ScreenshotSavePath == "" || Config.ScreenshotSavePath == null) + { + Config.ScreenshotSavePath = DefaultScreenshotPath; + } } catch (Exception e) { @@ -277,7 +318,13 @@ private void LoadConfig() Logger.Log(LogLevel.Info, "LoadConfig: Creating new configuration."); Config = new PluginConfig(); Config.SetDefaultOverlayConfigs(this.PluginDirectory); + if (Config.ScreenshotSavePath == "" || Config.ScreenshotSavePath == null) + { + Config.ScreenshotSavePath = DefaultScreenshotPath; + } } + + Directory.CreateDirectory(Config.ScreenshotSavePath); } /// @@ -306,11 +353,17 @@ private void SaveConfig() /// private static string GetConfigPath() { - var path = System.IO.Path.Combine( +#if DEBUG + var path = Path.Combine( + ActGlobals.oFormActMain.AppDataFolder.FullName, + "Config", + "RainbowMage.OverlayPlugin.config.debug.xml"); +#else + var path = Path.Combine( ActGlobals.oFormActMain.AppDataFolder.FullName, "Config", "RainbowMage.OverlayPlugin.config.xml"); - +#endif return path; } } diff --git a/OverlayPlugin.Core/Properties/AssemblyInfo.cs b/OverlayPlugin.Core/Properties/AssemblyInfo.cs index be25738da..29c347c92 100644 --- a/OverlayPlugin.Core/Properties/AssemblyInfo.cs +++ b/OverlayPlugin.Core/Properties/AssemblyInfo.cs @@ -1,5 +1,4 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // アセンブリに関する一般情報は以下の属性セットをとおして制御されます。 @@ -7,12 +6,8 @@ // これらの属性値を変更してください。 [assembly: AssemblyTitle("OverlayPlugin.Core")] [assembly: AssemblyDescription("Core assembly of the OverlayPlugin")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OverlayPlugin")] -[assembly: AssemblyCopyright("Copyright © RainbowMage 2015, Kuriyama hibiya 2016")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] +[assembly: AssemblyCopyright("Copyright © RainbowMage 2015, Kuriyama hibiya 2016, Laighlinne 2017")] // ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから // 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、 diff --git a/OverlayPlugin.Core/Screenshot.cs b/OverlayPlugin.Core/Screenshot.cs new file mode 100644 index 000000000..6a9543922 --- /dev/null +++ b/OverlayPlugin.Core/Screenshot.cs @@ -0,0 +1,180 @@ +using System; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Drawing.Imaging; +using System.IO; +using System.Runtime.InteropServices; + +namespace RainbowMage.OverlayPlugin +{ + internal static class Screenshot + { + public static void SaveScreenshot(DIBitmap buffer, ScreenshotConfig config) + { + Bitmap bitmap = null; + + try + { + bitmap = new Bitmap(buffer.Width, buffer.Height, PixelFormat.Format32bppArgb); + var rect = new Rectangle(Point.Empty, bitmap.Size); + + BitmapData bmpData = null; + try + { + bmpData = bitmap.LockBits(rect, ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb); + NativeMethods.CopyMemory(bmpData.Scan0, buffer.Bits, buffer.BitsCount); + } + finally + { + if (bmpData != null) + bitmap.UnlockBits(bmpData); + } + + if (config.AutoClipping) + bitmap = AutoClipping(bitmap); + + } + catch (Exception ex) + { + bitmap?.Dispose(); + PluginMain.Logger.Log(LogLevel.Error, "OverlayPlugin Can't Take Screenshot: {0}", ex.ToString()); + return; + } + + using (bitmap) + using (var src = new Bitmap(bitmap.Width + config.Margin * 2, bitmap.Height + config.Margin * 2, PixelFormat.Format32bppArgb)) + { + if (!string.IsNullOrWhiteSpace(config.BackgroundImagePath) && File.Exists(config.BackgroundImagePath)) + { + try + { + DrawBackground(src, config.BackgroundImagePath, config.BackgroundMode); + } + catch (Exception ex) + { + PluginMain.Logger.Log(LogLevel.Error, "OverlayPlugin Can't Take Screenshot: {0}", ex.ToString()); + } + } + + using (var g = Graphics.FromImage(src)) + { + g.CompositingMode = CompositingMode.SourceOver; + g.DrawImageUnscaled(bitmap, config.Margin, config.Margin); + } + + Directory.CreateDirectory(config.SavePath); + + src.Save( + Path.Combine(config.SavePath, DateTime.Now.ToString("'Screenshot_'yyyy-MM-dd_HH-mm-ss.fff'.png'")), + ImageFormat.Png); + } + } + + private static void DrawBackground(Bitmap ss, string path, ScreenshotBackgroundMode mode) + { + if (mode == ScreenshotBackgroundMode.Hide) + return; + + using (var bg = Image.FromFile(path)) + { + using (var g = Graphics.FromImage(ss)) + { + g.SmoothingMode = SmoothingMode.AntiAlias; + + switch (mode) + { + case ScreenshotBackgroundMode.Normal: + g.DrawImageUnscaled(bg, 0, 0); + return; + + case ScreenshotBackgroundMode.Center: + g.DrawImageUnscaled(bg, (ss.Width - bg.Width) / 2 , (ss.Height - bg.Height) / 2); + return; + + case ScreenshotBackgroundMode.Fill: + g.DrawImage(bg, + new Rectangle(Point.Empty, ss.Size), + new Rectangle(Point.Empty, bg.Size), + GraphicsUnit.Pixel); + return; + + case ScreenshotBackgroundMode.Uniform: + case ScreenshotBackgroundMode.UniformToFill: + { + var scaleX = (double)ss.Width / bg.Width; + var scaleY = (double)ss.Height / bg.Height; + var scale = mode == ScreenshotBackgroundMode.Uniform ? + Math.Min(scaleX, scaleY) : + Math.Max(scaleX, scaleY); + + var bg_w = (int)Math.Floor(bg.Width * scale); + var bg_h = (int)Math.Floor(bg.Height * scale); + + var ss_x = (int)Math.Ceiling((ss.Width - bg_w) / 2d); + var ss_y = (int)Math.Ceiling((ss.Height - bg_h) / 2d); + + g.DrawImage( + bg, + new Rectangle(ss_x, ss_y, bg_w, bg_h), + new Rectangle(0, 0, bg.Width, bg.Height), + GraphicsUnit.Pixel); + } + return; + } + } + } + } + + private static Bitmap AutoClipping(Bitmap bitmap) + { + var newHeight = bitmap.Height; + + BitmapData bmpData = null; + try + { + bmpData = bitmap.LockBits(new Rectangle(Point.Empty, bitmap.Size), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb); + + var strideBuffer = new byte[bmpData.Stride]; + + int x; + bool skip; + while (--newHeight >= 1) + { + Marshal.Copy(bmpData.Scan0 + bmpData.Stride * newHeight, strideBuffer, 0, bmpData.Stride); + + skip = true; + for (x = 0; x < bmpData.Width; ++x) + { + if (strideBuffer[x * 4 + 3] != 0) + { + skip = false; + break; + } + } + + if (!skip) + break; + } + } + finally + { + if (bmpData != null) + bitmap.UnlockBits(bmpData); + } + + var newBitmap = new Bitmap(bitmap.Width, newHeight, PixelFormat.Format32bppArgb); + using (var graphics = Graphics.FromImage(newBitmap)) + { + graphics.DrawImage( + bitmap, + new Rectangle(Point.Empty, newBitmap.Size), + new Rectangle(0, 0, bitmap.Width, newHeight), + GraphicsUnit.Pixel); + } + + bitmap.Dispose(); + + return newBitmap; + } + } +} diff --git a/OverlayPlugin.Core/TabControlExt.cs b/OverlayPlugin.Core/TabControlExt.cs deleted file mode 100644 index 9d38e5c34..000000000 --- a/OverlayPlugin.Core/TabControlExt.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System; -using System.Drawing; -using System.Windows.Forms; - -namespace RainbowMage.OverlayPlugin -{ - public class TabControlExt : TabControl - { - protected override void OnPaint(PaintEventArgs e) - { - base.OnPaint(e); - e.Graphics.Clear(SystemColors.ControlLightLight); - e.Graphics.FillRectangle(SystemBrushes.ControlLight, 4, 4, ItemSize.Height - 4, Height - 8); - - int inc = 0; - - foreach (TabPage tp in TabPages) - { - Color fore = Color.Black; - Font fontF = Font; - Font fontFSmall = new Font(Font.FontFamily, (float)(Font.Size * 0.85)); - Rectangle tabrect = GetTabRect(inc); - Rectangle rect = new Rectangle(tabrect.X + 4, tabrect.Y + 4, tabrect.Width - 8, tabrect.Height - 2); - Rectangle textrect1 = new Rectangle(tabrect.X + 4, tabrect.Y + 4, tabrect.Width - 8, tabrect.Height - 20); - Rectangle textrect2 = new Rectangle(tabrect.X + 4, tabrect.Y + 20, tabrect.Width - 8, tabrect.Height - 20); - - StringFormat sf = new StringFormat(); - sf.LineAlignment = StringAlignment.Center; - sf.Alignment = StringAlignment.Center; - - if (inc == SelectedIndex) - { - e.Graphics.FillRectangle(new SolidBrush(SystemColors.Highlight), rect); - fore = SystemColors.HighlightText; - fontF = new Font(Font, FontStyle.Bold); - } - else - { - e.Graphics.FillRectangle(Brushes.White, rect); - } - - e.Graphics.DrawString(tp.Name, fontF, new SolidBrush(fore), textrect1, sf); - e.Graphics.DrawString(tp.Text, fontFSmall, new SolidBrush(fore), textrect2, sf); - inc++; - } - } - - protected override void OnTabIndexChanged(EventArgs e) - { - base.OnTabIndexChanged(e); - Invalidate(); - } - - public TabControlExt() : base() - { - Alignment = TabAlignment.Left; - - SetStyle(ControlStyles.AllPaintingInWmPaint, true); - SetStyle(ControlStyles.OptimizedDoubleBuffer, true); - - SetStyle(ControlStyles.ResizeRedraw, true); - SetStyle(ControlStyles.UserPaint, true); - - DoubleBuffered = true; - - ItemSize = new Size(46, 140); - SizeMode = TabSizeMode.Fixed; - BackColor = Color.Transparent; - } - } -} \ No newline at end of file diff --git a/OverlayPlugin.Core/DIBitmap.cs b/OverlayPlugin.Core/UI Classes/DIBitmap.cs similarity index 90% rename from OverlayPlugin.Core/DIBitmap.cs rename to OverlayPlugin.Core/UI Classes/DIBitmap.cs index 33573f039..9abc23ba5 100644 --- a/OverlayPlugin.Core/DIBitmap.cs +++ b/OverlayPlugin.Core/UI Classes/DIBitmap.cs @@ -1,9 +1,5 @@ using System; -using System.Collections.Generic; -using System.Linq; using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; namespace RainbowMage.OverlayPlugin { @@ -21,15 +17,16 @@ class DIBitmap : IDisposable /// public int Height { get; private set; } /// - /// ビットマップデータのアドレスを取得します。 + /// Get the address of the bitmap data. /// public IntPtr Bits { get; private set; } + public uint BitsCount { get; private set; } /// - /// デバイス独立ビットマップのハンドルを取得します。 + /// Get the handle of the device independent bitmap. /// public IntPtr Handle { get; private set; } /// - /// デバイスコンテキストを取得します。 + /// Gets the device context. /// public IntPtr DeviceContext { get; private set; } /// @@ -78,6 +75,7 @@ public DIBitmap(int width, int height) public void SetSurfaceData(IntPtr srcSurfaceData, uint count) { NativeMethods.CopyMemory(this.Bits, srcSurfaceData, count); + this.BitsCount = count; } public void Dispose() diff --git a/OverlayPlugin.Core/NewOverlayDialog.Designer.cs b/OverlayPlugin.Core/UI Classes/Forms/NewOverlayDialog.Designer.cs similarity index 99% rename from OverlayPlugin.Core/NewOverlayDialog.Designer.cs rename to OverlayPlugin.Core/UI Classes/Forms/NewOverlayDialog.Designer.cs index 88b244c58..ba66675c5 100644 --- a/OverlayPlugin.Core/NewOverlayDialog.Designer.cs +++ b/OverlayPlugin.Core/UI Classes/Forms/NewOverlayDialog.Designer.cs @@ -69,9 +69,9 @@ private void InitializeComponent() // // comboBox1 // - resources.ApplyResources(this.comboBox1, "comboBox1"); this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBox1.FormattingEnabled = true; + resources.ApplyResources(this.comboBox1, "comboBox1"); this.comboBox1.Name = "comboBox1"; // // NewOverlayDialog @@ -106,4 +106,4 @@ private void InitializeComponent() private System.Windows.Forms.Label label2; private System.Windows.Forms.ComboBox comboBox1; } -} \ No newline at end of file +} diff --git a/OverlayPlugin.Core/NewOverlayDialog.cs b/OverlayPlugin.Core/UI Classes/Forms/NewOverlayDialog.cs similarity index 80% rename from OverlayPlugin.Core/NewOverlayDialog.cs rename to OverlayPlugin.Core/UI Classes/Forms/NewOverlayDialog.cs index 41bcc38b2..0b49a7050 100644 --- a/OverlayPlugin.Core/NewOverlayDialog.cs +++ b/OverlayPlugin.Core/UI Classes/Forms/NewOverlayDialog.cs @@ -1,11 +1,4 @@ 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; namespace RainbowMage.OverlayPlugin @@ -26,16 +19,14 @@ public NewOverlayDialog(PluginMain pluginMain) InitializeComponent(); this.pluginMain = pluginMain; - - // Default validator + this.NameValidator = (name) => { return name != null; }; foreach (var addon in pluginMain.Addons) { comboBox1.Items.Add(addon); } - - //comboBox1.ValueMember = "OverlayType"; + comboBox1.DisplayMember = "Name"; comboBox1.SelectedIndex = 0; } @@ -47,7 +38,7 @@ private void buttonOK_Click(object sender, EventArgs e) if (comboBox1.SelectedItem == null) { MessageBox.Show("Please select overlay type."); - this.DialogResult = System.Windows.Forms.DialogResult.None; + this.DialogResult = DialogResult.None; } else { @@ -57,7 +48,7 @@ private void buttonOK_Click(object sender, EventArgs e) } else { - this.DialogResult = System.Windows.Forms.DialogResult.None; + this.DialogResult = DialogResult.None; } } diff --git a/OverlayPlugin.Core/NewOverlayDialog.ja-JP.resx b/OverlayPlugin.Core/UI Classes/Forms/NewOverlayDialog.ja-JP.resx similarity index 84% rename from OverlayPlugin.Core/NewOverlayDialog.ja-JP.resx rename to OverlayPlugin.Core/UI Classes/Forms/NewOverlayDialog.ja-JP.resx index 4ed38f2b4..a2c671989 100644 --- a/OverlayPlugin.Core/NewOverlayDialog.ja-JP.resx +++ b/OverlayPlugin.Core/UI Classes/Forms/NewOverlayDialog.ja-JP.resx @@ -117,12 +117,30 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 351, 115 + + + 87, 23 + + + 257, 115 + + + 87, 23 + キャンセル - - 14, 29 + 16, 29 + + + 422, 21 + + + 14, 9 29, 12 @@ -130,6 +148,9 @@ 名前 + + 14, 57 + 29, 12 @@ -137,7 +158,16 @@ 種類 - 14, 77 + 16, 77 + + + 422, 20 + + + 7, 12 + + + 453, 150 新しいオーバーレイ diff --git a/OverlayPlugin.Core/NewOverlayDialog.ko-KR.resx b/OverlayPlugin.Core/UI Classes/Forms/NewOverlayDialog.ko-KR.resx similarity index 100% rename from OverlayPlugin.Core/NewOverlayDialog.ko-KR.resx rename to OverlayPlugin.Core/UI Classes/Forms/NewOverlayDialog.ko-KR.resx diff --git a/OverlayPlugin.Core/NewOverlayDialog.resx b/OverlayPlugin.Core/UI Classes/Forms/NewOverlayDialog.resx similarity index 95% rename from OverlayPlugin.Core/NewOverlayDialog.resx rename to OverlayPlugin.Core/UI Classes/Forms/NewOverlayDialog.resx index 98abfc862..00abdba4b 100644 --- a/OverlayPlugin.Core/NewOverlayDialog.resx +++ b/OverlayPlugin.Core/UI Classes/Forms/NewOverlayDialog.resx @@ -117,178 +117,178 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 2 - - + Bottom, Right - 301, 115 + 351, 115 - - Cancel + + 87, 23 - + + 0 - - $this - - - 75, 23 - - - $this - - - 75, 23 + + OK - - 362, 19 + + buttonOK - - 12, 57 + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + $this - - Name + + 5 - - NewOverlayDialog + + Bottom, Right - - $this + + 257, 115 - - $this + + 87, 23 0 - - 12, 9 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 4 - - - 362, 20 - - - 388, 150 + + Cancel - - System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + buttonCancel - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - OK + + $this - - buttonCancel + + 4 - - label1 + + 16, 24 - - label2 + + 422, 21 - - Bottom, Right + + 1 - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + textBox1 System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 2 + + $this + + + 3 True - - 14, 24 + + 14, 9 - - 30, 12 + + 39, 12 - - 3 + + 2 - - 5 + + Name - - 34, 12 + + label1 System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - buttonOK - - + $this - - 3 - - - 220, 115 - - + 2 True - - 1 + + 14, 57 - - $this + + 34, 12 + + + 2 Type - - textBox1 - - - 0 + + label2 - - 6, 12 + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Create new overlay + + $this 1 - 14, 72 + 16, 72 + + + 422, 20 + + + 3 comboBox1 + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + True - - ja-JP - + + 7, 12 + + + 453, 150 + + + CenterParent + + + Create new overlay + + + NewOverlayDialog + + + System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + \ No newline at end of file diff --git a/OverlayPlugin.Core/OverlayForm.Designer.cs b/OverlayPlugin.Core/UI Classes/Forms/OverlayForm.Designer.cs similarity index 99% rename from OverlayPlugin.Core/OverlayForm.Designer.cs rename to OverlayPlugin.Core/UI Classes/Forms/OverlayForm.Designer.cs index f2b8e25aa..7e707a6f9 100644 --- a/OverlayPlugin.Core/OverlayForm.Designer.cs +++ b/OverlayPlugin.Core/UI Classes/Forms/OverlayForm.Designer.cs @@ -44,4 +44,4 @@ private void InitializeComponent() #endregion } -} \ No newline at end of file +} diff --git a/OverlayPlugin.Core/OverlayForm.cs b/OverlayPlugin.Core/UI Classes/Forms/OverlayForm.cs similarity index 91% rename from OverlayPlugin.Core/OverlayForm.cs rename to OverlayPlugin.Core/UI Classes/Forms/OverlayForm.cs index 699aa9717..b43b76f1d 100644 --- a/OverlayPlugin.Core/OverlayForm.cs +++ b/OverlayPlugin.Core/UI Classes/Forms/OverlayForm.cs @@ -1,16 +1,9 @@ using RainbowMage.HtmlRenderer; using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; using System.Diagnostics; using System.Drawing; -using System.Drawing.Imaging; using System.Linq; using System.Security.Permissions; -using System.Text; -using System.Threading; -using System.Threading.Tasks; using System.Windows.Forms; using Xilium.CefGlue; @@ -21,7 +14,6 @@ public partial class OverlayForm : Form private DIBitmap surfaceBuffer; private object surfaceBufferLocker = new object(); private int maxFrameRate; - private System.Threading.Timer zorderCorrector; private bool terminated = false; private bool shiftKeyPressed = false; private bool altKeyPressed = false; @@ -29,6 +21,8 @@ public partial class OverlayForm : Form public Renderer Renderer { get; private set; } + internal DIBitmap SurfaceBuffer { get { return this.surfaceBuffer; } } + private string url; public string Url { @@ -42,7 +36,7 @@ public string Url private bool isClickThru; public bool IsClickThru - { + { get { return this.isClickThru; @@ -61,7 +55,7 @@ public bool IsClickThru public bool Locked { get; set; } - public OverlayForm(string overlayVersion,string overlayName, string url, int maxFrameRate = 30) + public OverlayForm(string overlayVersion, string overlayName, string url, int maxFrameRate = 30) { InitializeComponent(); Renderer.Initialize(); @@ -121,7 +115,7 @@ protected override void WndProc(ref Message m) return; } } - + if (m.Msg == NativeMethods.WM_KEYDOWN || m.Msg == NativeMethods.WM_KEYUP || m.Msg == NativeMethods.WM_CHAR || @@ -239,7 +233,7 @@ private void DisableMouseClickThru() } #endregion - + void renderer_Render(object sender, RenderEventArgs e) { if (!this.terminated) @@ -263,10 +257,7 @@ void renderer_Render(object sender, RenderEventArgs e) UpdateLayeredWindowBitmap(); } - catch - { - - } + catch { } } } @@ -283,17 +274,6 @@ private void OverlayForm_Load(object sender, EventArgs e) this.IsLoaded = true; UpdateMouseClickThru(); - - zorderCorrector = new System.Threading.Timer((state) => - { - if (this.Visible) - { - if (!this.IsOverlaysGameWindow()) - { - this.EnsureTopMost(); - } - } - }, null, 0, 1000); } private void OverlayForm_FormClosed(object sender, FormClosedEventArgs e) @@ -308,11 +288,6 @@ private void OverlayForm_FormClosed(object sender, FormClosedEventArgs e) /// true if managed resources should be disposed; otherwise, false. protected override void Dispose(bool disposing) { - if (zorderCorrector != null) - { - zorderCorrector.Dispose(); - } - if (this.Renderer != null) { this.Renderer.Dispose(); @@ -328,6 +303,7 @@ protected override void Dispose(bool disposing) { components.Dispose(); } + base.Dispose(disposing); } @@ -435,35 +411,6 @@ private CefEventFlags GetMouseEventFlags(MouseEventArgs e) return flags; } - private bool IsOverlaysGameWindow() - { - var xivHandle = GetGameWindowHandle(); - var handle = this.Handle; - - while (handle != IntPtr.Zero) - { - // Overlayウィンドウよりも前面側にFF14のウィンドウがあった - if (handle == xivHandle) - { - return false; - } - - handle = NativeMethods.GetWindow(handle, NativeMethods.GW_HWNDPREV); - } - - // 前面側にOverlayが存在する、もしくはFF14が起動していない - return true; - } - - private void EnsureTopMost() - { - NativeMethods.SetWindowPos( - this.Handle, - NativeMethods.HWND_TOPMOST, - 0, 0, 0, 0, - NativeMethods.SWP_NOSIZE | NativeMethods.SWP_NOMOVE | NativeMethods.SWP_NOACTIVATE); - } - private static object xivProcLocker = new object(); private static Process xivProc; private static DateTime lastTry; diff --git a/OverlayPlugin.Core/OverlayForm.resx b/OverlayPlugin.Core/UI Classes/Forms/OverlayForm.resx similarity index 100% rename from OverlayPlugin.Core/OverlayForm.resx rename to OverlayPlugin.Core/UI Classes/Forms/OverlayForm.resx diff --git a/OverlayPlugin.Core/UI Classes/Structures/GraphicsExt.cs b/OverlayPlugin.Core/UI Classes/Structures/GraphicsExt.cs new file mode 100644 index 000000000..d495a7a0e --- /dev/null +++ b/OverlayPlugin.Core/UI Classes/Structures/GraphicsExt.cs @@ -0,0 +1,67 @@ +using System; +using System.Drawing; +using System.Drawing.Drawing2D; + +namespace RainbowMage.OverlayPlugin +{ + public static class GraphicsExt + { + public static GraphicsPath RoundedRect(Rectangle bounds, int radius) + { + int diameter = radius * 2; + Size size = new Size(diameter, diameter); + Rectangle arc = new Rectangle(bounds.Location, size); + GraphicsPath path = new GraphicsPath(); + + if (radius == 0) + { + path.AddRectangle(bounds); + return path; + } + + // top left arc + path.AddArc(arc, 180, 90); + + // top right arc + arc.X = bounds.Right - diameter; + path.AddArc(arc, 270, 90); + + // bottom right arc + arc.Y = bounds.Bottom - diameter; + path.AddArc(arc, 0, 90); + + // bottom left arc + arc.X = bounds.Left; + path.AddArc(arc, 90, 90); + + path.CloseFigure(); + return path; + } + + public static void FillRoundedRectangle(this Graphics graphics, Brush brush, Rectangle bounds, int cornerRadius) + { + if (graphics == null) + throw new ArgumentNullException("graphics"); + if (brush == null) + throw new ArgumentNullException("brush"); + + using (GraphicsPath path = RoundedRect(bounds, cornerRadius)) + { + graphics.FillPath(brush, path); + } + } + + public static void DrawRoundedRectangle(this Graphics graphics, Pen pen, Rectangle bounds, int cornerRadius) + { + if (graphics == null) + throw new ArgumentNullException("graphics"); + if (pen == null) + throw new ArgumentNullException("pen"); + + using (GraphicsPath path = RoundedRect(bounds, cornerRadius)) + { + graphics.DrawPath(pen, path); + } + } + } +} diff --git a/OverlayPlugin.Core/NativeMethods.cs b/OverlayPlugin.Core/UI Classes/Structures/NativeMethods.cs similarity index 73% rename from OverlayPlugin.Core/NativeMethods.cs rename to OverlayPlugin.Core/UI Classes/Structures/NativeMethods.cs index eb4a5856b..45996d1ed 100644 --- a/OverlayPlugin.Core/NativeMethods.cs +++ b/OverlayPlugin.Core/UI Classes/Structures/NativeMethods.cs @@ -1,17 +1,88 @@ using System; -using System.Collections.Generic; -using System.Linq; using System.Runtime.InteropServices; using System.Text; -using System.Threading.Tasks; namespace RainbowMage.OverlayPlugin { - /// - /// ネイティブ関数を提供します。 - /// - static class NativeMethods + internal static class NativeMethods { + public delegate void WinEventDelegate( + IntPtr hWinEventHook, + uint eventType, + IntPtr hwnd, + int idObject, + int idChild, + uint dwEventThread, + uint dwmsEventTime); + + [DllImport("user32.dll")] + public static extern uint GetWindowThreadProcessId( + IntPtr hWnd, + out uint lpdwProcessId); + + [DllImport("user32.dll")] + public static extern IntPtr SetWinEventHook( + uint eventMin, + uint eventMax, + IntPtr hmodWinEventProc, + WinEventDelegate lpfnWinEventProc, + uint idProcess, + uint idThread, + uint dwFlags); + + [DllImport("user32.dll")] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool UnhookWinEvent( + IntPtr hWinEventHook); + + [DllImport("user32.dll")] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool IsWindow( + IntPtr hWnd); + + [DllImport("user32.dll", EntryPoint = "GetClassNameW", CharSet = CharSet.Unicode, SetLastError = true)] + public static extern int GetClassName( + IntPtr hWnd, + StringBuilder lpClassName, + int nMaxCount); + + [DllImport("user32.dll", EntryPoint = "GetWindowTextW", CharSet = CharSet.Unicode, SetLastError = true)] + public static extern int GetWindowText( + IntPtr hWnd, + StringBuilder lpClassName, + int nMaxCount); + + [DllImport("user32.dll")] + public static extern bool SetWindowPos( + IntPtr hWnd, + IntPtr hWndInsertAfter, + int X, + int Y, + int cx, + int cy, + uint uFlags); + + [DllImport("user32.dll")] + public static extern IntPtr GetWindow( + IntPtr hWnd, + uint uCmd); + + [DllImport("user32.dll")] + public static extern IntPtr GetForegroundWindow(); + + public const int EVENT_SYSTEM_FOREGROUND = 0x3; + public const int EVENT_SYSTEM_MINIMIZESTART = 0x16; + public const int EVENT_SYSTEM_MINIMIZEEND = 0x17; + public const int WINEVENT_OUTOFCONTEXT = 0x0; + + public const int HWND_TOPMOST = -1; + + public const uint SWP_NOSIZE = 0x0001; + public const uint SWP_NOMOVE = 0x0002; + public const uint SWP_NOACTIVATE = 0x0010; + + public const uint GW_HWNDPREV = 0x0003; + public struct BlendFunction { public byte BlendOp; @@ -163,14 +234,14 @@ private static int ToIntPtr32(IntPtr intPtr) public static IntPtr SetWindowLongA(IntPtr hWnd, int nIndex, IntPtr dwNewLong) { - int error = 0; - IntPtr result = IntPtr.Zero; + var error = 0; + var result = IntPtr.Zero; SetLastError(0); if (IntPtr.Size == 4) { - Int32 result32 = SetWindowLong(hWnd, nIndex, ToIntPtr32(dwNewLong)); + var result32 = SetWindowLong(hWnd, nIndex, ToIntPtr32(dwNewLong)); error = Marshal.GetLastWin32Error(); result = new IntPtr(result32); } @@ -187,41 +258,8 @@ public static IntPtr SetWindowLongA(IntPtr hWnd, int nIndex, IntPtr dwNewLong) return result; } - - [DllImport("user32.dll")] - public static extern IntPtr GetWindow( - IntPtr hWnd, // 元ウィンドウのハンドル - uint uCmd // 関係 - ); - - public const uint GW_HWNDPREV = 0x0003; - - [DllImport("user32.dll")] - public static extern bool SetWindowPos( - IntPtr hWnd, // ウィンドウのハンドル - IntPtr hWndInsertAfter, // 配置順序のハンドル - int X, // 横方向の位置 - int Y, // 縦方向の位置 - int cx, // 幅 - int cy, // 高さ - uint uFlags // ウィンドウ位置のオプション - ); - + public static readonly IntPtr HWND_TOP = new IntPtr(0); - public static readonly IntPtr HWND_TOPMOST = new IntPtr(-1); - - public const uint SWP_NOSIZE = 0x0001; - public const uint SWP_NOMOVE = 0x0002; - public const uint SWP_NOACTIVATE = 0x0010; - - [DllImport("user32.dll", SetLastError = true)] - public static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId); - - [DllImport("user32.dll")] - public static extern IntPtr GetForegroundWindow(); - - [DllImport("kernel32.dll", SetLastError = true)] - public static extern int GetModuleFileName(IntPtr hModule, StringBuilder lpFilename, int nSize); [DllImport("user32.dll")] public static extern short GetKeyState(int nVirtKey); diff --git a/OverlayPlugin.Core/UI Classes/Structures/RECT.cs b/OverlayPlugin.Core/UI Classes/Structures/RECT.cs new file mode 100644 index 000000000..713928656 --- /dev/null +++ b/OverlayPlugin.Core/UI Classes/Structures/RECT.cs @@ -0,0 +1,44 @@ +using System.Drawing; +using System.Runtime.InteropServices; + +namespace RainbowMage.OverlayPlugin +{ + /* + * Part of SRT4: https://github.com/laiglinne-ff/SRT4/blob/master/Client/SRinnLib/Design/MaterialColorTab.cs + * Copyright (c) 2014 Laighlinne; Licensed GNU General Public License 3.0. + * + + OverlayPageUI, OverlayTabUI + + + */ + [StructLayout(LayoutKind.Sequential)] + public struct RECT + { + public int left; + public int top; + public int right; + public int bottom; + + public RECT(int left, int top, int right, int bottom) + { + this.left = left; + this.top = top; + this.right = right; + this.bottom = bottom; + } + + public static explicit operator Rectangle(RECT value) + { + return new Rectangle(value.left, value.top, value.right - value.left, value.bottom - value.top); + } + public static explicit operator RECT(Rectangle value) + { + return new RECT(value.Left, value.Top, value.Right, value.Bottom); + } + + public static RECT FromXYWH(int x, int y, int width, int height) + { + return new RECT(x, + y, + x + width, + y + height); + } + } +} diff --git a/OverlayPlugin.Core/UI Classes/UserControls/ControlPanel.Designer.cs b/OverlayPlugin.Core/UI Classes/UserControls/ControlPanel.Designer.cs new file mode 100644 index 000000000..f56a5bd7d --- /dev/null +++ b/OverlayPlugin.Core/UI Classes/UserControls/ControlPanel.Designer.cs @@ -0,0 +1,553 @@ +using System.Windows.Forms; + +namespace RainbowMage.OverlayPlugin +{ + partial class ControlPanel + { + /// + /// 必要なデザイナー変数です。 + /// + private System.ComponentModel.IContainer components = null; + + /// + /// 使用中のリソースをすべてクリーンアップします。 + /// + /// マネージ リソースが破棄される場合 true、破棄されない場合は false です。 + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region コンポーネント デザイナーで生成されたコード + + /// + /// デザイナー サポートに必要なメソッドです。このメソッドの内容を + /// コード エディターで変更しないでください。 + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ControlPanel)); + this.contextMenuLogList = new System.Windows.Forms.ContextMenuStrip(this.components); + this.menuCopyLogAll = new System.Windows.Forms.ToolStripMenuItem(); + this.menuLogCopy = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator(); + this.menuFollowLatestLog = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator(); + this.menuClearLog = new System.Windows.Forms.ToolStripMenuItem(); + this.tabPageMain = new RainbowMage.OverlayPlugin.OverlayPageUI(); + this.label_ListEmpty = new System.Windows.Forms.Label(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.fbdScreenshotPath = new System.Windows.Forms.FolderBrowserDialog(); + this.ofdImage = new System.Windows.Forms.OpenFileDialog(); + this.overlayTabUI1 = new RainbowMage.OverlayPlugin.OverlayTabUI(); + this.overlaysTabPage = new RainbowMage.OverlayPlugin.OverlayPageUI(); + this.tabControl = new RainbowMage.OverlayPlugin.TabControlExt(); + this.panel1 = new System.Windows.Forms.Panel(); + this.takeScreenshotBtn = new System.Windows.Forms.Button(); + this.checkBoxAutoHide = new System.Windows.Forms.CheckBox(); + this.buttonNewOverlay = new System.Windows.Forms.Button(); + this.buttonRemoveOverlay = new System.Windows.Forms.Button(); + this.overlayLogsTabPage = new RainbowMage.OverlayPlugin.OverlayPageUI(); + 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.panel2 = new System.Windows.Forms.Panel(); + this.button1 = new System.Windows.Forms.Button(); + this.overlaySettingsTabPage = new RainbowMage.OverlayPlugin.OverlayPageUI(); + this.screenShotPathGroupbox = new System.Windows.Forms.GroupBox(); + this.screenShotTable = new System.Windows.Forms.TableLayoutPanel(); + this.screenShotMarginlabel = new System.Windows.Forms.Label(); + this.screenShotAutoClippingLabel = new System.Windows.Forms.Label(); + this.screenShotBackgroundModeLabel = new System.Windows.Forms.Label(); + this.screenShotBackgroundPathLabel = new System.Windows.Forms.Label(); + this.screenShotPathPanel = new System.Windows.Forms.Panel(); + this.screenShotPath = new System.Windows.Forms.TextBox(); + this.screenShotPathSelectButton = new System.Windows.Forms.Button(); + this.screenShotBackgroundPathPanel = new System.Windows.Forms.Panel(); + this.screenShotBackgroundPath = new System.Windows.Forms.TextBox(); + this.screenShotBackgroundPathSelect = new System.Windows.Forms.Button(); + this.screenShotAutoClipping = new System.Windows.Forms.CheckBox(); + this.screenShotBackgroundMode = new System.Windows.Forms.ComboBox(); + this.screenShotPathLabel = new System.Windows.Forms.Label(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.screenShotMargin = new System.Windows.Forms.NumericUpDown(); + this.label1 = new System.Windows.Forms.Label(); + this.overlayInformationTabPage = new RainbowMage.OverlayPlugin.OverlayPageUI(); + this.overlayPluginInformationGroupBox = new System.Windows.Forms.GroupBox(); + this.repo_dev_info_special = new System.Windows.Forms.Label(); + this.special_thanks = new System.Windows.Forms.Label(); + this.repo_dev_info = new System.Windows.Forms.Label(); + this.developers = new System.Windows.Forms.Label(); + this.contextMenuLogList.SuspendLayout(); + this.tabPageMain.SuspendLayout(); + this.overlayTabUI1.SuspendLayout(); + this.overlaysTabPage.SuspendLayout(); + this.panel1.SuspendLayout(); + this.overlayLogsTabPage.SuspendLayout(); + this.panel2.SuspendLayout(); + this.overlaySettingsTabPage.SuspendLayout(); + this.screenShotPathGroupbox.SuspendLayout(); + this.screenShotTable.SuspendLayout(); + this.screenShotPathPanel.SuspendLayout(); + this.screenShotBackgroundPathPanel.SuspendLayout(); + this.tableLayoutPanel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.screenShotMargin)).BeginInit(); + this.overlayInformationTabPage.SuspendLayout(); + this.overlayPluginInformationGroupBox.SuspendLayout(); + this.SuspendLayout(); + // + // contextMenuLogList + // + this.contextMenuLogList.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.menuCopyLogAll, + this.menuLogCopy, + this.toolStripMenuItem1, + this.menuFollowLatestLog, + this.toolStripMenuItem2, + this.menuClearLog}); + this.contextMenuLogList.Name = "contextMenuLogList"; + resources.ApplyResources(this.contextMenuLogList, "contextMenuLogList"); + // + // menuCopyLogAll + // + this.menuCopyLogAll.Name = "menuCopyLogAll"; + resources.ApplyResources(this.menuCopyLogAll, "menuCopyLogAll"); + this.menuCopyLogAll.Click += new System.EventHandler(this.MenuCopyLogAll_Click); + // + // menuLogCopy + // + this.menuLogCopy.Name = "menuLogCopy"; + resources.ApplyResources(this.menuLogCopy, "menuLogCopy"); + this.menuLogCopy.Click += new System.EventHandler(this.MenuLogCopy_Click); + // + // toolStripMenuItem1 + // + this.toolStripMenuItem1.Name = "toolStripMenuItem1"; + resources.ApplyResources(this.toolStripMenuItem1, "toolStripMenuItem1"); + // + // menuFollowLatestLog + // + this.menuFollowLatestLog.CheckOnClick = true; + this.menuFollowLatestLog.Name = "menuFollowLatestLog"; + resources.ApplyResources(this.menuFollowLatestLog, "menuFollowLatestLog"); + this.menuFollowLatestLog.Click += new System.EventHandler(this.MenwFollowLatestLog_Click); + // + // toolStripMenuItem2 + // + this.toolStripMenuItem2.Name = "toolStripMenuItem2"; + resources.ApplyResources(this.toolStripMenuItem2, "toolStripMenuItem2"); + // + // menuClearLog + // + this.menuClearLog.Name = "menuClearLog"; + resources.ApplyResources(this.menuClearLog, "menuClearLog"); + this.menuClearLog.Click += new System.EventHandler(this.MenuClearLog_Click); + // + // tabPageMain + // + this.tabPageMain.Controls.Add(this.label_ListEmpty); + resources.ApplyResources(this.tabPageMain, "tabPageMain"); + this.tabPageMain.Name = "tabPageMain"; + this.tabPageMain.TabImage = null; + this.tabPageMain.UseVisualStyleBackColor = true; + // + // label_ListEmpty + // + resources.ApplyResources(this.label_ListEmpty, "label_ListEmpty"); + this.label_ListEmpty.Name = "label_ListEmpty"; + // + // groupBox2 + // + resources.ApplyResources(this.groupBox2, "groupBox2"); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.TabStop = false; + // + // ofdImage + // + resources.ApplyResources(this.ofdImage, "ofdImage"); + // + // overlayTabUI1 + // + this.overlayTabUI1.Controls.Add(this.overlaysTabPage); + this.overlayTabUI1.Controls.Add(this.overlayLogsTabPage); + this.overlayTabUI1.Controls.Add(this.overlaySettingsTabPage); + this.overlayTabUI1.Controls.Add(this.overlayInformationTabPage); + resources.ApplyResources(this.overlayTabUI1, "overlayTabUI1"); + this.overlayTabUI1.Name = "overlayTabUI1"; + this.overlayTabUI1.SelectedIndex = 0; + // + // overlaysTabPage + // + this.overlaysTabPage.Controls.Add(this.tabControl); + this.overlaysTabPage.Controls.Add(this.panel1); + resources.ApplyResources(this.overlaysTabPage, "overlaysTabPage"); + this.overlaysTabPage.Name = "overlaysTabPage"; + this.overlaysTabPage.TabImage = ((System.Drawing.Image)(resources.GetObject("overlaysTabPage.TabImage"))); + this.overlaysTabPage.UseVisualStyleBackColor = true; + // + // tabControl + // + resources.ApplyResources(this.tabControl, "tabControl"); + this.tabControl.Multiline = true; + this.tabControl.Name = "tabControl"; + this.tabControl.SelectedIndex = 0; + this.tabControl.SizeMode = System.Windows.Forms.TabSizeMode.Fixed; + // + // panel1 + // + this.panel1.Controls.Add(this.takeScreenshotBtn); + this.panel1.Controls.Add(this.checkBoxAutoHide); + this.panel1.Controls.Add(this.buttonNewOverlay); + this.panel1.Controls.Add(this.buttonRemoveOverlay); + resources.ApplyResources(this.panel1, "panel1"); + this.panel1.Name = "panel1"; + // + // takeScreenshotBtn + // + resources.ApplyResources(this.takeScreenshotBtn, "takeScreenshotBtn"); + this.takeScreenshotBtn.Name = "takeScreenshotBtn"; + this.takeScreenshotBtn.UseVisualStyleBackColor = true; + this.takeScreenshotBtn.Click += new System.EventHandler(this.TakeScreenshotBtn_Click); + // + // checkBoxAutoHide + // + resources.ApplyResources(this.checkBoxAutoHide, "checkBoxAutoHide"); + this.checkBoxAutoHide.Name = "checkBoxAutoHide"; + this.checkBoxAutoHide.UseVisualStyleBackColor = true; + this.checkBoxAutoHide.CheckedChanged += new System.EventHandler(this.CheckBoxAutoHide_CheckedChanged); + // + // buttonNewOverlay + // + resources.ApplyResources(this.buttonNewOverlay, "buttonNewOverlay"); + this.buttonNewOverlay.Name = "buttonNewOverlay"; + this.buttonNewOverlay.UseVisualStyleBackColor = true; + this.buttonNewOverlay.Click += new System.EventHandler(this.ButtonNewOverlay_Click); + // + // buttonRemoveOverlay + // + resources.ApplyResources(this.buttonRemoveOverlay, "buttonRemoveOverlay"); + this.buttonRemoveOverlay.Name = "buttonRemoveOverlay"; + this.buttonRemoveOverlay.UseVisualStyleBackColor = true; + this.buttonRemoveOverlay.Click += new System.EventHandler(this.ButtonRemoveOverlay_Click); + // + // overlayLogsTabPage + // + this.overlayLogsTabPage.Controls.Add(this.listViewLog); + this.overlayLogsTabPage.Controls.Add(this.panel2); + resources.ApplyResources(this.overlayLogsTabPage, "overlayLogsTabPage"); + this.overlayLogsTabPage.Name = "overlayLogsTabPage"; + this.overlayLogsTabPage.TabImage = ((System.Drawing.Image)(resources.GetObject("overlayLogsTabPage.TabImage"))); + this.overlayLogsTabPage.UseVisualStyleBackColor = true; + // + // listViewLog + // + this.listViewLog.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.listViewLog.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnHeader1, + this.columnHeader2, + this.columnHeader3}); + this.listViewLog.ContextMenuStrip = this.contextMenuLogList; + resources.ApplyResources(this.listViewLog, "listViewLog"); + this.listViewLog.FullRowSelect = true; + this.listViewLog.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable; + this.listViewLog.HideSelection = false; + this.listViewLog.Name = "listViewLog"; + 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 + // + resources.ApplyResources(this.columnHeader1, "columnHeader1"); + // + // columnHeader2 + // + resources.ApplyResources(this.columnHeader2, "columnHeader2"); + // + // columnHeader3 + // + resources.ApplyResources(this.columnHeader3, "columnHeader3"); + // + // panel2 + // + this.panel2.Controls.Add(this.button1); + resources.ApplyResources(this.panel2, "panel2"); + this.panel2.Name = "panel2"; + // + // button1 + // + resources.ApplyResources(this.button1, "button1"); + this.button1.Name = "button1"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.MenuClearLog_Click); + // + // overlaySettingsTabPage + // + this.overlaySettingsTabPage.Controls.Add(this.screenShotPathGroupbox); + resources.ApplyResources(this.overlaySettingsTabPage, "overlaySettingsTabPage"); + this.overlaySettingsTabPage.Name = "overlaySettingsTabPage"; + this.overlaySettingsTabPage.TabImage = ((System.Drawing.Image)(resources.GetObject("overlaySettingsTabPage.TabImage"))); + this.overlaySettingsTabPage.UseVisualStyleBackColor = true; + // + // screenShotPathGroupbox + // + resources.ApplyResources(this.screenShotPathGroupbox, "screenShotPathGroupbox"); + this.screenShotPathGroupbox.Controls.Add(this.screenShotTable); + this.screenShotPathGroupbox.Name = "screenShotPathGroupbox"; + this.screenShotPathGroupbox.TabStop = false; + // + // screenShotTable + // + resources.ApplyResources(this.screenShotTable, "screenShotTable"); + this.screenShotTable.Controls.Add(this.screenShotMarginlabel, 0, 4); + this.screenShotTable.Controls.Add(this.screenShotAutoClippingLabel, 0, 3); + this.screenShotTable.Controls.Add(this.screenShotBackgroundModeLabel, 0, 2); + this.screenShotTable.Controls.Add(this.screenShotBackgroundPathLabel, 0, 1); + this.screenShotTable.Controls.Add(this.screenShotPathPanel, 1, 0); + this.screenShotTable.Controls.Add(this.screenShotBackgroundPathPanel, 1, 1); + this.screenShotTable.Controls.Add(this.screenShotAutoClipping, 1, 3); + this.screenShotTable.Controls.Add(this.screenShotBackgroundMode, 1, 2); + this.screenShotTable.Controls.Add(this.screenShotPathLabel, 0, 0); + this.screenShotTable.Controls.Add(this.tableLayoutPanel1, 1, 4); + this.screenShotTable.Name = "screenShotTable"; + // + // screenShotMarginlabel + // + resources.ApplyResources(this.screenShotMarginlabel, "screenShotMarginlabel"); + this.screenShotMarginlabel.Name = "screenShotMarginlabel"; + // + // screenShotAutoClippingLabel + // + resources.ApplyResources(this.screenShotAutoClippingLabel, "screenShotAutoClippingLabel"); + this.screenShotAutoClippingLabel.Name = "screenShotAutoClippingLabel"; + // + // screenShotBackgroundModeLabel + // + resources.ApplyResources(this.screenShotBackgroundModeLabel, "screenShotBackgroundModeLabel"); + this.screenShotBackgroundModeLabel.Name = "screenShotBackgroundModeLabel"; + // + // screenShotBackgroundPathLabel + // + resources.ApplyResources(this.screenShotBackgroundPathLabel, "screenShotBackgroundPathLabel"); + this.screenShotBackgroundPathLabel.Name = "screenShotBackgroundPathLabel"; + // + // screenShotPathPanel + // + this.screenShotPathPanel.Controls.Add(this.screenShotPath); + this.screenShotPathPanel.Controls.Add(this.screenShotPathSelectButton); + resources.ApplyResources(this.screenShotPathPanel, "screenShotPathPanel"); + this.screenShotPathPanel.Name = "screenShotPathPanel"; + // + // screenShotPath + // + resources.ApplyResources(this.screenShotPath, "screenShotPath"); + this.screenShotPath.Name = "screenShotPath"; + // + // screenShotPathSelectButton + // + resources.ApplyResources(this.screenShotPathSelectButton, "screenShotPathSelectButton"); + this.screenShotPathSelectButton.Name = "screenShotPathSelectButton"; + this.screenShotPathSelectButton.UseVisualStyleBackColor = true; + this.screenShotPathSelectButton.Click += new System.EventHandler(this.ScreenshotPathSelectButton_Click); + // + // screenShotBackgroundPathPanel + // + this.screenShotBackgroundPathPanel.Controls.Add(this.screenShotBackgroundPath); + this.screenShotBackgroundPathPanel.Controls.Add(this.screenShotBackgroundPathSelect); + resources.ApplyResources(this.screenShotBackgroundPathPanel, "screenShotBackgroundPathPanel"); + this.screenShotBackgroundPathPanel.Name = "screenShotBackgroundPathPanel"; + // + // screenShotBackgroundPath + // + resources.ApplyResources(this.screenShotBackgroundPath, "screenShotBackgroundPath"); + this.screenShotBackgroundPath.Name = "screenShotBackgroundPath"; + // + // screenShotBackgroundPathSelect + // + resources.ApplyResources(this.screenShotBackgroundPathSelect, "screenShotBackgroundPathSelect"); + this.screenShotBackgroundPathSelect.Name = "screenShotBackgroundPathSelect"; + this.screenShotBackgroundPathSelect.UseVisualStyleBackColor = true; + this.screenShotBackgroundPathSelect.Click += new System.EventHandler(this.ScreenshotBackgroundPathSelect_Click); + // + // screenShotAutoClipping + // + resources.ApplyResources(this.screenShotAutoClipping, "screenShotAutoClipping"); + this.screenShotAutoClipping.Name = "screenShotAutoClipping"; + this.screenShotAutoClipping.UseVisualStyleBackColor = true; + this.screenShotAutoClipping.CheckedChanged += new System.EventHandler(this.ScreenshotAutoClipping_CheckedChanged); + // + // screenShotBackgroundMode + // + resources.ApplyResources(this.screenShotBackgroundMode, "screenShotBackgroundMode"); + this.screenShotBackgroundMode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.screenShotBackgroundMode.FormattingEnabled = true; + this.screenShotBackgroundMode.Items.AddRange(new object[] { + resources.GetString("screenShotBackgroundMode.Items"), + resources.GetString("screenShotBackgroundMode.Items1"), + resources.GetString("screenShotBackgroundMode.Items2"), + resources.GetString("screenShotBackgroundMode.Items3"), + resources.GetString("screenShotBackgroundMode.Items4"), + resources.GetString("screenShotBackgroundMode.Items5")}); + this.screenShotBackgroundMode.Name = "screenShotBackgroundMode"; + this.screenShotBackgroundMode.SelectedIndexChanged += new System.EventHandler(this.ScreenshotBackgroundFillType_SelectedIndexChanged); + // + // screenShotPathLabel + // + resources.ApplyResources(this.screenShotPathLabel, "screenShotPathLabel"); + this.screenShotPathLabel.Name = "screenShotPathLabel"; + // + // tableLayoutPanel1 + // + resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1"); + this.tableLayoutPanel1.Controls.Add(this.screenShotMargin, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.label1, 1, 0); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + // + // screenShotMargin + // + resources.ApplyResources(this.screenShotMargin, "screenShotMargin"); + this.screenShotMargin.Maximum = new decimal(new int[] { + 10, + 0, + 0, + 0}); + this.screenShotMargin.Name = "screenShotMargin"; + this.screenShotMargin.ValueChanged += new System.EventHandler(this.ScreenshotMargin_ValueChanged); + // + // label1 + // + resources.ApplyResources(this.label1, "label1"); + this.label1.Name = "label1"; + // + // overlayInformationTabPage + // + this.overlayInformationTabPage.Controls.Add(this.overlayPluginInformationGroupBox); + resources.ApplyResources(this.overlayInformationTabPage, "overlayInformationTabPage"); + this.overlayInformationTabPage.Name = "overlayInformationTabPage"; + this.overlayInformationTabPage.TabImage = ((System.Drawing.Image)(resources.GetObject("overlayInformationTabPage.TabImage"))); + this.overlayInformationTabPage.UseVisualStyleBackColor = true; + // + // overlayPluginInformationGroupBox + // + this.overlayPluginInformationGroupBox.Controls.Add(this.repo_dev_info_special); + this.overlayPluginInformationGroupBox.Controls.Add(this.special_thanks); + this.overlayPluginInformationGroupBox.Controls.Add(this.repo_dev_info); + this.overlayPluginInformationGroupBox.Controls.Add(this.developers); + resources.ApplyResources(this.overlayPluginInformationGroupBox, "overlayPluginInformationGroupBox"); + this.overlayPluginInformationGroupBox.Name = "overlayPluginInformationGroupBox"; + this.overlayPluginInformationGroupBox.TabStop = false; + // + // repo_dev_info_special + // + resources.ApplyResources(this.repo_dev_info_special, "repo_dev_info_special"); + this.repo_dev_info_special.Name = "repo_dev_info_special"; + // + // special_thanks + // + resources.ApplyResources(this.special_thanks, "special_thanks"); + this.special_thanks.Name = "special_thanks"; + // + // repo_dev_info + // + resources.ApplyResources(this.repo_dev_info, "repo_dev_info"); + this.repo_dev_info.Name = "repo_dev_info"; + // + // developers + // + resources.ApplyResources(this.developers, "developers"); + this.developers.Name = "developers"; + // + // ControlPanel + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.SystemColors.ControlLightLight; + this.Controls.Add(this.overlayTabUI1); + this.Name = "ControlPanel"; + this.contextMenuLogList.ResumeLayout(false); + this.tabPageMain.ResumeLayout(false); + this.overlayTabUI1.ResumeLayout(false); + this.overlaysTabPage.ResumeLayout(false); + this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); + this.overlayLogsTabPage.ResumeLayout(false); + this.panel2.ResumeLayout(false); + this.overlaySettingsTabPage.ResumeLayout(false); + this.overlaySettingsTabPage.PerformLayout(); + this.screenShotPathGroupbox.ResumeLayout(false); + this.screenShotPathGroupbox.PerformLayout(); + this.screenShotTable.ResumeLayout(false); + this.screenShotPathPanel.ResumeLayout(false); + this.screenShotPathPanel.PerformLayout(); + this.screenShotBackgroundPathPanel.ResumeLayout(false); + this.screenShotBackgroundPathPanel.PerformLayout(); + this.tableLayoutPanel1.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.screenShotMargin)).EndInit(); + this.overlayInformationTabPage.ResumeLayout(false); + this.overlayPluginInformationGroupBox.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + private System.Windows.Forms.ContextMenuStrip contextMenuLogList; + private System.Windows.Forms.ToolStripMenuItem menuLogCopy; + private RainbowMage.OverlayPlugin.TabControlExt tabControl; + 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; + private OverlayPageUI tabPageMain; + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.Button buttonRemoveOverlay; + private System.Windows.Forms.Button buttonNewOverlay; + private System.Windows.Forms.CheckBox checkBoxAutoHide; + private Label label_ListEmpty; + private OverlayTabUI overlayTabUI1; + private OverlayPageUI overlaysTabPage; + private OverlayPageUI overlayLogsTabPage; + private OverlayPageUI overlayInformationTabPage; + private Panel panel1; + private Button takeScreenshotBtn; + private FolderBrowserDialog fbdScreenshotPath; + private OpenFileDialog ofdImage; + private OverlayPageUI overlaySettingsTabPage; + private GroupBox screenShotPathGroupbox; + private TableLayoutPanel screenShotTable; + private Label screenShotMarginlabel; + private Label screenShotAutoClippingLabel; + private Label screenShotBackgroundModeLabel; + private Label screenShotBackgroundPathLabel; + private Panel screenShotPathPanel; + private TextBox screenShotPath; + private Button screenShotPathSelectButton; + private Panel screenShotBackgroundPathPanel; + private TextBox screenShotBackgroundPath; + private Button screenShotBackgroundPathSelect; + private CheckBox screenShotAutoClipping; + private ComboBox screenShotBackgroundMode; + private NumericUpDown screenShotMargin; + private Label screenShotPathLabel; + private GroupBox overlayPluginInformationGroupBox; + private Label repo_dev_info_special; + private Label special_thanks; + private Label repo_dev_info; + private Label developers; + private Panel panel2; + private Button button1; + private TableLayoutPanel tableLayoutPanel1; + private Label label1; + } +} diff --git a/OverlayPlugin.Core/ControlPanel.cs b/OverlayPlugin.Core/UI Classes/UserControls/ControlPanel.cs similarity index 60% rename from OverlayPlugin.Core/ControlPanel.cs rename to OverlayPlugin.Core/UI Classes/UserControls/ControlPanel.cs index 805a7d4ec..e119c6dd9 100644 --- a/OverlayPlugin.Core/ControlPanel.cs +++ b/OverlayPlugin.Core/UI Classes/UserControls/ControlPanel.cs @@ -1,14 +1,10 @@ using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; using System.Data; +using System.Drawing; +using System.IO; using System.Linq; using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; -using System.Globalization; -using System.Threading; namespace RainbowMage.OverlayPlugin { @@ -27,11 +23,11 @@ public ControlPanel(PluginMain pluginMain, PluginConfig config) this.checkBoxAutoHide.Checked = this.config.HideOverlaysWhenNotActive; this.menuFollowLatestLog.Checked = this.config.FollowLatestLog; - this.listViewLog.VirtualListSize = pluginMain.Logger.Logs.Count; - this.pluginMain.Logger.Logs.ListChanged += (o, e) => + this.listViewLog.VirtualListSize = PluginMain.Logger.Logs.Count; + PluginMain.Logger.Logs.ListChanged += (o, e) => { this.listViewLog.BeginUpdate(); - this.listViewLog.VirtualListSize = pluginMain.Logger.Logs.Count; + this.listViewLog.VirtualListSize = PluginMain.Logger.Logs.Count; if (this.config.FollowLatestLog && this.listViewLog.VirtualListSize > 0) { this.listViewLog.EnsureVisible(this.listViewLog.VirtualListSize - 1); @@ -40,6 +36,17 @@ public ControlPanel(PluginMain pluginMain, PluginConfig config) }; InitializeOverlayConfigTabs(); + + screenShotPath.Text = config.ScreenshotSavePath; + screenShotBackgroundPath.Text = config.ScreenshotBackgroundPath; + screenShotBackgroundMode.SelectedIndex = config.ScreenshotBackgroundMode; + screenShotAutoClipping.Checked = config.ScreenshotAutoClipping; + screenShotMargin.Value = config.ScreenshotMargin; + + if (string.IsNullOrWhiteSpace(screenShotPath.Text)) + { + screenShotPath.Text = PluginMain.DefaultScreenshotPath; + } } private void InitializeOverlayConfigTabs() @@ -74,7 +81,7 @@ private void AddConfigTab(IOverlay overlay) } } - private void menuLogCopy_Click(object sender, EventArgs e) + private void MenuLogCopy_Click(object sender, EventArgs e) { if (listViewLog.SelectedIndices.Count > 0) { @@ -83,24 +90,24 @@ private void menuLogCopy_Click(object sender, EventArgs e) { sb.AppendFormat( "{0}: {1}: {2}", - pluginMain.Logger.Logs[index].Time, - pluginMain.Logger.Logs[index].Level, - pluginMain.Logger.Logs[index].Message); + PluginMain.Logger.Logs[index].Time, + PluginMain.Logger.Logs[index].Level, + PluginMain.Logger.Logs[index].Message); sb.AppendLine(); } Clipboard.SetText(sb.ToString()); } } - private void listViewLog_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e) + private void ListViewLog_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e) { - if (e.ItemIndex >= pluginMain.Logger.Logs.Count) + if (e.ItemIndex >= PluginMain.Logger.Logs.Count) { e.Item = new ListViewItem(); return; }; - var log = this.pluginMain.Logger.Logs[e.ItemIndex]; + var log = PluginMain.Logger.Logs[e.ItemIndex]; e.Item = new ListViewItem(log.Time.ToString()); e.Item.UseItemStyleForSubItems = true; e.Item.SubItems.Add(log.Level.ToString()); @@ -121,20 +128,20 @@ private void listViewLog_RetrieveVirtualItem(object sender, RetrieveVirtualItemE } } - private void menuFollowLatestLog_Click(object sender, EventArgs e) + private void MenwFollowLatestLog_Click(object sender, EventArgs e) { this.config.FollowLatestLog = menuFollowLatestLog.Checked; } - private void menuClearLog_Click(object sender, EventArgs e) + private void MenuClearLog_Click(object sender, EventArgs e) { - this.pluginMain.Logger.Logs.Clear(); + PluginMain.Logger.Logs.Clear(); } - private void menuCopyLogAll_Click(object sender, EventArgs e) + private void MenuCopyLogAll_Click(object sender, EventArgs e) { var sb = new StringBuilder(); - foreach (var log in this.pluginMain.Logger.Logs) + foreach (var log in PluginMain.Logger.Logs) { sb.AppendFormat( "{0}: {1}: {2}", @@ -146,7 +153,7 @@ private void menuCopyLogAll_Click(object sender, EventArgs e) Clipboard.SetText(sb.ToString()); } - private void buttonNewOverlay_Click(object sender, EventArgs e) + private void ButtonNewOverlay_Click(object sender, EventArgs e) { var newOverlayDialog = new NewOverlayDialog(pluginMain); newOverlayDialog.NameValidator = (name) => @@ -194,16 +201,16 @@ private IOverlay CreateAndRegisterOverlay(IOverlayAddon overlayType, string name return overlay; } - private void buttonRemoveOverlay_Click(object sender, EventArgs e) + private void ButtonRemoveOverlay_Click(object sender, EventArgs e) { if (this.tabControl.SelectedTab.Equals(this.tabPageMain)) return; - if (tabControl.SelectedTab == null) // ??? - tabControl.SelectedTab = tabControl.TabPages[0]; + if (tabControl.SelectedTab == null) + return; - string selectedOverlayName = tabControl.SelectedTab.Name; - int selectedOverlayIndex = tabControl.TabPages.IndexOf(tabControl.SelectedTab); + var selectedOverlayName = tabControl.SelectedTab.Name; + var selectedOverlayIndex = tabControl.TabPages.IndexOf(tabControl.SelectedTab); // コンフィグ削除 var configs = this.config.Overlays.Where(x => x.Name == selectedOverlayName); @@ -241,9 +248,82 @@ private void buttonRemoveOverlay_Click(object sender, EventArgs e) this.tabControl.Update(); } - private void checkBoxAutoHide_CheckedChanged(object sender, EventArgs e) + private void CheckBoxAutoHide_CheckedChanged(object sender, EventArgs e) { config.HideOverlaysWhenNotActive = checkBoxAutoHide.Checked; } + + private void ScreenshotPath_Leave(object sender, EventArgs e) + { + config.ScreenshotSavePath = screenShotPath.Text; + } + + private void ScreenshotPathSelectButton_Click(object sender, EventArgs e) + { + this.fbdScreenshotPath.SelectedPath = this.screenShotPath.Text; + + if (this.fbdScreenshotPath.ShowDialog() == DialogResult.OK) + { + screenShotPath.Text = this.fbdScreenshotPath.SelectedPath; + config.ScreenshotSavePath = this.fbdScreenshotPath.SelectedPath; + } + } + + private void ScreenshotBackgroundPath_Leave(object sender, EventArgs e) + { + config.ScreenshotBackgroundPath = screenShotBackgroundPath.Text; + } + + private void ScreenshotBackgroundPathSelect_Click(object sender, EventArgs e) + { + this.ofdImage.FileName = this.screenShotBackgroundPath.Text; + + if (this.ofdImage.ShowDialog() == DialogResult.OK) + { + screenShotBackgroundPath.Text = this.ofdImage.FileName; + config.ScreenshotBackgroundPath = this.ofdImage.FileName; + } + } + + private void ScreenshotBackgroundFillType_SelectedIndexChanged(object sender, EventArgs e) + { + config.ScreenshotBackgroundMode = screenShotBackgroundMode.SelectedIndex; + } + + private void ScreenshotAutoClipping_CheckedChanged(object sender, EventArgs e) + { + config.ScreenshotAutoClipping = screenShotAutoClipping.Checked; + } + + private void ScreenshotMargin_ValueChanged(object sender, EventArgs e) + { + config.ScreenshotMargin = (int)screenShotMargin.Value; + } + + private void TakeScreenshotBtn_Click(object sender, EventArgs e) + { + if (tabControl.SelectedIndex < 0) return; + var selTab = tabControl.SelectedIndex; + + if (pluginMain.Overlays.Count < 1) return; + var selectedOverlay = pluginMain.Overlays[selTab]; + + try + { + selectedOverlay.TakeScreenshot( + new ScreenshotConfig + { + SavePath = config.ScreenshotSavePath, + AutoClipping = config.ScreenshotAutoClipping, + BackgroundImagePath = config.ScreenshotBackgroundPath, + BackgroundMode = (ScreenshotBackgroundMode)config.ScreenshotBackgroundMode, + Margin = config.ScreenshotMargin, + }); + } + catch (Exception ex) + { + MessageBox.Show(ex.GetBaseException().ToString()); + } + } } } diff --git a/OverlayPlugin.Core/UI Classes/UserControls/ControlPanel.ja-JP.resx b/OverlayPlugin.Core/UI Classes/UserControls/ControlPanel.ja-JP.resx new file mode 100644 index 000000000..cb55629e0 --- /dev/null +++ b/OverlayPlugin.Core/UI Classes/UserControls/ControlPanel.ja-JP.resx @@ -0,0 +1,391 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + + 206, 22 + + + 全てのログをコピー + + + 206, 22 + + + 選択されたログをコピー + + + 203, 6 + + + 206, 22 + + + 最新のログを常に表示 + + + 203, 6 + + + 206, 22 + + + ログをクリア + + + 207, 104 + + + [追加] バートンを押して、オーバーレイを設定してください + + + MiddleCenter + + + 設定 + + + + None + + + 0, 0 + + + 200, 100 + + + + 0 + + + 777, 484 + + + 647, 4 + + + 画面キャプチャ + + + 189, 4 + + + 249, 19 + + + 非アクティブのときに自動的にオーバーレイを隠す + + + 追加 + + + 削除 + + + 777, 38 + + + 781, 523 + + + + iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xNkRpr/UAAACASURBVDhP7ZVB + CsAgDAT9/6v8WauUSRaxJFaPFaYsSWavLe3VxnWI3jVd7PCE9vrnM/RYGIZL/IU+3IEeC8MwhCKQnR+Q + M1AEsvMDcgaKQHZ+QM5AEchufrAKPRaGoYEQIY6LZAUhQhwXyQpChDgukhWECHHWxDfo0XCKk7+AUm9A + spyD5wNYwwAAAABJRU5ErkJggg== + + + + オーバーレイ + + + 時間 + + + レベル + + + メッセージ + + + 777, 484 + + + 658, 3 + + + 全体ログ削除 + + + 777, 38 + + + 781, 523 + + + + iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xNkRpr/UAAACfSURBVDhPrZRB + EoMwCEWzcOlhelMP6wEoP8X6B+g0kixeBh75jAu1ichSUjlDKmf4HK1tyqGcCsQTkEF244UQfKnCwQuv + J3uhfwIylj17bxKHlnc9Ssh7UYHzUVid9Rl8p9deVOB8FFb/6jN4HkQFzkdhddZ7MOc7vfaiAucvsfzF + Xv7p7RDKzM9h/y78hwU7fuZJpWd0GUilZ3SZiLQ3vjZfyPZLF4YAAAAASUVORK5CYII= + + + + オーバーレイログ + + + マージン + + + オートクリッピング + + + フィル方式 + + + 背景写真 + + + 604, 23 + + + 604, 0 + + + 653, 25 + + + 604, 23 + + + 604, 0 + + + 653, 25 + + + 653, 24 + + + + + + ソース + + + 中央揃 + + + フィル + + + 画一的 + + + 画一的 (フィル) + + + 653, 23 + + + 保存パス + + + 154, 23 + + + 157, 0 + + + 653, 25 + + + 755, 127 + + + 775, 157 + + + 画面キャプチャ設定 + + + 781, 523 + + + + iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xOdTWsmQAAADISURBVDhPrZAB + DsMwCAP79D1tP8uAEssYoklVI10VG0Npr7XWq4ymYufjTDVlNBk7/gBaV7pxb2NXaAwb/LZ1FTmMUD15 + ZagO5OAm/h/RMmUGizAkZOfLnHLwm5FbsD7c/XH+hxnY+FDfqDdQzUAP6hRCMTU+T/FaZkpP1DLw7sAM + laLx/JOZHWR9uPujv7AZd9Cu0L4NOOXgF5EhwTdmWqbMKKI3TANapsxgEUY2kN6Ngfj//6GSjUDrymgq + dnzrts3EaD5nXT/2/lD+gShquwAAAABJRU5ErkJggg== + + + + 設定 + + + 757, 38 + + + 757, 17 + + + 757, 38 + + + 757, 17 + + + 777, 522 + + + オーバーレイプラグイン情報 + + + 781, 523 + + + + iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xNkRpr/UAAAE5SURBVDhPrZQx + TgMxEEWNBH0OkCJdcogUEcoB0nAVLpAiBeIECOUQOUBKjkBBB2VERUG5+c/MGC/reCVkS0+a+TMe2Tvj + DV3XNaUogtZaPIk38WW8mrYu7YGhEMJE7AVODXImg/09J4Sl+BA4nGgnNmJqYKMRI4fcZa9GVoyTebGj + mGWxW7HI/JkgB4c96aR5Qb/m0bUs9ime/2jX4kXg7JNuQRqAwVXSyVJSCHNxU9AX4lvgrKJmATqHscs3 + OFr34u5C7EFgbKNvIqOBscmTHa138XghRqMwDtE30bs2zZMdrVpBuo9xir6JzQs2v/JYU2oFGXSMXlPG + xqZYkFzhn+t3bCxYG+xBQS0G219Lf7Atofb0rtw2f/zpWWK7n0MSfk7a5veVo7USW3EQJwMbLTagRFH8 + P104A3CtC1ZCZNpjAAAAAElFTkSuQmCC + + + + プラグイン情報 + + + 779, 561 + + + Meiryo UI, 9pt + + + 779, 561 + + \ No newline at end of file diff --git a/OverlayPlugin.Core/ControlPanel.ko-KR.resx b/OverlayPlugin.Core/UI Classes/UserControls/ControlPanel.ko-KR.resx similarity index 58% rename from OverlayPlugin.Core/ControlPanel.ko-KR.resx rename to OverlayPlugin.Core/UI Classes/UserControls/ControlPanel.ko-KR.resx index a4878d314..77e376c2c 100644 --- a/OverlayPlugin.Core/ControlPanel.ko-KR.resx +++ b/OverlayPlugin.Core/UI Classes/UserControls/ControlPanel.ko-KR.resx @@ -117,23 +117,87 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 맑은 고딕, 9pt + + + 202, 22 - - 삭제 + + 모든 로그 복사 - - 추가 + + 202, 22 + + + 선택된 로그 복사 + + + 199, 6 + + + 202, 22 + + + 마지막 로그를 따라가기 + + + 199, 6 + + + 202, 22 + + + 로그 지우기 + + + 203, 104 + + + 일반 [추가] 버튼을 눌러서 오버레이를 설정해주세요. + + 22, 3 + + + + iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xNkRpr/UAAACASURBVDhP7ZVB + CsAgDAT9/6v8WauUSRaxJFaPFaYsSWavLe3VxnWI3jVd7PCE9vrnM/RYGIZL/IU+3IEeC8MwhCKQnR+Q + M1AEsvMDcgaKQHZ+QM5AEchufrAKPRaGoYEQIY6LZAUhQhwXyQpChDgukhWECHHWxDfo0XCKk7+AUm9A + spyD5wNYwwAAAABJRU5ErkJggg== + + + + 오버레이 + + + 스크린샷 촬영 + + + 234, 19 + 비활성화 시 오버레이 자동으로 감추기 - - 일반 + + 추가 + + + 삭제 + + + + iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xNkRpr/UAAACfSURBVDhPrZRB + EoMwCEWzcOlhelMP6wEoP8X6B+g0kixeBh75jAu1ichSUjlDKmf4HK1tyqGcCsQTkEF244UQfKnCwQuv + J3uhfwIylj17bxKHlnc9Ssh7UYHzUVid9Rl8p9deVOB8FFb/6jN4HkQFzkdhddZ7MOc7vfaiAucvsfzF + Xv7p7RDKzM9h/y78hwU7fuZJpWd0GUilZ3SZiLQ3vjZfyPZLF4YAAAAASUVORK5CYII= + + + + 오버레이 로그 시각 @@ -144,38 +208,86 @@ 메시지 - - - 180, 22 + + 모든 로그 삭제 - - 모든 로그 복사 + + + iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xOdTWsmQAAADISURBVDhPrZAB + DsMwCAP79D1tP8uAEssYoklVI10VG0Npr7XWq4ymYufjTDVlNBk7/gBaV7pxb2NXaAwb/LZ1FTmMUD15 + ZagO5OAm/h/RMmUGizAkZOfLnHLwm5FbsD7c/XH+hxnY+FDfqDdQzUAP6hRCMTU+T/FaZkpP1DLw7sAM + laLx/JOZHWR9uPujv7AZd9Cu0L4NOOXgF5EhwTdmWqbMKKI3TANapsxgEUY2kN6Ngfj//6GSjUDrymgq + dnzrts3EaD5nXT/2/lD+gShquwAAAABJRU5ErkJggg== + - - 180, 22 + + 설정 - - 선택된 로그 복사 + + 스크린샷 - - 177, 6 + + 여백 - - 180, 22 + + 자동 자르기 - - 마지막 로그를 따라가기 + + 채우기 방식 - - 177, 6 + + 배경 이미지 - - 180, 22 + + 숨김 - - 로그 지우기 + + 원본 - - 181, 104 + + 가운데 + + + 채우기 + + + 자동 맞춤 + + + 자동 맞춤 (채우기) + + + 저장 경로 + + + + iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xNkRpr/UAAAE5SURBVDhPrZQx + TgMxEEWNBH0OkCJdcogUEcoB0nAVLpAiBeIECOUQOUBKjkBBB2VERUG5+c/MGC/reCVkS0+a+TMe2Tvj + DV3XNaUogtZaPIk38WW8mrYu7YGhEMJE7AVODXImg/09J4Sl+BA4nGgnNmJqYKMRI4fcZa9GVoyTebGj + mGWxW7HI/JkgB4c96aR5Qb/m0bUs9ime/2jX4kXg7JNuQRqAwVXSyVJSCHNxU9AX4lvgrKJmATqHscs3 + OFr34u5C7EFgbKNvIqOBscmTHa138XghRqMwDtE30bs2zZMdrVpBuo9xir6JzQs2v/JYU2oFGXSMXlPG + xqZYkFzhn+t3bCxYG+xBQS0G219Lf7Atofb0rtw2f/zpWWK7n0MSfk7a5veVo7USW3EQJwMbLTagRFH8 + P104A3CtC1ZCZNpjAAAAAElFTkSuQmCC + + + + 플러그인 정보 + + + 오버레이 플러그인 정보 + + + 륜아린 + + + RainbowMage, 히비야, 라그린네 + + + 개발자: + + + 맑은 고딕, 9pt \ No newline at end of file diff --git a/OverlayPlugin.Core/UI Classes/UserControls/ControlPanel.resx b/OverlayPlugin.Core/UI Classes/UserControls/ControlPanel.resx new file mode 100644 index 000000000..94782c736 --- /dev/null +++ b/OverlayPlugin.Core/UI Classes/UserControls/ControlPanel.resx @@ -0,0 +1,1513 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + 259, 17 + + + + 175, 22 + + + Copy all logs + + + 175, 22 + + + Copy selected logs + + + 172, 6 + + + 175, 22 + + + Follow latest log + + + 172, 6 + + + 175, 22 + + + Clear logs + + + 176, 104 + + + contextMenuLogList + + + System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + Fill + + + NoControl + + + 3, 3 + + + 566, 242 + + + + 0 + + + Click [Add] button to configure overlays. + + + label_ListEmpty + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tabPageMain + + + 0 + + + 4, 22 + + + 3, 3, 3, 3 + + + 572, 248 + + + 2 + + + General + + + tabPageMain + + + RainbowMage.OverlayPlugin.OverlayPageUI, OverlayPlugin.Core, Version=0.3.4.0, Culture=neutral, PublicKeyToken=null + + + Fill + + + 3, 3 + + + 560, 214 + + + 1 + + + Add/Remove overlays + + + groupBox2 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 423, 17 + + + 581, 17 + + + *.png;*.jpg;*.jpeg|*.png;*.jpg;*.jpeg + + + Left + + + Fill + + + 굴림, 9pt + + + 46, 140 + + + 2, 38 + + + 3, 4, 3, 4 + + + 655, 376 + + + 2 + + + tabControl + + + RainbowMage.OverlayPlugin.TabControlExt, OverlayPlugin.Core, Version=0.3.4.0, Culture=neutral, PublicKeyToken=null + + + overlaysTabPage + + + 0 + + + Top, Right + + + NoControl + + + 525, 4 + + + 127, 29 + + + 3 + + + Take Screenshot + + + takeScreenshotBtn + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel1 + + + 0 + + + True + + + NoControl + + + 189, 10 + + + 3, 4, 3, 4 + + + 172, 19 + + + 2 + + + Automatically hide overlays + + + checkBoxAutoHide + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel1 + + + 1 + + + NoControl + + + 3, 4 + + + 3, 4, 3, 4 + + + 87, 29 + + + 1 + + + New + + + buttonNewOverlay + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel1 + + + 2 + + + NoControl + + + 96, 4 + + + 3, 4, 3, 4 + + + 87, 29 + + + 1 + + + Remove + + + buttonRemoveOverlay + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel1 + + + 3 + + + Top + + + 2, 0 + + + 655, 38 + + + 4 + + + panel1 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + overlaysTabPage + + + 1 + + + -1, 39 + + + 2, 0, 2, 1 + + + 659, 415 + + + + iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xNkRpr/UAAACASURBVDhP7ZVB + CsAgDAT9/6v8WauUSRaxJFaPFaYsSWavLe3VxnWI3jVd7PCE9vrnM/RYGIZL/IU+3IEeC8MwhCKQnR+Q + M1AEsvMDcgaKQHZ+QM5AEchufrAKPRaGoYEQIY6LZAUhQhwXyQpChDgukhWECHHWxDfo0XCKk7+AUm9A + spyD5wNYwwAAAABJRU5ErkJggg== + + + + 0 + + + Overlays + + + overlaysTabPage + + + RainbowMage.OverlayPlugin.OverlayPageUI, OverlayPlugin.Core, Version=0.3.4.0, Culture=neutral, PublicKeyToken=null + + + overlayTabUI1 + + + 0 + + + Time + + + Level + + + Message + + + 451 + + + Fill + + + 2, 38 + + + 3, 4, 3, 4 + + + 655, 376 + + + 0 + + + listViewLog + + + System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + overlayLogsTabPage + + + 0 + + + Top, Right + + + 535, 3 + + + 117, 32 + + + 0 + + + Clear Logs + + + button1 + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel2 + + + 0 + + + Top + + + 2, 0 + + + 655, 38 + + + 1 + + + panel2 + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + overlayLogsTabPage + + + 1 + + + -1, 39 + + + 2, 0, 2, 1 + + + 659, 415 + + + + iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xNkRpr/UAAACfSURBVDhPrZRB + EoMwCEWzcOlhelMP6wEoP8X6B+g0kixeBh75jAu1ichSUjlDKmf4HK1tyqGcCsQTkEF244UQfKnCwQuv + J3uhfwIylj17bxKHlnc9Ssh7UYHzUVid9Rl8p9deVOB8FFb/6jN4HkQFzkdhddZ7MOc7vfaiAucvsfzF + Xv7p7RDKzM9h/y78hwU7fuZJpWd0GUilZ3SZiLQ3vjZfyPZLF4YAAAAASUVORK5CYII= + + + + 1 + + + Overlay Logs + + + overlayLogsTabPage + + + RainbowMage.OverlayPlugin.OverlayPageUI, OverlayPlugin.Core, Version=0.3.4.0, Culture=neutral, PublicKeyToken=null + + + overlayTabUI1 + + + 1 + + + True + + + True + + + 2 + + + Fill + + + NoControl + + + 4, 101 + + + 94, 25 + + + 9 + + + Margin + + + MiddleLeft + + + screenShotMarginlabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + screenShotTable + + + 0 + + + Fill + + + NoControl + + + 4, 76 + + + 94, 25 + + + 8 + + + Auto Clipping + + + MiddleLeft + + + screenShotAutoClippingLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + screenShotTable + + + 1 + + + Fill + + + NoControl + + + 4, 51 + + + 94, 25 + + + 7 + + + Fill Mode + + + MiddleLeft + + + screenShotBackgroundModeLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + screenShotTable + + + 2 + + + Fill + + + NoControl + + + 4, 26 + + + 94, 25 + + + 6 + + + Background + + + MiddleLeft + + + screenShotBackgroundPathLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + screenShotTable + + + 3 + + + Fill + + + 0, 0 + + + 0, 0, 0, 0 + + + 482, 23 + + + 4 + + + screenShotPath + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + screenShotPathPanel + + + 0 + + + Right + + + NoControl + + + 482, 0 + + + 0, 0, 0, 1 + + + 49, 25 + + + 5 + + + + + + screenShotPathSelectButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + screenShotPathPanel + + + 1 + + + Fill + + + 101, 1 + + + 0, 0, 0, 0 + + + 531, 25 + + + 0 + + + screenShotPathPanel + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + screenShotTable + + + 4 + + + Fill + + + 0, 0 + + + 0, 1, 0, 0 + + + 482, 23 + + + 4 + + + screenShotBackgroundPath + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + screenShotBackgroundPathPanel + + + 0 + + + Right + + + NoControl + + + 482, 0 + + + 49, 25 + + + 5 + + + ... + + + screenShotBackgroundPathSelect + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + screenShotBackgroundPathPanel + + + 1 + + + Fill + + + 101, 26 + + + 0, 0, 0, 0 + + + 531, 25 + + + 1 + + + screenShotBackgroundPathPanel + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + screenShotTable + + + 5 + + + Fill + + + NoControl + + + 101, 77 + + + 0, 1, 0, 0 + + + 531, 24 + + + 2 + + + screenShotAutoClipping + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + screenShotTable + + + 6 + + + Fill + + + Hide + + + Normal + + + Center + + + Fill + + + Uniform + + + UniformToFill + + + 101, 52 + + + 0, 1, 0, 0 + + + 531, 23 + + + 3 + + + screenShotBackgroundMode + + + System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + screenShotTable + + + 7 + + + Fill + + + NoControl + + + 4, 1 + + + 94, 25 + + + 5 + + + Save Path + + + MiddleLeft + + + screenShotPathLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + screenShotTable + + + 8 + + + 2 + + + Fill + + + 0, 1 + + + 0, 1, 0, 0 + + + 125, 23 + + + 4 + + + screenShotMargin + + + System.Windows.Forms.NumericUpDown, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + Left + + + 128, 0 + + + 38, 25 + + + 5 + + + px + + + MiddleLeft + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + Fill + + + 101, 101 + + + 0, 0, 0, 0 + + + 1 + + + 531, 25 + + + 10 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + screenShotTable + + + 9 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="screenShotMargin" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label1" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Percent,23.61905,Percent,76.38095,Absolute,20,Absolute,20,Absolute,20,Absolute,20,Absolute,20,Absolute,20,Absolute,20,Absolute,20,Absolute,20,Absolute,20" /><Rows Styles="Percent,50,Percent,50" /></TableLayoutSettings> + + + Fill + + + 10, 20 + + + 1, 1, 1, 1 + + + 5 + + + 633, 127 + + + 6 + + + screenShotTable + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + screenShotPathGroupbox + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="screenShotMarginlabel" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="screenShotAutoClippingLabel" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="screenShotBackgroundModeLabel" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="screenShotBackgroundPathLabel" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="screenShotPathPanel" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="screenShotBackgroundPathPanel" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="screenShotAutoClipping" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="screenShotBackgroundMode" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="screenShotPathLabel" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="tableLayoutPanel1" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="Absolute,100,Percent,100" /><Rows Styles="Absolute,25,Absolute,25,Absolute,25,Absolute,25,Absolute,25,Absolute,20" /></TableLayoutSettings> + + + Top + + + 3, 3 + + + 10, 4, 10, 10 + + + 653, 157 + + + 1 + + + Screenshot + + + screenShotPathGroupbox + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + overlaySettingsTabPage + + + 0 + + + -1, 39 + + + 3, 3, 3, 3 + + + 659, 415 + + + + iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xOdTWsmQAAADISURBVDhPrZAB + DsMwCAP79D1tP8uAEssYoklVI10VG0Npr7XWq4ymYufjTDVlNBk7/gBaV7pxb2NXaAwb/LZ1FTmMUD15 + ZagO5OAm/h/RMmUGizAkZOfLnHLwm5FbsD7c/XH+hxnY+FDfqDdQzUAP6hRCMTU+T/FaZkpP1DLw7sAM + laLx/JOZHWR9uPujv7AZd9Cu0L4NOOXgF5EhwTdmWqbMKKI3TANapsxgEUY2kN6Ngfj//6GSjUDrymgq + dnzrts3EaD5nXT/2/lD+gShquwAAAABJRU5ErkJggg== + + + + 3 + + + Settings + + + overlaySettingsTabPage + + + RainbowMage.OverlayPlugin.OverlayPageUI, OverlayPlugin.Core, Version=0.3.4.0, Culture=neutral, PublicKeyToken=null + + + overlayTabUI1 + + + 2 + + + Top + + + NoControl + + + 10, 94 + + + 635, 38 + + + 3 + + + RyuaNerin + + + repo_dev_info_special + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + overlayPluginInformationGroupBox + + + 0 + + + Top + + + NoControl + + + 10, 77 + + + 635, 17 + + + 2 + + + Special Thanks To: + + + special_thanks + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + overlayPluginInformationGroupBox + + + 1 + + + Top + + + NoControl + + + 10, 39 + + + 635, 38 + + + 1 + + + RainbowMage, hibiyasleep, Laighlinne + + + repo_dev_info + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + overlayPluginInformationGroupBox + + + 2 + + + Top + + + NoControl + + + 10, 22 + + + 635, 17 + + + 0 + + + Developers: + + + developers + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + overlayPluginInformationGroupBox + + + 3 + + + Fill + + + Segoe UI, 10pt + + + 2, 0 + + + 10, 4, 10, 10 + + + 655, 414 + + + 4 + + + OverlayPlugin Information + + + overlayPluginInformationGroupBox + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + overlayInformationTabPage + + + 0 + + + -1, 39 + + + 2, 0, 2, 1 + + + 659, 415 + + + + iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO + wwAADsMBx2+oZAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xNkRpr/UAAAE5SURBVDhPrZQx + TgMxEEWNBH0OkCJdcogUEcoB0nAVLpAiBeIECOUQOUBKjkBBB2VERUG5+c/MGC/reCVkS0+a+TMe2Tvj + DV3XNaUogtZaPIk38WW8mrYu7YGhEMJE7AVODXImg/09J4Sl+BA4nGgnNmJqYKMRI4fcZa9GVoyTebGj + mGWxW7HI/JkgB4c96aR5Qb/m0bUs9ime/2jX4kXg7JNuQRqAwVXSyVJSCHNxU9AX4lvgrKJmATqHscs3 + OFr34u5C7EFgbKNvIqOBscmTHa138XghRqMwDtE30bs2zZMdrVpBuo9xir6JzQs2v/JYU2oFGXSMXlPG + xqZYkFzhn+t3bCxYG+xBQS0G219Lf7Atofb0rtw2f/zpWWK7n0MSfk7a5veVo7USW3EQJwMbLTagRFH8 + P104A3CtC1ZCZNpjAAAAAElFTkSuQmCC + + + + 2 + + + Plugin Information + + + overlayInformationTabPage + + + RainbowMage.OverlayPlugin.OverlayPageUI, OverlayPlugin.Core, Version=0.3.4.0, Culture=neutral, PublicKeyToken=null + + + overlayTabUI1 + + + 3 + + + Fill + + + 100, 40 + + + 0, 0 + + + 28, 3 + + + 657, 453 + + + 1 + + + overlayTabUI1 + + + RainbowMage.OverlayPlugin.OverlayTabUI, OverlayPlugin.Core, Version=0.3.4.0, Culture=neutral, PublicKeyToken=null + + + $this + + + 1 + + + True + + + 7, 15 + + + Segoe UI, 9pt + + + 3, 4, 3, 4 + + + 657, 453 + + + menuCopyLogAll + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + menuLogCopy + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + toolStripMenuItem1 + + + System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + menuFollowLatestLog + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + toolStripMenuItem2 + + + System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + menuClearLog + + + System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + fbdScreenshotPath + + + System.Windows.Forms.FolderBrowserDialog, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ofdImage + + + System.Windows.Forms.OpenFileDialog, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + columnHeader1 + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + columnHeader2 + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + columnHeader3 + + + System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ControlPanel + + + System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/OverlayPlugin.Core/UI Classes/UserControls/OverlayPageUI.cs b/OverlayPlugin.Core/UI Classes/UserControls/OverlayPageUI.cs new file mode 100644 index 000000000..333aee403 --- /dev/null +++ b/OverlayPlugin.Core/UI Classes/UserControls/OverlayPageUI.cs @@ -0,0 +1,46 @@ +using System.Drawing; +using System.Drawing.Imaging; +using System.Windows.Forms; + +namespace RainbowMage.OverlayPlugin +{ + [System.ComponentModel.DesignerCategory("CODE")] + public class OverlayPageUI : TabPage + { + private Image m_image; + public Image TabImage + { + get + { + return m_image; + } + set + { + if (m_image != value) + { + GrayImage?.Dispose(); + BlackImage?.Dispose(); + + m_image = value; + + GrayImage = MixImage(value, Color.FromArgb(36, 41, 46)); + BlackImage = MixImage(value, Color.FromArgb(182, 184, 187)); + } + } + } + public Image GrayImage { get; private set; } + public Image BlackImage { get; private set; } + + private static Image MixImage(Image image, Color color) + { + var bmp = image as Bitmap; + var img = new Bitmap(image.Width, image.Height, PixelFormat.Format32bppArgb); + + for (var x = 0; x < image.Width; x++) + for (var y = 0; y < image.Height; y++) + img.SetPixel(x, y, Color.FromArgb(bmp.GetPixel(x, y).A, color)); + + return img; + } + } +} diff --git a/OverlayPlugin.Core/UI Classes/UserControls/OverlayTabUI.cs b/OverlayPlugin.Core/UI Classes/UserControls/OverlayTabUI.cs new file mode 100644 index 000000000..ded72517c --- /dev/null +++ b/OverlayPlugin.Core/UI Classes/UserControls/OverlayTabUI.cs @@ -0,0 +1,117 @@ +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Runtime.InteropServices; +using System.Windows.Forms; + +namespace RainbowMage.OverlayPlugin +{ + [System.ComponentModel.DesignerCategory("CODE")] + public class OverlayTabUI : TabControl + { + private System.ComponentModel.IContainer components = null; + private const int TCM_FIRST = 0x1300; + private const uint TCM_ADJUSTRECT = (TCM_FIRST + 40); + private static readonly Brush LightGray = new SolidBrush(Color.FromArgb(225, 228, 232)); + private static readonly Brush LightCloud = new SolidBrush(Color.FromArgb(250, 251, 252)); + private static readonly Brush LodestoneTabFocusColor = new SolidBrush(Color.FromArgb(71, 105, 179)); + private static readonly Brush TopLiner = new SolidBrush(Color.FromArgb(227, 98, 9)); + + public OverlayTabUI() + { + Initializer(); + } + + public void Initializer() + { + InitializeComponent(); + + SetStyle((ControlStyles)(0x02 | 0x06 | 0x2000 | 0x20000), true); + DoubleBuffered = true; + Alignment = TabAlignment.Top; + } + + private void InitializeComponent() + { + components = new System.ComponentModel.Container(); + } + + static readonly Pen LightGrayPen = new Pen(Color.FromArgb(225, 228, 232), 1f); + static readonly SolidBrush BlackBrush = new SolidBrush(Color.FromArgb(36, 41, 46)); + static readonly SolidBrush GrayBrush = new SolidBrush(Color.FromArgb(88, 96, 105)); + static readonly Font OnPaintFont = new Font("Microsoft NeoGothic", 13.75f, FontStyle.Regular, GraphicsUnit.Pixel); + static readonly StringFormat strFormat = new StringFormat((StringFormatFlags)(0x1000 | 0x4000)) + { + Alignment = StringAlignment.Far + }; + + protected override void OnPaint(PaintEventArgs e) + { + base.OnPaint(e); + + e.Graphics.Clear(Color.FromArgb(255, 255, 255)); + var rect = new Rectangle(0, ItemSize.Height - 2, Width, 1); + var TBackRect = new Rectangle(0, 0, ItemSize.Height, Width); + + e.Graphics.FillRectangle(LightCloud, rect); + e.Graphics.FillRectangle(LightGray, rect); + for (var i = 0; i < TabCount; i++) + { + var TR = GetTabRect(i); + e.Graphics.SmoothingMode = SmoothingMode.AntiAlias; + var TabRectExt = new Rectangle(TR.Left - 2, TR.Top - 2, TR.Width + 4, TR.Height + 2); + if (i == SelectedIndex) + { + GraphicsExt.FillRoundedRectangle(e.Graphics, Brushes.White, TR, 1); + GraphicsExt.DrawRoundedRectangle(e.Graphics, LightGrayPen, TR, 1); + GraphicsExt.FillRoundedRectangle(e.Graphics, TopLiner, new Rectangle(TR.Left + 1, TR.Top - 1, TR.Width - 2, TR.Height), 1); + e.Graphics.SmoothingMode = SmoothingMode.Default; + e.Graphics.FillRectangle(Brushes.White, new Rectangle(TR.Left + 1, TR.Top + 2, TR.Width - 1, TR.Height)); + } + + e.Graphics.SmoothingMode = SmoothingMode.Default; + + Image img = null; + var selectedBrush = GrayBrush; + + if (TabPages[i] is OverlayPageUI tce) + { + img = tce.BlackImage; + if (i == SelectedIndex) + { + img = tce.GrayImage; + selectedBrush = BlackBrush; + } + } + + if (img != null) + e.Graphics.DrawImage(img, new Point(TR.Left + 10, 11)); + + e.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit; + e.Graphics.DrawString(TabPages[i].Text, OnPaintFont, selectedBrush, new Rectangle(TR.Left + 30, TR.Top + 9, TR.Width - 45, 20), strFormat); + } + } + + protected override void WndProc(ref Message m) + { + if ((m.Msg == TCM_ADJUSTRECT)) + { + var rc = (RECT)m.GetLParam(typeof(RECT)); + rc.left -= 5; + rc.right += 5; + rc.top -= 5; + rc.bottom += 5; + Marshal.StructureToPtr(rc, m.LParam, true); + } + base.WndProc(ref m); + } + + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + } +} diff --git a/OverlayPlugin.Core/UI Classes/UserControls/TabControlExt.cs b/OverlayPlugin.Core/UI Classes/UserControls/TabControlExt.cs new file mode 100644 index 000000000..c8781bb1d --- /dev/null +++ b/OverlayPlugin.Core/UI Classes/UserControls/TabControlExt.cs @@ -0,0 +1,92 @@ +using System; +using System.Drawing; +using System.Windows.Forms; + +namespace RainbowMage.OverlayPlugin +{ + [System.ComponentModel.DesignerCategory("CODE")] + public class TabControlExt : TabControl + { + static readonly StringFormat CenterStringFormat = new StringFormat() + { + LineAlignment = StringAlignment.Center, + Alignment = StringAlignment.Center, + }; + + private Font fontFSmall; + private Font fontBold; + public override Font Font + { + get => base.Font; + set + { + base.Font = value; + + this.fontFSmall?.Dispose(); + this.fontFSmall = new Font(value.FontFamily, (float)(value.Size * 0.85)); + + this.fontBold?.Dispose(); + this.fontBold = new Font(value, FontStyle.Bold); + } + } + + protected override void OnPaint(PaintEventArgs e) + { + base.OnPaint(e); + e.Graphics.Clear(SystemColors.ControlLightLight); + e.Graphics.FillRectangle(SystemBrushes.ControlLight, 4, 4, ItemSize.Height - 4, Height - 8); + + var inc = 0; + + foreach (TabPage tp in TabPages) + { + var fore = Brushes.Black; + var fontF = this.Font; + var tabrect = GetTabRect(inc); + var rect = new Rectangle(tabrect.X + 4, tabrect.Y + 4, tabrect.Width - 8, tabrect.Height - 2); + var textrect1 = new Rectangle(tabrect.X + 4, tabrect.Y + 4, tabrect.Width - 8, tabrect.Height - 20); + var textrect2 = new Rectangle(tabrect.X + 4, tabrect.Y + 20, tabrect.Width - 8, tabrect.Height - 20); + + if (inc == SelectedIndex) + { + e.Graphics.FillRectangle(SystemBrushes.Highlight, rect); + fore = SystemBrushes.HighlightText; + fontF = this.fontBold; + } + else + { + e.Graphics.FillRectangle(Brushes.White, rect); + } + + e.Graphics.DrawString(tp.Name, fontF, fore, textrect1, CenterStringFormat); + e.Graphics.DrawString(tp.Text, fontFSmall, fore, textrect2, CenterStringFormat); + inc++; + } + } + + protected override void OnTabIndexChanged(EventArgs e) + { + base.OnTabIndexChanged(e); + Invalidate(); + } + + public TabControlExt() : base() + { + Alignment = TabAlignment.Left; + + SetStyle(ControlStyles.AllPaintingInWmPaint, true); + SetStyle(ControlStyles.OptimizedDoubleBuffer, true); + + SetStyle(ControlStyles.ResizeRedraw, true); + SetStyle(ControlStyles.UserPaint, true); + + DoubleBuffered = true; + + ItemSize = new Size(46, 140); + SizeMode = TabSizeMode.Fixed; + BackColor = Color.Transparent; + + this.Font = base.Font; + } + } +} diff --git a/OverlayPlugin.Core/Util.cs b/OverlayPlugin.Core/Util.cs index af7d30080..0b7f990ab 100644 --- a/OverlayPlugin.Core/Util.cs +++ b/OverlayPlugin.Core/Util.cs @@ -1,12 +1,8 @@ using System; using System.Collections.Generic; using System.Drawing; -using System.Linq; using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; -using System.Diagnostics; -using System.Runtime.InteropServices; namespace RainbowMage.OverlayPlugin { @@ -46,7 +42,7 @@ public static string ReplaceNaNString(string str, string replace) public static bool IsOnScreen(Form form) { var screens = Screen.AllScreens; - foreach (Screen screen in screens) + foreach (var screen in screens) { var formRectangle = new Rectangle(form.Left, form.Top, form.Width, form.Height); @@ -66,7 +62,7 @@ public static bool IsOnScreen(Form form) /// public static void HidePreview(System.Windows.Forms.Form form) { - int ex = NativeMethods.GetWindowLong(form.Handle, NativeMethods.GWL_EXSTYLE); + var ex = NativeMethods.GetWindowLong(form.Handle, NativeMethods.GWL_EXSTYLE); ex |= NativeMethods.WS_EX_TOOLWINDOW; NativeMethods.SetWindowLongA(form.Handle, NativeMethods.GWL_EXSTYLE, (IntPtr)ex); } @@ -81,7 +77,7 @@ public static void HidePreview(System.Windows.Forms.Form form) /// public static string GetHotkeyString(Keys modifier, Keys key, String defaultText = "") { - StringBuilder sbKeys = new StringBuilder(); + var sbKeys = new StringBuilder(); if ((modifier & Keys.Shift) == Keys.Shift) { sbKeys.Append("Shift + "); @@ -101,9 +97,7 @@ public static string GetHotkeyString(Keys modifier, Keys key, String defaultText sbKeys.Append(Enum.ToObject(typeof(Keys), key).ToString()); return sbKeys.ToString(); } - - - + /// /// Removes stray references to Left/Right shifts, etc and modifications of the actual /// key value caused by bitwise operations. diff --git a/OverlayPlugin.Core/Window.cs b/OverlayPlugin.Core/Window.cs new file mode 100644 index 000000000..83e7d5cbd --- /dev/null +++ b/OverlayPlugin.Core/Window.cs @@ -0,0 +1,51 @@ +using System; +using System.Windows.Forms; + +namespace RainbowMage.OverlayPlugin +{ + /// + /// Represents the window that is used internally to get the messages. + /// + public class Window : NativeWindow, IDisposable + { + private static int WM_HOTKEY = 0x0312; + + public Window() + { + // create the handle for the window. + this.CreateHandle(new CreateParams()); + } + + /// + /// Overridden to get the notifications. + /// + /// + protected override void WndProc(ref Message m) + { + base.WndProc(ref m); + + // check if we got a hot key pressed. + if (m.Msg == WM_HOTKEY) + { + // get the keys. + var key = (Keys)(((int)m.LParam >> 16) & 0xFFFF); + var modifier = (ModifierKeys)((int)m.LParam & 0xFFFF); + + // invoke the event to notify the parent. + if (KeyPressed != null) + KeyPressed(this, new KeyPressedEventArgs(modifier, key)); + } + } + + public event EventHandler KeyPressed; + + #region IDisposable Members + + public void Dispose() + { + this.DestroyHandle(); + } + + #endregion + } +} diff --git a/OverlayPlugin.sln b/OverlayPlugin.sln index 2bb5efd9a..7980a8c54 100644 --- a/OverlayPlugin.sln +++ b/OverlayPlugin.sln @@ -9,6 +9,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HtmlRenderer", "HtmlRendere EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Files", "Files", "{84CCF15D-3E71-42A6-9C35-A5E3D19FF5DA}" ProjectSection(SolutionItems) = preProject + .editorconfig = .editorconfig .gitignore = .gitignore build.bat = build.bat Utils\distribute.ps1 = Utils\distribute.ps1 diff --git a/OverlayPlugin/AssemblyResolver.cs b/OverlayPlugin/AssemblyResolver.cs index 339c2c592..53d6ccc3d 100644 --- a/OverlayPlugin/AssemblyResolver.cs +++ b/OverlayPlugin/AssemblyResolver.cs @@ -1,11 +1,8 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq; using System.Reflection; -using System.Text; using System.Text.RegularExpressions; -using System.Threading.Tasks; namespace RainbowMage.OverlayPlugin { @@ -90,30 +87,15 @@ private Assembly GetAssembly(string path) protected void OnExceptionOccured(Exception exception) { - if (this.ExceptionOccured != null) - { - this.ExceptionOccured(this, new ExceptionOccuredEventArgs(exception)); - } + this.ExceptionOccured?.Invoke(this, new ExceptionOccuredEventArgs(exception)); } protected void OnAssemblyLoaded(Assembly assembly) { - if (this.AssemblyLoaded != null) - { - this.AssemblyLoaded(this, new AssemblyLoadEventArgs(assembly)); - } + this.AssemblyLoaded?.Invoke(this, new AssemblyLoadEventArgs(assembly)); } public event EventHandler ExceptionOccured; public event EventHandler AssemblyLoaded; - - public class ExceptionOccuredEventArgs : EventArgs - { - public Exception Exception {get; set;} - public ExceptionOccuredEventArgs(Exception exception) - { - this.Exception = exception; - } - } } } diff --git a/OverlayPlugin/ExceptionOccuredEventArgs.cs b/OverlayPlugin/ExceptionOccuredEventArgs.cs new file mode 100644 index 000000000..2c60f142d --- /dev/null +++ b/OverlayPlugin/ExceptionOccuredEventArgs.cs @@ -0,0 +1,13 @@ +using System; + +namespace RainbowMage.OverlayPlugin +{ + public class ExceptionOccuredEventArgs : EventArgs + { + public Exception Exception { get; set; } + public ExceptionOccuredEventArgs(Exception exception) + { + this.Exception = exception; + } + } +} diff --git a/OverlayPlugin/OverlayPlugin.csproj b/OverlayPlugin/OverlayPlugin.csproj index 326fcbebd..b1273262a 100644 --- a/OverlayPlugin/OverlayPlugin.csproj +++ b/OverlayPlugin/OverlayPlugin.csproj @@ -22,7 +22,7 @@ MinimumRecommendedRules.ruleset - bin\x64\Release\ + ..\Release_x64\ TRACE true pdbonly @@ -40,7 +40,7 @@ MinimumRecommendedRules.ruleset - bin\x86\Release\ + ..\Release_x86\ TRACE true pdbonly @@ -52,6 +52,7 @@ False ..\Thirdparty\ACT\Advanced Combat Tracker.exe + False @@ -64,6 +65,7 @@ + diff --git a/OverlayPlugin/PluginLoader.cs b/OverlayPlugin/PluginLoader.cs index a2a464547..248fc9d14 100644 --- a/OverlayPlugin/PluginLoader.cs +++ b/OverlayPlugin/PluginLoader.cs @@ -3,17 +3,14 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using System.Reflection; using System.Runtime.CompilerServices; -using System.Text; -using System.Text.RegularExpressions; -using System.Threading.Tasks; using System.Windows.Forms; namespace RainbowMage.OverlayPlugin { public class PluginLoader : IActPluginV1 { + public static string primaryUser = "YOU"; PluginMain pluginMain; Logger logger; AssemblyResolver asmResolver; @@ -28,7 +25,10 @@ public void InitPlugin(TabPage pluginScreenSpace, Label pluginStatusText) directories.Add(Path.Combine(pluginDirectory, "addon")); asmResolver = new AssemblyResolver(directories); + ActGlobals.oFormActMain.BeforeLogLineRead += BeforeLogLineRead; + Initialize(pluginScreenSpace, pluginStatusText); + AddExportVariable(); } // AssemblyResolver でカスタムリゾルバを追加する前に PluginMain が解決されることを防ぐために、 @@ -41,27 +41,58 @@ private void Initialize(TabPage pluginScreenSpace, Label pluginStatusText) asmResolver.AssemblyLoaded += (o, e) => logger.Log(LogLevel.Debug, "AssemblyResolver: Loaded: {0}", e.LoadedAssembly.FullName); pluginMain = new PluginMain(pluginDirectory, logger); pluginMain.InitPlugin(pluginScreenSpace, pluginStatusText); + PluginMain.PrimaryUser = "YOU"; } public void DeInitPlugin() { + ActGlobals.oFormActMain.BeforeLogLineRead -= BeforeLogLineRead; pluginMain.DeInitPlugin(); asmResolver.Dispose(); } - private string GetPluginDirectory() + public string GetPluginDirectory() { // ACT のプラグインリストからパスを取得する // Assembly.CodeBase からはパスを取得できない var plugin = ActGlobals.oFormActMain.ActPlugins.Where(x => x.pluginObj == this).FirstOrDefault(); if (plugin != null) { - return System.IO.Path.GetDirectoryName(plugin.pluginFile.FullName); + return Path.GetDirectoryName(plugin.pluginFile.FullName); } else { throw new Exception(); } } + + /// + /// ACT BeforeLogLineRead Event getting Change Primary Player Name + /// + /// + /// + private void BeforeLogLineRead(bool isImport, LogLineEventArgs logInfo) + { + if (logInfo.logLine.IndexOf("02:Changed") > -1) + { + primaryUser = logInfo.logLine; + primaryUser = primaryUser.Replace("02:Changed primary player to ", "").Replace(".", ""); + PluginMain.PrimaryUser = primaryUser = primaryUser.Substring(primaryUser.IndexOf("]") + 2); + } + } + + public void AddExportVariable() + { + if (!EncounterData.ExportVariables.ContainsKey("PrimaryUser")) + { + EncounterData.ExportVariables.Add("PrimaryUser", + new EncounterData.TextExportFormatter("PrimaryUser", "Primary Current Username", "Using ACT Current Charname 'YOU' almost get Current Username from User Input, but this Force Attach Current Username.", (Data, Extra, Format) => { return getPrimaryUserName(); })); + } + } + + public string getPrimaryUserName() + { + return primaryUser; + } } } diff --git a/OverlayPlugin/Properties/AssemblyInfo.cs b/OverlayPlugin/Properties/AssemblyInfo.cs index 62d63bcb4..cd529b2c3 100644 --- a/OverlayPlugin/Properties/AssemblyInfo.cs +++ b/OverlayPlugin/Properties/AssemblyInfo.cs @@ -1,5 +1,4 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // アセンブリに関する一般情報は以下の属性セットをとおして制御されます。 @@ -7,12 +6,8 @@ // これらの属性値を変更してください。 [assembly: AssemblyTitle("OverlayPlugin")] [assembly: AssemblyDescription("Overlay plugin for Advanced Combat Tracker")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OverlayPlugin")] [assembly: AssemblyCopyright("Copyright © RainbowMage 2015, Kuriyama hibiya 2016")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] // ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから // 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、 diff --git a/README-en.md b/README-en.md deleted file mode 100644 index a11574e13..000000000 --- a/README-en.md +++ /dev/null @@ -1,59 +0,0 @@ -# OverlayPlugin - -Plugin to show customizable mini parse and timeline overlay for Advanced Combat Tracker. - -## Download - -You can download release and pre-release archives from [release page](https://github.com/RainbowMage/OverlayPlugin/releases). - -## System requirements - -* .NET Framework 4.5 - -## How to build - -* Install .NET Framework 4.5.1 or later. -* Install [Microsoft Build Tools 2013](http://www.microsoft.com/ja-jp/download/details.aspx?id=40760). (This is not required if you installed Visual Studio 2013 already.) -* Checkout source codes with git, or download source code as ZIP and extract. -* Copy the Advanced Combat Tracker executable file (`Advanced Combat Tracker.exe`) into `Thirdparty\ACT` folder. -* Execute `build.bat`. - -Once finished, the plugin file `OverlayPlugin.dll` will appear in the `Build` folder. - -## How to use - -To use this plugin, add the `OverlayPlugin.dll` in ACT's plugin tab. It can not be moved around alone, as the files around it are important. - -When you first install, a window will appear saying "No data to show" or your DPS numbers. It can be moved by dragging a non-transparent part, and resized by dragging the bottom right corner (it's a little hard to see). - -In the Plugins tab of ACT in the `OveralyPlugin.dll` tab, you can change the settings like the formatting file (URL), or if clickthrough is enabled. - -Example HTML files are in `Build\resources` - -## Troubleshooting - -If the window does not appear, please check the message log at the bottom of the window of the `OverlayPlugin.dll` tab of the `Plugins` tab. - -### `Error: AssemblyResolve: => System.NotSupportedException` - -If you use standard Windows ZIP-ing, after downloading the archive from the Internet, it may be flagged as an untrusted file. - -If this happens, it's not possible to read the executable or DLLs that have this flag, and the above error will occur. To check whether the file has blocked or not and unblock it, please refer to: http://blogs.msdn.com/b/delay/p/unblockingdownloadedfile.aspx. - -In Windows Explorer, for each of the DLL files, right-click and select `Properties` then click the `Unblock` button at the bottom. - -This can also happen if you are using this on a networked drive. Please copy to a local drive instead. - -### `Error: AssemblyResolve: => System.IO.FileNotFoundException` - -A required DLL is missing in the folder that `OverlayPlugin.dll` is in. - -Please copy all of the files when moving location. - -### The parser won't sit in front of the game window anymore. - -It's probably Windows's fault. Toggle the visibility off and on again and it will fix itself. - -## License - -MIT license. See LICENSE.txt for details. diff --git a/README-jp.md b/README-jp.md new file mode 100644 index 000000000..2f94bd1ab --- /dev/null +++ b/README-jp.md @@ -0,0 +1,58 @@ +# OverlayPlugin + +ACT に柔軟にカスタマイズ可能なミニパースやスペルタイマーのオーバーレイを追加します。 + +## 動作環境 + +* .NET Framework 4.5 以上がインストールされているシステム + +## ダウンロード + +[リリースページ](https://github.com/RainbowMage/OverlayPlugin/releases)でビルド済みのバイナリを配布しています。 + +ダウンロード後、ファイルを展開する前にダウンロードした ZIP ファイルを右クリックしてプロパティを開き、「ブロックを解除」ボタンを押してブロックを解除することを強く推奨します。 + +## ビルド方法 + +手順: + +* .NET Framework 4.5.1 をインストールします +* Microsoft Build Tools 2017 (https://www.visualstudio.com/jp/thank-you-downloading-visual-studio/?sku=BuildTools&rel=15) をインストールします(Visual Studio 2017 がインストールされている場合は不要) +* ソースコード一式をチェックアウト、または ZIP ファイルでダウンロードして解凍します +* Thirdparty フォルダの中にある ACT フォルダに、ACT の実行ファイル(Advanced Combat Tracker.exe)をコピーします +* build.bat を実行します + +うまくいけば、BuildX86 および BuildX64 フォルダの中にプラグインが生成されます。 + +## 使用方法 + +OverlayPlugin.dll をプラグインとして ACT に追加します。 + +追加すると、`No data to show` と表示されたオーバーレイか、 もしくはプレイヤーの DPS が表示されたオーバーレイが表示されます。 +オーバーレイの非透過部分をドラッグすると移動させることができ、右下のハンドルをドラッグするとオーバーレイのサイズの変更ができます。 + +ACT のプラグインタブにある「OverlayPlugin.dll」タブで、オーバーレイの追加や削除、表示の切り替え、マウスクリックの透過、表示するファイルの設定などが行えます。 + +## トラブルシューティング + +オーバーレイウィンドウなどが表示されない場合は、`Plugins` タブにある `OverlayPlugin.dll` タブ内の下部にあるログのメッセージをよく確認した上で [トラブルシューティング](https://github.com/RainbowMage/OverlayPlugin/wiki/%E3%83%88%E3%83%A9%E3%83%96%E3%83%AB%E3%82%B7%E3%83%A5%E3%83%BC%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0)をお読みください。 + +## カスタマイズ + +プラグインが配置されているフォルダにある resources フォルダの中の、`miniparse.html` および `spelltimer.html` を編集することでカスタマイズができます。 + +詳しい編集方法に関しては [Wiki](https://github.com/RainbowMage/OverlayPlugin/wiki/) をご覧ください。JavaScript と HTML に関する基礎的な知識があれば編集できると思います。 + +## アドオン + +本プラグインはアドオンをサポートしております。対応するアドオンをプラグインディレクトリ直下の `addon` ディレクトリに配置すると自動的に読み込まれます。 + +仕様に関しては `AddonExample` プロジェクトをご確認ください。 + +## ライセンス + +MIT ライセンスです。詳細は LICENSE.txt を参照してください。 + +## Other Languages: + +* [English (EN)](../master/README-en.md) diff --git a/README-ko.md b/README-ko.md new file mode 100644 index 000000000..5ca58fc45 --- /dev/null +++ b/README-ko.md @@ -0,0 +1,55 @@ +# OverlayPlugin + +ACT에서 사용할 수 있는 커스터마이징 가능한 타임라인 및 오버레이를 제공합니다. + +## 다운로드 + +릴리즈 페이지에서 사전 배포본과 배포본을 다운로드 받을 수 있습니다. [release page](https://github.com/RainbowMage/OverlayPlugin/releases). + +## 시스템 요구사항 + +* 닷넷 프레임워크 4.5 + +## 빌드 방법 + +* 4.5.1 버전 이상의 닷넷프레임워크를 설치합니다. +* [Microsoft Build Tools 2017](https://www.visualstudio.com/ko/thank-you-downloading-visual-studio/?sku=BuildTools&rel=15). 를 설치합니다. (단, Visual Studio 2017 이상이 이미 설치된 경우 필요하지 않습니다.) +* 깃허브에서 내려받거나 소스 압축파일을 내려받아 압축을 해제합니다. +* 실행 가능한 Advanced Combat Tracker 파일 (`Advanced Combat Tracker.exe`)을 `Thirdparty\ACT` 폴더에 복사합니다. +* `build.bat`을 실행합니다. + +작업이 끝나면 플러그인 파일 `OverlayPlugin.dll`이 `Build` 폴더에 생성됩니다. + +## 사용 방법 + +이 플러그인을 사용하려면 먼저 `OverlayPlugin.dll` 을 ACT Plugin 탭에 추가해야 합니다. 함께 포함된 파일과 분리해서는 안되며 이 포함된 파일들은 반드시 필요한 파일입니다. + +직접 첫 설치를 한 경우 No Data to show 라는 메세지가 적힌 오버레이 창을 볼 수 있으며 여러분은 이 창의 불투명한 부분을 클릭해 드래그하거나 오른쪽 하단의 모서리에 마우스를 올려 윈도우 크기를 조절할 수 있습니다 (좀 어려워 보이긴 하지만). + +ACT의 플러그인 탭에서 `OveralyPlugin.dll` 항목에서 여러분은 설정을 변경하거나 파일 주소 또는 웹 주소를 입력할 수 있고, 클릭 통과 같은 옵션을 설정할 수 있습니다. + +예제 웹 문서는 `Build\resources`에 포함되어 있습니다. + +## 문제 해결 + +오버레이가 보이지 않으면 여러분은 ACT Plugins 탭에 포함된 `OverlayPlugin.dll` 에서 Overlay Logs 탭을 확인할 수 있습니다. + +### `Error: AssemblyResolve: => System.NotSupportedException` + +만약 여러분이 기본 윈도우 압축 해제 방식을 사용한다면, 인터넷에서 다운로드 받은 압축 파일을 신뢰하지 못하는 파일로 분류할 것입니다. + +이러한 문제가 발생하는 경우 실행 파일이나 DLL 파일이 손상될 수 있으며 이로 인해 오류를 야기할 수 있습니다. 이곳을 참조하여 문제를 확인합니다. http://blogs.msdn.com/b/delay/p/unblockingdownloadedfile.aspx. + +윈도우 탐색기에서 DLL파일을 우클릭하여 속성에 들어가 하단의 차단 해제 버튼을 눌러 해결할 수 있습니다. + +만약 네트워크 드라이브를 사용하고 있다면 발생할 수 있으며 이는 로컬 드라이브로 복사하여 해결할 수 있습니다. + +### `Error: AssemblyResolve: => System.IO.FileNotFoundException` + +`OverlayPlugin.dll` 에서 필요한 파일이 없을 경우 발생합니다. + +플러그인 폴더에 존재하는 모든 파일을 복사하여 옮겨주어야 정상적으로 동작합니다. + +## 라이센스 + +MIT 라이센스. LICENSE.txt 에 자세한 정보가 적혀 있습니다. \ No newline at end of file diff --git a/README.md b/README.md index e1761a318..cd1176676 100644 --- a/README.md +++ b/README.md @@ -1,58 +1,4 @@ # OverlayPlugin - -ACT に柔軟にカスタマイズ可能なミニパースやスペルタイマーのオーバーレイを追加します。 - -## 動作環境 - -* .NET Framework 4.5 以上がインストールされているシステム - -## ダウンロード - -[リリースページ](https://github.com/RainbowMage/OverlayPlugin/releases)でビルド済みのバイナリを配布しています。 - -ダウンロード後、ファイルを展開する前にダウンロードした ZIP ファイルを右クリックしてプロパティを開き、「ブロックを解除」ボタンを押してブロックを解除することを強く推奨します。 - -## ビルド方法 - -手順: - -* .NET Framework 4.5.1 をインストールします -* Microsoft Build Tools 2013 (http://www.microsoft.com/ja-jp/download/details.aspx?id=40760) をインストールします(Visual Studio 2013 がインストールされている場合は不要) -* ソースコード一式をチェックアウト、または ZIP ファイルでダウンロードして解凍します -* Thirdparty フォルダの中にある ACT フォルダに、ACT の実行ファイル(Advanced Combat Tracker.exe)をコピーします -* build.bat を実行します - -うまくいけば、BuildX86 および BuildX64 フォルダの中にプラグインが生成されます。 - -## 使用方法 - -OverlayPlugin.dll をプラグインとして ACT に追加します。 - -追加すると、`No data to show` と表示されたオーバーレイか、 もしくはプレイヤーの DPS が表示されたオーバーレイが表示されます。 -オーバーレイの非透過部分をドラッグすると移動させることができ、右下のハンドルをドラッグするとオーバーレイのサイズの変更ができます。 - -ACT のプラグインタブにある「OverlayPlugin.dll」タブで、オーバーレイの追加や削除、表示の切り替え、マウスクリックの透過、表示するファイルの設定などが行えます。 - -## トラブルシューティング - -オーバーレイウィンドウなどが表示されない場合は、`Plugins` タブにある `OverlayPlugin.dll` タブ内の下部にあるログのメッセージをよく確認した上で [トラブルシューティング](https://github.com/RainbowMage/OverlayPlugin/wiki/%E3%83%88%E3%83%A9%E3%83%96%E3%83%AB%E3%82%B7%E3%83%A5%E3%83%BC%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0)をお読みください。 - -## カスタマイズ - -プラグインが配置されているフォルダにある resources フォルダの中の、`miniparse.html` および `spelltimer.html` を編集することでカスタマイズができます。 - -詳しい編集方法に関しては [Wiki](https://github.com/RainbowMage/OverlayPlugin/wiki/) をご覧ください。JavaScript と HTML に関する基礎的な知識があれば編集できると思います。 - -## アドオン - -本プラグインはアドオンをサポートしております。対応するアドオンをプラグインディレクトリ直下の `addon` ディレクトリに配置すると自動的に読み込まれます。 - -仕様に関しては `AddonExample` プロジェクトをご確認ください。 - -## ライセンス - -MIT ライセンスです。詳細は LICENSE.txt を参照してください。 - -## Other Languages: - -* [English (EN)](../master/README-en.md) +###### This Project continue to [Aliapoh.Overlay](https://github.com/lalafellsleep/Aliapoh.Overlay) +> this repo not managed. some older browser version, cause security problems...
+> If you want newer version of CEF, refer my new repo diff --git a/Thirdparty/CefBinary_x86/LICENSE.txt b/Thirdparty/CefBinary_x86/LICENSE.txt new file mode 100644 index 000000000..21a8b1ad1 --- /dev/null +++ b/Thirdparty/CefBinary_x86/LICENSE.txt @@ -0,0 +1,158 @@ +Copyright (c) 2014 RainbowMage + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +---------------- + +Libraries used by OverlayPlugin: + + * Chromium Embedded Framework + https://code.google.com/p/chromiumembedded/ + + See CEF-LICENSE.txt for license details + + + * Xilium.CefGlue + http://xilium.bitbucket.org/cefglue/ + + MIT and new BSD License + Copyright (c) Xilium Project 2012 + + + * ICU + http://site.icu-project.org/ + + COPYRIGHT AND PERMISSION NOTICE + + Copyright (c) 1995-2014 International Business Machines Corporation and others + + All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, provided that the above copyright notice(s) and this permission notice appear in all copies of the Software and that both the above copyright notice(s) and this permission notice appear in supporting documentation. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization of the copyright holder. + + + * ANGLE + https://code.google.com/p/angleproject/ + + // Copyright (C) 2002-2013 The ANGLE Project Authors. + // All rights reserved. + // + // Redistribution and use in source and binary forms, with or without + // modification, are permitted provided that the following conditions + // are met: + // + // Redistributions of source code must retain the above copyright + // notice, this list of conditions and the following disclaimer. + // + // Redistributions in binary form must reproduce the above + // copyright notice, this list of conditions and the following + // disclaimer in the documentation and/or other materials provided + // with the distribution. + // + // Neither the name of TransGaming Inc., Google Inc., 3DLabs Inc. + // Ltd., nor the names of their contributors may be used to endorse + // or promote products derived from this software without specific + // prior written permission. + // + // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + // POSSIBILITY OF SUCH DAMAGE. + + + * PowerShellUtils + https://github.com/guitarrapc/PowerShellUtil + + PowerShellUtils - Scripts for manage with PowerShell Scripts + Copyright c 2013-2013 Ikiru Yoshizaki + All rights reserved. + + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + + * jQuery + https://jquery.org/ + + Copyright 2005, 2014 jQuery Foundation and other contributors, + https://jquery.org/ + + This software consists of voluntary contributions made by many + individuals. For exact contribution history, see the revision history + available at https://github.com/jquery/jquery + + The following license applies to all parts of this software except as + documented below: + + ==== + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + ==== + + All files located in the node_modules and external directories are + externally maintained libraries used by this software which have their + own licenses; we recommend you read them, as their terms may differ from + the terms above. diff --git a/Thirdparty/CefBinary_x86/README.md b/Thirdparty/CefBinary_x86/README.md new file mode 100644 index 000000000..e1761a318 --- /dev/null +++ b/Thirdparty/CefBinary_x86/README.md @@ -0,0 +1,58 @@ +# OverlayPlugin + +ACT に柔軟にカスタマイズ可能なミニパースやスペルタイマーのオーバーレイを追加します。 + +## 動作環境 + +* .NET Framework 4.5 以上がインストールされているシステム + +## ダウンロード + +[リリースページ](https://github.com/RainbowMage/OverlayPlugin/releases)でビルド済みのバイナリを配布しています。 + +ダウンロード後、ファイルを展開する前にダウンロードした ZIP ファイルを右クリックしてプロパティを開き、「ブロックを解除」ボタンを押してブロックを解除することを強く推奨します。 + +## ビルド方法 + +手順: + +* .NET Framework 4.5.1 をインストールします +* Microsoft Build Tools 2013 (http://www.microsoft.com/ja-jp/download/details.aspx?id=40760) をインストールします(Visual Studio 2013 がインストールされている場合は不要) +* ソースコード一式をチェックアウト、または ZIP ファイルでダウンロードして解凍します +* Thirdparty フォルダの中にある ACT フォルダに、ACT の実行ファイル(Advanced Combat Tracker.exe)をコピーします +* build.bat を実行します + +うまくいけば、BuildX86 および BuildX64 フォルダの中にプラグインが生成されます。 + +## 使用方法 + +OverlayPlugin.dll をプラグインとして ACT に追加します。 + +追加すると、`No data to show` と表示されたオーバーレイか、 もしくはプレイヤーの DPS が表示されたオーバーレイが表示されます。 +オーバーレイの非透過部分をドラッグすると移動させることができ、右下のハンドルをドラッグするとオーバーレイのサイズの変更ができます。 + +ACT のプラグインタブにある「OverlayPlugin.dll」タブで、オーバーレイの追加や削除、表示の切り替え、マウスクリックの透過、表示するファイルの設定などが行えます。 + +## トラブルシューティング + +オーバーレイウィンドウなどが表示されない場合は、`Plugins` タブにある `OverlayPlugin.dll` タブ内の下部にあるログのメッセージをよく確認した上で [トラブルシューティング](https://github.com/RainbowMage/OverlayPlugin/wiki/%E3%83%88%E3%83%A9%E3%83%96%E3%83%AB%E3%82%B7%E3%83%A5%E3%83%BC%E3%83%86%E3%82%A3%E3%83%B3%E3%82%B0)をお読みください。 + +## カスタマイズ + +プラグインが配置されているフォルダにある resources フォルダの中の、`miniparse.html` および `spelltimer.html` を編集することでカスタマイズができます。 + +詳しい編集方法に関しては [Wiki](https://github.com/RainbowMage/OverlayPlugin/wiki/) をご覧ください。JavaScript と HTML に関する基礎的な知識があれば編集できると思います。 + +## アドオン + +本プラグインはアドオンをサポートしております。対応するアドオンをプラグインディレクトリ直下の `addon` ディレクトリに配置すると自動的に読み込まれます。 + +仕様に関しては `AddonExample` プロジェクトをご確認ください。 + +## ライセンス + +MIT ライセンスです。詳細は LICENSE.txt を参照してください。 + +## Other Languages: + +* [English (EN)](../master/README-en.md) diff --git a/Thirdparty/CefBinary_x86/resources/handle.png b/Thirdparty/CefBinary_x86/resources/handle.png new file mode 100644 index 000000000..e8a9a3af5 Binary files /dev/null and b/Thirdparty/CefBinary_x86/resources/handle.png differ diff --git a/Thirdparty/CefBinary_x86/resources/jquery-2.1.1.min.js b/Thirdparty/CefBinary_x86/resources/jquery-2.1.1.min.js new file mode 100644 index 000000000..e5ace116b --- /dev/null +++ b/Thirdparty/CefBinary_x86/resources/jquery-2.1.1.min.js @@ -0,0 +1,4 @@ +/*! jQuery v2.1.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ +!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.1",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="
",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+Math.random()}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b) +},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthx",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]*)\/>/gi,bb=/<([\w:]+)/,cb=/<|&#?\w+;/,db=/<(?:script|style|link)/i,eb=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/^$|\/(?:java|ecma)script/i,gb=/^true\/(.*)/,hb=/^\s*\s*$/g,ib={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ib.optgroup=ib.option,ib.tbody=ib.tfoot=ib.colgroup=ib.caption=ib.thead,ib.th=ib.td;function jb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function kb(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function lb(a){var b=gb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function mb(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function nb(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function ob(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pb(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=ob(h),f=ob(a),d=0,e=f.length;e>d;d++)pb(f[d],g[d]);if(b)if(c)for(f=f||ob(a),g=g||ob(h),d=0,e=f.length;e>d;d++)nb(f[d],g[d]);else nb(a,h);return g=ob(h,"script"),g.length>0&&mb(g,!i&&ob(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(cb.test(e)){f=f||k.appendChild(b.createElement("div")),g=(bb.exec(e)||["",""])[1].toLowerCase(),h=ib[g]||ib._default,f.innerHTML=h[1]+e.replace(ab,"<$1>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=ob(k.appendChild(e),"script"),i&&mb(f),c)){j=0;while(e=f[j++])fb.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(ob(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&mb(ob(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(ob(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!db.test(a)&&!ib[(bb.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(ab,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(ob(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(ob(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&eb.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(ob(c,"script"),kb),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,ob(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,lb),j=0;g>j;j++)h=f[j],fb.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(hb,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qb,rb={};function sb(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function tb(a){var b=l,c=rb[a];return c||(c=sb(a,b),"none"!==c&&c||(qb=(qb||n("