Cleaner way of fetching inputs in intermission.
This commit is contained in:
parent
a8ed346e67
commit
e92b7cf269
2 changed files with 11 additions and 31 deletions
|
|
@ -1,3 +1,3 @@
|
|||
[default]
|
||||
SWWM_MODVER="\cyDEMOLITIONIST \cw1.2.21 \cu(Wed 1 Jun 18:33:35 CEST 2022)\c-";
|
||||
SWWM_SHORTVER="\cw1.2.21 \cu(2022-06-01 18:33:35)\c-";
|
||||
SWWM_MODVER="\cyDEMOLITIONIST \cw1.2.21 \cu(Tue 7 Jun 12:01:07 CEST 2022)\c-";
|
||||
SWWM_SHORTVER="\cw1.2.21 \cu(2022-06-07 12:01:07)\c-";
|
||||
|
|
|
|||
|
|
@ -297,40 +297,25 @@ Class SWWMStatScreen : StatusScreen abstract
|
|||
{
|
||||
if ( evt.type == InputEvent.Type_KeyDown )
|
||||
{
|
||||
Array<int> usekey, firekey, altfirekey, reloadkey, zoomkey;
|
||||
Bindings.GetAllKeysForCommand(usekey,"+use");
|
||||
for ( int i=0; i<usekey.Size(); i++ )
|
||||
String cmd = Bindings.GetBinding(evt.KeyScan);
|
||||
if ( (cmd ~== "+attack") || (cmd ~== "+use") )
|
||||
{
|
||||
if ( evt.KeyScan != usekey[i] ) continue;
|
||||
accelerateStage = 1;
|
||||
return true;
|
||||
}
|
||||
Bindings.GetAllKeysForCommand(firekey,"+attack");
|
||||
for ( int i=0; i<firekey.Size(); i++ )
|
||||
if ( cmd ~== "+altattack" )
|
||||
{
|
||||
if ( evt.KeyScan != firekey[i] ) continue;
|
||||
accelerateStage = 1;
|
||||
return true;
|
||||
}
|
||||
Bindings.GetAllKeysForCommand(altfirekey,"+altattack");
|
||||
for ( int i=0; i<altfirekey.Size(); i++ )
|
||||
{
|
||||
if ( evt.KeyScan != altfirekey[i] ) continue;
|
||||
bFade = true;
|
||||
return true;
|
||||
}
|
||||
Bindings.GetAllKeysForCommand(reloadkey,"+reload");
|
||||
for ( int i=0; i<reloadkey.Size(); i++ )
|
||||
if ( cmd ~== "+reload" )
|
||||
{
|
||||
if ( evt.KeyScan != reloadkey[i] ) continue;
|
||||
if ( !swwm_nointertips ) PlaySound("menu/demoscroll");
|
||||
whichtip = 0;
|
||||
return true;
|
||||
}
|
||||
Bindings.GetAllKeysForCommand(zoomkey,"+zoom");
|
||||
for ( int i=0; i<zoomkey.Size(); i++ )
|
||||
if ( cmd ~== "+zoom" )
|
||||
{
|
||||
if ( evt.KeyScan != zoomkey[i] ) continue;
|
||||
if ( swwm_interart ) PlaySound("menu/demoscroll");
|
||||
whichart = 0;
|
||||
arttex.SetNull();
|
||||
|
|
@ -338,16 +323,11 @@ Class SWWMStatScreen : StatusScreen abstract
|
|||
}
|
||||
return false;
|
||||
}
|
||||
else if ( evt.type == InputEvent.Type_KeyUp )
|
||||
else if ( (evt.type == InputEvent.Type_KeyUp)
|
||||
&& (Bindings.GetBinding(evt.KeyScan) ~== "+altattack") )
|
||||
{
|
||||
Array<int> altfirekey;
|
||||
Bindings.GetAllKeysForCommand(altfirekey,"+altattack");
|
||||
for ( int i=0; i<altfirekey.Size(); i++ )
|
||||
{
|
||||
if ( evt.KeyScan != altfirekey[i] ) continue;
|
||||
bFade = false;
|
||||
return true;
|
||||
}
|
||||
bFade = false;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue