diff --git a/OverlayPlugin.Common/IOverlay.cs b/OverlayPlugin.Common/IOverlay.cs
index b9335ff31..0af3b8929 100644
--- a/OverlayPlugin.Common/IOverlay.cs
+++ b/OverlayPlugin.Common/IOverlay.cs
@@ -21,6 +21,11 @@ public interface IOverlay : IDisposable
///
string Name { get; }
+ ///
+ /// プラグインの設定を取得します。
+ ///
+ IPluginConfig PluginConfig { get; set; }
+
///
/// オーバーレイがログを出力したときに発生します。
///
diff --git a/OverlayPlugin.Common/IPluginConfig.cs b/OverlayPlugin.Common/IPluginConfig.cs
new file mode 100644
index 000000000..f9fc7f03d
--- /dev/null
+++ b/OverlayPlugin.Common/IPluginConfig.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace RainbowMage.OverlayPlugin
+{
+ public interface IPluginConfig
+ {
+ OverlayConfigList Overlays { get; set; }
+ bool FollowLatestLog { get; set; }
+ bool HideOverlaysWhenNotActive { get; set; }
+ Version Version { get; set; }
+ bool IsFirstLaunch { get; set; }
+ }
+}
diff --git a/OverlayPlugin.Core/OverlayConfigList.cs b/OverlayPlugin.Common/OverlayConfigList.cs
similarity index 100%
rename from OverlayPlugin.Core/OverlayConfigList.cs
rename to OverlayPlugin.Common/OverlayConfigList.cs
diff --git a/OverlayPlugin.Common/OverlayPlugin.Common.csproj b/OverlayPlugin.Common/OverlayPlugin.Common.csproj
index 2722fc1d9..e2d0c7486 100644
--- a/OverlayPlugin.Common/OverlayPlugin.Common.csproj
+++ b/OverlayPlugin.Common/OverlayPlugin.Common.csproj
@@ -44,7 +44,9 @@
+
+
diff --git a/OverlayPlugin.Common/Properties/AssemblyInfo.cs b/OverlayPlugin.Common/Properties/AssemblyInfo.cs
index 1ea56fe24..8716ce9bf 100644
--- a/OverlayPlugin.Common/Properties/AssemblyInfo.cs
+++ b/OverlayPlugin.Common/Properties/AssemblyInfo.cs
@@ -32,4 +32,4 @@
// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("0.3.3.5")]
\ No newline at end of file
+[assembly: AssemblyVersion("0.3.3.6")]
\ No newline at end of file
diff --git a/OverlayPlugin.Core/ControlPanel.Designer.cs b/OverlayPlugin.Core/ControlPanel.Designer.cs
index 18032ecd8..30120b4d3 100644
--- a/OverlayPlugin.Core/ControlPanel.Designer.cs
+++ b/OverlayPlugin.Core/ControlPanel.Designer.cs
@@ -33,12 +33,14 @@ private void InitializeComponent()
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.tabControl = new System.Windows.Forms.TabControl();
this.tabPageMain = new System.Windows.Forms.TabPage();
+ this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.buttonRemoveOverlay = new System.Windows.Forms.Button();
this.buttonNewOverlay = new System.Windows.Forms.Button();
this.listViewOverlay = new System.Windows.Forms.ListView();
this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+ this.checkBoxAutoHide = new System.Windows.Forms.CheckBox();
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()));
@@ -56,6 +58,7 @@ private void InitializeComponent()
this.splitContainer1.SuspendLayout();
this.tabControl.SuspendLayout();
this.tabPageMain.SuspendLayout();
+ this.tableLayoutPanel1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.contextMenuLogList.SuspendLayout();
this.SuspendLayout();
@@ -85,10 +88,17 @@ private void InitializeComponent()
// tabPageMain
//
resources.ApplyResources(this.tabPageMain, "tabPageMain");
- this.tabPageMain.Controls.Add(this.groupBox2);
+ this.tabPageMain.Controls.Add(this.tableLayoutPanel1);
this.tabPageMain.Name = "tabPageMain";
this.tabPageMain.UseVisualStyleBackColor = true;
//
+ // tableLayoutPanel1
+ //
+ resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1");
+ this.tableLayoutPanel1.Controls.Add(this.groupBox2, 0, 0);
+ this.tableLayoutPanel1.Controls.Add(this.checkBoxAutoHide, 0, 1);
+ this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+ //
// groupBox2
//
resources.ApplyResources(this.groupBox2, "groupBox2");
@@ -133,6 +143,13 @@ private void InitializeComponent()
//
resources.ApplyResources(this.columnHeader5, "columnHeader5");
//
+ // checkBoxAutoHide
+ //
+ resources.ApplyResources(this.checkBoxAutoHide, "checkBoxAutoHide");
+ this.checkBoxAutoHide.Name = "checkBoxAutoHide";
+ this.checkBoxAutoHide.UseVisualStyleBackColor = true;
+ this.checkBoxAutoHide.CheckedChanged += new System.EventHandler(this.checkBoxAutoHide_CheckedChanged);
+ //
// listViewLog
//
resources.ApplyResources(this.listViewLog, "listViewLog");
@@ -222,6 +239,8 @@ private void InitializeComponent()
this.splitContainer1.ResumeLayout(false);
this.tabControl.ResumeLayout(false);
this.tabPageMain.ResumeLayout(false);
+ this.tableLayoutPanel1.ResumeLayout(false);
+ this.tableLayoutPanel1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.contextMenuLogList.ResumeLayout(false);
this.ResumeLayout(false);
@@ -250,5 +269,7 @@ private void InitializeComponent()
private System.Windows.Forms.ListView listViewOverlay;
private System.Windows.Forms.ColumnHeader columnHeader4;
private System.Windows.Forms.ColumnHeader columnHeader5;
+ private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
+ private System.Windows.Forms.CheckBox checkBoxAutoHide;
}
}
diff --git a/OverlayPlugin.Core/ControlPanel.cs b/OverlayPlugin.Core/ControlPanel.cs
index c668706f5..5ea45b8ff 100644
--- a/OverlayPlugin.Core/ControlPanel.cs
+++ b/OverlayPlugin.Core/ControlPanel.cs
@@ -24,6 +24,8 @@ public ControlPanel(PluginMain pluginMain, PluginConfig config)
this.pluginMain = pluginMain;
this.config = 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) =>
@@ -230,5 +232,10 @@ private void buttonRemoveOverlay_Click(object sender, EventArgs e)
UpdateOverlayListView();
}
}
+
+ private void checkBoxAutoHide_CheckedChanged(object sender, EventArgs e)
+ {
+ config.HideOverlaysWhenNotActive = checkBoxAutoHide.Checked;
+ }
}
}
diff --git a/OverlayPlugin.Core/ControlPanel.ja-JP.resx b/OverlayPlugin.Core/ControlPanel.ja-JP.resx
index af354b6c4..838bca165 100644
--- a/OverlayPlugin.Core/ControlPanel.ja-JP.resx
+++ b/OverlayPlugin.Core/ControlPanel.ja-JP.resx
@@ -132,6 +132,9 @@
オーバーレイの管理
+
+ 非アクティブのときに自動的にオーバーレイを隠す
+
設定
diff --git a/OverlayPlugin.Core/ControlPanel.resx b/OverlayPlugin.Core/ControlPanel.resx
index 4a5b6536e..433414187 100644
--- a/OverlayPlugin.Core/ControlPanel.resx
+++ b/OverlayPlugin.Core/ControlPanel.resx
@@ -117,390 +117,456 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- 3, 3, 3, 3
-
-
- Time
-
-
-
- 2
-
-
- 572, 248
+
+ 3, 223
-
- menuCopyLogAll
+
+ splitContainer1.Panel2
-
- tabPageMain
+
+ columnHeader3
+
+
+ 6, 18
0
-
- NoControl
+
+ 3, 3
-
- listViewOverlay
+
+ columnHeader1
-
- contextMenuLogList
+
+ 1
-
- Message
+
+ 0
-
- 0, 0
+
+ System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- 451
+
+ System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- buttonRemoveOverlay
+
+ System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- 0
+
+ New
-
- Fill
+
+
+ NoControl
-
- 1
+
+ tableLayoutPanel1
-
- 251
+
+ 580, 274
-
- 0
+
+ 4, 22
-
- 0
+
+ System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- System.Windows.Forms.SplitContainer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ listViewLog
-
- System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ Fill
-
+
Fill
-
- 6, 12
+
+ menuClearLog
-
+
tabControl
-
- New
-
-
- 6, 213
+
+ columnHeader4
-
- 1
+
+ 2
-
- Level
+
+
+ 0
-
- menuFollowLatestLog
+
+ Message
-
- 182, 22
+
+ splitContainer1
-
- 4, 22
+
+ 580, 410
-
- System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ 179, 6
-
- 1
+
+ 183, 104
-
- System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ 144
splitContainer1.Panel1
-
- 182, 22
-
-
- 554, 189
+
+ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- groupBox2
+
+ 1
-
- 2
+
+ 274
-
+
System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- 0
-
-
- tabControl
+
+ Bottom, Left
-
- 182, 22
+
+ Level
-
- groupBox2
+
+ Time
-
- Fill
+
+ 0
-
- 580, 274
+
+ menuFollowLatestLog
-
- Remove
+
+ toolStripMenuItem2
-
- System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ listViewOverlay
-
- 87, 213
+
+ System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- 0
+
+ Copy all logs
-
- 183, 104
+
+ toolStripMenuItem1
-
- Clear logs
+
+ tabControl
-
- 179, 6
+
+ NoControl
-
- 144
+
+ ControlPanel
-
- Copy all logs
+
+ $this
-
- 580, 410
+
+ menuCopyLogAll
-
- System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ General
-
- Add/Remove overlays
+
+ groupBox2
-
- 3, 3
+
+ Name
-
- columnHeader4
+
+ 1
-
- System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ 75, 23
-
- 2
+
+ 1
-
- 274
+
+ tableLayoutPanel1
-
- NoControl
+
+ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- 580, 410
+
+ Fill
-
- 182, 22
+
+ System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- Follow latest log
+
+ tabPageMain
-
- Name
+
+ columnHeader2
splitContainer1
-
- System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ <?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
-
- listViewLog
+
+ 560, 16
-
- 1
+
+ 0, 0
-
- columnHeader3
+
+ splitContainer1
-
- columnHeader1
+
+ 451
-
- Bottom, Left
+
+ 0
-
- System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ 548, 161
-
- splitContainer1.Panel1
+
+ 572, 248
System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- groupBox2
+
+ tabPageMain
-
- Horizontal
+
+ True
-
- toolStripMenuItem1
+
+ Clear logs
-
- System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ 3, 3, 3, 3
-
- splitContainer1.Panel2
+
+ 2
-
- splitContainer1
+
+ 87, 185
-
- 179, 6
+
+ 182, 22
-
- Type
+
+ Fill
-
- System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ Automatically hide overlays
-
- 75, 23
+
+ Bottom, Left
-
- columnHeader2
+
+ 0
-
- System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ 182, 22
-
- System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ buttonRemoveOverlay
-
- $this
+
+ Remove
-
+
System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- Bottom, Left
+
+ 580, 132
-
- menuClearLog
+
+ 179, 6
-
+
+ 6, 185
+
+
+ 580, 410
+
+
splitContainer1.Panel2
-
- 0, 0
+
+ System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- 566, 242
+
+ System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- 0
+
+ Follow latest log
-
- 6, 18
+
+ 1
-
+
+ 2
+
+
1
-
+
+ 0, 0
+
+
groupBox2
-
- 75, 23
+
+ System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- toolStripMenuItem2
+
+ 182, 22
-
- ControlPanel
+
+ 2
-
- 1
+
+ checkBoxAutoHide
-
- System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ splitContainer1.Panel1
-
+
+ 566, 242
+
+
Fill
-
+
+ 2
+
+
+ 182, 22
+
+
+ 251
+
+
0
-
- Copy selected logs
+
+ System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ 3, 3
-
- Top, Bottom, Left, Right
+
+ 0
-
+
0, 0
-
- System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ 6, 12
+
+
+ System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
columnHeader5
-
- 0
+
+ System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- tabPageMain
+
+ tableLayoutPanel1
-
+
System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- splitContainer1
+
+ Top, Bottom, Left, Right
+
+
+ 0
+
+
+ System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ menuLogCopy
buttonNewOverlay
-
- General
+
+ Horizontal
-
- System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ System.Windows.Forms.SplitContainer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- 580, 132
+
+ Fill
-
- menuLogCopy
+
+ 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
diff --git a/OverlayPlugin.Core/NativeMethods.cs b/OverlayPlugin.Core/NativeMethods.cs
index ac09e9d55..eb4a5856b 100644
--- a/OverlayPlugin.Core/NativeMethods.cs
+++ b/OverlayPlugin.Core/NativeMethods.cs
@@ -214,9 +214,17 @@ uint uFlags // ウィンドウ位置のオプション
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 short GetKeyState(int nVirtKey);
+ 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);
public const int WM_KEYDOWN = 0x0100;
public const int WM_KEYUP = 0x0101;
diff --git a/OverlayPlugin.Core/OverlayBase.cs b/OverlayPlugin.Core/OverlayBase.cs
index 3a48a872b..9ce0843c7 100644
--- a/OverlayPlugin.Core/OverlayBase.cs
+++ b/OverlayPlugin.Core/OverlayBase.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
@@ -15,6 +16,7 @@ public abstract class OverlayBase : IOverlay
{
private KeyboardHook hook = new KeyboardHook();
protected System.Timers.Timer timer;
+ protected System.Timers.Timer xivWindowTimer;
///
/// オーバーレイがログを出力したときに発生します。
@@ -36,6 +38,11 @@ public abstract class OverlayBase : IOverlay
///
public TConfig Config { get; private set; }
+ ///
+ /// プラグインの設定を取得します。
+ ///
+ public IPluginConfig PluginConfig { get; set; }
+
protected OverlayBase(TConfig config, string name)
{
this.Config = config;
@@ -52,6 +59,7 @@ protected OverlayBase(TConfig config, string name)
public void Start()
{
timer.Start();
+ xivWindowTimer.Start();
}
///
@@ -60,6 +68,7 @@ public void Start()
public void Stop()
{
timer.Stop();
+ xivWindowTimer.Stop();
}
///
@@ -216,6 +225,36 @@ 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();
+ NativeMethods.GetWindowThreadProcessId(hWndFg, out pid);
+ var exePath = Process.GetProcessById((int)pid).MainModule.FileName;
+
+ if (Path.GetFileName(exePath.ToString()) == "ffxiv.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());
+ }
+ };
}
///
diff --git a/OverlayPlugin.Core/OverlayPlugin.Core.csproj b/OverlayPlugin.Core/OverlayPlugin.Core.csproj
index a7182e866..c4b7c6f2e 100644
--- a/OverlayPlugin.Core/OverlayPlugin.Core.csproj
+++ b/OverlayPlugin.Core/OverlayPlugin.Core.csproj
@@ -60,7 +60,6 @@
-
diff --git a/OverlayPlugin.Core/PluginConfig.cs b/OverlayPlugin.Core/PluginConfig.cs
index b4f79ef12..de4e13f72 100644
--- a/OverlayPlugin.Core/PluginConfig.cs
+++ b/OverlayPlugin.Core/PluginConfig.cs
@@ -12,7 +12,7 @@
namespace RainbowMage.OverlayPlugin
{
[Serializable]
- public class PluginConfig
+ public class PluginConfig : IPluginConfig
{
#region Config for version 0.1.2.0 or below
#pragma warning disable 612, 618
@@ -177,6 +177,9 @@ public MiniParseSortType SortTypeObsolete
[XmlElement("FollowLatestLog")]
public bool FollowLatestLog { get; set; }
+ [XmlElement("HideOverlaysWhenNotActive")]
+ public bool HideOverlaysWhenNotActive { get; set; }
+
///
/// 設定ファイルを生成したプラグインのバージョンを取得または設定します。
/// 設定が新規に作成された場合、またはバージョン0.3未満では null が設定されます。
@@ -239,6 +242,7 @@ public PluginConfig()
this.Overlays = new OverlayConfigList();
this.FollowLatestLog = false;
+ this.HideOverlaysWhenNotActive = false;
this.IsFirstLaunch = true;
}
diff --git a/OverlayPlugin.Core/PluginMain.cs b/OverlayPlugin.Core/PluginMain.cs
index 433ff2247..fbcac26dc 100644
--- a/OverlayPlugin.Core/PluginMain.cs
+++ b/OverlayPlugin.Core/PluginMain.cs
@@ -141,6 +141,7 @@ private void InitializeOverlays()
internal void RegisterOverlay(IOverlay overlay)
{
overlay.OnLog += (o, e) => Logger.Log(e.Level, e.Message);
+ overlay.PluginConfig = (IPluginConfig)Config;
overlay.Start();
this.Overlays.Add(overlay);
}
diff --git a/OverlayPlugin.Core/Properties/AssemblyInfo.cs b/OverlayPlugin.Core/Properties/AssemblyInfo.cs
index f74333625..b77116c9a 100644
--- a/OverlayPlugin.Core/Properties/AssemblyInfo.cs
+++ b/OverlayPlugin.Core/Properties/AssemblyInfo.cs
@@ -32,4 +32,4 @@
// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("0.3.3.5")]
+[assembly: AssemblyVersion("0.3.3.6")]
diff --git a/OverlayPlugin/Properties/AssemblyInfo.cs b/OverlayPlugin/Properties/AssemblyInfo.cs
index 08e43a08a..c74735de2 100644
--- a/OverlayPlugin/Properties/AssemblyInfo.cs
+++ b/OverlayPlugin/Properties/AssemblyInfo.cs
@@ -32,4 +32,4 @@
// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("0.3.3.5")]
+[assembly: AssemblyVersion("0.3.3.6")]