aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYour Name <you@example.com>2019-01-17 05:01:01 +0900
committerYour Name <you@example.com>2019-01-17 21:55:50 +0900
commit613d4f90fdc559573e3e6433ae70d4074b809706 (patch)
treed8f97d98c035c4f76c712f054cccd7a8646c74b3
parenta8ff08420fbd160e9ddbc16b6f5b228c0d853467 (diff)
downloadwf-clock-613d4f90fdc559573e3e6433ae70d4074b809706.tar.gz
port from DirectX to WPF2019-01-17
All miracles require sacrifice. (Memory consumption now goes up to 200MB instead of 40MB.)
-rw-r--r--WarframeClock/Clock.cs12
-rw-r--r--WarframeClock/ClockOverlay.cs221
-rw-r--r--WarframeClock/Native.cs39
-rw-r--r--WarframeClock/OverlayWindow.xaml22
-rw-r--r--WarframeClock/OverlayWindow.xaml.cs145
-rw-r--r--WarframeClock/Program.cs102
-rw-r--r--WarframeClock/WarframeClock.csproj23
-rw-r--r--WarframeClock/packages.config4
8 files changed, 235 insertions, 333 deletions
diff --git a/WarframeClock/Clock.cs b/WarframeClock/Clock.cs
index 9d1ffa7..688781b 100644
--- a/WarframeClock/Clock.cs
+++ b/WarframeClock/Clock.cs
@@ -2,11 +2,11 @@
namespace WarframeClock
{
- public class Clock
+ public static class Clock
{
- public long CetusExpiry { get; set; } = -1;
+ public static long CetusExpiry { get; set; } = -1;
- public string CetusExpiryString()
+ public static string CetusExpiryString()
{
double currentTime = GetCurrentTime();
double cetusLen = 8998.8748;
@@ -25,7 +25,7 @@ namespace WarframeClock
return $"Plains: 🌙 {GetReadableTimeSpan(cetusBegin + cetusLen - currentTime)}";
}
- public string VallisExpiryString()
+ public static string VallisExpiryString()
{
double currentTime = GetCurrentTime();
double dayStart = 1542131224;
@@ -41,10 +41,10 @@ namespace WarframeClock
return $"Vallis: ☁[→❄️] {GetReadableTimeSpan(dayStart + 1600 - currentTime)}";
}
- private double GetCurrentTime() =>
+ private static double GetCurrentTime() =>
DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1)).TotalMilliseconds / 1000;
- private string GetReadableTimeSpan(double span) =>
+ private static string GetReadableTimeSpan(double span) =>
$"{Math.Floor(span / 60)}m{Math.Floor(span % 60)}s";
}
}
diff --git a/WarframeClock/ClockOverlay.cs b/WarframeClock/ClockOverlay.cs
deleted file mode 100644
index acdd2f7..0000000
--- a/WarframeClock/ClockOverlay.cs
+++ /dev/null
@@ -1,221 +0,0 @@
-using System;
-using System.Linq;
-using System.Threading;
-using SharpDX;
-using SharpDX.Direct2D1;
-using SharpDX.DirectWrite;
-using SharpDX.DXGI;
-using SharpDX.Mathematics.Interop;
-using AlphaMode = SharpDX.Direct2D1.AlphaMode;
-using Color = System.Drawing.Color;
-
-namespace WarframeClock
-{
- class ClockOverlay : IDisposable
- {
- private readonly string targetProcessName;
- private Clock clock;
- private IntPtr targetWindowHandle;
- private IntPtr handle;
- private bool isVisible;
- private bool isTopMost;
- private Native.Rect parentBounds;
-
- private WindowRenderTarget device;
- private SharpDX.Direct2D1.Factory _factory;
- private SharpDX.DirectWrite.Factory _fontFactory;
- private static readonly Color gdiTransparent = Color.Transparent;
- private readonly RawColor4 transparent = new RawColor4(gdiTransparent.R, gdiTransparent.G, gdiTransparent.B,
- gdiTransparent.A);
- private TextFormat textFont;
- private SolidColorBrush textBrush;
-
- public ClockOverlay(Clock clock, string targetProcessName)
- {
- this.clock = clock;
- this.targetProcessName = targetProcessName;
-
- SetupOverlayWindow();
- }
-
- ~ClockOverlay()
- {
- Dispose();
- }
-
- private void SetupOverlayWindow()
- {
- isVisible = false;
- isTopMost = false;
-
- parentBounds = new Native.Rect()
- {
- Top = 0,
- Left = 0,
- Right = Native.GetSystemMetrics(0),
- Bottom = Native.GetSystemMetrics(1),
- };
-
- handle = Native.CreateWindowEx(
- 0x8000000 /* WS_EX_NOACTIVATE */
- | 0x80000 /* WS_EX_LAYERED */
- | 0x80 /* WS_EX_TOOLWINDOW */
- | 0x20 /* WS_EX_TRANSPARENT */,
- "Static",
- "",
- 0x8000000 /* WS_DISABLED */
- | 0x80000000 /* WS_POPUP */,
- parentBounds.Left,
- parentBounds.Top,
- parentBounds.Right - parentBounds.Left,
- parentBounds.Bottom - parentBounds.Top,
- IntPtr.Zero,
- IntPtr.Zero,
- IntPtr.Zero,
- IntPtr.Zero);
- if (handle == IntPtr.Zero)
- {
- throw new Exception("Could not create OverlayWindow");
- }
- Native.SetLayeredWindowAttributes(handle, 0, 255, 0x00000002 /* LWA_ALPHA */);
-
- // Setup Direct*
- _factory = new SharpDX.Direct2D1.Factory();
- _fontFactory = new SharpDX.DirectWrite.Factory();
-
- var targetProperties = new HwndRenderTargetProperties
- {
- Hwnd = handle,
- PixelSize = new Size2(
- parentBounds.Right - parentBounds.Left,
- parentBounds.Bottom - parentBounds.Top),
- PresentOptions = PresentOptions.None
- };
-
- var prop = new RenderTargetProperties(RenderTargetType.Hardware,
- new PixelFormat(Format.B8G8R8A8_UNorm, AlphaMode.Premultiplied), 0, 0, RenderTargetUsage.None,
- FeatureLevel.Level_DEFAULT);
- device = new WindowRenderTarget(_factory, prop, targetProperties);
-
- textBrush = new SolidColorBrush(device, new RawColor4(0xff, 0xff, 0xff, 0x7f));
- textFont = new TextFormat(_fontFactory, "Segoe UI", FontWeight.Normal, FontStyle.Normal, 12);
- }
-
- public void Dispose()
- {
- textBrush.Dispose();
- textFont.Dispose();
- _fontFactory.Dispose();
- _factory.Dispose();
- device.Dispose();
-
- Native.DestroyWindow(handle);
- }
-
- public void Start()
- {
- while (true)
- {
- Update();
- Thread.Sleep(100);
- }
- }
-
- private void Update()
- {
- GetTargetWindow();
- if (targetWindowHandle == IntPtr.Zero)
- {
- if (isVisible)
- {
- isVisible = false;
- Native.ShowWindow(handle, 0);
- }
- return;
- }
-
- // Set top-most flag if the target window is foreground. Move to
- // behind the current foreground window otherwise.
- var currentActiveWindow = Native.GetForegroundWindow();
- if (currentActiveWindow == targetWindowHandle != isTopMost || !isVisible)
- {
- isTopMost = currentActiveWindow == targetWindowHandle;
- var after = isTopMost ? (IntPtr)(-1 /* HWND_TOPMOST */) : currentActiveWindow;
- Console.WriteLine($"ClockOverlay: Overlay is inserted after: {after}");
- Native.SetWindowPos(handle, after, 0, 0, 0, 0, 0x0001 /* SWP_NOSIZE */ | 0x0002 /* SWP_NOMOVE */);
- }
-
- if (!isVisible)
- {
- isVisible = true;
- Native.ShowWindow(handle, 5);
- }
-
- Native.Rect newBounds;
- if (Native.GetWindowRect(targetWindowHandle, out newBounds) == 0)
- {
- targetWindowHandle = IntPtr.Zero;
- return;
- }
- if (parentBounds.Left != newBounds.Left || parentBounds.Right != newBounds.Right ||
- parentBounds.Top != newBounds.Top || parentBounds.Bottom != newBounds.Bottom)
- {
- parentBounds = newBounds;
-
- var width = parentBounds.Right - parentBounds.Left;
- var height = parentBounds.Bottom - parentBounds.Top;
-
- Native.SetWindowPos(handle, IntPtr.Zero, parentBounds.Left, parentBounds.Top, width, height,
- 0x0004 /* SWP_NOZORDER */);
-
- device.Resize(new Size2(width, height));
-
- Native.RawMargin _margin;
- _margin.cxLeftWidth = parentBounds.Left;
- _margin.cxRightWidth = width;
- _margin.cyBottomHeight = height;
- _margin.cyTopHeight = parentBounds.Top;
- Native.DwmExtendFrameIntoClientArea(handle, ref _margin);
- }
-
- // Render text
- device.BeginDraw();
- device.Clear(transparent);
-
- var infoText = $"{clock.CetusExpiryString()} {clock.VallisExpiryString()}";
- device.DrawText(infoText, textFont,
- new RawRectangleF(30, parentBounds.Bottom - parentBounds.Top - 50, float.MaxValue, float.MaxValue),
- textBrush);
-
- device.EndDraw();
- }
-
- private void GetTargetWindow()
- {
- if (targetWindowHandle == IntPtr.Zero || Native.IsWindow(targetWindowHandle) == 0)
- {
- targetWindowHandle = IntPtr.Zero;
-
- var process = System.Diagnostics.Process.GetProcessesByName(targetProcessName).FirstOrDefault();
- if (process == null)
- {
- return;
- }
-
- try
- {
- targetWindowHandle = process.MainWindowHandle;
- if (targetWindowHandle != IntPtr.Zero)
- {
- Console.WriteLine($"ClockOverlay: Found a process with name={targetProcessName}; " +
- $"MainWindowHandle={targetWindowHandle}");
- }
- }
- catch (Exception)
- {
- // Ignore errors; maybe the process is just exiting. Let's retry during the next cycle.
- }
- }
- }
- }
-}
diff --git a/WarframeClock/Native.cs b/WarframeClock/Native.cs
index 560e06b..c83bac9 100644
--- a/WarframeClock/Native.cs
+++ b/WarframeClock/Native.cs
@@ -6,45 +6,18 @@ namespace WarframeClock
class Native
{
[DllImport("user32.dll")]
- public static extern IntPtr CreateWindowEx(
- uint dwExStyle,
- string lpClassName,
- string lpWindowName,
- uint dwStyle,
- int x,
- int y,
- int nWidth,
- int nHeight,
- IntPtr hWndParent,
- IntPtr hMenu,
- IntPtr hInstance,
- IntPtr lpParam);
-
- [DllImport("user32.dll")]
- public static extern int DestroyWindow(IntPtr hwnd);
-
- [DllImport("user32.dll")]
public static extern int SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int x, int y, int cx, int cy,
uint uFlags);
[DllImport("user32.dll")]
- public static extern int GetSystemMetrics(int index);
-
- [DllImport("user32.dll")]
public static extern int IsWindow(IntPtr hWnd);
[DllImport("user32.dll")]
public static extern IntPtr GetForegroundWindow();
[DllImport("user32.dll")]
- public static extern int ShowWindow(IntPtr hWnd, uint nCmdShow);
-
- [DllImport("user32.dll")]
public static extern int GetWindowRect(IntPtr hwnd, out Rect lpRect);
- [DllImport("user32.dll")]
- public static extern bool SetLayeredWindowAttributes(IntPtr hwnd, uint crKey, byte bAlpha, uint dwFlags);
-
[StructLayout(LayoutKind.Sequential)]
public struct Rect
{
@@ -53,17 +26,5 @@ namespace WarframeClock
public int Right;
public int Bottom;
}
-
- [DllImport("dwmapi.dll")]
- public static extern void DwmExtendFrameIntoClientArea(IntPtr hWnd, ref RawMargin pMargins);
-
- [StructLayout(LayoutKind.Sequential)]
- public struct RawMargin
- {
- public int cxLeftWidth;
- public int cxRightWidth;
- public int cyTopHeight;
- public int cyBottomHeight;
- }
}
} \ No newline at end of file
diff --git a/WarframeClock/OverlayWindow.xaml b/WarframeClock/OverlayWindow.xaml
new file mode 100644
index 0000000..63cc8f8
--- /dev/null
+++ b/WarframeClock/OverlayWindow.xaml
@@ -0,0 +1,22 @@
+<Window x:Class="WarframeClock.OverlayWindow"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ mc:Ignorable="d"
+ Title="WarframeClock OverlayWindow"
+ WindowStyle="None"
+ ShowInTaskbar="false"
+ AllowsTransparency="True">
+ <Window.Background>
+ <SolidColorBrush Opacity="0.0" Color="Black" />
+ </Window.Background>
+ <Label x:Name="OverlayLabel"
+ HorizontalAlignment="Left"
+ VerticalAlignment="Bottom"
+ FontFamily="Segoe UI"
+ FontSize="14"
+ Content="!!PLACEHOLDER!!"
+ Foreground="White"
+ Margin="30,0,0,20" />
+</Window>
diff --git a/WarframeClock/OverlayWindow.xaml.cs b/WarframeClock/OverlayWindow.xaml.cs
new file mode 100644
index 0000000..8ce8f1c
--- /dev/null
+++ b/WarframeClock/OverlayWindow.xaml.cs
@@ -0,0 +1,145 @@
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Interop;
+
+namespace WarframeClock
+{
+ public partial class OverlayWindow : Window
+ {
+ private IntPtr targetWindowHandle;
+ private Native.Rect parentBounds = new Native.Rect()
+ {
+ Top = 0,
+ Left = 0,
+ Right = 300,
+ Bottom = 300,
+ };
+
+ public IntPtr WindowHandle
+ {
+ get; private set;
+ }
+
+ public OverlayWindow()
+ {
+ InitializeComponent();
+ WindowHandle = new WindowInteropHelper(this).EnsureHandle();
+ }
+
+ public void Start()
+ {
+ var updateLoop = Task.Factory.StartNew(() =>
+ {
+ while (true)
+ {
+ Dispatcher.BeginInvoke(new Action(() => Update()));
+ Thread.Sleep(100);
+ }
+ });
+ System.Windows.Threading.Dispatcher.Run();
+ }
+
+ private void Update()
+ {
+ var handle = WindowHandle;
+
+ GetTargetWindow();
+ if (targetWindowHandle == IntPtr.Zero ||
+ Native.GetWindowRect(targetWindowHandle, out Native.Rect newBounds) == 0)
+ {
+ targetWindowHandle = IntPtr.Zero;
+ if (IsVisible)
+ {
+ Console.WriteLine($"ClockOverlay ({handle}): Hide");
+ Hide();
+ }
+ return;
+ }
+
+ // Set top-most flag if the target window is foreground. Move to
+ // behind the current foreground window otherwise.
+ var currentActiveWindow = Native.GetForegroundWindow();
+ if (currentActiveWindow != IntPtr.Zero &&
+ (!IsVisible || currentActiveWindow == targetWindowHandle != Topmost))
+ {
+ if (currentActiveWindow == targetWindowHandle)
+ {
+ Console.WriteLine($"ClockOverlay ({handle}): Overlay is now top-most");
+ Topmost = true;
+ }
+ else
+ {
+ Console.WriteLine($"ClockOverlay ({handle}): Overlay is now non-top-most, " +
+ $"behind {currentActiveWindow}");
+
+ // Setting Topmost to false brings the overlay to just
+ // behind the other top-most window -- above the foreground
+ // window. This is not what we want to do here.
+ // Setting Topmost is still needed to update the private
+ // backing fields.
+ Topmost = false;
+ Native.SetWindowPos(handle, currentActiveWindow, 0, 0, 0, 0,
+ 0x0001 /* SWP_NOSIZE */ | 0x0002 /* SWP_NOMOVE */ | 0x0010 /* SWP_NOACTIVATE */);
+ }
+ }
+
+ if (!IsVisible ||
+ parentBounds.Left != newBounds.Left || parentBounds.Right != newBounds.Right ||
+ parentBounds.Top != newBounds.Top || parentBounds.Bottom != newBounds.Bottom)
+ {
+ parentBounds = newBounds;
+
+ var width = parentBounds.Right - parentBounds.Left;
+ var height = parentBounds.Bottom - parentBounds.Top;
+
+ // Do not use window.Left (and so on) because they're DPI-aware.
+ // We don't want that....
+ Console.WriteLine($"ClockOverlay ({handle}): Move window to: " +
+ $"l={parentBounds.Left};t={parentBounds.Top};w={width};h={height}");
+ Native.SetWindowPos(handle, IntPtr.Zero, parentBounds.Left, parentBounds.Top, width, height,
+ 0x0004 /* SWP_NOZORDER */);
+ }
+
+ // Render text
+ var infoText = $"{Clock.CetusExpiryString()} {Clock.VallisExpiryString()}";
+ OverlayLabel.Content = infoText;
+ if (!IsVisible)
+ {
+ Console.WriteLine($"ClockOverlay ({handle}): Show");
+ Show();
+ }
+ }
+
+ private void GetTargetWindow()
+ {
+ if (targetWindowHandle == IntPtr.Zero || Native.IsWindow(targetWindowHandle) == 0)
+ {
+ targetWindowHandle = IntPtr.Zero;
+
+ var ary = System.Diagnostics.Process.GetProcesses();
+ foreach (var process in ary)
+ {
+ if (process.ProcessName == "Warframe" || process.ProcessName == "Warframe.x64")
+ {
+ try
+ {
+ targetWindowHandle = process.MainWindowHandle;
+ if (targetWindowHandle != IntPtr.Zero)
+ {
+ Console.WriteLine($"ClockOverlay: Found a process with name={process.ProcessName}; " +
+ $"MainWindowHandle={targetWindowHandle}");
+ }
+ }
+ catch (Exception)
+ {
+ // Ignore errors; maybe the process is just exiting. Let's retry during the next cycle.
+ }
+ }
+ process.Dispose();
+ }
+ }
+ }
+ }
+}
diff --git a/WarframeClock/Program.cs b/WarframeClock/Program.cs
index 6378173..f390adc 100644
--- a/WarframeClock/Program.cs
+++ b/WarframeClock/Program.cs
@@ -1,93 +1,89 @@
using System;
using System.Linq;
using System.Threading;
-using System.Windows.Forms;
namespace WarframeClock
{
class Program
{
- public static bool UseWorldStatePhp = true;
- public static string VersionString = "Warframe Clock Overlay 2019-01-16";
- private static Clock clock;
- private static System.Threading.Timer worldStateFetchTimer;
+ public static readonly string VersionString = "Warframe Clock Overlay 2019-01-17";
+ public static readonly bool UseWorldStatePhp = true;
+
+ private static Timer worldStateFetchTimer;
+ private static System.Windows.Forms.NotifyIcon notifyIcon;
+ private static OverlayWindow overlayWindow;
[STAThread]
static void Main(string[] args)
{
try
{
- clock = new Clock();
-
- StartNotifyIcon();
if (UseWorldStatePhp)
StartWorldStateFetch();
+ StartNotifyIcon();
StartOverlay();
}
catch (Exception ex)
{
Console.WriteLine($"Main: Uncaught exception: {ex.Message}");
Console.WriteLine(ex.StackTrace);
- MessageBox.Show($"Main: Uncaught exception: {ex.Message}\n{ex.StackTrace}");
+ System.Windows.Forms.MessageBox.Show($"Main: Uncaught exception: {ex.Message}\n{ex.StackTrace}");
+ Terminate();
}
}
- private static void StartNotifyIcon()
+ private static void StartWorldStateFetch()
{
- var thread = new Thread(delegate ()
+ worldStateFetchTimer = new Timer(state =>
{
- var iconMenu = new ContextMenu();
- var icon = new NotifyIcon()
+ try
{
- Text = "Warframe Clock",
- ContextMenu = iconMenu,
- Icon = Properties.Resources.TrayIcon
- };
-
- iconMenu.MenuItems.Add(new MenuItem(VersionString) { Enabled = false });
- iconMenu.MenuItems.Add(new MenuItem("Quit", (_, __) =>
+ var worldState = WorldState.Fetch();
+ var cetusSyndicate = worldState.SyndicateMissions.FirstOrDefault(mi => mi.Tag == "CetusSyndicate");
+ if (cetusSyndicate == null)
+ {
+ Console.WriteLine("WorldState: CetusSyndicate missions not found");
+ return;
+ }
+ var cetusExpiry = cetusSyndicate.Expiry.Date.NumberLong;
+ Console.WriteLine($"WorldState: CetusSyndicate missions expire at {cetusExpiry}");
+ Clock.CetusExpiry = cetusExpiry;
+ }
+ catch (Exception ex)
{
- icon.Dispose();
- Environment.Exit(0);
- }));
- icon.Visible = true;
-
- Application.Run();
- });
- thread.Start();
+ Console.WriteLine($"WorldState: Failed to fetch or parse worldState.php: {ex.ToString()}");
+ Console.WriteLine(ex.StackTrace);
+ }
+ }, null, 0, 10 * 60 * 1000 /* 10 minutes */);
}
- private static void StartWorldStateFetch()
+ private static void StartNotifyIcon()
{
- worldStateFetchTimer = new System.Threading.Timer(state =>
+ var iconMenu = new System.Windows.Forms.ContextMenu();
+ notifyIcon = new System.Windows.Forms.NotifyIcon()
{
- lock (state)
- {
- try
- {
- var worldState = WorldState.Fetch();
- var cetusSyndicate = worldState.SyndicateMissions.FirstOrDefault(mi => mi.Tag == "CetusSyndicate");
- if (cetusSyndicate == null)
- {
- Console.WriteLine("WorldState: CetusSyndicate missions not found");
- return;
- }
- var cetusExpiry = cetusSyndicate.Expiry.Date.NumberLong;
- Console.WriteLine($"WorldState: CetusSyndicate missions expire at {cetusExpiry}");
- clock.CetusExpiry = cetusExpiry;
- }
- catch (Exception ex)
- {
- Console.WriteLine($"WorldState: Failed to fetch or parse worldState.php: {ex.ToString()}");
- Console.WriteLine(ex.StackTrace);
- }
- }
- }, new object(), 0, 10 * 60 * 1000 /* 10 minutes */);
+ Text = "Warframe Clock",
+ ContextMenu = iconMenu,
+ Icon = Properties.Resources.TrayIcon
+ };
+
+ iconMenu.MenuItems.Add(new System.Windows.Forms.MenuItem(VersionString) { Enabled = false });
+ iconMenu.MenuItems.Add(new System.Windows.Forms.MenuItem("Quit", (_, __) => Terminate()));
+ notifyIcon.Visible = true;
}
private static void StartOverlay()
{
- new ClockOverlay(clock, "Warframe.x64").Start();
+ overlayWindow = new OverlayWindow();
+ overlayWindow.Start();
+ }
+
+ private static void Terminate()
+ {
+ notifyIcon.Dispose();
+ overlayWindow.Close();
+ worldStateFetchTimer.Change(Timeout.Infinite, Timeout.Infinite);
+ Environment.Exit(0);
}
}
}
diff --git a/WarframeClock/WarframeClock.csproj b/WarframeClock/WarframeClock.csproj
index 88e8198..8bcf4e6 100644
--- a/WarframeClock/WarframeClock.csproj
+++ b/WarframeClock/WarframeClock.csproj
@@ -62,31 +62,28 @@
<Reference Include="Costura, Version=3.3.0.0, Culture=neutral, PublicKeyToken=9919ef960d84173d, processorArchitecture=MSIL">
<HintPath>..\packages\Costura.Fody.3.3.0\lib\net40\Costura.dll</HintPath>
</Reference>
- <Reference Include="SharpDX, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL">
- <HintPath>..\packages\SharpDX.4.2.0\lib\net45\SharpDX.dll</HintPath>
- </Reference>
- <Reference Include="SharpDX.Direct2D1, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL">
- <HintPath>..\packages\SharpDX.Direct2D1.4.2.0\lib\net45\SharpDX.Direct2D1.dll</HintPath>
- </Reference>
- <Reference Include="SharpDX.DXGI, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL">
- <HintPath>..\packages\SharpDX.DXGI.4.2.0\lib\net45\SharpDX.DXGI.dll</HintPath>
- </Reference>
+ <Reference Include="PresentationCore" />
+ <Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Windows.Forms" />
+ <Reference Include="System.Xaml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
+ <Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="Clock.cs" />
- <Compile Include="ClockOverlay.cs" />
<Compile Include="Native.cs" />
+ <Compile Include="OverlayWindow.xaml.cs">
+ <DependentUpon>OverlayWindow.xaml</DependentUpon>
+ </Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources1.Designer.cs">
@@ -122,6 +119,12 @@
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
+ <ItemGroup>
+ <Page Include="OverlayWindow.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Fody.3.3.5\build\Fody.targets" Condition="Exists('..\packages\Fody.3.3.5\build\Fody.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
diff --git a/WarframeClock/packages.config b/WarframeClock/packages.config
index ad6a7d1..3d24229 100644
--- a/WarframeClock/packages.config
+++ b/WarframeClock/packages.config
@@ -2,8 +2,4 @@
<packages>
<package id="Costura.Fody" version="3.3.0" targetFramework="net462" />
<package id="Fody" version="3.3.5" targetFramework="net462" developmentDependency="true" />
- <package id="Newtonsoft.Json" version="12.0.1" targetFramework="net462" />
- <package id="SharpDX" version="4.2.0" targetFramework="net462" />
- <package id="SharpDX.Direct2D1" version="4.2.0" targetFramework="net462" />
- <package id="SharpDX.DXGI" version="4.2.0" targetFramework="net462" />
</packages> \ No newline at end of file