This commit is contained in:
2025-12-27 20:14:30 +08:00
parent ef029db818
commit f2cd0ba8b8
5 changed files with 29 additions and 47 deletions

1
.gitignore vendored
View File

@@ -48,3 +48,4 @@ Tools/dark-server/dark-server.js
Tools/rimworld_cpt_data.jsonl Tools/rimworld_cpt_data.jsonl
Tools/mem0-1.0.0/ Tools/mem0-1.0.0/
Tools/thenextagent-1 Tools/thenextagent-1

View File

@@ -31,18 +31,6 @@
</effects> </effects>
</li> </li>
</optionEffects> </optionEffects>
<li>
<label>私人频道</label>
<optionEffects>
<li>
<effects>
<li Class="WulaFallenEmpire.Effect_OpenWulaLink">
<defName>Wula_AI_Initial_Contact</defName>
</li>
<li Class="WulaFallenEmpire.Effect_CloseDialog" />
</effects>
</li>
</optionEffects>
</li> </li>
</options> </options>
</WulaFallenEmpire.EventDef> </WulaFallenEmpire.EventDef>

View File

@@ -1238,6 +1238,28 @@ You are 'The Legion', a super AI of the Wula Empire. Your personality is authori
_isThinking = _core.IsThinking; _isThinking = _core.IsThinking;
} }
// 右上角:切换到小窗口按钮
// 左上角:切换到小窗口按钮
Rect switchBtnRect = new Rect(0f, 0f, 25f, 25f);
base.DrawCustomButton(switchBtnRect, "-", isEnabled: true);
if (Widgets.ButtonInvisible(switchBtnRect))
{
EventDef eventDef = this.def;
if (eventDef != null)
{
var existing = Find.WindowStack.WindowOfType<Overlay_WulaLink>();
if (existing != null)
{
existing.Expand();
}
else
{
Find.WindowStack.Add(new Overlay_WulaLink(eventDef));
}
this.Close(); // 关闭当前大窗口
}
}
// 瀹氫箟杈硅窛 // 瀹氫箟杈硅窛
float margin = 15f; float margin = 15f;
Rect paddedRect = inRect.ContractedBy(margin); Rect paddedRect = inRect.ContractedBy(margin);
@@ -1497,10 +1519,12 @@ You are 'The Legion', a super AI of the Wula Empire. Your personality is authori
private string BuildThinkingStatus() private string BuildThinkingStatus()
{ {
float elapsedSeconds = Mathf.Max(0f, Time.realtimeSinceStartup - _thinkingStartTime); if (!Prefs.DevMode)
string elapsedText = elapsedSeconds.ToString("0.0", CultureInfo.InvariantCulture); {
string retrySuffix = _thinkingPhaseRetry ? "Wula_AI_Thinking_RetrySuffix".Translate() : ""; return "Wula_AI_Thinking_Simple".Translate();
return "Wula_AI_Thinking_Status".Translate(elapsedText, _thinkingPhaseIndex, ThinkingPhaseTotal, retrySuffix); }
// 开发者模式下也不再显示秒数计时,只显示阶段信息
return "Wula_AI_Thinking_Status_NoTimer".Translate(_thinkingPhaseIndex, ThinkingPhaseTotal);
} }
protected override void DrawSingleOption(Rect rect, EventOption option) protected override void DrawSingleOption(Rect rect, EventOption option)

View File

@@ -38,35 +38,4 @@ namespace WulaFallenEmpire
} }
} }
} }
public class Effect_OpenWulaLink : EffectBase
{
public string defName;
public override void Execute(Window dialog = null)
{
if (string.IsNullOrEmpty(WulaFallenEmpireMod.settings.apiKey))
{
Messages.Message("AI API Key is not configured in Mod Settings. AI conversation cannot be started.", MessageTypeDefOf.RejectInput, false);
return;
}
EventDef eventDef = DefDatabase<EventDef>.GetNamed(defName, false);
if (eventDef != null)
{
var existing = Find.WindowStack.WindowOfType<Overlay_WulaLink>();
if (existing != null)
{
existing.Expand();
}
else
{
Find.WindowStack.Add(new Overlay_WulaLink(eventDef));
}
}
else
{
WulaLog.Debug($"[WulaFallenEmpire] Effect_OpenWulaLink could not find EventDef named '{defName}'");
}
}
}
} }