From 71019b7d1598371d7af5884c925b1031db793e78 Mon Sep 17 00:00:00 2001 From: fly Date: Sun, 25 Feb 2024 22:33:26 +0100 Subject: [PATCH] Fix uses or surface type Signed-off-by: fly --- .../Instruments-3d/FG1000/Nasal/Constants.nas | 25 +++++++------- .../MFDPages/AirportInfo/AirportInfo.nas | 2 +- .../NearestAirports/NearestAirports.nas | 2 +- Nasal/canvas/map/RWY.symbol | 33 +++++++++++++++---- 4 files changed, 42 insertions(+), 20 deletions(-) diff --git a/Aircraft/Instruments-3d/FG1000/Nasal/Constants.nas b/Aircraft/Instruments-3d/FG1000/Nasal/Constants.nas index 32329a548..b977bbd99 100644 --- a/Aircraft/Instruments-3d/FG1000/Nasal/Constants.nas +++ b/Aircraft/Instruments-3d/FG1000/Nasal/Constants.nas @@ -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. diff --git a/Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/AirportInfo/AirportInfo.nas b/Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/AirportInfo/AirportInfo.nas index d196c8e67..016f20068 100644 --- a/Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/AirportInfo/AirportInfo.nas +++ b/Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/AirportInfo/AirportInfo.nas @@ -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); } }, diff --git a/Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/NearestAirports/NearestAirports.nas b/Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/NearestAirports/NearestAirports.nas index 1417d01be..8098c3c7b 100644 --- a/Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/NearestAirports/NearestAirports.nas +++ b/Aircraft/Instruments-3d/FG1000/Nasal/MFDPages/NearestAirports/NearestAirports.nas @@ -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", ""); diff --git a/Nasal/canvas/map/RWY.symbol b/Nasal/canvas/map/RWY.symbol index a6d15a033..23eb6eb2a 100644 --- a/Nasal/canvas/map/RWY.symbol +++ b/Nasal/canvas/map/RWY.symbol @@ -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 }, };