|
|
|
@ -151,7 +151,7 @@ Menu*Menu::CreateMenu(MenuType type,vf2d pos,vf2d size){ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void Menu::CheckClickAndPerformMenuSelect(AiL*game){ |
|
|
|
|
if(game->GetMouse(Mouse::LEFT).bReleased||game->GetKey(SPACE).bReleased||game->GetKey(ENTER).bReleased){ |
|
|
|
|
if(game->KEY_CONFIRM.Released()){ |
|
|
|
|
MenuSelect(game); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -231,7 +231,7 @@ void Menu::Update(AiL*game){ |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(itemHovered&&draggingComponent==nullptr&&selection!=vi2d{-1,-1}&&(((!UsingMouseNavigation()&&(game->GetKey(ENTER).bHeld)||game->GetKey(SPACE).bHeld))||game->GetMouse(Mouse::LEFT).bHeld)){ |
|
|
|
|
if(itemHovered&&draggingComponent==nullptr&&selection!=vi2d{-1,-1}&&!UsingMouseNavigation()&&(game->KEY_CONFIRM.Held())){ |
|
|
|
|
buttonHoldTime+=game->GetElapsedTime(); |
|
|
|
|
}else{ |
|
|
|
|
buttonHoldTime=0; |
|
|
|
@ -251,7 +251,7 @@ void Menu::Update(AiL*game){ |
|
|
|
|
|
|
|
|
|
if(!UsingMouseNavigation()){ |
|
|
|
|
if(!game->IsTextEntryEnabled()){ |
|
|
|
|
if(game->GetKey(ENTER).bReleased||game->GetKey(SPACE).bReleased){ |
|
|
|
|
if(game->KEY_CONFIRM.Released()){ |
|
|
|
|
if(selectedComponent==nullptr){//Dropping over an empty area.
|
|
|
|
|
ClearDraggingComponent(); |
|
|
|
|
}else |
|
|
|
@ -261,7 +261,7 @@ void Menu::Update(AiL*game){ |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
if(game->GetMouse(Mouse::LEFT).bReleased){ |
|
|
|
|
if(game->KEY_CONFIRM.Released()){ |
|
|
|
|
if(selectedComponent==nullptr){//Dropping over an empty area.
|
|
|
|
|
ClearDraggingComponent(); |
|
|
|
|
}else |
|
|
|
@ -449,7 +449,7 @@ void Menu::KeyboardButtonNavigation(AiL*game,vf2d menuPos){ |
|
|
|
|
selection.x=-1; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if(game->GetMouse(0).bPressed||game->GetKey(ENTER).bPressed||game->GetKey(SPACE).bPressed){ |
|
|
|
|
if(game->KEY_CONFIRM.Pressed()){ |
|
|
|
|
SetMouseNavigation(game->GetMouse(0).bPressed); //If a click occurs we use mouse controls.
|
|
|
|
|
if(!UsingMouseNavigation()){ |
|
|
|
|
buttonHoldTime=0; |
|
|
|
|