|
|
|
@ -534,7 +534,7 @@ void AiL::HandleUserInput(float fElapsedTime){ |
|
|
|
|
if(GetKey(SCROLL).bPressed)displayHud=!displayHud; |
|
|
|
|
|
|
|
|
|
bool setIdleAnimation=true; |
|
|
|
|
bool heldDownMovementKey=false; //Is true when a movement key has been held down.
|
|
|
|
|
bool heldDownMovementKey=false; |
|
|
|
|
|
|
|
|
|
if(KEY_MENU.Released()){ |
|
|
|
|
if(GameState::GetCurrentState()==States::GAME_HUB)Menu::OpenMenu(MenuType::HUB_PAUSE); |
|
|
|
@ -2069,6 +2069,9 @@ void AiL::RenderCooldowns(){ |
|
|
|
|
player->GetAbility4(), |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
bool mouseHoveredOverSkill{false}; |
|
|
|
|
bool heldDownAnyAbilityKey=false; |
|
|
|
|
|
|
|
|
|
const auto DrawCooldown=[&](vf2d pos,Ability&a,int loadoutSlot=-1/*Set to 0-2 to get an item slot rendered instead*/){ |
|
|
|
|
bool circle=loadoutSlot==-1; |
|
|
|
|
if(a.name!="???"){ |
|
|
|
@ -2169,16 +2172,16 @@ void AiL::RenderCooldowns(){ |
|
|
|
|
DrawShadowStringDecal(iconPos+vf2d{1,12}-shortNameSize/2,a.shortName,shortNameCol,shadowCol,{0.5f,0.75f},{0.5f,0.75f}); |
|
|
|
|
|
|
|
|
|
#pragma region Mouseover Detection |
|
|
|
|
if(circle&&geom2d::overlaps(geom2d::circle<float>{iconPos,16},GetMousePos())|| |
|
|
|
|
!circle&&geom2d::overlaps(geom2d::rect<float>{pos-vf2d{2,2},vf2d{16,16}},GetMousePos())){ |
|
|
|
|
a.iconMouseoverTime+=GetElapsedTime(); |
|
|
|
|
a.alphaMouseoverTime=std::min(a.alphaMouseoverTime+GetElapsedTime(),0.5f); |
|
|
|
|
}else{ |
|
|
|
|
a.iconMouseoverTime=0.f; |
|
|
|
|
a.alphaMouseoverTime=std::max(0.f,a.alphaMouseoverTime-GetElapsedTime()); |
|
|
|
|
} |
|
|
|
|
const std::string abilityTooltipText{std::format("{}\n{}",a.GetName(),a.GetDescription())}; |
|
|
|
|
drawutil::DrawAbilityTooltipAtMouseCursor(this,abilityTooltipText,util::lerp(0U,255U,a.alphaMouseoverTime/0.5f)); |
|
|
|
|
if(!KEY_ATTACK.Held()&&!a.input->Held()){ //Attacking indicates we are busy in combat.
|
|
|
|
|
if(circle&&geom2d::overlaps(geom2d::circle<float>{iconPos,12},GetMousePos())|| |
|
|
|
|
!circle&&geom2d::overlaps(geom2d::rect<float>{pos,vf2d{24,24}},GetMousePos())){ |
|
|
|
|
Ability::iconMouseoverTime=std::min(Ability::iconMouseoverTime+GetElapsedTime(),1.5f); |
|
|
|
|
mouseHoveredOverSkill=true; |
|
|
|
|
if(Ability::iconMouseoverTime>=1.5f)Ability::alphaMouseoverTime=std::min(Ability::alphaMouseoverTime+GetElapsedTime(),Ability::MAX_DESCRIPTION_HOVER_TIME); |
|
|
|
|
const std::string abilityTooltipText{std::format("{}\n{}",a.GetName(),a.GetDescription())}; |
|
|
|
|
drawutil::DrawAbilityTooltipAtMouseCursor(this,abilityTooltipText,util::lerp(0U,255U,Ability::alphaMouseoverTime/Ability::MAX_DESCRIPTION_HOVER_TIME)); |
|
|
|
|
} |
|
|
|
|
}else heldDownAnyAbilityKey=true; |
|
|
|
|
#pragma endregion |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
@ -2201,6 +2204,14 @@ void AiL::RenderCooldowns(){ |
|
|
|
|
if(loadoutSlot==2){a=&GetPlayer()->useItem3;} |
|
|
|
|
DrawCooldown({float(ScreenWidth()/2+i*26-12),float(ScreenHeight()-26)},*a,loadoutSlot); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(heldDownAnyAbilityKey){ |
|
|
|
|
Ability::iconMouseoverTime=0.f; |
|
|
|
|
Ability::alphaMouseoverTime=0.f; |
|
|
|
|
}else if(!mouseHoveredOverSkill){ |
|
|
|
|
Ability::iconMouseoverTime=std::max(0.f,Ability::iconMouseoverTime-GetElapsedTime()); |
|
|
|
|
Ability::alphaMouseoverTime=std::max(0.f,Ability::alphaMouseoverTime-GetElapsedTime()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
std::pair<ForegroundWrapper,BackgroundWrapper>AiL::AddEffect(std::unique_ptr<Effect>foreground,std::unique_ptr<Effect> background){ |
|
|
|
|