Rename game config util

This commit is contained in:
Vortrex
2022-03-06 01:17:37 -06:00
parent f1443f2945
commit d9ae395254
18 changed files with 136 additions and 195 deletions

View File

@@ -8,7 +8,7 @@
// ===========================================================================
function getCustomImage(imageName) {
let contentResource = findResourceByName(getGameData().extraContentResource[getGame()]);
let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]);
if(contentResource != null) {
if(contentResource.isStarted) {
let image = contentResource.exports.getCustomImage(imageName);
@@ -23,7 +23,7 @@ function getCustomImage(imageName) {
// ===========================================================================
function getCustomFont(fontName) {
let contentResource = findResourceByName(getGameData().extraContentResource[getGame()]);
let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]);
if(contentResource != null) {
if(contentResource.isStarted) {
let font = contentResource.exports.getCustomFont(fontName);
@@ -38,7 +38,7 @@ function getCustomFont(fontName) {
// ===========================================================================
function getCustomAudio(audioName) {
let contentResource = findResourceByName(getGameData().extraContentResource[getGame()]);
let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]);
if(contentResource != null) {
if(contentResource.isStarted) {
let audioFile = contentResource.exports.getCustomAudio(audioName);
@@ -53,7 +53,7 @@ function getCustomAudio(audioName) {
// ===========================================================================
function playCustomAudio(audioName, volume = 0.5, loop = false) {
let contentResource = findResourceByName(getGameData().extraContentResource[getGame()]);
let contentResource = findResourceByName(getGameConfig().extraContentResource[getGame()]);
if(contentResource != null) {
if(contentResource.isStarted) {
contentResource.exports.playCustomAudio(audioName, volume, loop);

View File

@@ -104,6 +104,7 @@ function closeAllWindows() {
listDialog.window.shown = false;
resetPassword.window.shown = false;
passwordChange.window.shown = false;
mexui.setInput(false);
mexui.focusedControl = false;
@@ -299,14 +300,22 @@ function processGUIKeyPress(keyCode) {
if(guiSubmitKey != false) {
guiSubmitKey();
}
} else if(keyCode == SDLK_LEFT) {
} else if(keyCode == getKeyIdFromParams("left") || keyCode == getKeyIdFromParams("a")) {
if(guiLeftKey != false) {
guiLeftKey();
}
} else if(keyCode == SDLK_RIGHT) {
} else if(keyCode == getKeyIdFromParams("right") || keyCode == getKeyIdFromParams("d")) {
if(guiRightKey != false) {
guiRightKey();
}
} else if(keyCode == getKeyIdFromParams("down") || keyCode == getKeyIdFromParams("s")) {
if(guiDownKey != false) {
guiDownKey();
}
} else if(keyCode == getKeyIdFromParams("up") || keyCode == getKeyIdFromParams("w")) {
if(guiUpKey != false) {
guiUpKey();
}
}
}

View File

@@ -15,4 +15,6 @@ let clanManager = {
vehiclesTab: null,
businessesTab: null,
housesTab: null,
};
};
// ===========================================================================

View File

@@ -168,4 +168,6 @@ function switchToPasswordResetGUI() {
logToConsole(LOG_DEBUG, `[VRR.GUI] Showing password reset dialog window`);
showResetPasswordGUI();
return false;
}
}
// ===========================================================================

View File

@@ -52,7 +52,7 @@ function deleteGameElement(element, position) {
// ===========================================================================
function createGameVehicle(modelIndex, position, heading) {
return game.createVehicle(getGameData().vehicles[getGame()][modelIndex][0], position, heading);
return game.createVehicle(getGameConfig().vehicles[getGame()][modelIndex][0], position, heading);
}
// ===========================================================================

View File

@@ -116,7 +116,7 @@ function syncVehicleProperties(vehicle) {
}
if(getGame() == VRR_GAME_GTA_SA) {
let allUpgrades = getGameData().vehicleUpgrades[getGame()];
let allUpgrades = getGameConfig().vehicleUpgrades[getGame()];
for(let i in allUpgrades) {
vehicle.removeUpgrade(i);
}