Scripts/resources/[standalone]/RageUI/components/Visual.lua

65 lines
1.5 KiB
Lua
Raw Permalink Normal View History

2024-12-29 20:02:43 +00:00
---
--- @author Dylan MALANDAIN
--- @version 2.0.0
--- @since 2020
---
--- RageUI Is Advanced UI Libs in LUA for make beautiful interface like RockStar GAME.
---
---
--- Commercial Info.
--- Any use for commercial purposes is strictly prohibited and will be punished.
---
--- @see RageUI
---
---@class Visual
Visual = Visual or {};
local function AddLongString(txt)
for i = 100, string.len(txt), 99 do
local sub = string.sub(txt, i, i + 99)
AddTextComponentSubstringPlayerName(sub)
end
end
function Visual.Popup()
end
function Visual.Radar()
end
function Visual.Subtitle(text, time)
ClearPrints()
BeginTextCommandPrint("STRING")
AddTextComponentSubstringPlayerName(text)
EndTextCommandPrint(time and math.ceil(time) or 0, true)
end
function Visual.FloatingHelpText(text, sound, loop)
BeginTextCommandDisplayHelp("jamyfafi")
AddTextComponentSubstringPlayerName(text)
if string.len(text) > 99 then
AddLongString(text)
end
EndTextCommandDisplayHelp(0, loop or 0, sound or true, -1)
end
function Visual.Prompt(text, spinner)
BeginTextCommandBusyspinnerOn("STRING")
AddTextComponentSubstringPlayerName(text)
EndTextCommandBusyspinnerOn(spinner or 1)
end
function Visual.PromptDuration(duration, text, spinner)
CreateThread(function()
Wait(0)
Visual.Prompt(text, spinner)
Wait(duration)
if (BusyspinnerIsOn()) then
BusyspinnerOff();
end
end)
end