1
0
Fork 0

Fix uses or surface type

Signed-off-by: fly <merspieler@alwaysdata.com>
This commit is contained in:
fly 2024-02-25 22:33:26 +01:00
parent d09b61eaa8
commit 71019b7d15
4 changed files with 42 additions and 20 deletions

View file

@ -179,18 +179,19 @@ var FASCIA = {
COPLT : 69 COPLT : 69
}; };
var SURFACE_TYPES = { var get_SURFACE_TYPES = func(type) {
1 : "HARD SURFACE", # Asphalt if (type <= 2 or (type >= 20 and type <= 38) or (type >= 50 and type <= 57)) {
2 : "HARD SURFACE", # Concrete return "HARD SURFACE";
3 : "TURF", }
4 : "DIRT", if (type == 3) {
5 : "GRAVEL", return "TURF";
# Helipads }
6 : "HARD SURFACE", # Asphalt if (type == 4) {
7 : "HARD SURFACE", # Concrete return "DIRT";
8 : "TURF", }
9 : "DIRT", if (type == 5) {
0 : "GRAVEL", return "GRAVEL";
}
}; };
# Vertical ranges, and labels. # Vertical ranges, and labels.

View file

@ -180,7 +180,7 @@ var AirportInfo =
var dim = sprintf("%ift x %ift", 3.28 * rwy_info.length, 3.28 * rwy_info.width); var dim = sprintf("%ift x %ift", 3.28 * rwy_info.length, 3.28 * rwy_info.width);
me.setTextElement("RwyDimensions", dim); me.setTextElement("RwyDimensions", dim);
me.setTextElement("RwySurface", SURFACE_TYPES[rwy_info.surface]); me.setTextElement("RwySurface", get_SURFACE_TYPES(rwy_info.surface));
#me.setTextElement("RwyLighting", rwy_info.surface); #me.setTextElement("RwyLighting", rwy_info.surface);
} }
}, },

View file

@ -234,7 +234,7 @@ var NearestAirports =
if (rwy_info != nil ) { if (rwy_info != nil ) {
var dim = sprintf("%ift x %ift", 3.28 * rwy_info.length, 3.28 * rwy_info.width); var dim = sprintf("%ift x %ift", 3.28 * rwy_info.length, 3.28 * rwy_info.width);
me.setTextElement("RunwayDimensions", dim); me.setTextElement("RunwayDimensions", dim);
me.setTextElement("RunwaySurface", SURFACE_TYPES[rwy_info.surface]); me.setTextElement("RunwaySurface", get_SURFACE_TYPES(rwy_info.surface));
} else { } else {
me.setTextElement("RunwayDimensions", ""); me.setTextElement("RunwayDimensions", "");
me.setTextElement("RunwaySurface", ""); me.setTextElement("RunwaySurface", "");

View file

@ -26,12 +26,33 @@ var SURFACECOLORS = {
3 : { type: "turf", r:0.2, g:0.5, b:0.2 }, 3 : { type: "turf", r:0.2, g:0.5, b:0.2 },
4 : { type: "dirt", r:0.4, g:0.3, b:0.3 }, 4 : { type: "dirt", r:0.4, g:0.3, b:0.3 },
5 : { type: "gravel", r:0.35, g:0.3, b:0.3 }, 5 : { type: "gravel", r:0.35, g:0.3, b:0.3 },
# Helipads 20 : { type: "asphalt", r:0.2, g:0.2, b:0.2 },
6 : { type: "asphalt", r:0.2, g:0.2, b:0.2 }, 21 : { type: "asphalt", r:0.2, g:0.2, b:0.2 },
7 : { type: "concrete", r:0.3, g:0.3, b:0.3 }, 22 : { type: "asphalt", r:0.2, g:0.2, b:0.2 },
8 : { type: "turf", r:0.2, g:0.5, b:0.2 }, 23 : { type: "asphalt", r:0.2, g:0.2, b:0.2 },
9 : { type: "dirt", r:0.4, g:0.3, b:0.3 }, 24 : { type: "asphalt", r:0.2, g:0.2, b:0.2 },
0 : { type: "gravel", r:0.35, g:0.3, b:0.3 }, 25 : { type: "asphalt", r:0.2, g:0.2, b:0.2 },
26 : { type: "asphalt", r:0.2, g:0.2, b:0.2 },
27 : { type: "asphalt", r:0.2, g:0.2, b:0.2 },
28 : { type: "asphalt", r:0.2, g:0.2, b:0.2 },
29 : { type: "asphalt", r:0.2, g:0.2, b:0.2 },
30 : { type: "asphalt", r:0.2, g:0.2, b:0.2 },
31 : { type: "asphalt", r:0.2, g:0.2, b:0.2 },
32 : { type: "asphalt", r:0.2, g:0.2, b:0.2 },
33 : { type: "asphalt", r:0.2, g:0.2, b:0.2 },
34 : { type: "asphalt", r:0.2, g:0.2, b:0.2 },
35 : { type: "asphalt", r:0.2, g:0.2, b:0.2 },
36 : { type: "asphalt", r:0.2, g:0.2, b:0.2 },
37 : { type: "asphalt", r:0.2, g:0.2, b:0.2 },
38 : { type: "asphalt", r:0.2, g:0.2, b:0.2 },
50 : { type: "concrete", r:0.3, g:0.3, b:0.3 },
51 : { type: "concrete", r:0.3, g:0.3, b:0.3 },
52 : { type: "concrete", r:0.3, g:0.3, b:0.3 },
53 : { type: "concrete", r:0.3, g:0.3, b:0.3 },
54 : { type: "concrete", r:0.3, g:0.3, b:0.3 },
55 : { type: "concrete", r:0.3, g:0.3, b:0.3 },
56 : { type: "concrete", r:0.3, g:0.3, b:0.3 },
57 : { type: "concrete", r:0.3, g:0.3, b:0.3 },
}; };