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 RimWorld;
using RimWorld;
using Verse;
using UnityEngine;
using Verse.Sound;
@@ -397,7 +397,7 @@ namespace WulaFallenEmpire
}
catch (System.Exception ex)
{
Log.Warning($"Error in TryIntercept: {ex}");
WulaLog.Debug($"Error in TryIntercept: {ex}");
return false;
}
}
@@ -445,7 +445,7 @@ namespace WulaFallenEmpire
}
catch (System.Exception ex)
{
Log.Warning($"Error reflecting projectile: {ex}");
WulaLog.Debug($"Error reflecting projectile: {ex}");
}
return false;
@@ -479,7 +479,7 @@ namespace WulaFallenEmpire
Projectile newProjectile = (Projectile)GenSpawn.Spawn(originalProjectile.def, spawnCell, Holder.Map);
if (newProjectile == null)
{
Log.Warning("Failed to spawn reflected projectile");
WulaLog.Debug("Failed to spawn reflected projectile");
return false;
}
@@ -502,12 +502,12 @@ namespace WulaFallenEmpire
// 使用延迟销毁而不是立即销毁
ReflectedProjectileManager.MarkForDelayedDestroy(originalProjectile);
Log.Message($"反射抛射体: 由 {Holder?.LabelShort} 从 {spawnCell} 向 {targetCell} 发射");
WulaLog.Debug($"反射抛射体: 由 {Holder?.LabelShort} 从 {spawnCell} 向 {targetCell} 发射");
return true;
}
catch (System.Exception ex)
{
Log.Warning($"Error creating reflected projectile: {ex}");
WulaLog.Debug($"Error creating reflected projectile: {ex}");
return false;
}
}
@@ -554,7 +554,7 @@ namespace WulaFallenEmpire
}
catch (System.Exception ex)
{
Log.Warning($"Error copying projectile properties: {ex}");
WulaLog.Debug($"Error copying projectile properties: {ex}");
}
}