1
24
1.6/1.6/Defs/EventDefs/EventDef_Wula/Wula_MainEvent.xml
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<Defs>
|
||||
<WulaFallenEmpire.EventDef>
|
||||
<defName>Wula_UI_Legion_1</defName>
|
||||
<label>和P.I.A的通讯</label>
|
||||
<portraitPath>Wula/Events/Portraits/WULA_Legion_1</portraitPath>
|
||||
<characterName>「军团」</characterName>
|
||||
<descriptions>
|
||||
<li>这里是P.I.A,通讯信号良好,等待输入。</li>
|
||||
</descriptions>
|
||||
<options>
|
||||
<li>
|
||||
<label>再见</label>
|
||||
<optionEffects>
|
||||
<li>
|
||||
<effects>
|
||||
<li Class="WulaFallenEmpire.Effect_CloseDialog" />
|
||||
</effects>
|
||||
</li>
|
||||
</optionEffects>
|
||||
</li>
|
||||
</options>
|
||||
</WulaFallenEmpire.EventDef>
|
||||
</Defs>
|
||||
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Defs>
|
||||
<StorytellerDef ParentName="BaseStoryteller">
|
||||
<defName>WULA_Anisia</defName>
|
||||
<label>URa-1138「艾妮西娅」</label>
|
||||
<description>一位诞生于乌拉帝国黄金时代的合成人,是黄金时代禁忌科技的守密者。她在边缘世界一带强制唤醒了大量的旧时代乌拉帝国合成人,无人知晓她真正的目的。\n\n艾妮西娅喜欢大场面,因此她不会安排任何小型袭击,而是安排比其他叙事者所安排的大型袭击更加强大的袭击。不过,在两次袭击间她将安排充足的时间让殖民地进行发展,并让殖民者得到放松以充分消化战利品和修补战线。</description>
|
||||
<portraitLarge>Wula/Storyteller/WULA_Anisia</portraitLarge>
|
||||
<portraitTiny>Wula/Storyteller/WULA_Anisia_TINY</portraitTiny>
|
||||
<defName>WULA_Legion</defName>
|
||||
<label>「军团」</label>
|
||||
<description>一个超级AI,负责控制调度乌拉帝国行星封锁机关P.I.A的舰队,是帝国开发署扩张领地的先锋。当帝国需要对一个星球进行控制和介入时,她会指挥庞大的先锋舰队攻占轨道,以不容置疑的实力向星球宣示帝国的权威。\n\n作为讲述者,她不会为你留下任何保护措施,所有的袭击和恶性事件从落地开始就有可能生成,并且袭击的频率要比常规情况下更高——尽管它们还是有周期规律的。</description>
|
||||
<portraitLarge>Wula/Storyteller/WULA_Legion</portraitLarge>
|
||||
<portraitTiny>Wula/Storyteller/WULA_Legion_TINY</portraitTiny>
|
||||
<listOrder>20</listOrder>
|
||||
<comps>
|
||||
<!-- Intro -->
|
||||
@@ -13,9 +13,9 @@
|
||||
<!-- 袭击生成器 -->
|
||||
<li Class="StorytellerCompProperties_OnOffCycle">
|
||||
<category>ThreatBig</category> <!-- 大型袭击 -->
|
||||
<minDaysPassed>15.0</minDaysPassed> <!-- 最低在15日后开始生成 -->
|
||||
<minDaysPassed>0</minDaysPassed>
|
||||
<onDays>2</onDays> <!-- 每个周期(12天)有多少天允许生成袭击 -->
|
||||
<offDays>9</offDays> <!-- 每个周期(12天)有多少天不生成袭击 -->
|
||||
<offDays>5</offDays> <!-- 每个周期(12天)有多少天不生成袭击 -->
|
||||
<minSpacingDays>0.25</minSpacingDays> <!-- 事件最小间隔 -->
|
||||
<numIncidentsRange>2~3</numIncidentsRange> <!-- 事件点数 -->
|
||||
<!-- <forceRaidEnemyBeforeDaysPassed>20</forceRaidEnemyBeforeDaysPassed> -->
|
||||
@@ -23,11 +23,11 @@
|
||||
<li>Map_RaidBeacon</li>
|
||||
</disallowedTargetTags>
|
||||
</li>
|
||||
<!-- <li Class="StorytellerCompProperties_OnOffCycle">
|
||||
<li Class="StorytellerCompProperties_OnOffCycle">
|
||||
<category>ThreatSmall</category>
|
||||
<minDaysPassed>11.0</minDaysPassed>
|
||||
<onDays>4.6</onDays>
|
||||
<offDays>6.0</offDays>
|
||||
<minDaysPassed>0</minDaysPassed>
|
||||
<onDays>2.6</onDays>
|
||||
<offDays>3.0</offDays>
|
||||
<numIncidentsRange>0.2~1</numIncidentsRange>
|
||||
<acceptPercentFactorPerThreatPointsCurve>
|
||||
<points>
|
||||
@@ -35,7 +35,7 @@
|
||||
<li>(2800, 0)</li>
|
||||
</points>
|
||||
</acceptPercentFactorPerThreatPointsCurve>
|
||||
</li> -->
|
||||
</li>
|
||||
<li Class="StorytellerCompProperties_ThreatsGenerator">
|
||||
<allowedTargetTags>
|
||||
<li>Map_RaidBeacon</li>
|
||||
@@ -55,17 +55,17 @@
|
||||
<allowedTargetTags>
|
||||
<li>Map_PlayerHome</li>
|
||||
</allowedTargetTags>
|
||||
<minDaysPassed>5</minDaysPassed>
|
||||
<minDaysPassed>0</minDaysPassed>
|
||||
<mtbDays>4.8</mtbDays>
|
||||
</li>
|
||||
<li Class="StorytellerCompProperties_ShipChunkDrop"/>
|
||||
<li Class="StorytellerCompProperties_Disease">
|
||||
<category>DiseaseHuman</category>
|
||||
<minDaysPassed>9</minDaysPassed>
|
||||
<minDaysPassed>0</minDaysPassed>
|
||||
</li>
|
||||
<li Class="StorytellerCompProperties_Disease">
|
||||
<category>DiseaseAnimal</category>
|
||||
<minDaysPassed>9</minDaysPassed>
|
||||
<minDaysPassed>0</minDaysPassed>
|
||||
</li>
|
||||
<!-- Ally/neutral interaction -->
|
||||
<li Class="StorytellerCompProperties_FactionInteraction">
|
||||
@@ -170,7 +170,7 @@
|
||||
<allowedTargetTags>
|
||||
<li>World</li>
|
||||
</allowedTargetTags>
|
||||
<minDaysPassed>15</minDaysPassed>
|
||||
<minDaysPassed>0</minDaysPassed>
|
||||
<mtbDays>15</mtbDays>
|
||||
</li>
|
||||
<!-- Orbital trader -->
|
||||
@@ -180,11 +180,6 @@
|
||||
<offDays>8</offDays>
|
||||
<numIncidentsRange>1</numIncidentsRange>
|
||||
</li>
|
||||
<!-- Triggered -->
|
||||
<li Class="StorytellerCompProperties_Triggered">
|
||||
<incident>StrangerInBlackJoin</incident>
|
||||
<delayTicks>180</delayTicks>
|
||||
</li>
|
||||
</comps>
|
||||
</StorytellerDef>
|
||||
</Defs>
|
||||
@@ -831,7 +831,7 @@
|
||||
</comps>
|
||||
</ThingDef>
|
||||
|
||||
<!-- 制造机 -->
|
||||
<!-- 订单机 -->
|
||||
<ThingDef ParentName="BuildingBase">
|
||||
<defName>WULA_WeaponArmor_Productor_Cleanzone</defName>
|
||||
<label>乌拉帝国作业通讯台</label>
|
||||
@@ -988,9 +988,9 @@
|
||||
<overrideExistingFaction>false</overrideExistingFaction>
|
||||
</li>
|
||||
<li Class="WulaFallenEmpire.CompProperties_OpenCustomUI">
|
||||
<uiDefName>Wula_UI_Main_1</uiDefName>
|
||||
<label>联络乌拉帝国</label>
|
||||
<failReason>无法接触通讯站。</failReason>
|
||||
<uiDefName>Wula_UI_Legion_1</uiDefName>
|
||||
<label>联络行星封锁机关</label>
|
||||
<failReason>无法接触。</failReason>
|
||||
</li>
|
||||
</comps>
|
||||
</ThingDef>
|
||||
|
||||
@@ -5,8 +5,9 @@
|
||||
<label>自律核心数据包(射击)</label>
|
||||
<description>包含了射击经验的自律核心数据包,可以被乌拉帝国拥有自律核心的武器吸收以提升其品质。</description>
|
||||
<graphicData>
|
||||
<texPath>Wula/Item/WULA_Dark_Matter_Item</texPath>
|
||||
<texPath>Wula/Item/WULA_ExperienceDataPack</texPath>
|
||||
<graphicClass>Graphic_Single</graphicClass>
|
||||
<drawSize>0.8</drawSize>
|
||||
</graphicData>
|
||||
<tickerType>Never</tickerType>
|
||||
<smeltable>false</smeltable>
|
||||
@@ -35,8 +36,9 @@
|
||||
<label>自律核心数据包(近战)</label>
|
||||
<description>包含了近战经验的自律核心数据包,可以被乌拉帝国拥有自律核心的武器吸收以提升其品质。</description>
|
||||
<graphicData>
|
||||
<texPath>Wula/Item/WULA_Dark_Matter_Item</texPath>
|
||||
<texPath>Wula/Item/WULA_ExperienceDataPack</texPath>
|
||||
<graphicClass>Graphic_Single</graphicClass>
|
||||
<drawSize>0.8</drawSize>
|
||||
</graphicData>
|
||||
<tickerType>Never</tickerType>
|
||||
<smeltable>false</smeltable>
|
||||
@@ -62,7 +64,7 @@
|
||||
</ThingDef>
|
||||
|
||||
<!-- 近战 -->
|
||||
<ThingDef Name="WULA_ExperienceCore_Weapon_Melee" ParentName="BaseMeleeWeapon_Blunt_Quality">
|
||||
<ThingDef Name="WULA_ExperienceCore_Weapon_Melee" ParentName="BaseMeleeWeapon_Blunt_Quality" Abstract="True">
|
||||
<comps>
|
||||
<!-- 经验核心组件 -->
|
||||
<li Class="WulaFallenEmpire.CompProperties_ExperienceCore">
|
||||
@@ -428,7 +430,7 @@
|
||||
</ThingDef>
|
||||
|
||||
<!-- 射弹武器 -->
|
||||
<ThingDef Name="WULA_ExperienceCore_Weapon_Ranged" ParentName="BaseHumanMakeableGun">
|
||||
<ThingDef Name="WULA_ExperienceCore_Weapon_Ranged" ParentName="BaseHumanMakeableGun" Abstract="True">
|
||||
<comps>
|
||||
<!-- 经验核心组件 -->
|
||||
<li Class="WulaFallenEmpire.CompProperties_ExperienceCore">
|
||||
|
||||
@@ -6,22 +6,22 @@
|
||||
|
||||
<!-- General Style -->
|
||||
<labelFont>Small</labelFont>
|
||||
<drawBorders>false</drawBorders>
|
||||
<drawBorders>true</drawBorders>
|
||||
<showDefName>false</showDefName>
|
||||
<showLabel>true</showLabel>
|
||||
<defaultBackgroundImagePath></defaultBackgroundImagePath>
|
||||
|
||||
<!-- Virtual Layout Dimensions -->
|
||||
<lihuiSize>(500, 800)</lihuiSize>
|
||||
<nameSize>(650, 130)</nameSize>
|
||||
<textSize>(650, 350)</textSize>
|
||||
<lihuiSize>(1093, 687)</lihuiSize>
|
||||
<nameSize>(593, 530)</nameSize>
|
||||
<textSize>(593, 330)</textSize>
|
||||
<optionsWidth>750</optionsWidth>
|
||||
|
||||
<!-- Virtual Layout Offsets -->
|
||||
<textNameOffset>0</textNameOffset>
|
||||
<optionsTextOffset>0</optionsTextOffset>
|
||||
|
||||
<defaultWindowSize>(750, 600)</defaultWindowSize>
|
||||
<defaultWindowSize>(693, 887)</defaultWindowSize>
|
||||
|
||||
<!-- New Layout Dimensions -->
|
||||
<newLayoutNameSize>(200, 50)</newLayoutNameSize>
|
||||
|
||||
|
Before Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 57 KiB |
BIN
Content/Textures/Wula/Building/WULA_Cube_Productor_east.png
Normal file
|
After Width: | Height: | Size: 200 KiB |
BIN
Content/Textures/Wula/Building/WULA_Cube_Productor_north.png
Normal file
|
After Width: | Height: | Size: 200 KiB |
BIN
Content/Textures/Wula/Building/WULA_Cube_Productor_south.png
Normal file
|
After Width: | Height: | Size: 200 KiB |
BIN
Content/Textures/Wula/Events/Portraits/WULA_Legion_1.png
Normal file
|
After Width: | Height: | Size: 3.3 MiB |
BIN
Content/Textures/Wula/Item/WULA_ExperienceDataPack.png
Normal file
|
After Width: | Height: | Size: 99 KiB |
BIN
Content/Textures/Wula/Storyteller/WULA_Legion.png
Normal file
|
After Width: | Height: | Size: 1.8 MiB |
BIN
Content/Textures/Wula/Storyteller/WULA_Legion_TINY.png
Normal file
|
After Width: | Height: | Size: 340 KiB |
@@ -103,11 +103,13 @@ namespace WulaFallenEmpire
|
||||
|
||||
public override void DoWindowContents(Rect inRect)
|
||||
{
|
||||
// 绘制背景
|
||||
if (background != null)
|
||||
{
|
||||
GUI.DrawTexture(inRect, background, ScaleMode.ScaleToFit);
|
||||
}
|
||||
|
||||
// 调试信息(def名称)
|
||||
if (Config.showDefName)
|
||||
{
|
||||
Text.Font = GameFont.Tiny;
|
||||
@@ -116,34 +118,31 @@ namespace WulaFallenEmpire
|
||||
GUI.color = Color.white;
|
||||
}
|
||||
|
||||
if (Config.showLabel)
|
||||
{
|
||||
Text.Font = Config.labelFont;
|
||||
Widgets.Label(new Rect(5, 20f, inRect.width - 10, 30f), def.label);
|
||||
Text.Font = GameFont.Small;
|
||||
}
|
||||
// 使用新的布局参数
|
||||
float scale = CalculateScale(inRect);
|
||||
|
||||
// 使用新的布局尺寸
|
||||
float scaledLihuiWidth = Config.newLayoutLihuiSize.x * scale;
|
||||
float scaledLihuiHeight = Config.newLayoutLihuiSize.y * scale;
|
||||
float scaledTextWidth = Config.newLayoutTextSize.x * scale;
|
||||
float scaledTextHeight = Config.newLayoutTextSize.y * scale;
|
||||
float scaledOptionsWidth = Config.newLayoutOptionsWidth * scale;
|
||||
|
||||
float virtualWidth = Config.lihuiSize.x + Config.textSize.x;
|
||||
float virtualHeight = Config.lihuiSize.y;
|
||||
// 计算各元素高度
|
||||
float labelHeight = 30f * scale;
|
||||
float characterNameHeight = 25f * scale;
|
||||
float descriptionHeight = scaledTextHeight;
|
||||
float optionsHeight = CalculateOptionsHeight(def.options, scaledOptionsWidth, scale);
|
||||
|
||||
float scaleX = inRect.width / virtualWidth;
|
||||
float scaleY = inRect.height / virtualHeight;
|
||||
float scale = Mathf.Min(scaleX, scaleY) * 0.95f;
|
||||
// 使用新的间距参数
|
||||
float topMargin = Config.newLayoutPadding * scale;
|
||||
float elementSpacing = Config.newLayoutTextNameOffset * scale;
|
||||
float textOptionsSpacing = Config.newLayoutOptionsTextOffset * scale;
|
||||
|
||||
float scaledLihuiWidth = Config.lihuiSize.x * scale;
|
||||
float scaledLihuiHeight = Config.lihuiSize.y * scale;
|
||||
float scaledNameWidth = Config.nameSize.x * scale;
|
||||
float scaledNameHeight = Config.nameSize.y * scale;
|
||||
float scaledTextWidth = Config.textSize.x * scale;
|
||||
float scaledTextHeight = Config.textSize.y * scale;
|
||||
float scaledOptionsWidth = Config.optionsWidth * scale;
|
||||
float currentY = topMargin;
|
||||
|
||||
float totalContentWidth = scaledLihuiWidth + scaledTextWidth;
|
||||
float totalContentHeight = scaledLihuiHeight;
|
||||
float startX = (inRect.width - totalContentWidth) / 2;
|
||||
float startY = (inRect.height - totalContentHeight) / 2;
|
||||
|
||||
Rect lihuiRect = new Rect(startX, startY, scaledLihuiWidth, scaledLihuiHeight);
|
||||
// 1. 立绘(水平居中,顶着顶部)
|
||||
Rect lihuiRect = new Rect((inRect.width - scaledLihuiWidth) / 2, currentY, scaledLihuiWidth, scaledLihuiHeight);
|
||||
if (portrait != null)
|
||||
{
|
||||
GUI.DrawTexture(lihuiRect, portrait, ScaleMode.ScaleToFit);
|
||||
@@ -152,59 +151,146 @@ namespace WulaFallenEmpire
|
||||
{
|
||||
Widgets.DrawBox(lihuiRect);
|
||||
}
|
||||
currentY += scaledLihuiHeight + elementSpacing;
|
||||
|
||||
Rect nameRect = new Rect(lihuiRect.xMax, lihuiRect.y, scaledNameWidth, scaledNameHeight);
|
||||
if (Config.drawBorders)
|
||||
// 2. Label(水平居中)
|
||||
if (Config.showLabel)
|
||||
{
|
||||
Widgets.DrawBox(nameRect);
|
||||
Rect labelRect = new Rect(0, currentY, inRect.width, labelHeight);
|
||||
Text.Anchor = TextAnchor.MiddleCenter;
|
||||
Text.Font = Config.labelFont;
|
||||
Widgets.Label(labelRect, def.label);
|
||||
Text.Font = GameFont.Small;
|
||||
Text.Anchor = TextAnchor.UpperLeft;
|
||||
|
||||
if (Config.drawBorders)
|
||||
{
|
||||
Widgets.DrawBox(labelRect);
|
||||
}
|
||||
currentY += labelHeight + elementSpacing;
|
||||
}
|
||||
|
||||
// 3. CharacterName(水平居中)
|
||||
Rect nameRect = new Rect(0, currentY, inRect.width, characterNameHeight);
|
||||
Text.Anchor = TextAnchor.MiddleCenter;
|
||||
Text.Font = GameFont.Medium;
|
||||
Widgets.Label(nameRect, def.characterName);
|
||||
Text.Font = GameFont.Small;
|
||||
Text.Anchor = TextAnchor.UpperLeft;
|
||||
|
||||
if (Config.drawBorders)
|
||||
{
|
||||
Widgets.DrawBox(nameRect);
|
||||
}
|
||||
currentY += characterNameHeight + elementSpacing;
|
||||
|
||||
Rect textRect = new Rect(nameRect.x, nameRect.yMax + Config.textNameOffset * scale, scaledTextWidth, scaledTextHeight);
|
||||
// 4. Descriptions(水平居中)
|
||||
Rect textRect = new Rect((inRect.width - scaledTextWidth) / 2, currentY, scaledTextWidth, descriptionHeight);
|
||||
if (Config.drawBorders)
|
||||
{
|
||||
Widgets.DrawBox(textRect);
|
||||
}
|
||||
Rect textInnerRect = textRect.ContractedBy(10f * scale);
|
||||
Widgets.Label(textInnerRect, selectedDescription);
|
||||
|
||||
Rect optionRect = new Rect(nameRect.x, textRect.yMax + Config.optionsTextOffset * scale, scaledOptionsWidth, lihuiRect.height - nameRect.height - textRect.height - (Config.textNameOffset + Config.optionsTextOffset) * scale);
|
||||
|
||||
Listing_Standard listing = new Listing_Standard();
|
||||
listing.Begin(optionRect.ContractedBy(10f * scale));
|
||||
if (def.options != null)
|
||||
{
|
||||
foreach (var option in def.options)
|
||||
{
|
||||
string reason;
|
||||
bool conditionsMet = AreConditionsMet(option.conditions, out reason);
|
||||
// 增加内边距
|
||||
float textInnerPadding = 15f * scale;
|
||||
Rect textInnerRect = textRect.ContractedBy(textInnerPadding);
|
||||
Widgets.LabelScrollable(textInnerRect, selectedDescription, ref scrollPosition);
|
||||
|
||||
currentY += descriptionHeight + textOptionsSpacing;
|
||||
|
||||
if (conditionsMet)
|
||||
// 5. Options(水平居中)
|
||||
Rect optionRect = new Rect((inRect.width - scaledOptionsWidth) / 2, currentY, scaledOptionsWidth, optionsHeight);
|
||||
if (Config.drawBorders)
|
||||
{
|
||||
Widgets.DrawBox(optionRect);
|
||||
}
|
||||
|
||||
// 增加内边距
|
||||
float optionsInnerPadding = 10f * scale;
|
||||
DrawOptions(optionRect.ContractedBy(optionsInnerPadding), def.options, scale);
|
||||
}
|
||||
|
||||
// 计算缩放比例 - 使用新的布局参数
|
||||
private float CalculateScale(Rect inRect)
|
||||
{
|
||||
float virtualWidth = Mathf.Max(
|
||||
Config.newLayoutLihuiSize.x,
|
||||
Config.newLayoutTextSize.x,
|
||||
Config.newLayoutOptionsWidth
|
||||
);
|
||||
float scaleX = inRect.width / virtualWidth;
|
||||
return Mathf.Min(scaleX, 1.0f) * 0.85f; // 稍微减少缩放以留出更多边距
|
||||
}
|
||||
|
||||
// 计算选项区域高度
|
||||
private float CalculateOptionsHeight(List<EventOption> options, float optionsWidth, float scale)
|
||||
{
|
||||
if (options == null || options.Count == 0)
|
||||
return 0f;
|
||||
|
||||
float totalHeight = 0f;
|
||||
var eventVarManager = Find.World.GetComponent<EventVariableManager>();
|
||||
|
||||
foreach (var option in options)
|
||||
{
|
||||
string reason;
|
||||
bool conditionsMet = AreConditionsMet(option.conditions, out reason);
|
||||
|
||||
if (!conditionsMet && option.hideWhenDisabled)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// 增加选项高度和间距
|
||||
totalHeight += 35f * scale; // 每个选项高度
|
||||
totalHeight += 8f * scale; // 选项间距
|
||||
}
|
||||
|
||||
return totalHeight;
|
||||
}
|
||||
|
||||
// 绘制选项
|
||||
private void DrawOptions(Rect rect, List<EventOption> options, float scale)
|
||||
{
|
||||
if (options == null || options.Count == 0)
|
||||
return;
|
||||
|
||||
Listing_Standard listing = new Listing_Standard();
|
||||
listing.Begin(rect);
|
||||
|
||||
// 增加选项之间的间距
|
||||
listing.verticalSpacing = 8f * scale;
|
||||
|
||||
foreach (var option in options)
|
||||
{
|
||||
string reason;
|
||||
bool conditionsMet = AreConditionsMet(option.conditions, out reason);
|
||||
|
||||
if (conditionsMet)
|
||||
{
|
||||
if (listing.ButtonText(option.label))
|
||||
{
|
||||
if (listing.ButtonText(option.label))
|
||||
{
|
||||
HandleAction(option.optionEffects);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (option.hideWhenDisabled)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
Rect rect = listing.GetRect(30f);
|
||||
Widgets.ButtonText(rect, option.label, false, true, false);
|
||||
TooltipHandler.TipRegion(rect, GetDisabledReason(option, reason));
|
||||
HandleAction(option.optionEffects);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (option.hideWhenDisabled)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
Rect buttonRect = listing.GetRect(35f * scale); // 增加按钮高度
|
||||
Widgets.ButtonText(buttonRect, option.label, false, true, false);
|
||||
TooltipHandler.TipRegion(buttonRect, GetDisabledReason(option, reason));
|
||||
}
|
||||
}
|
||||
|
||||
listing.End();
|
||||
}
|
||||
|
||||
// 滚动位置用于描述文本
|
||||
private Vector2 scrollPosition = Vector2.zero;
|
||||
|
||||
private void HandleAction(List<ConditionalEffects> conditionalEffects)
|
||||
{
|
||||
if (conditionalEffects.NullOrEmpty())
|
||||
@@ -258,16 +344,14 @@ namespace WulaFallenEmpire
|
||||
private string FormatDescription(string description)
|
||||
{
|
||||
var eventVarManager = Find.World.GetComponent<EventVariableManager>();
|
||||
// Use regex to find all placeholders like {variableName}
|
||||
return Regex.Replace(description, @"\{(.+?)\}", match =>
|
||||
{
|
||||
string varName = match.Groups[1].Value;
|
||||
if (eventVarManager.HasVariable(varName))
|
||||
{
|
||||
// Important: GetVariable<object> to get any type
|
||||
return eventVarManager.GetVariable<object>(varName)?.ToString() ?? "";
|
||||
}
|
||||
return match.Value; // Keep placeholder if variable not found
|
||||
return match.Value;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
BIN
美术与文本源文件/Wula/Building/WULA_Cube_Productor.sai2
Normal file
BIN
美术与文本源文件/Wula/Item/WULA_ExperienceDataPack.sai2
Normal file
BIN
美术与文本源文件/Wula/UI/EventUI/新建画布2.png
Normal file
|
After Width: | Height: | Size: 2.2 MiB |
BIN
美术与文本源文件/Wula/UI/EventUI/新建画布22.png
Normal file
|
After Width: | Height: | Size: 2.0 MiB |