Change netevent and const prefix
This commit is contained in:
@@ -73,7 +73,7 @@ function initGUI() {
|
||||
resetGUIStrings();
|
||||
resetLocaleChooserOptions();
|
||||
|
||||
sendNetworkEventToServer("vrr.guiReady", true);
|
||||
sendNetworkEventToServer("agrp.guiReady", true);
|
||||
};
|
||||
|
||||
// ===========================================================================
|
||||
@@ -230,7 +230,7 @@ function processGUIKeyPress(keyCode) {
|
||||
|
||||
function processToggleGUIKeyPress(keyCode) {
|
||||
if (keyCode == disableGUIKey) {
|
||||
sendNetworkEventToServer("vrr.toggleGUI");
|
||||
sendNetworkEventToServer("agrp.toggleGUI");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ let twoFactorAuth = {
|
||||
|
||||
function initTwoFactorAuthenticationGUI() {
|
||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating two factor auth GUI ...`);
|
||||
twoFactorAuth.window = mexui.window(game.width/2-150, game.height/2-129, 300, 258, 'LOGIN', {
|
||||
twoFactorAuth.window = mexui.window(game.width / 2 - 150, game.height / 2 - 129, 300, 258, 'LOGIN', {
|
||||
main: {
|
||||
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
||||
transitionTime: 500,
|
||||
@@ -38,7 +38,7 @@ function initTwoFactorAuthenticationGUI() {
|
||||
borderColour: toColour(0, 0, 0, 0),
|
||||
},
|
||||
});
|
||||
twoFactorAuth.window.titleBarIconSize = toVector2(0,0);
|
||||
twoFactorAuth.window.titleBarIconSize = toVector2(0, 0);
|
||||
twoFactorAuth.window.titleBarHeight = 0;
|
||||
|
||||
twoFactorAuth.qrCode = twoFactorAuth.window.image(100, 20, 100, 100, mainLogoPath, {
|
||||
@@ -129,7 +129,7 @@ function twoFactorAuthSuccess() {
|
||||
|
||||
function checkTwoFactorAuth() {
|
||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Checking two-factor authentication with server ...`);
|
||||
sendNetworkEventToServer("vrr.2fa", twoFactorAuth.codeInput.lines[0]);
|
||||
sendNetworkEventToServer("agrp.2fa", twoFactorAuth.codeInput.lines[0]);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -128,7 +128,7 @@ function passwordChangeFailed(errorMessage) {
|
||||
|
||||
function checkChangePassword() {
|
||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Checking password change with server ...`);
|
||||
sendNetworkEventToServer("vrr.checkChangePassword", passwordChange.passwordInput.lines[0], passwordChange.confirmPasswordInput.lines[0]);
|
||||
sendNetworkEventToServer("agrp.checkChangePassword", passwordChange.passwordInput.lines[0], passwordChange.confirmPasswordInput.lines[0]);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
@@ -23,23 +23,23 @@ let characterSelect = {
|
||||
// ===========================================================================
|
||||
|
||||
function initCharacterSelectGUI() {
|
||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating character select GUI ...`);
|
||||
characterSelect.window = mexui.window(game.width/2-215, game.height/2-83, 430, 190, 'SELECT CHARACTER', {
|
||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating character select GUI ...`);
|
||||
characterSelect.window = mexui.window(game.width / 2 - 215, game.height / 2 - 83, 430, 190, 'SELECT CHARACTER', {
|
||||
main: {
|
||||
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
||||
},
|
||||
title: {
|
||||
title: {
|
||||
textSize: 12.0,
|
||||
textFont: mainFont,
|
||||
textColour: toColour(0, 0, 0, 255),
|
||||
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha),
|
||||
},
|
||||
icon: {
|
||||
textColour: toColour(0, 0, 0, 255),
|
||||
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha),
|
||||
},
|
||||
icon: {
|
||||
textSize: 10.0,
|
||||
textFont: mainFont,
|
||||
textColour: toColour(0, 0, 0, 255),
|
||||
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha),
|
||||
}
|
||||
textColour: toColour(0, 0, 0, 255),
|
||||
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha),
|
||||
}
|
||||
});
|
||||
characterSelect.window.titleBarIconSize = toVector2(0, 0);
|
||||
characterSelect.window.titleBarIconShown = false;
|
||||
@@ -171,7 +171,7 @@ function showCharacterSelectGUI(firstName, lastName, cash, clan, lastPlayed, ski
|
||||
guiLeftKey = selectPreviousCharacter;
|
||||
guiRightKey = selectNextCharacter;
|
||||
|
||||
showLocaleChooserGUI(new Vec2(getScreenWidth()/2-(localeChooser.window.size.x/2), characterSelect.window.position.y+characterSelect.window.size.y+20));
|
||||
showLocaleChooserGUI(new Vec2(getScreenWidth() / 2 - (localeChooser.window.size.x / 2), characterSelect.window.position.y + characterSelect.window.size.y + 20));
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -186,21 +186,21 @@ function showNewCharacter() {
|
||||
|
||||
function selectNextCharacter() {
|
||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Requesting next character info from server for character select window`);
|
||||
sendNetworkEventToServer("vrr.nextCharacter");
|
||||
sendNetworkEventToServer("agrp.nextCharacter");
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function selectPreviousCharacter() {
|
||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Requesting previous character info from server for character select window`);
|
||||
sendNetworkEventToServer("vrr.previousCharacter");
|
||||
sendNetworkEventToServer("agrp.previousCharacter");
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function selectThisCharacter() {
|
||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Tell server the current shown character was selected in character select window`);
|
||||
sendNetworkEventToServer("vrr.selectCharacter");
|
||||
sendNetworkEventToServer("agrp.selectCharacter");
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -214,7 +214,7 @@ function switchCharacterSelectGUI(firstName, lastName, cash, clan, lastPlayed, s
|
||||
characterSelect.clanText.text = `Clan: ${clan}`;
|
||||
characterSelect.lastPlayedText.text = `Last Played: ${lastPlayed}`;
|
||||
|
||||
if(characterSelect.skinImage != null) {
|
||||
if (characterSelect.skinImage != null) {
|
||||
characterSelect.skinImage.remove();
|
||||
}
|
||||
characterSelect.skinImage = (getGame() == VRR_GAME_GTA_III) ? characterSelect.window.image(310, 32, 100, 90, `files/images/skins/gta3/${getSkinImage(skinId)}.png`) : characterSelect.window.image(310, 32, 100, 90, "files/images/skins/none.png");
|
||||
@@ -236,11 +236,11 @@ function characterSelectSuccess() {
|
||||
// ===========================================================================
|
||||
|
||||
function getSkinImage(skinId, gameId = getGame()) {
|
||||
if(skinId < 10) {
|
||||
if (skinId < 10) {
|
||||
return `Skin_00${skinId}.png`;
|
||||
} else if(skinId > 10 && skinId < 100) {
|
||||
} else if (skinId > 10 && skinId < 100) {
|
||||
return `Skin_0${skinId}.png`;
|
||||
} else if(skinId > 100) {
|
||||
} else if (skinId > 100) {
|
||||
return `Skin_${skinId}.png`;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ let login = {
|
||||
// ===========================================================================
|
||||
|
||||
let loginHTML =
|
||||
`<html>
|
||||
`<html>
|
||||
<head>
|
||||
<title>Asshat Gaming Roleplay: Login</title>
|
||||
<style type="text/css" rel="stylesheet">
|
||||
@@ -42,8 +42,8 @@ let loginHTML =
|
||||
// ===========================================================================
|
||||
|
||||
function initLoginGUI() {
|
||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating login GUI ...`);
|
||||
login.window = mexui.window(getScreenWidth()/2-150, getScreenHeight()/2-135, 300, 275, 'LOGIN', {
|
||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating login GUI ...`);
|
||||
login.window = mexui.window(getScreenWidth() / 2 - 150, getScreenHeight() / 2 - 135, 300, 275, 'LOGIN', {
|
||||
main: {
|
||||
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
||||
transitionTime: 500,
|
||||
@@ -60,7 +60,7 @@ function initLoginGUI() {
|
||||
borderColour: toColour(0, 0, 0, 0),
|
||||
},
|
||||
});
|
||||
login.window.titleBarIconSize = toVector2(0,0);
|
||||
login.window.titleBarIconSize = toVector2(0, 0);
|
||||
login.window.titleBarHeight = 0;
|
||||
login.window.titleBarShown = false;
|
||||
|
||||
@@ -157,7 +157,7 @@ function showLoginGUI() {
|
||||
mexui.focusedControl = login.passwordInput;
|
||||
guiSubmitKey = checkLogin;
|
||||
|
||||
showLocaleChooserGUI(new Vec2(getScreenWidth()/2-(localeChooser.window.size.x/2), login.window.position.y+login.window.size.y+20));
|
||||
showLocaleChooserGUI(new Vec2(getScreenWidth() / 2 - (localeChooser.window.size.x / 2), login.window.position.y + login.window.size.y + 20));
|
||||
//showSmallGameMessage(`If you don't have a mouse cursor, press ${toUpperCase(getKeyNameFromId(disableGUIKey))} to disable GUI`, COLOUR_WHITE, 7500);
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ function showLoginGUI() {
|
||||
|
||||
function checkLogin() {
|
||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Checking login with server ...`);
|
||||
sendNetworkEventToServer("vrr.checkLogin", login.passwordInput.lines[0]);
|
||||
sendNetworkEventToServer("agrp.checkLogin", login.passwordInput.lines[0]);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -191,7 +191,7 @@ function switchToPasswordResetGUI() {
|
||||
//closeAllWindows();
|
||||
//logToConsole(LOG_DEBUG, `[VRR.GUI] Showing password reset dialog window`);
|
||||
//showResetPasswordGUI();
|
||||
sendNetworkEventToServer("vrr.checkResetPassword", "");
|
||||
sendNetworkEventToServer("agrp.checkResetPassword", "");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ let newCharacter = {
|
||||
|
||||
function initNewCharacterGUI() {
|
||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating new character GUI ...`);
|
||||
newCharacter.window = mexui.window(getScreenWidth()/2-130, getScreenHeight()/2-115, 300, 230, 'NEW CHARACTER', {
|
||||
newCharacter.window = mexui.window(getScreenWidth() / 2 - 130, getScreenHeight() / 2 - 115, 300, 230, 'NEW CHARACTER', {
|
||||
main: {
|
||||
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
||||
transitionTime: 500,
|
||||
@@ -122,7 +122,7 @@ function newCharacterFailed(errorMessage) {
|
||||
newCharacter.firstNameInput.text = "";
|
||||
newCharacter.lastNameInput.text = "";
|
||||
|
||||
if(!newCharacter.window.shown) {
|
||||
if (!newCharacter.window.shown) {
|
||||
closeAllWindows();
|
||||
setChatWindowEnabled(false);
|
||||
mexui.setInput(true);
|
||||
@@ -135,15 +135,15 @@ function newCharacterFailed(errorMessage) {
|
||||
|
||||
function checkNewCharacter() {
|
||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Checking new character with server ...`);
|
||||
if(newCharacter.firstNameInput.lines[0].length < 2) {
|
||||
if (newCharacter.firstNameInput.lines[0].length < 2) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if(newCharacter.lastNameInput.lines[0].length < 2) {
|
||||
if (newCharacter.lastNameInput.lines[0].length < 2) {
|
||||
return false;
|
||||
}
|
||||
|
||||
sendNetworkEventToServer("vrr.checkNewCharacter",
|
||||
sendNetworkEventToServer("agrp.checkNewCharacter",
|
||||
newCharacter.firstNameInput.lines[0],
|
||||
newCharacter.lastNameInput.lines[0],
|
||||
);
|
||||
@@ -160,7 +160,7 @@ function showNewCharacterGUI() {
|
||||
mexui.focusedInput = newCharacter.firstNameInput;
|
||||
guiSubmitKey = checkNewCharacter;
|
||||
|
||||
showLocaleChooserGUI(new Vec2(getScreenWidth()/2-(localeChooser.window.size.x/2), newCharacter.window.position.y+newCharacter.window.size.y+20));
|
||||
showLocaleChooserGUI(new Vec2(getScreenWidth() / 2 - (localeChooser.window.size.x / 2), newCharacter.window.position.y + newCharacter.window.size.y + 20));
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -20,8 +20,8 @@ let register = {
|
||||
// ===========================================================================
|
||||
|
||||
function initRegisterGUI() {
|
||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating register GUI ...`);
|
||||
register.window = mexui.window(getScreenWidth()/2-150, getScreenHeight()/2-150, 300, 300, 'Register', {
|
||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Creating register GUI ...`);
|
||||
register.window = mexui.window(getScreenWidth() / 2 - 150, getScreenHeight() / 2 - 150, 300, 300, 'Register', {
|
||||
main: {
|
||||
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
||||
transitionTime: 500,
|
||||
@@ -37,7 +37,7 @@ function initRegisterGUI() {
|
||||
backgroundColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], windowTitleAlpha),
|
||||
}
|
||||
});
|
||||
register.window.titleBarIconSize = toVector2(0,0);
|
||||
register.window.titleBarIconSize = toVector2(0, 0);
|
||||
register.window.titleBarHeight = 0;
|
||||
register.window.titleBarShown = false;
|
||||
|
||||
@@ -148,7 +148,7 @@ function registrationFailed(errorMessage) {
|
||||
|
||||
function checkRegistration() {
|
||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Checking registration with server ...`);
|
||||
sendNetworkEventToServer("vrr.checkRegistration", register.passwordInput.lines[0], register.confirmPasswordInput.lines[0], register.emailInput.lines[0]);
|
||||
sendNetworkEventToServer("agrp.checkRegistration", register.passwordInput.lines[0], register.confirmPasswordInput.lines[0], register.emailInput.lines[0]);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -162,7 +162,7 @@ function showRegistrationGUI() {
|
||||
mexui.focusedControl = register.passwordInput;
|
||||
guiSubmitKey = checkRegistration;
|
||||
|
||||
showLocaleChooserGUI(new Vec2(getScreenWidth()/2-(localeChooser.window.size.x/2), register.window.position.y+register.window.size.y+20));
|
||||
showLocaleChooserGUI(new Vec2(getScreenWidth() / 2 - (localeChooser.window.size.x / 2), register.window.position.y + register.window.size.y + 20));
|
||||
|
||||
//showSmallGameMessage(`If you don't have a mouse cursor, press ${toUpperCase(getKeyNameFromId(disableGUIKey))} to disable GUI`, COLOUR_WHITE, 7500);
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ function showResetPasswordGUI() {
|
||||
|
||||
function checkResetPassword() {
|
||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Checking password reset with server (${passwordReset.emailInput.lines[0]}) ...`);
|
||||
sendNetworkEventToServer("vrr.checkResetPassword", passwordReset.emailInput.lines[0]);
|
||||
sendNetworkEventToServer("agrp.checkResetPassword", passwordReset.emailInput.lines[0]);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
@@ -9,17 +9,17 @@
|
||||
|
||||
|
||||
let yesNoDialog = {
|
||||
window: null,
|
||||
messageLabel: null,
|
||||
yesButton: null,
|
||||
noButton: null,
|
||||
window: null,
|
||||
messageLabel: null,
|
||||
yesButton: null,
|
||||
noButton: null,
|
||||
};
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function initYesNoDialogGUI() {
|
||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Created prompt GUI ...`);
|
||||
yesNoDialog.window = mexui.window(game.width/2-200, game.height/2-70, 400, 140, 'Question', {
|
||||
yesNoDialog.window = mexui.window(game.width / 2 - 200, game.height / 2 - 70, 400, 140, 'Question', {
|
||||
main: {
|
||||
backgroundColour: toColour(secondaryColour[0], secondaryColour[1], secondaryColour[2], windowAlpha),
|
||||
transitionTime: 500,
|
||||
@@ -79,37 +79,37 @@ function initYesNoDialogGUI() {
|
||||
// ===========================================================================
|
||||
|
||||
function showYesNoPromptGUI(promptMessage, promptTitle, yesButtonText, noButtonText) {
|
||||
closeAllWindows();
|
||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Showing prompt window. Prompt: ${promptTitle} - ${promptMessage}`);
|
||||
mexui.setInput(true);
|
||||
closeAllWindows();
|
||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Showing prompt window. Prompt: ${promptTitle} - ${promptMessage}`);
|
||||
mexui.setInput(true);
|
||||
|
||||
yesNoDialog.messageLabel.text = "";
|
||||
yesNoDialog.yesButton.text = "";
|
||||
yesNoDialog.noButton.text = "";
|
||||
yesNoDialog.window.title = "";
|
||||
yesNoDialog.messageLabel.text = "";
|
||||
yesNoDialog.yesButton.text = "";
|
||||
yesNoDialog.noButton.text = "";
|
||||
yesNoDialog.window.title = "";
|
||||
|
||||
yesNoDialog.messageLabel.text = promptMessage;
|
||||
yesNoDialog.yesButton.text = yesButtonText;
|
||||
yesNoDialog.noButton.text = noButtonText;
|
||||
yesNoDialog.window.title = promptTitle;
|
||||
yesNoDialog.messageLabel.text = promptMessage;
|
||||
yesNoDialog.yesButton.text = yesButtonText;
|
||||
yesNoDialog.noButton.text = noButtonText;
|
||||
yesNoDialog.window.title = promptTitle;
|
||||
|
||||
yesNoDialog.window.shown = true;
|
||||
yesNoDialog.window.shown = true;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function yesNoDialogAnswerNo() {
|
||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Responding with answer NO to server prompt`);
|
||||
sendNetworkEventToServer("vrr.promptAnswerNo");
|
||||
closeAllWindows();
|
||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Responding with answer NO to server prompt`);
|
||||
sendNetworkEventToServer("agrp.promptAnswerNo");
|
||||
closeAllWindows();
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function yesNoDialogAnswerYes() {
|
||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Responding with answer YES to server prompt`);
|
||||
sendNetworkEventToServer("vrr.promptAnswerYes");
|
||||
closeAllWindows();
|
||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Responding with answer YES to server prompt`);
|
||||
sendNetworkEventToServer("agrp.promptAnswerYes");
|
||||
closeAllWindows();
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -230,39 +230,39 @@ function repairVehicle(syncId) {
|
||||
// ===========================================================================
|
||||
|
||||
function syncVehicleProperties(vehicle) {
|
||||
if (doesEntityDataExist(vehicle, "vrr.lights")) {
|
||||
let lightStatus = getEntityData(vehicle, "vrr.lights");
|
||||
if (doesEntityDataExist(vehicle, "agrp.lights")) {
|
||||
let lightStatus = getEntityData(vehicle, "agrp.lights");
|
||||
vehicle.lights = lightStatus;
|
||||
}
|
||||
|
||||
if (doesEntityDataExist(vehicle, "vrr.invincible")) {
|
||||
let invincible = getEntityData(vehicle, "vrr.invincible");
|
||||
if (doesEntityDataExist(vehicle, "agrp.invincible")) {
|
||||
let invincible = getEntityData(vehicle, "agrp.invincible");
|
||||
element.setProofs(invincible, invincible, invincible, invincible, invincible);
|
||||
}
|
||||
|
||||
if (doesEntityDataExist(vehicle, "vrr.panelStatus")) {
|
||||
let panelsStatus = getEntityData(vehicle, "vrr.panelStatus");
|
||||
if (doesEntityDataExist(vehicle, "agrp.panelStatus")) {
|
||||
let panelsStatus = getEntityData(vehicle, "agrp.panelStatus");
|
||||
for (let i in panelsStatus) {
|
||||
vehicle.setPanelStatus(i, panelsStatus[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (doesEntityDataExist(vehicle, "vrr.wheelStatus")) {
|
||||
let wheelsStatus = getEntityData(vehicle, "vrr.wheelStatus");
|
||||
if (doesEntityDataExist(vehicle, "agrp.wheelStatus")) {
|
||||
let wheelsStatus = getEntityData(vehicle, "agrp.wheelStatus");
|
||||
for (let i in wheelsStatus) {
|
||||
vehicle.setWheelStatus(i, wheelsStatus[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (doesEntityDataExist(vehicle, "vrr.lightStatus")) {
|
||||
let lightStatus = getEntityData(vehicle, "vrr.lightStatus");
|
||||
if (doesEntityDataExist(vehicle, "agrp.lightStatus")) {
|
||||
let lightStatus = getEntityData(vehicle, "agrp.lightStatus");
|
||||
for (let i in lightStatus) {
|
||||
vehicle.setLightStatus(i, lightStatus[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (doesEntityDataExist(vehicle, "vrr.suspensionHeight")) {
|
||||
let suspensionHeight = getEntityData(vehicle, "vrr.suspensionHeight");
|
||||
if (doesEntityDataExist(vehicle, "agrp.suspensionHeight")) {
|
||||
let suspensionHeight = getEntityData(vehicle, "agrp.suspensionHeight");
|
||||
vehicle.setSuspensionHeight(suspensionHeight);
|
||||
}
|
||||
|
||||
@@ -272,8 +272,8 @@ function syncVehicleProperties(vehicle) {
|
||||
vehicle.removeUpgrade(i);
|
||||
}
|
||||
|
||||
if (doesEntityDataExist(vehicle, "vrr.upgrades")) {
|
||||
let upgrades = getEntityData(vehicle, "vrr.upgrades");
|
||||
if (doesEntityDataExist(vehicle, "agrp.upgrades")) {
|
||||
let upgrades = getEntityData(vehicle, "agrp.upgrades");
|
||||
for (let i in upgrades) {
|
||||
if (upgrades[i] != 0) {
|
||||
vehicle.addUpgrade(upgrades[i]);
|
||||
@@ -283,8 +283,8 @@ function syncVehicleProperties(vehicle) {
|
||||
}
|
||||
|
||||
if (getGame() == VRR_GAME_GTA_SA || getGame() == VRR_GAME_GTA_IV) {
|
||||
if (doesEntityDataExist(vehicle, "vrr.livery")) {
|
||||
let livery = getEntityData(vehicle, "vrr.livery");
|
||||
if (doesEntityDataExist(vehicle, "agrp.livery")) {
|
||||
let livery = getEntityData(vehicle, "agrp.livery");
|
||||
if (getGame() == VRR_GAME_GTA_SA) {
|
||||
vehicle.setPaintJob(livery);
|
||||
} else if (getGame() == VRR_GAME_GTA_IV) {
|
||||
@@ -316,8 +316,8 @@ function doesEntityDataExist(entity, dataName) {
|
||||
|
||||
function syncCivilianProperties(civilian) {
|
||||
if (getGame() == VRR_GAME_GTA_III) {
|
||||
if (doesEntityDataExist(civilian, "vrr.scale")) {
|
||||
let scaleFactor = getEntityData(civilian, "vrr.scale");
|
||||
if (doesEntityDataExist(civilian, "agrp.scale")) {
|
||||
let scaleFactor = getEntityData(civilian, "agrp.scale");
|
||||
let tempMatrix = civilian.matrix;
|
||||
tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z));
|
||||
let tempPosition = civilian.position;
|
||||
@@ -328,78 +328,78 @@ function syncCivilianProperties(civilian) {
|
||||
}
|
||||
|
||||
if (getGame() == VRR_GAME_GTA_SA) {
|
||||
if (doesEntityDataExist(civilian, "vrr.fightStyle")) {
|
||||
let fightStyle = getEntityData(civilian, "vrr.fightStyle");
|
||||
if (doesEntityDataExist(civilian, "agrp.fightStyle")) {
|
||||
let fightStyle = getEntityData(civilian, "agrp.fightStyle");
|
||||
civilian.setFightStyle(fightStyle[0], fightStyle[1]);
|
||||
}
|
||||
}
|
||||
|
||||
if (getGame() == VRR_GAME_GTA_III) {
|
||||
if (doesEntityDataExist(civilian, "vrr.walkStyle")) {
|
||||
let walkStyle = getEntityData(civilian, "vrr.walkStyle");
|
||||
if (doesEntityDataExist(civilian, "agrp.walkStyle")) {
|
||||
let walkStyle = getEntityData(civilian, "agrp.walkStyle");
|
||||
civilian.walkStyle = walkStyle;
|
||||
}
|
||||
}
|
||||
|
||||
if (getGame() == VRR_GAME_GTA_IV) {
|
||||
if (doesEntityDataExist(civilian, "vrr.bodyPropHair")) {
|
||||
let bodyPropHair = getEntityData(civilian, "vrr.bodyPropHair");
|
||||
if (doesEntityDataExist(civilian, "agrp.bodyPropHair")) {
|
||||
let bodyPropHair = getEntityData(civilian, "agrp.bodyPropHair");
|
||||
civilian.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]);
|
||||
}
|
||||
|
||||
if (doesEntityDataExist(civilian, "vrr.bodyPropHead")) {
|
||||
let bodyPropHead = getEntityData(civilian, "vrr.bodyPropHead");
|
||||
if (doesEntityDataExist(civilian, "agrp.bodyPropHead")) {
|
||||
let bodyPropHead = getEntityData(civilian, "agrp.bodyPropHead");
|
||||
civilian.changeBodyProp(1, bodyPropHead[0], bodyPropHead[1]);
|
||||
}
|
||||
|
||||
if (doesEntityDataExist(civilian, "vrr.bodyPropEyes")) {
|
||||
let bodyPropEyes = getEntityData(civilian, "vrr.bodyPropEyes");
|
||||
if (doesEntityDataExist(civilian, "agrp.bodyPropEyes")) {
|
||||
let bodyPropEyes = getEntityData(civilian, "agrp.bodyPropEyes");
|
||||
civilian.changeBodyProp(1, bodyPropEyes[0], bodyPropEyes[1]);
|
||||
}
|
||||
|
||||
if (doesEntityDataExist(civilian, "vrr.bodyPropLeftHand")) {
|
||||
let bodyPropLeftHand = getEntityData(civilian, "vrr.bodyPropLeftHand");
|
||||
if (doesEntityDataExist(civilian, "agrp.bodyPropLeftHand")) {
|
||||
let bodyPropLeftHand = getEntityData(civilian, "agrp.bodyPropLeftHand");
|
||||
civilian.changeBodyProp(1, bodyPropLeftHand[0], bodyPropLeftHand[1]);
|
||||
}
|
||||
|
||||
if (doesEntityDataExist(civilian, "vrr.bodyPropRightHand")) {
|
||||
let bodyPropRightHand = getEntityData(civilian, "vrr.bodyPropRightHand");
|
||||
if (doesEntityDataExist(civilian, "agrp.bodyPropRightHand")) {
|
||||
let bodyPropRightHand = getEntityData(civilian, "agrp.bodyPropRightHand");
|
||||
civilian.changeBodyProp(1, bodyPropRightHand[0], bodyPropRightHand[1]);
|
||||
}
|
||||
|
||||
if (doesEntityDataExist(civilian, "vrr.bodyPropLeftWrist")) {
|
||||
let bodyPropLeftWrist = getEntityData(civilian, "vrr.bodyPropLeftWrist");
|
||||
if (doesEntityDataExist(civilian, "agrp.bodyPropLeftWrist")) {
|
||||
let bodyPropLeftWrist = getEntityData(civilian, "agrp.bodyPropLeftWrist");
|
||||
civilian.changeBodyProp(1, bodyPropLeftWrist[0], bodyPropLeftWrist[1]);
|
||||
}
|
||||
|
||||
if (doesEntityDataExist(civilian, "vrr.bodyPropRightWrist")) {
|
||||
let bodyPropRightWrist = getEntityData(civilian, "vrr.bodyPropRightWrist");
|
||||
if (doesEntityDataExist(civilian, "agrp.bodyPropRightWrist")) {
|
||||
let bodyPropRightWrist = getEntityData(civilian, "agrp.bodyPropRightWrist");
|
||||
civilian.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
|
||||
}
|
||||
|
||||
if (doesEntityDataExist(civilian, "vrr.bodyPropRightWrist")) {
|
||||
let bodyPropRightWrist = getEntityData(civilian, "vrr.bodyPropRightWrist");
|
||||
if (doesEntityDataExist(civilian, "agrp.bodyPropRightWrist")) {
|
||||
let bodyPropRightWrist = getEntityData(civilian, "agrp.bodyPropRightWrist");
|
||||
civilian.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
|
||||
}
|
||||
|
||||
if (doesEntityDataExist(civilian, "vrr.bodyPropHip")) {
|
||||
let bodyPropHip = getEntityData(civilian, "vrr.bodyPropHip");
|
||||
if (doesEntityDataExist(civilian, "agrp.bodyPropHip")) {
|
||||
let bodyPropHip = getEntityData(civilian, "agrp.bodyPropHip");
|
||||
civilian.changeBodyProp(1, bodyPropHip[0], bodyPropHip[1]);
|
||||
}
|
||||
|
||||
if (doesEntityDataExist(civilian, "vrr.bodyPropLeftFoot")) {
|
||||
let bodyPropLeftFoot = getEntityData(civilian, "vrr.bodyPropLeftFoot");
|
||||
if (doesEntityDataExist(civilian, "agrp.bodyPropLeftFoot")) {
|
||||
let bodyPropLeftFoot = getEntityData(civilian, "agrp.bodyPropLeftFoot");
|
||||
civilian.changeBodyProp(1, bodyPropLeftFoot[0], bodyPropLeftFoot[1]);
|
||||
}
|
||||
|
||||
if (doesEntityDataExist(civilian, "vrr.bodyPropRightFoot")) {
|
||||
let bodyPropRightFoot = getEntityData(civilian, "vrr.bodyPropRightFoot");
|
||||
if (doesEntityDataExist(civilian, "agrp.bodyPropRightFoot")) {
|
||||
let bodyPropRightFoot = getEntityData(civilian, "agrp.bodyPropRightFoot");
|
||||
civilian.changeBodyProp(1, bodyPropRightFoot[0], bodyPropRightFoot[1]);
|
||||
}
|
||||
}
|
||||
|
||||
if (doesEntityDataExist(civilian, "vrr.anim")) {
|
||||
let animData = getEntityData(vehicle, "vrr.anim");
|
||||
if (doesEntityDataExist(civilian, "agrp.anim")) {
|
||||
let animData = getEntityData(vehicle, "agrp.anim");
|
||||
civilian.addAnimation(animData[0], animData[1]);
|
||||
}
|
||||
}
|
||||
@@ -414,8 +414,8 @@ function preventDefaultEventAction(event) {
|
||||
|
||||
function syncPlayerProperties(player) {
|
||||
if (getGame() == VRR_GAME_GTA_III) {
|
||||
if (doesEntityDataExist(player, "vrr.scale")) {
|
||||
let scaleFactor = getEntityData(player, "vrr.scale");
|
||||
if (doesEntityDataExist(player, "agrp.scale")) {
|
||||
let scaleFactor = getEntityData(player, "agrp.scale");
|
||||
let tempMatrix = player.matrix;
|
||||
tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z));
|
||||
let tempPosition = player.position;
|
||||
@@ -426,94 +426,94 @@ function syncPlayerProperties(player) {
|
||||
}
|
||||
|
||||
if (getGame() == VRR_GAME_GTA_SA) {
|
||||
if (doesEntityDataExist(player, "vrr.fightStyle")) {
|
||||
let fightStyle = getEntityData(player, "vrr.fightStyle");
|
||||
if (doesEntityDataExist(player, "agrp.fightStyle")) {
|
||||
let fightStyle = getEntityData(player, "agrp.fightStyle");
|
||||
player.setFightStyle(fightStyle[0], fightStyle[1]);
|
||||
}
|
||||
}
|
||||
|
||||
//if(getGame() == VRR_GAME_GTA_SA) {
|
||||
// if(doesEntityDataExist(player, "vrr.walkStyle")) {
|
||||
// let walkStyle = getEntityData(player, "vrr.walkStyle");
|
||||
// if(doesEntityDataExist(player, "agrp.walkStyle")) {
|
||||
// let walkStyle = getEntityData(player, "agrp.walkStyle");
|
||||
// player.walkStyle = walkStyle;
|
||||
// }
|
||||
//}
|
||||
|
||||
if (getGame() == VRR_GAME_GTA_IV) {
|
||||
if (doesEntityDataExist(player, "vrr.bodyPartHair")) {
|
||||
let bodyPartHead = getEntityData(player, "vrr.bodyPartHair");
|
||||
if (doesEntityDataExist(player, "agrp.bodyPartHair")) {
|
||||
let bodyPartHead = getEntityData(player, "agrp.bodyPartHair");
|
||||
player.changeBodyPart(0, bodyPartHead[0], bodyPartHair[1]);
|
||||
}
|
||||
|
||||
if (doesEntityDataExist(player, "vrr.bodyPartHead")) {
|
||||
let bodyPartHead = getEntityData(player, "vrr.bodyPartHead");
|
||||
if (doesEntityDataExist(player, "agrp.bodyPartHead")) {
|
||||
let bodyPartHead = getEntityData(player, "agrp.bodyPartHead");
|
||||
player.changeBodyPart(1, bodyPartHead[0], bodyPartHead[1]);
|
||||
}
|
||||
|
||||
if (doesEntityDataExist(player, "vrr.bodyPartUpper")) {
|
||||
let bodyPartUpper = getEntityData(player, "vrr.bodyPartUpper");
|
||||
if (doesEntityDataExist(player, "agrp.bodyPartUpper")) {
|
||||
let bodyPartUpper = getEntityData(player, "agrp.bodyPartUpper");
|
||||
player.changeBodyPart(1, bodyPartUpper[0], bodyPartUpper[1]);
|
||||
}
|
||||
|
||||
if (doesEntityDataExist(player, "vrr.bodyPartLower")) {
|
||||
let bodyPartLower = getEntityData(player, "vrr.bodyPartLower");
|
||||
if (doesEntityDataExist(player, "agrp.bodyPartLower")) {
|
||||
let bodyPartLower = getEntityData(player, "agrp.bodyPartLower");
|
||||
player.changeBodyPart(1, bodyPartLower[0], bodyPartLower[1]);
|
||||
}
|
||||
}
|
||||
|
||||
if (getGame() == VRR_GAME_GTA_IV) {
|
||||
if (doesEntityDataExist(player, "vrr.bodyPropHair")) {
|
||||
let bodyPropHair = getEntityData(player, "vrr.bodyPropHair");
|
||||
if (doesEntityDataExist(player, "agrp.bodyPropHair")) {
|
||||
let bodyPropHair = getEntityData(player, "agrp.bodyPropHair");
|
||||
player.changeBodyProp(0, bodyPropHair[0], bodyPropHair[1]);
|
||||
}
|
||||
|
||||
if (doesEntityDataExist(player, "vrr.bodyPropHead")) {
|
||||
let bodyPropHead = getEntityData(player, "vrr.bodyPropHead");
|
||||
if (doesEntityDataExist(player, "agrp.bodyPropHead")) {
|
||||
let bodyPropHead = getEntityData(player, "agrp.bodyPropHead");
|
||||
player.changeBodyProp(1, bodyPropHead[0], bodyPropHead[1]);
|
||||
}
|
||||
|
||||
if (doesEntityDataExist(player, "vrr.bodyPropEyes")) {
|
||||
let bodyPropEyes = getEntityData(player, "vrr.bodyPropEyes");
|
||||
if (doesEntityDataExist(player, "agrp.bodyPropEyes")) {
|
||||
let bodyPropEyes = getEntityData(player, "agrp.bodyPropEyes");
|
||||
player.changeBodyProp(1, bodyPropEyes[0], bodyPropEyes[1]);
|
||||
}
|
||||
|
||||
if (doesEntityDataExist(player, "vrr.bodyPropLeftHand")) {
|
||||
let bodyPropLeftHand = getEntityData(player, "vrr.bodyPropLeftHand");
|
||||
if (doesEntityDataExist(player, "agrp.bodyPropLeftHand")) {
|
||||
let bodyPropLeftHand = getEntityData(player, "agrp.bodyPropLeftHand");
|
||||
player.changeBodyProp(1, bodyPropLeftHand[0], bodyPropLeftHand[1]);
|
||||
}
|
||||
|
||||
if (doesEntityDataExist(player, "vrr.bodyPropRightHand")) {
|
||||
let bodyPropRightHand = getEntityData(player, "vrr.bodyPropRightHand");
|
||||
if (doesEntityDataExist(player, "agrp.bodyPropRightHand")) {
|
||||
let bodyPropRightHand = getEntityData(player, "agrp.bodyPropRightHand");
|
||||
player.changeBodyProp(1, bodyPropRightHand[0], bodyPropRightHand[1]);
|
||||
}
|
||||
|
||||
if (doesEntityDataExist(player, "vrr.bodyPropLeftWrist")) {
|
||||
let bodyPropLeftWrist = getEntityData(player, "vrr.bodyPropLeftWrist");
|
||||
if (doesEntityDataExist(player, "agrp.bodyPropLeftWrist")) {
|
||||
let bodyPropLeftWrist = getEntityData(player, "agrp.bodyPropLeftWrist");
|
||||
player.changeBodyProp(1, bodyPropLeftWrist[0], bodyPropLeftWrist[1]);
|
||||
}
|
||||
|
||||
if (doesEntityDataExist(player, "vrr.bodyPropRightWrist")) {
|
||||
let bodyPropRightWrist = getEntityData(player, "vrr.bodyPropRightWrist");
|
||||
if (doesEntityDataExist(player, "agrp.bodyPropRightWrist")) {
|
||||
let bodyPropRightWrist = getEntityData(player, "agrp.bodyPropRightWrist");
|
||||
player.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
|
||||
}
|
||||
|
||||
if (doesEntityDataExist(player, "vrr.bodyPropRightWrist")) {
|
||||
let bodyPropRightWrist = getEntityData(player, "vrr.bodyPropRightWrist");
|
||||
if (doesEntityDataExist(player, "agrp.bodyPropRightWrist")) {
|
||||
let bodyPropRightWrist = getEntityData(player, "agrp.bodyPropRightWrist");
|
||||
player.changeBodyProp(1, bodyPropRightWrist[0], bodyPropRightWrist[1]);
|
||||
}
|
||||
|
||||
if (doesEntityDataExist(player, "vrr.bodyPropHip")) {
|
||||
let bodyPropHip = getEntityData(player, "vrr.bodyPropHip");
|
||||
if (doesEntityDataExist(player, "agrp.bodyPropHip")) {
|
||||
let bodyPropHip = getEntityData(player, "agrp.bodyPropHip");
|
||||
player.changeBodyProp(1, bodyPropHip[0], bodyPropHip[1]);
|
||||
}
|
||||
|
||||
if (doesEntityDataExist(player, "vrr.bodyPropLeftFoot")) {
|
||||
let bodyPropLeftFoot = getEntityData(player, "vrr.bodyPropLeftFoot");
|
||||
if (doesEntityDataExist(player, "agrp.bodyPropLeftFoot")) {
|
||||
let bodyPropLeftFoot = getEntityData(player, "agrp.bodyPropLeftFoot");
|
||||
player.changeBodyProp(1, bodyPropLeftFoot[0], bodyPropLeftFoot[1]);
|
||||
}
|
||||
|
||||
if (doesEntityDataExist(player, "vrr.bodyPropRightFoot")) {
|
||||
let bodyPropRightFoot = getEntityData(player, "vrr.bodyPropRightFoot");
|
||||
if (doesEntityDataExist(player, "agrp.bodyPropRightFoot")) {
|
||||
let bodyPropRightFoot = getEntityData(player, "agrp.bodyPropRightFoot");
|
||||
player.changeBodyProp(1, bodyPropRightFoot[0], bodyPropRightFoot[1]);
|
||||
}
|
||||
}
|
||||
@@ -523,8 +523,8 @@ function syncPlayerProperties(player) {
|
||||
|
||||
function syncObjectProperties(object) {
|
||||
if (getGame() == VRR_GAME_GTA_III || getGame() == VRR_GAME_GTA_VC) {
|
||||
if (doesEntityDataExist(object, "vrr.scale")) {
|
||||
let scaleFactor = getEntityData(object, "vrr.scale");
|
||||
if (doesEntityDataExist(object, "agrp.scale")) {
|
||||
let scaleFactor = getEntityData(object, "agrp.scale");
|
||||
let tempMatrix = object.matrix;
|
||||
tempMatrix.setScale(toVector3(scaleFactor.x, scaleFactor.y, scaleFactor.z));
|
||||
let tempPosition = object.position;
|
||||
@@ -574,9 +574,9 @@ function getPlayerId(client) {
|
||||
// ===========================================================================
|
||||
|
||||
function syncElementProperties(element) {
|
||||
if (doesEntityDataExist(element, "vrr.interior")) {
|
||||
if (doesEntityDataExist(element, "agrp.interior")) {
|
||||
if (typeof element.interior != "undefined") {
|
||||
element.interior = getEntityData(element, "vrr.interior");
|
||||
element.interior = getEntityData(element, "agrp.interior");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,53 +44,53 @@ function loadSkinSelectMessageFontBottom() {
|
||||
// ===========================================================================
|
||||
|
||||
function processSkinSelectKeyPress(keyCode) {
|
||||
if(usingSkinSelector) {
|
||||
if(keyCode == SDLK_PAGEUP) {
|
||||
if(skinSelectorIndex >= allowedSkins.length-1) {
|
||||
if (usingSkinSelector) {
|
||||
if (keyCode == SDLK_PAGEUP) {
|
||||
if (skinSelectorIndex >= allowedSkins.length - 1) {
|
||||
skinSelectorIndex = 1;
|
||||
} else {
|
||||
skinSelectorIndex = skinSelectorIndex + 1;
|
||||
}
|
||||
logToConsole(LOG_DEBUG, `Switching to skin ${allowedSkins[skinSelectorIndex][1]} (Index: ${skinSelectorIndex}, Skin: ${allowedSkins[skinSelectorIndex][0]})`);
|
||||
skinSelectMessageTextTop = allowedSkins[skinSelectorIndex][1];
|
||||
if(getGame() == VRR_GAME_GTA_IV) {
|
||||
if (getGame() == VRR_GAME_GTA_IV) {
|
||||
let skinId = allowedSkins[skinSelectorIndex][0];
|
||||
if(natives.isModelInCdimage(skinId)) {
|
||||
if (natives.isModelInCdimage(skinId)) {
|
||||
natives.requestModel(skinId);
|
||||
natives.loadAllObjectsNow();
|
||||
if(natives.hasModelLoaded(skinId)) {
|
||||
if (natives.hasModelLoaded(skinId)) {
|
||||
natives.changePlayerModel(natives.getPlayerId(), skinId);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
localPlayer.skin = allowedSkins[skinSelectorIndex][0];
|
||||
}
|
||||
} else if(keyCode == SDLK_PAGEDOWN) {
|
||||
if(skinSelectorIndex <= 0) {
|
||||
skinSelectorIndex = allowedSkins.length-1;
|
||||
} else if (keyCode == SDLK_PAGEDOWN) {
|
||||
if (skinSelectorIndex <= 0) {
|
||||
skinSelectorIndex = allowedSkins.length - 1;
|
||||
} else {
|
||||
skinSelectorIndex = skinSelectorIndex - 1;
|
||||
}
|
||||
logToConsole(LOG_DEBUG, `Switching to skin ${allowedSkins[skinSelectorIndex][1]} (Index: ${skinSelectorIndex}, Skin: ${allowedSkins[skinSelectorIndex][0]})`);
|
||||
skinSelectMessageTextTop = allowedSkins[skinSelectorIndex][1];
|
||||
if(getGame() == VRR_GAME_GTA_IV) {
|
||||
if (getGame() == VRR_GAME_GTA_IV) {
|
||||
let skinId = allowedSkins[skinSelectorIndex][0];
|
||||
if(natives.isModelInCdimage(skinId)) {
|
||||
if (natives.isModelInCdimage(skinId)) {
|
||||
natives.requestModel(skinId);
|
||||
natives.loadAllObjectsNow();
|
||||
if(natives.hasModelLoaded(skinId)) {
|
||||
if (natives.hasModelLoaded(skinId)) {
|
||||
natives.changePlayerModel(natives.getPlayerId(), skinId);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
localPlayer.skin = allowedSkins[skinSelectorIndex][0];
|
||||
}
|
||||
} else if(keyCode == SDLK_RETURN) {
|
||||
sendNetworkEventToServer("vrr.skinSelected", skinSelectorIndex);
|
||||
} else if (keyCode == SDLK_RETURN) {
|
||||
sendNetworkEventToServer("agrp.skinSelected", skinSelectorIndex);
|
||||
toggleSkinSelect(false);
|
||||
return true;
|
||||
} else if(keyCode == SDLK_BACKSPACE) {
|
||||
sendNetworkEventToServer("vrr.skinSelected", -1);
|
||||
} else if (keyCode == SDLK_BACKSPACE) {
|
||||
sendNetworkEventToServer("agrp.skinSelected", -1);
|
||||
toggleSkinSelect(false);
|
||||
return true;
|
||||
}
|
||||
@@ -101,11 +101,11 @@ function processSkinSelectKeyPress(keyCode) {
|
||||
// ===========================================================================
|
||||
|
||||
function processSkinSelectRendering() {
|
||||
if(usingSkinSelector) {
|
||||
if(skinSelectMessageFontTop != null && skinSelectMessageFontBottom != null) {
|
||||
if(skinSelectMessageTextTop != "" && skinSelectMessageTextBottom != "") {
|
||||
skinSelectMessageFontTop.render(skinSelectMessageTextTop, [0, game.height-100], game.width, 0.5, 0.0, skinSelectMessageFontTop.size, skinSelectMessageColourTop, true, true, false, true);
|
||||
skinSelectMessageFontBottom.render(skinSelectMessageTextBottom, [0, game.height-65], game.width, 0.5, 0.0, skinSelectMessageFontBottom.size, skinSelectMessageColourBottom, true, true, false, true);
|
||||
if (usingSkinSelector) {
|
||||
if (skinSelectMessageFontTop != null && skinSelectMessageFontBottom != null) {
|
||||
if (skinSelectMessageTextTop != "" && skinSelectMessageTextBottom != "") {
|
||||
skinSelectMessageFontTop.render(skinSelectMessageTextTop, [0, game.height - 100], game.width, 0.5, 0.0, skinSelectMessageFontTop.size, skinSelectMessageColourTop, true, true, false, true);
|
||||
skinSelectMessageFontBottom.render(skinSelectMessageTextBottom, [0, game.height - 65], game.width, 0.5, 0.0, skinSelectMessageFontBottom.size, skinSelectMessageColourBottom, true, true, false, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -114,9 +114,9 @@ function processSkinSelectRendering() {
|
||||
// ===========================================================================
|
||||
|
||||
function toggleSkinSelect(state) {
|
||||
if(state) {
|
||||
if (state) {
|
||||
skinSelectorIndex = getAllowedSkinIndexFromSkin(localPlayer.skin);
|
||||
if(!skinSelectorIndex) {
|
||||
if (!skinSelectorIndex) {
|
||||
skinSelectorIndex = 0;
|
||||
}
|
||||
|
||||
@@ -124,19 +124,19 @@ function toggleSkinSelect(state) {
|
||||
skinSelectPosition = localPlayer.position;
|
||||
skinSelectHeading = localPlayer.heading;
|
||||
|
||||
if(isCustomCameraSupported()) {
|
||||
if (isCustomCameraSupported()) {
|
||||
let tempPosition = localPlayer.position;
|
||||
tempPosition.z += 0.5;
|
||||
let frontCameraPosition = getPosInFrontOfPos(tempPosition, localPlayer.heading, 3);
|
||||
game.setCameraLookAt(frontCameraPosition, localPlayer.position, true);
|
||||
}
|
||||
|
||||
if(getGame() == VRR_GAME_GTA_IV) {
|
||||
if (getGame() == VRR_GAME_GTA_IV) {
|
||||
let skinId = allowedSkins[skinSelectorIndex][0];
|
||||
if(natives.isModelInCdimage(skinId)) {
|
||||
if (natives.isModelInCdimage(skinId)) {
|
||||
natives.requestModel(skinId);
|
||||
natives.loadAllObjectsNow();
|
||||
if(natives.hasModelLoaded(skinId)) {
|
||||
if (natives.hasModelLoaded(skinId)) {
|
||||
natives.changePlayerModel(natives.getPlayerId(), skinId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user