mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-16 01:40:46 +08:00
@@ -16,6 +16,7 @@ using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using MaaWpfGui.Constants;
|
||||
using MaaWpfGui.Views.UI;
|
||||
using Stylet;
|
||||
using Screen = System.Windows.Forms.Screen;
|
||||
|
||||
@@ -38,8 +39,6 @@ namespace MaaWpfGui.Helper
|
||||
private readonly double Width = double.Parse(ConfigurationHelper.GetValue(ConfigurationKeys.WindowWidth, DefaultDouble.ToString(CultureInfo.InvariantCulture)), CultureInfo.InvariantCulture);
|
||||
private readonly double Height = double.Parse(ConfigurationHelper.GetValue(ConfigurationKeys.WindowHeight, DefaultDouble.ToString(CultureInfo.InvariantCulture)), CultureInfo.InvariantCulture);
|
||||
|
||||
private readonly string RootView = "MaaWpfGui.RootView";
|
||||
|
||||
public void MoveWindowToDisplay(string displayName, Window window)
|
||||
{
|
||||
var screen = Screen.AllScreens.FirstOrDefault(x => x.DeviceName == displayName);
|
||||
@@ -73,7 +72,7 @@ namespace MaaWpfGui.Helper
|
||||
// In Stylet, CreateWindow().WindowStartupLocation is CenterScreen or CenterOwner (if w.WSLoc == Manual && w.Left == NaN && w.Top == NaN && ...)
|
||||
window.WindowStartupLocation = WindowStartupLocation.Manual;
|
||||
|
||||
if (window.ToString() == RootView)
|
||||
if (window is RootView)
|
||||
{
|
||||
MoveWindowToDisplay(ScreenName, window);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,19 @@ namespace MaaWpfGui.Services.Web
|
||||
{
|
||||
private const string UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.99 Safari/537.36 Edg/97.0.1072.76";
|
||||
|
||||
private static string Proxy => ConfigurationHelper.GetValue(ConfigurationKeys.UpdateProxy, string.Empty);
|
||||
private static string Proxy
|
||||
{
|
||||
get
|
||||
{
|
||||
var p = ConfigurationHelper.GetValue(ConfigurationKeys.UpdateProxy, string.Empty);
|
||||
if (string.IsNullOrEmpty(p))
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
return p.Contains("://") ? p : $"http://{p}";
|
||||
}
|
||||
}
|
||||
|
||||
private readonly ILogger _logger = Log.ForContext<HttpService>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user