WulaFallenEmpireSettings.cs - 添加了 public bool enableDebugLogs = false; 字段和保存配置

 WulaLog.cs - 修改了DebugEnabled属性,仅检查enableDebugLogs设置(不检查DevMode)
 WulaFallenEmpireMod.cs - 在DoSettingsWindowContents中添加了UI复选框,显示"Enable Debug Logs"选项
 替换了所有848个Log.Message/Error/Warning调用为WulaLog.Debug()
This commit is contained in:
2025-12-15 13:05:50 +08:00
parent 9bdcd8e308
commit 98a0400c78
134 changed files with 1000 additions and 1019 deletions

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using RimWorld;
@@ -157,7 +157,7 @@ namespace WulaFallenEmpire
warmupTicksLeft--;
if (warmupTicksLeft % 60 == 0)
{
Log.Message($"[WULA] Teleport warmup: {warmupTicksLeft} ticks left.");
WulaLog.Debug($"[WULA] Teleport warmup: {warmupTicksLeft} ticks left.");
foreach (var member in GroupMembers)
{
Props.warmupEffecter?.Spawn(member.parent, member.parent.Map).Cleanup();
@@ -166,7 +166,7 @@ namespace WulaFallenEmpire
if (warmupTicksLeft <= 0)
{
Log.Message("[WULA] Warmup finished. Attempting teleport...");
WulaLog.Debug("[WULA] Warmup finished. Attempting teleport...");
TryTeleport();
isWarmingUp = false;
}
@@ -335,7 +335,7 @@ namespace WulaFallenEmpire
private void TryTeleport()
{
Log.Message($"[WULA] TryTeleport called. Target valid: {target.IsValid}, Tile: {target.Tile}, Cell: {target.Cell}");
WulaLog.Debug($"[WULA] TryTeleport called. Target valid: {target.IsValid}, Tile: {target.Tile}, Cell: {target.Cell}");
if (!target.IsValid)
{
@@ -349,7 +349,7 @@ namespace WulaFallenEmpire
if (targetMap == null)
{
Log.Message($"[WULA] Target map is null. Generating map for tile {target.Tile}...");
WulaLog.Debug($"[WULA] Target map is null. Generating map for tile {target.Tile}...");
targetMap = GetOrGenerateTargetMap(target.Tile);
if (targetMap == null)
{
@@ -360,7 +360,7 @@ namespace WulaFallenEmpire
targetCell = targetMap.Center;
}
Log.Message($"[WULA] Teleporting to map {targetMap.Index}, cell {targetCell}");
WulaLog.Debug($"[WULA] Teleporting to map {targetMap.Index}, cell {targetCell}");
TeleportContents(targetMap, targetCell);
}
@@ -402,7 +402,7 @@ namespace WulaFallenEmpire
List<ThingToTeleport> thingsToTeleport = new List<ThingToTeleport>();
List<Pair<IntVec3, TerrainDef>> terrainToTeleport = new List<Pair<IntVec3, TerrainDef>>();
Log.Message($"[WULA] Collecting data from {cells.Count} cells in group");
WulaLog.Debug($"[WULA] Collecting data from {cells.Count} cells in group");
// 1. 收集数据
HashSet<Thing> collectedThings = new HashSet<Thing>();