This commit is contained in:
guava
2016-12-15 13:40:07 +01:00
commit ee4dd89693
95 changed files with 7368 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
dependency 'channelfeed'
client_script 'obituary.lua'
export 'printObituary'
files 'obituary.css'

View File

@@ -0,0 +1,46 @@
@font-face {
font-family: 'Roboto Condensed';
src: url('nui://channelfeed/client/fonts/roboto-condensed.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Roboto';
src: url('nui://channelfeed/client/fonts/roboto-regular.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
#channel-obituary
{
position: absolute;
}
#channel-obituary > div
{
width: 100%;
font-family: 'Roboto';
}
#channel-obituary div.item
{
background-color: rgba(50, 50, 50, .6);
padding: 4px;
padding-left: 8px;
padding-right: 8px;
border-radius: 4px;
color: #eee;
margin-bottom: 3px;
font-size: 65%;
}
#channel-obituary div.item b
{
font-family: 'Roboto Condensed';
font-size: 125%;
font-weight: normal;
color: #09f;
}

View File

@@ -0,0 +1,51 @@
AddEventHandler('onClientResourceStart', function(name)
if name == GetCurrentResource() then
local x, y = GetHudPosition('HUD_RADAR')
local w, h = GetHudSize('HUD_RADAR')
x = x - 0.01
w = w + 0.02
if GetIsWidescreen() then
x = x / 1.333
w = w / 1.333
end
exports.channelfeed:addChannel('obituary', {
method = 'append',
styleUrl = 'nui://obituary/obituary.css',
styles = { -- temporary
left = tostring(x * 100) .. '%',
bottom = 'calc(' .. tostring((1 - y) * 100) .. '% + 10px)',
width = tostring(w * 100) .. '%'
},
template = '<div class="item">{{{text}}}</div>'
})
end
end)
function printObituary(format, ...)
local args = table.pack(...)
for i = 1, args.n do
if type(args[i]) == 'string' then
args[i] = args[i]:gsub('<', '&lt;')
end
end
echo("obituary: printObituary\n")
exports.channelfeed:printTo('obituary', {
text = string.format(format, table.unpack(args))
})
end
--[[AddEventHandler('chatMessage', function(name, color, message)
exports.channelfeed:printTo('obituary', {
text = message:gsub('<', '&lt;')
})
end)]]
AddEventHandler('onClientResourceStop', function()
-- todo: remove channel
end)