From a284edd130c30f280dae64de468bde7a709cd7cc Mon Sep 17 00:00:00 2001 From: PopSlime Date: Wed, 1 Nov 2023 01:02:55 +0800 Subject: [PATCH] Add debug logs about environment and fonts. --- Assets/Cryville/Common/Unity/UI/TMPAutoFont.cs | 3 +++ Assets/Cryville/Crtr/Game.cs | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/Assets/Cryville/Common/Unity/UI/TMPAutoFont.cs b/Assets/Cryville/Common/Unity/UI/TMPAutoFont.cs index 883c15c..f22f174 100644 --- a/Assets/Cryville/Common/Unity/UI/TMPAutoFont.cs +++ b/Assets/Cryville/Common/Unity/UI/TMPAutoFont.cs @@ -6,6 +6,7 @@ using TMPro; using UnityEngine; using UnityEngine.TextCore.LowLevel; using UnityEngine.TextCore.Text; +using Logger = Cryville.Common.Logging.Logger; namespace Cryville.Common.Unity.UI { [RequireComponent(typeof(TextMeshProUGUI))] @@ -29,12 +30,14 @@ namespace Cryville.Common.Unity.UI { else if (DefaultShader) ifont.material.shader = DefaultShader; if (_font == null) { _font = ifont; + Logger.Log("main", 1, "UI", "Using main font: {0}", typeface.FullName); if (MaxFallbackCount <= 0) break; } else { if (_font.fallbackFontAssetTable == null) _font.fallbackFontAssetTable = new List(); _font.fallbackFontAssetTable.Add(ifont); + Logger.Log("main", 1, "UI", "Using fallback font #{0}: {1}", _font.fallbackFontAssetTable.Count, typeface.FullName); if (_font.fallbackFontAssetTable.Count >= MaxFallbackCount) break; } } diff --git a/Assets/Cryville/Crtr/Game.cs b/Assets/Cryville/Crtr/Game.cs index fdbc42a..41451d4 100644 --- a/Assets/Cryville/Crtr/Game.cs +++ b/Assets/Cryville/Crtr/Game.cs @@ -16,6 +16,7 @@ using FFmpeg.AutoGen; using Ionic.Zip; using Newtonsoft.Json; using System; +using System.Globalization; using System.IO; using UnityEngine; using Logger = Cryville.Common.Logging.Logger; @@ -53,6 +54,12 @@ namespace Cryville.Crtr { Application.logMessageReceivedThreaded += OnLog; Logger.Create("main", MainLogger); + Logger.Log("main", 1, "Game", "Game Version: {0}", Application.version); + Logger.Log("main", 1, "Game", "Unity Version: {0}", Application.unityVersion); + Logger.Log("main", 1, "Game", "Operating System: {0}", Environment.OSVersion); + Logger.Log("main", 1, "Game", "Platform: Build = {0}, Unity = {1}", PlatformConfig.Name, Application.platform); + Logger.Log("main", 1, "Game", "Culture: {0}, UI = {1}, System = {2}, Unity = {3}", CultureInfo.CurrentCulture, CultureInfo.CurrentUICulture, CultureInfo.InstalledUICulture, Application.systemLanguage); + if (_bcflag) Logger.Log("main", 2, "Game", "Reset all settings"); GameDataPath = Settings.Default.GameDataPath;