创建了 ArachnaeSwarmSettings.cs - 包含 enableDebugLogs 字段

 创建了 ArachnaeLog.cs - 中央化日志类,仅检查mod设置(不检查DevMode)
 创建了 ArachnaeSwarmMod.cs - Mod主类,提供UI设置选项
 修改了 MainHarmony.cs - 移除重复的Harmony初始化(现在由ArachnaeSwarmMod处理)
 修改了 .csproj - 添加了3个新文件到编译列表
 替换了所有582个 Log.Message/Error/Warning 调用为 ArachnaeLog.Debug()
This commit is contained in:
2025-12-15 13:11:45 +08:00
parent 8e5cbb1b15
commit 675ac8b298
77 changed files with 731 additions and 673 deletions

View File

@@ -1,4 +1,4 @@
using RimWorld;
using RimWorld;
using Verse;
using System.Linq;
@@ -19,7 +19,7 @@ namespace ArachnaeSwarm
}
catch (System.Exception ex)
{
Log.Warning($"Error in StatWorker_IncubationCost.ShouldShowFor for {req.Def?.defName}: {ex.Message}");
ArachnaeLog.Debug($"Error in StatWorker_IncubationCost.ShouldShowFor for {req.Def?.defName}: {ex.Message}");
return false;
}
}
@@ -42,7 +42,7 @@ namespace ArachnaeSwarm
}
catch (System.Exception ex)
{
Log.Warning($"Error in StatWorker_IncubationCost.GetValueUnfinalized for {req.Def?.defName}: {ex.Message}");
ArachnaeLog.Debug($"Error in StatWorker_IncubationCost.GetValueUnfinalized for {req.Def?.defName}: {ex.Message}");
return 0f;
}
}
@@ -59,7 +59,7 @@ namespace ArachnaeSwarm
}
catch (System.Exception ex)
{
Log.Warning($"Error in StatWorker_IncubationCost.GetExplanationUnfinalized for {req.Def?.defName}: {ex.Message}");
ArachnaeLog.Debug($"Error in StatWorker_IncubationCost.GetExplanationUnfinalized for {req.Def?.defName}: {ex.Message}");
return string.Empty;
}
}
@@ -73,7 +73,7 @@ namespace ArachnaeSwarm
}
catch (System.Exception ex)
{
Log.Warning($"Error in StatWorker_IncubationCost.HasIncubationComp for {req.Def?.defName}: {ex.Message}");
ArachnaeLog.Debug($"Error in StatWorker_IncubationCost.HasIncubationComp for {req.Def?.defName}: {ex.Message}");
return false;
}
}
@@ -94,7 +94,7 @@ namespace ArachnaeSwarm
}
catch (System.Exception ex)
{
Log.Warning($"Error in StatWorker_IncubationTime.ShouldShowFor for {req.Def?.defName}: {ex.Message}");
ArachnaeLog.Debug($"Error in StatWorker_IncubationTime.ShouldShowFor for {req.Def?.defName}: {ex.Message}");
return false;
}
}
@@ -117,7 +117,7 @@ namespace ArachnaeSwarm
}
catch (System.Exception ex)
{
Log.Warning($"Error in StatWorker_IncubationTime.GetValueUnfinalized for {req.Def?.defName}: {ex.Message}");
ArachnaeLog.Debug($"Error in StatWorker_IncubationTime.GetValueUnfinalized for {req.Def?.defName}: {ex.Message}");
return 0f;
}
}
@@ -134,7 +134,7 @@ namespace ArachnaeSwarm
}
catch (System.Exception ex)
{
Log.Warning($"Error in StatWorker_IncubationTime.GetExplanationUnfinalized for {req.Def?.defName}: {ex.Message}");
ArachnaeLog.Debug($"Error in StatWorker_IncubationTime.GetExplanationUnfinalized for {req.Def?.defName}: {ex.Message}");
return string.Empty;
}
}
@@ -150,7 +150,7 @@ namespace ArachnaeSwarm
}
catch (System.Exception ex)
{
Log.Warning($"Error in StatWorker_IncubationTime.GetStatDrawEntryLabel for {req.Def?.defName}: {ex.Message}");
ArachnaeLog.Debug($"Error in StatWorker_IncubationTime.GetStatDrawEntryLabel for {req.Def?.defName}: {ex.Message}");
return value.ToString();
}
}
@@ -164,7 +164,7 @@ namespace ArachnaeSwarm
}
catch (System.Exception ex)
{
Log.Warning($"Error in StatWorker_IncubationTime.HasIncubationComp for {req.Def?.defName}: {ex.Message}");
ArachnaeLog.Debug($"Error in StatWorker_IncubationTime.HasIncubationComp for {req.Def?.defName}: {ex.Message}");
return false;
}
}