bubble text 3D
- Animatie tableta (prop_cs_tablet) la deschiderea Job Center NUI - Bubble text 3D deasupra capului vizibil pt toti jucatorii (state bags) - Job Center: icon 💼 | testbubble: icon 💬 + text custom - Curatat locale ro.lua (~r~[E]~s~ incompatibil cu qb-target) - Comenzi test: testanim, stopanim, testbubble [text], stopbubble - Scos db/ din git tracking + .gitignore actualizat - Regula 13 rulebook: commit info dupa fiecare modificare - Fisiere: 17mov_JobCenter/client/utils.lua, locale/ro.lua, .gitignore, rulebook.md
This commit is contained in:
BIN
cache/files/17mov_JobCenter/resource.rpf
vendored
BIN
cache/files/17mov_JobCenter/resource.rpf
vendored
Binary file not shown.
2
cache/files/17mov_JobCenter/resource.rpf.db
vendored
2
cache/files/17mov_JobCenter/resource.rpf.db
vendored
File diff suppressed because one or more lines are too long
@@ -18,6 +18,16 @@ git tkn: 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
|
||||
### 📝 Terminologie Standardizată
|
||||
- ✏️ Înlocuit termenul "vendor" cu "devTeam" în toate fișierele .md (skills, KB, docs, changelog)
|
||||
|
||||
### 💬 Bubble Text System (3D text deasupra capului)
|
||||
- ✏️ `resources/[framework]/[base]/[jobs]/17mov_JobCenter/client/utils.lua`
|
||||
- Text 3D deasupra capului jucătorului vizibil de toți (via state bags: `browsingJobs`, `bubbleText`, `bubbleIcon`)
|
||||
- Job Center: 💼 "Se uita la locuri de munca..."
|
||||
- Generic (testbubble): 💬 + text custom
|
||||
- Scalare automată bazată pe distanță + FOV cameră
|
||||
- 🆕 Comenzi de test permanente: `testanim`, `stopanim`, `testbubble [text]`, `stopbubble`
|
||||
|
||||
### 📋 Rulebook Updates
|
||||
- ✏️ Regula 13: Commit info (Summary + Description) după fiecare modificare
|
||||
|
||||
### 🎯 Migrare Sistem Interacțiuni → qb-target (20 resurse)
|
||||
Toate resursele care foloseau DrawText3D `[E]` / Markers au fost trecute pe **qb-target** (third-eye system) pentru experiență uniformă.
|
||||
|
||||
@@ -30,6 +30,18 @@ RegisterCommand("stopanim", function()
|
||||
if testProp and DoesEntityExist(testProp) then DeleteEntity(testProp) testProp = nil end
|
||||
end, false)
|
||||
|
||||
RegisterCommand("testbubble", function(_, args)
|
||||
local text = table.concat(args, " ")
|
||||
if text == "" then text = "Test bubble..." end
|
||||
LocalPlayer.state:set("bubbleText", text, true)
|
||||
LocalPlayer.state:set("bubbleIcon", "💬", true)
|
||||
LocalPlayer.state:set("browsingJobs", true, true)
|
||||
end, false)
|
||||
|
||||
RegisterCommand("stopbubble", function()
|
||||
LocalPlayer.state:set("browsingJobs", false, true)
|
||||
end, false)
|
||||
|
||||
-- Animatie tableta pentru meniul Job Center
|
||||
local tabletProp = nil
|
||||
local animDict = "amb@code_human_in_bus_passenger_idles@female@tablet@base"
|
||||
@@ -95,6 +107,7 @@ end
|
||||
|
||||
-- Opreste animatia cand se inchide meniul (safety net)
|
||||
-- Monitorizeza NUI focus — cand se pierde, opreste animatia
|
||||
-- Seteaza state bag pentru text bubble vizibil de toti jucatorii
|
||||
CreateThread(function()
|
||||
local wasOpen = false
|
||||
while true do
|
||||
@@ -103,10 +116,72 @@ CreateThread(function()
|
||||
if wasOpen and not nuiFocused then
|
||||
-- Meniul tocmai s-a inchis
|
||||
Utils.StopTabletAnim()
|
||||
LocalPlayer.state:set("browsingJobs", false, true)
|
||||
wasOpen = false
|
||||
elseif nuiFocused and tabletProp and DoesEntityExist(tabletProp) then
|
||||
if not wasOpen then
|
||||
LocalPlayer.state:set("bubbleText", "Se uita la locuri de munca...", true)
|
||||
LocalPlayer.state:set("bubbleIcon", "💼", true)
|
||||
LocalPlayer.state:set("browsingJobs", true, true)
|
||||
end
|
||||
wasOpen = true
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
-- Deseneaza text bubble deasupra jucatorilor care cauta joburi
|
||||
-- Vizibil pentru toti jucatorii din apropiere
|
||||
CreateThread(function()
|
||||
while true do
|
||||
Wait(0)
|
||||
local myPed = PlayerPedId()
|
||||
local myCoords = GetEntityCoords(myPed)
|
||||
|
||||
for _, playerId in ipairs(GetActivePlayers()) do
|
||||
local targetPed = GetPlayerPed(playerId)
|
||||
local state = Player(GetPlayerServerId(playerId)).state
|
||||
|
||||
if state and state.browsingJobs then
|
||||
local pedCoords = GetEntityCoords(targetPed)
|
||||
local dist = #(myCoords - pedCoords)
|
||||
|
||||
if dist < 15.0 then
|
||||
local headBone = GetPedBoneCoords(targetPed, 31086, 0.0, 0.0, 0.0) -- SKEL_Head
|
||||
local bubbleText = state.bubbleText or "Se uita la locuri de munca..."
|
||||
local bubbleIcon = state.bubbleIcon or ""
|
||||
Utils.DrawJobBubble(headBone.x, headBone.y, headBone.z + 0.35, bubbleIcon .. " " .. bubbleText)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
-- Deseneaza text bubble stilizat deasupra capului
|
||||
Utils.DrawJobBubble = function(x, y, z, text)
|
||||
local onScreen, _x, _y = World3dToScreen2d(x, y, z)
|
||||
if onScreen then
|
||||
local camCoords = GetGameplayCamCoords()
|
||||
local dist = #(vec3(x, y, z) - camCoords)
|
||||
local scale = (1 / dist) * 2
|
||||
local fov = (1 / GetGameplayCamFov()) * 100
|
||||
scale = scale * fov
|
||||
|
||||
-- Limiteaza scala
|
||||
if scale > 0.4 then scale = 0.4 end
|
||||
if scale < 0.15 then scale = 0.15 end
|
||||
|
||||
-- Background box
|
||||
SetTextScale(0.0, scale * 0.5)
|
||||
SetTextFont(4)
|
||||
SetTextProportional(true)
|
||||
SetTextColour(255, 255, 255, 245)
|
||||
SetTextDropshadow(1, 0, 0, 0, 200)
|
||||
SetTextEdge(2, 0, 0, 0, 180)
|
||||
SetTextDropShadow()
|
||||
SetTextOutline()
|
||||
SetTextEntry("STRING")
|
||||
SetTextCentre(true)
|
||||
AddTextComponentString(text)
|
||||
DrawText(_x, _y)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user