Skip to content

Commit

Permalink
* Tracked down the reason for the overlay issues in the pinned mode a…
Browse files Browse the repository at this point in the history
…nd implemented some hints to inform the user about it.

* Changed the warning about the wrong game mode to be ignorable.
* updated some urls
* added a new pic
* updated the version
  • Loading branch information
MartinKuschnik committed Nov 20, 2015
1 parent 65c9a34 commit 455b1c2
Show file tree
Hide file tree
Showing 10 changed files with 112 additions and 51 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ Its possible that avast Free Antivirus (maybe also other antivirus software) wil
A tiny Final Fantasy XIV overlay that allows you to observe the progress of your Nexus and Zeta weapons.

## Who can use it?
You have to play in [frameless] window mode to use this overlay.
You have to play in a window mode to use this overlay.

## How to use it?
Only download the program and run it. Now you should see a tiny overlay if you have equipped a supported weapon like this:

<img title="Zodiac Overlay" src="https://github.com/InvisibleShield/FFXIV-Zodiac-Glass/blob/master/doc/pics/overlay_zodiac.jpg" />
<img title="Zeta Overlay" src="https://github.com/InvisibleShield/FFXIV-Zodiac-Glass/blob/master/doc/pics/overlay_zeta.jpg" />
<img title="Zodiac Overlay" src="https://github.com/MartinKuschnik/FFXIV-Zodiac-Glass/blob/master/doc/pics/overlay_zodiac.jpg" />
<img title="Zeta Overlay" src="https://github.com/MartinKuschnik/FFXIV-Zodiac-Glass/blob/master/doc/pics/overlay_zeta.jpg" />

## How to change the position?
You can change the position by simple dragging it.
Expand All @@ -33,6 +33,6 @@ Currently there a two modes:
- percentage value

## How to download it?
Go to [Releases](https://github.com/InvisibleShield/FFXIV-Zodiac-Glass/releases) and download the current version.
Go to [Releases](https://github.com/MartinKuschnik/FFXIV-Zodiac-Glass/releases) and download the current version.

© 2015 Martin Kuschnik
2 changes: 1 addition & 1 deletion UPDATE
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Version>1.4.1506.28001</Version>
<Content>
<File>
<Source>https://github.com/InvisibleShield/FFXIV-Zodiac-Glass/releases/download/v1.4.1506.28001/Zodiac.Glass.exe</Source>
<Source>https://github.com/MartinKuschnik/FFXIV-Zodiac-Glass/releases/download/v1.4.1506.28001/Zodiac.Glass.exe</Source>
<Target>Zodiac.Glass.exe</Target>
</File>
</Content>
Expand Down
5 changes: 3 additions & 2 deletions Zodiac Glass.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.21005.1
# Visual Studio 14
VisualStudioVersion = 14.0.24627.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Zodiac Glass", "Zodiac Glass\Zodiac Glass.csproj", "{CEF678D2-4FF4-4FCE-8B03-CC1DB468521C}"
EndProject
Expand All @@ -17,6 +17,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "doc", "doc", "{A4C1B7D3-69E
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "pics", "pics", "{DDC6E237-F429-48A5-B1B9-4A7801D68341}"
ProjectSection(SolutionItems) = preProject
doc\pics\context_menu_CanNotSeeOverlay.jpg = doc\pics\context_menu_CanNotSeeOverlay.jpg
doc\pics\notify_icon_context_menu.jpg = doc\pics\notify_icon_context_menu.jpg
doc\pics\overlay_zeta.jpg = doc\pics\overlay_zeta.jpg
doc\pics\overlay_zodiac.jpg = doc\pics\overlay_zodiac.jpg
Expand Down
7 changes: 7 additions & 0 deletions Zodiac Glass/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
<setting name="OverlayPinned" serializeAs="String">
<value>True</value>
</setting>
<setting name="WarnedAboutOverlayPinningNotWorkingWithCurrentRuntimeVersion"
serializeAs="String">
<value>False</value>
</setting>
<setting name="ShowWarningIfGameModeIsNotSupported" serializeAs="String">
<value>True</value>
</setting>
</ZodiacGlass.Properties.Settings>
</userSettings>
</configuration>
97 changes: 60 additions & 37 deletions Zodiac Glass/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@

public partial class App : Application
{
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
public static Version CLRRuntimeVersionRequiredToUsePinnedMode = new Version(4, 0, 30319, 42000);

[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private const string XIVProcessName = "ffxiv"; // ffxiv_dx11 for DirectX 11 (but ffxiv_dx11 is a x64 process and has different mem addresses)

Expand Down Expand Up @@ -68,7 +71,7 @@ protected override void OnStartup(StartupEventArgs e)
AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;

try
{
{
// ensure one one instance of app is open
if (mutex.WaitOne(TimeSpan.Zero, true))
{
Expand Down Expand Up @@ -222,8 +225,9 @@ private void ConfigureNotifyIcon()
newItem.Image = Image.FromStream(Application.GetResourceStream(new Uri(string.Format(imageRuiFormat, "config.ico"))).Stream);
this.notifyIcon.ContextMenuStrip.Items.Add(newItem);

togglePinningToolStripMenuItem = new ToolStripMenuItem("Overlay Pinning");
togglePinningToolStripMenuItem.Checked = Settings.Default.OverlayPinned;
togglePinningToolStripMenuItem = new ToolStripMenuItem(string.Format("Overlay Pinning{0}", Environment.Version < CLRRuntimeVersionRequiredToUsePinnedMode ? " (Microsoft .NET Framework 4.6 required)" : string.Empty));
togglePinningToolStripMenuItem.Enabled = Environment.Version >= CLRRuntimeVersionRequiredToUsePinnedMode;
togglePinningToolStripMenuItem.Checked = togglePinningToolStripMenuItem.Checked && Settings.Default.OverlayPinned;
togglePinningToolStripMenuItem.Image = this.UpdateTogglePinningToolStripMenuItemImage();
togglePinningToolStripMenuItem.Click += (s, e) => this.OnToggleOverlayPinningButtonClicked();
newItem.DropDownItems.Add(togglePinningToolStripMenuItem);
Expand Down Expand Up @@ -272,7 +276,7 @@ private bool Update()
{
try
{
WebRequest request = HttpWebRequest.Create("https://raw.githubusercontent.com/InvisibleShield/FFXIV-Zodiac-Glass/master/UPDATE");
WebRequest request = HttpWebRequest.Create("https://raw.githubusercontent.com/MartinKuschnik/FFXIV-Zodiac-Glass/master/UPDATE");

using (Stream responseStream = request.GetResponse().GetResponseStream())
{
Expand Down Expand Up @@ -382,7 +386,7 @@ private bool UpdateMemoryMap()
{
try
{
WebRequest request = HttpWebRequest.Create("https://raw.githubusercontent.com/InvisibleShield/FFXIV-Zodiac-Glass/master/MEMMAP");
WebRequest request = HttpWebRequest.Create("https://raw.githubusercontent.com/MartinKuschnik/FFXIV-Zodiac-Glass/master/MEMMAP");

using (Stream responseStream = request.GetResponse().GetResponseStream())
{
Expand Down Expand Up @@ -432,24 +436,24 @@ private void AttachToExistingProcesses()

switch (processes.Count())
{
case 0:
case 0:

break;
case 1:
break;
case 1:

Process singleProcess = processes.First();
this.CreateOverlay(singleProcess);
Process singleProcess = processes.First();
this.CreateOverlay(singleProcess);

// activate the game window
Native.NativeMethods.SetForegroundWindow(singleProcess.MainWindowHandle);
// activate the game window
Native.NativeMethods.SetForegroundWindow(singleProcess.MainWindowHandle);

break;
default:
break;
default:

foreach (Process process in processes)
this.CreateOverlay(process);
foreach (Process process in processes)
this.CreateOverlay(process);

break;
break;
}

}
Expand All @@ -461,21 +465,34 @@ private void CreateOverlay(Process process)
try
{
IOverlay overlay = new OverlayWindow(process);

process.EnableRaisingEvents = true;
process.Exited += this.OnProcessExited;


if (Settings.Default.OverlayPinned && Environment.Version < CLRRuntimeVersionRequiredToUsePinnedMode && !Settings.Default.WarnedAboutOverlayPinningNotWorkingWithCurrentRuntimeVersion)
{
MessageBox.Show(
"You have installed a version of the Microsoft .NET Framework older than version 4.6.\r\nOverlay pinning is the recommended way but only supported for the .NET Framework 4.6 or newer.\r\nThe pinning will be disabled.\r\nPlease install Microsoft .NET Framework 4.6 (https://goo.gl/3uP54q) and reconfigure this option to use the overlay in the recommended way.",
"Overlay pining not supported",
MessageBoxButton.OK,
MessageBoxImage.Warning);

Settings.Default.OverlayPinned = false;
Settings.Default.WarnedAboutOverlayPinningNotWorkingWithCurrentRuntimeVersion = true;
Settings.Default.Save();
}

overlay.Pinned = Settings.Default.OverlayPinned;
overlay.Position = Settings.Default.OverlayPosition;
overlay.PositionChanged += this.OnOverlayRelativePositionChangedChanged;

overlay.DisplayMode = (OverlayDisplayMode)Settings.Default.OverlayDisplayMode;
overlay.MemoryReader = new FFXIVMemoryReader(process, this.currentMemoryMap);

overlay.DisplayModeChanged += this.OnOverlayDisplayModeChanged;

overlay.Show();

this.overlays.Add(overlay);

this.CheckGameWindowMode(process);
Expand Down Expand Up @@ -572,8 +589,14 @@ private void CheckGameWindowMode(Process process)

this.log.Write(LogLevel.Info, string.Format("CurrentScreenMode: {0}", curScreanMode));

if (curScreanMode != FFXIVScreenMode.FramelessWindow && curScreanMode != FFXIVScreenMode.Window)
MessageBox.Show("FINAL FANTASY XIV have to run into a window mode!", "Window mode required!", MessageBoxButton.OK, MessageBoxImage.Warning);
if (curScreanMode != FFXIVScreenMode.FramelessWindow && curScreanMode != FFXIVScreenMode.Window && Settings.Default.ShowWarningIfGameModeIsNotSupported)
{
if (MessageBox.Show("FINAL FANTASY XIV have to run into a window mode to work in all cases!\r\nWould you like to see this warning again?", "Window mode required!", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.No)
{
Settings.Default.ShowWarningIfGameModeIsNotSupported = false;
Settings.Default.Save();
}
}
}

private Image UpdateTogglePinningToolStripMenuItemImage()
Expand Down Expand Up @@ -649,26 +672,26 @@ private void OnResetOverlayButtonClicked()
{
switch (this.overlays.Count())
{
case 0:
break;
case 1:
case 0:
break;
case 1:

var singleOverlay = this.overlays.FirstOrDefault();
var singleOverlay = this.overlays.FirstOrDefault();

singleOverlay.Position = new System.Windows.Point(0, 0);
singleOverlay.Position = new System.Windows.Point(0, 0);

// activate the game window
Native.NativeMethods.SetForegroundWindow(singleOverlay.Process.MainWindowHandle);
// activate the game window
Native.NativeMethods.SetForegroundWindow(singleOverlay.Process.MainWindowHandle);

break;
default:
break;
default:

foreach (OverlayWindow overlay in this.overlays.ToArray())
{
overlay.Position = new Point(0, 0);
}
foreach (OverlayWindow overlay in this.overlays.ToArray())
{
overlay.Position = new Point(0, 0);
}

break;
break;
}
}

Expand Down
2 changes: 1 addition & 1 deletion Zodiac Glass/Properties/AssemblyProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
internal static class AssemblyProperties
{
internal const string Version = "1.4.1511.15002"; // X.X.Year_Year_Month_Mont.Day_Day_BuildOfDayBuildOfDayBuildOfDay
internal const string Version = "1.4.1511.20001"; // X.X.Year_Year_Month_Mont.Day_Day_BuildOfDayBuildOfDayBuildOfDay
internal const string Name = "Zodiac Glass";
internal const string Copyright = "© 2015 Martin Kuschnik";
}
Expand Down
34 changes: 29 additions & 5 deletions Zodiac Glass/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Zodiac Glass/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,11 @@
<Setting Name="OverlayPinned" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="WarnedAboutOverlayPinningNotWorkingWithCurrentRuntimeVersion" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
<Setting Name="ShowWarningIfGameModeIsNotSupported" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
</Settings>
</SettingsFile>
2 changes: 1 addition & 1 deletion Zodiac Glass/Resources/About.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
{$Copyright}

Support:
- https://github.com/InvisibleShield/FFXIV-Zodiac-Glass
- https://github.com/MartinKuschnik/FFXIV-Zodiac-Glass
Binary file added doc/pics/context_menu_CanNotSeeOverlay.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 455b1c2

Please sign in to comment.