暂存2
This commit is contained in:
Binary file not shown.
@@ -7,6 +7,8 @@
|
||||
<!-- General Style -->
|
||||
<labelFont>Small</labelFont>
|
||||
<drawBorders>false</drawBorders>
|
||||
<showDefName>true</showDefName>
|
||||
<showLabel>true</showLabel>
|
||||
<defaultBackgroundImagePath></defaultBackgroundImagePath>
|
||||
|
||||
<!-- Virtual Layout Dimensions -->
|
||||
|
||||
@@ -403,4 +403,13 @@
|
||||
</li>
|
||||
```
|
||||
|
||||
### `Condition_VariableNotEqual`
|
||||
检查一个变量是否 **不等于** 一个特定值。
|
||||
```xml
|
||||
<li Class="WulaFallenEmpire.Condition_VariableNotEqual">
|
||||
<name>QuestStage</name>
|
||||
<value>3</value>
|
||||
</li>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
@@ -112,4 +112,10 @@ namespace WulaFallenEmpire
|
||||
protected override bool Compare(float var1, float var2) => var1 <= var2;
|
||||
protected override string GetOperatorString() => "<=";
|
||||
}
|
||||
|
||||
public class Condition_VariableNotEqual : Condition_CompareVariable
|
||||
{
|
||||
protected override bool Compare(float var1, float var2) => var1 != var2;
|
||||
protected override string GetOperatorString() => "!=";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,14 +95,20 @@ namespace WulaFallenEmpire
|
||||
}
|
||||
|
||||
// 2. Draw Top-left defName and Label
|
||||
Text.Font = GameFont.Tiny;
|
||||
GUI.color = Color.gray;
|
||||
Widgets.Label(new Rect(5, 5, inRect.width - 10, 20f), def.defName);
|
||||
GUI.color = Color.white;
|
||||
if (Config.showDefName)
|
||||
{
|
||||
Text.Font = GameFont.Tiny;
|
||||
GUI.color = Color.gray;
|
||||
Widgets.Label(new Rect(5, 5, inRect.width - 10, 20f), def.defName);
|
||||
GUI.color = Color.white;
|
||||
}
|
||||
|
||||
Text.Font = Config.labelFont;
|
||||
Widgets.Label(new Rect(5, 20f, inRect.width - 10, 30f), def.label);
|
||||
Text.Font = GameFont.Small; // Reset to default
|
||||
if (Config.showLabel)
|
||||
{
|
||||
Text.Font = Config.labelFont;
|
||||
Widgets.Label(new Rect(5, 20f, inRect.width - 10, 30f), def.label);
|
||||
Text.Font = GameFont.Small; // Reset to default
|
||||
}
|
||||
|
||||
// 3. Calculate Layout based on ConfigDef
|
||||
float virtualWidth = Config.lihuiSize.x + Config.textSize.x;
|
||||
|
||||
@@ -293,7 +293,12 @@ namespace WulaFallenEmpire
|
||||
return;
|
||||
}
|
||||
|
||||
float currentValue = EventContext.GetVariable<float>(name, 0f);
|
||||
if (!EventContext.HasVariable(name))
|
||||
{
|
||||
EventContext.SetVariable(name, 0f);
|
||||
}
|
||||
|
||||
float currentValue = EventContext.GetVariable<float>(name);
|
||||
|
||||
switch (operation)
|
||||
{
|
||||
|
||||
@@ -43,6 +43,11 @@ namespace WulaFallenEmpire
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
public static bool HasVariable(string name)
|
||||
{
|
||||
return variables.ContainsKey(name);
|
||||
}
|
||||
|
||||
public static void Clear()
|
||||
{
|
||||
variables.Clear();
|
||||
|
||||
@@ -8,6 +8,8 @@ namespace WulaFallenEmpire
|
||||
// General Style
|
||||
public GameFont labelFont = GameFont.Small;
|
||||
public bool drawBorders = true;
|
||||
public bool showDefName = true;
|
||||
public bool showLabel = true;
|
||||
public string defaultBackgroundImagePath;
|
||||
public Vector2 defaultWindowSize = new Vector2(750f, 500f);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user