diff --git a/resources/08lapdcvpipack/08lapdcvpipack.lua b/resources/08lapdcvpipack/08lapdcvpipack.lua
deleted file mode 100644
index 6b907c578..000000000
--- a/resources/08lapdcvpipack/08lapdcvpipack.lua
+++ /dev/null
@@ -1,51 +0,0 @@
---[[
- Ultimate Lighting Controller Config
- the ULC resource is required to use this configuration
- get the resource here: https://github.com/Flohhhhh/ultimate-lighting-controller/releases/latest
-
- To learn how to setup and use ULC visit here: https://docs.dwnstr.com/ulc/overview
-]]
-
-return { names = {"08lapdcvpi1", "08lapdcvpi2", "08lapdcvpighost", "08lapdcvpiharbor", "08lapdcvpisecsd"},
- steadyBurnConfig = {
- forceOn = false, useTime = false,
- disableWithLights = false,
- sbExtras = {}
- },
- parkConfig = {
- usePark = false,
- useSync = false,
- syncWith = {},
- pExtras = {},
- dExtras = {}
- },
- hornConfig = {
- useHorn = false,
- hornExtras = {},
- },
- brakeConfig = {
- useBrakes = false,
- speedThreshold = 3,
- brakeExtras = {}
- },
- reverseConfig = {
- useReverse = false,
- reverseExtras = {}
- },
- doorConfig = {
- useDoors = false,
- driverSide = {enable = {}, disable = {}},
- passSide = {enable = {}, disable = {}},
- trunk = {enable ={}, disable = {}}
- },
- buttons = {
- {label = "Stage 1", key = 1, color = "green", extra = 8, linkedExtras = {}, oppositeExtras = {}, offExtras = {5,6,7}, repair = false},
- {label = "Stage 2", key = 2, color = "red", extra = 5, linkedExtras = {7}, oppositeExtras = {6}, offExtras = {6}, repair = false},
- {label = "Stage 3", key = 3, color = "red", extra = 6, linkedExtras = {7}, oppositeExtras = {5}, offExtras = {5}, repair = false}
- },
- defaultStages = {
- useDefaults = false,
- enableKeys = {},
- disableKeys = {}
- }
-}
\ No newline at end of file
diff --git a/resources/08lapdcvpipack/ulc.lua b/resources/08lapdcvpipack/ulc.lua
index 6b907c578..4b34b3407 100644
--- a/resources/08lapdcvpipack/ulc.lua
+++ b/resources/08lapdcvpipack/ulc.lua
@@ -15,9 +15,9 @@ return { names = {"08lapdcvpi1", "08lapdcvpi2", "08lapdcvpighost", "08lapdcvpiha
parkConfig = {
usePark = false,
useSync = false,
- syncWith = {},
- pExtras = {},
- dExtras = {}
+ syncWith = {10},
+ pExtras = {11},
+ dExtras = {12}
},
hornConfig = {
useHorn = false,
diff --git a/resources/LAPD/08lapdcvpipack.lua b/resources/LAPD/08lapdcvpipack.lua
deleted file mode 100644
index 6b907c578..000000000
--- a/resources/LAPD/08lapdcvpipack.lua
+++ /dev/null
@@ -1,51 +0,0 @@
---[[
- Ultimate Lighting Controller Config
- the ULC resource is required to use this configuration
- get the resource here: https://github.com/Flohhhhh/ultimate-lighting-controller/releases/latest
-
- To learn how to setup and use ULC visit here: https://docs.dwnstr.com/ulc/overview
-]]
-
-return { names = {"08lapdcvpi1", "08lapdcvpi2", "08lapdcvpighost", "08lapdcvpiharbor", "08lapdcvpisecsd"},
- steadyBurnConfig = {
- forceOn = false, useTime = false,
- disableWithLights = false,
- sbExtras = {}
- },
- parkConfig = {
- usePark = false,
- useSync = false,
- syncWith = {},
- pExtras = {},
- dExtras = {}
- },
- hornConfig = {
- useHorn = false,
- hornExtras = {},
- },
- brakeConfig = {
- useBrakes = false,
- speedThreshold = 3,
- brakeExtras = {}
- },
- reverseConfig = {
- useReverse = false,
- reverseExtras = {}
- },
- doorConfig = {
- useDoors = false,
- driverSide = {enable = {}, disable = {}},
- passSide = {enable = {}, disable = {}},
- trunk = {enable ={}, disable = {}}
- },
- buttons = {
- {label = "Stage 1", key = 1, color = "green", extra = 8, linkedExtras = {}, oppositeExtras = {}, offExtras = {5,6,7}, repair = false},
- {label = "Stage 2", key = 2, color = "red", extra = 5, linkedExtras = {7}, oppositeExtras = {6}, offExtras = {6}, repair = false},
- {label = "Stage 3", key = 3, color = "red", extra = 6, linkedExtras = {7}, oppositeExtras = {5}, offExtras = {5}, repair = false}
- },
- defaultStages = {
- useDefaults = false,
- enableKeys = {},
- disableKeys = {}
- }
-}
\ No newline at end of file
diff --git a/resources/LAPD/hybridfpis.lua b/resources/LAPD/hybridfpis.lua
deleted file mode 100644
index 5bb7c2804..000000000
--- a/resources/LAPD/hybridfpis.lua
+++ /dev/null
@@ -1,50 +0,0 @@
---[[
- Ultimate Lighting Controller Config
- the ULC resource is required to use this configuration
- get the resource here: https://github.com/Flohhhhh/ultimate-lighting-controller/releases/latest
-
- To learn how to setup and use ULC visit here: https://docs.dwnstr.com/ulc/overview
-]]
-
-return { names = {"hybridfpis"},
- steadyBurnConfig = {
- forceOn = false, useTime = false,
- disableWithLights = false,
- sbExtras = {}
- },
- parkConfig = {
- usePark = false,
- useSync = false,
- syncWith = {},
- pExtras = {},
- dExtras = {}
- },
- hornConfig = {
- useHorn = false,
- hornExtras = {},
- },
- brakeConfig = {
- useBrakes = false,
- speedThreshold = 3,
- brakeExtras = {}
- },
- reverseConfig = {
- useReverse = false,
- reverseExtras = {}
- },
- doorConfig = {
- useDoors = false,
- driverSide = {enable = {}, disable = {}},
- passSide = {enable = {}, disable = {}},
- trunk = {enable ={}, disable = {}}
- },
- buttons = {
- {label = "Stage 2", key = 2, color = "green", extra = 6, linkedExtras = {7}, oppositeExtras = {2,3,4,5,8}, offExtras = {2,3,4,5,8}, repair = false},
- {label = "Stage 3", key = 3, color = "green", extra = 3, linkedExtras = {6,4,5,7}, oppositeExtras = {6,8}, offExtras = {6,8}, repair = false}
- },
- defaultStages = {
- useDefaults = false,
- enableKeys = {},
- disableKeys = {}
- }
-}
\ No newline at end of file
diff --git a/resources/LAPD/lapd13fpiu.lua b/resources/LAPD/lapd13fpiu.lua
deleted file mode 100644
index cc3da7fad..000000000
--- a/resources/LAPD/lapd13fpiu.lua
+++ /dev/null
@@ -1,51 +0,0 @@
---[[
- Ultimate Lighting Controller Config
- the ULC resource is required to use this configuration
- get the resource here: https://github.com/Flohhhhh/ultimate-lighting-controller/releases/latest
-
- To learn how to setup and use ULC visit here: https://docs.dwnstr.com/ulc/overview
-]]
-
-return { names = {"lapd13fpiu"},
- steadyBurnConfig = {
- forceOn = false, useTime = false,
- disableWithLights = false,
- sbExtras = {}
- },
- parkConfig = {
- usePark = false,
- useSync = false,
- syncWith = {},
- pExtras = {},
- dExtras = {}
- },
- hornConfig = {
- useHorn = false,
- hornExtras = {},
- },
- brakeConfig = {
- useBrakes = false,
- speedThreshold = 3,
- brakeExtras = {}
- },
- reverseConfig = {
- useReverse = false,
- reverseExtras = {}
- },
- doorConfig = {
- useDoors = false,
- driverSide = {enable = {}, disable = {}},
- passSide = {enable = {}, disable = {}},
- trunk = {enable ={}, disable = {}}
- },
- buttons = {
- {label = "Stage 1", key = 1, color = "green", extra = 8, linkedExtras = {10}, oppositeExtras = {6,7,9}, offExtras = {6,7,9}, repair = false},
- {label = "Stage 2", key = 2, color = "green", extra = 8, linkedExtras = {9}, oppositeExtras = {6,7,10}, offExtras = {6,7,10}, repair = false},
- {label = "Stage 3", key = 3, color = "green", extra = 6, linkedExtras = {7,9}, oppositeExtras = {8,10}, offExtras = {8,10}, repair = false}
- },
- defaultStages = {
- useDefaults = false,
- enableKeys = {},
- disableKeys = {}
- }
-}
\ No newline at end of file
diff --git a/resources/LAPD/lapd14chrg.lua b/resources/LAPD/lapd14chrg.lua
deleted file mode 100644
index 104ab93d0..000000000
--- a/resources/LAPD/lapd14chrg.lua
+++ /dev/null
@@ -1,51 +0,0 @@
---[[
- Ultimate Lighting Controller Config
- the ULC resource is required to use this configuration
- get the resource here: https://github.com/Flohhhhh/ultimate-lighting-controller/releases/latest
-
- To learn how to setup and use ULC visit here: https://docs.dwnstr.com/ulc/overview
-]]
-
-return { names = {"lapd14chargertd", "lapd14charger"},
- steadyBurnConfig = {
- forceOn = false, useTime = false,
- disableWithLights = false,
- sbExtras = {}
- },
- parkConfig = {
- usePark = false,
- useSync = false,
- syncWith = {},
- pExtras = {},
- dExtras = {}
- },
- hornConfig = {
- useHorn = false,
- hornExtras = {},
- },
- brakeConfig = {
- useBrakes = false,
- speedThreshold = 3,
- brakeExtras = {}
- },
- reverseConfig = {
- useReverse = false,
- reverseExtras = {}
- },
- doorConfig = {
- useDoors = false,
- driverSide = {enable = {}, disable = {}},
- passSide = {enable = {}, disable = {}},
- trunk = {enable ={}, disable = {}}
- },
- buttons = {
- {label = "Stage 1", key = 1, color = "green", extra = 1, linkedExtras = {}, oppositeExtras = {}, offExtras = {3,4,5}, repair = true},
- {label = "Stage 2", key = 2, color = "green", extra = 4, linkedExtras = {}, oppositeExtras = {}, offExtras = {3,5}, repair = true},
- {label = "Stage 3", key = 3, color = "green", extra = 3, linkedExtras = {5}, oppositeExtras = {}, offExtras = {4}, repair = true}
- },
- defaultStages = {
- useDefaults = false,
- enableKeys = {},
- disableKeys = {}
- }
-}
\ No newline at end of file
diff --git a/resources/LAPD/lapdfpis.lua b/resources/LAPD/lapdfpis.lua
deleted file mode 100644
index 76c242302..000000000
--- a/resources/LAPD/lapdfpis.lua
+++ /dev/null
@@ -1,51 +0,0 @@
---[[
- Ultimate Lighting Controller Config
- the ULC resource is required to use this configuration
- get the resource here: https://github.com/Flohhhhh/ultimate-lighting-controller/releases/latest
-
- To learn how to setup and use ULC visit here: https://docs.dwnstr.com/ulc/overview
-]]
-
-return { names = {"lapdfpis"},
- steadyBurnConfig = {
- forceOn = false, useTime = false,
- disableWithLights = false,
- sbExtras = {}
- },
- parkConfig = {
- usePark = false,
- useSync = false,
- syncWith = {},
- pExtras = {},
- dExtras = {}
- },
- hornConfig = {
- useHorn = false,
- hornExtras = {},
- },
- brakeConfig = {
- useBrakes = false,
- speedThreshold = 3,
- brakeExtras = {}
- },
- reverseConfig = {
- useReverse = false,
- reverseExtras = {}
- },
- doorConfig = {
- useDoors = false,
- driverSide = {enable = {}, disable = {}},
- passSide = {enable = {}, disable = {}},
- trunk = {enable ={}, disable = {}}
- },
- buttons = {
- {label = "Stage 1", key = 1, color = "green", extra = 5, linkedExtras = {}, oppositeExtras = {}, offExtras = {3,4,6}, repair = false},
- {label = "Stage 2", key = 2, color = "green", extra = 4, linkedExtras = {6}, oppositeExtras = {3,5}, offExtras = {3,5}, repair = false},
- {label = "Stage 3", key = 3, color = "green", extra = 3, linkedExtras = {6}, oppositeExtras = {4,5}, offExtras = {4,5}, repair = false}
- },
- defaultStages = {
- useDefaults = false,
- enableKeys = {},
- disableKeys = {}
- }
-}
\ No newline at end of file
diff --git a/resources/LAPD/metro13fpiu.lua b/resources/LAPD/metro13fpiu.lua
deleted file mode 100644
index 0cbdd66f2..000000000
--- a/resources/LAPD/metro13fpiu.lua
+++ /dev/null
@@ -1,51 +0,0 @@
---[[
- Ultimate Lighting Controller Config
- the ULC resource is required to use this configuration
- get the resource here: https://github.com/Flohhhhh/ultimate-lighting-controller/releases/latest
-
- To learn how to setup and use ULC visit here: https://docs.dwnstr.com/ulc/overview
-]]
-
-return { names = {"metrofpiu"},
- steadyBurnConfig = {
- forceOn = false, useTime = false,
- disableWithLights = false,
- sbExtras = {}
- },
- parkConfig = {
- usePark = false,
- useSync = false,
- syncWith = {},
- pExtras = {},
- dExtras = {}
- },
- hornConfig = {
- useHorn = false,
- hornExtras = {},
- },
- brakeConfig = {
- useBrakes = false,
- speedThreshold = 3,
- brakeExtras = {}
- },
- reverseConfig = {
- useReverse = false,
- reverseExtras = {}
- },
- doorConfig = {
- useDoors = false,
- driverSide = {enable = {}, disable = {}},
- passSide = {enable = {}, disable = {}},
- trunk = {enable ={}, disable = {}}
- },
- buttons = {
- {label = "Stage 1", key = 1, color = "green", extra = 6, linkedExtras = {}, oppositeExtras = {1,2,3,4,5,7}, offExtras = {1,2,3,4,5,7}, repair = false},
- {label = "Stage 2", key = 2, color = "green", extra = 5, linkedExtras = {7}, oppositeExtras = {1,2,3,4,6}, offExtras = {1,2,3,4,6}, repair = false},
- {label = "Stage 3", key = 3, color = "green", extra = 1, linkedExtras = {2,3,4,7}, oppositeExtras = {5,6}, offExtras = {5,6}, repair = false}
- },
- defaultStages = {
- useDefaults = false,
- enableKeys = {},
- disableKeys = {}
- }
-}
\ No newline at end of file
diff --git a/resources/LAPD/16lapdfpiu.lua b/resources/LAPD/ulc.lua
similarity index 84%
rename from resources/LAPD/16lapdfpiu.lua
rename to resources/LAPD/ulc.lua
index 6b38fd3f4..ed5157459 100644
--- a/resources/LAPD/16lapdfpiu.lua
+++ b/resources/LAPD/ulc.lua
@@ -6,7 +6,7 @@
To learn how to setup and use ULC visit here: https://docs.dwnstr.com/ulc/overview
]]
-return { names = {"metro16fpiu","metro16fpiu2","metro16fpiu3"},
+return { names = {"13lapdfpis2","16lapdexp", "16lapdexpk9","20lapdexp","20lapdexp2","20lapdexp3","20lapdexpk9"},
steadyBurnConfig = {
forceOn = false, useTime = false,
disableWithLights = false,
@@ -15,9 +15,9 @@ return { names = {"metro16fpiu","metro16fpiu2","metro16fpiu3"},
parkConfig = {
usePark = false,
useSync = false,
- syncWith = {},
- pExtras = {},
- dExtras = {}
+ syncWith = {10},
+ pExtras = {11},
+ dExtras = {12}
},
hornConfig = {
useHorn = false,
@@ -41,7 +41,7 @@ return { names = {"metro16fpiu","metro16fpiu2","metro16fpiu3"},
buttons = {
{label = "Stage", key = 1, color = "green", linkedExtras = {}, oppositeExtras = {}, offExtras = {2,3,4,5,1}, repair = false},
{label = "Stage 2", key = 2, color = "green", extra = 5, linkedExtras = {}, oppositeExtras = {}, offExtras = {1,2,4,3}, repair = false},
- {label = "Stage 3", key = 3, color = "green", extra = 1, linkedExtras = {2}, oppositeExtras = {}, offExtras = {3,4,5}, repair = false}
+ {label = "Stage 3", key = 3, color = "green", extra = 1, linkedExtras = {}, oppositeExtras = {}, offExtras = {3,4,5}, repair = false}
},
defaultStages = {
useDefaults = false,
diff --git a/resources/LegacyFuel/config.lua b/resources/LegacyFuel/config.lua
index c09c6afb8..69a8ee994 100644
--- a/resources/LegacyFuel/config.lua
+++ b/resources/LegacyFuel/config.lua
@@ -17,7 +17,7 @@ Config.FuelDecor = "_FUEL_LEVEL"
Config.DisableKeys = {0, 22, 23, 24, 29, 30, 31, 37, 44, 56, 82, 140, 166, 167, 168, 170, 288, 289, 311, 323}
-- Want to use the HUD? Turn this to true.
-Config.EnableHUD = true
+Config.EnableHUD = false
-- Configure blips here. Turn both to false to disable blips all together.
Config.ShowNearestGasStationOnly = true
diff --git a/resources/[ERS]/night_ers/.fxap b/resources/[ERS]/night_ers/.fxap
index 258c95d54..67747aac4 100644
Binary files a/resources/[ERS]/night_ers/.fxap and b/resources/[ERS]/night_ers/.fxap differ
diff --git a/resources/[ERS]/night_ers/NUI/main.js b/resources/[ERS]/night_ers/NUI/main.js
index 75a416b17..38438cfd6 100644
--- a/resources/[ERS]/night_ers/NUI/main.js
+++ b/resources/[ERS]/night_ers/NUI/main.js
@@ -1,45 +1,6 @@
-let resourceName=null,language=null,commands=null,firstnames={},lastnames={},isDisplayingPreCalloutInterface=!1,isDisplayingCalloutInterface=!1;window.addEventListener("message",e=>{let t=e.data;if("playSound"==t.transactionType&&PlayNUISound(t.transactionFolder,t.transactionFile,t.transactionVolume),"init"==t.type&&("undefined"!=typeof $?(resourceName=t.resourcename,language=t.language,commands=t.commands,firstnames=t.firstnames,lastnames=t.lastnames,$.post(`https://${resourceName}/initComplete`,JSON.stringify({complete:!0}))):console.log("Script is still loading...")),"togglecalloutinfo"==t.type&&toggleCalloutInfo(),"ersselectionmenu"==t.type){var a,n,i,o=t.display;ToggleERSSelectionMenu(o,t.permissions)}if("radialmenu"==t.type){var o=t.display;ToggleRadialMenu(o)}if("pursuitradialmenu"==t.type){var o=t.display;TogglePursuitRadialMenu(o)}if("pursuitmode"==t.type){var s,l,o=t.display,r=t.displayhotkeyhint;TogglePursuitModeUI(o,r,t.zoomhotkey,t.backuphotkey)}if("hotkeyhintprompt"==t.type){var o=t.display,c=t.hotkeys,d=t.time;ToggleHotKeyHintPrompt(o,c,language,d)}if("dispatchmessage"==t.type){var u,o=t.display,c=t.hotkeys,p=t.messagetype,g=t.calloutdata,m=t.message,d=t.time;AddMessageToDispatchQueue(o,c,p,g,d,m,t.toggle)}if("calloutprompt"==t.type){var b,o=t.display,g=t.calloutdata,c=t.hotkeys,d=t.time;ToggleCalloutDisplayPrompt(o,c,language,d,g,t.serviceType)}if("calloutpreinterface"==t.type){var o=t.display,c=t.hotkeys,g=t.calloutdata;TogglePreCalloutInterface(o,c,g)}if("calloutinterface"==t.type){var h,y,o=t.display,c=t.hotkeys,f=t.pedCount,v=t.vehicleCount,x=t.objectCount,w=t.propCount,k=t.fireCount,C=t.smokeCount,g=t.calloutdata,P=t.pedOriginalCount,T=t.vehOriginalCount,I=t.objOriginalCount,S=t.propOriginalCount;ToggleCalloutInterface(o,c,f,v,x,w,k,C,g,P,T,I,S,t.fireOriginalCount,t.smokeOriginalCount)}if("pedinteractionprompt"==t.type){var o=t.display,N=t.hotkey;DisplayPedInteractionPrompt(o,N)}if("injuredpedinteractionprompt"==t.type){var o=t.display,N=t.hotkey;DisplayInjuredPedInteractionPrompt(o,N)}if("impoundprompt"==t.type){var o=t.display,N=t.hotkey;DisplayImpoundPrompt(o,N)}if("gearprompt"==t.type){var o=t.display,N=t.hotkey;DisplayGearPrompt(o,N)}if("stretcherprompt"==t.type){var o=t.display,N=t.hotkey;DisplayStretcherPrompt(o,N)}if("objectcleanupprompt"==t.type){var o=t.display,N=t.hotkey;DisplayObjectCleanupPrompt(o,N)}if("interactionmodule"==t.type){var R,o=t.display;DisplayPedInteractionModule(o,t.ispeddeadordying)}if("idcardprompt"==t.type){var E,A,o=t.display;DisplayPedIdCard(o,t.pedpersonaldata,t.showdatabasecheck)}if("inventoryprompt"==t.type){var _,o=t.display;DisplayPedInventory(o,t.itemlist)}if("vehicleinfoprompt"==t.type){var M,D,o=t.display;DisplayVehicleInfo(o,t.vehicleData,t.DisableTaxAndMOT)}if("togglequestionsmodule"==t.type){var q,o=t.display;ToggleQuestionsModule(o,t.questions)}if("updateanswers"==t.type){var O,o=t.display;UpdateAnswers(o,t.answers)}if("addorremovewaypoint"==t.type&&AddWaypoint(t.addwaypoint),"updatewaypoint"==t.type){var L,B,j,U=t.scaleX;UpdateWaypointPosition(U,t.scaleY,t.distanceText)}if("areyousure"==t.type){var o=t.display;DisplayAreYouSurePopup(o)}if("gearmenu"==t.type){var F,o=t.display;DisplayGearMenu(o,t.locationdata)}if("spikesvehicleprompt"==t.type){var o=t.display,N=t.hotkey,m=t.message,d=t.time;DisplaySpikesVehiclePrompt(o,N,m,d)}if("updatezonechange"==t.type){UpdateZoneChangeUI(t.lastZone,t.currentZone)}"updatewaypoints"===t.type&&updateWaypoints(t)});var interactionPromptTimeout,injuredPedPromptTimeout,impoundPromptTimeout,gearPromptTimeout,StretcherPromptTimeout,ObjectCleanupPromptTimeout,idCardTimeout,dbCheckTimeout,vehicleInfoTimeout,vehicleDbCheckTimeout,inventoryTimeout,spikesVehiclePromptTimeout,zoneChangeTimeout=null;let zoneChangeQueue=[],isAnimating=!1;function UpdateZoneChangeUI(e,t){zoneChangeQueue.push({oldZone:e,newZone:t}),isAnimating||processNextZoneChange()}function processNextZoneChange(){if(0===zoneChangeQueue.length){isAnimating=!1;return}isAnimating=!0;let{oldZone:e,newZone:t}=zoneChangeQueue.shift(),a=document.getElementById("zone-change-ui");if(!a){processNextZoneChange();return}let n=a.querySelector(".old-zone"),i=a.querySelector(".new-zone");if(!n||!i){processNextZoneChange();return}zoneChangeTimeout&&clearTimeout(zoneChangeTimeout),a.classList.remove("show"),i.classList.remove("show"),n.textContent=e||"N/A",i.textContent=t||"N/A",a.offsetWidth,a.classList.add("show"),i.classList.add("show"),zoneChangeTimeout=setTimeout(()=>{a.classList.remove("show"),i.classList.remove("show"),setTimeout(processNextZoneChange,500)},4e3)}let escapeEventListenerAdded=!1;function DisplayAreYouSurePopup(e){if(e){$("#are-you-sure-modal").remove();let t=`
${language.CompletingCalloutCannotBeUndone}
`;$("body").append(t),$("#are-you-sure-modal").modal({backdrop:"static",keyboard:!1}),$("#are-you-sure-modal").modal("show"),$("#are-you-sure-modal").on("shown.bs.modal",function(){escapeEventListenerAdded||($(document).on("keydown",function(e){"Escape"===e.key&&($("#are-you-sure-modal").modal("hide"),handleNoClick(),e.stopPropagation())}),escapeEventListenerAdded=!0)}).on("hidden.bs.modal",function(){$(document).off("keydown"),escapeEventListenerAdded=!1})}else $("#are-you-sure-modal").remove()}function handleNoClick(){$.post(`https://${resourceName}/AreYouSure`,JSON.stringify({areyousure:!1})),$("#are-you-sure-modal").modal("hide")}function handleYesClick(){$.post(`https://${resourceName}/AreYouSure`,JSON.stringify({areyousure:!0})),$("#are-you-sure-modal").modal("hide")}function DisplayPedInteractionModule(e,t){e?(DisplayPedInteractionPrompt(!1),t)?($("#ped-interaction-module").empty(),$("#ped-interaction-module").show(),$("#ped-interaction-module").append(` ${language.InteractionOptions}
${[{id:"identify",label:language.IdentifyDeadPed,explanation:language.IdentifyDeadPedExplanation},{id:"drag",label:language.DragPed,explanation:language.DragPedExplanation},{id:"massivebleeding",label:language.CheckMassiveBleeding,explanation:language.CheckMassiveExplanation},{id:"airway",label:language.CheckAirway,explanation:language.CheckAirwayExplanation},{id:"breathing",label:language.CheckBreathing,explanation:language.CheckBreathingExplanation},{id:"circulation",label:language.CheckCirculation,explanation:language.CheckCirculationExplanation},{id:"hypothermia",label:language.CheckHypothermia,explanation:language.CheckHypothermiaExplanation},{id:"cpr",label:language.PerformCPR,explanation:language.PerformCPRExplanation},{id:"putonstretcher",label:language.PutOnStretcher,explanation:language.PutOnStretcherExplanation},{id:"takeoffstretcher",label:language.TakeOffStretcher,explanation:language.TakeOffStretcherExplanation},{id:"bodybag",label:language.PutInBodyBag,explanation:language.PutInBodyBagExplanation}].map(e=>`
${e.explanation}
`).join("")}
`),["identify","drag","massivebleeding","airway","breathing","circulation","hypothermia","cpr","putonstretcher","takeoffstretcher","bodybag","exit"].forEach(e=>addSoundOnHoverEventListener(`p-btn-${e}`))):($("#ped-interaction-module").empty(),$("#ped-interaction-module").show(),$("#ped-interaction-module").append(`
- ${language.InteractionOptions}
-
-
-
-
- ${[{id:"greet",label:language.Greet,explanation:language.GreetExplanation},{id:"id",label:language.AskForId,explanation:language.AskForIdExplanation},{id:"questioning",label:language.Question,explanation:language.QuestionExplanation},{id:"breathalyze",label:language.Breathalyze,explanation:language.BreathalyzeExplanation},{id:"drugtest",label:language.DrugTest,explanation:language.DrugTestExplanation},{id:"warn",label:language.Warn,explanation:language.WarnExplanation},{id:"fine",label:language.Fine,explanation:language.FineExplanation},{id:"grab",label:language.Grab,explanation:language.GrabExplanation},{id:"getout",label:language.GetOut,explanation:language.GetOutExplanation},{id:"follow",label:language.AskToFollow,explanation:language.AskToFollowExplanation},{id:"wait",label:language.AskToWait,explanation:language.AskToWaitExplanation},{id:"handsup",label:language.HandsUp,explanation:language.HandsUpExplanation},{id:"search",label:language.Search,explanation:language.SearchExplanation},{id:"cuff",label:language.Cuff,explanation:language.CuffExplanation},{id:"putinvehicle",label:language.PutInVehicle,explanation:language.PutInVehicleExplanation}].map(e=>`
-
-
-
-
-
- ${e.explanation}
-
-
- `).join("")}
-
-
-
-
-
-
-
-
-
-
-
-
-
- `),["greet","id","questioning","breathalyze","drugtest","warn","fine","grab","getout","follow","wait","handsup","search","cuff","putinvehicle","end","exit","custody"].forEach(e=>addSoundOnHoverEventListener(`p-btn-${e}`))):$("#ped-interaction-module").hide()}function PedInteraction(e){$.post(`https://${resourceName}/pedInteraction`,JSON.stringify({interactionType:e}))}function addSoundOnHoverEventListener(e){document.getElementById(e).addEventListener("mouseenter",function(){PlayNUISound("generic-sounds","rollover",.5)})}function DisplayPedInteractionPrompt(e,t){e?(hideAllPromptsExceptOne("ped-interaction-prompt"),$("#ped-interaction-prompt").show(),clearTimeout(interactionPromptTimeout),interactionPromptTimeout=setTimeout(function(){$("#ped-interaction-prompt").hide()},1500),$("#ped-interaction-prompt").html(`
- ๐ฌ ${language.Press} ${t} ${language.ToInteract}
- `)):$("#ped-interaction-prompt").hide()}function DisplayInjuredPedInteractionPrompt(e,t){e?(hideAllPromptsExceptOne("injured-ped-prompt"),$("#injured-ped-prompt").show(),clearTimeout(injuredPedPromptTimeout),injuredPedPromptTimeout=setTimeout(function(){$("#injured-ped-prompt").hide()},1500),$("#injured-ped-prompt").html(`
- ๐ฉบ ${language.Press} ${t} ${language.ToPerformCPR}
- `)):$("#injured-ped-prompt").hide()}function DisplayImpoundPrompt(e,t){e?(hideAllPromptsExceptOne("impound-prompt"),$("#impound-prompt").show(),clearTimeout(impoundPromptTimeout),impoundPromptTimeout=setTimeout(function(){$("#impound-prompt").hide()},1500),$("#impound-prompt").html(`
- ๐ ${language.Press} ${t} ${language.ToInteractImpound}
- `)):$("#impound-prompt").hide()}function DisplayGearPrompt(e,t){e?(hideAllPromptsExceptOne("gear-prompt"),$("#gear-prompt").show(),clearTimeout(gearPromptTimeout),gearPromptTimeout=setTimeout(function(){$("#gear-prompt").hide()},1500),$("#gear-prompt").html(`
- ๐ ${language.Press} ${t} ${language.ToInteractGear}
- `)):$("#gear-prompt").hide()}function DisplayStretcherPrompt(e,t){e?(hideAllPromptsExceptOne("stretcher-prompt"),$("#stretcher-prompt").show(),clearTimeout(StretcherPromptTimeout),StretcherPromptTimeout=setTimeout(function(){$("#stretcher-prompt").hide()},1500),$("#stretcher-prompt").html(`
- ๐ฅ ${language.Press} ${t} ${language.ToUseStretcherVeh}
- `)):$("#stretcher-prompt").hide()}function DisplayObjectCleanupPrompt(e,t){e?(hideAllPromptsExceptOne("obj-cleanup-prompt"),$("#obj-cleanup-prompt").show(),clearTimeout(ObjectCleanupPromptTimeout),ObjectCleanupPromptTimeout=setTimeout(function(){$("#obj-cleanup-prompt").hide()},1500),$("#obj-cleanup-prompt").html(`
- ๐งน ${language.Press} ${t} ${language.ToCleanupObject}
- `)):$("#obj-cleanup-prompt").hide()}function DisplayPedIdCard(e,t,a){if(e){hideAllPromptsExceptOne("ped-interaction-id-card"),$("#vehicle-info").hide(),clearTimeout(idCardTimeout),clearTimeout(dbCheckTimeout),$("#ped-interaction-id-card").empty();var n=t.ProfilePicture||"N/A",i=t.FirstName||"N/A",o=t.LastName||"N/A",s=t.DOB||"N/A",l=t.Gender||"N/A",r=t.Email||"N/A",c=t.PhoneNumber||"N/A",d=t.Country||"N/A",u=t.State||"N/A",p=t.City||"N/A",g=t.PostalCode||"N/A",m=t.Address||"N/A";t.AddressType;var b=t.Nationality||"N/A",h=t.FlagsOrMarkers,y=t.License_Car||"N/A",f=t.License_Car_Colour||"text-light",v=t.License_Car_Icon||"fas fa-car",x=t.License_Bike||"N/A",w=t.License_Bike_Colour||"text-light",k=t.License_Bike_Icon||"fas fa-bicycle",C=t.License_Boat||"N/A",P=t.License_Boat_Colour||"text-light",T=t.License_Boat_Icon||"fas fa-ship",I=t.License_Truck||"N/A",S=t.License_Truck_Colour||"text-light",N=t.License_Truck_Icon||"fas fa-truck",R=t.License_Pilot||"N/A",E=t.License_Pilot_Colour||"text-light",A=t.License_Pilot_Icon||"fas fa-plane";$("#ped-interaction-id-card").append(` - ${language.FullName} ${i} ${o}
- ${language.DOB} ${s}
`),$("#ped-interaction-id-card").show(),a&&($("#ped-interaction-id-card").append(` Loading...
${language.RunningDatabaseCheck}
`),dbCheckTimeout=setTimeout(function(){$("#initial-check").remove(),$("#database-check").html(` ${i} ${o}
(${s})
- ${language.Nationality} ${b}
- ${language.Gender} ${l}
- ${language.Address} ${m}, ${p}, ${u} ${g} (${d})
- ${language.Email} ${r} | ${language.PhoneNumber} ${c}
${language.Licenses} ${y} ${x} ${C} ${I} ${R}
${h&&Object.keys(h).some(e=>h[e])?`
${language.FlagsOrMarkers} ${h.armed_and_dangerous?` ${language.armed_and_dangerous}
`:""} ${h.assault?` ${language.assault}
`:""} ${h.burglary?` ${language.burglary}
`:""} ${h.drug_related?` ${language.drug_related}
`:""} ${h.gang_affiliation?` ${language.gang_affiliation}
`:""} ${h.homicide?` ${language.homicide}
`:""} ${h.kidnapping?` ${language.kidnapping}
`:""} ${h.mental_health_issues?` ${language.mental_health_issues}
`:""} ${h.sex_offense?` ${language.sex_offense}
`:""} ${h.terrorism?` ${language.terrorism}
`:""} ${h.theft?` ${language.theft}
`:""} ${h.traffic_violation?` ${language.traffic_violation}
`:""} ${h.wanted_person?` ${language.wanted_person}
`:""} ${h.other?` ${language.other}
`:""} ${h.active_warrant?` ${language.active_warrant}
`:""}
`:""}
`)},3e3)),idCardTimeout=setTimeout(function(){$("#ped-interaction-id-card").hide()},15e3)}else $("#ped-interaction-id-card").hide()}function DisplayVehicleInfo(e,t,a){if(e){hideAllPromptsExceptOne("vehicle-info"),$("#ped-interaction-id-card").hide(),clearTimeout(vehicleInfoTimeout),clearTimeout(vehicleDbCheckTimeout),$("#vehicle-info").empty();var n={vehNetId:t.vehNetId,license_plate:t.license_plate,model:t.model,model_hash:t.model_hash,vehicle_class:t.vehicle_class,vehicle_class_from_name:t.vehicle_class_from_name,color:t.color,color_secondary:t.color_secondary,build_year:t.build_year,tax:t.tax,mot:t.mot,insurance:t.insurance,stolen:t.stolen,bolo:t.bolo,bolo_description:t.bolo_description,owner_name:t.owner_name};$("#vehicle-info").append(` - ${language.VehiclePlate} ${n.license_plate}
- ${language.VehicleModel} ${n.model}
`),$("#vehicle-info").append(` Loading...
${language.RunningDatabaseCheck}
`),$("#vehicle-info").show(),vehicleDbCheckTimeout=setTimeout(function(){$("#vehicle-info-database-check").html(` `)},5e3),vehicleInfoTimeout=setTimeout(function(){$("#vehicle-info").hide()},15e3)}else $("#vehicle-info").hide()}function DisplayPedInventory(e,t){e?(hideAllPromptsExceptOne("ped-interaction-inventory"),clearTimeout(inventoryTimeout),$("#ped-interaction-inventory").empty(),$("#ped-interaction-inventory").append(` ${language.Inventory}
`),$.each(t,function(e,t){var a,n=` | ${t.name} |
`;$("#inventory-table-body").append(n)}),$("#ped-interaction-inventory").show(),inventoryTimeout=setTimeout(function(){$("#ped-interaction-inventory").hide()},15e3)):$("#ped-interaction-inventory").hide()}var listener=!1;function setupButton(e,t,a){let n=document.getElementById(e);$(`#${e}`).html(``),n.addEventListener("mouseenter",()=>PlayNUISound("generic-sounds","rollover",.5)),n.addEventListener("mouseover",()=>{document.getElementById("instruction-text").style.display="block",$("#instruction-text").html(`${a}
`)}),n.addEventListener("mouseout",()=>document.getElementById("instruction-text").style.display="none")}function setupRadialMenu(){if(!listener){listener=!0;let e=[{id:"middle-x",iconClass:"",instruction:language.ExitRadialMenuInstruction,hoverColour:"",function:"ToggleRadialMenu(false)"},{id:"police-transport",iconClass:language.RequestPoliceTransportIcon,instruction:language.RequestPoliceTransportInstruction,hoverColour:"#0057b9",function:"RequestOrCancelPoliceTransport()"},{id:"ambulance-request",iconClass:language.RequestAmbulanceIcon,instruction:language.RequestAmbulanceInstruction,hoverColour:"#ff0000",function:"RequestOrCancelAmbulance()"},{id:"tow-request",iconClass:language.RequestTowIcon,instruction:language.RequestTowInstruction,hoverColour:"#782323",function:"RequestOrCancelTow()"},{id:"taxi-request",iconClass:language.RequestTaxiIcon,instruction:language.RequestTaxiInstruction,hoverColour:"#FF9A18",function:"RequestOrCancelTaxi()"},{id:"road-service-request",iconClass:language.RequestRoadServiceIcon,instruction:language.RequestRoadServiceInstruction,hoverColour:"#ffbf00",function:"RequestOrCancelRoadService()"},{id:"coroner-request",iconClass:language.RequestCoronerIcon,instruction:language.RequestCoronerInstruction,hoverColour:"#3D3D3D",function:"RequestOrCancelCoroner()"},{id:"animal-rescue-request",iconClass:language.RequestAnimalRescueIcon,instruction:language.RequestAnimalRescueInstruction,hoverColour:"#9bde00",function:"RequestOrCancelAnimalRescue()"},{id:"mechanic-request",iconClass:language.RequestMechanicIcon,instruction:language.RequestMechanicInstruction,hoverColour:"#3D3D3D",function:"RequestOrCancelMechanic()"},{id:"fire-request",iconClass:language.RequestFireIcon,instruction:language.RequestFireInstruction,hoverColour:"#3D3D3D",function:"RequestOrCancelFire()"}];$("#circle-menu").html(`
+let resourceName=null,language=null,commands=null,firstnames={},lastnames={},isDisplayingPreCalloutInterface=!1,isDisplayingCalloutInterface=!1,isDragMode=!1,isDragging=!1,dragElement=null,dragOffset={x:0,y:0},isLayoutMode=!1,layoutElements={},visibleLayoutElements=new Set,originalStyles=new Map,layoutBoundaries={left:20,top:20,right:20,bottom:20},snapGrid={enabled:!0,size:10},collisionDetection={enabled:!0},dimensionValidation={enabled:!0};window.addEventListener("message",e=>{let t=e.data;if("playSound"==t.transactionType&&PlayNUISound(t.transactionFolder,t.transactionFile,t.transactionVolume),"init"==t.type&&("undefined"!=typeof $?(resourceName=t.resourcename,language=t.language,commands=t.commands,firstnames=t.firstnames,lastnames=t.lastnames,$.post(`https://${resourceName}/initComplete`,JSON.stringify({complete:!0}))):console.log("Script is still loading...")),"togglecalloutinfo"==t.type&&toggleCalloutInfo(),"toggleUILayoutMode"==t.type&&(console.log("Received toggleUILayoutMode message from Lua"),toggleUILayoutMode()),"emergencyUICleanup"==t.type&&(console.log("Received emergencyUICleanup message from Lua"),emergencyUICleanup()),"ersselectionmenu"==t.type){var a,n,i,o=t.display;ToggleERSSelectionMenu(o,t.permissions)}if("radialmenu"==t.type){var o=t.display;ToggleRadialMenu(o)}if("pursuitradialmenu"==t.type){var o=t.display;TogglePursuitRadialMenu(o)}if("pursuitmode"==t.type){var s,l,o=t.display,r=t.displayhotkeyhint;TogglePursuitModeUI(o,r,t.zoomhotkey,t.backuphotkey)}if("dualsteeringmode"==t.type){var o=t.display;ToggleDualSteeringMode(o)}if("hotkeyhintprompt"==t.type){var o=t.display,c=t.hotkeys,d=t.time;ToggleHotKeyHintPrompt(o,c,language,d)}if("dispatchmessage"==t.type){var u,o=t.display,c=t.hotkeys,g=t.messagetype,p=t.calloutdata,b=t.message,d=t.time;AddMessageToDispatchQueue(o,c,g,p,d,b,t.toggle)}if("calloutprompt"==t.type){var m,o=t.display,p=t.calloutdata,c=t.hotkeys,d=t.time;ToggleCalloutDisplayPrompt(o,c,language,d,p,t.serviceType)}if("calloutpreinterface"==t.type){var o=t.display,c=t.hotkeys,p=t.calloutdata;TogglePreCalloutInterface(o,c,p)}if("calloutinterface"==t.type){var h,y,o=t.display,c=t.hotkeys,f=t.pedCount,v=t.vehicleCount,x=t.objectCount,w=t.propCount,k=t.fireCount,C=t.smokeCount,p=t.calloutdata,I=t.pedOriginalCount,T=t.vehOriginalCount,S=t.objOriginalCount,P=t.propOriginalCount;ToggleCalloutInterface(o,c,f,v,x,w,k,C,p,I,T,S,P,t.fireOriginalCount,t.smokeOriginalCount)}if("unifiedprompt"==t.type){var o=t.display,E=t.promptType,R=t.hotkey,b=t.message,d=t.time;DisplayUnifiedPrompt(o,E,R,b,d)}if("interactionmodule"==t.type){var N,A,o=t.display;DisplayPedInteractionModule(o,t.ispeddeadordying,t.service)}if("idcardprompt"==t.type){var M,_,o=t.display;DisplayPedIdCard(o,t.pedpersonaldata,t.showdatabasecheck)}if("inventoryprompt"==t.type){var q,o=t.display;DisplayPedInventory(o,t.itemlist)}if("vehicleinfoprompt"==t.type){var D,O,o=t.display;DisplayVehicleInfo(o,t.vehicleData,t.DisableTaxAndMOT)}if("togglequestionsmodule"==t.type){var L,o=t.display;ToggleQuestionsModule(o,t.questions)}if("updateanswers"==t.type){var B,o=t.display;UpdateAnswers(o,t.answers)}if("addorremovewaypoint"==t.type&&AddWaypoint(t.addwaypoint),"updatewaypoint"==t.type){var U,j,F,G=t.scaleX;UpdateWaypointPosition(G,t.scaleY,t.distanceText)}if("areyousure"==t.type){var o=t.display;DisplayAreYouSurePopup(o)}if("gearmenu"==t.type){var W,o=t.display;DisplayGearMenu(o,t.locationdata)}if("updatezonechange"==t.type){UpdateZoneChangeUI(t.lastZone,t.currentZone)}"updatewaypoints"===t.type&&updateWaypoints(t)});var unifiedPromptTimeout,idCardTimeout,dbCheckTimeout,vehicleInfoTimeout,vehicleDbCheckTimeout,inventoryTimeout,zoneChangeTimeout=null;let zoneChangeQueue=[],isAnimating=!1;function UpdateZoneChangeUI(e,t){zoneChangeQueue.push({oldZone:e,newZone:t}),isAnimating||processNextZoneChange()}function processNextZoneChange(){if(0===zoneChangeQueue.length){isAnimating=!1;return}isAnimating=!0;let{oldZone:e,newZone:t}=zoneChangeQueue.shift(),a=document.getElementById("zone-change-ui");if(!a){processNextZoneChange();return}let n=a.querySelector(".old-zone"),i=a.querySelector(".new-zone");if(!n||!i){processNextZoneChange();return}zoneChangeTimeout&&clearTimeout(zoneChangeTimeout),a.classList.remove("show"),i.classList.remove("show"),n.textContent=e||"N/A",i.textContent=t||"N/A",a.offsetWidth,a.classList.add("show"),i.classList.add("show"),zoneChangeTimeout=setTimeout(()=>{a.classList.remove("show"),i.classList.remove("show"),setTimeout(processNextZoneChange,500)},4e3)}let escapeEventListenerAdded=!1;function DisplayAreYouSurePopup(e){if(e){$("#are-you-sure-modal").remove();let t=` ${language.CompletingCalloutCannotBeUndone}
`;$("body").append(t),$("#are-you-sure-modal").modal({backdrop:"static",keyboard:!1}),$("#are-you-sure-modal").modal("show"),$("#are-you-sure-modal").on("shown.bs.modal",function(){escapeEventListenerAdded||($(document).on("keydown",function(e){"Escape"===e.key&&($("#are-you-sure-modal").modal("hide"),handleNoClick(),e.stopPropagation())}),escapeEventListenerAdded=!0)}).on("hidden.bs.modal",function(){$(document).off("keydown"),escapeEventListenerAdded=!1})}else $("#are-you-sure-modal").remove()}function handleNoClick(){$.post(`https://${resourceName}/AreYouSure`,JSON.stringify({areyousure:!1})),$("#are-you-sure-modal").modal("hide")}function handleYesClick(){$.post(`https://${resourceName}/AreYouSure`,JSON.stringify({areyousure:!0})),$("#are-you-sure-modal").modal("hide")}function DisplayPedInteractionModule(e,t,a){if(e){if(DisplayUnifiedPrompt(!1),t)$("#ped-interaction-module").empty(),$("#ped-interaction-module").show(),$("#ped-interaction-module").append(` ${language.InteractionOptions}
${[{id:"identify",label:language.IdentifyDeadPed,explanation:language.IdentifyDeadPedExplanation},{id:"drag",label:language.DragPed,explanation:language.DragPedExplanation},{id:"massivebleeding",label:language.CheckMassiveBleeding,explanation:language.CheckMassiveExplanation},{id:"airway",label:language.CheckAirway,explanation:language.CheckAirwayExplanation},{id:"breathing",label:language.CheckBreathing,explanation:language.CheckBreathingExplanation},{id:"circulation",label:language.CheckCirculation,explanation:language.CheckCirculationExplanation},{id:"hypothermia",label:language.CheckHypothermia,explanation:language.CheckHypothermiaExplanation},{id:"cpr",label:language.PerformCPR,explanation:language.PerformCPRExplanation},{id:"putonstretcher",label:language.PutOnStretcher,explanation:language.PutOnStretcherExplanation},{id:"takeoffstretcher",label:language.TakeOffStretcher,explanation:language.TakeOffStretcherExplanation},{id:"bodybag",label:language.PutInBodyBag,explanation:language.PutInBodyBagExplanation}].map(e=>`
${e.explanation}
`).join("")}
`),applySavedPosition("ped-interaction-module"),["identify","drag","massivebleeding","airway","breathing","circulation","hypothermia","cpr","putonstretcher","takeoffstretcher","bodybag","exit"].forEach(e=>addSoundOnHoverEventListener(`p-btn-${e}`));else{$("#ped-interaction-module").empty(),$("#ped-interaction-module").show();var n={police:[{id:"greet",label:language.Greet,explanation:language.GreetExplanation},{id:"id",label:language.AskForId,explanation:language.AskForIdExplanation},{id:"questioning",label:language.Question,explanation:language.QuestionExplanation},{id:"breathalyze",label:language.Breathalyze,explanation:language.BreathalyzeExplanation},{id:"drugtest",label:language.DrugTest,explanation:language.DrugTestExplanation},{id:"warn",label:language.Warn,explanation:language.WarnExplanation},{id:"fine",label:language.Fine,explanation:language.FineExplanation},{id:"grab",label:language.Grab,explanation:language.GrabExplanation},{id:"getout",label:language.GetOut,explanation:language.GetOutExplanation},{id:"follow",label:language.AskToFollow,explanation:language.AskToFollowExplanation},{id:"wait",label:language.AskToWait,explanation:language.AskToWaitExplanation},{id:"handsup",label:language.HandsUp,explanation:language.HandsUpExplanation},{id:"search",label:language.Search,explanation:language.SearchExplanation},{id:"cuff",label:language.Cuff,explanation:language.CuffExplanation},{id:"putinvehicle",label:language.PutInVehicle,explanation:language.PutInVehicleExplanation}],ambulance:[{id:"greet",label:language.Greet,explanation:language.GreetExplanation},{id:"questioning",label:language.Question,explanation:language.QuestionExplanation},{id:"breathalyze",label:language.Breathalyze,explanation:language.BreathalyzeExplanation},{id:"drugtest",label:language.DrugTest,explanation:language.DrugTestExplanation},{id:"getout",label:language.GetOut,explanation:language.GetOutExplanation},{id:"follow",label:language.AskToFollow,explanation:language.AskToFollowExplanation},{id:"wait",label:language.AskToWait,explanation:language.AskToWaitExplanation},{id:"putinvehicle",label:language.PutInVehicle,explanation:language.PutInVehicleExplanation}],fire:[{id:"greet",label:language.Greet,explanation:language.GreetExplanation},{id:"questioning",label:language.Question,explanation:language.QuestionExplanation},{id:"breathalyze",label:language.Breathalyze,explanation:language.BreathalyzeExplanation},{id:"drugtest",label:language.DrugTest,explanation:language.DrugTestExplanation},{id:"getout",label:language.GetOut,explanation:language.GetOutExplanation},{id:"follow",label:language.AskToFollow,explanation:language.AskToFollowExplanation},{id:"wait",label:language.AskToWait,explanation:language.AskToWaitExplanation},{id:"putinvehicle",label:language.PutInVehicle,explanation:language.PutInVehicleExplanation}],tow:[{id:"greet",label:language.Greet,explanation:language.GreetExplanation},{id:"questioning",label:language.Question,explanation:language.QuestionExplanation},{id:"getout",label:language.GetOut,explanation:language.GetOutExplanation},{id:"follow",label:language.AskToFollow,explanation:language.AskToFollowExplanation},{id:"wait",label:language.AskToWait,explanation:language.AskToWaitExplanation},{id:"putinvehicle",label:language.PutInVehicle,explanation:language.PutInVehicleExplanation}]};$("#ped-interaction-module").append(` ${language.InteractionOptions}
${(n[a]||n.police).map(e=>`
${e.explanation}
`).join("")}
${"police"===a?``:""}
`);let i=n[a]||n.police,o=[...i.map(e=>e.id),"end","exit",..."police"===a?["custody"]:[]];o.forEach(e=>addSoundOnHoverEventListener(`p-btn-${e}`)),applySavedPosition("ped-interaction-module")}}else $("#ped-interaction-module").hide()}function PedInteraction(e){$.post(`https://${resourceName}/pedInteraction`,JSON.stringify({interactionType:e}))}function addSoundOnHoverEventListener(e){document.getElementById(e).addEventListener("mouseenter",function(){PlayNUISound("generic-sounds","rollover",.5)})}function DisplayUnifiedPrompt(e,t,a,n,i){if(e){$("#unified-prompt").show(),applySavedPosition("unified-prompt"),clearTimeout(unifiedPromptTimeout);let o={pedinteraction:{icon:"\uD83D\uDCAC",color:"text-warning",text:language.ToInteract,timeout:1500},injuredped:{icon:"\uD83E\uDE7A",color:"text-danger",text:language.ToPerformCPR,timeout:1500},impound:{icon:"\uD83D\uDE97",color:"text-danger",text:language.ToInteractImpound,timeout:1500},gear:{icon:"\uD83D\uDE97",color:"text-danger",text:language.ToInteractGear,timeout:1500},stretcher:{icon:"\uD83C\uDFE5",color:"text-info",text:language.ToUseStretcherVeh,timeout:1500},objectcleanup:{icon:"\uD83E\uDDF9",color:"text-success",text:language.ToCleanupObject,timeout:1500},spikesvehicle:{icon:"\uD83D\uDCA2",color:"text-warning",text:n||"",timeout:i||1500}},s=o[t]||o.pedinteraction;$("#unified-prompt").html(`
+ ${s.icon} ${language.Press} ${a} ${s.text}
+ `),unifiedPromptTimeout=setTimeout(function(){$("#unified-prompt").hide()},s.timeout)}else $("#unified-prompt").hide()}function DisplayPedIdCard(e,t,a){if(e){$("#vehicle-info").hide(),$("#ped-interaction-inventory").hide(),clearTimeout(idCardTimeout),clearTimeout(dbCheckTimeout),$("#ped-interaction-id-card").empty();var n=t.ProfilePicture||"N/A",i=t.FirstName||"N/A",o=t.LastName||"N/A",s=t.DOB||"N/A",l=t.Gender||"N/A",r=t.Email||"N/A",c=t.PhoneNumber||"N/A",d=t.Country||"N/A",u=t.State||"N/A",g=t.City||"N/A",p=t.PostalCode||"N/A",b=t.Address||"N/A";t.AddressType;var m=t.Nationality||"N/A",h=t.FlagsOrMarkers,y=t.License_Car||"N/A",f=t.License_Car_Colour||"text-light",v=t.License_Car_Icon||"fas fa-car",x=t.License_Bike||"N/A",w=t.License_Bike_Colour||"text-light",k=t.License_Bike_Icon||"fas fa-bicycle",C=t.License_Boat||"N/A",I=t.License_Boat_Colour||"text-light",T=t.License_Boat_Icon||"fas fa-ship",S=t.License_Truck||"N/A",P=t.License_Truck_Colour||"text-light",E=t.License_Truck_Icon||"fas fa-truck",R=t.License_Pilot||"N/A",N=t.License_Pilot_Colour||"text-light",A=t.License_Pilot_Icon||"fas fa-plane";$("#ped-interaction-id-card").append(` - ${language.FullName} ${i} ${o}
- ${language.DOB} ${s}
`),$("#ped-interaction-id-card").show(),applySavedPosition("ped-interaction-id-card"),a&&($("#ped-interaction-id-card").append(` Loading...
${language.RunningDatabaseCheck}
`),dbCheckTimeout=setTimeout(function(){$("#initial-check").remove(),$("#database-check").html(` ${i} ${o}
(${s})
- ${language.Nationality} ${m}
- ${language.Gender} ${l}
- ${language.Address} ${b}, ${g}, ${u} ${p} (${d})
- ${language.Email} ${r} | ${language.PhoneNumber} ${c}
${language.Licenses} ${y} ${x} ${C} ${S} ${R}
${h&&Object.keys(h).some(e=>h[e])?`
${language.FlagsOrMarkers} ${h.armed_and_dangerous?` ${language.armed_and_dangerous}
`:""} ${h.assault?` ${language.assault}
`:""} ${h.burglary?` ${language.burglary}
`:""} ${h.drug_related?` ${language.drug_related}
`:""} ${h.gang_affiliation?` ${language.gang_affiliation}
`:""} ${h.homicide?` ${language.homicide}
`:""} ${h.kidnapping?` ${language.kidnapping}
`:""} ${h.mental_health_issues?` ${language.mental_health_issues}
`:""} ${h.sex_offense?` ${language.sex_offense}
`:""} ${h.terrorism?` ${language.terrorism}
`:""} ${h.theft?` ${language.theft}
`:""} ${h.traffic_violation?` ${language.traffic_violation}
`:""} ${h.wanted_person?` ${language.wanted_person}
`:""} ${h.other?` ${language.other}
`:""} ${h.active_warrant?` ${language.active_warrant}
`:""}
`:""}
`)},3e3)),idCardTimeout=setTimeout(function(){$("#ped-interaction-id-card").hide()},15e3)}else $("#ped-interaction-id-card").hide()}function DisplayVehicleInfo(e,t,a){if(e){$("#ped-interaction-id-card").hide(),$("#ped-interaction-inventory").hide(),clearTimeout(vehicleInfoTimeout),clearTimeout(vehicleDbCheckTimeout),$("#vehicle-info").empty();var n={vehNetId:t.vehNetId,license_plate:t.license_plate,model:t.model,model_hash:t.model_hash,vehicle_class:t.vehicle_class,vehicle_class_from_name:t.vehicle_class_from_name,color:t.color,color_secondary:t.color_secondary,build_year:t.build_year,tax:t.tax,mot:t.mot,insurance:t.insurance,stolen:t.stolen,bolo:t.bolo,bolo_description:t.bolo_description,owner_name:t.owner_name};$("#vehicle-info").append(` - ${language.VehiclePlate} ${n.license_plate}
- ${language.VehicleModel} ${n.model}
`),$("#vehicle-info").append(` Loading...
${language.RunningDatabaseCheck}
`),$("#vehicle-info").show(),applySavedPosition("vehicle-info"),vehicleDbCheckTimeout=setTimeout(function(){$("#vehicle-info-database-check").html(` `)},5e3),vehicleInfoTimeout=setTimeout(function(){$("#vehicle-info").hide()},15e3)}else $("#vehicle-info").hide()}function DisplayPedInventory(e,t){e?($("#ped-interaction-id-card").hide(),$("#vehicle-info").hide(),clearTimeout(inventoryTimeout),$("#ped-interaction-inventory").empty(),$("#ped-interaction-inventory").append(` ${language.Inventory}
`),$.each(t,function(e,t){var a,n=` | ${t.name} |
`;$("#inventory-table-body").append(n)}),$("#ped-interaction-inventory").show(),applySavedPosition("ped-interaction-inventory"),inventoryTimeout=setTimeout(function(){$("#ped-interaction-inventory").hide()},15e3)):$("#ped-interaction-inventory").hide()}var listener=!1;function setupButton(e,t,a){let n=document.getElementById(e);$(`#${e}`).html(``),n.addEventListener("mouseenter",()=>PlayNUISound("generic-sounds","rollover",.5)),n.addEventListener("mouseover",()=>{document.getElementById("instruction-text").style.display="block",$("#instruction-text").html(`${a}
`)}),n.addEventListener("mouseout",()=>document.getElementById("instruction-text").style.display="none")}function setupRadialMenu(){if(!listener){listener=!0;let e=[{id:"middle-x",iconClass:"",instruction:language.ExitRadialMenuInstruction,hoverColour:"",function:"ToggleRadialMenu(false)"},{id:"police-transport",iconClass:language.RequestPoliceTransportIcon,instruction:language.RequestPoliceTransportInstruction,hoverColour:"#0057b9",function:"RequestOrCancelPoliceTransport()"},{id:"ambulance-request",iconClass:language.RequestAmbulanceIcon,instruction:language.RequestAmbulanceInstruction,hoverColour:"#ff0000",function:"RequestOrCancelAmbulance()"},{id:"tow-request",iconClass:language.RequestTowIcon,instruction:language.RequestTowInstruction,hoverColour:"#782323",function:"RequestOrCancelTow()"},{id:"taxi-request",iconClass:language.RequestTaxiIcon,instruction:language.RequestTaxiInstruction,hoverColour:"#FF9A18",function:"RequestOrCancelTaxi()"},{id:"road-service-request",iconClass:language.RequestRoadServiceIcon,instruction:language.RequestRoadServiceInstruction,hoverColour:"#ffbf00",function:"RequestOrCancelRoadService()"},{id:"coroner-request",iconClass:language.RequestCoronerIcon,instruction:language.RequestCoronerInstruction,hoverColour:"#3D3D3D",function:"RequestOrCancelCoroner()"},{id:"animal-rescue-request",iconClass:language.RequestAnimalRescueIcon,instruction:language.RequestAnimalRescueInstruction,hoverColour:"#9bde00",function:"RequestOrCancelAnimalRescue()"},{id:"mechanic-request",iconClass:language.RequestMechanicIcon,instruction:language.RequestMechanicInstruction,hoverColour:"#3D3D3D",function:"RequestOrCancelMechanic()"},{id:"fire-request",iconClass:language.RequestFireIcon,instruction:language.RequestFireInstruction,hoverColour:"#3D3D3D",function:"RequestOrCancelFire()"}];$("#circle-menu").html(`
${e.slice(1).map(e=>` `).join("")}
@@ -54,11 +15,9 @@ let resourceName=null,language=null,commands=null,firstnames={},lastnames={},isD
${language.DispatchMessage}
- `);return}"response"==a||"arrival"==a?("response"==a&&$.post(`https://${resourceName}/offerToTrackPlayer`,JSON.stringify({calloutdata:n})),$("#dispatch-message-prompt-container").empty().show().append(` ${wrapText(i,50)}
| ${language.Caller} | ${wrapText(`${n.FirstName} ${n.LastName}`,50)} |
| ${language.CallDescription} | ${wrapText(n.Description??"N/A",50)} |
| ${language.Location} | ${wrapText(n.StreetName??"N/A",50)} |
| ${language.Postal} | ${wrapText(n.Postal??"N/A",50)} |
| ${language.CalloutUnitsRequired} | ${wrapText(n.CalloutUnitsRequired?.description??"N/A",50)} |
| ${language.DispatchNote} | ${wrapText(language.DispatchNoteResponseText??"N/A",50)} |
`),"response"==a&&$("#dispatch-message-prompt-container").append(` `)):$("#dispatch-message-prompt-container").empty().show().append(` `)}function StartCountdownTimer(e){var t=e/1e3;let a=`${language.NextDispatchMessage} ${t} ${language.Seconds}...`;$("#countdown-timer").html(`${wrapText(a,70)}
`);var n=setInterval(function(){--t>=0?$("#countdown-timer").html(`${wrapText(`${language.NextDispatchMessage} ${t} ${language.Seconds}...`,70)}
`):(clearInterval(n),$("#countdown-timer").html(`${wrapText("Time's up!",70)}
`))},1e3)}function ToggleHotKeyHintPrompt(e,t,a,n){e?($("#prompt-container").empty(),$("#prompt-container").show(),$("#prompt-container").append(` ${a.HotKeys} | ${a.Explanation} |
`),setTimeout(function(){$("#prompt-container").hide(),$.post(`https://${resourceName}/reallowPromptMessages`,JSON.stringify({}))},n)):($("#prompt-container").empty(),$("#prompt-container").hide())}function SelectBackGroundColourByServiceType(e){var t="bg-primary",a="border-primary",n="btn-outline-primary",i="text-light";return"police"==e?(t="bg-primary",a="border-primary",n="btn-outline-primary",i="text-light"):"ambulance"==e?(t="bg-success",a="border-success",n="btn-outline-success",i="text-light"):"fire"==e?(t="bg-danger",a="border-danger",n="btn-outline-danger",i="text-light"):"tow"==e&&(t="bg-warning",a="border-warning",n="btn-outline-warning",i="text-light"),{backgroundColor:t,borderColor:a,textColor:i,buttonOutlineColor:n}}function ToggleCalloutDisplayPrompt(e,t,a,n,i,o){var s=n/1e3,{backgroundColor:l,borderColor:r,textColor:c,buttonOutlineColor:d}=SelectBackGroundColourByServiceType(o);e?($("#callout-prompt-container").empty(),$("#callout-prompt-container").show(),$("#callout-prompt-container").append(` | ${a.Caller} | ${wrapText(`${i.FirstName} ${i.LastName}`,50)} |
| ${a.CallDescription} | ${wrapText(i.Description??"N/A",50)} |
| ${a.Location} | ${wrapText(i.StreetName??"N/A",50)} |
| ${a.Postal} | ${wrapText(i.Postal??"N/A",50)} |
| ${a.CalloutUnitsRequired} | ${wrapText(i.CalloutUnitsRequired?.description??"N/A",50)} |
| ${a.DispatchNote} | ${wrapText(a.DispatchNoteResponseText??"N/A",50)} |
`),clearInterval(window.countdownInterval),s--,window.countdownInterval=setInterval(function(){s>0?($("#callout-prompt-container").find("#countdown-text").html(` ${a.TimeRemainingToAcceptCallout} ${s} ${a.Seconds}... `),s--):(clearInterval(window.countdownInterval),$("#callout-prompt-container").hide(),$.post(`https://${resourceName}/calloutTimeout`,JSON.stringify({})))},1e3)):($("#callout-prompt-container").empty(),$("#callout-prompt-container").hide())}function ToggleCalloutInterface(e,t,a,n,i,o,s,l,r,c,d,u,p,g,m){isDisplayingCalloutInterface=e,e?($("#callout-interface-container").empty().addClass("slideInFromLeft"),$("#callout-interface-container").show(),$("#callout-interface-container").append(` แฏฝ ${r.CalloutName}
${a>0?` | โก ${language.InvolvedPedsRemaining} | ${a}/${c} |
`:""} ${n>0?` | โก ${language.InvolvedVehsRemaining} | ${n}/${d} |
`:""} ${i>0?` | โก ${language.InvolvedObjsRemaining} | ${i}/${u} |
`:""} ${o>0?` | โก ${language.InvolvedPropsRemaining} | ${o}/${p} |
`:""} ${s>0?` | โก ${language.ExtinguishAllFires} | ${s}/${g} |
`:""} ${l>0?` | โก ${language.ClearAreaOfSmoke} | ${l}/${m} |
`:""}
${language.Press} ${t.ToggleCalloutInfo} ${language.ToHideOrShow}
`)):($("#callout-interface-container").empty(),$("#callout-interface-container").hide())}function TogglePreCalloutInterface(e,t,a){isDisplayingPreCalloutInterface=e,e?($("#callout-pre-interface-container").empty().addClass("slideInFromLeft"),$("#callout-pre-interface-container").show(),$("#callout-pre-interface-container").append(` แฏฝ ${wrapText(`${language.EmergencyCall} (${a?.CalloutName??"N/A"})`,40)}
โก ${language.Caller} ${wrapText(`${a?.FirstName??"N/A"} ${a?.LastName??"N/A"}`,70)} |
โก ${language.CallDescription} ${wrapText(a?.Description??"N/A",70)} |
โก ${language.Location} ${wrapText(a?.StreetName??"N/A",70)} |
โก ${language.Postal} ${wrapText(a?.Postal??"N/A",70)} |
โก ${language.CalloutUnitsRequired} ${wrapText(a?.CalloutUnitsRequired?.description??"N/A",70)} |
โก ${language.DispatchNote} ${wrapText(language.DispatchNoteResponseText,70)} |
${language.Press} ${t.ToggleCalloutInfo} ${language.ToHideOrShow}
`)):($("#callout-pre-interface-container").empty(),$("#callout-pre-interface-container").hide())}let Waypoints=[];function UpdateWaypointPosition(e,t,a){if(null==Waypoints[0]){$("#waypoint-container").hide();return}let n=document.getElementById("waypoint-container");$("#waypoint-distance").empty(),$("#waypoint-container").show(),$("#waypoint-distance").append(`
+ `),applySavedPosition("dispatch-message-prompt-container");return}"response"==a||"arrival"==a?("response"==a&&$.post(`https://${resourceName}/offerToTrackPlayer`,JSON.stringify({calloutdata:n})),$("#dispatch-message-prompt-container").empty().show().append(` ${wrapText(i,50)}
| ${language.Caller} | ${wrapText(`${n.FirstName} ${n.LastName}`,50)} |
| ${language.CallDescription} | ${wrapText(n.Description??"N/A",50)} |
| ${language.Location} | ${wrapText(n.StreetName??"N/A",50)} |
| ${language.Postal} | ${wrapText(n.Postal??"N/A",50)} |
| ${language.CalloutUnitsRequired} | ${wrapText(n.CalloutUnitsRequired?.description??"N/A",50)} |
| ${language.DispatchNote} | ${wrapText(language.DispatchNoteResponseText??"N/A",50)} |
`),applySavedPosition("dispatch-message-prompt-container"),"response"==a&&$("#dispatch-message-prompt-container").append(` `)):($("#dispatch-message-prompt-container").empty().show().append(` `),applySavedPosition("dispatch-message-prompt-container"))}function StartCountdownTimer(e){var t=e/1e3;let a=`${language.NextDispatchMessage} ${t} ${language.Seconds}...`;$("#countdown-timer").html(`${wrapText(a,70)}
`);var n=setInterval(function(){--t>=0?$("#countdown-timer").html(`${wrapText(`${language.NextDispatchMessage} ${t} ${language.Seconds}...`,70)}
`):(clearInterval(n),$("#countdown-timer").html(`${wrapText("Time's up!",70)}
`))},1e3)}function ToggleHotKeyHintPrompt(e,t,a,n){e?($("#hint-prompt-container").empty(),$("#hint-prompt-container").show(),applySavedPosition("hint-prompt-container"),$("#hint-prompt-container").append(` ${a.HotKeys} | ${a.Explanation} |
`),setTimeout(function(){$("#hint-prompt-container").hide(),$.post(`https://${resourceName}/reallowPromptMessages`,JSON.stringify({}))},n)):($("#hint-prompt-container").empty(),$("#hint-prompt-container").hide())}function SelectBackGroundColourByServiceType(e){var t="bg-primary",a="border-primary",n="btn-outline-primary",i="text-light";return"police"==e?(t="bg-primary",a="border-primary",n="btn-outline-primary",i="text-light"):"ambulance"==e?(t="bg-success",a="border-success",n="btn-outline-success",i="text-light"):"fire"==e?(t="bg-danger",a="border-danger",n="btn-outline-danger",i="text-light"):"tow"==e&&(t="bg-warning",a="border-warning",n="btn-outline-warning",i="text-light"),{backgroundColor:t,borderColor:a,textColor:i,buttonOutlineColor:n}}function ToggleCalloutDisplayPrompt(e,t,a,n,i,o){var s=n/1e3,{backgroundColor:l,borderColor:r,textColor:c,buttonOutlineColor:d}=SelectBackGroundColourByServiceType(o);e?($("#callout-prompt-container").empty(),$("#callout-prompt-container").show(),$("#callout-prompt-container").append(` | ${a.Caller} | ${wrapText(`${i.FirstName} ${i.LastName}`,50)} |
| ${a.CallDescription} | ${wrapText(i.Description??"N/A",50)} |
| ${a.Location} | ${wrapText(i.StreetName??"N/A",50)} |
| ${a.Postal} | ${wrapText(i.Postal??"N/A",50)} |
| ${a.CalloutUnitsRequired} | ${wrapText(i.CalloutUnitsRequired?.description??"N/A",50)} |
| ${a.DispatchNote} | ${wrapText(a.DispatchNoteResponseText??"N/A",50)} |
`),applySavedPosition("callout-prompt-container"),clearInterval(window.countdownInterval),s--,window.countdownInterval=setInterval(function(){s>0?($("#callout-prompt-container").find("#countdown-text").html(` ${a.TimeRemainingToAcceptCallout} ${s} ${a.Seconds}... `),s--):(clearInterval(window.countdownInterval),$("#callout-prompt-container").hide(),$.post(`https://${resourceName}/calloutTimeout`,JSON.stringify({})))},1e3)):($("#callout-prompt-container").empty(),$("#callout-prompt-container").hide())}function ToggleCalloutInterface(e,t,a,n,i,o,s,l,r,c,d,u,g,p,b){isDisplayingCalloutInterface=e,e?($("#callout-interface-container").empty().addClass("slideInFromLeft"),$("#callout-interface-container").show(),$("#callout-interface-container").append(` แฏฝ ${r.CalloutName}
${a>0?` | โก ${language.InvolvedPedsRemaining} | ${a}/${c} |
`:""} ${n>0?` | โก ${language.InvolvedVehsRemaining} | ${n}/${d} |
`:""} ${i>0?` | โก ${language.InvolvedObjsRemaining} | ${i}/${u} |
`:""} ${o>0?` | โก ${language.InvolvedPropsRemaining} | ${o}/${g} |
`:""} ${s>0?` | โก ${language.ExtinguishAllFires} | ${s}/${p} |
`:""} ${l>0?` | โก ${language.ClearAreaOfSmoke} | ${l}/${b} |
`:""}
${language.Press} ${t.ToggleCalloutInfo} ${language.ToHideOrShow}
`),applySavedPosition("callout-interface-container")):($("#callout-interface-container").empty(),$("#callout-interface-container").hide())}function TogglePreCalloutInterface(e,t,a){isDisplayingPreCalloutInterface=e,e?($("#callout-pre-interface-container").empty().addClass("slideInFromLeft"),$("#callout-pre-interface-container").show(),$("#callout-pre-interface-container").append(` แฏฝ ${wrapText(`${language.EmergencyCall} (${a?.CalloutName??"N/A"})`,40)}
โก ${language.Caller} ${wrapText(`${a?.FirstName??"N/A"} ${a?.LastName??"N/A"}`,70)} |
โก ${language.CallDescription} ${wrapText(a?.Description??"N/A",70)} |
โก ${language.Location} ${wrapText(a?.StreetName??"N/A",70)} |
โก ${language.Postal} ${wrapText(a?.Postal??"N/A",70)} |
โก ${language.CalloutUnitsRequired} ${wrapText(a?.CalloutUnitsRequired?.description??"N/A",70)} |
โก ${language.DispatchNote} ${wrapText(language.DispatchNoteResponseText,70)} |
${language.Press} ${t.ToggleCalloutInfo} ${language.ToHideOrShow}
`),applySavedPosition("callout-pre-interface-container")):($("#callout-pre-interface-container").empty(),$("#callout-pre-interface-container").hide())}let Waypoints=[];function UpdateWaypointPosition(e,t,a){if(null==Waypoints[0]){$("#waypoint-container").hide();return}let n=document.getElementById("waypoint-container");$("#waypoint-distance").empty(),$("#waypoint-container").show(),$("#waypoint-distance").append(`
แฏฝ ${a}
- `);let i=window.innerWidth,o=window.innerHeight,s=n.getBoundingClientRect(),l=s.width,r=s.height;n.style.left=(i-l)*e+"px",n.style.top=(o-r)*t+"px"}function AddWaypoint(e){let t=document.getElementById("waypoint-container");e?Waypoints.push({element:t}):($("#waypoint-container").hide(),Waypoints=[])}let escapeEventListenerAddedERSSelectionMenu=!1,menuSoundInstance=null;function ToggleERSSelectionMenu(e,t){if(e){let a=t.isPolice,n=t.isAmbulance,i=t.isFire,o=t.isTow;fadeOutMenuMusic(menuSoundInstance),menuSoundInstance=PlayNUISound("generic-sounds","selectionmenu",.5);let s=`
${language.PoliceDescription}
${language.AmbulanceDescription}
${language.FireDescription}
${language.TowDescription}
`;$("body").append(s),$("#ers-selection-modal").modal({backdrop:"static",keyboard:!1}),$("#ers-selection-modal").modal("show");for(var l=1;l<=6;l++)addSoundOnHoverEventListener("s-btn-"+l);$("#ers-selection-modal").on("shown.bs.modal",function(){escapeEventListenerAddedERSSelectionMenu||($(document).on("keydown",function(e){"Escape"===e.key&&(fadeOutMenuMusic(menuSoundInstance),$("#ers-selection-modal").modal("hide"),CancelServiceSelection(),e.stopPropagation())}),escapeEventListenerAddedERSSelectionMenu=!0)}).on("hidden.bs.modal",function(){$(document).off("keydown"),escapeEventListenerAddedERSSelectionMenu=!1})}else $("#ers-selection-modal").modal("hide").on("hidden.bs.modal",function(){fadeOutMenuMusic(menuSoundInstance),$(this).remove()})}function CancelServiceSelection(){$.post(`https://${resourceName}/cancelServiceSelection`,JSON.stringify({})),$("#ers-selection-modal").modal("hide").on("hidden.bs.modal",function(){fadeOutMenuMusic(menuSoundInstance),$(this).data("bs.modal",null),$(this).remove()})}function SelectService(e){$.post(`https://${resourceName}/selectedService`,JSON.stringify({service:e})),$("#ers-selection-modal").modal("hide").on("hidden.bs.modal",function(){fadeOutMenuMusic(menuSoundInstance),$(this).data("bs.modal",null),$(this).remove()})}function fadeOutMenuMusic(e){null!==e&&(e.fade(e.volume(),0,5e3),setTimeout(function(){e.stop()},5e3))}let escapeEventListenerAddedERSGearnMenu=!1;function DisplayGearMenu(e,t){if(e){fadeOutMenuMusic(menuSoundInstance),menuSoundInstance=PlayNUISound("generic-sounds","selectionmenu",.5);let a=` `;$("body").append(a);var n=t.ClothingData;let i=function e(t){switch(t){case"police":return"primary";case"fire":return"danger";case"ambulance":return"warning";case"tow":return"info";default:return"secondary"}}(t.ServiceType);$.each(n,function(e,a){let n=encodeURIComponent(JSON.stringify(t));$("#gear-options").append(` `)}),$("#ers-gear-modal").modal({backdrop:"static",keyboard:!1}),$("#ers-gear-modal").modal("show");for(var o=0;o๐ข ${language.Press} ${t} ${a}
- `),$("#spikes-vehicle-prompt").show(),spikesVehiclePromptTimeout=setTimeout(function(){$("#spikes-vehicle-prompt").hide()},n)):$("#spikes-vehicle-prompt").hide()}const containerIDs={preCallout:"#callout-pre-interface-container",callout:"#callout-interface-container"};function slideOut(e){$(e).removeClass("slideInFromLeft").addClass("slideOutToLeft"),setTimeout(()=>$(e).hide(),250)}function slideIn(e){$(e).show().removeClass("slideOutToLeft").addClass("slideInFromLeft")}function toggleCalloutInfo(){if(isDisplayingPreCalloutInterface){let e=containerIDs.preCallout;$(e).is(":visible")?slideOut(e):slideIn(e)}if(isDisplayingCalloutInterface){let t=containerIDs.callout;$(t).is(":visible")?slideOut(t):slideIn(t)}}function updateWaypoints(e){let t=e.data,a=trackExistingUnitWaypoints();for(let[n,i]of Object.entries(t))null!==i&&i.distanceText>0&&processUnitWaypoint(n,i,a);removeUnusedUnitWaypoints(a)}function trackExistingUnitWaypoints(){let e=new Set;return document.querySelectorAll(".unit-waypoint-container").forEach(t=>{e.add(t.id)}),e}function processUnitWaypoint(e,t,a){let n=`unit-waypoint-container-${e}`,i=document.getElementById(n);i||(i=createUnitWaypointContainer(n)),updateUnitWaypointPosition(i,t),updateUnitWaypointContent(i,t),a.delete(n)}function createUnitWaypointContainer(e){let t=document.createElement("div");return t.classList.add("unit-waypoint-container","smooth-transition"),t.id=e,document.body.appendChild(t),t}function updateUnitWaypointPosition(e,t){let a=window.innerWidth,n=window.innerHeight,i=e.getBoundingClientRect(),o=i.width,s=i.height;t.scaleX>=0&&t.scaleX<=1&&t.scaleY>=0&&t.scaleY<=1&&(e.style.left=(a-o)*t.scaleX+"px",e.style.top=(n-s)*t.scaleY+"px")}function updateUnitWaypointContent(e,t){e.innerHTML=`
+ `);let i=window.innerWidth,o=window.innerHeight,s=n.getBoundingClientRect(),l=s.width,r=s.height;n.style.left=(i-l)*e+"px",n.style.top=(o-r)*t+"px"}function AddWaypoint(e){let t=document.getElementById("waypoint-container");e?Waypoints.push({element:t}):($("#waypoint-container").hide(),Waypoints=[])}let escapeEventListenerAddedERSSelectionMenu=!1,menuSoundInstance=null;function ToggleERSSelectionMenu(e,t){if(e){let a=t.isPolice,n=t.isAmbulance,i=t.isFire,o=t.isTow;fadeOutMenuMusic(menuSoundInstance),menuSoundInstance=PlayNUISound("generic-sounds","selectionmenu",.5);let s=`
${language.PoliceDescription}
${language.AmbulanceDescription}
${language.FireDescription}
${language.TowDescription}
`;$("body").append(s),$("#ers-selection-modal").modal({backdrop:"static",keyboard:!1}),$("#ers-selection-modal").modal("show");for(var l=1;l<=6;l++)addSoundOnHoverEventListener("s-btn-"+l);$("#ers-selection-modal").on("shown.bs.modal",function(){escapeEventListenerAddedERSSelectionMenu||($(document).on("keydown",function(e){"Escape"===e.key&&(fadeOutMenuMusic(menuSoundInstance),$("#ers-selection-modal").modal("hide"),CancelServiceSelection(),e.stopPropagation())}),escapeEventListenerAddedERSSelectionMenu=!0)}).on("hidden.bs.modal",function(){$(document).off("keydown"),escapeEventListenerAddedERSSelectionMenu=!1})}else $("#ers-selection-modal").modal("hide").on("hidden.bs.modal",function(){fadeOutMenuMusic(menuSoundInstance),$(this).remove()})}function CancelServiceSelection(){$.post(`https://${resourceName}/cancelServiceSelection`,JSON.stringify({})),$("#ers-selection-modal").modal("hide").on("hidden.bs.modal",function(){fadeOutMenuMusic(menuSoundInstance),$(this).data("bs.modal",null),$(this).remove()})}function SelectService(e){$.post(`https://${resourceName}/selectedService`,JSON.stringify({service:e})),$("#ers-selection-modal").modal("hide").on("hidden.bs.modal",function(){fadeOutMenuMusic(menuSoundInstance),$(this).data("bs.modal",null),$(this).remove()})}function fadeOutMenuMusic(e){null!==e&&(e.fade(e.volume(),0,5e3),setTimeout(function(){e.stop()},5e3))}let escapeEventListenerAddedERSGearnMenu=!1;function DisplayGearMenu(e,t){if(e){fadeOutMenuMusic(menuSoundInstance),menuSoundInstance=PlayNUISound("generic-sounds","selectionmenu",.5);let a=` `;$("body").append(a);var n=t.ClothingData;let i=function e(t){switch(t){case"police":return"primary";case"fire":return"danger";case"ambulance":return"warning";case"tow":return"info";default:return"secondary"}}(t.ServiceType);$.each(n,function(e,a){let n=encodeURIComponent(JSON.stringify(t));$("#gear-options").append(` `)}),$("#ers-gear-modal").modal({backdrop:"static",keyboard:!1}),$("#ers-gear-modal").modal("show");for(var o=0;o$(e).hide(),250)}function slideIn(e){$(e).show().removeClass("slideOutToLeft").addClass("slideInFromLeft")}function toggleCalloutInfo(){if(isDisplayingPreCalloutInterface){let e=containerIDs.preCallout;$(e).is(":visible")?slideOut(e):slideIn(e)}if(isDisplayingCalloutInterface){let t=containerIDs.callout;$(t).is(":visible")?slideOut(t):slideIn(t)}}function updateWaypoints(e){let t=e.data,a=trackExistingUnitWaypoints();for(let[n,i]of Object.entries(t))null!==i&&i.distanceText>0&&processUnitWaypoint(n,i,a);removeUnusedUnitWaypoints(a)}function trackExistingUnitWaypoints(){let e=new Set;return document.querySelectorAll(".unit-waypoint-container").forEach(t=>{e.add(t.id)}),e}function processUnitWaypoint(e,t,a){let n=`unit-waypoint-container-${e}`,i=document.getElementById(n);i||(i=createUnitWaypointContainer(n)),updateUnitWaypointPosition(i,t),updateUnitWaypointContent(i,t),a.delete(n)}function createUnitWaypointContainer(e){let t=document.createElement("div");return t.classList.add("unit-waypoint-container","smooth-transition"),t.id=e,document.body.appendChild(t),t}function updateUnitWaypointPosition(e,t){let a=window.innerWidth,n=window.innerHeight,i=e.getBoundingClientRect(),o=i.width,s=i.height;t.scaleX>=0&&t.scaleX<=1&&t.scaleY>=0&&t.scaleY<=1&&(e.style.left=(a-o)*t.scaleX+"px",e.style.top=(n-s)*t.scaleY+"px")}function updateUnitWaypointContent(e,t){e.innerHTML=`
แฏฝ ${t.distanceText}${t.metrics}
`}function removeUnusedUnitWaypoints(e){e.forEach(e=>{let t=document.getElementById(e);t&&t.remove()})}function ToggleQuestionsModule(e,t){if(e){if($("#question-options-list").empty(),$("#ped-interaction-questioning").show(),t.length>0){let a=`
@@ -77,7 +36,7 @@ let resourceName=null,language=null,commands=null,firstnames={},lastnames={},isD
`).join("")}
- `;$("#question-options-list").append(a),t.forEach((e,t)=>{let a=`s-btn-${t+1}`;document.getElementById(a)&&addSoundOnHoverEventListener(a)}),$("#question-options-list button").off("click").on("click",function(){let e=$(this).data("target"),t=$(this).data("question-text"),a=$(this).data("sound-file"),n=$(this).data("sound-volume");e&&(PlayNUISound("generic-sounds","q_select",1),$.post(`https://${resourceName}/questionSelected`,JSON.stringify({questionData:{id:e,text:t,soundFile:a,soundVolume:n}})))})}let n=`
+ `;$("#question-options-list").append(a),applySavedPosition("ped-interaction-questioning"),t.forEach((e,t)=>{let a=`s-btn-${t+1}`;document.getElementById(a)&&addSoundOnHoverEventListener(a)}),$("#question-options-list button").off("click").on("click",function(){let e=$(this).data("target"),t=$(this).data("question-text"),a=$(this).data("sound-file"),n=$(this).data("sound-volume");e&&(PlayNUISound("generic-sounds","q_select",1),$.post(`https://${resourceName}/questionSelected`,JSON.stringify({questionData:{id:e,text:t,soundFile:a,soundVolume:n}})))})}let n=`