Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hud remake #20

Closed
wants to merge 38 commits into from
Closed
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
85fa0fa
Hud remake
TonybynMp4 Jan 4, 2024
bf1edeb
en locale update
TonybynMp4 Jan 4, 2024
da5179b
fix ox_inventory event
TonybynMp4 Jan 4, 2024
6fe0348
unused variables
TonybynMp4 Jan 4, 2024
3813db2
fix linting?
TonybynMp4 Jan 5, 2024
095a595
Disable minimap on login
TonybynMp4 Jan 8, 2024
032c27c
localize playerstate & remove useless safe navigation
TonybynMp4 Jan 11, 2024
2d8461c
improved shooting stress loop
TonybynMp4 Jan 11, 2024
747bedd
prevent ram from going up (flextape style)
TonybynMp4 Jan 11, 2024
3678001
use native instead of state.fuel
TonybynMp4 Jan 11, 2024
ccac1de
improve voice loop, use proximity statebag & correctly calculate prox…
TonybynMp4 Jan 11, 2024
bfa0c20
config for new shooting loop
TonybynMp4 Jan 11, 2024
bacf6ab
rename global variable correctly
TonybynMp4 Jan 12, 2024
a5ec51c
feat: locales
TonybynMp4 Mar 16, 2024
153a75a
fixes (#2)
TonybynMp4 Mar 16, 2024
b4e31ba
feat: ox_lib locales
TonybynMp4 Mar 16, 2024
54bea20
Merge branch 'main' into dev
TonybynMp4 Mar 16, 2024
6ae4de6
feat: circular progressbars
TonybynMp4 Mar 25, 2024
a6d30bf
fix: stroke not BG
TonybynMp4 Mar 25, 2024
f4a7496
Merge branch 'main' into dev
TonybynMp4 Apr 5, 2024
976a9f4
Merge branch 'main' into dev
TonybynMp4 Apr 8, 2024
6170c04
add transition
TonybynMp4 Apr 25, 2024
a339004
fix: stream fonts
TonybynMp4 Apr 25, 2024
ac81c9b
split in multiple files & localize frequently used natives
TonybynMp4 Apr 25, 2024
274019e
move to the main thread
TonybynMp4 Apr 25, 2024
9fed10a
how did that get here
TonybynMp4 Apr 25, 2024
2b9b414
fixes
TonybynMp4 Apr 25, 2024
0a4a7a1
feat: marker on voice change
TonybynMp4 Apr 30, 2024
2a4ff94
drop support for onMoneyChange, bank changes should be handled by the…
TonybynMp4 May 6, 2024
2c5d1e2
move the progress styling entirely to the JS
TonybynMp4 May 6, 2024
4bb9343
extract stress function
TonybynMp4 May 6, 2024
86646e5
fix: typo
TonybynMp4 May 7, 2024
d9c2d9b
remove the UI money stuff
TonybynMp4 May 7, 2024
21b74a2
fix: rework Mph config & indicators
TonybynMp4 May 7, 2024
31e0e47
fix: changed var
TonybynMp4 May 7, 2024
36fc2f7
fix: speed isn't set if above the estimated maxspeed
TonybynMp4 May 7, 2024
b139210
fix: might want round it BEFORE using it
TonybynMp4 May 7, 2024
9e1801d
rotaté
TonybynMp4 May 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
##
**Q:** How do I enable dev mode?

**A:** Simple! All you have to do is type /admin and navigate through the menu to the last section called "Developer Options" and inside there you should see "Dev Mode", this will keep you invincible and add a cool developer icon in your circles/radials
**A:** Simple! All you have to do is type /admin and navigate through the menu to the last section called "Developer Options" and inside there you should see "Dev Mode", this will keep you invincible and add a cool developer icon in your circles/radials
##

##
Expand Down
70 changes: 70 additions & 0 deletions client/compass.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
local SendNUIMessage = SendNUIMessage
local currentHeading
local currentStreet
local currentStreet2
local showingMinimap = false
local directions = {
N = 360,
NE = 315,
E = 270,
SE = 225,
S = 180,
SW = 135,
W = 90,
NW = 45,
}

CreateThread(function()
Wait(250)
while true do
local sleep = 1000
if not IsMinimapRendering() then
if showingMinimap then
showingMinimap = false
SendNUIMessage({
update = true,
data = {
{
type = 'compass',
show = false,
}
}
})
end
else
local coords = GetEntityCoords(cache.ped)
local var1, var2 = GetStreetNameAtCoord(coords.x, coords.y, coords.z)
local street, hash2 = GetStreetNameFromHashKey(var1), GetStreetNameFromHashKey(var2)
local street2 = ("%s%s"):format(hash2 ~= '' and hash2 .. ', ' or '', GetLabelText(GetNameOfZone(coords.x, coords.y, coords.z)))
local heading = GetEntityHeading(cache.ped) % 360
local convertedHeading = 'N'

for k, v in pairs(directions) do
if heading >= v - 22.5 and heading <= v + 22.5 then
convertedHeading = k
break
end
end

if currentHeading ~= convertedHeading or currentStreet ~= street or currentStreet2 ~= street2 then
SendNUIMessage({
update = true,
data = {
{
type = 'compass',
show = true,
heading = currentHeading ~= convertedHeading and convertedHeading or nil,
street = currentStreet ~= street and street or nil,
street2 = currentStreet2 ~= street2 and street2 or nil,
}
}
})
currentHeading, currentStreet, currentStreet2 = convertedHeading, street, street2
showingMinimap = true
end
sleep = 500
--collectgarbage() -- please help i don't understand why this is necessary
end
Wait(sleep)
end
end)
Loading
Loading