From 03766db082d6ade19e9feaa6432711ebbd08c59f Mon Sep 17 00:00:00 2001 From: ngld Date: Wed, 29 Jul 2020 14:19:22 +0200 Subject: [PATCH] Release 0.15.0 --- HtmlRenderer/Properties/AssemblyInfo.cs | 2 +- .../Properties/AssemblyInfo.cs | 2 +- .../Controls/NewOverlayDialog.cs | 32 +++++++++++++++++-- .../EventSources/EnmityMemory50.cs | 2 ++ OverlayPlugin.Core/OverlayPlugin.Core.csproj | 3 ++ OverlayPlugin.Core/Properties/AssemblyInfo.cs | 2 +- .../Properties/AssemblyInfo.cs | 2 +- OverlayPlugin/Properties/AssemblyInfo.cs | 2 +- build.ps1 | 3 ++ 9 files changed, 43 insertions(+), 7 deletions(-) diff --git a/HtmlRenderer/Properties/AssemblyInfo.cs b/HtmlRenderer/Properties/AssemblyInfo.cs index a7dcd32c3..71f583edb 100644 --- a/HtmlRenderer/Properties/AssemblyInfo.cs +++ b/HtmlRenderer/Properties/AssemblyInfo.cs @@ -32,4 +32,4 @@ // すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を // 既定値にすることができます: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.14.1.0")] +[assembly: AssemblyVersion("0.15.0.0")] diff --git a/OverlayPlugin.Common/Properties/AssemblyInfo.cs b/OverlayPlugin.Common/Properties/AssemblyInfo.cs index 733e89e77..01685aa71 100644 --- a/OverlayPlugin.Common/Properties/AssemblyInfo.cs +++ b/OverlayPlugin.Common/Properties/AssemblyInfo.cs @@ -32,4 +32,4 @@ // すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を // 既定値にすることができます: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.14.1.0")] \ No newline at end of file +[assembly: AssemblyVersion("0.15.0.0")] \ No newline at end of file diff --git a/OverlayPlugin.Core/Controls/NewOverlayDialog.cs b/OverlayPlugin.Core/Controls/NewOverlayDialog.cs index dfd52e474..e55c62978 100644 --- a/OverlayPlugin.Core/Controls/NewOverlayDialog.cs +++ b/OverlayPlugin.Core/Controls/NewOverlayDialog.cs @@ -11,6 +11,7 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Forms; +using System.Net; namespace RainbowMage.OverlayPlugin { @@ -58,7 +59,11 @@ public NewOverlayDialog(PluginMain pluginMain) } cbType.DisplayMember = "Key"; - cbType.SelectedIndex = 0; + // Workaround for the special case where no overlay type has been registered. + // That still indicates a bug but showing an empty combo box is better than crashing. + if (cbType.Items.Count > 0) + cbType.SelectedIndex = 0; + presets = PreparePresetCombo(cbPreset); lblType.Visible = false; @@ -169,6 +174,16 @@ private void buttonOK_Click(object sender, EventArgs e) // Reconstruct the overlay to reset the preview state. SelectedOverlay = new Overlays.MiniParseOverlay(config, name); + if (config.Url == "") + { + // If the preview didn't load, we try again here to avoid ending up with an empty overlay. +#if DEBUG + var resourcesPath = "file:///" + PluginMain.PluginDirectory.Replace('\\', '/') + "/libs/resources"; +#else + var resourcesPath = "file:///" + PluginMain.PluginDirectory.Replace('\\', '/') + "/resources"; +#endif + SelectedOverlay.Navigate(preset.Url.Replace("%%", resourcesPath)); + } } else { @@ -221,9 +236,22 @@ private void cbPreset_SelectedIndexChanged(object sender, EventArgs e) IsLocked = preset.Locked, }; + var presetUrl = preset.Url.Replace("%%", resourcesPath); var overlay = new Overlays.MiniParseOverlay(config, config.Name); overlay.Preview = true; - overlay.Navigate(preset.Url.Replace("%%", resourcesPath)); + + var first = true; + overlay.Overlay.Renderer.BrowserLoad += (o, ev) => + { + // Once the placeholder is ready, we load the actual overlay. + if (first) + { + first = false; + overlay.Navigate(presetUrl); + } + }; + // Show a placeholder while the actual overlay is loading. + overlay.Navigate(resourcesPath + "/loading.html"); preview = overlay; break; diff --git a/OverlayPlugin.Core/EventSources/EnmityMemory50.cs b/OverlayPlugin.Core/EventSources/EnmityMemory50.cs index 71f74d612..160751c87 100644 --- a/OverlayPlugin.Core/EventSources/EnmityMemory50.cs +++ b/OverlayPlugin.Core/EventSources/EnmityMemory50.cs @@ -97,6 +97,8 @@ private bool GetPointerAddress() if ((DateTime.Now - lastSigScan) < TimeSpan.FromSeconds(5)) return false; + lastSigScan = DateTime.Now; + bool success = true; bool bRIP = true; diff --git a/OverlayPlugin.Core/OverlayPlugin.Core.csproj b/OverlayPlugin.Core/OverlayPlugin.Core.csproj index 3af697939..4ab5f4cfd 100644 --- a/OverlayPlugin.Core/OverlayPlugin.Core.csproj +++ b/OverlayPlugin.Core/OverlayPlugin.Core.csproj @@ -225,6 +225,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest diff --git a/OverlayPlugin.Core/Properties/AssemblyInfo.cs b/OverlayPlugin.Core/Properties/AssemblyInfo.cs index 277f7ef37..0d7708d7b 100644 --- a/OverlayPlugin.Core/Properties/AssemblyInfo.cs +++ b/OverlayPlugin.Core/Properties/AssemblyInfo.cs @@ -32,4 +32,4 @@ // すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を // 既定値にすることができます: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.14.1.0")] +[assembly: AssemblyVersion("0.15.0.0")] diff --git a/OverlayPlugin.Updater/Properties/AssemblyInfo.cs b/OverlayPlugin.Updater/Properties/AssemblyInfo.cs index 615b733e6..1a3b1e684 100644 --- a/OverlayPlugin.Updater/Properties/AssemblyInfo.cs +++ b/OverlayPlugin.Updater/Properties/AssemblyInfo.cs @@ -32,4 +32,4 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.14.1.0")] +[assembly: AssemblyVersion("0.15.0.0")] diff --git a/OverlayPlugin/Properties/AssemblyInfo.cs b/OverlayPlugin/Properties/AssemblyInfo.cs index 469081099..5da5a4685 100644 --- a/OverlayPlugin/Properties/AssemblyInfo.cs +++ b/OverlayPlugin/Properties/AssemblyInfo.cs @@ -32,4 +32,4 @@ // すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を // 既定値にすることができます: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.14.1.0")] +[assembly: AssemblyVersion("0.15.0.0")] diff --git a/build.ps1 b/build.ps1 index 860aab51c..445c1ca15 100644 --- a/build.ps1 +++ b/build.ps1 @@ -20,6 +20,9 @@ try { } $ENV:PATH = "$VS_PATH\MSBuild\Current\Bin;${ENV:PATH}"; + if (Test-Path "C:\Program Files\7-Zip\7z.exe") { + $ENV:PATH = "C:\Program Files\7-Zip;${ENV:PATH}"; + } if ( -not (Test-Path .\OverlayPlugin.Updater\Resources\libcurl.dll)) { echo "==> Building cURL..."