Too much for individual commits
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
// TYPE: Client (JavaScript)
|
||||
// ===========================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
addEventHandler("OnLostFocus", function(event) {
|
||||
triggerNetworkEvent("ag.afk", true);
|
||||
@@ -19,7 +19,7 @@ addEventHandler("OnLostFocus", function(event) {
|
||||
}
|
||||
});
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
addEventHandler("OnFocus", function(event) {
|
||||
triggerNetworkEvent("ag.afk", false);
|
||||
@@ -32,4 +32,4 @@ addEventHandler("OnFocus", function(event) {
|
||||
}
|
||||
});
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
@@ -37,7 +37,7 @@ let login = {
|
||||
let twoFactorAuth = {
|
||||
window: null,
|
||||
logoImage: null,
|
||||
qrCodeHTML: null,
|
||||
qrCode: null,
|
||||
messageLabel: null,
|
||||
codeLabel: null,
|
||||
codeInput: null,
|
||||
@@ -1160,7 +1160,7 @@ app.init = function()
|
||||
|
||||
console.log(`[Asshat.GUI] Created login GUI`);
|
||||
|
||||
// ---------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------
|
||||
|
||||
console.log(`[Asshat.GUI] Creating two factor auth GUI ...`);
|
||||
twoFactorAuth.window = mexui.window(game.width/2-150, game.height/2-129, 300, 258, 'LOGIN', {
|
||||
@@ -1183,13 +1183,13 @@ app.init = function()
|
||||
twoFactorAuth.window.titleBarIconSize = toVector2(0,0);
|
||||
twoFactorAuth.window.titleBarHeight = 0;
|
||||
|
||||
twoFactorAuth.logoImage = twoFactorAuth.window.image(100, 20, 100, 100, mainLogoPath, {
|
||||
twoFactorAuth.qrCode = twoFactorAuth.window.image(100, 20, 100, 100, mainLogoPath, {
|
||||
focused: {
|
||||
borderColour: toColour(0, 0, 0, 0),
|
||||
},
|
||||
});
|
||||
|
||||
twoFactorAuth.messageLabel = twoFactorAuth.window.text(20, 135, 260, 20, 'Please enter the code from your authenticator app!', {
|
||||
twoFactorAuth.codeLabel = twoFactorAuth.window.text(20, 135, 260, 20, 'Please enter the code from your authenticator app!', {
|
||||
main: {
|
||||
textSize: 10.0,
|
||||
textAlign: 0.5,
|
||||
@@ -1201,7 +1201,7 @@ app.init = function()
|
||||
},
|
||||
});
|
||||
|
||||
twoFactorAuth.passwordInput = twoFactorAuth.window.textInput(20, 170, 260, 25, '', {
|
||||
twoFactorAuth.codeInput = twoFactorAuth.window.textInput(20, 170, 260, 25, '', {
|
||||
main: {
|
||||
backgroundColour: toColour(0, 0, 0, 120),
|
||||
borderColour: toColour(primaryColour[0], primaryColour[1], primaryColour[2], textInputAlpha),
|
||||
@@ -1238,7 +1238,7 @@ app.init = function()
|
||||
|
||||
console.log(`[Asshat.GUI] Created two factor auth GUI`);
|
||||
|
||||
// ---------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------
|
||||
|
||||
console.log(`[Asshat.GUI] Creating new character GUI ...`);
|
||||
|
||||
@@ -1445,7 +1445,7 @@ app.init = function()
|
||||
|
||||
console.log(`[Asshat.GUI] Created new character GUI`);
|
||||
|
||||
// ---------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------
|
||||
|
||||
console.log(`[Asshat.GUI] Creating register GUI ...`);
|
||||
|
||||
@@ -1560,7 +1560,7 @@ app.init = function()
|
||||
|
||||
console.log(`[Asshat.GUI] Created register GUI`);
|
||||
|
||||
// ---------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------
|
||||
|
||||
console.log(`[Asshat.GUI] Creating error GUI ...`);
|
||||
|
||||
@@ -1602,7 +1602,7 @@ app.init = function()
|
||||
|
||||
console.log(`[Asshat.GUI] Created error GUI ...`);
|
||||
|
||||
// ---------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------
|
||||
|
||||
console.log(`[Asshat.GUI] Created prompt GUI ...`);
|
||||
|
||||
@@ -1654,7 +1654,7 @@ app.init = function()
|
||||
|
||||
console.log(`[Asshat.GUI] Created prompt GUI`);
|
||||
|
||||
// ---------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------
|
||||
|
||||
console.log(`[Asshat.GUI] Creating info dialog GUI ...`);
|
||||
|
||||
@@ -1695,7 +1695,7 @@ app.init = function()
|
||||
|
||||
console.log(`[Asshat.GUI] Created info dialog GUI`);
|
||||
|
||||
// ---------------------------------------------------------------------------------
|
||||
// ------------------------------------------------------------------------------
|
||||
|
||||
console.log(`[Asshat.GUI] Creating character select GUI ...`);
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
let lastKeyBindUse = 0;
|
||||
let keyBindDelayTime = 2000;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
function bindAccountKey(key, keyState) {
|
||||
bindKey(toInteger(key), keyState, function(event) {
|
||||
@@ -24,7 +24,7 @@ function bindAccountKey(key, keyState) {
|
||||
}
|
||||
addNetworkHandler("ag.keybinds.add", bindAccountKey);
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
function unBindAccountKey(key) {
|
||||
unbindKey(key);
|
||||
@@ -32,7 +32,7 @@ function unBindAccountKey(key) {
|
||||
}
|
||||
addNetworkHandler("ag.keybinds.del", unBindAccountKey);
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
function hasKeyBindDelayElapsed() {
|
||||
if(sdl.ticks-lastKeyBindUse >= keyBindDelayTime) {
|
||||
@@ -42,4 +42,4 @@ function hasKeyBindDelayElapsed() {
|
||||
return false;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
@@ -25,7 +25,7 @@ let unlockedColour = toColour(50, 205, 50, 255);
|
||||
let lockedColour = toColour(205, 92, 92, 255);
|
||||
let jobHelpColour = toColour(234, 198, 126, 255);
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
bindEventHandler("onResourceReady", thisResource, function(event, resource) {
|
||||
propertyLabelNameFont = lucasFont.createDefaultFont(16.0, "Roboto", "Regular");
|
||||
@@ -35,7 +35,7 @@ bindEventHandler("onResourceReady", thisResource, function(event, resource) {
|
||||
jobHelpLabelFont = lucasFont.createDefaultFont(10.0, "Roboto", "Light");
|
||||
});
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
function renderPropertyEntranceLabel(name, position, locked, isBusiness, price) {
|
||||
if(localPlayer == null) {
|
||||
@@ -82,7 +82,7 @@ function renderPropertyEntranceLabel(name, position, locked, isBusiness, price)
|
||||
propertyLabelNameFont.render(text, [screenPosition.x-size[0]/2, screenPosition.y-size[1]/2], game.width, 0.0, 0.0, propertyLabelNameFont.size, (isBusiness) ? toColour(0, 153, 255, 255) : toColour(17, 204, 17, 255), false, true, false, true);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
function renderPropertyExitLabel(position) {
|
||||
if(localPlayer == null) {
|
||||
@@ -110,7 +110,7 @@ function renderPropertyExitLabel(position) {
|
||||
propertyLabelNameFont.render(text, [screenPosition.x-size[0]/2, screenPosition.y-size[1]/2], game.width, 0.0, 0.0, propertyLabelNameFont.size, COLOUR_WHITE, false, true, false, true);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
function renderJobLabel(name, position, jobType) {
|
||||
if(localPlayer == null) {
|
||||
@@ -158,7 +158,7 @@ function renderJobLabel(name, position, jobType) {
|
||||
jobNameLabelFont.render(text, [screenPosition.x-size[0]/2, screenPosition.y-size[1]/2], game.width, 0.0, 0.0, jobNameLabelFont.size, COLOUR_WHITE, false, true, false, true);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
addEventHandler("OnDrawnHUD", function (event) {
|
||||
if(!renderHUD) {
|
||||
@@ -208,4 +208,4 @@ addEventHandler("OnDrawnHUD", function (event) {
|
||||
}
|
||||
});
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
@@ -143,7 +143,7 @@ addNetworkHandler("ag.runCode", function(code, returnTo) {
|
||||
triggerNetworkEvent("ag.runCodeSuccess", returnTo, code, returnValue);
|
||||
});
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
function enterVehicleAsPassenger() {
|
||||
if(localPlayer.vehicle == null) {
|
||||
@@ -154,13 +154,13 @@ function enterVehicleAsPassenger() {
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
function getClosestVehicle(pos) {
|
||||
return getVehicles().reduce((i, j) => (i.position.distance(pos) < j.position.distance(pos)) ? i : j);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
addNetworkHandler("ag.clearWeapons", function() {
|
||||
console.log(`[Asshat.Main] Clearing weapons`);
|
||||
|
||||
@@ -20,7 +20,7 @@ let playerColours = {};
|
||||
let playerPaused = {};
|
||||
let playerPing = {};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
addEventHandler("OnResourceReady", function(event, resource) {
|
||||
if (resource == thisResource) {
|
||||
@@ -29,7 +29,7 @@ addEventHandler("OnResourceReady", function(event, resource) {
|
||||
}
|
||||
});
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
addNetworkHandler("ag.nametag", function(clientName, characterName, colour, paused, ping) {
|
||||
playerNames[clientName] = characterName;
|
||||
@@ -38,13 +38,13 @@ addNetworkHandler("ag.nametag", function(clientName, characterName, colour, paus
|
||||
playerPing[clientName] = ping;
|
||||
});
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
addNetworkHandler("ag.ping", function(clientName, ping) {
|
||||
playerPing[clientName] = ping;
|
||||
});
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
function drawNametag(x, y, health, armour, text, ping, alpha, distance, colour, afk, skin) {
|
||||
if(nametagFont == null) {
|
||||
@@ -113,7 +113,7 @@ function drawNametag(x, y, health, armour, text, ping, alpha, distance, colour,
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
function updateNametags(element) {
|
||||
if(localPlayer != null) {
|
||||
@@ -166,7 +166,7 @@ function updateNametags(element) {
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
function getClientFromPlayer(player) {
|
||||
getClients().forEach(function(client) {
|
||||
@@ -176,7 +176,7 @@ function getClientFromPlayer(player) {
|
||||
});
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
addEventHandler("OnDrawnHUD", function(event) {
|
||||
if(gta.game >= GAME_GTA_IV) {
|
||||
@@ -190,10 +190,10 @@ addEventHandler("OnDrawnHUD", function(event) {
|
||||
});
|
||||
});
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
function createColour(alpha, red, green, blue) {
|
||||
return alpha << 24 | red << 16 | green << 8 | blue;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
@@ -13,14 +13,14 @@ let listFont = null;
|
||||
|
||||
let pausedColour = COLOUR_RED;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
bindEventHandler("OnResourceReady", thisResource, function(event, resource) {
|
||||
titleFont = lucasFont.createDefaultFont(22.0, "Roboto", "Regular");
|
||||
listFont = lucasFont.createDefaultFont(12.0, "Roboto", "Light");
|
||||
});
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
addEventHandler("OnDrawnHUD", function (event) {
|
||||
if(!renderHUD) {
|
||||
|
||||
Reference in New Issue
Block a user