Skip to content

Commit 0aa2e7d

Browse files
authored
Merge pull request #6 from GoatG33k/master
v1.5.2 - GitHub CI, Bugfixes, and Performance Improvements
2 parents 9da17ce + 8b47ebc commit 0aa2e7d

File tree

6 files changed

+34
-12
lines changed

6 files changed

+34
-12
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: CI
2+
on: [push, pull_request]
3+
jobs:
4+
lint:
5+
name: Lint Lua Scripts
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Checkout
9+
uses: actions/checkout@v2
10+
- name: Lint
11+
uses: GoatG33k/fivem-lua-lint-action@v1
12+
with:
13+
capture: "junit.xml"
14+
args: "-t --formatter JUnit"
15+
- name: Publish Test Report
16+
uses: mikepenz/action-junit-report@v2
17+
if: always()
18+
with:
19+
report_paths: "**/junit.xml"
20+
fail_on_failure: 0

cl_dev.lua

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
local insert = table.insert
2+
local remove = table.remove
3+
14
--- [[ Development shit ]]
25

3-
local devLocal = json.decode(raw)
6+
local devLocal = {}
47
local next = 0
58

69
RegisterCommand('setnext', function(_, args)
@@ -43,7 +46,7 @@ RegisterCommand('remove', function(_, args)
4346
else
4447
for i, d in ipairs(devLocal) do
4548
if d.code == args[1] then
46-
table.remove(devLocal, i)
49+
remove(devLocal, i)
4750
print('remove ' .. d.code)
4851
return
4952
end

cl_render.lua

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
-- optimizations
22
local vec = vec
3-
local Wait = Wait
3+
local Wait = Citizen.Wait
44
local format = string.format
55
local RemoveBlip = RemoveBlip
66
local PlayerPedId = PlayerPedId
77
local IsHudHidden = IsHudHidden
88
local SetTextFont = SetTextFont
9-
local CreateThread = CreateThread
109
local SetTextScale = SetTextScale
1110
local SetTextOutline = SetTextOutline
1211
local GetEntityCoords = GetEntityCoords
@@ -60,7 +59,7 @@ Citizen.CreateThread(function()
6059
local _code = postals[_nearestIndex].code
6160
nearest = { code = _code, dist = _nearestD }
6261
nearestPostalText = format(formatTemplate, _code, _nearestD)
63-
Citizen.Wait(delay)
62+
Wait(delay)
6463
end
6564
end)
6665

@@ -80,6 +79,6 @@ Citizen.CreateThread(function()
8079
AddTextComponentSubstringPlayerName(nearestPostalText)
8180
EndTextCommandDisplayText(posX, posY)
8281
end
83-
Citizen.Wait(0)
82+
Wait(0)
8483
end
8584
end)

fxmanifest.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ fx_version 'cerulean'
1010
games { 'gta5' }
1111
lua54 "yes"
1212

13-
author 'blockba5her'
13+
author 'DevBlocky'
1414
description 'This script displays the nearest postal next to map, and allows you to navigate to specific postal codes'
15-
version '1.5.1'
16-
url 'https://github.com/blockba5her/nearest-postal'
15+
version '1.5.2'
16+
url 'https://github.com/DevBlocky/nearest-postal'
1717

1818
client_scripts {
1919
'config.lua',

sv.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Citizen.CreateThread(function()
33
local vRaw = LoadResourceFile(GetCurrentResourceName(), 'version.json')
44
if vRaw and config.versionCheck then
55
local v = json.decode(vRaw)
6-
local url = 'https://raw.githubusercontent.com/blockba5her/nearest-postal/master/version.json'
6+
local url = 'https://raw.githubusercontent.com/DevBlocky/nearest-postal/master/version.json'
77
PerformHttpRequest(url, function(code, res)
88
if code == 200 then
99
local rv = json.decode(res)

version.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"version": "1.5.1",
3-
"changelog": "Fix Threads and add destination text"
2+
"version": "1.5.2",
3+
"changelog": "Bugfixes and performance improvements"
44
}

0 commit comments

Comments
 (0)