224
edits
No edit summary |
mNo edit summary |
||
Line 7: | Line 7: | ||
----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ||
To toggle the Parking brake, use this. Entire code-block shown. Non-repeatable button. (You have to specifically set <repeatable> to true if you want repeatable. It is assumed to be false. | |||
<syntaxhighlight lang="xml"> | <syntaxhighlight lang="xml"> | ||
<button n="1"> | <button n="1"> | ||
Line 18: | Line 17: | ||
</button> | </button> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
This method can be used to toggle any property that is on/off. Use Debug - Browse Internal Properties to find suitable candidates. | |||
Also see getProp, setProp and setAll below. | |||
Remember, it ''toggles'' the property, you can't use it to set the property into a specific state. | |||
----------------------------------------------------------------------------- | |||
----------------------------------------------------------------------------- | |||
To make condition work with mixture on a lever (axis). This is pertinent to turboprops. | |||
Change | |||
<pre style="white-space: pre-wrap; | |||
white-space: -moz-pre-wrap; | |||
white-space: -pre-wrap; | |||
white-space: -o-pre-wrap; | |||
word-wrap: break-word"> | |||
controls.mixtureAxis() | |||
</pre> | |||
to | |||
<pre style="white-space: pre-wrap; | |||
white-space: -moz-pre-wrap; | |||
white-space: -pre-wrap; | |||
white-space: -o-pre-wrap; | |||
word-wrap: break-word"> | |||
controls.mixtureAxis(); | |||
props.setAll("controls/engines/engine", "condition", getprop("controls/engines/engine/mixture")) | |||
</pre> | |||
----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ||
----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ||
To make condition work with mixture on a non-repeatable button. | To make condition work with mixture on a non-repeatable button. | ||
Line 68: | Line 80: | ||
]]> | ]]> | ||
----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ||
----------------------------------------------------------------------------- | |||
This is an alternative method to adjust a property | This is an alternative method to adjust a property | ||
<repeatable>true</repeatable> | <repeatable>true</repeatable> | ||
Line 78: | Line 89: | ||
</binding> | </binding> | ||
This will continuously reduce /sim/current-view/goal-pitch-offset-deg in steps of 2 while the button is held in. | This will continuously reduce /sim/current-view/goal-pitch-offset-deg in steps of 2 while the button is held in. | ||
----------------------------------------------------------------------------- | |||
----------------------------------------------------------------------------- | |||
== Advanced Programming == | == Advanced Programming == |
edits