Config: Added filp function. Models: Added plate. Liveries: New liveries by 0404 and 0762. Splash: New splash and preview image.

This commit is contained in:
Sidi Liang 2019-08-08 21:37:08 +08:00
parent 0b66fbe907
commit 40e4146b51
53 changed files with 51206 additions and 50480 deletions

View File

@ -0,0 +1,11 @@
<?xml version="1.0"?>
<PropertyList>
<sim>
<model>
<livery>
<name type="string">e-tron Black</name>
<texture-fuse>Texture/e-tron_black.png</texture-fuse>
</livery>
</model>
</sim>
</PropertyList>

Binary file not shown.

Before

(image error) Size: 671 B

After

(image error) Size: 1.4 KiB

Binary file not shown.

After

(image error) Size: 671 B

BIN
Models/blanco.png Normal file

Binary file not shown.

After

(image error) Size: 196 B

File diff suppressed because it is too large Load Diff

View File

@ -51,7 +51,39 @@
</offsets>
</model>
<!-- PLATE -->
<model>
<condition>
<not>
<equals>
<property>sim/multiplay/generic/string[0]</property>
<value>NONE</value>
</equals>
</not>
</condition>
<path>Aircraft/followme_e-tron/Models/plate/plate.xml</path>
<offsets>
<x-m> 0.01</x-m>
<y-m> 0.0</y-m>
<z-m> 0.39</z-m>
</offsets>
</model>
<!-- INSTRUMENTS -->
<animation>
<type>select</type>
<object-name>screen</object-name>
<object-name>frame</object-name>
<condition>
<equals>
<property>sim/multiplay/generic/int[300]</property>
<value>1</value>
</equals>
</condition>
</animation>
<model>
<condition>

BIN
Models/frame.png Normal file

Binary file not shown.

After

(image error) Size: 1.7 KiB

BIN
Models/plate/back.png Normal file

Binary file not shown.

After

(image error) Size: 2.2 KiB

76
Models/plate/plate.ac Normal file
View File

@ -0,0 +1,76 @@
AC3Db
MATERIAL "None" rgb 1 1 1 amb 1 1 1 emis 0 0 0 spec 0.8 0.8 0.8 shi 0 trans 0
OBJECT world
kids 2
OBJECT poly
name "back"
data 13
Cube_Cube.001
texture "back.png"
crease 30.000000
numvert 8
-0.00499997 -0.07 0.22
-0.00499997 0.07 0.22
-0.00500003 0.07 -0.22
-0.00500003 -0.07 -0.22
0.00499997 -0.07 -0.22
0.00499997 0.07 -0.22
0.00500003 0.07 0.22
0.00500003 -0.07 0.22
numsurf 5
SURF 0x10
mat 0
refs 4
4 0.0001 0.9999
5 0.0001 0.0001
6 0.9999 0.0001
7 0.9999 0.9999
SURF 0x10
mat 0
refs 4
7 0.501192 0.364479
6 0.498774 0.363672
1 0.233119 8.6e-05
0 0.999915 8.5e-05
SURF 0x10
mat 0
refs 4
3 0.766881 0.730613
2 8.5e-05 0.730613
5 0.498808 0.36622
4 0.501226 0.367027
SURF 0x10
mat 0
refs 4
7 0.501192 0.364479
0 0.999915 8.5e-05
3 0.766881 0.730613
4 0.501226 0.367027
SURF 0x10
mat 0
refs 4
1 0.233119 8.6e-05
6 0.498774 0.363672
5 0.498808 0.36622
2 8.5e-05 0.730613
kids 0
OBJECT poly
name "face"
data 13
Cube_Cube.002
texture "texture/JLH0762.png"
crease 30.000000
numvert 4
-0.00499997 -0.07 0.22
-0.00499997 0.07 0.22
-0.00500003 0.07 -0.22
-0.00500003 -0.07 -0.22
numsurf 1
SURF 0x10
mat 0
refs 4
0 1 0
1 1 1
2 0 1
3 0 0
kids 0

80
Models/plate/plate.ac.bak Normal file
View File

@ -0,0 +1,80 @@
AC3Db
MATERIAL "None_back.png" rgb 0.800 0.800 0.800 amb 0.000 0.000 0.000 emis 0.000 0.000 0.000 spec 0.800 0.800 0.800 shi 0 trans 0.000
MATERIAL "None" rgb 0.800 0.800 0.800 amb 0.000 0.000 0.000 emis 0.000 0.000 0.000 spec 0.800 0.800 0.800 shi 0 trans 0.000
OBJECT world
name "Blender_exporter_v2.26__plate.ac"
kids 2
OBJECT poly
name "back"
data 13
Cube_Cube.001
crease 30.0
texture "back.png"
texrep 1 1
numvert 8
0.005 -0.07 -0.22
0.005 0.07 -0.22
0.005 0.07 0.22
0.005 -0.07 0.22
-0.005 -0.07 0.22
-0.005 0.07 0.22
-0.005 0.07 -0.22
-0.005 -0.07 -0.22
numsurf 5
SURF 0X10
mat 0
refs 4
4 0.0001 0.9999
5 0.0001 0.0001
6 0.9999 0.0001
7 0.9999 0.9999
SURF 0X10
mat 0
refs 4
7 0.501192 0.364479
6 0.498774 0.363672
1 0.233119 0.000086
0 0.999915 0.000085
SURF 0X10
mat 0
refs 4
3 0.766881 0.730613
2 0.000085 0.730613
5 0.498808 0.36622
4 0.501226 0.367027
SURF 0X10
mat 0
refs 4
7 0.501192 0.364479
0 0.999915 0.000085
3 0.766881 0.730613
4 0.501226 0.367027
SURF 0X10
mat 0
refs 4
1 0.233119 0.000086
6 0.498774 0.363672
5 0.498808 0.36622
2 0.000085 0.730613
kids 0
OBJECT poly
name "face"
data 13
Cube_Cube.002
crease 30.0
texture "texture/JLH0762.png"
texrep 1 1
numvert 4
0.005 -0.07 -0.22
0.005 0.07 -0.22
0.005 0.07 0.22
0.005 -0.07 0.22
numsurf 1
SURF 0X10
mat 1
refs 4
0 1 0
1 1 1
2 0 1
3 0 0
kids 0

44
Models/plate/plate.xml Normal file
View File

@ -0,0 +1,44 @@
<?xml version="1.0"?>
<PropertyList>
<path>plate.ac</path>
<animation>
<type>material</type>
<object-name>face</object-name>
<condition>
<equals>
<property>sim/multiplay/generic/string[0]</property>
<value>JAD00762</value>
</equals>
</condition>
<texture>texture/JAD00762.png</texture>
</animation>
<animation>
<type>material</type>
<object-name>face</object-name>
<condition>
<equals>
<property>sim/multiplay/generic/string[0]</property>
<value>JLH0762</value>
</equals>
</condition>
<texture>texture/JLH0762.png</texture>
</animation>
<animation>
<type>material</type>
<object-name>face</object-name>
<condition>
<equals>
<property>sim/multiplay/generic/string[0]</property>
<value>YBD00404</value>
</equals>
</condition>
<texture>texture/YBD00404.png</texture>
</animation>
</PropertyList>

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>backingScale</key>
<real>1</real>
<key>mode</key>
<integer>0</integer>
<key>shapeSelectionFilename</key>
<string>shapeSelection</string>
<key>size</key>
<data>
NC10UHpTVFAQAAAAQEKAAAAAAABAUIAAAAAAAA==
</data>
<key>softness</key>
<real>0.0</real>
<key>timestamp</key>
<real>586959512.22095704</real>
<key>transform</key>
<data>
NC10UHNuclQwAAAAP+////////8AAAAAAAAAAAAAAAAAAAAAP+////////8AAAAAAAAA
AAAAAAAAAAAA
</data>
<key>version</key>
<integer>1</integer>
</dict>
</plist>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>backingScale</key>
<real>1</real>
<key>pathFilename</key>
<string>path</string>
<key>version</key>
<integer>1</integer>
</dict>
</plist>

Binary file not shown.

Binary file not shown.

After

(image error) Size: 48 KiB

Binary file not shown.

After

(image error) Size: 36 KiB

Binary file not shown.

After

(image error) Size: 44 KiB

BIN
Models/screen.jpeg Normal file

Binary file not shown.

After

(image error) Size: 76 KiB

233
Nasal/SmartScreen.nas Normal file
View File

@ -0,0 +1,233 @@
var smartScreen = canvas.new({
"name": "smartScreen", # The name is optional but allow for easier identification
"size": [2048, 2048], # Size of the underlying texture (should be a power of 2, required) [Resolution]
"view": [768, 768], # Virtual resolution (Defines the coordinate system of the canvas [Dimensions]
# which will be stretched the size of the texture, required)
"mipmapping": 1 # Enable mipmapping (optional)
});
smartScreen.addPlacement({"node": "screen", "texture": "screen.jpeg"});
var group = smartScreen.createGroup();
# Create a text element and set some values
var text = group.createChild("text", "optional-id-for element")
.setTranslation(10, 20) # The origin is in the top left corner
.setAlignment("left-center") # All values from osgText are supported (see $FG_ROOT/Docs/README.osgtext)
.setFont("LiberationFonts/LiberationSans-Regular.ttf") # Fonts are loaded either from $AIRCRAFT_DIR/Fonts or $FG_ROOT/Fonts
.setFontSize(14, 1.2) # Set fontsize and optionally character aspect ratio
.setColor(1,0,0) # Text color
.setText("This is a text element");
# ...
text.hide();
# ...
text.setText("SELF TEST NORMAL").show();
var ui_root = smartScreen.createGroup();
var vbox = canvas.VBoxLayout.new();
smartScreen.setLayout(vbox);
var button_onl = canvas.gui.widgets.Button.new(ui_root, canvas.style, {}).setText("Online OSM").listen("clicked", func showOnlineMap());
var button_offl = canvas.gui.widgets.Button.new(ui_root, canvas.style, {}).setText("Offline OSM").listen("clicked", func showOfflineMap());
button_onl.setSizeHint([32, 128]);
button_offl.setSizeHint([32, 128]);
var label = canvas.gui.widgets.Label.new(ui_root, canvas.style, {});
var button_box = canvas.HBoxLayout.new();
button_box.addItem(button_onl);
button_box.addItem(button_offl);
button_box.addItem(label);
button_box.addStretch(1);
vbox.addItem(button_box);
vbox.addStretch(1);
var showOnlineMap = func(){
TestMap.show();
g.hide();
label.setText("Online Mode");
}
var showOfflineMap = func(){
TestMap.hide();
g.show();
label.setText("Offline Mode");
}
#######
#Online Map using MapStructure
var TestMap = smartScreen.createGroup().createChild("map");
TestMap.setTranslation(
smartScreen.get("view[0]")/2,
smartScreen.get("view[1]")/2
);
var ctrl_ns = canvas.Map.Controller.get("Aircraft position");
var source = ctrl_ns.SOURCES["map-dialog"];
if (source == nil) {
# TODO: amend
var source = ctrl_ns.SOURCES["map-dialog"] = {
getPosition: func subvec(geo.aircraft_position().latlon(), 0, 2),
getAltitude: func getprop('/position/altitude-ft'),
getHeading: func {
if (me.aircraft_heading)
getprop('/orientation/heading-deg')
else 0
},
aircraft_heading: 1,
};
}
setlistener("/sim/gui/dialogs/map-canvas/aircraft-heading-up", func(n) {
source.aircraft_heading = n.getBoolValue();
}, 1);
TestMap.setController("Aircraft position", "map-dialog");
TestMap.setRange(1);
var r = func(name,vis=1,zindex=nil) return caller(0)[0];
# TODO: we'll need some z-indexing here, right now it's just random
foreach(var type; [r('APS')] ){
TestMap.addLayer(factory: canvas.SymbolLayer, type_arg: type.name, visible: type.vis, priority: 2,);
}
foreach(var type; [ r('OSM')]) {
TestMap.addLayer(factory: canvas.OverlayLayer, type_arg: type.name,
visible: type.vis, priority: 1,);
}
TestMap.hide();
#######
#Offline map
var g = smartScreen.createGroup();
var zoom = 15;
var type = "intl";
var tile_size = 256;
var changeZoom = func(d)
{
zoom = math.max(2, math.min(19, zoom + d));
updateTiles();
}
# http://polymaps.org/docs/
# https://github.com/simplegeo/polymaps
# https://github.com/Leaflet/Leaflet
var maps_base = getprop("/sim/fg-home") ~ '/cache/maps';
var makePath =
string.compileTemplate(maps_base ~ '/osm-{type}/{z}/{x}/{y}.jpg');
var num_tiles = [4, 4];
var center_tile_offset = [
(num_tiles[0] - 1) / 2,
(num_tiles[1] - 1) / 2
];
# simple aircraft icon at current position/center of the map
g.createChild("path")
.moveTo( tile_size * center_tile_offset[0] - 10,
tile_size * center_tile_offset[1] )
.horiz(20)
.move(-10,-10)
.vert(20)
.set("stroke", "red")
.set("stroke-width", 2)
.set("z-index", 1);
##
# initialize the map by setting up
# a grid of raster images
var tiles = setsize([], num_tiles[0]);
for(var x = 0; x < num_tiles[0]; x += 1)
{
tiles[x] = setsize([], num_tiles[1]);
for(var y = 0; y < num_tiles[1]; y += 1)
tiles[x][y] = g.createChild("image", "map-tile");
}
var last_tile = [-1,-1];
var last_type = type;
##
# this is the callback that will be regularly called by the timer
# to update the map
var updateTiles = func()
{
# get current position
var lat = getprop('/position/latitude-deg');
var lon = getprop('/position/longitude-deg');
var n = math.pow(2, zoom);
var offset = [
n * ((lon + 180) / 360) - center_tile_offset[0],
(1 - math.ln(math.tan(lat * math.pi/180) + 1 / math.cos(lat * math.pi/180)) / math.pi) / 2 * n - center_tile_offset[1]
];
var tile_index = [int(offset[0]), int(offset[1])];
var ox = tile_index[0] - offset[0];
var oy = tile_index[1] - offset[1];
for(var x = 0; x < num_tiles[0]; x += 1)
for(var y = 0; y < num_tiles[1]; y += 1)
tiles[x][y].setTranslation(int((ox + x) * tile_size + 0.5), int((oy + y) * tile_size + 0.5));
if( tile_index[0] != last_tile[0]
or tile_index[1] != last_tile[1]
or type != last_type )
{
for(var x = 0; x < num_tiles[0]; x += 1)
for(var y = 0; y < num_tiles[1]; y += 1)
{
var pos = {
z: zoom,
x: int(offset[0] + x),
y: int(offset[1] + y),
type: type
};
(func {
var img_path = makePath(pos);
var tile = tiles[x][y];
print('loading ' ~ img_path);
tile.set("src", img_path)
})();
}
last_tile = tile_index;
last_type = type;
}
};
##
# set up a timer that will invoke updateTiles at 2-second intervals
var update_timer = maketimer(2, updateTiles);
# actually start the timer
update_timer.start();
##
# set up default zoom level
changeZoom(0);
#g.hide();

View File

@ -49,9 +49,11 @@ 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("controls/lighting/headlight-als", 1).setValue(0);
props.getNode("sim/remote/pilot-callsign", 1).setValue("");
#var Led = {
#
# new: func() { return { parents:[Led] },

Binary file not shown.

Before

(image error) Size: 314 KiB

After

(image error) Size: 135 KiB

Binary file not shown.

Before

(image error) Size: 126 KiB

BIN
Splash/12.png Normal file

Binary file not shown.

After

(image error) Size: 739 KiB

Binary file not shown.

Before

(image error) Size: 153 KiB

After

(image error) Size: 151 KiB

BIN
Splash/G4_Tour/4.jpg Normal file

Binary file not shown.

After

(image error) Size: 102 KiB

View File

@ -93,7 +93,7 @@
<preview>
<type>exterior</type>
<splash type="bool">true</splash>
<path>Splash/12.jpg</path>
<path>Splash/12.png</path>
</preview>
<preview>
@ -143,6 +143,12 @@
<splash type="bool">true</splash>
<path>Splash/20.jpg</path>
</preview>
<preview>
<type>exterior</type>
<splash type="bool">true</splash>
<path>Splash/G4_Tour/4.jpg</path>
</preview>
</previews>
<rating>
@ -372,6 +378,8 @@
<float n="12" alias="/gear/gear[3]/compression-norm"/>
<float n="13" alias="/gear/gear[3]/rollspeed-ms"/>
<string n="0" alias="/systems/plate"/>
</generic>
</multiplay>
</sim>
@ -592,6 +600,9 @@
<followme>
<file>Aircraft/followme_e-tron/Nasal/systems.nas</file>
</followme>
<!--<screen>
<file>Aircraft/followme_e-tron/Nasal/SmartScreen.nas</file>
</screen> -->
<engine>
<file>Aircraft/followme_e-tron/Nasal/engine.nas</file>
</engine>

View File

@ -119,7 +119,7 @@
<padding>6</padding>
<text><label>Welcome message</label></text>
<button>
<halign>middle</halign>
<halign>left</halign>
<legend>Disable welcome message</legend>
<pref-width>160</pref-width>
<pref-height>28</pref-height>
@ -146,7 +146,7 @@
<layout>hbox</layout>
<padding>2</padding>
<button>
<halign>right</halign>
<halign>left</halign>
<legend>Enable Chinese</legend>
<pref-width>100</pref-width>
<pref-height>28</pref-height>
@ -169,7 +169,7 @@
</binding>
</button>
<button>
<halign>right</halign>
<halign>left</halign>
<legend>Enable English</legend>
<pref-width>100</pref-width>
<pref-height>28</pref-height>
@ -275,10 +275,56 @@
</group>
</group>
<group>
<layout>vbox</layout>
<text><label>Plate</label></text>
<combo>
<name>plateSelection</name>
<row>1</row>
<col>6</col>
<pref-width>120</pref-width>
<halign>left</halign>
<name>Plate Selection</name>
<property>/systems/plate</property>
<value>NONE</value>
<value>JAD00762</value>
<value>YBD00404</value>
<value>JLH0762</value>
<binding>
<command>dialog-apply</command>
<object-name>plateSelection</object-name>
</binding>
</combo>
</group>
<hrule/>
<group>
<layout>hbox</layout>
<text>
<label>Rescue</label>
</text>
<button>
<halign>right</halign>
<legend>Flip Vehicle</legend>
<pref-width>120</pref-width>
<pref-height>28</pref-height>
<enable>
<and>
<not>
<property>/sim/freeze/replay-state</property>
</not>
<less-than>
<property>velocities/groundspeed-kt</property>
<value>1.0</value>
</less-than>
</and>
</enable>
<binding>
<command>property-assign</command>
<property>/orientation/roll-deg</property>
<value>0</value>
</binding>
</button>
<button>
<halign>right</halign>
@ -305,6 +351,7 @@
<value>288000</value>
</binding>
</button>
</group>
<hrule/>