added HPG VEhicles Mission, Audio settings; mission Context menu

This commit is contained in:
PxlLoewe
2025-05-24 12:46:11 -07:00
parent b2890b3ecc
commit 1ca6007ac5
28 changed files with 680 additions and 369 deletions

View File

@@ -0,0 +1,28 @@
export const selectRandomHPGMissionSzenery = (code: string) => {
const scenery = code
.split("_")
.map((n: string) => {
const numbers = n.split(",");
const parsedNumbers = numbers
.map((num) => {
if (num.includes("-")) {
const [min, max] = num.split("-").map(Number);
// creae a range of numbers
return Array.from(
{
length: max! - min! + 1,
},
(_, ai) => ai + min!,
);
}
return Number(num);
})
.flat();
const randomI = Math.floor(Math.random() * parsedNumbers.length);
return parsedNumbers[randomI];
})
.join("_");
console.log("scenery", scenery);
return scenery;
};