-
Notifications
You must be signed in to change notification settings - Fork 27
/
propIndicatorCircular.xml
302 lines (291 loc) · 10.6 KB
/
propIndicatorCircular.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
<PropConfig>
<!--
This file is a prop configuration template for the Prop Config utility
described on the MAS wiki at https://github.com/MOARdV/AvionicsSystems/wiki/Prop-Config
The tool and this XML file are used to quickly generate multiple props
without the tedious effort of copying config files and making small edits
while hoping you didn't overlook something.
Copyright (c) 2018 MOARdV
This file is licensed by MOARdV under the Creative Commons Attribution-Share Alike
4.0 International license (CC BY-SA) https://creativecommons.org/licenses/by-sa/4.0/
-->
<!--
IndicatorCircular is a square prop that has a circular gauge around 3/4 of the prop that provides
a visual indication of the value.
It consists of two text items (the caption, id 0, and the readout, id 1). The caption is positioned
above the readout. The value proper is sized to display up to 6 digits. Default colors for the
caption and value are based on the IndicatorCircular_THROTTLE ASET prop (white caption, yellow readout).
The caption is left-justified, the value is right-justified.
The Power Off feature is set up as always-on (unless there's a power disruption). It could be changed
to have an on-off switch behavior by changing the variable field in TRANSLATION.
The 'folder' attribute identifies the directory where the config files will be written. This folder
is relative to the current working directory.
-->
<IndicatorCircular folder="IndicatorCircular">
<!--
The 'style' element provides a template for a common look-and-feel for a prop. For a prop
like the IndicatorCircular, it makes it easy to create many props with minimal cut-and-paste.
The 'name' attribute is required - while it's not terribly important for this prop, since
there really aren't a lot of options for configuring it, it is *very* important when you're
working with the modular props (rotary switches, push buttons, and toggle switches).
A style as a scope of the element it's in - that is, if there were other prop types listed
in this config file, they would not be able to use this 'Standard Circular Indicator'.
-->
<style name="Standard Circular Indicator">
<MODEL>
<model>ASET/ASET_Props/Instruments/IndicatorCircular/IndicatorCircular</model>
</MODEL>
<ANIMATION>
<name>Gauge Animation</name>
<animation>IndicatorCircularAnim</animation>
</ANIMATION>
<TRANSLATION>
<name>Power Off Transformation</name>
<transform>PowerOFFloc</transform>
<startTranslation>0, -0.003, 0</startTranslation>
<endTranslation>0, 0, 0</endTranslation>
<variable>fc.Conditioned(1)</variable>
</TRANSLATION>
<TEXT_LABEL id="0">
<name>Readout Caption</name>
<transform>ResourceNameObj</transform>
<fontSize>3.5</fontSize>
<font>Liberation Sans</font>
<alignment>Left</alignment>
<anchor>LowerLeft</anchor>
<emissive>always</emissive>
<transformOffset>0, -0.008</transformOffset>
<passiveColor>255, 255, 255, 255</passiveColor>
</TEXT_LABEL>
<TEXT_LABEL id="1">
<name>Readout Value</name>
<transform>ResourceAmountObj</transform>
<fontSize>5.4</fontSize>
<font>Liberation Sans</font>
<style>Bold</style>
<alignment>Right</alignment>
<anchor>UpperRight</anchor>
<emissive>always</emissive>
<transformOffset>0.030, 0</transformOffset>
<passiveColor>255, 246, 0, 255</passiveColor>
</TEXT_LABEL>
</style>
<!--
Individual props are created like this:
-->
<prop>
<!--
The 'name' element is the name of the prop as it will appear in Unity. It is also the
name of the file that is created (with '.cfg' automatically added to the end). Spaces
should not be used in the name.
-->
<name>MAS_IndicatorCircular_Throttle</name>
<!--
The style that should be used as a template is listed here. Only a 'style' from the
same top-level element can be used.
-->
<style>Standard Circular Indicator</style>
<!--
Overrides for the template are listed here. Typically, the override is going to be something
that makes the prop unique from other props of the same style. For instance, the 'variable' for
the animation player below.
If a particular element is unsed only once in a prop, you do not need to include an 'id' attribute.
For the TEXT_LABELs below, since there are two of them defined in the style, we must include the
ids - otherwise, both would modify id=0.
-->
<ANIMATION>
<!--
The data source that controls the animation. This variable must fall in the
range of 0 to 1 (negative values won't show anything; values larger than 1 will
fill the gauge). For variables that do not report 0-1 values, there are several
ways to convert the value to 0-1. For instance, to track progress through the
atmosphere, use fc.SafeDivide(fc.Altitude(), fc.AtmosphereTop()) (use safe divide,
in case the current world has no atmo. You can also use fc.Remap(), or simple maths.
-->
<variable>fc.GetThrottle()</variable>
</ANIMATION>
<!--
There is no TRANSLATION node in the prop, since we do not need to override the default behaviors.
-->
<TEXT_LABEL id="0">
<text>Throttle:</text>
</TEXT_LABEL>
<TEXT_LABEL id="1">
<!--
Data readout. Note we use $#$ instead of $&$, since '&' is a reserved character in
XML. We could also use $&$. Similarly, we use standard C# string format tokens
{ and } in the text, instead of <= and =>, since < and > are also reserved.
-->
<text>{0,6:P0} $#$ fc.GetThrottle()</text>
</TEXT_LABEL>
</prop>
<!-- And an example without all of the explanations, to show how compact a prop definition could be -->
<prop>
<name>MAS_IndicatorCircular_Charge</name>
<style>Standard Circular Indicator</style>
<ANIMATION>
<variable>fc.PowerPercent()</variable>
</ANIMATION>
<TEXT_LABEL id="0">
<text>Power:</text>
</TEXT_LABEL>
<TEXT_LABEL id="1">
<text>{0,6:0} $#$ fc.PowerCurrent()</text>
</TEXT_LABEL>
</prop>
<prop>
<name>MAS_IndicatorCircular_ChargeRate</name>
<style>Standard Circular Indicator</style>
<ANIMATION>
<variable>-fc.PowerDelta() * 0.04</variable>
</ANIMATION>
<TEXT_LABEL id="0">
<text>Chg Rate:</text>
</TEXT_LABEL>
<TEXT_LABEL id="1">
<text>{0,6:0.0} $#$ fc.Clamp(-fc.PowerDelta(), -999.9, 999.9)</text>
</TEXT_LABEL>
</prop>
<prop>
<name>MAS_IndicatorCircular_CommNet_Strength</name>
<style>Standard Circular Indicator</style>
<ANIMATION>
<variable>fc.CommNetSignalStrength()</variable>
</ANIMATION>
<TEXT_LABEL id="0">
<text>Signal$$$Strength:</text>
</TEXT_LABEL>
<TEXT_LABEL id="1">
<text>{0,6:P0} $#$ fc.CommNetSignalStrength()</text>
</TEXT_LABEL>
</prop>
<prop>
<name>MAS_IndicatorCircular_GForce</name>
<style>Standard Circular Indicator</style>
<ANIMATION>
<variable>0.25 * (4 - fc.GForce()) + 0.01</variable>
</ANIMATION>
<TEXT_LABEL id="0">
<text>G-Force:</text>
</TEXT_LABEL>
<TEXT_LABEL id="1">
<text>{0,6:0.00} $#$ fc.GForce()</text>
</TEXT_LABEL>
</prop>
<prop>
<name>MAS_IndicatorCircular_Propellant</name>
<style>Standard Circular Indicator</style>
<ANIMATION>
<variable>fc.PropellantStagePercent()</variable>
</ANIMATION>
<TEXT_LABEL id="0">
<text>Propellant:</text>
</TEXT_LABEL>
<TEXT_LABEL id="1">
<text>{0,6:0} $#$ fc.PropellantStageCurrent()</text>
</TEXT_LABEL>
</prop>
<prop>
<name>MAS_IndicatorCircular_Rcs</name>
<style>Standard Circular Indicator</style>
<ANIMATION>
<variable>fc.RcsPercent()</variable>
</ANIMATION>
<TEXT_LABEL id="0">
<text>RCS Fuel:</text>
</TEXT_LABEL>
<TEXT_LABEL id="1">
<text>{0,6:0} $#$ fc.RcsCurrent()</text>
</TEXT_LABEL>
</prop>
<prop>
<name>MAS_IndicatorCircular_StageDeltaV</name>
<style>Standard Circular Indicator</style>
<ANIMATION>
<variable>fc.SafeDivide(fc.DeltaVStage(), fc.DeltaVStageMax())</variable>
</ANIMATION>
<TEXT_LABEL id="0">
<text>Stage$$$ΔV, m/s:</text>
</TEXT_LABEL>
<TEXT_LABEL id="1">
<text>{0,6:0.0} $#$ fc.DeltaVStage()</text>
</TEXT_LABEL>
</prop>
<prop>
<name>MAS_IndicatorCircular_Thrust</name>
<style>Standard Circular Indicator</style>
<ANIMATION>
<variable>fc.CurrentRatedThrust()</variable>
</ANIMATION>
<TEXT_LABEL id="0">
<text>Thrust, kN:</text>
</TEXT_LABEL>
<TEXT_LABEL id="1">
<text>{0,6:0.0} $#$ fc.CurrentThrustkN()</text>
</TEXT_LABEL>
</prop>
<!--
This particular prop has a second way to operate it. Instead of using the animation, it can use
texture UV shifting and color changes to control the appearance.
A 'style' may be placed anywhere in the parent element - before the props, mixed with the props,
whatever.
-->
<style name="Advanced Circular Indicator">
<MODEL>
<model>ASET/ASET_Props/Instruments/IndicatorCircular/IndicatorCircular</model>
</MODEL>
<!--
Keep in mind that using the scaling here causes the gauge to 'grow' counter-clockwise,
the opposite direction of the default pre-colored scales.
-->
<TEXTURE_SHIFT>
<name>Scale animation</name>
<transform>CircularIndScale</transform>
<startUV>0, 0</startUV>
<endUV>-0.5, 0</endUV>
<blend>true</blend>
</TEXTURE_SHIFT>
<!-- Invert the U scale of the circular border, since the gauge fills in reverse. -->
<TEXTURE_SCALE>
<name>Scale border</name>
<transform>CircularIndScaleBorder</transform>
<startUV>-1, 1</startUV>
</TEXTURE_SCALE>
<COLOR_SHIFT>
<name>Scale color</name>
<transform>CircularIndScale</transform>
<colorName>_Color</colorName>
</COLOR_SHIFT>
<TRANSLATION>
<name>Power Off Transformation</name>
<transform>PowerOFFloc</transform>
<startTranslation>0, -0.003, 0</startTranslation>
<endTranslation>0, 0, 0</endTranslation>
<variable>fc.Conditioned(1)</variable>
</TRANSLATION>
<TEXT_LABEL id="0">
<name>Readout Caption</name>
<transform>ResourceNameObj</transform>
<fontSize>3.5</fontSize>
<font>Liberation Sans</font>
<alignment>Left</alignment>
<anchor>LowerLeft</anchor>
<emissive>always</emissive>
<transformOffset>0, -0.008</transformOffset>
<passiveColor>255, 255, 255, 255</passiveColor>
</TEXT_LABEL>
<TEXT_LABEL id="1">
<name>Readout Value</name>
<transform>ResourceAmountObj</transform>
<fontSize>5.4</fontSize>
<font>Liberation Sans</font>
<style>Bold</style>
<alignment>Right</alignment>
<anchor>UpperRight</anchor>
<emissive>always</emissive>
<transformOffset>0.030, 0</transformOffset>
<passiveColor>255, 246, 0, 255</passiveColor>
</TEXT_LABEL>
</style>
</IndicatorCircular>
</PropConfig>