add Nasal console to debug menu. Usage: enter Nasal code, press <TAB> to
leave edit field!, press <Return> to execute; as an example try screen.log.write("hello world"), or f16.canopy.open() in the F16, or bo105.doors[3].move(0.3) in the Bo105 etc.
This commit is contained in:
parent
e151ee6a18
commit
fabf21cf8d
2 changed files with 73 additions and 0 deletions
65
gui/dialogs/nasal-console.xml
Normal file
65
gui/dialogs/nasal-console.xml
Normal file
|
@ -0,0 +1,65 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
|
||||||
|
<PropertyList>
|
||||||
|
<x>-20</x>
|
||||||
|
<y>-20</y>
|
||||||
|
<name>nasal-console</name>
|
||||||
|
<layout>vbox</layout>
|
||||||
|
|
||||||
|
<text>
|
||||||
|
<label>Nasal Console</label>
|
||||||
|
</text>
|
||||||
|
|
||||||
|
<hrule><dummy/></hrule>
|
||||||
|
|
||||||
|
<textbox>
|
||||||
|
<halign>fill</halign>
|
||||||
|
<pref-height>120</pref-height>
|
||||||
|
<pref-width>400</pref-width>
|
||||||
|
<slider>20</slider>
|
||||||
|
<editable>true</editable>
|
||||||
|
<property>/sim/gui/dialogs/nasal-console/code</property>
|
||||||
|
</textbox>
|
||||||
|
|
||||||
|
<group>
|
||||||
|
<layout>hbox</layout>
|
||||||
|
<default-padding>8</default-padding>
|
||||||
|
|
||||||
|
<text>
|
||||||
|
<label>TAB to leave edit field</label>
|
||||||
|
<halign>fill</halign>
|
||||||
|
<color>
|
||||||
|
<red>0.5</red>
|
||||||
|
<green>0.5</green>
|
||||||
|
<blue>0.5</blue>
|
||||||
|
</color>
|
||||||
|
</text>
|
||||||
|
|
||||||
|
<group>
|
||||||
|
<layout>hbox</layout>
|
||||||
|
<default-padding>0</default-padding>
|
||||||
|
|
||||||
|
<button>
|
||||||
|
<legend>Close</legend>
|
||||||
|
<key>Esc</key>
|
||||||
|
<equal>true</equal>
|
||||||
|
<binding>
|
||||||
|
<command>dialog-close</command>
|
||||||
|
</binding>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button>
|
||||||
|
<legend>Execute</legend>
|
||||||
|
<default>true</default>
|
||||||
|
<equal>true</equal>
|
||||||
|
<binding>
|
||||||
|
<command>dialog-apply</command>
|
||||||
|
</binding>
|
||||||
|
<binding>
|
||||||
|
<command>nasal</command>
|
||||||
|
<script>compile(getprop("/sim/gui/dialogs/nasal-console/code"))()</script>
|
||||||
|
</binding>
|
||||||
|
</button>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
</PropertyList>
|
|
@ -403,6 +403,14 @@
|
||||||
</binding>
|
</binding>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
<item>
|
||||||
|
<label>Nasal Console</label>
|
||||||
|
<binding>
|
||||||
|
<command>dialog-show</command>
|
||||||
|
<dialog-name>nasal-console</dialog-name>
|
||||||
|
</binding>
|
||||||
|
</item>
|
||||||
|
|
||||||
<item>
|
<item>
|
||||||
<label>Development Keys</label>
|
<label>Development Keys</label>
|
||||||
<binding>
|
<binding>
|
||||||
|
|
Loading…
Reference in a new issue