Skip to content

Commit

Permalink
Merge pull request #1599 from fnbar0/dev
Browse files Browse the repository at this point in the history
refactor(es_extended/client/modules/scaleform): Make scaleforms show duration framerate independent
  • Loading branch information
Kenshiin13 authored Jan 19, 2025
2 parents 6e3dbc1 + bdb74d0 commit 153212e
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions [core]/es_extended/client/modules/scaleform.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ ESX.Scaleform.Utils = {}

function ESX.Scaleform.ShowFreemodeMessage(title, msg, sec)
local scaleform = ESX.Scaleform.Utils.RunMethod("MP_BIG_MESSAGE_FREEMODE", "SHOW_SHARD_WASTED_MP_MESSAGE", false, title, msg)

while sec > 0 do

local endTime = GetGameTimer() + (sec * 1000)
while GetGameTimer() < endTime do
Wait(0)
sec = sec - 0.01

DrawScaleformMovieFullscreen(scaleform, 255, 255, 255, 255, 0)
end

Expand All @@ -19,10 +18,9 @@ function ESX.Scaleform.ShowBreakingNews(title, msg, bottom, sec)
ESX.Scaleform.Utils.RunMethod(scaleform, "SET_SCROLL_TEXT", false, 0, 0, title)
ESX.Scaleform.Utils.RunMethod(scaleform, "DISPLAY_SCROLL_TEXT", false, 0, 0)

while sec > 0 do
local endTime = GetGameTimer() + (sec * 1000)
while GetGameTimer() < endTime do
Wait(0)
sec = sec - 0.01

DrawScaleformMovieFullscreen(scaleform, 255, 255, 255, 255, 0)
end

Expand All @@ -32,10 +30,9 @@ end
function ESX.Scaleform.ShowPopupWarning(title, msg, bottom, sec)
local scaleform = ESX.Scaleform.Utils.RunMethod("POPUP_WARNING", "SHOW_POPUP_WARNING", false, 500.0, title, msg, bottom, true)

while sec > 0 do
local endTime = GetGameTimer() + (sec * 1000)
while GetGameTimer() < endTime do
Wait(0)
sec = sec - 0.01

DrawScaleformMovieFullscreen(scaleform, 255, 255, 255, 255, 0)
end

Expand All @@ -45,10 +42,9 @@ end
function ESX.Scaleform.ShowTrafficMovie(sec)
local scaleform = ESX.Scaleform.Utils.RunMethod("TRAFFIC_CAM", "PLAY_CAM_MOVIE", false)

while sec > 0 do
local endTime = GetGameTimer() + (sec * 1000)
while GetGameTimer() < endTime do
Wait(0)
sec = sec - 0.01

DrawScaleformMovieFullscreen(scaleform, 255, 255, 255, 255, 0)
end

Expand Down

0 comments on commit 153212e

Please sign in to comment.