Skip to content

Commit

Permalink
chore: bpt_hud fxmanifest updated to version 1.0.1 + Run formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
bitpredator committed Feb 28, 2024
1 parent aa41c52 commit d355a79
Show file tree
Hide file tree
Showing 9 changed files with 452 additions and 428 deletions.
2 changes: 1 addition & 1 deletion server-data/resources/[bpt_addons]/bpt_hud/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<h1 align='center'>bpt_hud</a></h1>
<p align='center'><a href='https://discord.gg/ksGfNvDEfq'>Discord</a>

Copyright (C) 2022-2023 bitpredator
Copyright (C) 2022-2024 bitpredator

This program Is free software: you can redistribute it And/Or modify it under the terms Of the GNU General Public License As published by the Free Software Foundation, either version 3 Of the License, Or (at your option) any later version.

Expand Down
380 changes: 206 additions & 174 deletions server-data/resources/[bpt_addons]/bpt_hud/client/carhud.lua

Large diffs are not rendered by default.

89 changes: 44 additions & 45 deletions server-data/resources/[bpt_addons]/bpt_hud/client/client.lua
Original file line number Diff line number Diff line change
@@ -1,65 +1,64 @@
local minimap = RequestScaleformMovie("minimap")

CreateThread(function()
while true do
Wait(1250)
while true do
Wait(1250)

if IsPauseMenuActive() then
SendNUIMessage({mapfoil = true})
SendNUIMessage({mapoutline = false})
else
SendNUIMessage({mapfoil = false})
SendNUIMessage({mapoutline = true})
end
if IsPauseMenuActive() then
SendNUIMessage({ mapfoil = true })
SendNUIMessage({ mapoutline = false })
else
SendNUIMessage({ mapfoil = false })
SendNUIMessage({ mapoutline = true })
end

SetRadarZoom(1150)
SetRadarZoom(1150)

if Config.Hidemapoutsidecar then
if Config.Hidemapwhenengineoff then
local player = PlayerPedId()
local vehicle = GetVehiclePedIsIn(player, false)
local vehicleIsOn = GetIsVehicleEngineRunning(vehicle)
if IsPedInAnyVehicle(player, false) and vehicleIsOn then
ToggleRadar(true)
SendNUIMessage({mapoutline = true})
TriggerVehicleLoop()
else
ToggleRadar(false)
SendNUIMessage({mapoutline = false})
end
else
local player = PlayerPedId()
if IsPedInAnyVehicle(player, false) then
ToggleRadar(true)
SendNUIMessage({mapoutline = true})
TriggerVehicleLoop()
else
ToggleRadar(false)
SendNUIMessage({mapoutline = false})
end
end
end
end
if Config.Hidemapoutsidecar then
if Config.Hidemapwhenengineoff then
local player = PlayerPedId()
local vehicle = GetVehiclePedIsIn(player, false)
local vehicleIsOn = GetIsVehicleEngineRunning(vehicle)
if IsPedInAnyVehicle(player, false) and vehicleIsOn then
ToggleRadar(true)
SendNUIMessage({ mapoutline = true })
TriggerVehicleLoop()
else
ToggleRadar(false)
SendNUIMessage({ mapoutline = false })
end
else
local player = PlayerPedId()
if IsPedInAnyVehicle(player, false) then
ToggleRadar(true)
SendNUIMessage({ mapoutline = true })
TriggerVehicleLoop()
else
ToggleRadar(false)
SendNUIMessage({ mapoutline = false })
end
end
end
end
end)

local x = -0.025
local y = -0.015

CreateThread(function()

RequestStreamedTextureDict("circlemap", false)
while not HasStreamedTextureDictLoaded("circlemap") do
Wait(100)
end

AddReplaceTexture("platform:/textures/graphics", "radarmasksm", "circlemap", "radarmasksm")
SetMinimapClipType(1)
SetMinimapComponentPosition('minimap', 'L', 'B', -0.022, -0.026, 0.16, 0.245)
SetMinimapComponentPosition('minimap_mask', 'L', 'B', x + 0.21, y + 0.09, 0.071, 0.164)
SetMinimapComponentPosition('minimap_blur', 'L', 'B', -0.032, -0.04, 0.18, 0.22)
ThefeedSpsExtendWidescreenOn()
SetRadarBigmapEnabled(true, false)
SetRadarBigmapEnabled(false, false)
SetMinimapClipType(1)
SetMinimapComponentPosition("minimap", "L", "B", -0.022, -0.026, 0.16, 0.245)
SetMinimapComponentPosition("minimap_mask", "L", "B", x + 0.21, y + 0.09, 0.071, 0.164)
SetMinimapComponentPosition("minimap_blur", "L", "B", -0.032, -0.04, 0.18, 0.22)
ThefeedSpsExtendWidescreenOn()
SetRadarBigmapEnabled(true, false)
SetRadarBigmapEnabled(false, false)
end)

ToggleRadar = function(state)
Expand All @@ -72,6 +71,6 @@ end
TriggerVehicleLoop = function()
CreateThread(function()
ToggleRadar(true)
SetRadarBigmapEnabled(false, false)
SetRadarBigmapEnabled(false, false)
end)
end
10 changes: 5 additions & 5 deletions server-data/resources/[bpt_addons]/bpt_hud/client/status.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ local posi = "bottom"

ESX = exports["es_extended"]:getSharedObject()

AddEventHandler('playerSpawned', function() -- Enable hud only after player spawn
AddEventHandler("playerSpawned", function() -- Enable hud only after player spawn
CreateThread(function()
while true do
Wait(0)
Expand All @@ -16,20 +16,20 @@ AddEventHandler('playerSpawned', function() -- Enable hud only after player spa
health = math.ceil(GetEntityHealth(GetPlayerPed(-1)) - 100)
end
armor = math.ceil(GetPedArmour(GetPlayerPed(-1)))
TriggerEvent('esx_status:getStatus', 'hunger', function(status)
TriggerEvent("esx_status:getStatus", "hunger", function(status)
food = status.getPercent()
end)
TriggerEvent('esx_status:getStatus', 'thirst', function(status)
TriggerEvent("esx_status:getStatus", "thirst", function(status)
thirst = status.getPercent()
end)
SendNUIMessage({
posi = posi,
show = IsPauseMenuActive(), -- Disable hud if settings menu is active
show = IsPauseMenuActive(), -- Disable hud if settings menu is active
health = health,
armor = armor,
food = food,
thirst = thirst,
})
end
end)
end)
end)
2 changes: 1 addition & 1 deletion server-data/resources/[bpt_addons]/bpt_hud/config.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Config = {}

Config.Hidemapoutsidecar = true -- set to true if you want to hide the minimap when not in a vehicle
Config.Hidemapwhenengineoff = true -- set to true if you want to hide the map when a vehicles engine is off
Config.Hidemapwhenengineoff = true -- set to true if you want to hide the map when a vehicles engine is off
34 changes: 17 additions & 17 deletions server-data/resources/[bpt_addons]/bpt_hud/fxmanifest.lua
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
fx_version 'adamant'
fx_version("adamant")

game 'gta5'
author 'bitpredator'
description 'bitpredator HUD'
version '1.0.0'
game("gta5")
author("bitpredator")
description("bitpredator HUD")
version("1.0.1")

ui_page 'html/ui.html'
ui_page("html/ui.html")

shared_script '@es_extended/imports.lua'
shared_script("@es_extended/imports.lua")

files {
'html/*.css',
'html/*.js',
'html/*.png',
'html/ui.html',
}
files({
"html/*.css",
"html/*.js",
"html/*.png",
"html/ui.html",
})

client_scripts {
'client/*.lua',
'config.lua'
}
client_scripts({
"client/*.lua",
"config.lua",
})
27 changes: 14 additions & 13 deletions server-data/resources/[bpt_addons]/bpt_hud/html-map/script.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
$(document).ready(function () {
window.addEventListener("message", function (event) {
let data = event.data;
window.addEventListener("message", function (event) {
let data = event.data;

if (data.mapoutline == true) {
$(".outline").show();
} else if (data.mapoutline == false) {
$(".outline").hide();
}
if (data.mapoutline == true) {
$(".outline").show();
} else if (data.mapoutline == false) {
$(".outline").hide();
}

if (data.mapfoil == true) {
$(".mapfoil").hide();
} else if (data.mapfoil == false) {
$(".mapfoil").show();
}
if (data.mapfoil == true) {
$(".mapfoil").hide();
} else if (data.mapfoil == false) {
$(".mapfoil").show();
}

})})
})
})
Loading

0 comments on commit d355a79

Please sign in to comment.