commit
e39d82a625
File diff suppressed because it is too large
Load Diff
|
@ -23,7 +23,7 @@
|
|||
<type>rotate</type>
|
||||
<object-name>steeringwheel</object-name>
|
||||
<property>sim/multiplay/generic/float[18]</property>
|
||||
<factor>-1</factor>
|
||||
<factor>-0.5</factor>
|
||||
<center>
|
||||
<x-m> 1.50</x-m>
|
||||
<y-m>-0.33</y-m>
|
||||
|
|
|
@ -122,7 +122,7 @@
|
|||
<condition>
|
||||
<not>
|
||||
<equals>
|
||||
<property>sim/multiplay/generic/string[0]</property>
|
||||
<property>sim/multiplay/generic/string[5]</property>
|
||||
<value>NONE</value>
|
||||
</equals>
|
||||
</not>
|
||||
|
|
|
@ -12,6 +12,13 @@
|
|||
</effect>
|
||||
|
||||
<animation>
|
||||
<type>material</type>
|
||||
<object-name>face</object-name>
|
||||
<property-base>sim/multiplay/generic</property-base>
|
||||
<texture-prop>string[5]</texture-prop>
|
||||
</animation>
|
||||
|
||||
<!--<animation>
|
||||
<type>material</type>
|
||||
<object-name>face</object-name>
|
||||
<condition>
|
||||
|
@ -90,6 +97,6 @@
|
|||
</equals>
|
||||
</condition>
|
||||
<texture>texture/Airport.png</texture>
|
||||
</animation>
|
||||
</animation>-->
|
||||
|
||||
</PropertyList>
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
#Custom plate selection system by Sidi Liang for follow me EV
|
||||
#Contact: sidi.liang@gmail.com
|
||||
#
|
||||
#Instructions: This code scans the Models/plate/texture folder
|
||||
#whenever the vehicle config dialog (config-dialog.xml) is opened.
|
||||
#To add an plate, just place the new plate texture file (must be .png
|
||||
#format) to that folder and it will show up in the dialog.
|
||||
|
||||
var path = props.getNode("/",1).getValue("sim/aircraft-dir") ~ '/Models/plate/texture';
|
||||
var scan = func(){
|
||||
var data = [];
|
||||
var files = directory(path);
|
||||
if (size(files)) {
|
||||
foreach (var file; files) {
|
||||
if (substr(file, -4) != ".png")
|
||||
continue;
|
||||
var n = io.read_properties(path ~ file);
|
||||
append(data, [substr(file, 0, size(file) - 4), path ~ file]);
|
||||
}
|
||||
#me.data = sort(me.data, func(a, b) num(a[1]) == nil or num(b[1]) == nil
|
||||
# ? cmp(a[1], b[1]) : a[1] - b[1]);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
var updateList = func(){
|
||||
var allPlates = scan();
|
||||
var data = props.globals.getNode("/sim/gui/dialogs/vehicle_config/dialog/group[3]/combo/", 1);
|
||||
data.removeChildren("value");
|
||||
data.getChild("value", 0, 1).setValue("NONE");
|
||||
forindex(var i; allPlates){
|
||||
data.getChild("value", i+1, 1).setValue(allPlates[i][0]);
|
||||
}
|
||||
}
|
||||
var Plate = {
|
||||
new: func() {
|
||||
return { parents:[Plate]};
|
||||
},
|
||||
plateNameNode: props.getNode("systems/plate/name", 1),
|
||||
plateFileNode: props.getNode("systems/plate/file", 1),
|
||||
multiplayerNameNode: props.getNode("sim/multiplay/generic/string[4]", 1),
|
||||
multiplayerFileNode: props.getNode("sim/multiplay/generic/string[5]", 1),
|
||||
name: "",
|
||||
file: "",
|
||||
changePlate: func(name){
|
||||
#NONE for uninstalling the plate
|
||||
me.name = name;
|
||||
me.file = name~".png";
|
||||
me.update();
|
||||
},
|
||||
update: func(){
|
||||
me.plateNameNode.setValue(me.name);
|
||||
me.plateFileNode.setValue(me.file);
|
||||
},
|
||||
};
|
|
@ -2,6 +2,9 @@
|
|||
#### Gijs de Rooy (Original) ####
|
||||
#### Sidi Liang ####
|
||||
|
||||
props.getNode("/sim/gui/dialogs/vehicle_config/dialog",1);
|
||||
var configDialog = gui.Dialog.new("/sim/gui/dialogs/vehicle_config/dialog", "Aircraft/followme_e-tron/gui/dialogs/config-dialog.xml");
|
||||
|
||||
var liveryFuse = {
|
||||
init: func(dir, nameprop = "sim/model/livery/name", sortprop = nil) {
|
||||
me.parents = [gui.OverlaySelector.new("Select Livery", dir, nameprop,
|
||||
|
@ -91,7 +94,8 @@ props.getNode("systems/welcome-message", 1).setValue(0);
|
|||
props.getNode("systems/display-speed", 1).setValue(0);
|
||||
props.getNode("systems/speedometer/type", 1).setValue("Type_A");
|
||||
props.getNode("systems/battery-gauge/type", 1).setValue("Type_A");
|
||||
props.getNode("systems/plate", 1).setValue("NONE");
|
||||
props.getNode("systems/plate/file", 1).setValue("NONE");
|
||||
props.getNode("systems/plate/name", 1).setValue("NONE");
|
||||
props.getNode("controls/lighting/headlight-als", 1).setValue(0);
|
||||
props.getNode("sim/remote/pilot-callsign", 1).setValue("");
|
||||
props.getNode("/systems/codriver-enable", 1).setValue(0);
|
||||
|
@ -432,7 +436,7 @@ var brakesABS = func(){
|
|||
|
||||
var absTimer = maketimer(0.001, brakesABS);
|
||||
|
||||
var brakeWithABS = func(){ #//Doesn't seems to work as it seems that jsbsim wheels never overbrake?
|
||||
var brakeWithABS = func(){ #//Doesn't seems to work because it seems that jsbsim wheels never overbrake?
|
||||
var brakeCmd = props.getNode("/",1).getValue("/controls/gear/brake-cmd");
|
||||
if(brakeCmd){
|
||||
absTimer.start();
|
||||
|
|
|
@ -445,8 +445,8 @@
|
|||
<item>
|
||||
<label>Configuration</label>
|
||||
<binding>
|
||||
<command>dialog-show</command>
|
||||
<dialog-name>config-dialog</dialog-name>
|
||||
<command>nasal</command>
|
||||
<script>followme.configDialog.open();</script>
|
||||
</binding>
|
||||
</item>
|
||||
<item>
|
||||
|
@ -550,10 +550,12 @@
|
|||
<float n="22" alias="/controls/engines/engine/throttle"/>
|
||||
|
||||
|
||||
<string n="0" alias="/systems/plate"/>
|
||||
<!--<string n="0" alias="/systems/plate"/>-->
|
||||
<string n="1" alias="/systems/battery-gauge/type"/>
|
||||
<string n="2" alias="/systems/speedometer/type"/>
|
||||
<string n="3" alias="/systems/interior/type"/>
|
||||
<string n="4" alias="/systems/plate/name"/>
|
||||
<string n="5" alias="/systems/plate/file"/>
|
||||
|
||||
</generic>
|
||||
</multiplay>
|
||||
|
@ -803,6 +805,7 @@
|
|||
<followme>
|
||||
<file>Aircraft/followme_e-tron/Nasal/electrical.nas</file>
|
||||
<file>Aircraft/followme_e-tron/Nasal/systems.nas</file>
|
||||
<file>Aircraft/followme_e-tron/Nasal/plate.nas</file>
|
||||
<file>Aircraft/followme_e-tron/Nasal/steering.nas</file>
|
||||
<file>Aircraft/followme_e-tron/Nasal/radar.nas</file>
|
||||
</followme>
|
||||
|
|
|
@ -8,6 +8,24 @@
|
|||
<modal>false</modal>
|
||||
<draggable>true</draggable>
|
||||
|
||||
<nasal>
|
||||
<open>
|
||||
followme.updateList();
|
||||
#print(cmdarg().getPath());
|
||||
var nameNode = props.getNode("systems/plate/name", 1);
|
||||
var fileNode = props.getNode("systems/plate/file", 1);
|
||||
var lis = setlistener(nameNode, func(){
|
||||
if(nameNode.getValue() != "NONE"){
|
||||
fileNode.setValue("texture/" ~ nameNode.getValue() ~ ".png");
|
||||
}else{
|
||||
fileNode.setValue(nameNode.getValue());
|
||||
}
|
||||
});
|
||||
</open>
|
||||
<close>
|
||||
removelistener(lis);
|
||||
</close>
|
||||
</nasal>
|
||||
|
||||
<group>
|
||||
<layout>hbox</layout>
|
||||
|
@ -112,15 +130,8 @@
|
|||
<pref-width>120</pref-width>
|
||||
<halign>left</halign>
|
||||
<name>Plate Selection</name>
|
||||
<property>/systems/plate</property>
|
||||
<value>NONE</value>
|
||||
<value>Airport0</value>
|
||||
<value>JLH0762</value>
|
||||
<value>JAD00762</value>
|
||||
<value>YBD00404</value>
|
||||
<value>YAD07749</value>
|
||||
<value>SAD00818</value>
|
||||
<value>JAD00066</value>
|
||||
<property>/systems/plate/name</property>
|
||||
<value>$value</value>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
<object-name>plateSelection</object-name>
|
||||
|
|
|
@ -280,8 +280,8 @@
|
|||
</and>
|
||||
</enable>
|
||||
<binding>
|
||||
<command>dialog-show</command>
|
||||
<dialog-name>config-dialog</dialog-name>>
|
||||
<command>nasal</command>
|
||||
<script>followme.configDialog.open();</script>
|
||||
</binding>
|
||||
</button>
|
||||
<hrule/>
|
||||
|
|
Loading…
Reference in New Issue