Open RealMrCactus opened 1 month ago
I have no experience on key mappings 🤔 but on ticks this doesn't happen.. might happen that commands are executed twice tho 🤔
Also.. if you restart your script without closing the menu first.. a new instance will open.. that's scaleforns..
i dont think so because if i do the command manually it still happens
Also.. if you restart your script without closing the menu first.. a new instance will open.. that's scaleforns..
yeah ive been making sure to close it
the menu opens twice only when visible is set to true 🤔 unless you set Visible(true) twice there's no logic way to make it appear twice i made multiple checks into that.. unless your command is executing twice 🤔
well im not sure then
On my side when closed I need to send command twice so it opens after being closed (esc) Lua
I don't use commands so I can't say why this happens.. if you check the example.lua I open the menu via classic IsControlJustPressed native 🤔 and it works flawlessly 🤔 I'll try to investigate but I can't control commands natives
I don't use commands so I can't say why this happens.. if you check the example.lua I open the menu via classic IsControlJustPressed native 🤔 and it works flawlessly 🤔 I'll try to investigate but I can't control commands natives
i perfer registerKeybind and command so people can set a different keybind if they want
ok so... i've been trying to use this
RegisterCommand("echeveria", function ()
CreateMenu()
end, false)
RegisterKeyMapping("echeveria", "Opens the trainer", "KEYBOARD", "f1")
and everything is working fine with example menu
RegisterCommand("echeveria", function () menu:Visible(true) end, false) RegisterKeyMapping("echeveria", "Opens the trainer", "KEYBOARD", "f1")
thats how ive been opening it and there is only one
menu
declared
You can put like this:
RegisterCommand('openptfxmenu', function()
if menu and not MenuHandler:IsAnyMenuOpen() then
menu:Visible(true)
end
end)
CreateThread(function()
CreatePtfxMainMenu() -- create menu
RegisterKeyMapping('openptfxmenu', 'Open PTFX Test Menu', 'KEYBOARD', 'F1') -- keybind
end)
Thanks for the hint I'll test this in the next days and report 🤔
using the code you provided i did
RegisterCommand('openptfxmenu', function()
if exampleMenu and not MenuHandler:IsAnyMenuOpen() then
exampleMenu:Visible(true)
end
end)
CreateThread(function()
CreateMenu() -- create menu
RegisterKeyMapping('openptfxmenu', 'Open PTFX Test Menu', 'KEYBOARD', 'L') -- keybind
end)
and this is the result
i would suggest you to use the correct quake command alike intended for this feature.. so
as you can see i added a minus before the command this is intended for commands that we want to execute once without toggling things.
quick explanation:
if you want it to be a +command in this case the command would be
RegisterCommand('+openptfxmenu', function()
if exampleMenu and not MenuHandler:IsAnyMenuOpen() then
exampleMenu:Visible(true)
else
MenuHandler:CloseAndClearHistory()
end
end)
What's this issue's status ?
Busy with stuff ATM but will test stuff ASAP
thats how ive been opening it and there is only one
menu
declared