Commit 7e0140a3 authored by Manuel Moos's avatar Manuel Moos
Browse files

Merge from beta_0.2.8.3

parents 740f4131 6516b6fd
Pipeline #197976818 passed with stages
in 37 minutes and 18 seconds
......@@ -128,7 +128,7 @@ static inline void arrow(REAL x,REAL y,REAL dy,REAL size){
#endif
}
static bool repeat = false;
static bool s_globalRepeat = false;
#ifndef DEDICATED
static bool disphelp=false;
......@@ -146,6 +146,7 @@ static rNoAutoDisplayAtNewlineCallback su_noNewline( uMenu::MenuActive );
void uMenu::OnEnter(){
#ifndef DEDICATED
bool localRepeat = false;
float nextrepeat = 0.0f;
static const float repeatdelay = 0.2f;
static const float repeatrateStart = 0.2f;
......@@ -208,12 +209,12 @@ void uMenu::OnEnter(){
// don't send keyup events when released.
break;
}
repeat = true;
localRepeat = s_globalRepeat = true;
memcpy( &tEventRepeat, &tEvent, sizeof( SDL_Event ) );
nextrepeat = tSysTimeFloat() + repeatdelay;
break;
case SDL_KEYUP:
repeat = false;
localRepeat = s_globalRepeat = false;
repeatrate = repeatrateStart;
break;
}
......@@ -226,11 +227,11 @@ void uMenu::OnEnter(){
if ( tSysTimeFloat() - entertime > 1 )
{
repeat = false;
localRepeat = s_globalRepeat = false;
}
}
if ( repeat && tSysTimeFloat() > nextrepeat )
if ( localRepeat && s_globalRepeat && tSysTimeFloat() > nextrepeat )
{
this->HandleEvent( tEventRepeat );
nextrepeat = tSysTimeFloat() + repeatrate;
......@@ -359,7 +360,7 @@ void uMenu::OnEnter(){
#endif
}
repeat = false;
s_globalRepeat = false;
uCallbackMenuLeave::MenuLeave();
su_inMenu = false;
......@@ -378,7 +379,7 @@ void uMenu::HandleEvent( SDL_Event event )
switch (event.key.keysym.sym){
case(SDLK_ESCAPE):
repeat = false;
s_globalRepeat = false;
lastkey=tSysTimeFloat();
Exit();
break;
......@@ -418,7 +419,7 @@ void uMenu::HandleEvent( SDL_Event event )
case(SDLK_SPACE):
case(SDLK_KP_ENTER):
case(SDLK_RETURN):
repeat = false;
s_globalRepeat = false;
try
{
su_inMenu = false;
......@@ -449,7 +450,7 @@ void uMenu::HandleEvent( SDL_Event event )
su_inMenu = true;
repeat = false;
s_globalRepeat = false;
lastkey=tSysTimeFloat();
break;
......@@ -1177,7 +1178,7 @@ bool uMenu::IdleInput( bool processInput )
switch (event.key.keysym.sym)
{
case(SDLK_ESCAPE):
repeat = false;
s_globalRepeat = false;
lastkey=tSysTimeFloat();
return true;
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment