-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
319 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
MSK.TextUI = {} | ||
|
||
local isTextUIOpen = false | ||
local thread = false | ||
|
||
MSK.TextUI.Show = function(key, text, color) | ||
if isTextUIOpen then return end | ||
isTextUIOpen = true | ||
|
||
SendNUIMessage({ | ||
action = 'textUI', | ||
show = true, | ||
key = key or 'E', | ||
text = text or '', | ||
color = color or Config.TextUIColor, | ||
}) | ||
end | ||
exports('ShowTextUI', MSK.TextUI.Show) | ||
RegisterNetEvent("msk_core:textUiShow", MSK.TextUI.Show) | ||
|
||
setmetatable(MSK.TextUI, { | ||
__call = function(self, ...) | ||
self.Show(...) | ||
end | ||
}) | ||
|
||
MSK.TextUI.ShowThread = function(key, text, color) | ||
MSK.TextUI.Show(key, text, color) | ||
|
||
if thread then return end | ||
thread = true | ||
|
||
local timer = GetGameTimer() | ||
CreateThread(function() | ||
while timer + 100 >= GetGameTimer() do Wait(100) end | ||
thread = false | ||
Wait(0) | ||
|
||
if not thread then | ||
MSK.TextUI.Hide() | ||
end | ||
end) | ||
end | ||
exports('ShowTextUIThread', MSK.TextUI.ShowThread) | ||
RegisterNetEvent("msk_core:textUiShowThread", MSK.TextUI.ShowThread) | ||
|
||
MSK.TextUI.Hide = function() | ||
if not isTextUIOpen then return end | ||
isTextUIOpen = false | ||
thread = false | ||
|
||
SendNUIMessage({ | ||
action = 'textUI', | ||
show = false | ||
}) | ||
end | ||
exports('HideTextUI', MSK.TextUI.Hide) | ||
RegisterNetEvent("msk_core:textUiHide", MSK.TextUI.Hide) | ||
|
||
MSK.TextUI.Active = function() | ||
return isTextUIOpen | ||
end | ||
exports('TextUIActive', MSK.TextUI.Active) | ||
|
||
AddEventHandler('onResourceStop', function(resource) | ||
if GetCurrentResourceName() ~= resource then return end | ||
MSK.TextUI.Hide() | ||
end) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
.textui { | ||
position: absolute; | ||
bottom:6vh; | ||
left:50%; | ||
transform:translateX(-50%); | ||
} | ||
|
||
.textui-key { | ||
position: relative; | ||
width: 4vh; | ||
height:4vh; | ||
line-height:4vh; | ||
left:50%; | ||
font-size:2vh; | ||
font-weight:bold; | ||
color:white; | ||
text-align:center; | ||
transform:translateX(-50%); | ||
transition: 200ms; | ||
background: repeating-linear-gradient( | ||
-55deg, | ||
rgb(24, 198, 0), | ||
rgb(24, 198, 0) 0.6vh, | ||
rgb(18, 158, 0) 0.6vh, | ||
rgb(18, 158, 0) 1.6vh | ||
); | ||
border-radius:0.4vh; | ||
outline:0.2vh solid rgb(30, 255, 0); | ||
box-shadow:0 1.2vh 2vh rgb(30, 255, 0); | ||
animation:moveLines 2s infinite; | ||
margin-bottom:2vh; | ||
} | ||
|
||
@keyframes moveLines { | ||
0% { | ||
/* opacity:1.0; */ | ||
background-position-x: 6vh; | ||
margin-bottom:1.6vh; | ||
} | ||
50% { | ||
/* opacity:0.4; */ | ||
margin-bottom:3.0vh; | ||
} | ||
100% { | ||
/* opacity:1.0; */ | ||
background-position-x: 2vh; | ||
margin-bottom:1.6vh; | ||
} | ||
} | ||
|
||
.textui-text { | ||
position: relative; | ||
max-width:30vh; | ||
font-size:2vh; | ||
/* color:rgb(204, 204, 204); */ | ||
color:rgb(255, 255, 255); | ||
font-weight:600; | ||
text-align: center; | ||
|
||
text-shadow:0vh 0vh 0.5vh black; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.