Remove code built on incorrect assumptions about UI events.
That is, remove code for closing menus with the key that's bound to open them. As it turns out, UIEvent.keystring isn't 1:1 with key binds for a command. This SEEMINGLY worked since the Demolitionist Menu is by default bound to Q, and pressing Q does send an UIEvent to the menu with the string "Q". But if, for example, the menu had been bound to Tab, this would fall apart because then the key string sent is " " (a literal tab character). If there is a way to do this properly, I don't know about it. I've looked everywhere in GZDoom's code for a solution, something that would let me do what I need, but alas, there is nothing there. Better to get rid of this in its entirety than keep the flaky code in the mod until someone with a special setup that breaks it shows up to complain.
This commit is contained in:
parent
48f8a75362
commit
5488bfce5d
7 changed files with 41 additions and 69 deletions
|
|
@ -605,26 +605,29 @@ extend Class SWWMHandler
|
|||
|
||||
override bool InputProcess( InputEvent e )
|
||||
{
|
||||
if ( (e.Type == InputEvent.TYPE_KeyDown) && (e.KeyChar >= 0x61) && (e.KeyChar <= 0x7A) )
|
||||
if ( e.Type != InputEvent.TYPE_KeyDown ) return false;
|
||||
// F
|
||||
if ( e.KeyChar == 0x66 )
|
||||
{
|
||||
// F
|
||||
if ( e.KeyChar == 0x66 )
|
||||
let demo = Demolitionist(players[consoleplayer].mo);
|
||||
let gone = PlayerGone(players[consoleplayer].mo);
|
||||
if ( (demo && (demo.Health <= 0) && (demo.deadtimer > 40))
|
||||
|| (gone && (gone.Health <= 0) && (gone.deadtimer > 40)) )
|
||||
{
|
||||
let demo = Demolitionist(players[consoleplayer].mo);
|
||||
let gone = PlayerGone(players[consoleplayer].mo);
|
||||
if ( (demo && (demo.Health <= 0) && (demo.deadtimer > 40))
|
||||
|| (gone && (gone.Health <= 0) && (gone.deadtimer > 40)) )
|
||||
// pay respects
|
||||
int numf = Random[FInTheChat](1,6);
|
||||
for ( int i=0; i<numf; i++ )
|
||||
{
|
||||
// pay respects
|
||||
int numf = Random[FInTheChat](1,6);
|
||||
for ( int i=0; i<numf; i++ )
|
||||
{
|
||||
let f = PayRespects.PressF();
|
||||
StatusBar.AttachMessage(f,0,layer:StatusBar.HUDMSGLayer_OverHUD);
|
||||
}
|
||||
let f = PayRespects.PressF();
|
||||
StatusBar.AttachMessage(f,0,layer:StatusBar.HUDMSGLayer_OverHUD);
|
||||
}
|
||||
}
|
||||
if ( CheatInput(e) ) return true;
|
||||
}
|
||||
// cheats
|
||||
if ( (e.KeyChar >= 0x61) && (e.KeyChar <= 0x7A) )
|
||||
{
|
||||
if ( CheatInput(e) )
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue