diff --git a/lua/wire/client/cl_wirelib.lua b/lua/wire/client/cl_wirelib.lua index dd9be1ff72..f70ce813f6 100644 --- a/lua/wire/client/cl_wirelib.lua +++ b/lua/wire/client/cl_wirelib.lua @@ -237,12 +237,11 @@ end function WireLib.hud_debug(text, oneframe) hook.Add("HUDPaint","wire_hud_debug",function() - if oneframe then hook.Remove("HUDPaint","wire_hud_debug") end - draw.DrawText(text,"Trebuchet24",10,200,Color(255,255,255,255),0) + if oneframe then hook.Remove("HUDPaint", "wire_hud_debug") end + draw.DrawText(text, "Trebuchet24", 10, ScrH() / 5, color_white, 0) end) end - local old_renderhalos = WireLib.__old_renderhalos or hook.GetTable().PostDrawEffects.RenderHalos WireLib.__old_renderhalos = old_renderhalos if old_renderhalos ~= nil then diff --git a/lua/wire/wireshared.lua b/lua/wire/wireshared.lua index 2689c16a0e..106989c7aa 100644 --- a/lua/wire/wireshared.lua +++ b/lua/wire/wireshared.lua @@ -238,13 +238,12 @@ do NOTIFYSOUND_CONFIRM4 = 10 if CLIENT then - local sounds = { [NOTIFYSOUND_DRIP1 ] = "ambient/water/drip1.wav", [NOTIFYSOUND_DRIP2 ] = "ambient/water/drip2.wav", [NOTIFYSOUND_DRIP3 ] = "ambient/water/drip3.wav", [NOTIFYSOUND_DRIP4 ] = "ambient/water/drip4.wav", - [NOTIFYSOUND_DRIP5 ] = "ambient/water/drip5.wav", + [NOTIFYSOUND_DRIP5 ] = "ambient/water/drip4.wav", -- Non-existent sound, left for compatibility [NOTIFYSOUND_ERROR1 ] = "buttons/button10.wav", [NOTIFYSOUND_CONFIRM1] = "buttons/button3.wav", [NOTIFYSOUND_CONFIRM2] = "buttons/button14.wav", @@ -258,39 +257,33 @@ do elseif ply ~= LocalPlayer() then return end + GAMEMODE:AddNotify(Message, Type, Duration) if Sound and sounds[Sound] then surface.PlaySound(sounds[Sound]) end end net.Receive("wire_addnotify", function(netlen) local Message = net.ReadString() - local Type = net.ReadUInt(8) + local Type = net.ReadUInt(3) local Duration = net.ReadFloat() - local Sound = net.ReadUInt(8) + local Sound = net.ReadUInt(4) WireLib.AddNotify(LocalPlayer(), Message, Type, Duration, Sound) end) - - elseif SERVER then - - NOTIFY_GENERIC = 0 - NOTIFY_ERROR = 1 - NOTIFY_UNDO = 2 - NOTIFY_HINT = 3 - NOTIFY_CLEANUP = 4 - + else util.AddNetworkString("wire_addnotify") + function WireLib.AddNotify(ply, Message, Type, Duration, Sound) if isstring(ply) then ply, Message, Type, Duration, Sound = nil, ply, Message, Type, Duration end if ply and not ply:IsValid() then return end + net.Start("wire_addnotify") net.WriteString(Message) - net.WriteUInt(Type or 0,8) + net.WriteUInt(Type or 0, 3) net.WriteFloat(Duration) - net.WriteUInt(Sound or 0,8) + net.WriteUInt(Sound or 0, 4) if ply then net.Send(ply) else net.Broadcast() end end - end end -- wire_addnotify