From 4744e94f36be71af014690afc53d305eaa90729f Mon Sep 17 00:00:00 2001 From: edshot99 Date: Mon, 12 Aug 2024 19:47:20 -0500 Subject: [PATCH] make the toggle be done through a desktop icon instead of double clicking C which is very annoying. also removes chat messages that just clutter the chat. --- .../lua/autorun/sh_bfg_weaponseats.lua | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/seat_weaponiser_ii_fixed_custom/lua/autorun/sh_bfg_weaponseats.lua b/seat_weaponiser_ii_fixed_custom/lua/autorun/sh_bfg_weaponseats.lua index f9132aa..8458157 100644 --- a/seat_weaponiser_ii_fixed_custom/lua/autorun/sh_bfg_weaponseats.lua +++ b/seat_weaponiser_ii_fixed_custom/lua/autorun/sh_bfg_weaponseats.lua @@ -58,8 +58,8 @@ if SERVER then end if !ply.SWInfo then - ply:SendLua([[chat.AddText(Color(0, 255, 50), "This server is using Seat Weaponiser!\n", Color(50, 255, 255), "Double-tap the context key (C by default) or bind a key to weaponseats_toggle to use it!")]]) - ply:SendLua([[chat.AddText(Color(255, 0, 0), "To toggle the in-seat crosshair, use the convar weaponseats_enablecrosshair 1 or 0.")]]) + --ply:SendLua([[chat.AddText(Color(0, 255, 50), "This server is using Seat Weaponiser!\n", Color(50, 255, 255), "Double-tap the context key (C by default) or bind a key to weaponseats_toggle to use it!")]]) + --ply:SendLua([[chat.AddText(Color(255, 0, 0), "To toggle the in-seat crosshair, use the convar weaponseats_enablecrosshair 1 or 0.")]]) ply.SWInfo = true end end) @@ -99,6 +99,7 @@ else end end) + --[[ hook.Add("ContextMenuOpen", "BFG_WeaponSeats_Toggle", function() local ply = LocalPlayer() if !input.LookupBinding("weaponseats_toggle") and SWLastPressed and CurTime() - SWLastPressed < 0.5 then @@ -108,6 +109,16 @@ else SWLastPressed = CurTime() end) + ]]-- + + list.Set("DesktopWindows", "WeaponSeats", { + title = "Seat Weapons", + icon = "icon16/car.png", + init = function() + net.Start("WeaponSeats_ToggleCommand") + net.SendToServer() + end + }) hook.Add("CalcViewModelView", "BFG_WeaponSeats_OffsetFix", function() local ply = LocalPlayer()