zc
This commit is contained in:
Binary file not shown.
@@ -31,6 +31,18 @@
|
|||||||
</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>
|
||||||
|
|||||||
@@ -38,4 +38,35 @@ 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}'");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user