feat: 白色主题UI + 签到接口修复 + 物理/地形Bug修复 + WPF启动器重构
CI / Go Backend (push) Canceled after 0s

This commit is contained in:
xyou
2026-08-09 21:32:55 +08:00
parent f70b061d1a
commit abd4548dff
20 changed files with 3559 additions and 449 deletions
+38 -14
View File
@@ -1,26 +1,50 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows;
using PCL.Core.App.Essentials;
using PCL.Core.App.IoC;
using MRCC.Launcher;
namespace MRCC.Launcher;
public static class Program
internal static class Program
{
public static bool IsDevMode;
private static readonly object _logLock = new();
private static readonly string LogPath = "redcircuit.log";
[DllImport("kernel32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool AllocConsole();
[STAThread]
public static void Main(string[] args)
{
// 设置 WPF Application 加载委托
ApplicationService.Loading = () =>
IsDevMode = args.Any(a => string.Equals(a, "dev", StringComparison.OrdinalIgnoreCase));
if (IsDevMode)
{
var app = new App();
return app;
};
AllocConsole();
Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = true });
Log("=== RedCircuit 开发模式 ===");
Log($"工作目录: {Environment.CurrentDirectory}");
Log($"EXE目录: {AppContext.BaseDirectory}");
Log("HTML5 世界直接运行于 WebView2 内,控制台用于查看日志。");
}
// 设置主窗口加载委托
MainWindowService.Loading = () => new MainWindow();
// 启动器 UIWebView2 加载 HTML5 世界
var app = new App();
app.Run(new MainWindow());
}
// 启动生命周期
Lifecycle.OnInitialize();
public static void Log(string message)
{
var line = $"[{DateTime.Now:HH:mm:ss.fff}] {message}";
lock (_logLock)
{
if (IsDevMode) Console.WriteLine(line);
Debug.WriteLine(line);
try { File.AppendAllText(LogPath, line + Environment.NewLine, Encoding.UTF8); } catch { }
}
}
}