|
|
|
@ -70,6 +70,7 @@ All rights reserved. |
|
|
|
|
#include "SaveFile.h" |
|
|
|
|
#include "TitleScreen.h" |
|
|
|
|
#include "SoundEffect.h" |
|
|
|
|
#include "olcPGEX_Gamepad.h" |
|
|
|
|
#ifndef __EMSCRIPTEN__ |
|
|
|
|
#include "discord.h" |
|
|
|
|
#endif |
|
|
|
@ -175,6 +176,8 @@ AiL::AiL() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool AiL::OnUserCreate(){ |
|
|
|
|
GamePad::init(); |
|
|
|
|
|
|
|
|
|
Font::init(); |
|
|
|
|
|
|
|
|
|
InitializeDefaultKeybinds(); |
|
|
|
@ -315,6 +318,18 @@ bool AiL::UpReleased(){ |
|
|
|
|
bool AiL::DownReleased(){ |
|
|
|
|
return KEY_DOWN.Released(); |
|
|
|
|
} |
|
|
|
|
bool AiL::LeftPressed(){ |
|
|
|
|
return KEY_LEFT.Pressed(); |
|
|
|
|
} |
|
|
|
|
bool AiL::RightPressed(){ |
|
|
|
|
return KEY_RIGHT.Pressed(); |
|
|
|
|
} |
|
|
|
|
bool AiL::UpPressed(){ |
|
|
|
|
return KEY_UP.Pressed(); |
|
|
|
|
} |
|
|
|
|
bool AiL::DownPressed(){ |
|
|
|
|
return KEY_DOWN.Pressed(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void AiL::HandleUserInput(float fElapsedTime){ |
|
|
|
|
if(!Menu::stack.empty())return; //A window being opened means there's no user input allowed.
|
|
|
|
@ -2278,25 +2293,45 @@ void AiL::DrawSquarePie(vf2d center,float radius,float degreesCut,Pixel col){ |
|
|
|
|
|
|
|
|
|
void AiL::InitializeDefaultKeybinds(){ |
|
|
|
|
Player::KEY_ABILITY1.AddKeybind({KEY,Q}); |
|
|
|
|
Player::KEY_ABILITY1.AddKeybind({CONTROLLER,static_cast<int>(GPButtons::L1)}); |
|
|
|
|
Player::KEY_ABILITY1.AddKeybind({CONTROLLER,static_cast<int>(GPButtons::FACE_L)}); |
|
|
|
|
Player::KEY_ABILITY2.AddKeybind({KEY,E}); |
|
|
|
|
Player::KEY_ABILITY2.AddKeybind({CONTROLLER,static_cast<int>(GPButtons::R1)}); |
|
|
|
|
Player::KEY_ABILITY2.AddKeybind({CONTROLLER,static_cast<int>(GPButtons::FACE_U)}); |
|
|
|
|
Player::KEY_ABILITY3.AddKeybind({KEY,R}); |
|
|
|
|
Player::KEY_ABILITY3.AddKeybind({CONTROLLER,static_cast<int>(GPButtons::FACE_R)}); |
|
|
|
|
Player::KEY_ABILITY4.AddKeybind({KEY,F}); |
|
|
|
|
Player::KEY_ABILITY4.AddKeybind({CONTROLLER,static_cast<int>(GPButtons::L2)}); |
|
|
|
|
Player::KEY_DEFENSIVE.AddKeybind({MOUSE,Mouse::RIGHT}); |
|
|
|
|
Player::KEY_DEFENSIVE.AddKeybind({KEY,SPACE}); |
|
|
|
|
Player::KEY_DEFENSIVE.AddKeybind({CONTROLLER,static_cast<int>(GPButtons::R2)}); |
|
|
|
|
Player::KEY_ITEM1.AddKeybind({KEY,K1}); |
|
|
|
|
Player::KEY_ITEM1.AddKeybind({CONTROLLER,static_cast<int>(GPButtons::SELECT)}); |
|
|
|
|
Player::KEY_ITEM2.AddKeybind({KEY,K2}); |
|
|
|
|
Player::KEY_ITEM2.AddKeybind({CONTROLLER,static_cast<int>(GPButtons::L3)}); |
|
|
|
|
Player::KEY_ITEM3.AddKeybind({KEY,K3}); |
|
|
|
|
Player::KEY_ITEM3.AddKeybind({CONTROLLER,static_cast<int>(GPButtons::R3)}); |
|
|
|
|
KEY_ATTACK.AddKeybind({MOUSE,Mouse::LEFT}); |
|
|
|
|
KEY_ATTACK.AddKeybind({CONTROLLER,static_cast<int>(GPButtons::FACE_D)}); |
|
|
|
|
KEY_LEFT.AddKeybind({KEY,LEFT}); |
|
|
|
|
KEY_LEFT.AddKeybind({KEY,A}); |
|
|
|
|
KEY_LEFT.AddKeybind({CONTROLLER,static_cast<int>(GPButtons::DPAD_L)}); |
|
|
|
|
KEY_RIGHT.AddKeybind({KEY,RIGHT}); |
|
|
|
|
KEY_RIGHT.AddKeybind({KEY,D}); |
|
|
|
|
KEY_RIGHT.AddKeybind({CONTROLLER,static_cast<int>(GPButtons::DPAD_R)}); |
|
|
|
|
KEY_UP.AddKeybind({KEY,UP}); |
|
|
|
|
KEY_UP.AddKeybind({KEY,W}); |
|
|
|
|
KEY_UP.AddKeybind({CONTROLLER,static_cast<int>(GPButtons::DPAD_U)}); |
|
|
|
|
KEY_DOWN.AddKeybind({KEY,DOWN}); |
|
|
|
|
KEY_DOWN.AddKeybind({KEY,S}); |
|
|
|
|
KEY_DOWN.AddKeybind({CONTROLLER,static_cast<int>(GPButtons::DPAD_D)}); |
|
|
|
|
KEY_CONFIRM.AddKeybind({MOUSE,Mouse::LEFT}); |
|
|
|
|
KEY_CONFIRM.AddKeybind({CONTROLLER,static_cast<int>(GPButtons::FACE_D)}); |
|
|
|
|
KEY_CONFIRM.AddKeybind({CONTROLLER,static_cast<int>(GPButtons::FACE_R)}); |
|
|
|
|
KEY_CONFIRM.AddKeybind({CONTROLLER,static_cast<int>(GPButtons::START)}); |
|
|
|
|
KEY_CONFIRM.AddKeybind({KEY,ENTER}); |
|
|
|
|
KEY_MENU.AddKeybind({KEY,ESCAPE}); |
|
|
|
|
KEY_MENU.AddKeybind({CONTROLLER,static_cast<int>(GPButtons::START)}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void AiL::SetBossNameDisplay(std::string name,float time){ |
|
|
|
|