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
};
var SURFACE_TYPES = {
1 : "HARD SURFACE", # Asphalt
2 : "HARD SURFACE", # Concrete
3 : "TURF",
4 : "DIRT",
5 : "GRAVEL",
# Helipads
6 : "HARD SURFACE", # Asphalt
7 : "HARD SURFACE", # Concrete
8 : "TURF",
9 : "DIRT",
0 : "GRAVEL",
var get_SURFACE_TYPES = func(type) {
if (type <= 2 or (type >= 20 and type <= 38) or (type >= 50 and type <= 57)) {
return "HARD SURFACE";
}
if (type == 3) {
return "TURF";
}
if (type == 4) {
return "DIRT";
}
if (type == 5) {
return "GRAVEL";
}
};
# 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);
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);
}
},

View file

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

View file

@ -26,12 +26,33 @@ var SURFACECOLORS = {
3 : { type: "turf", r:0.2, g:0.5, b:0.2 },
4 : { type: "dirt", r:0.4, g:0.3, b:0.3 },
5 : { type: "gravel", r:0.35, g:0.3, b:0.3 },
# Helipads
6 : { type: "asphalt", r:0.2, g:0.2, b:0.2 },
7 : { type: "concrete", r:0.3, g:0.3, b:0.3 },
8 : { type: "turf", r:0.2, g:0.5, b:0.2 },
9 : { type: "dirt", r:0.4, g:0.3, b:0.3 },
0 : { type: "gravel", r:0.35, g:0.3, b:0.3 },
20 : { type: "asphalt", r:0.2, g:0.2, b:0.2 },
21 : { type: "asphalt", r:0.2, g:0.2, b:0.2 },
22 : { type: "asphalt", r:0.2, g:0.2, b:0.2 },
23 : { type: "asphalt", r:0.2, g:0.2, b:0.2 },
24 : { type: "asphalt", r:0.2, g:0.2, b:0.2 },
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 },
};