Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added timeout parameter for subtitle. #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions client/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,22 @@ local CurrentCinematic = nil
local CurrentStage = nil
local ShowingText = nil

--@function: ShowSubtitle
--@description: Shows a subtitle.
--@param: Text string The text to show.
local function ShowSubtitle(Text)
SendNUIMessage({ action = "SHOW_SUBTITLE", text = Text })
end

--@function: HideSubtitle
--@description: Hides the subtitle.
local function HideSubtitle()
SendNUIMessage({ action = "HIDE_SUBTITLE" })
end

--@function: ShowSubtitle
--@description: Shows a subtitle.
--@param: Text string The text to show.
local function ShowSubtitle(Text, timeout)
SendNUIMessage({ action = "SHOW_SUBTITLE", text = Text })
if timeout then
SetTimeout(timeout, HideSubtitle)
end
end

--@function: StartCinematic
--@description: Starts a Cinematic.
--@param: CinematicName string The name of the Cinematic to start.
Expand Down