Reorganize some utils, change dividing lines
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
// Asshat-Gaming Roleplay
|
||||
// https://github.com/VortrexFTW/gtac_asshat_rp
|
||||
// Copyright (c) 2021 Asshat-Gaming (https://asshatgaming.com)
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
// FILE: afk.js
|
||||
// DESC: Provides AFK detection
|
||||
// TYPE: Client (JavaScript)
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
// Asshat-Gaming Roleplay
|
||||
// https://github.com/VortrexFTW/gtac_asshat_rp
|
||||
// Copyright (c) 2021 Asshat-Gaming (https://asshatgaming.com)
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
// FILE: chatbox.js
|
||||
// DESC: Provides extra chatbox features
|
||||
// TYPE: Client (JavaScript)
|
||||
// ===========================================================================
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
let chatBoxHistory = [];
|
||||
let bottomMessageIndex = 0;
|
||||
@@ -17,12 +17,12 @@ let maxChatBoxHistory = 500;
|
||||
let scrollAmount = 1;
|
||||
let maxChatBoxLines = 6;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
bindKey(SDLK_PAGEUP, KEYSTATE_DOWN, chatBoxScrollUp);
|
||||
bindKey(SDLK_PAGEDOWN, KEYSTATE_DOWN, chatBoxScrollDown);
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.m", function(messageString, colour) {
|
||||
message(messageString, colour);
|
||||
@@ -30,13 +30,13 @@ addNetworkHandler("ag.m", function(messageString, colour) {
|
||||
bottomMessageIndex = chatBoxHistory.length-1;
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
function addToChatBoxHistory(messageString, colour) {
|
||||
chatBoxHistory.push([messageString, colour]);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
function chatBoxScrollUp() {
|
||||
if(bottomMessageIndex > maxChatBoxLines) {
|
||||
@@ -45,7 +45,7 @@ function chatBoxScrollUp() {
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
function chatBoxScrollDown() {
|
||||
if(bottomMessageIndex < chatBoxHistory.length-1) {
|
||||
@@ -54,7 +54,7 @@ function chatBoxScrollDown() {
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
function clearChatBox() {
|
||||
for(let i = 0 ; i <= maxChatBoxLines ; i++) {
|
||||
@@ -62,7 +62,7 @@ function clearChatBox() {
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
function updateChatBox() {
|
||||
clearChatBox();
|
||||
@@ -75,4 +75,4 @@ function updateChatBox() {
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
@@ -2,7 +2,7 @@
|
||||
// Asshat-Gaming Roleplay
|
||||
// https://github.com/VortrexFTW/gtac_asshat_rp
|
||||
// Copyright (c) 2021 Asshat-Gaming (https://asshatgaming.com)
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
// FILE: gui.js
|
||||
// DESC: Provides GUI functionality and styles (using MexUI)
|
||||
// TYPE: Client (JavaScript)
|
||||
@@ -1166,7 +1166,7 @@ app.init = function()
|
||||
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Created login GUI`);
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Creating two factor auth GUI ...`);
|
||||
twoFactorAuth.window = mexui.window(game.width/2-150, game.height/2-129, 300, 258, 'LOGIN', {
|
||||
@@ -1244,7 +1244,7 @@ app.init = function()
|
||||
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Created two factor auth GUI`);
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Creating new character GUI ...`);
|
||||
|
||||
@@ -1450,7 +1450,7 @@ app.init = function()
|
||||
}, checkNewCharacter);
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Created new character GUI`);
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Creating register GUI ...`);
|
||||
register.window = mexui.window(game.width/2-130, game.height/2-125, 300, 250, 'Register', {
|
||||
@@ -1563,7 +1563,7 @@ app.init = function()
|
||||
}, checkRegistration);
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Created register GUI`);
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Creating error GUI ...`);
|
||||
errorDialog.window = mexui.window(game.width/2-200, game.height/2-70, 400, 140, 'ERROR', {
|
||||
@@ -1609,7 +1609,7 @@ app.init = function()
|
||||
}, closeErrorDialog);
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Created error GUI ...`);
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Created prompt GUI ...`);
|
||||
yesNoDialog.window = mexui.window(game.width/2-200, game.height/2-70, 400, 140, 'Question', {
|
||||
@@ -1668,7 +1668,7 @@ app.init = function()
|
||||
}, yesNoDialogAnswerNo);
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Created prompt GUI`);
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Creating info dialog GUI ...`);
|
||||
infoDialog.window = mexui.window(game.width/2-200, game.height/2-70, 400, 140, 'Information', {
|
||||
@@ -1713,7 +1713,7 @@ app.init = function()
|
||||
}, closeInfoDialog);
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Created info dialog GUI`);
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Creating list dialog GUI ...`);
|
||||
listDialog.window = mexui.window(game.width/2-200, game.height/2-70, 400, 500, 'List', {
|
||||
@@ -1771,7 +1771,7 @@ app.init = function()
|
||||
});
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Created list dialog GUI`);
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Creating character select GUI ...`);
|
||||
characterSelect.window = mexui.window(game.width/2-215, game.height/2-83, 430, 166, 'Select Character', {
|
||||
@@ -1897,20 +1897,20 @@ app.init = function()
|
||||
});
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Created character select GUI`);
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] All GUI created successfully!`);
|
||||
closeAllWindows();
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
let checkLogin = function() {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Checking login with server ...`);
|
||||
triggerNetworkEvent("ag.checkLogin", login.passwordInput.lines[0]);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
let loginFailed = function(errorMessage) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Server reports login failed`);
|
||||
@@ -1919,21 +1919,21 @@ let loginFailed = function(errorMessage) {
|
||||
login.passwordInput.text = "";
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
let loginSuccess = function() {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Server reports login was successful`);
|
||||
closeAllWindows();
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
let checkRegistration = function() {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Checking registration with server ...`);
|
||||
triggerNetworkEvent("ag.checkRegistration", register.passwordInput.lines[0], register.confirmPasswordInput.lines[0], register.emailInput.lines[0]);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
let checkNewCharacter = function() {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Checking new character with server ...`);
|
||||
@@ -1964,7 +1964,7 @@ let checkNewCharacter = function() {
|
||||
);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
let registrationFailed = function(errorMessage) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Server reports registration failed. Reason: ${errorMessage}`);
|
||||
@@ -1975,14 +1975,14 @@ let registrationFailed = function(errorMessage) {
|
||||
register.emailInput.text = "";
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
let registrationSuccess = function() {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Server reports registration was successful`);
|
||||
closeAllWindows();
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
let twoFactorAuthFailed = function(errorMessage) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Server reports two-factor authentication failed. Reason: ${errorMessage}`);
|
||||
@@ -1991,28 +1991,28 @@ let twoFactorAuthFailed = function(errorMessage) {
|
||||
login.passwordInput.text = "";
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
let twoFactorAuthSuccess = function() {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Server reports two-factor authentication was successful`);
|
||||
closeAllWindows();
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
let checkTwoFactorAuth = function() {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Checking two-factor authentication with server ...`);
|
||||
triggerNetworkEvent("ag.checkTwoFactorAuth", twoFactorAuth.codeInput.lines[0]);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
let characterSelectSuccess = function() {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Server reports character selection was successful`);
|
||||
closeAllWindows();
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
let closeErrorDialog = function() {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Closing error dialog`);
|
||||
@@ -2020,7 +2020,7 @@ let closeErrorDialog = function() {
|
||||
mexui.setInput(false);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
let closeInfoDialog = function() {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Closing info dialog`);
|
||||
@@ -2028,7 +2028,7 @@ let closeInfoDialog = function() {
|
||||
mexui.setInput(false);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
let closeAllWindows = function() {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Closing all GUI windows`);
|
||||
@@ -2044,21 +2044,21 @@ let closeAllWindows = function() {
|
||||
mexui.setInput(false);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
let yesNoDialogAnswerNo = function() {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Responding with answer NO to server prompt`);
|
||||
triggerNetworkEvent("ag.promptAnswerNo");
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
let yesNoDialogAnswerYes = function() {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Responding with answer YES to server prompt`);
|
||||
triggerNetworkEvent("ag.promptAnswerYes");
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
let showRegistration = function() {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Showing registration window`);
|
||||
@@ -2068,7 +2068,7 @@ let showRegistration = function() {
|
||||
register.window.shown = true;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
let showLogin = function() {
|
||||
closeAllWindows();
|
||||
@@ -2078,7 +2078,7 @@ let showLogin = function() {
|
||||
login.window.shown = true;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
let showTwoFactorAuth = function() {
|
||||
closeAllWindows();
|
||||
@@ -2088,7 +2088,7 @@ let showTwoFactorAuth = function() {
|
||||
twoFactorAuth.window.shown = true;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
let showCharacterSelect = function(firstName, lastName, placeOfOrigin, dateOfBirth, skinId) {
|
||||
closeAllWindows();
|
||||
@@ -2102,7 +2102,7 @@ let showCharacterSelect = function(firstName, lastName, placeOfOrigin, dateOfBir
|
||||
characterSelect.window.shown = true;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
let showError = function(errorMessage, errorTitle) {
|
||||
closeAllWindows();
|
||||
@@ -2113,7 +2113,7 @@ let showError = function(errorMessage, errorTitle) {
|
||||
errorDialog.window.shown = true;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
let showYesNo = function(promptMessage, promptTitle) {
|
||||
closeAllWindows();
|
||||
@@ -2123,7 +2123,7 @@ let showYesNo = function(promptMessage, promptTitle) {
|
||||
yesNoDialog.window.shown = true;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
let showInfo = function(infoMessage, infoTitle) {
|
||||
closeAllWindows();
|
||||
@@ -2133,7 +2133,7 @@ let showInfo = function(infoMessage, infoTitle) {
|
||||
infoDialog.window.shown = true;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
let showNewCharacter = function() {
|
||||
closeAllWindows();
|
||||
@@ -2143,28 +2143,28 @@ let showNewCharacter = function() {
|
||||
newCharacter.window.shown = true;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
let selectNextCharacter = function() {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Requesting next character info from server for character select window`);
|
||||
triggerNetworkEvent("ag.nextCharacter");
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
let selectPreviousCharacter = function() {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Requesting previous character info from server for character select window`);
|
||||
triggerNetworkEvent("ag.previousCharacter");
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
let selectThisCharacter = function() {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Tell server the current shown character was selected in character select window`);
|
||||
triggerNetworkEvent("ag.selectCharacter");
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
let switchCharacterSelect = function(firstName, lastName, placeOfOrigin, dateOfBirth, skinId) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Updating character info with data from server`);
|
||||
@@ -2177,70 +2177,70 @@ let switchCharacterSelect = function(firstName, lastName, placeOfOrigin, dateOfB
|
||||
characterSelect.window.shown = true;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.showLogin", function() {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Received request from server to show login window`);
|
||||
showLogin();
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.showRegistration", function() {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Received request from server to show registration window`);
|
||||
showRegistration();
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.showNewCharacter", function() {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Received request from server to show new character window`);
|
||||
showNewCharacter();
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.showCharacterSelect", function(firstName, lastName, placeOfOrigin, dateOfBirth, skinId) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Received request from server to show character selection window`);
|
||||
showCharacterSelect(firstName, lastName, placeOfOrigin, dateOfBirth, skinId);
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.switchCharacterSelect", function(firstName, lastName, placeOfOrigin, dateOfBirth, skinId) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Received request from server to update character selection window with new info`);
|
||||
switchCharacterSelect(firstName, lastName, placeOfOrigin, dateOfBirth, skinId);
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.showError", function(errorMessage, errorTitle) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Received request from server to show error window`);
|
||||
showError(errorMessage, errorTitle);
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.showPrompt", function(promptMessage, promptTitle) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Received request from server to show prompt window`);
|
||||
showYesNo(promptMessage, promptTitle);
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.showInfo", function(infoMessage) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Received request from server to show info dialog`);
|
||||
showInfo(infoMessage);
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.loginSuccess", function() {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Received signal of successful login from server`);
|
||||
loginSuccess();
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.characterSelectSuccess", function() {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Received signal of successful character selection from server`);
|
||||
@@ -2248,28 +2248,28 @@ addNetworkHandler("ag.characterSelectSuccess", function() {
|
||||
setChatWindowEnabled(true);
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.loginFailed", function(remainingAttempts) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Received signal of failed login from server`);
|
||||
loginFailed(remainingAttempts);
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.registrationSuccess", function() {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Received signal of successful registration from server`);
|
||||
registrationSuccess();
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.registrationFailed", function(errorMessage) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Received signal of failed registration from server`);
|
||||
registrationFailed(errorMessage);
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.guiColour", function(red, green, blue) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Received new GUI colours from server`);
|
||||
@@ -2277,7 +2277,7 @@ addNetworkHandler("ag.guiColour", function(red, green, blue) {
|
||||
focusedColour = [red+focusedColourOffset, green+focusedColourOffset, blue+focusedColourOffset];
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.guiInit", function() {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.GUI] Initializing MexUI app`);
|
||||
@@ -2285,4 +2285,4 @@ addNetworkHandler("ag.guiInit", function() {
|
||||
triggerNetworkEvent("ag.guiReady", true);
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
@@ -2,7 +2,7 @@
|
||||
// Asshat-Gaming Roleplay
|
||||
// https://github.com/VortrexFTW/gtac_asshat_rp
|
||||
// Copyright (c) 2021 Asshat-Gaming (https://asshatgaming.com)
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
// FILE: keybind.js
|
||||
// DESC: Provides keybind features
|
||||
// TYPE: Client (JavaScript)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Asshat-Gaming Roleplay
|
||||
// https://github.com/VortrexFTW/gtac_asshat_rp
|
||||
// Copyright (c) 2021 Asshat-Gaming (https://asshatgaming.com)
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
// FILE: labels.js
|
||||
// DESC: Provides functionality for world labels (3D labels)
|
||||
// TYPE: Client (JavaScript)
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
// Asshat-Gaming Roleplay
|
||||
// https://github.com/VortrexFTW/gtac_asshat_rp
|
||||
// Copyright (c) 2021 Asshat-Gaming (https://asshatgaming.com)
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
// FILE: main.js
|
||||
// DESC: Main client script (will be reorganized into individual files later)
|
||||
// TYPE: Client (JavaScript)
|
||||
// ===========================================================================
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
let bigMessageFont = null;
|
||||
let logoImage = null;
|
||||
@@ -70,7 +70,7 @@ let controlsEnabled = false;
|
||||
|
||||
let usingSkinSelector = false;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addEvent("OnLocalPlayerEnterSphere", 1);
|
||||
addEvent("OnLocalPlayerExitSphere", 1);
|
||||
@@ -78,7 +78,7 @@ addEvent("OnLocalPlayerEnteredVehicle", 1);
|
||||
addEvent("OnLocalPlayerExitedVehicle", 1);
|
||||
addEvent("OnLocalPlayerSwitchWeapon", 2);
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
bindEventHandler("onResourceReady", thisResource, function(event, resource) {
|
||||
if(resource == thisResource) {
|
||||
@@ -101,7 +101,7 @@ bindEventHandler("onResourceReady", thisResource, function(event, resource) {
|
||||
openAllGarages();
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
bindEventHandler("onResourceStart", thisResource, function(event, resource) {
|
||||
if(gta.game == GAME_GTA_SA) {
|
||||
@@ -115,13 +115,13 @@ bindEventHandler("onResourceStart", thisResource, function(event, resource) {
|
||||
addEventHandler("onProcess", processEvent);
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
bindEventHandler("onResourceStop", thisResource, function(event, resource) {
|
||||
removeEventHandler("onProcess");
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addEventHandler("onKeyUp", function(event, virtualKey, physicalKey, keyModifiers) {
|
||||
if(usingSkinSelector) {
|
||||
@@ -142,21 +142,21 @@ addEventHandler("onKeyUp", function(event, virtualKey, physicalKey, keyModifiers
|
||||
}
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.cameraLookAt", function(cameraPosition, cameraLookat) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Main] Set camera to look at ${cameraPosition.x}, ${cameraPosition.y}, ${cameraPosition.z}`);
|
||||
gta.setCameraLookAt(cameraPosition, cameraLookat, true);
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.restoreCamera", function() {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Main] Camera restored`);
|
||||
gta.restoreCamera(true);
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.clearPeds", function() {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Main] Clearing all self-owned peds ...`);
|
||||
@@ -164,14 +164,14 @@ addNetworkHandler("ag.clearPeds", function() {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Main] All self-owned peds cleared`);
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.logo", function(state) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Main] Server logo ${(state) ? "enabled" : "disabled"}`);
|
||||
renderLogo = state;
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.ambience", function(state) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Main] Ambient civilians and traffic ${(state) ? "enabled" : "disabled"}`);
|
||||
@@ -183,7 +183,7 @@ addNetworkHandler("ag.ambience", function(state) {
|
||||
clearSelfOwnedPeds();
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.runCode", function(code, returnTo) {
|
||||
let returnValue = "Nothing";
|
||||
@@ -223,7 +223,7 @@ addNetworkHandler("ag.clearWeapons", function() {
|
||||
forceWeaponClipAmmo = 0;
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.giveWeapon", function(weaponId, ammo, active) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Main] Giving weapon ${weaponId} with ${ammo} ammo`);
|
||||
@@ -233,7 +233,7 @@ addNetworkHandler("ag.giveWeapon", function(weaponId, ammo, active) {
|
||||
forceWeapon = weaponId;
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addEventHandler("OnElementStreamIn", function(event, element) {
|
||||
switch(element.type) {
|
||||
@@ -258,7 +258,7 @@ addEventHandler("OnElementStreamIn", function(event, element) {
|
||||
}
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.blips", function(blipData) {
|
||||
for(let i in blipData) {
|
||||
@@ -266,7 +266,7 @@ addNetworkHandler("ag.blips", function(blipData) {
|
||||
}
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
function showIslandBlips() {
|
||||
for(let i in allServerBlips) {
|
||||
@@ -278,7 +278,7 @@ function showIslandBlips() {
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
function getIslandFromPosition(position) {
|
||||
switch(gta.game) {
|
||||
@@ -295,28 +295,28 @@ function getIslandFromPosition(position) {
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.position", function(position) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Main] Setting position to ${position.x}, ${position.y}, ${position.z}`);
|
||||
localPlayer.position = position;
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.position", function(position) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Main] Setting position to ${position.x}, ${position.y}, ${position.z}`);
|
||||
localPlayer.position = position;
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.heading", function(heading) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Main] Setting heading to ${heading}`);
|
||||
localPlayer.heading = heading;
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.interior", function(interior) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Main] Interior set to ${interior}`);
|
||||
@@ -324,14 +324,14 @@ addNetworkHandler("ag.interior", function(interior) {
|
||||
gta.cameraInterior = interior;
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.removeFromVehicle", function() {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Main] Removing local player from vehicle`);
|
||||
localPlayer.removeFromVehicle();
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
function processEvent(event, deltaTime) {
|
||||
if(gta.game != GAME_GTA_IV) {
|
||||
@@ -430,7 +430,7 @@ function processEvent(event, deltaTime) {
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addEventHandler("OnDrawnHUD", function (event) {
|
||||
if(!renderHUD) {
|
||||
@@ -489,7 +489,7 @@ addEventHandler("OnDrawnHUD", function (event) {
|
||||
}
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
function openAllGarages() {
|
||||
switch(gta.game) {
|
||||
@@ -518,7 +518,7 @@ function openAllGarages() {
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
function closeAllGarages() {
|
||||
switch(gta.game) {
|
||||
@@ -547,14 +547,14 @@ function closeAllGarages() {
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.freeze", function(state) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Main] Setting frozen state to ${state}`);
|
||||
gui.showCursor(state, !state);
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.control", function(controlState, cursorState = false) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Main] Setting control state to ${controlState} (Cursor: ${cursorState})`);
|
||||
@@ -564,21 +564,21 @@ addNetworkHandler("ag.control", function(controlState, cursorState = false) {
|
||||
localPlayer.invincible = false;
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.fadeCamera", function(state, time) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Main] Fading camera ${(state)?"in":"out"} for ${time} seconds`);
|
||||
gta.fadeCamera(state, time);
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addEventHandler("OnPedWasted", function(event, wastedPed, killerPed, weapon, pedPiece) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Main] Ped ${wastedPed.name} died`);
|
||||
wastedPed.clearWeapons();
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.showBusStop", function(position, colour) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Main] Showing bus stop`);
|
||||
@@ -592,7 +592,7 @@ addNetworkHandler("ag.showBusStop", function(position, colour) {
|
||||
jobRouteStopBlip = gta.createBlip(position, 0, 2, colour);
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.snow", function(fallingSnow, groundSnow) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Main] Setting falling snow to ${fallingSnow} and ground snow to ${groundSnow}`);
|
||||
@@ -602,28 +602,28 @@ addNetworkHandler("ag.snow", function(fallingSnow, groundSnow) {
|
||||
}
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.money", function(amount) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Main] Setting local player money`);
|
||||
localPlayer.money = amount;
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.removeWorldObject", function(model, position, range) {
|
||||
logToConsole(LOG_DEBUG, `Removing world object ${model} at X: ${position.x}, Y: ${position.x}, Z: ${position.x} with range of ${range}`);
|
||||
gta.removeWorldObject(model, position, range);
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.excludeGroundSnow", function(model) {
|
||||
logToConsole(LOG_DEBUG, `Disabling ground snow for object model ${model}`);
|
||||
groundSnow.excludeModel(model);
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addEventHandler("OnLocalPlayerEnterSphere", function(event, sphere) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Main] Local player entered sphere`);
|
||||
@@ -632,7 +632,7 @@ addEventHandler("OnLocalPlayerEnterSphere", function(event, sphere) {
|
||||
}
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.smallGameMessage", function(text, colour, duration) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Main] Showing small game message '${text}' for ${duration}ms`);
|
||||
@@ -650,7 +650,7 @@ addNetworkHandler("ag.smallGameMessage", function(text, colour, duration) {
|
||||
}, duration);
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
function enteredJobRouteSphere() {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Main] Entered job route sphere`);
|
||||
@@ -661,21 +661,21 @@ function enteredJobRouteSphere() {
|
||||
jobRouteStopBlip = null;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.jobType", function(tempJobType) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Main] Set local player job type to ${tempJobType}`);
|
||||
localPlayerJobType = tempJobType;
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.working", function(tempWorking) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Main] Setting working state to ${tempWorking}`);
|
||||
localPlayerWorking = tempWorking;
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.spawned", function(client, state) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Main] Setting spawned state to ${state}`);
|
||||
@@ -716,21 +716,21 @@ addNetworkHandler("ag.spawned", function(client, state) {
|
||||
}
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.weaponDamageEvent", function(clientName, eventType) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Main] Set ${clientName} damage event type to ${eventType}`);
|
||||
weaponDamageEvent[clientName] = eventType;
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.weaponDamageEnabled", function(clientName, state) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Main] ${(state)?"Enabled":"Disabled"} damage from ${clientName}`);
|
||||
weaponDamageEnabled[clientName] = state;
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.mouseCamera", function(state) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Main] ${(state)?"Enabled":"Disabled"} mouse camera`);
|
||||
@@ -738,14 +738,14 @@ addNetworkHandler("ag.mouseCamera", function(state) {
|
||||
SetStandardControlsEnabled(!mouseCameraEnabled);
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.mouseCursor", function(state) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Main] ${(state)?"Enabled":"Disabled"} mouse cursor`);
|
||||
gui.showCursor(state, !state);
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
function clearSelfOwnedPeds() {
|
||||
logToConsole(LOG_DEBUG, `Clearing self-owned peds`);
|
||||
@@ -756,7 +756,7 @@ function clearSelfOwnedPeds() {
|
||||
});
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.set2DRendering", function(hudState, labelState, smallGameMessageState, scoreboardState, hotBarState, itemActionDelayState) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Main] Updating render states (HUD: ${hudState}, Labels: ${labelState}, Bottom Text: ${smallGameMessageState}, Scoreboard: ${scoreboardState}, HotBar: ${hotBarState}, Item Action Delay: ${itemActionDelayState})`);
|
||||
@@ -770,7 +770,7 @@ addNetworkHandler("ag.set2DRendering", function(hudState, labelState, smallGameM
|
||||
renderItemActionDelay = itemActionDelayState;
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
function getLocalPlayerVehicleSeat() {
|
||||
for(let i = 0 ; i <= 4 ; i++) {
|
||||
@@ -780,7 +780,7 @@ function getLocalPlayerVehicleSeat() {
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addEventHandler("OnPedInflictDamage", function(event, damagedEntity, damagerEntity, weaponId, healthLoss, pedPiece) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Main] ${damagerEntity.name} (${damagerEntity.name}, ${damagerEntity.type} - ${typeof damagerEntity}) damaged ${damagedEntity} (${damagedEntity.name}, ${damagedEntity.type} - ${typeof damagedEntity}) at part ${pedPiece} with weapon ${weaponId}`);
|
||||
@@ -796,7 +796,7 @@ addEventHandler("OnPedInflictDamage", function(event, damagedEntity, damagerEnti
|
||||
}
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addEventHandler("OnLocalPlayerExitedVehicle", function(event, vehicle, seat) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Main] Local player exited vehicle`);
|
||||
@@ -807,7 +807,7 @@ addEventHandler("OnLocalPlayerExitedVehicle", function(event, vehicle, seat) {
|
||||
}
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addEventHandler("OnLocalPlayerEnteredVehicle", function(event, vehicle, seat) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Main] Local player entered vehicle`);
|
||||
@@ -824,7 +824,7 @@ addEventHandler("OnLocalPlayerEnteredVehicle", function(event, vehicle, seat) {
|
||||
}
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.showItemActionDelay", function(duration) {
|
||||
itemActionDelayDuration = duration;
|
||||
@@ -833,13 +833,13 @@ addNetworkHandler("ag.showItemActionDelay", function(duration) {
|
||||
logToConsole(LOG_DEBUG, `Item action delay started. Duration: ${itemActionDelayDuration}, Start: ${itemActionDelayStart}, Rendering Enabled: ${renderItemActionDelay}`);
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
function getWeaponSlot(weaponId) {
|
||||
return getGameData().weaponSlots[gta.game][weaponId];
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.drunkEffect", function(amount, duration) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Main] Drunk effect set to ${amount} for ${duration}ms`);
|
||||
@@ -855,27 +855,27 @@ addNetworkHandler("ag.drunkEffect", function(amount, duration) {
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.clearPedState", function() {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Main] Clearing local ped state`);
|
||||
localPlayer.clearObjective();
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.pedSpeech", function(pedName, speechId) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Main] Making ${pedName}'s ped talk (${speechId})`);
|
||||
gta.SET_CHAR_SAY(int, int)
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.hotbar", function(activeSlot, itemsArray) {
|
||||
logToConsole(LOG_DEBUG, `[Asshat.Main] Updating hotbar`);
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
function getPedFromNetworkEvent(ped) {
|
||||
//let peds = getPeds();
|
||||
@@ -886,7 +886,7 @@ function getPedFromNetworkEvent(ped) {
|
||||
return getElementFromId(ped);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.skinSelect", function() {
|
||||
usingSkinSelector = true;
|
||||
@@ -898,4 +898,10 @@ addNetworkHandler("ag.skinSelect", function() {
|
||||
localPlayer.collisionsEnabled = false;
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
function isSnowEnabled() {
|
||||
return (typeof snowing != "undefined");
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -3,7 +3,7 @@
|
||||
// Asshat-Gaming Roleplay
|
||||
// https://github.com/VortrexFTW/gtac_asshat_rp
|
||||
// Copyright (c) 2021 Asshat-Gaming (https://asshatgaming.com)
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
// FILE: mouse-camera.js
|
||||
// DESC: Provides a freelook camera similar to SA for III and VC
|
||||
// TYPE: Client (JavaScript)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Asshat-Gaming Roleplay
|
||||
// https://github.com/VortrexFTW/gtac_asshat_rp
|
||||
// Copyright (c) 2021 Asshat-Gaming (https://asshatgaming.com)
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
// FILE: nametags.js
|
||||
// DESC: Provides nametag rendering
|
||||
// TYPE: Client (JavaScript)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Asshat-Gaming Roleplay
|
||||
// https://github.com/VortrexFTW/gtac_asshat_rp
|
||||
// Copyright (c) 2021 Asshat-Gaming (https://asshatgaming.com)
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
// FILE: scoreboard.js
|
||||
// DESC: Provides scoreboard features and rendering
|
||||
// TYPE: Client (JavaScript)
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
// Asshat-Gaming Roleplay
|
||||
// https://github.com/VortrexFTW/gtac_asshat_rp
|
||||
// Copyright (c) 2021 Asshat-Gaming (https://asshatgaming.com)
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
// FILE: sync.js
|
||||
// DESC: Provides some elements and data sync
|
||||
// TYPE: Client (JavaScript)
|
||||
// ===========================================================================
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addEventHandler("onProcess", function(event, deltaTime) {
|
||||
if(localPlayer != null && isSpawned) {
|
||||
@@ -24,25 +24,25 @@ addEventHandler("onProcess", function(event, deltaTime) {
|
||||
}
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.veh.engine", function(vehicle, state) {
|
||||
vehicle.engine = state;
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.veh.lights", function(vehicle, state) {
|
||||
vehicle.lights = state;
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.veh.repair", function(syncId) {
|
||||
getVehicleFromSyncId(syncId).fix();
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.veh.sync", function(event, vehicle) {
|
||||
if(vehicle != null) {
|
||||
@@ -50,7 +50,7 @@ addNetworkHandler("ag.veh.sync", function(event, vehicle) {
|
||||
}
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.civ.sync", function(event, civilian) {
|
||||
if(civilian != null) {
|
||||
@@ -58,7 +58,7 @@ addNetworkHandler("ag.civ.sync", function(event, civilian) {
|
||||
}
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.player.sync", function(event, player) {
|
||||
if(player != null) {
|
||||
@@ -66,7 +66,7 @@ addNetworkHandler("ag.player.sync", function(event, player) {
|
||||
}
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
addNetworkHandler("ag.obj.sync", function(event, object) {
|
||||
if(object != null) {
|
||||
@@ -74,7 +74,7 @@ addNetworkHandler("ag.obj.sync", function(event, object) {
|
||||
}
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
function syncVehicleProperties(vehicle) {
|
||||
if(doesEntityDataExist(vehicle, "ag.panelStatus")) {
|
||||
@@ -122,7 +122,7 @@ function syncVehicleProperties(vehicle) {
|
||||
//gta.REMOVE_UPSIDEDOWN_CAR_CHECK(gta.GET_VEHICLE_ID(vehicle));
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
function syncCivilianProperties(civilian) {
|
||||
if(doesEntityDataExist(civilian, "ag.scale")) {
|
||||
@@ -164,7 +164,7 @@ function syncCivilianProperties(civilian) {
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
function syncPlayerProperties(player) {
|
||||
if(doesEntityDataExist(player, "ag.scale")) {
|
||||
@@ -203,7 +203,7 @@ function syncPlayerProperties(player) {
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
|
||||
function syncObjectProperties(object) {
|
||||
if(doesEntityDataExist(object, "ag.scale")) {
|
||||
@@ -217,4 +217,4 @@ function syncObjectProperties(object) {
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ===========================================================================
|
||||
Reference in New Issue
Block a user