formatting(all): Format with prettier and lua formatter

This commit is contained in:
TheFantomas
2023-07-09 17:00:36 +02:00
parent 860ecbfbc4
commit 9049c98d76
49 changed files with 3915 additions and 2635 deletions
+10
View File
@@ -0,0 +1,10 @@
root = true
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
trim_trailing_whitespace = true
max_line_length = 300
indent_size = 4
indent_style = space
+5 -1
View File
@@ -15,7 +15,11 @@ function GetTime()
local h = tonumber(os.date('%H', timestamp))
local m = tonumber(os.date('%M', timestamp))
return { d = d, h = h, m = m }
return {
d = d,
h = h,
m = m
}
end
function OnTime(d, h, m)
+32 -38
View File
@@ -26,7 +26,7 @@ end
function ESX.SearchInventory(items, count)
if type(items) == 'string' then
items = {items}
items = { items }
end
local returnData = {}
@@ -203,7 +203,6 @@ function ESX.UI.Menu.Open(type, namespace, name, data, submit, cancel, change, c
menu.change = change
menu.close = function()
ESX.UI.Menu.RegisteredTypes[type].close(namespace, name)
for i = 1, #ESX.UI.Menu.Opened, 1 do
@@ -218,11 +217,9 @@ function ESX.UI.Menu.Open(type, namespace, name, data, submit, cancel, change, c
if close then
close()
end
end
menu.update = function(query, newData)
for i = 1, #menu.data.elements, 1 do
local match = true
@@ -238,7 +235,6 @@ function ESX.UI.Menu.Open(type, namespace, name, data, submit, cancel, change, c
end
end
end
end
menu.refresh = function()
@@ -266,7 +262,6 @@ function ESX.UI.Menu.Open(type, namespace, name, data, submit, cancel, change, c
break
end
end
end
end
end
@@ -496,7 +491,6 @@ function ESX.Game.GetPlayers(onlyOtherPlayers, returnKeyValue, returnPeds)
return players
end
function ESX.Game.GetClosestObject(coords, modelFilter)
return ESX.Game.GetClosestEntity(ESX.Game.GetObjects(), false, coords, modelFilter)
end
@@ -604,19 +598,19 @@ function ESX.Game.GetVehicleProperties(vehicle)
local interiorColor = GetVehicleInteriorColour(vehicle)
local customPrimaryColor = nil
if hasCustomPrimaryColor then
customPrimaryColor = {GetVehicleCustomPrimaryColour(vehicle)}
customPrimaryColor = { GetVehicleCustomPrimaryColour(vehicle) }
end
local hasCustomXenonColor, customXenonColorR, customXenonColorG, customXenonColorB = GetVehicleXenonLightsCustomColor(vehicle)
local customXenonColor = nil
if hasCustomXenonColor then
customXenonColor = {customXenonColorR, customXenonColorG, customXenonColorB}
customXenonColor = { customXenonColorR, customXenonColorG, customXenonColorB }
end
local hasCustomSecondaryColor = GetIsVehicleSecondaryColourCustom(vehicle)
local customSecondaryColor = nil
if hasCustomSecondaryColor then
customSecondaryColor = {GetVehicleCustomSecondaryColour(vehicle)}
customSecondaryColor = { GetVehicleCustomSecondaryColour(vehicle) }
end
local extras = {}
@@ -635,10 +629,10 @@ function ESX.Game.GetVehicleProperties(vehicle)
local numWheels = tostring(GetVehicleNumberOfWheels(vehicle))
local TyresIndex = { -- Wheel index list according to the number of vehicle wheels.
['2'] = {0, 4}, -- Bike and cycle.
['3'] = {0, 1, 4, 5}, -- Vehicle with 3 wheels (get for wheels because some 3 wheels vehicles have 2 wheels on front and one rear or the reverse).
['4'] = {0, 1, 4, 5}, -- Vehicle with 4 wheels.
['6'] = {0, 1, 2, 3, 4, 5} -- Vehicle with 6 wheels.
['2'] = { 0, 4 }, -- Bike and cycle.
['3'] = { 0, 1, 4, 5 }, -- Vehicle with 3 wheels (get for wheels because some 3 wheels vehicles have 2 wheels on front and one rear or the reverse).
['4'] = { 0, 1, 4, 5 }, -- Vehicle with 4 wheels.
['6'] = { 0, 1, 2, 3, 4, 5 } -- Vehicle with 6 wheels.
}
if TyresIndex[numWheels] then
@@ -690,8 +684,8 @@ function ESX.Game.GetVehicleProperties(vehicle)
xenonColor = GetVehicleXenonLightsColor(vehicle),
customXenonColor = customXenonColor,
neonEnabled = {IsVehicleNeonLightEnabled(vehicle, 0), IsVehicleNeonLightEnabled(vehicle, 1),
IsVehicleNeonLightEnabled(vehicle, 2), IsVehicleNeonLightEnabled(vehicle, 3)},
neonEnabled = { IsVehicleNeonLightEnabled(vehicle, 0), IsVehicleNeonLightEnabled(vehicle, 1),
IsVehicleNeonLightEnabled(vehicle, 2), IsVehicleNeonLightEnabled(vehicle, 3) },
neonColor = table.pack(GetVehicleNeonLightsColour(vehicle)),
extras = extras,
@@ -1074,7 +1068,7 @@ function ESX.ShowInventory()
local playerPed = ESX.PlayerData.ped
local elements = {
{unselectable = true, icon = 'fas fa-box', title = 'Player Inventory'}
{ unselectable = true, icon = 'fas fa-box', title = 'Player Inventory' }
}
local currentWeight = 0
@@ -1083,7 +1077,7 @@ function ESX.ShowInventory()
local formattedMoney = TranslateCap('locale_currency', ESX.Math.GroupDigits(ESX.PlayerData.accounts[i].money))
local canDrop = ESX.PlayerData.accounts[i].name ~= 'bank'
elements[#elements+1] = {
elements[#elements + 1] = {
icon = 'fas fa-money-bill-wave',
title = ('%s: <span style="color:green;">%s</span>'):format(ESX.PlayerData.accounts[i].label, formattedMoney),
count = ESX.PlayerData.accounts[i].money,
@@ -1100,7 +1094,7 @@ function ESX.ShowInventory()
if v.count > 0 then
currentWeight = currentWeight + (v.weight * v.count)
elements[#elements+1] = {
elements[#elements + 1] = {
icon = 'fas fa-box',
title = ('%s x%s'):format(v.label, v.count),
count = v.count,
@@ -1119,7 +1113,7 @@ function ESX.ShowInventory()
if HasPedGotWeapon(playerPed, weaponHash, false) then
local ammo = GetAmmoInPedWeapon(playerPed, weaponHash)
elements[#elements+1] = {
elements[#elements + 1] = {
icon = 'fas fa-gun',
title = v.ammo and ('%s - %s %s'):format(v.label, ammo, v.ammo.label) or v.label,
count = 1,
@@ -1134,10 +1128,10 @@ function ESX.ShowInventory()
end
end
elements[#elements+1] = {
elements[#elements + 1] = {
unselectable = true,
icon = "fas fa-weight",
title = "Current Weight: "..currentWeight
title = "Current Weight: " .. currentWeight
}
ESX.CloseContext()
@@ -1148,7 +1142,7 @@ function ESX.ShowInventory()
local elements2 = {}
if element.usable then
elements2[#elements2+1] = {
elements2[#elements2 + 1] = {
icon = "fas fa-utensils",
title = TranslateCap('use'),
action = 'use',
@@ -1159,7 +1153,7 @@ function ESX.ShowInventory()
if element.canRemove then
if player ~= -1 and distance <= 3.0 then
elements2[#elements2+1] = {
elements2[#elements2 + 1] = {
icon = "fas fa-hands",
title = TranslateCap('give'),
action = 'give',
@@ -1168,7 +1162,7 @@ function ESX.ShowInventory()
}
end
elements2[#elements2+1] = {
elements2[#elements2 + 1] = {
icon = "fas fa-trash",
title = TranslateCap('remove'),
action = 'remove',
@@ -1178,7 +1172,7 @@ function ESX.ShowInventory()
end
if element.type == 'item_weapon' and element.canGiveAmmo and element.ammo > 0 and player ~= -1 and distance <= 3.0 then
elements2[#elements2+1] = {
elements2[#elements2 + 1] = {
icon = "fas fa-gun",
title = TranslateCap('giveammo'),
action = 'give_ammo',
@@ -1187,7 +1181,7 @@ function ESX.ShowInventory()
}
end
elements2[#elements2+1] = {
elements2[#elements2 + 1] = {
icon = "fas fa-arrow-left",
title = TranslateCap('return'),
action = 'return'
@@ -1202,7 +1196,7 @@ function ESX.ShowInventory()
if #playersNearby > 0 then
local players = {}
local elements3 = {
{unselectable = true, icon = "fas fa-users", title = "Nearby Players"}
{ unselectable = true, icon = "fas fa-users", title = "Nearby Players" }
}
for _, playerNearby in ipairs(playersNearby) do
@@ -1211,7 +1205,7 @@ function ESX.ShowInventory()
ESX.TriggerServerCallback('esx:getPlayerNames', function(returnedPlayers)
for playerId, playerName in pairs(returnedPlayers) do
elements3[#elements3+1] = {
elements3[#elements3 + 1] = {
icon = "fas fa-user",
title = playerName,
playerId = playerId
@@ -1232,9 +1226,9 @@ function ESX.ShowInventory()
ESX.CloseContext()
else
local elementsG = {
{unselectable = true, icon = "fas fa-trash", title = element.title},
{icon = "fas fa-tally", title = "Amount.", input = true, inputType = "number", inputPlaceholder = "Amount to give..", inputMin = 1, inputMax = 1000},
{icon = "fas fa-check-double", title = "Confirm", val = "confirm"}
{ unselectable = true, icon = "fas fa-trash", title = element.title },
{ icon = "fas fa-tally", title = "Amount.", input = true, inputType = "number", inputPlaceholder = "Amount to give..", inputMin = 1, inputMax = 1000 },
{ icon = "fas fa-check-double", title = "Confirm", val = "confirm" }
}
ESX.OpenContext("right", elementsG, function(menuG, _)
@@ -1271,9 +1265,9 @@ function ESX.ShowInventory()
TriggerServerEvent('esx:removeInventoryItem', type, item)
else
local elementsR = {
{unselectable = true, icon = "fas fa-trash", title = element.title},
{icon = "fas fa-tally", title = "Amount.", input = true, inputType = "number", inputPlaceholder = "Amount to remove..", inputMin = 1, inputMax = 1000},
{icon = "fas fa-check-double", title = "Confirm", val = "confirm"}
{ unselectable = true, icon = "fas fa-trash", title = element.title },
{ icon = "fas fa-tally", title = "Amount.", input = true, inputType = "number", inputPlaceholder = "Amount to remove..", inputMin = 1, inputMax = 1000 },
{ icon = "fas fa-check-double", title = "Confirm", val = "confirm" }
}
ESX.OpenContext("right", elementsR, function(menuR, _)
@@ -1306,9 +1300,9 @@ function ESX.ShowInventory()
if closestPlayer ~= -1 and closestDistance < 3.0 then
if pedAmmo > 0 then
local elementsGA = {
{unselectable = true, icon = "fas fa-trash", title = element.title},
{icon = "fas fa-tally", title = "Amount.", input = true, inputType = "number", inputPlaceholder = "Amount to give..", inputMin = 1, inputMax = 1000},
{icon = "fas fa-check-double", title = "Confirm", val = "confirm"}
{ unselectable = true, icon = "fas fa-trash", title = element.title },
{ icon = "fas fa-tally", title = "Amount.", input = true, inputType = "number", inputPlaceholder = "Amount to give..", inputMin = 1, inputMax = 1000 },
{ icon = "fas fa-check-double", title = "Confirm", val = "confirm" }
}
ESX.OpenContext("right", elementsGA, function(menuGA, _)
+1 -2
View File
@@ -20,8 +20,7 @@ html {
font-size: 2em;
font-weight: bold;
color: #fff;
text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000,
1px 1px 0 #000;
text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}
.menu {
File diff suppressed because one or more lines are too long
+1 -2
View File
@@ -4,8 +4,7 @@
ESXWrapper.messageId = 0;
window.SendMessage = function (namespace, type, msg) {
ESXWrapper.messageId =
ESXWrapper.messageId < 65535 ? ESXWrapper.messageId + 1 : 0;
ESXWrapper.messageId = ESXWrapper.messageId < 65535 ? ESXWrapper.messageId + 1 : 0;
const str = JSON.stringify(msg);
for (let i = 0; i < str.length; i++) {
+1 -1
View File
@@ -403,7 +403,7 @@ function ESX.RefreshJobs()
if not Jobs then
-- Fallback data, if no jobs exist
ESX.Jobs['unemployed'] = {label = 'Unemployed', grades = {['0'] = {grade = 0, label = 'Unemployed', salary = 200, skin_male = {}, skin_female = {}}}}
ESX.Jobs['unemployed'] = { label = 'Unemployed', grades = { ['0'] = { grade = 0, label = 'Unemployed', salary = 200, skin_male = {}, skin_female = {} } } }
else
ESX.Jobs = Jobs
end
+24 -11
View File
@@ -52,11 +52,10 @@ function onPlayerJoined(playerId)
('there was an error loading your character!\nError code: identifier-active-ingame\n\nThis error is caused by a player on this server who has the same identifier as you have. Make sure you are not playing on the same Rockstar account.\n\nYour Rockstar identifier: %s'):format(
identifier))
else
local result = MySQL.scalar.await('SELECT 1 FROM users WHERE identifier = ?', {identifier})
local result = MySQL.scalar.await('SELECT 1 FROM users WHERE identifier = ?', { identifier })
if result then
loadESXPlayer(identifier, playerId, false)
else
createESXPlayer(identifier, playerId)
end
end
@@ -80,12 +79,12 @@ function createESXPlayer(identifier, playerId, data)
end
if not Config.Multichar then
MySQL.prepare(newPlayer, {json.encode(accounts), identifier, defaultGroup}, function()
MySQL.prepare(newPlayer, { json.encode(accounts), identifier, defaultGroup }, function()
loadESXPlayer(identifier, playerId, true)
end)
else
MySQL.prepare(newPlayer,
{json.encode(accounts), identifier, defaultGroup, data.firstname, data.lastname, data.dateofbirth, data.sex, data.height}, function()
{ json.encode(accounts), identifier, defaultGroup, data.firstname, data.lastname, data.dateofbirth, data.sex, data.height }, function()
loadESXPlayer(identifier, playerId, true)
end)
end
@@ -363,7 +362,6 @@ function loadESXPlayer(identifier, playerId, isNew)
print(('[^2INFO^0] Player ^5"%s"^0 has connected to the server. ID: ^5%s^7'):format(xPlayer.getName(), playerId))
end
AddEventHandler('chatMessage', function(playerId, _, message)
local xPlayer = ESX.GetPlayerFromId(playerId)
if message:sub(1, 1) == '/' and playerId > 0 then
@@ -621,8 +619,16 @@ end
ESX.RegisterServerCallback('esx:getPlayerData', function(source, cb)
local xPlayer = ESX.GetPlayerFromId(source)
cb({identifier = xPlayer.identifier, accounts = xPlayer.getAccounts(), inventory = xPlayer.getInventory(), job = xPlayer.getJob(),
loadout = xPlayer.getLoadout(), money = xPlayer.getMoney(), position = xPlayer.getCoords(true), metadata = xPlayer.getMeta()})
cb({
identifier = xPlayer.identifier,
accounts = xPlayer.getAccounts(),
inventory = xPlayer.getInventory(),
job = xPlayer.getJob(),
loadout = xPlayer.getLoadout(),
money = xPlayer.getMoney(),
position = xPlayer.getCoords(true),
metadata = xPlayer.getMeta()
})
end)
ESX.RegisterServerCallback('esx:isUserAdmin', function(source, cb)
@@ -636,8 +642,16 @@ end)
ESX.RegisterServerCallback('esx:getOtherPlayerData', function(_, cb, target)
local xPlayer = ESX.GetPlayerFromId(target)
cb({identifier = xPlayer.identifier, accounts = xPlayer.getAccounts(), inventory = xPlayer.getInventory(), job = xPlayer.getJob(),
loadout = xPlayer.getLoadout(), money = xPlayer.getMoney(), position = xPlayer.getCoords(true), metadata = xPlayer.getMeta()})
cb({
identifier = xPlayer.identifier,
accounts = xPlayer.getAccounts(),
inventory = xPlayer.getInventory(),
job = xPlayer.getJob(),
loadout = xPlayer.getLoadout(),
money = xPlayer.getMoney(),
position = xPlayer.getCoords(true),
metadata = xPlayer.getMeta()
})
end)
ESX.RegisterServerCallback('esx:getPlayerNames', function(source, cb, players)
@@ -656,7 +670,7 @@ ESX.RegisterServerCallback('esx:getPlayerNames', function(source, cb, players)
cb(players)
end)
ESX.RegisterServerCallback("esx:spawnVehicle", function(source,cb,vehData)
ESX.RegisterServerCallback("esx:spawnVehicle", function(source, cb, vehData)
local ped = GetPlayerPed(source)
ESX.OneSync.SpawnVehicle(vehData.model or `ADDER`, vehData.coords or GetEntityCoords(ped), vehData.coords.w or 0.0, vehData.props or {}, function(id)
if vehData.warp then
@@ -684,4 +698,3 @@ end)
AddEventHandler('txAdmin:events:serverShuttingDown', function()
Core.SavePlayers()
end)
+4 -14
View File
@@ -2,14 +2,8 @@
<html>
<head>
<script src="nui://game/ui/jquery.js" type="text/javascript"></script>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css"
/>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css"
/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" />
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
@@ -227,10 +221,7 @@
<i class="fas fa-check"></i>
<div>
<b>Item</b>
<i
>Testing, testing a description here. Generic words to force
overflow.</i
>
<i>Testing, testing a description here. Generic words to force overflow.</i>
</div>
</div>
</div>
@@ -278,8 +269,7 @@
let input = CreateElement("INPUT", "", container);
input.type = "radio";
input.name = i + 1;
input.checked =
(ele.inputValue || ele.inputPlaceholder || -1) === v.value;
input.checked = (ele.inputValue || ele.inputPlaceholder || -1) === v.value;
let span = CreateElement("SPAN", "checkmark", container);
+2 -2
View File
@@ -76,7 +76,7 @@ input {
width: 36%;
}
.radio-toolbar input[type="radio"]:checked+label {
.radio-toolbar input[type="radio"]:checked + label {
width: 36%;
background-color: rgba(15, 15, 15, 0.9);
border: none;
@@ -85,7 +85,7 @@ input {
color: #ffffff;
}
.radio-toolbar input[type="radio"]:focus+label {
.radio-toolbar input[type="radio"]:focus + label {
background-color: rgba(15, 15, 15, 0.9);
border: none;
border-bottom: 1px solid #93a3b6;
+10 -38
View File
@@ -1,48 +1,23 @@
<!DOCTYPE html>
<html lang="en">
<head>
<head>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous" />
<link href="css/style.css" rel="stylesheet" />
<title>ESX Identity</title>
</head>
</head>
<body class="none" onkeydown="TriggeredKey(this)">
<body class="none" onkeydown="TriggeredKey(this)">
<div class="dialog">
<div class="title"><b>IDENTITY</b></div>
<form id="register" name="register" action="#">
<div style="
color: rgb(46, 187, 205);
font-size: 12px;
font-family: 'Gill Sans', sans-serif;
">
First Name
</div>
<div style="color: rgb(46, 187, 205); font-size: 12px; font-family: 'Gill Sans', sans-serif">First Name</div>
<input id="firstname" type="text" class="" name="firstname" placeholder="First Name" minlength="3" maxlength="8" pattern="[a-zA-Z]*" /><br />
<div style="
color: rgb(46, 187, 205);
font-size: 12px;
font-family: 'Gill Sans', sans-serif;
">
Last Name
</div>
<div style="color: rgb(46, 187, 205); font-size: 12px; font-family: 'Gill Sans', sans-serif">Last Name</div>
<input id="lastname" type="text" class="" name="lastname" placeholder="Last Name" minlength="3" maxlength="10" pattern="[a-zA-Z]*" /><br />
<div style="
color: rgb(46, 187, 205);
font-size: 12px;
font-family: 'Gill Sans', sans-serif;
">
Date of Birth (MM/DD/YYYY)
</div>
<div style="color: rgb(46, 187, 205); font-size: 12px; font-family: 'Gill Sans', sans-serif">Date of Birth (MM/DD/YYYY)</div>
<input id="dateofbirth" type="date" name="dateofbirth" class="" min="1900-01-01" max="2010-01-01" onfocus="(this.type='date')" /><br />
<div style="
color: rgb(46, 187, 205);
font-size: 12px;
font-family: 'Gill Sans', sans-serif;
">
Height
</div>
<div style="color: rgb(46, 187, 205); font-size: 12px; font-family: 'Gill Sans', sans-serif">Height</div>
<input id="height" type="number" class="" name="height" min="120" max="220" placeholder="Height (cm)" /><br />
<center>
<div class="radio-toolbar">
@@ -58,8 +33,7 @@
</button>
</form>
<center>
<font size="1px" color="green">If the submit button doesn't work, please ensure that you've entered
the fields correctly.</font>
<font size="1px" color="green">If the submit button doesn't work, please ensure that you've entered the fields correctly.</font>
</center>
</div>
@@ -67,11 +41,9 @@
function TriggeredKey(e) {
var keycode;
if (window.event) keycode = window.event.keyCode;
if (window.event.keyCode === 13 || window.event.keyCode === 27)
return false;
if (window.event.keyCode === 13 || window.event.keyCode === 27) return false;
}
</script>
<script src="js/script.js" defer></script>
</body>
</body>
</html>
+4 -11
View File
@@ -12,15 +12,9 @@ document.querySelector("#register").addEventListener("submit", (event) => {
const dateCheck = new Date(dofVal);
const year = new Intl.DateTimeFormat("en", { year: "numeric" }).format(
dateCheck
);
const month = new Intl.DateTimeFormat("en", { month: "2-digit" }).format(
dateCheck
);
const day = new Intl.DateTimeFormat("en", { day: "2-digit" }).format(
dateCheck
);
const year = new Intl.DateTimeFormat("en", { year: "numeric" }).format(dateCheck);
const month = new Intl.DateTimeFormat("en", { month: "2-digit" }).format(dateCheck);
const day = new Intl.DateTimeFormat("en", { day: "2-digit" }).format(dateCheck);
const formattedDate = `${day}/${month}/${year}`;
fetch("http://esx_identity/register", {
@@ -29,8 +23,7 @@ document.querySelector("#register").addEventListener("submit", (event) => {
firstname: document.querySelector("#firstname").value,
lastname: document.querySelector("#lastname").value,
dateofbirth: formattedDate,
sex: document.querySelector("input[type='radio'][name='sex']:checked")
.value,
sex: document.querySelector("input[type='radio'][name='sex']:checked").value,
height: document.querySelector("#height").value,
}),
});
+1 -4
View File
@@ -1,10 +1,7 @@
<html lang="en">
<head>
<link rel="stylesheet" href="css/index.css" type="text/css" />
<link
href="https://fonts.googleapis.com/css2?family=Quicksand&display=swap"
rel="stylesheet"
/>
<link href="https://fonts.googleapis.com/css2?family=Quicksand&display=swap" rel="stylesheet" />
<script src="./js/index.js" type="text/javascript"></script>
</head>
+6 -18
View File
@@ -71,10 +71,7 @@
delete ESX_MENU.opened[namespace][name];
for (let i = 0; i < ESX_MENU.focus.length; i++) {
if (
ESX_MENU.focus[i].namespace === namespace &&
ESX_MENU.focus[i].name === name
) {
if (ESX_MENU.focus[i].namespace === namespace && ESX_MENU.focus[i].name === name) {
ESX_MENU.focus.splice(i, 1);
break;
}
@@ -103,10 +100,7 @@
case "slider": {
element.isSlider = true;
element.sliderLabel =
typeof element.options === "undefined"
? element.value
: element.options[element.value];
element.sliderLabel = typeof element.options === "undefined" ? element.value : element.options[element.value];
break;
}
@@ -221,12 +215,10 @@
if (pos > 0) {
ESX_MENU.pos[focused.namespace][focused.name]--;
} else {
ESX_MENU.pos[focused.namespace][focused.name] =
menu.elements.length - 1;
ESX_MENU.pos[focused.namespace][focused.name] = menu.elements.length - 1;
}
let elem =
menu.elements[ESX_MENU.pos[focused.namespace][focused.name]];
let elem = menu.elements[ESX_MENU.pos[focused.namespace][focused.name]];
for (let i = 0; i < menu.elements.length; i++) {
if (i === ESX_MENU.pos[focused.namespace][focused.name]) {
@@ -261,8 +253,7 @@
ESX_MENU.pos[focused.namespace][focused.name] = 0;
}
let elem =
menu.elements[ESX_MENU.pos[focused.namespace][focused.name]];
let elem = menu.elements[ESX_MENU.pos[focused.namespace][focused.name]];
for (let i = 0; i < menu.elements.length; i++) {
if (i === ESX_MENU.pos[focused.namespace][focused.name]) {
@@ -332,10 +323,7 @@
break;
case "slider": {
if (
typeof elem.options != "undefined" &&
elem.value < elem.options.length - 1
) {
if (typeof elem.options != "undefined" && elem.value < elem.options.length - 1) {
elem.value++;
ESX_MENU.change(focused.namespace, focused.name, elem);
}
File diff suppressed because one or more lines are too long
+3 -12
View File
@@ -3,23 +3,14 @@
<meta charset="utf-8" />
<link rel="stylesheet" href="nui://esx_menu_default/html/css/app.css" />
<link rel="preconnect" href="https://fonts.gstatic.com" />
<link
href="https://fonts.googleapis.com/css2?family=PT+Sans+Narrow&display=swap"
rel="stylesheet"
/>
<link href="https://fonts.googleapis.com/css2?family=PT+Sans+Narrow&display=swap" rel="stylesheet" />
</head>
<body>
<div id="menus"></div>
<script src="nui://game/ui/jquery.js" type="text/javascript"></script>
<script
src="nui://esx_menu_default/html/js/mustache.min.js"
type="text/javascript"
></script>
<script
src="nui://esx_menu_default/html/js/app.js"
type="text/javascript"
></script>
<script src="nui://esx_menu_default/html/js/mustache.min.js" type="text/javascript"></script>
<script src="nui://esx_menu_default/html/js/app.js" type="text/javascript"></script>
</body>
</html>
+1 -4
View File
@@ -64,10 +64,7 @@
delete ESX_MENU.opened[namespace][name];
for (let i = 0; i < ESX_MENU.focus.length; i++) {
if (
ESX_MENU.focus[i].namespace === namespace &&
ESX_MENU.focus[i].name === name
) {
if (ESX_MENU.focus[i].namespace === namespace && ESX_MENU.focus[i].name === name) {
ESX_MENU.focus.splice(i, 1);
break;
}
File diff suppressed because one or more lines are too long
+3 -12
View File
@@ -3,10 +3,7 @@
<meta charset="utf-8" />
<link rel="stylesheet" href="nui://esx_menu_dialog/html/css/app.css" />
<link rel="preconnect" href="https://fonts.gstatic.com" />
<link
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@1,300&family=PT+Sans+Narrow&display=swap"
rel="stylesheet"
/>
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@1,300&family=PT+Sans+Narrow&display=swap" rel="stylesheet" />
</head>
<body>
@@ -14,13 +11,7 @@
<script src="nui://game/ui/jquery.js" type="text/javascript"></script>
<script src="nui://es_extended/html/js/wrapper.js"></script>
<script
src="nui://esx_menu_dialog/html/js/mustache.min.js"
type="text/javascript"
></script>
<script
src="nui://esx_menu_dialog/html/js/app.js"
type="text/javascript"
></script>
<script src="nui://esx_menu_dialog/html/js/mustache.min.js" type="text/javascript"></script>
<script src="nui://esx_menu_dialog/html/js/app.js" type="text/javascript"></script>
</body>
</html>
+4 -24
View File
@@ -48,10 +48,7 @@
delete ESX_MENU.opened[namespace][name];
for (let i = 0; i < ESX_MENU.focus.length; i++) {
if (
ESX_MENU.focus[i].namespace === namespace &&
ESX_MENU.focus[i].name === name
) {
if (ESX_MENU.focus[i].namespace === namespace && ESX_MENU.focus[i].name === name) {
ESX_MENU.focus.splice(i, 1);
break;
}
@@ -107,20 +104,7 @@
}
for (let k = 0; k < matches.length; k++) {
col = col.replace(
"{{" + matches[k][1] + "|" + matches[k][2] + "}}",
'<button data-id="' +
i +
'" data-namespace="' +
namespace +
'" data-name="' +
name +
'" data-value="' +
matches[k][2] +
'">' +
matches[k][1] +
"</button>"
);
col = col.replace("{{" + matches[k][1] + "|" + matches[k][2] + "}}", '<button data-id="' + i + '" data-namespace="' + namespace + '" data-name="' + name + '" data-value="' + matches[k][2] + '">' + matches[k][1] + "</button>");
}
view.rows[i].cols.push({ data: data, content: col });
@@ -130,13 +114,9 @@
let menu = $(Mustache.render(MenuTpl, view));
menu.find("button[data-namespace][data-name]").click(function () {
ESX_MENU.data[$(this).data("namespace")][$(this).data("name")][
parseInt($(this).data("id"))
].currentRow = parseInt($(this).data("id")) + 1;
ESX_MENU.data[$(this).data("namespace")][$(this).data("name")][parseInt($(this).data("id"))].currentRow = parseInt($(this).data("id")) + 1;
ESX_MENU.submit($(this).data("namespace"), $(this).data("name"), {
data: ESX_MENU.data[$(this).data("namespace")][
$(this).data("name")
][parseInt($(this).data("id"))],
data: ESX_MENU.data[$(this).data("namespace")][$(this).data("name")][parseInt($(this).data("id"))],
value: $(this).data("value"),
});
});
File diff suppressed because one or more lines are too long
+1 -3
View File
@@ -48,9 +48,7 @@ var money = Intl.NumberFormat("en-US", {
Kashacter.CloseUI = function () {
$("body").css({ display: "none" });
$(".main-container").css({ display: "none" });
$("[data-charid=1]").html(
'<h3 class="character-fullname"></h3><div class="character-info"><p class="character-info-new"></p></div>'
);
$("[data-charid=1]").html('<h3 class="character-fullname"></h3><div class="character-info"><p class="character-info-new"></p></div>');
};
window.onload = function (e) {
+2 -9
View File
@@ -1,10 +1,7 @@
<html>
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<!-- Custom CSS -->
<link rel="stylesheet" type="text/css" href="css/main.css" />
<!-- Locales -->
@@ -19,11 +16,7 @@
</div>
<div class="footer">Multicharacter</div>
</div>
<script
src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
crossorigin="anonymous"
></script>
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<script src="js/app.js" type="text/javascript"></script>
</body>
</html>
+1 -4
View File
@@ -2,10 +2,7 @@
<html lang="en">
<head>
<script src="nui://game/ui/jquery.js" type="text/javascript"></script>
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200"
/>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" />
<link rel="stylesheet" href="css/style.css" />
<script src="js/script.js"></script>
<title>ESX Notify</title>
+1 -3
View File
@@ -60,9 +60,7 @@ notification = (data) => {
const notification = $(`
<div class="notify ${data.type}">
<div class="innerText">
<span class="material-symbols-outlined icon">${
types[data.type]["icon"]
}</span>
<span class="material-symbols-outlined icon">${types[data.type]["icon"]}</span>
<p class="text">${data["message"]}</p>
</div>
</div>
+1 -6
View File
@@ -42,12 +42,7 @@
height: 2px;
width: 100%;
border-radius: 20px;
background: linear-gradient(
to right,
#0052d4,
#4364f7,
#6fb1fc
); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
background: linear-gradient(to right, #0052d4, #4364f7, #6fb1fc); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
}
.icon {
+1 -4
View File
@@ -1,10 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200"
/>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" />
<script src="https://kit.fontawesome.com/a81368914c.js"></script>
<link rel="stylesheet" href="css/style.css" />
<script src="js/script.js"></script>