qb-target migration + DrawText suppression + time freeze

- qb-core/client/drawtext.lua: Global [E] prompt suppression (all DrawText functions are no-ops) - qs-housing/qb.lua: DrawText3D/DrawText3Ds/DrawTextBoard no-ops when UseTarget=true - qs-housing/qb-target.lua: Added BoxZone target on Real Estate NPC (executes /housebrowser) - qb-weathersync: Time freeze at 14:00 (BaseTime=14, FreezeTime=true)
This commit is contained in:
2026-04-03 04:12:32 +03:00
parent e756e29294
commit 4d73d4a013
5 changed files with 87 additions and 60 deletions

View File

@@ -61,7 +61,12 @@ function ShowHelpNotification(msg)
end end
local texts = {} local texts = {}
if GetResourceState('qs-textui') == 'started' then if Config.UseTarget then
-- RED VALLEY: Suprimăm DrawText3D când folosim qb-target (dot target)
function DrawText3D(x, y, z, text, id, key) end
function DrawText3Ds(x, y, z, text) end
function DrawTextBoard(x, y, z, text) end
elseif GetResourceState('qs-textui') == 'started' then
function DrawText3D(x, y, z, text, id, key) function DrawText3D(x, y, z, text, id, key)
local _id = id local _id = id
if not texts[_id] then if not texts[_id] then
@@ -96,32 +101,34 @@ else
end end
end end
function DrawText3Ds(x, y, z, text) if not Config.UseTarget then
SetTextScale(0.35, 0.35) function DrawText3Ds(x, y, z, text)
SetTextFont(4) SetTextScale(0.35, 0.35)
SetTextProportional(1) SetTextFont(4)
SetTextColour(255, 255, 255, 215) SetTextProportional(1)
SetTextEntry('STRING') SetTextColour(255, 255, 255, 215)
SetTextCentre(true) SetTextEntry('STRING')
AddTextComponentString(text) SetTextCentre(true)
SetDrawOrigin(x, y, z, 0) AddTextComponentString(text)
DrawText(0.0, 0.0) SetDrawOrigin(x, y, z, 0)
local factor = text:len() / 370 DrawText(0.0, 0.0)
DrawRect(0.0, 0.0 + 0.0125, 0.017 + factor, 0.03, 0, 0, 0, 75) local factor = text:len() / 370
ClearDrawOrigin() DrawRect(0.0, 0.0 + 0.0125, 0.017 + factor, 0.03, 0, 0, 0, 75)
end ClearDrawOrigin()
end
function DrawTextBoard(x, y, z, text) function DrawTextBoard(x, y, z, text)
SetTextScale(0.45, 0.45) SetTextScale(0.45, 0.45)
SetTextFont(1) SetTextFont(1)
SetTextProportional(1) SetTextProportional(1)
SetTextColour(0, 0, 0, 215) SetTextColour(0, 0, 0, 215)
SetTextEntry('STRING') SetTextEntry('STRING')
SetTextCentre(true) SetTextCentre(true)
AddTextComponentString(text) AddTextComponentString(text)
SetDrawOrigin(x, y, z, 0) SetDrawOrigin(x, y, z, 0)
DrawText(0.0, 0.0) DrawText(0.0, 0.0)
ClearDrawOrigin() ClearDrawOrigin()
end
end end
function DrawGenericText(text) function DrawGenericText(text)

View File

@@ -920,3 +920,31 @@ RegisterNetEvent('housing:initHouses', function(houseConfig)
end end
end end
end) end)
-- ============================================================================
-- RED VALLEY: qb-target pe NPC-ul Real Estate (înlocuiește [E] - Open House Browser)
-- ============================================================================
if Config.RealeStateNPC and Config.RealeStateNPC.enabled then
CreateThread(function()
Wait(3000) -- Așteptăm ca NPC-ul să fie spawnat de codul encrypted
local npcCoords = Config.RealeStateNPC.location
exports[target_name]:AddBoxZone('rv_realestate_npc', vec3(npcCoords.x, npcCoords.y, npcCoords.z), 1.5, 1.5, {
name = 'rv_realestate_npc',
heading = npcCoords.w,
debugPoly = false,
minZ = npcCoords.z - 1.0,
maxZ = npcCoords.z + 2.0,
}, {
options = {
{
icon = 'fa-solid fa-house',
label = 'Open House Browser',
action = function()
ExecuteCommand('housebrowser')
end,
},
},
distance = 2.5,
})
end)
end

View File

@@ -3,9 +3,9 @@ Config.DynamicWeather = true -- Set this to false if you don't want the weathe
-- On server start -- On server start
Config.StartWeather = 'EXTRASUNNY' -- Default weather default: 'EXTRASUNNY' Config.StartWeather = 'EXTRASUNNY' -- Default weather default: 'EXTRASUNNY'
Config.BaseTime = 8 -- Time default: 8 Config.BaseTime = 14 -- Time default: 8 -- RED VALLEY: freeze la 14:00
Config.TimeOffset = 0 -- Time offset default: 0 Config.TimeOffset = 0 -- Time offset default: 0
Config.FreezeTime = false -- freeze time default: false Config.FreezeTime = true -- freeze time default: false -- RED VALLEY: ora blocată la 14:00
Config.Blackout = false -- Set blackout default: false Config.Blackout = false -- Set blackout default: false
Config.BlackoutVehicle = false -- Set blackout affects vehicles default: false Config.BlackoutVehicle = false -- Set blackout affects vehicles default: false
Config.NewWeatherTimer = 10 -- Time (in minutes) between each weather change default: 10 Config.NewWeatherTimer = 10 -- Time (in minutes) between each weather change default: 10

View File

@@ -78,6 +78,7 @@ end
-- Seteaza state bag pentru text bubble vizibil de toti jucatorii -- Seteaza state bag pentru text bubble vizibil de toti jucatorii
CreateThread(function() CreateThread(function()
local wasOpen = false local wasOpen = false
local closedAt = 0
while true do while true do
Wait(500) Wait(500)
local nuiFocused = IsNuiFocused() local nuiFocused = IsNuiFocused()
@@ -86,6 +87,14 @@ CreateThread(function()
Utils.StopTabletAnim() Utils.StopTabletAnim()
LocalPlayer.state:set("browsingJobs", false, true) LocalPlayer.state:set("browsingJobs", false, true)
wasOpen = false wasOpen = false
closedAt = GetGameTimer()
elseif wasOpen and nuiFocused and tabletProp and DoesEntityExist(tabletProp) then
-- NUI e inca focusat DAR poate e alt NUI (ex: license dialog, inventar)
-- Daca browsingJobs e false => alt NUI a preluat, cleanup prop
if not LocalPlayer.state.browsingJobs then
Utils.StopTabletAnim()
wasOpen = false
end
elseif nuiFocused and tabletProp and DoesEntityExist(tabletProp) then elseif nuiFocused and tabletProp and DoesEntityExist(tabletProp) then
if not wasOpen then if not wasOpen then
LocalPlayer.state:set("bubbleText", "Se uita la locuri de munca...", true) LocalPlayer.state:set("bubbleText", "Se uita la locuri de munca...", true)

View File

@@ -1,60 +1,43 @@
-- ============================================================================
-- RED VALLEY: DrawText SUPRIMAT GLOBAL
-- Toate interacțiunile folosesc qb-target (dot target), nu [E] prompts.
-- Funcțiile rămân ca no-ops ca să nu crape resursele care le apelează.
-- ============================================================================
local function hideText() local function hideText()
SendNUIMessage({ -- Suprimat — nu mai afișăm nimic
action = 'HIDE_TEXT',
})
end end
local function drawText(text, position) local function drawText(text, position)
if type(position) ~= 'string' then position = 'left' end -- Suprimat — folosim qb-target în loc de [E] prompts
SendNUIMessage({
action = 'DRAW_TEXT',
data = {
text = text,
position = position
}
})
end end
local function changeText(text, position) local function changeText(text, position)
if type(position) ~= 'string' then position = 'left' end -- Suprimat
SendNUIMessage({
action = 'CHANGE_TEXT',
data = {
text = text,
position = position
}
})
end end
local function keyPressed() local function keyPressed()
CreateThread(function() -- Not sure if a thread is needed but why not eh? -- Suprimat
SendNUIMessage({
action = 'KEY_PRESSED',
})
Wait(500)
hideText()
end)
end end
RegisterNetEvent('qb-core:client:DrawText', function(text, position) RegisterNetEvent('qb-core:client:DrawText', function(text, position)
drawText(text, position) -- Suprimat
end) end)
RegisterNetEvent('qb-core:client:ChangeText', function(text, position) RegisterNetEvent('qb-core:client:ChangeText', function(text, position)
changeText(text, position) -- Suprimat
end) end)
RegisterNetEvent('qb-core:client:HideText', function() RegisterNetEvent('qb-core:client:HideText', function()
hideText() -- Suprimat
end) end)
RegisterNetEvent('qb-core:client:KeyPressed', function() RegisterNetEvent('qb-core:client:KeyPressed', function()
keyPressed() -- Suprimat
end) end)
exports('DrawText', drawText) exports('DrawText', drawText)
exports('ChangeText', changeText) exports('ChangeText', changeText)
exports('HideText', hideText) exports('HideText', hideText)
exports('KeyPressed', keyPressed) exports('KeyPressed', keyPressed)