mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 14:53:50 +02:00
migrate to wpf
This commit is contained in:
9
App.xaml
Normal file
9
App.xaml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<Application x:Class="VRCX.App"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:local="clr-namespace:VRCX"
|
||||||
|
StartupUri="MainWindow.xaml">
|
||||||
|
<Application.Resources>
|
||||||
|
|
||||||
|
</Application.Resources>
|
||||||
|
</Application>
|
||||||
14
App.xaml.cs
Normal file
14
App.xaml.cs
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Configuration;
|
||||||
|
using System.Data;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
|
namespace VRCX
|
||||||
|
{
|
||||||
|
public partial class App : Application
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
59
AppApi.cs
59
AppApi.cs
@@ -15,6 +15,7 @@ using System.IO;
|
|||||||
using System.Net;
|
using System.Net;
|
||||||
using Windows.UI.Notifications;
|
using Windows.UI.Notifications;
|
||||||
using Windows.Data.Xml.Dom;
|
using Windows.Data.Xml.Dom;
|
||||||
|
using System.Windows;
|
||||||
|
|
||||||
namespace VRCX
|
namespace VRCX
|
||||||
{
|
{
|
||||||
@@ -27,9 +28,59 @@ namespace VRCX
|
|||||||
Instance = new AppApi();
|
Instance = new AppApi();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void CloseMainWindow()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
MainWindow.Instance.Dispatcher.BeginInvoke(new MethodInvoker(() =>
|
||||||
|
{
|
||||||
|
MainWindow.Instance.Close();
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void MinimizeMainWindow()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
MainWindow.Instance.Dispatcher.BeginInvoke(new MethodInvoker(() =>
|
||||||
|
{
|
||||||
|
MainWindow.Instance.WindowState = WindowState.Minimized;
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ToggleMaximizeMainWindow()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
MainWindow.Instance.Dispatcher.BeginInvoke(new MethodInvoker(() =>
|
||||||
|
{
|
||||||
|
var mainWindow = MainWindow.Instance;
|
||||||
|
if (mainWindow.WindowState == WindowState.Maximized)
|
||||||
|
{
|
||||||
|
mainWindow.WindowState = WindowState.Normal;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mainWindow.WindowState = WindowState.Maximized;
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void ShowDevTools()
|
public void ShowDevTools()
|
||||||
{
|
{
|
||||||
MainForm.Instance.Browser.ShowDevTools();
|
MainWindow.Instance.Browser.ShowDevTools();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DeleteAllCookies()
|
public void DeleteAllCookies()
|
||||||
@@ -145,13 +196,13 @@ namespace VRCX
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
MainForm.Instance.BeginInvoke(new MethodInvoker(() =>
|
/*MainForm.Instance.BeginInvoke(new MethodInvoker(() =>
|
||||||
{
|
{
|
||||||
if (VRForm.Instance == null)
|
if (VRForm.Instance == null)
|
||||||
{
|
{
|
||||||
new VRForm().Show();
|
new VRForm().Show();
|
||||||
}
|
}
|
||||||
}));
|
}));*/
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
@@ -215,7 +266,7 @@ namespace VRCX
|
|||||||
{
|
{
|
||||||
if (enabled == true)
|
if (enabled == true)
|
||||||
{
|
{
|
||||||
var path = Application.ExecutablePath;
|
var path = System.Reflection.Assembly.GetExecutingAssembly().Location;
|
||||||
key.SetValue("VRCX", $"\"{path}\" --startup");
|
key.SetValue("VRCX", $"\"{path}\" --startup");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using CefSharp;
|
using CefSharp;
|
||||||
using CefSharp.WinForms;
|
using CefSharp.Wpf;
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
@@ -16,6 +16,8 @@ namespace VRCX
|
|||||||
|
|
||||||
internal void Init()
|
internal void Init()
|
||||||
{
|
{
|
||||||
|
AppContext.SetSwitch("Switch.System.Windows.Input.Stylus.EnablePointerSupport", true);
|
||||||
|
|
||||||
var cefSettings = new CefSettings
|
var cefSettings = new CefSettings
|
||||||
{
|
{
|
||||||
CachePath = Path.Combine(Program.BaseDirectory, "cache"),
|
CachePath = Path.Combine(Program.BaseDirectory, "cache"),
|
||||||
@@ -34,6 +36,7 @@ namespace VRCX
|
|||||||
SchemeHandlerFactory = new FolderSchemeHandlerFactory(Application.StartupPath + "/../../../html")
|
SchemeHandlerFactory = new FolderSchemeHandlerFactory(Application.StartupPath + "/../../../html")
|
||||||
});*/
|
});*/
|
||||||
|
|
||||||
|
cefSettings.CefCommandLineArgs.Add("disable-threaded-scrolling");
|
||||||
cefSettings.CefCommandLineArgs.Add("ignore-certificate-errors");
|
cefSettings.CefCommandLineArgs.Add("ignore-certificate-errors");
|
||||||
cefSettings.CefCommandLineArgs.Add("disable-plugins");
|
cefSettings.CefCommandLineArgs.Add("disable-plugins");
|
||||||
cefSettings.CefCommandLineArgs.Add("disable-spell-checking");
|
cefSettings.CefCommandLineArgs.Add("disable-spell-checking");
|
||||||
|
|||||||
73
DragHandler.cs
Normal file
73
DragHandler.cs
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
// Copyright(c) 2019 pypy. All rights reserved.
|
||||||
|
//
|
||||||
|
// This work is licensed under the terms of the MIT license.
|
||||||
|
// For a copy, see <https://opensource.org/licenses/MIT>.
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Drawing;
|
||||||
|
using CefSharp;
|
||||||
|
using CefSharp.Enums;
|
||||||
|
|
||||||
|
namespace VRCX
|
||||||
|
{
|
||||||
|
public class DragHandler : IDragHandler
|
||||||
|
{
|
||||||
|
public event Action<Region> RegionsChanged;
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
RegionsChanged = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IDragHandler.OnDragEnter(IWebBrowser chromiumWebBrowser, IBrowser browser, IDragData dragData, DragOperationsMask mask)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void IDragHandler.OnDraggableRegionsChanged(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, IList<DraggableRegion> regions)
|
||||||
|
{
|
||||||
|
//By default popup browers are native windows in WPF so we cannot handle their drag using this method
|
||||||
|
if (browser.IsPopup == false)
|
||||||
|
{
|
||||||
|
//NOTE: I haven't tested with dynamically adding removing regions so this may need some tweaking
|
||||||
|
Region draggableRegion = null;
|
||||||
|
|
||||||
|
if (regions.Count > 0)
|
||||||
|
{
|
||||||
|
//Take the individual Region and construct a complex Region that represents them all.
|
||||||
|
foreach (var region in regions)
|
||||||
|
{
|
||||||
|
var rect = new Rectangle(region.X, region.Y, region.Width, region.Height);
|
||||||
|
|
||||||
|
if (draggableRegion == null)
|
||||||
|
{
|
||||||
|
draggableRegion = new Region(rect);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (region.Draggable)
|
||||||
|
{
|
||||||
|
draggableRegion.Union(rect);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//In the scenario where we have an outer region, that is draggable and it has
|
||||||
|
// an inner region that's not, we must exclude the non draggable.
|
||||||
|
// Not all scenarios are covered in this example.
|
||||||
|
draggableRegion.Exclude(rect);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var handler = RegionsChanged;
|
||||||
|
|
||||||
|
if (handler != null)
|
||||||
|
{
|
||||||
|
handler(draggableRegion);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
25
MainWindow.xaml
Normal file
25
MainWindow.xaml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<Window x:Class="VRCX.MainWindow"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:local="clr-namespace:VRCX"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
Title="VRCX"
|
||||||
|
Width="800"
|
||||||
|
Height="450"
|
||||||
|
MinWidth="320"
|
||||||
|
MinHeight="240"
|
||||||
|
WindowStyle="None"
|
||||||
|
WindowStartupLocation="CenterScreen"
|
||||||
|
Loaded="Window_Loaded"
|
||||||
|
Closed="Window_Closed"
|
||||||
|
Closing="Window_Closing"
|
||||||
|
LocationChanged="Window_LocationChanged"
|
||||||
|
SizeChanged="Window_SizeChanged">
|
||||||
|
<WindowChrome.WindowChrome>
|
||||||
|
<WindowChrome
|
||||||
|
CaptionHeight="0"
|
||||||
|
ResizeBorderThickness="5"/>
|
||||||
|
</WindowChrome.WindowChrome>
|
||||||
|
</Window>
|
||||||
244
MainWindow.xaml.cs
Normal file
244
MainWindow.xaml.cs
Normal file
@@ -0,0 +1,244 @@
|
|||||||
|
using CefSharp;
|
||||||
|
using CefSharp.Wpf;
|
||||||
|
using System;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Drawing;
|
||||||
|
using System.IO;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using System.Windows.Input;
|
||||||
|
|
||||||
|
namespace VRCX
|
||||||
|
{
|
||||||
|
public partial class MainWindow : Window
|
||||||
|
{
|
||||||
|
public static MainWindow Instance;
|
||||||
|
public ChromiumWebBrowser Browser;
|
||||||
|
|
||||||
|
// Store draggable region if we have one - used for hit testing
|
||||||
|
private Region Region_;
|
||||||
|
|
||||||
|
private NotifyIcon NotifyIcon_;
|
||||||
|
private bool Quit_;
|
||||||
|
|
||||||
|
private int LastLocationX;
|
||||||
|
private int LastLocationY;
|
||||||
|
private int LastSizeWidth;
|
||||||
|
private int LastSizeHeight;
|
||||||
|
|
||||||
|
public MainWindow()
|
||||||
|
{
|
||||||
|
Instance = this;
|
||||||
|
InitializeComponent();
|
||||||
|
DoTrayIcon();
|
||||||
|
|
||||||
|
var dragHandler = new DragHandler();
|
||||||
|
dragHandler.RegionsChanged += (region) =>
|
||||||
|
{
|
||||||
|
if (region != null)
|
||||||
|
{
|
||||||
|
// Only wire up event handler once
|
||||||
|
if (Region_ == null)
|
||||||
|
{
|
||||||
|
Browser.PreviewMouseLeftButtonDown += (sender, e) =>
|
||||||
|
{
|
||||||
|
var point = e.GetPosition(Browser);
|
||||||
|
|
||||||
|
if (Region_.IsVisible((float)point.X, (float)point.Y))
|
||||||
|
{
|
||||||
|
var window = GetWindow(this);
|
||||||
|
window.DragMove();
|
||||||
|
|
||||||
|
e.Handled = true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
Region_ = region;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Browser = new ChromiumWebBrowser(
|
||||||
|
Path.Combine(Program.BaseDirectory, "html/index.html")
|
||||||
|
)
|
||||||
|
{
|
||||||
|
DragHandler = dragHandler,
|
||||||
|
MenuHandler = new NoopMenuHandler(),
|
||||||
|
BrowserSettings =
|
||||||
|
{
|
||||||
|
DefaultEncoding = "UTF-8",
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Browser.IsBrowserInitializedChanged += (A, B) =>
|
||||||
|
{
|
||||||
|
if (Browser.IsDisposed == false)
|
||||||
|
{
|
||||||
|
Browser.ShowDevTools();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Util.ApplyJavascriptBindings(Browser.JavascriptObjectRepository);
|
||||||
|
|
||||||
|
Content = Browser;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
// restore last window location and size
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int.TryParse(VRCXStorage.Instance.Get("VRCX_LocationX"), out LastLocationX);
|
||||||
|
int.TryParse(VRCXStorage.Instance.Get("VRCX_LocationY"), out LastLocationY);
|
||||||
|
int.TryParse(VRCXStorage.Instance.Get("VRCX_SizeWidth"), out LastSizeWidth);
|
||||||
|
int.TryParse(VRCXStorage.Instance.Get("VRCX_SizeHeight"), out LastSizeHeight);
|
||||||
|
var location = new System.Drawing.Point(LastLocationX, LastLocationY);
|
||||||
|
var size = new System.Drawing.Size(LastSizeWidth, LastSizeHeight);
|
||||||
|
var screen = Screen.FromPoint(location);
|
||||||
|
if (screen.Bounds.Contains(location.X, location.Y) == true)
|
||||||
|
{
|
||||||
|
Left = location.X;
|
||||||
|
Top = location.Y;
|
||||||
|
}
|
||||||
|
if (size.Width > 0 && size.Height > 0)
|
||||||
|
{
|
||||||
|
Width = size.Width;
|
||||||
|
Height = size.Height;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// restore last window state
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var state = WindowState;
|
||||||
|
if ("true".Equals(VRCXStorage.Instance.Get("VRCX_StartAsMinimizedState")))
|
||||||
|
{
|
||||||
|
state = WindowState.Minimized;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (int.TryParse(VRCXStorage.Instance.Get("VRCX_WindowState"), out int v))
|
||||||
|
{
|
||||||
|
state = (WindowState)v;
|
||||||
|
}
|
||||||
|
if (state == WindowState.Minimized)
|
||||||
|
{
|
||||||
|
state = WindowState.Normal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
WindowState = state;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Window_Closed(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
VRCXStorage.Instance.Set("VRCX_LocationX", LastLocationX.ToString());
|
||||||
|
VRCXStorage.Instance.Set("VRCX_LocationY", LastLocationY.ToString());
|
||||||
|
VRCXStorage.Instance.Set("VRCX_SizeWidth", LastSizeWidth.ToString());
|
||||||
|
VRCXStorage.Instance.Set("VRCX_SizeHeight", LastSizeHeight.ToString());
|
||||||
|
VRCXStorage.Instance.Set("VRCX_WindowState", ((int)WindowState).ToString());
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
if (NotifyIcon_ != null)
|
||||||
|
{
|
||||||
|
NotifyIcon_.Visible = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Content = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DoTrayIcon()
|
||||||
|
{
|
||||||
|
var contextMenu = new ContextMenu();
|
||||||
|
|
||||||
|
contextMenu.MenuItems.Add("Open", (sender, e) =>
|
||||||
|
{
|
||||||
|
if (WindowState == WindowState.Minimized)
|
||||||
|
{
|
||||||
|
WindowState = WindowState.Normal;
|
||||||
|
}
|
||||||
|
Show();
|
||||||
|
Focus();
|
||||||
|
});
|
||||||
|
|
||||||
|
contextMenu.MenuItems.Add("-");
|
||||||
|
|
||||||
|
contextMenu.MenuItems.Add("Quit VRCX", (sender, e) =>
|
||||||
|
{
|
||||||
|
Quit_ = true;
|
||||||
|
Close();
|
||||||
|
});
|
||||||
|
|
||||||
|
NotifyIcon_ = new NotifyIcon();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var location = Assembly.GetExecutingAssembly().Location;
|
||||||
|
NotifyIcon_.Icon = System.Drawing.Icon.ExtractAssociatedIcon(location);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
NotifyIcon_.ContextMenu = contextMenu;
|
||||||
|
NotifyIcon_.Text = "VRCX";
|
||||||
|
NotifyIcon_.DoubleClick += (sender, e) =>
|
||||||
|
{
|
||||||
|
if (WindowState == WindowState.Minimized)
|
||||||
|
{
|
||||||
|
WindowState = WindowState.Normal;
|
||||||
|
}
|
||||||
|
Show();
|
||||||
|
Focus();
|
||||||
|
};
|
||||||
|
NotifyIcon_.Visible = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Window_Closing(object sender, CancelEventArgs e)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (Quit_ == false &&
|
||||||
|
"true".Equals(SharedVariable.Instance.Get("config:vrcx_closetotray")) == true)
|
||||||
|
{
|
||||||
|
e.Cancel = true;
|
||||||
|
Hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Window_LocationChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (WindowState == WindowState.Normal)
|
||||||
|
{
|
||||||
|
LastLocationX = (int)Left;
|
||||||
|
LastLocationY = (int)Top;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Window_SizeChanged(object sender, SizeChangedEventArgs e)
|
||||||
|
{
|
||||||
|
if (WindowState == WindowState.Normal)
|
||||||
|
{
|
||||||
|
LastSizeWidth = (int)Width;
|
||||||
|
LastSizeHeight = (int)Height;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
31
NoopMenuHandler.cs
Normal file
31
NoopMenuHandler.cs
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
// Copyright(c) 2019 pypy. All rights reserved.
|
||||||
|
//
|
||||||
|
// This work is licensed under the terms of the MIT license.
|
||||||
|
// For a copy, see <https://opensource.org/licenses/MIT>.
|
||||||
|
|
||||||
|
using CefSharp;
|
||||||
|
|
||||||
|
namespace VRCX
|
||||||
|
{
|
||||||
|
public class NoopMenuHandler : IContextMenuHandler
|
||||||
|
{
|
||||||
|
public void OnBeforeContextMenu(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model)
|
||||||
|
{
|
||||||
|
model.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool OnContextMenuCommand(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, IContextMenuParams parameters, CefMenuCommand commandId, CefEventFlags eventFlags)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnContextMenuDismissed(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool RunContextMenu(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, IContextMenuParams parameters, IMenuModel model, IRunContextMenuCallback callback)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -45,7 +45,11 @@ namespace VRCX
|
|||||||
|
|
||||||
CefService.Instance.Init();
|
CefService.Instance.Init();
|
||||||
VRCXVR.Instance.Init();
|
VRCXVR.Instance.Init();
|
||||||
Application.Run(new MainForm());
|
|
||||||
|
var app = new App();
|
||||||
|
app.InitializeComponent();
|
||||||
|
app.Run();
|
||||||
|
|
||||||
WebApi.Instance.SaveCookies();
|
WebApi.Instance.SaveCookies();
|
||||||
VRCXVR.Instance.Exit();
|
VRCXVR.Instance.Exit();
|
||||||
CefService.Instance.Exit();
|
CefService.Instance.Exit();
|
||||||
|
|||||||
43
VRCX.csproj
43
VRCX.csproj
@@ -10,6 +10,7 @@
|
|||||||
<AssemblyName>VRCX</AssemblyName>
|
<AssemblyName>VRCX</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
<Deterministic>true</Deterministic>
|
<Deterministic>true</Deterministic>
|
||||||
<NuGetPackageImportStamp>
|
<NuGetPackageImportStamp>
|
||||||
@@ -77,9 +78,12 @@
|
|||||||
<StartupObject />
|
<StartupObject />
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Reference Include="PresentationCore" />
|
||||||
|
<Reference Include="PresentationFramework" />
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="System.Management" />
|
<Reference Include="System.Management" />
|
||||||
|
<Reference Include="System.Xaml" />
|
||||||
<Reference Include="System.Xml.Linq" />
|
<Reference Include="System.Xml.Linq" />
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
@@ -89,29 +93,26 @@
|
|||||||
<Reference Include="System.Net.Http" />
|
<Reference Include="System.Net.Http" />
|
||||||
<Reference Include="System.Windows.Forms" />
|
<Reference Include="System.Windows.Forms" />
|
||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
|
<Reference Include="WindowsBase" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Include="App.xaml.cs">
|
||||||
|
<DependentUpon>App.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="CefService.cs" />
|
<Compile Include="CefService.cs" />
|
||||||
<Compile Include="Discord.cs" />
|
<Compile Include="Discord.cs" />
|
||||||
<Compile Include="CpuMonitor.cs" />
|
<Compile Include="CpuMonitor.cs" />
|
||||||
|
<Compile Include="MainWindow.xaml.cs">
|
||||||
|
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="DragHandler.cs" />
|
||||||
|
<Compile Include="NoopMenuHandler.cs" />
|
||||||
<Compile Include="OffScreenBrowser.cs" />
|
<Compile Include="OffScreenBrowser.cs" />
|
||||||
<Compile Include="NoopDragHandler.cs" />
|
<Compile Include="NoopDragHandler.cs" />
|
||||||
<Compile Include="WebApi.cs" />
|
<Compile Include="WebApi.cs" />
|
||||||
<Compile Include="SQLite.cs" />
|
<Compile Include="SQLite.cs" />
|
||||||
<Compile Include="SharedVariable.cs" />
|
<Compile Include="SharedVariable.cs" />
|
||||||
<Compile Include="Util.cs" />
|
<Compile Include="Util.cs" />
|
||||||
<Compile Include="VRForm.cs">
|
|
||||||
<SubType>Form</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="VRForm.Designer.cs">
|
|
||||||
<DependentUpon>VRForm.cs</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="MainForm.cs">
|
|
||||||
<SubType>Form</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="MainForm.Designer.cs">
|
|
||||||
<DependentUpon>MainForm.cs</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="VRCXVR.cs" />
|
<Compile Include="VRCXVR.cs" />
|
||||||
<Compile Include="openvr_api.cs" />
|
<Compile Include="openvr_api.cs" />
|
||||||
<Compile Include="Program.cs" />
|
<Compile Include="Program.cs" />
|
||||||
@@ -122,12 +123,6 @@
|
|||||||
<Compile Include="VRCXStorage.cs" />
|
<Compile Include="VRCXStorage.cs" />
|
||||||
<Compile Include="JsonSerializer.cs" />
|
<Compile Include="JsonSerializer.cs" />
|
||||||
<Compile Include="WinApi.cs" />
|
<Compile Include="WinApi.cs" />
|
||||||
<EmbeddedResource Include="VRForm.resx">
|
|
||||||
<DependentUpon>VRForm.cs</DependentUpon>
|
|
||||||
</EmbeddedResource>
|
|
||||||
<EmbeddedResource Include="MainForm.resx">
|
|
||||||
<DependentUpon>MainForm.cs</DependentUpon>
|
|
||||||
</EmbeddedResource>
|
|
||||||
<EmbeddedResource Include="Properties\Resources.resx">
|
<EmbeddedResource Include="Properties\Resources.resx">
|
||||||
<Generator>ResXFileCodeGenerator</Generator>
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
@@ -172,7 +167,7 @@
|
|||||||
<PackageReference Include="CefSharp.OffScreen">
|
<PackageReference Include="CefSharp.OffScreen">
|
||||||
<Version>86.0.241</Version>
|
<Version>86.0.241</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="CefSharp.WinForms">
|
<PackageReference Include="CefSharp.Wpf">
|
||||||
<Version>86.0.241</Version>
|
<Version>86.0.241</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="DiscordRichPresence">
|
<PackageReference Include="DiscordRichPresence">
|
||||||
@@ -203,5 +198,15 @@
|
|||||||
<Version>1.0.113.7</Version>
|
<Version>1.0.113.7</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Include="App.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
|
<Page Include="MainWindow.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
</Project>
|
</Project>
|
||||||
@@ -67,9 +67,9 @@ speechSynthesis.getVoices();
|
|||||||
|
|
||||||
document.addEventListener('keyup', function (e) {
|
document.addEventListener('keyup', function (e) {
|
||||||
if (e.ctrlKey) {
|
if (e.ctrlKey) {
|
||||||
if (e.shiftKey && e.code === 'KeyI') {
|
if (e.key === 'I') {
|
||||||
AppApi.ShowDevTools();
|
AppApi.ShowDevTools();
|
||||||
} else if (e.code === 'KeyR') {
|
} else if (e.key === 'r') {
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3455,6 +3455,18 @@ speechSynthesis.getVoices();
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$app.methods.minimizeWindow = function () {
|
||||||
|
AppApi.MinimizeMainWindow();
|
||||||
|
};
|
||||||
|
|
||||||
|
$app.methods.toggleMaximizeWindow = function () {
|
||||||
|
AppApi.ToggleMaximizeMainWindow();
|
||||||
|
};
|
||||||
|
|
||||||
|
$app.methods.closeWindow = function () {
|
||||||
|
AppApi.CloseMainWindow();
|
||||||
|
};
|
||||||
|
|
||||||
$app.methods.openExternalLink = function (link) {
|
$app.methods.openExternalLink = function (link) {
|
||||||
this.$confirm(`${link}`, 'Open External Link', {
|
this.$confirm(`${link}`, 'Open External Link', {
|
||||||
confirmButtonText: 'Confirm',
|
confirmButtonText: 'Confirm',
|
||||||
|
|||||||
@@ -138,10 +138,24 @@ a {
|
|||||||
.x-app {
|
.x-app {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.x-title-bar {
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
height: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.x-wrap {
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
height: calc(100% - 30px);
|
||||||
overflow: hidden auto;
|
overflow: hidden auto;
|
||||||
cursor: default;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.x-container {
|
.x-container {
|
||||||
@@ -156,10 +170,10 @@ a {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
// modal 시작이 2000이라서
|
// modal 시작이 2000이라서
|
||||||
z-index: 1999;
|
z-index: 1999;
|
||||||
display: flex;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
|
overflow: hidden scroll;
|
||||||
}
|
}
|
||||||
|
|
||||||
.x-menu-container {
|
.x-menu-container {
|
||||||
|
|||||||
3386
html/src/index.pug
3386
html/src/index.pug
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user