Forum

> > CS2D > Scripts > Menu and the escape key
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Menu and the escape key

8 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Menu and the escape key

Blighted Song
User Off Offline

Zitieren
Hi guys just a quick one this time,

with menus what is the listener for the escape key?

I cant find any docummentation on the matter. . .

alt Re: Menu and the escape key

archmage
User Off Offline

Zitieren
I think if you use the menu hook it will set button to 0.
1
menu_hook(id, menu, button)

In the time you posted this and waited for an answer you could have tested it yourself.

alt Re: Menu and the escape key

Blighted Song
User Off Offline

Zitieren
Perhaps, which is a bit annoying because I need a script to execute, regardless of the player choosing an option. It does the same thing no matter what they choose.

alt Re: Menu and the escape key

archmage
User Off Offline

Zitieren
Then there is but one option. I do not think it is a good one though.

Edit:
nvm it won't work either.

Also why do you need a menu to do the same thing for each button pressed?

alt Re: Menu and the escape key

Blighted Song
User Off Offline

Zitieren
Its more of a place holder, it sits on the left hand of the screen while I show stuff on the right, it only has one button to bring the player back to the main menu.

Problem is if the player doesnt press the button the stuff on the right won't go away, so I use the menu to determin when I should remove the images and text.

EDIT:

it does the same thing if you hit cancel or the exit button, but I need it to also do the script if you close the menu, that way every thing works.

Infact if the player doesnt do that script it screws everyone else's images aswell.

alt Re: Menu and the escape key

archmage
User Off Offline

Zitieren
I think that this is your only fix atm
1
2
3
4
5
6
addhook("always", "func")
function func()
	for i = 1, 32 do
		show_menu(i)
	end
end

Maybe binds, but I think binds will only work for the server.

alt Re: Menu and the escape key

DC
Admin Off Offline

Zitieren
there are many ways how a menu can be closed (for example also by opening another menu - which can be an event that is not even sent to the server).

there is currently no save way to keep track of the menu state as server.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht