Download CommonLua/UI/Subtitles.lua from sirnii/myspace: direct link, hf CLI and curl.
- Browser
- Download file 670 Bytes
-
https://huggingface.co/spaces/sirnii/myspace/resolve/main/CommonLua/UI/Subtitles.lua
- Command line
-
hf download hf://spaces/sirnii/myspace/CommonLua/UI/Subtitles.lua
-
curl -L -o Subtitles.lua https://huggingface.co/spaces/sirnii/myspace/resolve/main/CommonLua/UI/Subtitles.lua
670 Bytes
| DefineClass.XSubtitles = | |
| { | |
| __parents = { "XDialog" }, | |
| } | |
| function XSubtitles:SetSubtitles(text) | |
| self.idText:SetText(text) | |
| end | |
| ----------------------------------------------------- | |
| MapVar("g_SubtitlesThread", false) | |
| function ShowSubtitles(text, duration, delay) | |
| if g_SubtitlesThread then HideSubtitles() end | |
| local dlg = OpenDialog("XSubtitles") | |
| g_SubtitlesThread = CreateMapRealTimeThread(function() | |
| if delay then | |
| Sleep(delay) | |
| end | |
| dlg:SetSubtitles(text) | |
| Sleep(duration) | |
| CloseDialog("XSubtitles") | |
| g_SubtitlesThread = false | |
| end) | |
| end | |
| function HideSubtitles() | |
| DeleteThread(g_SubtitlesThread) | |
| g_SubtitlesThread = false | |
| CloseDialog("XSubtitles") | |
| end |