From ade7a3bc167ad4ee6f88f9562d342e2ecbcef0cc Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sun, 11 Nov 2018 14:20:49 +0100 Subject: [PATCH] Minor improvements --- __resource.lua | 4 +- client/main.lua | 12 ++--- html/css/app.css | 85 ++++++++++++++++------------------ html/js/app.js | 114 ++++++++++++++++++++++++---------------------- html/js/app_en.js | 114 ++++++++++++++++++++++++---------------------- html/js/app_pl.js | 114 ++++++++++++++++++++++++---------------------- html/ui_pl.html | 12 ----- 7 files changed, 224 insertions(+), 231 deletions(-) delete mode 100644 html/ui_pl.html diff --git a/__resource.lua b/__resource.lua index 081c5dfc..8d41f890 100644 --- a/__resource.lua +++ b/__resource.lua @@ -18,4 +18,6 @@ files { 'html/fonts/pdown.ttf', 'html/fonts/bankgothic.ttf' -} \ No newline at end of file +} + +dependency 'es_extended' \ No newline at end of file diff --git a/client/main.lua b/client/main.lua index b419cd73..e220444a 100644 --- a/client/main.lua +++ b/client/main.lua @@ -23,7 +23,7 @@ Citizen.CreateThread(function() action = 'openMenu', namespace = namespace, name = name, - data = data, + data = data }) local timeoutId = ESX.SetTimeout(200, function() @@ -41,7 +41,7 @@ Citizen.CreateThread(function() action = 'closeMenu', namespace = namespace, name = name, - data = data, + data = data }) for k,v in pairs(OpenedMenus) do @@ -68,7 +68,7 @@ Citizen.CreateThread(function() if tonumber(data.value) ~= nil then -- Round float values - data.value = round(tonumber(data.value)) + data.value = ESX.Math.Round(tonumber(data.value)) -- Check for negative value if tonumber(data.value) <= 0 then @@ -128,11 +128,9 @@ Citizen.CreateThread(function() DisableControlAction(0, 15, true) -- WeaponWheelPrev DisableControlAction(0, 16, true) -- SelectNextWeapon DisableControlAction(0, 17, true) -- SelectPrevWeapon + else + Citizen.Wait(500) end end end) - - function round(x) - return x>=0 and math.floor(x+0.5) or math.ceil(x-0.5) - end end) \ No newline at end of file diff --git a/html/css/app.css b/html/css/app.css index e50e4d31..459d3c37 100644 --- a/html/css/app.css +++ b/html/css/app.css @@ -1,81 +1,74 @@ @font-face { - font-family: bankgothic; - src: url('../fonts/bankgothic.ttf'); + font-family: bankgothic; + src: url('../fonts/bankgothic.ttf'); } @font-face { - font-family: pcdown; - src: url('../fonts/pdown.ttf'); + font-family: pcdown; + src: url('../fonts/pdown.ttf'); } #controls { - font-family : pcdown; - font-size : 3em; - color : #FFF; - position : absolute; - bottom : 40; - right : 40; - - text-shadow: - -1px -1px 0 #000, - 1px -1px 0 #000, - -1px 1px 0 #000, - 1px 1px 0 #000 - ; + font-family: pcdown; + font-size: 3em; + color: #FFF; + position: absolute; + bottom: 40; + right: 40; + text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000; } .controls { - display: none; + display: none; } .dialog { - - font-family : bankgothic; - background-color: #fff; - color : #fff; - box-shadow : 0px 0px 50px 0px #000; - position : absolute; - overflow : hidden; - top : 50%; - left : 50%; - width : 600px; - height : 104px; - transform : translate(-50%, -50%); + font-family: bankgothic; + background-color: #fff; + color: #fff; + box-shadow: 0px 0px 50px 0px #000; + position: absolute; + overflow: hidden; + top: 50%; + left: 50%; + width: 600px; + height: 104px; + transform: translate(-50%, -50%); } .dialog.big { - height: 200px; + height: 200px; } .dialog .head { - background-color: #506be6; - text-align : center; - height : 40px; + background-color: #506be6; + text-align: center; + height: 40px; } .dialog .head span:before { - content: ""; - display: inline-block; - height: 100%; - vertical-align: middle; + content: ""; + display: inline-block; + height: 100%; + vertical-align: middle; } .dialog input[type="text"] { - width : 100%; - height: 32px; + width: 100%; + height: 32px; } .dialog textarea { - width : 100%; - height: 128px; + width: 100%; + height: 128px; } .dialog button[name="submit"] { - width : 75%; - height: 32px; + width: 75%; + height: 32px; } .dialog button[name="cancel"] { - width : 25%; - height: 32px; + width: 25%; + height: 32px; } \ No newline at end of file diff --git a/html/js/app.js b/html/js/app.js index 8d136b59..4988e11f 100644 --- a/html/js/app.js +++ b/html/js/app.js @@ -1,4 +1,4 @@ -(function(){ +(function () { let MenuTpl = '