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