Skip to content

Commit

Permalink
refactor(natives/name): update
Browse files Browse the repository at this point in the history
This should get all the real names instead of old ones.
  • Loading branch information
PsychoShock committed Jun 13, 2024
1 parent c7701a2 commit e8e9e72
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
28 changes: 14 additions & 14 deletions ctf-gamemode/ctf_rendering.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function ctfRenderingRenderThisFrame()
end

if isInTeamSelection() then
DisableRadarThisFrame()
HideMinimapExteriorMapThisFrame()
HideHudAndRadarThisFrame()
DrawScaleformMovieFullscreen(buttonsHandle, 255, 255, 255, 255, 1) -- Draw the instructional buttons this frame

Expand Down Expand Up @@ -121,7 +121,7 @@ end

function buttonMessage(text)
BeginTextCommandScaleformString("STRING")
AddTextComponentScaleform(text)
AddTextComponentSubstringKeyboardDisplay(text)
EndTextCommandScaleformString()
end

Expand All @@ -135,20 +135,20 @@ function drawScaleFormUI(buttonsHandle)

CallScaleformMovieMethod(buttonsHandle, 'CLEAR_ALL') -- Clear previous buttons

PushScaleformMovieFunction(buttonsHandle, "SET_DATA_SLOT")
PushScaleformMovieFunctionParameterInt(2)
BeginScaleformMovieMethod(buttonsHandle, "SET_DATA_SLOT")
ScaleformMovieMethodAddParamInt(2)
ScaleformMovieMethodAddParamPlayerNameString("~INPUT_SPRINT~")
buttonMessage(btnCaptions.Spawn)
PopScaleformMovieFunctionVoid()

PushScaleformMovieFunction(buttonsHandle, "SET_DATA_SLOT")
PushScaleformMovieFunctionParameterInt(1)
BeginScaleformMovieMethod(buttonsHandle, "SET_DATA_SLOT")
ScaleformMovieMethodAddParamInt(1)
ScaleformMovieMethodAddParamPlayerNameString("~INPUT_ATTACK~")
buttonMessage(btnCaptions.PreviousTeam)
PopScaleformMovieFunctionVoid()

PushScaleformMovieFunction(buttonsHandle, "SET_DATA_SLOT")
PushScaleformMovieFunctionParameterInt(0)
BeginScaleformMovieMethod(buttonsHandle, "SET_DATA_SLOT")
ScaleformMovieMethodAddParamInt(0)
ScaleformMovieMethodAddParamPlayerNameString("~INPUT_AIM~") -- The button to display
buttonMessage(btnCaptions.NextTeam) -- the message to display next to it
PopScaleformMovieFunctionVoid()
Expand Down Expand Up @@ -182,9 +182,9 @@ function drawTxt(x,y,width,height,scale, text, r,g,b,a)
SetTextDropShadow()
SetTextOutline()
-- Let's use our previously created text entry 'textRenderingEntry'
SetTextEntry("textRenderingEntry")
AddTextComponentString(text)
DrawText(x - width/2, y - height/2 + 0.005)
BeginTextCommandDisplayText("textRenderingEntry")
AddTextComponentSubstringPlayerName(text)
EndTextCommandDisplayText(x - width/2, y - height/2 + 0.005)
end

--- https://forum.cfx.re/t/draw-3d-text-as-marker/2643565/2
Expand All @@ -205,9 +205,9 @@ function Draw3DText(x, y, z, scl_factor, text)
SetTextDropShadow()
SetTextOutline()
-- Let's use our previously created text entry 'textRenderingEntry'
SetTextEntry("textRenderingEntry")
BeginTextCommandDisplayText("textRenderingEntry")
SetTextCentre(1)
AddTextComponentString(text)
DrawText(_x, _y)
AddTextComponentSubstringPlayerName(text)
EndTextCommandDisplayText(_x, _y)
end
end
22 changes: 11 additions & 11 deletions tdm-gamemode/tdm_client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ end

local buttonMessage = function(text)
BeginTextCommandScaleformString("STRING")
AddTextComponentScaleform(Locales[tostring(GetCurrentLanguage())][text] or text) -- Calling native every time so if player change game language, it will update automatically
AddTextComponentSubstringKeyboardDisplay(Locales[tostring(GetCurrentLanguage())][text] or text) -- Calling native every time so if player change game language, it will update automatically
EndTextCommandScaleformString()
end

Expand All @@ -123,20 +123,20 @@ local drawScaleFormUI = function(buttonsHandle)

CallScaleformMovieMethod(buttonsHandle, 'CLEAR_ALL') -- Clear previous buttons

PushScaleformMovieFunction(buttonsHandle, "SET_DATA_SLOT")
PushScaleformMovieFunctionParameterInt(2)
BeginScaleformMovieMethod(buttonsHandle, "SET_DATA_SLOT")
ScaleformMovieMethodAddParamInt(2)
ScaleformMovieMethodAddParamPlayerNameString("~INPUT_SPRINT~")
buttonMessage('spawn')
PopScaleformMovieFunctionVoid()

PushScaleformMovieFunction(buttonsHandle, "SET_DATA_SLOT")
PushScaleformMovieFunctionParameterInt(1)
BeginScaleformMovieMethod(buttonsHandle, "SET_DATA_SLOT")
ScaleformMovieMethodAddParamInt(1)
ScaleformMovieMethodAddParamPlayerNameString("~INPUT_ATTACK~")
buttonMessage('previous_team')
PopScaleformMovieFunctionVoid()

PushScaleformMovieFunction(buttonsHandle, "SET_DATA_SLOT")
PushScaleformMovieFunctionParameterInt(0)
BeginScaleformMovieMethod(buttonsHandle, "SET_DATA_SLOT")
ScaleformMovieMethodAddParamInt(0)
ScaleformMovieMethodAddParamPlayerNameString("~INPUT_AIM~") -- The button to display
buttonMessage('next_team') -- the message to display next to it
PopScaleformMovieFunctionVoid()
Expand Down Expand Up @@ -192,9 +192,9 @@ local drawTxt = function(x, y, width, height, scale, text, r, g, b, a)
SetTextDropShadow()
SetTextOutline()
-- Let's use our previously created text entry 'textRenderingEntry'
SetTextEntry("textRenderingEntry")
AddTextComponentString(text)
DrawText(x - width/2, y - height/2 + 0.005)
BeginTextCommandDisplayText("textRenderingEntry")
AddTextComponentSubstringPlayerName(text)
EndTextCommandDisplayText(x - width/2, y - height/2 + 0.005)
end

--- Handles player input for team selection.
Expand Down Expand Up @@ -382,7 +382,7 @@ CreateThread(function()

-- Run the logic for picking a team
if bInTeamSelection then
DisableRadarThisFrame()
HideMinimapExteriorMapThisFrame()
HideHudAndRadarThisFrame()

-- Draw the instructional buttons this frame
Expand Down

0 comments on commit e8e9e72

Please sign in to comment.