Close last menu if key is pressed again while menu is still open.
parent
9b7b38c8f7
commit
202840a12d
|
@ -1,5 +1,6 @@
|
||||||
-- Sent by the server to let us know about available taunts
|
-- Sent by the server to let us know about available taunts
|
||||||
local sortedTaunts = {}
|
local sortedTaunts = {}
|
||||||
|
local lastMenu = nil
|
||||||
|
|
||||||
net.Receive("TauntList_Update", function()
|
net.Receive("TauntList_Update", function()
|
||||||
|
|
||||||
|
@ -101,6 +102,9 @@ end
|
||||||
|
|
||||||
hook.Add( "PlayerBindPress", "PlayerBindPressFKeyMenus", function(pl, bind, pressed)
|
hook.Add( "PlayerBindPress", "PlayerBindPressFKeyMenus", function(pl, bind, pressed)
|
||||||
if bind == "gm_showspare2" and pressed then
|
if bind == "gm_showspare2" and pressed then
|
||||||
|
if lastMenu ~= nil then
|
||||||
|
lastMenu:Close()
|
||||||
|
end
|
||||||
local menu = CreateMenu()
|
local menu = CreateMenu()
|
||||||
if menu ~= nil then
|
if menu ~= nil then
|
||||||
menu:Open()
|
menu:Open()
|
||||||
|
|
Loading…
Reference in New Issue