Files
WulaFallenEmpireRW/Source/WulaFallenEmpire/EventSystem/Effect/Effect_SetTimedFlag.cs
ProjectKoi-Kalo\Kalo 98a0400c78 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()
2025-12-15 13:05:50 +08:00

27 lines
910 B
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// 在 EffectBase.cs 中添加以下类
using Verse;
using RimWorld;
namespace WulaFallenEmpire
{
public class Effect_SetTimedFlag : EffectBase
{
public string flagName;
public int durationTicks; // 持续时间tick负数表示永久
public override void Execute(Window dialog = null)
{
if (string.IsNullOrEmpty(flagName))
{
WulaLog.Debug("[WulaFallenEmpire] Effect_SetTimedFlag has a null or empty flagName.");
return;
}
var eventVarManager = Find.World.GetComponent<EventVariableManager>();
eventVarManager.SetTimedFlag(flagName, durationTicks);
string durationInfo = durationTicks < 0 ? "permanent" : $"{durationTicks} ticks";
WulaLog.Debug($"[EventSystem] Set timed flag '{flagName}' with duration: {durationInfo}");
}
}
}