Skip to content

Commit

Permalink
Fix bugs in GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
sidi762 committed Aug 22, 2024
1 parent f462d6d commit 2ae58cf
Show file tree
Hide file tree
Showing 3 changed files with 186 additions and 79 deletions.
3 changes: 3 additions & 0 deletions Nasal/node_setup.nas
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ vInfo.systems.speedometer = vInfo.systems.getNode("speedometer", 1);
vInfo.systems.speedometer.type = vInfo.systems.speedometer.getNode("type", 1);
vInfo.systems.batteryGauge = vInfo.systems.getNode("battery-gauge", 1);
vInfo.systems.batteryGauge.type = vInfo.systems.batteryGauge.getNode("type", 1);
vInfo.systems.driftSoundEnabled = vInfo.systems.getNode("drifting-sound", 1);

#//Electrical
vInfo.systems.electrical = props.getNode("/systems/electrical/", 1);
Expand Down Expand Up @@ -127,6 +128,8 @@ vInfo.systems.safety.isAebOn.setValue("0");
vInfo.systems.isAutoholdEnabled.setValue("0");
vInfo.systems.isAutoholdWorking.setValue("0");

vInfo.systems.driftSoundEnabled.setValue(0);

#//Doors
vInfo.controls.doors.FL.setValue(0);
vInfo.controls.doors.FR.setValue(0);
Expand Down
16 changes: 16 additions & 0 deletions Sounds/followme-sound.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@
<property>/velocities/groundspeed-kt</property>
<value>5</value>
</greater-than>
<equals>
<property>systems/drifting-sound</property>
<value>1</value>
</equals>
</and>
</condition>
<position>
Expand Down Expand Up @@ -148,6 +152,10 @@
<property>/velocities/groundspeed-kt</property>
<value>5</value>
</greater-than>
<equals>
<property>systems/drifting-sound</property>
<value>1</value>
</equals>
</and>
</condition>
<position>
Expand Down Expand Up @@ -184,6 +192,10 @@
<property>/velocities/groundspeed-kt</property>
<value>5</value>
</greater-than>
<equals>
<property>systems/drifting-sound</property>
<value>1</value>
</equals>
</and>
</condition>
<position>
Expand Down Expand Up @@ -220,6 +232,10 @@
<property>/velocities/groundspeed-kt</property>
<value>5</value>
</greater-than>
<equals>
<property>systems/drifting-sound</property>
<value>1</value>
</equals>
</and>
</condition>
<position>
Expand Down
246 changes: 167 additions & 79 deletions gui/dialogs/vehicle-dialog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,44 +30,47 @@
<group>
<layout>vbox</layout>
<padding>6</padding>
<button>
<halign>left</halign>
<legend>Enable Performance Mode</legend>
<pref-width>150</pref-width>
<pref-height>28</pref-height>
<enable>
<and>
<not>
<property>/sim/freeze/replay-state</property>
</not>
</and>
</enable>
<binding>
<command>property-assign</command>
<!-- dialog-apply would apply values to all objects here - setlistener reacts on them in unfortunate way-->
<property>/controls/mode</property>
<value>1</value>
</binding>
</button>
<button>
<halign>left</halign>
<legend>Enable Comfort Mode</legend>
<pref-width>150</pref-width>
<pref-height>28</pref-height>
<enable>
<and>
<not>
<property>/sim/freeze/replay-state</property>
</not>
</and>
</enable>
<binding>
<command>property-assign</command>
<!-- dialog-apply would apply values to all objects here - setlistener reacts on them in unfortunate way-->
<property>/controls/mode</property>
<value>0.65</value>
</binding>
</button>
<group>
<layout>hbox</layout>
<button>
<halign>left</halign>
<legend>Enable Performance Mode</legend>
<pref-width>150</pref-width>
<pref-height>28</pref-height>
<enable>
<and>
<not>
<property>/sim/freeze/replay-state</property>
</not>
</and>
</enable>
<binding>
<command>property-assign</command>
<!-- dialog-apply would apply values to all objects here - setlistener reacts on them in unfortunate way-->
<property>/controls/mode</property>
<value>1</value>
</binding>
</button>
<button>
<halign>left</halign>
<legend>Enable Comfort Mode</legend>
<pref-width>150</pref-width>
<pref-height>28</pref-height>
<enable>
<and>
<not>
<property>/sim/freeze/replay-state</property>
</not>
</and>
</enable>
<binding>
<command>property-assign</command>
<!-- dialog-apply would apply values to all objects here - setlistener reacts on them in unfortunate way-->
<property>/controls/mode</property>
<value>0.65</value>
</binding>
</button>
</group>
<button>
<halign>left</halign>
<legend>Enable Low Power Mode</legend>
Expand All @@ -89,10 +92,7 @@
</button>
</group>
<text>
<label>*Experimental Features</label>
</text>
<text>
<label>Realistic Steering</label>
<label>Realistic Steering (*Experimental)</label>
</text>
<group>
<layout>hbox</layout>
Expand Down Expand Up @@ -229,43 +229,131 @@
<text>
<label>Welcome message/Startup Sound</label>
</text>
<button>
<halign>left</halign>
<legend>Set Startup Sound</legend>
<pref-width>160</pref-width>
<pref-height>28</pref-height>
<binding>
<command>nasal</command>
<script>smartInstruments.setStartupSound_dlg.open()</script>
</binding>
</button>
<button>
<halign>left</halign>
<legend>Disable welcome message</legend>
<pref-width>160</pref-width>
<pref-height>28</pref-height>
<enable>
<or>
<equals>
<property>systems/welcome-message</property>
<value>1</value>
</equals>
<equals>
<property>systems/welcome-message</property>
<value>2</value>
</equals>
<equals>
<property>systems/welcome-message</property>
<value>3</value>
</equals>
</or>
</enable>
<binding>
<command>property-assign</command>
<property>systems/welcome-message</property>
<value>0</value>
</binding>
</button>
<group>
<layout>hbox</layout>
<button>
<halign>left</halign>
<legend>Set Startup Sound</legend>
<pref-width>140</pref-width>
<pref-height>28</pref-height>
<binding>
<command>nasal</command>
<script>smartInstruments.setStartupSound_dlg.open()</script>
</binding>
</button>
<button>
<halign>left</halign>
<legend>Disable welcome message</legend>
<pref-width>160</pref-width>
<pref-height>28</pref-height>
<enable>
<or>
<equals>
<property>systems/welcome-message</property>
<value>1</value>
</equals>
<equals>
<property>systems/welcome-message</property>
<value>2</value>
</equals>
<equals>
<property>systems/welcome-message</property>
<value>3</value>
</equals>
</or>
</enable>
<binding>
<command>property-assign</command>
<property>systems/welcome-message</property>
<value>0</value>
</binding>
</button>
</group>
<group>
<layout>hbox</layout>
<padding>2</padding>
<button>
<halign>left</halign>
<legend>Enable Chinese</legend>
<pref-width>100</pref-width>
<pref-height>28</pref-height>
<enable>
<or>
<equals>
<property>systems/welcome-message</property>
<value>0</value>
</equals>
<equals>
<property>systems/welcome-message</property>
<value>2</value>
</equals>
<equals>
<property>systems/welcome-message</property>
<value>3</value>
</equals>
</or>
</enable>
<binding>
<command>property-assign</command>
<property>systems/welcome-message</property>
<value>1</value>
</binding>
</button>
<button>
<halign>left</halign>
<legend>Enable English</legend>
<pref-width>100</pref-width>
<pref-height>28</pref-height>
<enable>
<or>
<equals>
<property>systems/welcome-message</property>
<value>0</value>
</equals>
<equals>
<property>systems/welcome-message</property>
<value>1</value>
</equals>
<equals>
<property>systems/welcome-message</property>
<value>3</value>
</equals>
</or>
</enable>
<binding>
<command>property-assign</command>
<property>systems/welcome-message</property>
<value>2</value>
</binding>
</button>
<button>
<halign>left</halign>
<legend>Enable Special</legend>
<pref-width>100</pref-width>
<pref-height>28</pref-height>
<enable>
<or>
<equals>
<property>systems/welcome-message</property>
<value>0</value>
</equals>
<equals>
<property>systems/welcome-message</property>
<value>1</value>
</equals>
<equals>
<property>systems/welcome-message</property>
<value>2</value>
</equals>
</or>
</enable>
<binding>
<command>property-assign</command>
<property>systems/welcome-message</property>
<value>3</value>
</binding>
</button>
</group>
</group>
<group>
<layout>vbox</layout>
Expand Down

0 comments on commit 2ae58cf

Please sign in to comment.