Downstream merge with demo branch into master branch.

pull/57/head
sigonasr2 8 months ago
commit 3d897b1aba
  1. 40
      Adventures in Lestoria/AdventuresInLestoria.cpp
  2. 2
      Adventures in Lestoria/AdventuresInLestoria.h
  3. 12
      Adventures in Lestoria/Checkbox.h
  4. 12
      Adventures in Lestoria/GameSettings.cpp
  5. 3
      Adventures in Lestoria/GameSettings.h
  6. 12
      Adventures in Lestoria/InputKeyboardWindow.cpp
  7. 1
      Adventures in Lestoria/Key.cpp
  8. 1
      Adventures in Lestoria/Key.h
  9. 4
      Adventures in Lestoria/LoadGameWindow.cpp
  10. 10
      Adventures in Lestoria/Menu.cpp
  11. 66
      Adventures in Lestoria/Minimap.cpp
  12. 12
      Adventures in Lestoria/Minimap.h
  13. 4
      Adventures in Lestoria/Player.cpp
  14. 6
      Adventures in Lestoria/SaveFile.cpp
  15. 4
      Adventures in Lestoria/ScrollableWindowComponent.h
  16. 25
      Adventures in Lestoria/SettingsWindow.cpp
  17. 21
      Adventures in Lestoria/TODO.txt
  18. 2
      Adventures in Lestoria/Version.h
  19. BIN
      Adventures in Lestoria/assets/checkmark.png
  20. 3
      Adventures in Lestoria/assets/config/configuration.txt
  21. 1
      Adventures in Lestoria/assets/config/gfx/gfx.txt
  22. 3
      Adventures in Lestoria/assets/config/settings/input.txt
  23. BIN
      Adventures in Lestoria/assets/gamepack.pak
  24. 26
      Adventures in Lestoria/controller_config/controller_generic.vdf
  25. 26
      Adventures in Lestoria/controller_config/controller_switch_pro.vdf
  26. 28
      Adventures in Lestoria/controller_config/controller_xboxone.vdf
  27. 2
      Adventures in Lestoria/controller_config/game_actions_2895980.vdf
  28. 3
      Adventures in Lestoria/olcPixelGameEngine.h
  29. BIN
      x64/Release/Adventures in Lestoria.exe

@ -146,6 +146,8 @@ InputGroup AiL::KEY_SHOULDER2;
InputGroup AiL::KEY_CHANGE_LOADOUT; InputGroup AiL::KEY_CHANGE_LOADOUT;
InputGroup AiL::KEY_MOUSE_RIGHT; InputGroup AiL::KEY_MOUSE_RIGHT;
InputGroup AiL::KEY_TOGGLE_MAP;
#ifndef __EMSCRIPTEN__ #ifndef __EMSCRIPTEN__
::discord::Core*Discord{}; ::discord::Core*Discord{};
#endif #endif
@ -1740,6 +1742,9 @@ void AiL::RenderHud(){
} }
} }
}; };
minimap.Update();
minimap.Draw();
RenderAimingCursor(); RenderAimingCursor();
@ -1811,9 +1816,6 @@ void AiL::RenderHud(){
std::string displayText=player->notificationDisplay.first; std::string displayText=player->notificationDisplay.first;
DrawShadowStringPropDecal(vf2d{float(ScreenWidth()/2),float(ScreenHeight()/4)-24}-GetTextSizeProp(displayText)/2,displayText,BLUE,VERY_DARK_BLUE); DrawShadowStringPropDecal(vf2d{float(ScreenWidth()/2),float(ScreenHeight()/4)-24}-GetTextSizeProp(displayText)/2,displayText,BLUE,VERY_DARK_BLUE);
} }
minimap.Update();
minimap.Draw();
DisplayBossEncounterInfo(); DisplayBossEncounterInfo();
#ifdef _DEBUG #ifdef _DEBUG
@ -2770,14 +2772,24 @@ bool Steam_Init(){
int main() int main()
{ {
#ifndef __EMSCRIPTEN__ if(!std::filesystem::exists("assets/config/configuration.txt")){
if(SteamAPI_RestartAppIfNecessary(2895980U))return false; //Immediately quit if steam is detected and can be started through it. ERR("WARNING! Could not find initial config file! Aborting.");
if(Steam_Init()){ return false;
LOG("Steam API Initialized successfully!"); }
}else{ {
LOG("Steam API failed to initialize!"); utils::datafile configFile;
utils::datafile::Read(configFile,"assets/config/configuration.txt");
if(configFile["steam_api"].GetBool()){
#ifndef __EMSCRIPTEN__
if(SteamAPI_RestartAppIfNecessary(2895980U))return false; //Immediately quit if steam is detected and can be started through it.
if(Steam_Init()){
LOG("Steam API Initialized successfully!");
}else{
LOG("Steam API failed to initialize!");
}
#endif
} }
#endif }
{ {
AiL demo; AiL demo;
@ -3169,6 +3181,10 @@ void AiL::InitializeDefaultKeybinds(){
KEY_UNEQUIP.AddKeybind({CONTROLLER,static_cast<int>(GPButtons::FACE_U)}); KEY_UNEQUIP.AddKeybind({CONTROLLER,static_cast<int>(GPButtons::FACE_U)});
KEY_FACEDOWN.AddKeybind({STEAM,Steam::FUNCTION_1}); KEY_FACEDOWN.AddKeybind({STEAM,Steam::FUNCTION_1});
KEY_TOGGLE_MAP.AddKeybind({KEY,TAB});
KEY_TOGGLE_MAP.AddKeybind({CONTROLLER,static_cast<int>(GPButtons::R3)});
KEY_TOGGLE_MAP.AddKeybind({STEAM,Steam::TOGGLE_MAP});
KEY_MOUSE_RIGHT.AddKeybind({MOUSE,Mouse::RIGHT}); KEY_MOUSE_RIGHT.AddKeybind({MOUSE,Mouse::RIGHT});
#define TieMenuNameToMenuInputGroup(KEY_NAME) \ #define TieMenuNameToMenuInputGroup(KEY_NAME) \
@ -3196,6 +3212,7 @@ void AiL::InitializeDefaultKeybinds(){
TieMenuNameToGameplayInputGroup(Player::KEY_ITEM1); TieMenuNameToGameplayInputGroup(Player::KEY_ITEM1);
TieMenuNameToGameplayInputGroup(Player::KEY_ITEM2); TieMenuNameToGameplayInputGroup(Player::KEY_ITEM2);
TieMenuNameToGameplayInputGroup(Player::KEY_ITEM3); TieMenuNameToGameplayInputGroup(Player::KEY_ITEM3);
TieMenuNameToGameplayInputGroup(KEY_TOGGLE_MAP);
InputGroup::menuNamesToInputGroups.SetInitialized(); InputGroup::menuNamesToInputGroups.SetInitialized();
} }
@ -3740,7 +3757,7 @@ void AiL::UpdateDiscordStatus(std::string levelName,std::string className){
} }
SteamFriends()->SetRichPresence("steam_display","#Status"); SteamFriends()->SetRichPresence("steam_display","#Status");
}else{ }else{
if(Steam_Init()){ if("steam_api"_B&&Steam_Init()){
retry=true; retry=true;
LOG("Steam API Initialized successfully!"); LOG("Steam API Initialized successfully!");
} }
@ -3786,6 +3803,7 @@ void AiL::ResetGame(bool changeToMainMenu){
SetChapter(1); SetChapter(1);
SaveFile::SetSaveFileName(""); SaveFile::SetSaveFileName("");
Tutorial::Initialize(); Tutorial::Initialize();
minimap.SetMinimapMode(MinimapMode::SMALL);
minimap.EraseChunkData(); minimap.EraseChunkData();
} }

@ -123,6 +123,8 @@ public:
static InputGroup KEY_MOUSE_RIGHT; static InputGroup KEY_MOUSE_RIGHT;
static InputGroup KEY_TOGGLE_MAP;
static float SIZE_CHANGE_SPEED; static float SIZE_CHANGE_SPEED;
double levelTime=0.; double levelTime=0.;
Camera2D camera; Camera2D camera;

@ -42,6 +42,7 @@ All rights reserved.
#include "SoundEffect.h" #include "SoundEffect.h"
INCLUDE_game INCLUDE_game
INCLUDE_GFX
class Checkbox:public MenuComponent{ class Checkbox:public MenuComponent{
protected: protected:
@ -76,17 +77,10 @@ public:
} }
inline void DrawDecal(ViewPort&window,bool focused)override{ inline void DrawDecal(ViewPort&window,bool focused)override{
geom2d::line<float>checkmarkLine1=geom2d::line<float>({rect.left().start.x+rect.size.x*0.125f,rect.left().start.y+rect.size.y*0.5f},{rect.top().start.x+rect.size.x*0.375f,rect.top().start.y+rect.size.y*0.875f});
geom2d::line<float>checkmarkLine2=geom2d::line<float>(checkmarkLine1.end,{rect.left().start.x+rect.size.x*0.875f,rect.top().start.y+rect.size.y*0.25f});
MenuComponent::DrawDecal(window,focused); MenuComponent::DrawDecal(window,focused);
if(checked){ if(checked){
for(int y=-1;y<=1;y++){ window.DrawDecal(rect.pos,GFX["checkmark.png"].Decal());
for(int x=-1;x<=1;x++){
window.DrawLineDecal(vf2d{float(x),float(y)}/game->GetScreenPixelSize()+checkmarkLine1.start,vf2d{float(x),float(y)}/game->GetScreenPixelSize()+checkmarkLine1.end);
window.DrawLineDecal(vf2d{float(x),float(y)}/game->GetScreenPixelSize()+checkmarkLine2.start,vf2d{float(x),float(y)}/game->GetScreenPixelSize()+checkmarkLine2.end);
}
}
} }
} }
}; };

@ -52,6 +52,7 @@ bool GameSettings::rumble=true;
bool GameSettings::terrainCollisionBoxes=true; bool GameSettings::terrainCollisionBoxes=true;
bool GameSettings::keyboardAutoAim=false; bool GameSettings::keyboardAutoAim=false;
bool GameSettings::vsync=true; bool GameSettings::vsync=true;
bool GameSettings::autopause=true;
const bool GameSettings::OVERRIDE=true; const bool GameSettings::OVERRIDE=true;
vi2d GameSettings::windowPos{30,30}; vi2d GameSettings::windowPos{30,30};
IconType GameSettings::iconType=IconType::XB; IconType GameSettings::iconType=IconType::XB;
@ -83,6 +84,9 @@ const IconType GameSettings::GetIconType(){
const bool GameSettings::VSyncEnabled(){ const bool GameSettings::VSyncEnabled(){
return vsync; return vsync;
} }
const bool GameSettings::AutoPauseEnabled(){
return autopause;
}
void GameSettings::SetMaxHealthDisplay(bool maxHealthDisplayed){ void GameSettings::SetMaxHealthDisplay(bool maxHealthDisplayed){
showMaxHealth=maxHealthDisplayed; showMaxHealth=maxHealthDisplayed;
@ -152,6 +156,10 @@ void GameSettings::Initialize(){
Component<Checkbox>(SETTINGS,"VSync Checkbox")->SetChecked(loadSystemFile["VSync"].GetBool()); Component<Checkbox>(SETTINGS,"VSync Checkbox")->SetChecked(loadSystemFile["VSync"].GetBool());
game->SetVSync(GameSettings::VSyncEnabled()); game->SetVSync(GameSettings::VSyncEnabled());
} }
if(loadSystemFile.HasProperty("Auto Pause")){
GameSettings::SetAutoPause(loadSystemFile["Auto Pause"].GetBool());
Component<Checkbox>(SETTINGS,"Auto Pause Checkbox")->SetChecked(loadSystemFile["Auto Pause"].GetBool());
}
if(loadSystemFile.HasProperty("Controller Icons")){ if(loadSystemFile.HasProperty("Controller Icons")){
const int maxIterations=10; const int maxIterations=10;
int iterationCount=0; int iterationCount=0;
@ -192,4 +200,8 @@ void GameSettings::Initialize(){
} }
} }
#pragma endregion #pragma endregion
}
void GameSettings::SetAutoPause(const bool autoPauseEnabled){
autopause=autoPauseEnabled;
} }

@ -48,6 +48,7 @@ class GameSettings{
static bool terrainCollisionBoxes; static bool terrainCollisionBoxes;
static bool keyboardAutoAim; static bool keyboardAutoAim;
static bool vsync; static bool vsync;
static bool autopause;
static vi2d windowPos; static vi2d windowPos;
static IconType iconType; static IconType iconType;
public: public:
@ -60,6 +61,7 @@ public:
static const bool TerrainCollisionBoxesEnabled(); static const bool TerrainCollisionBoxesEnabled();
static const bool KeyboardAutoAimEnabled(); static const bool KeyboardAutoAimEnabled();
static const bool VSyncEnabled(); static const bool VSyncEnabled();
static const bool AutoPauseEnabled();
static const vi2d GetWindowPos(); static const vi2d GetWindowPos();
static const IconType GetIconType(); static const IconType GetIconType();
static void SetMaxHealthDisplay(bool maxHealthDisplayed); static void SetMaxHealthDisplay(bool maxHealthDisplayed);
@ -71,5 +73,6 @@ public:
static void SetWindowPos(vi2d windowPos); static void SetWindowPos(vi2d windowPos);
static void SetIconType(IconType type); static void SetIconType(IconType type);
static void SetVSync(const bool vSyncEnabled); static void SetVSync(const bool vSyncEnabled);
static void SetAutoPause(const bool autoPauseEnabled);
static void Initialize(); static void Initialize();
}; };

@ -239,15 +239,21 @@ void Menu::InitializeKeyboardInputWindow(){
}}, }},
{"Input_3_1 Gameplay Input Displayer",{ {"Input_3_1 Gameplay Input Displayer",{
.up="Input_2_1 Gameplay Input Displayer", .up="Input_2_1 Gameplay Input Displayer",
.down="Confirm Button", .down="Input_4_1 Gameplay Input Displayer",
.left="Input_3_0 Gameplay Input Displayer", .left="Input_3_0 Gameplay Input Displayer",
.right="Input_3_0 Gameplay Input Displayer", .right="Input_3_0 Gameplay Input Displayer",
}}, }},
{"Input_4_0 Gameplay Input Displayer",{ {"Input_4_0 Gameplay Input Displayer",{
.up="Input_3_0 Gameplay Input Displayer", .up="Input_3_0 Gameplay Input Displayer",
.down="Confirm Button", .down="Confirm Button",
.left="Input_3_1 Gameplay Input Displayer", .left="Input_4_1 Gameplay Input Displayer",
.right="Input_3_1 Gameplay Input Displayer", .right="Input_4_1 Gameplay Input Displayer",
}},
{"Input_4_1 Gameplay Input Displayer",{
.up="Input_3_1 Gameplay Input Displayer",
.down="Confirm Button",
.left="Input_4_0 Gameplay Input Displayer",
.right="Input_4_0 Gameplay Input Displayer",
}}, }},
{"Confirm Button",{ {"Confirm Button",{
.up="Input_4_0 Gameplay Input Displayer", .up="Input_4_0 Gameplay Input Displayer",

@ -171,6 +171,7 @@ void Input::Initialize(){
enumToActionName[i][Steam::LOCK_UNLOCK_ACC]={"Lock/Unlock_Accessory",{}}; enumToActionName[i][Steam::LOCK_UNLOCK_ACC]={"Lock/Unlock_Accessory",{}};
enumToActionName[i][Steam::FAST_SCROLL_UP]={"Fast_Scroll_Up",{}}; enumToActionName[i][Steam::FAST_SCROLL_UP]={"Fast_Scroll_Up",{}};
enumToActionName[i][Steam::FAST_SCROLL_DOWN]={"Fast_Scroll_Down",{}}; enumToActionName[i][Steam::FAST_SCROLL_DOWN]={"Fast_Scroll_Down",{}};
enumToActionName[i][Steam::TOGGLE_MAP]={"Toggle_Map",{}};
} }
} }

@ -92,6 +92,7 @@ namespace Steam{
LOCK_UNLOCK_ACC, LOCK_UNLOCK_ACC,
FAST_SCROLL_UP, FAST_SCROLL_UP,
FAST_SCROLL_DOWN, FAST_SCROLL_DOWN,
TOGGLE_MAP,
}; };
}; };

@ -101,14 +101,14 @@ void Menu::InitializeLoadGameWindow(){
if(SaveFile::GetSaveFileCount()>0||SaveFile::GetOnlineSaveFileCount()>0){ if(SaveFile::GetSaveFileCount()>0||SaveFile::GetOnlineSaveFileCount()>0){
if(SaveFile::IsOnline()){ if(SaveFile::IsOnline()){
if(Component<ScrollableWindowComponent>(type,"Online Game Files List")->GetComponents().size()>0){ if(Component<ScrollableWindowComponent>(type,"Online Game Files List")->GetComponents().size()>0){
Menu::menus[type]->SetSelection(Component<ScrollableWindowComponent>(type,"Online Game Files List")->GetComponents()[0],true); Menu::menus[type]->SetSelection(Component<ScrollableWindowComponent>(type,"Online Game Files List")->GetComponents()[0],true,true);
returnData=Menu::menus[type]->GetSelection(); returnData=Menu::menus[type]->GetSelection();
}else{ }else{
returnData="Go Back Button"; returnData="Go Back Button";
} }
}else{ }else{
if(Component<ScrollableWindowComponent>(type,"Game Files List")->GetComponents().size()>0){ if(Component<ScrollableWindowComponent>(type,"Game Files List")->GetComponents().size()>0){
Menu::menus[type]->SetSelection(Component<ScrollableWindowComponent>(type,"Game Files List")->GetComponents()[0],true); Menu::menus[type]->SetSelection(Component<ScrollableWindowComponent>(type,"Game Files List")->GetComponents()[0],true,true);
returnData=Menu::menus[type]->GetSelection(); returnData=Menu::menus[type]->GetSelection();
}else{ }else{
returnData="Go Back Button"; returnData="Go Back Button";

@ -322,7 +322,7 @@ void Menu::OpenMenu(MenuType menu,bool cover){
Data returnData; Data returnData;
menus[menu]->onOpenFunc(menu,returnData); menus[menu]->onOpenFunc(menu,returnData);
menus[menu]->defaultButton=returnData; menus[menu]->defaultButton=returnData;
if(std::holds_alternative<ButtonName>(returnData)&&std::get<ButtonName>(returnData).length()>0||std::holds_alternative<std::weak_ptr<MenuComponent>>(returnData))menus[menu]->SetSelection(returnData,true); if(std::holds_alternative<ButtonName>(returnData)&&std::get<ButtonName>(returnData).length()>0||std::holds_alternative<std::weak_ptr<MenuComponent>>(returnData))menus[menu]->SetSelection(returnData,false);
} }
stack.push_back(menus[menu]); stack.push_back(menus[menu]);
Audio::UpdateBGMVolume(); //If we open the pause menu, it forces the bgm volume to be halved. So we notify the engine that this is happening. Audio::UpdateBGMVolume(); //If we open the pause menu, it forces the bgm volume to be halved. So we notify the engine that this is happening.
@ -761,17 +761,11 @@ void Menu::SetSelection(std::string_view button,const bool scroll,const bool res
keyboardSelection=selection; keyboardSelection=selection;
} }
if(!selection.lock()->parentComponent.expired()&&reset){
auto scrollWindow=selection.lock()->parentComponent.lock();
scrollWindow->targetScrollOffset.y=0.f;
scrollWindow->scrollOffset.y=0.f;
scrollWindow->selectionIndex=0.f;
}
if(scroll&&!UsingMouseNavigation()&&!selection.lock()->parentComponent.expired()){ if(scroll&&!UsingMouseNavigation()&&!selection.lock()->parentComponent.expired()){
auto scrollWindow=selection.lock()->parentComponent.lock(); auto scrollWindow=selection.lock()->parentComponent.lock();
scrollWindow->HandleOutsideDisabledButtonSelection(Menu::menus[selection.lock()->parentMenu]->components[selection.lock()->GetName()]); scrollWindow->HandleOutsideDisabledButtonSelection(Menu::menus[selection.lock()->parentMenu]->components[selection.lock()->GetName()]);
scrollWindow->selectionIndex=scrollWindow->GetComponentIndex(selection); scrollWindow->selectionIndex=scrollWindow->GetComponentIndex(selection);
scrollWindow->SetScrollAmount(scrollWindow->GetScrollAmount()-scrollWindow->GetComponents()[scrollWindow->selectionIndex].lock()->GetPos());
} }
} }

@ -53,17 +53,27 @@ void Minimap::Initialize(){
} }
mapCircleHud=ViewPort{enlargedCircle,vi2d{game->ScreenWidth()-"Minimap.Minimap HUD Size"_I-4,4}}; mapCircleHud=ViewPort{enlargedCircle,vi2d{game->ScreenWidth()-"Minimap.Minimap HUD Size"_I-4,4}};
enlargedCircle.clear();
for(int i=360;i>=0;i-=4){
float angle=util::degToRad(float(i))-PI/2;
if(i==360){enlargedCircle.push_back(vf2d{cos(angle),sin(angle)}*game->ScreenWidth()/3+game->ScreenWidth()/3);}
enlargedCircle.push_back(vf2d{cos(angle),sin(angle)}*game->ScreenWidth()/3+game->ScreenWidth()/3);
}
mapCircleLargeHud=ViewPort{enlargedCircle,vi2d{game->ScreenWidth()/2-game->ScreenWidth()/3,game->ScreenHeight()/2-game->ScreenWidth()/3}};
} }
void Minimap::Reset(){ void Minimap::Reset(){
if(minimap.Sprite()==nullptr)minimap.Create(1,1); if(minimap.Sprite()==nullptr)minimap.Create(1,1);
if(cover.Sprite()==nullptr)cover.Create(1,1); if(cover.Sprite()==nullptr)cover.Create(1,1);
if(coverOutline.Sprite()==nullptr)coverOutline.Create(1,1);
Sprite baseMinimap; Sprite baseMinimap;
#pragma region Cleanup minimap and cover images #pragma region Cleanup minimap and cover images
minimap.Sprite()->Resize(game->GetCurrentMapData().width,game->GetCurrentMapData().height); minimap.Sprite()->Resize(game->GetCurrentMapData().width,game->GetCurrentMapData().height);
cover.Sprite()->Resize(game->GetCurrentMapData().width,game->GetCurrentMapData().height); cover.Sprite()->Resize(game->GetCurrentMapData().width,game->GetCurrentMapData().height);
coverOutline.Sprite()->Resize(game->GetCurrentMapData().width,game->GetCurrentMapData().height);
baseMinimap.Resize(game->GetCurrentMapData().width,game->GetCurrentMapData().height); baseMinimap.Resize(game->GetCurrentMapData().width,game->GetCurrentMapData().height);
game->SetDrawTarget(minimap.Sprite()); game->SetDrawTarget(minimap.Sprite());
game->SetPixelMode(Pixel::ALPHA); game->SetPixelMode(Pixel::ALPHA);
@ -72,6 +82,8 @@ void Minimap::Reset(){
game->Clear(BLANK); game->Clear(BLANK);
game->SetDrawTarget(cover.Sprite()); game->SetDrawTarget(cover.Sprite());
game->Clear(BLANK); game->Clear(BLANK);
game->SetDrawTarget(coverOutline.Sprite());
game->Clear(BLANK);
game->SetPixelMode(Pixel::NORMAL); game->SetPixelMode(Pixel::NORMAL);
//Will update the minimap decal at the end, since we are about to change it anyways. //Will update the minimap decal at the end, since we are about to change it anyways.
cover.Decal()->Update(); cover.Decal()->Update();
@ -124,6 +136,19 @@ void Minimap::Reset(){
} }
} }
} }
if(game->GetZones().count("EndZone")){
for(const ZoneData&zone:game->GetZones().at("EndZone")){
vf2d ringPos=zone.zone.pos/game->GetCurrentMapData().TileSize;
vf2d ringSize=zone.zone.size/game->GetCurrentMapData().TileSize;
for(int y=0;y<=ringSize.y;y++){
for(int x=0;x<=ringSize.x;x++){
minimap.Sprite()->SetPixel(ringPos+vi2d{x,y},GREEN);
}
}
}
}
game->SetDrawTarget(nullptr); game->SetDrawTarget(nullptr);
minimap.Decal()->Update(); minimap.Decal()->Update();
@ -137,7 +162,11 @@ void Minimap::Reset(){
} }
void Minimap::Update(){ void Minimap::Update(){
if(game->KEY_TOGGLE_MAP.Pressed()){
if(displayMode==MinimapMode::SMALL)displayMode=MinimapMode::LARGE;
else if(displayMode==MinimapMode::LARGE)displayMode=MinimapMode::OFF;
else if(displayMode==MinimapMode::OFF)displayMode=MinimapMode::SMALL;
}
} }
void Minimap::UpdateChunk(const MapName map,const vi2d chunkPos){ void Minimap::UpdateChunk(const MapName map,const vi2d chunkPos){
@ -153,11 +182,15 @@ void Minimap::UpdateChunk(const MapName map,const vi2d chunkPos){
//We start twice the distance we are supposed to outwards. //We start twice the distance we are supposed to outwards.
for(int y=pixelPos.y;y<chunkEndPixelPos.y;y++){ for(int y=pixelPos.y;y<chunkEndPixelPos.y;y++){
for(int x=pixelPos.x;x<chunkEndPixelPos.x;x++){ for(int x=pixelPos.x;x<chunkEndPixelPos.x;x++){
if(cover.Sprite()->GetPixel(x,y).a==255||minimap.Sprite()->GetPixel(x,y).a==0)continue; //Already revealed or invisible anyways. Pixel sourceCol=minimap.Sprite()->GetPixel(x,y);
bool sourceWasBlack=sourceCol==BLACK;
if(cover.Sprite()->GetPixel(x,y).a==255||sourceCol.a==0)continue; //Already revealed or invisible anyways.
vi2d chunk=vi2d{x,y}/"Minimap.Chunk Size"_I; vi2d chunk=vi2d{x,y}/"Minimap.Chunk Size"_I;
if(chunk==chunkPos){ if(chunk==chunkPos){
cover.Sprite()->SetPixel(x,y,minimap.Sprite()->GetPixel(x,y)); cover.Sprite()->SetPixel(x,y,sourceCol);
if(sourceWasBlack)coverOutline.Sprite()->SetPixel(x,y,sourceCol);
}else{ }else{
const vi2d chunkOffset={"Minimap.Chunk Size"_I/2,"Minimap.Chunk Size"_I/2}; const vi2d chunkOffset={"Minimap.Chunk Size"_I/2,"Minimap.Chunk Size"_I/2};
@ -166,21 +199,32 @@ void Minimap::UpdateChunk(const MapName map,const vi2d chunkPos){
if(cover.Sprite()->GetPixel(x,y).a>alpha)continue; //The distance was uncovered by another closer chunk, don't need to reveal it here. if(cover.Sprite()->GetPixel(x,y).a>alpha)continue; //The distance was uncovered by another closer chunk, don't need to reveal it here.
Pixel sourceCol=minimap.Sprite()->GetPixel(x,y);
sourceCol.a=alpha; sourceCol.a=alpha;
cover.Sprite()->SetPixel(x,y,sourceCol); cover.Sprite()->SetPixel(x,y,sourceCol);
if(sourceWasBlack)coverOutline.Sprite()->SetPixel(x,y,sourceCol);
} }
} }
} }
cover.Decal()->Update(); cover.Decal()->Update();
coverOutline.Decal()->Update();
} }
void Minimap::Draw(){ void Minimap::Draw(){
const vf2d minimapPos=vf2d{float("Minimap.Minimap HUD Size"_I),float("Minimap.Minimap HUD Size"_I)}/2; const vf2d minimapPos=vf2d{float("Minimap.Minimap HUD Size"_I),float("Minimap.Minimap HUD Size"_I)}/2;
if(!game->InBossEncounter())mapCircleHud.DrawRotatedDecal(minimapPos,cover.Decal(),0.f,game->GetPlayer()->GetPos()/game->GetCurrentMapData().tilewidth,vf2d{0.5f,0.5f}); if(!game->InBossEncounter()){
game->DrawRotatedDecal(mapCircleHud.GetOffset()+minimapPos,GFX["skill_overlay_icon.png"].Decal(),0.f,GFX["skill_overlay_icon.png"].Sprite()->Size()/2,vf2d{float("Minimap.Minimap HUD Size"_I),float("Minimap.Minimap HUD Size"_I)}/24.f*1.05f); switch(displayMode){
game->DrawRotatedDecal(mapCircleHud.GetOffset()+minimapPos,game->GetPlayer()->GetMinimapImage().Decal(),0.f,vi2d{"Player.Minimap Image Size"_i[0],"Player.Minimap Image Size"_i[1]}/2,{0.5f,0.5f}); case MinimapMode::SMALL:{
mapCircleHud.DrawRotatedDecal(minimapPos,cover.Decal(),0.f,game->camera.GetPosition()/game->GetCurrentMapData().tilewidth,vf2d{0.5f,0.5f});
game->DrawRotatedDecal(mapCircleHud.GetOffset()+minimapPos,GFX["skill_overlay_icon.png"].Decal(),0.f,GFX["skill_overlay_icon.png"].Sprite()->Size()/2,vf2d{float("Minimap.Minimap HUD Size"_I),float("Minimap.Minimap HUD Size"_I)}/24.f*1.05f);
game->DrawRotatedDecal(mapCircleHud.GetOffset()+minimapPos,game->GetPlayer()->GetMinimapImage().Decal(),0.f,vi2d{"Player.Minimap Image Size"_i[0],"Player.Minimap Image Size"_i[1]}/2,{0.5f,0.5f});
}break;
case MinimapMode::LARGE:{
mapCircleLargeHud.DrawRotatedDecal(vf2d{game->ScreenWidth()/3.f,game->ScreenWidth()/3.f},coverOutline.Decal(),0.f,game->camera.GetPosition()/game->GetCurrentMapData().tilewidth,vf2d{2.f,2.f},{255,255,255,48});
}break;
case MinimapMode::OFF:{}break;
}
}
} }
void Minimap::EraseChunkData(){ void Minimap::EraseChunkData(){
@ -189,4 +233,12 @@ void Minimap::EraseChunkData(){
const std::unordered_map<MapName,std::unordered_set<std::string>>&Minimap::GetChunkData(){ const std::unordered_map<MapName,std::unordered_set<std::string>>&Minimap::GetChunkData(){
return loadedChunks; return loadedChunks;
}
const MinimapMode&Minimap::GetMinimapMode()const{
return displayMode;
}
void Minimap::SetMinimapMode(MinimapMode newMode){
displayMode=newMode;
} }

@ -39,6 +39,12 @@ All rights reserved.
#include "olcPGEX_ViewPort.h" #include "olcPGEX_ViewPort.h"
enum class MinimapMode{
SMALL,
LARGE,
OFF,
};
class Minimap{ class Minimap{
public: public:
void Initialize(); void Initialize();
@ -50,9 +56,15 @@ public:
void EraseChunkData(); void EraseChunkData();
const std::unordered_map<MapName,std::unordered_set<std::string>>&GetChunkData(); const std::unordered_map<MapName,std::unordered_set<std::string>>&GetChunkData();
const MinimapMode&GetMinimapMode()const;
void SetMinimapMode(MinimapMode newMode);
private: private:
ViewPort mapCircleHud; ViewPort mapCircleHud;
ViewPort mapCircleLargeHud;
Renderable minimap; Renderable minimap;
Renderable cover; Renderable cover;
Renderable coverOutline;
std::unordered_map<MapName,std::unordered_set<std::string>>loadedChunks; std::unordered_map<MapName,std::unordered_set<std::string>>loadedChunks;
MinimapMode displayMode=MinimapMode::SMALL;
}; };

@ -802,6 +802,10 @@ bool Player::Hurt(int damage,bool onUpperLevel,float z){
if(game->GetPlayer()->GetHealth()<game->GetPlayer()->GetMaxHealth()*0.5f&&!Tutorial::TaskIsComplete(TutorialTaskName::USE_RECOVERY_ITEMS)){ if(game->GetPlayer()->GetHealth()<game->GetPlayer()->GetMaxHealth()*0.5f&&!Tutorial::TaskIsComplete(TutorialTaskName::USE_RECOVERY_ITEMS)){
Tutorial::SetNextTask(TutorialTaskName::USE_RECOVERY_ITEMS); Tutorial::SetNextTask(TutorialTaskName::USE_RECOVERY_ITEMS);
} }
if(GameSettings::AutoPauseEnabled()&&!Menu::IsMenuOpen()&&GameState::STATE==GameState::states[States::GAME_RUN]&&!game->IsFocused()){
Menu::OpenMenu(MenuType::PAUSE);
}
return true; return true;
} }

@ -136,6 +136,7 @@ const void SaveFile::SaveGame(){
saveFile["Save Name"].SetString(std::string(GetSaveFileName())); saveFile["Save Name"].SetString(std::string(GetSaveFileName()));
saveFile["Game Time"].SetReal(game->GetRuntime()); saveFile["Game Time"].SetReal(game->GetRuntime());
saveFile["TravelingMerchant"].SetString(std::string(Merchant::GetCurrentTravelingMerchant().GetKeyName())); saveFile["TravelingMerchant"].SetString(std::string(Merchant::GetCurrentTravelingMerchant().GetKeyName()));
saveFile["Minimap Display Mode"].SetInt(int(game->minimap.GetMinimapMode()));
#pragma region Save Keyboard/Controller mappings #pragma region Save Keyboard/Controller mappings
//NOTE: We are shadowing code from InputKeyboardWindow! If at some point the retrival method for getting input displays changes, we likely will be changing the code here as well! //NOTE: We are shadowing code from InputKeyboardWindow! If at some point the retrival method for getting input displays changes, we likely will be changing the code here as well!
@ -173,6 +174,7 @@ const void SaveFile::SaveGame(){
saveSystemFile["Keyboard Auto-Aim"].SetBool(GameSettings::KeyboardAutoAimEnabled()); saveSystemFile["Keyboard Auto-Aim"].SetBool(GameSettings::KeyboardAutoAimEnabled());
saveSystemFile["Controller Icons"].SetInt(int(GameSettings::GetIconType())); saveSystemFile["Controller Icons"].SetInt(int(GameSettings::GetIconType()));
saveSystemFile["VSync"].SetBool(GameSettings::VSyncEnabled()); saveSystemFile["VSync"].SetBool(GameSettings::VSyncEnabled());
saveSystemFile["Auto Pause"].SetBool(GameSettings::AutoPauseEnabled());
saveSystemFile["Window Pos"].SetInt(game->GetActualWindowPos().x,0); saveSystemFile["Window Pos"].SetInt(game->GetActualWindowPos().x,0);
saveSystemFile["Window Pos"].SetInt(game->GetActualWindowPos().y,1); saveSystemFile["Window Pos"].SetInt(game->GetActualWindowPos().y,1);
@ -403,6 +405,10 @@ void SaveFile::LoadFile(){
} }
} }
if(loadFile.HasProperty("Minimap Display Mode")){
game->minimap.SetMinimapMode(MinimapMode(loadFile["Minimap Display Mode"].GetInt()));
}
#pragma region Load Keyboard/Controller mappings #pragma region Load Keyboard/Controller mappings
//NOTE: We are shadowing code from InputKeyboardWindow! If at some point the retrival method for getting input displays changes, we likely will be changing the code here as well! //NOTE: We are shadowing code from InputKeyboardWindow! If at some point the retrival method for getting input displays changes, we likely will be changing the code here as well!
const int ingameControlsRowCount=DATA.GetProperty("Inputs.Gameplay Input Names").GetValueCount()%2==0?DATA.GetProperty("Inputs.Gameplay Input Names").GetValueCount()/2:DATA.GetProperty("Inputs.Gameplay Input Names").GetValueCount()/2+1; const int ingameControlsRowCount=DATA.GetProperty("Inputs.Gameplay Input Names").GetValueCount()%2==0?DATA.GetProperty("Inputs.Gameplay Input Names").GetValueCount()/2:DATA.GetProperty("Inputs.Gameplay Input Names").GetValueCount()/2+1;

@ -90,6 +90,10 @@ public:
LOG("WARNING! Attempted to remove subbuttons from button listing, but not found!"); LOG("WARNING! Attempted to remove subbuttons from button listing, but not found!");
} }
} }
targetScrollOffset.y=std::min(targetScrollOffset.y,bounds.bottom().end.y);
scrollOffset.y=std::min(scrollOffset.y,bounds.bottom().end.y);
selectionIndex=std::min(size_t(selectionIndex),components.size()-1);
} }
virtual inline void RemoveButton(std::weak_ptr<MenuComponent>button){ virtual inline void RemoveButton(std::weak_ptr<MenuComponent>button){
auto componentSearchResults=std::find_if(components.begin(),components.end(),[&](std::weak_ptr<MenuComponent>ptr){return &*ptr.lock()==&*button.lock();}); auto componentSearchResults=std::find_if(components.begin(),components.end(),[&](std::weak_ptr<MenuComponent>ptr){return &*ptr.lock()==&*button.lock();});

@ -141,6 +141,12 @@ void Menu::InitializeSettingsWindow(){
return true; return true;
},GameSettings::VSyncEnabled())END; },GameSettings::VSyncEnabled())END;
auto vsyncToggleLabel=settingsList->ADD("VSync Toggle Label",MenuLabel)(geom2d::rect<float>{{22.f,100},{windowSize.x/2-36.f,16.f}},"VSync",1.f,ComponentAttr::SHADOW|ComponentAttr::LEFT_ALIGN)END; auto vsyncToggleLabel=settingsList->ADD("VSync Toggle Label",MenuLabel)(geom2d::rect<float>{{22.f,100},{windowSize.x/2-36.f,16.f}},"VSync",1.f,ComponentAttr::SHADOW|ComponentAttr::LEFT_ALIGN)END;
auto autoPauseToggle=settingsList->ADD("Auto Pause Checkbox",Checkbox)(geom2d::rect<float>{{4.f,120},{16.f,16.f}},[](ToggleFuncData data){
GameSettings::SetAutoPause(data.checked);
return true;
},GameSettings::AutoPauseEnabled())END;
auto autoPauseToggleLabel=settingsList->ADD("Auto Pause Toggle Label",MenuLabel)(geom2d::rect<float>{{22.f,120},{windowSize.x/2-36.f,16.f}},"Pause if Hit When\nWindow Unfocused",1.f,ComponentAttr::SHADOW|ComponentAttr::LEFT_ALIGN)END;
settingsList->ADD("Terrain Collision Boxes Checkbox",Checkbox)(geom2d::rect<float>{{windowSize.x/2+4.f,60},{16.f,16.f}},[](ToggleFuncData data){ settingsList->ADD("Terrain Collision Boxes Checkbox",Checkbox)(geom2d::rect<float>{{windowSize.x/2+4.f,60},{16.f,16.f}},[](ToggleFuncData data){
GameSettings::SetTerrainCollisionBoxes(data.checked); GameSettings::SetTerrainCollisionBoxes(data.checked);
@ -169,7 +175,7 @@ void Menu::InitializeSettingsWindow(){
fullscreenToggleLabel->Disable(); fullscreenToggleLabel->Disable();
#endif #endif
settingsList->ADD("Button Set Toggle Box",MenuIconButton)(geom2d::rect<float>{{windowSize.x/2.f-windowSize.x/8.f-6.f,120.f},{windowSize.x/4.f,16.f}},GFX["themes/xb.png"].Decal(),[](MenuFuncData data){ settingsList->ADD("Button Set Toggle Box",MenuIconButton)(geom2d::rect<float>{{windowSize.x/2.f-windowSize.x/8.f-6.f,140.f},{windowSize.x/4.f,16.f}},GFX["themes/xb.png"].Decal(),[](MenuFuncData data){
switch(GameSettings::GetIconType()){ switch(GameSettings::GetIconType()){
case IconType::XB:{ case IconType::XB:{
GameSettings::SetIconType(IconType::PS); GameSettings::SetIconType(IconType::PS);
@ -215,13 +221,13 @@ void Menu::InitializeSettingsWindow(){
}; };
#pragma endregion #pragma endregion
settingsList->ADD("Keyboard Bindings Button",MenuComponent)(geom2d::rect<float>{{28,140.f},vf2d{settingsList->rect.size.x-12-56,24}},"Keyboard Bindings",[&](MenuFuncData data){ settingsList->ADD("Keyboard Bindings Button",MenuComponent)(geom2d::rect<float>{{28,160.f},vf2d{settingsList->rect.size.x-12-56,24}},"Keyboard Bindings",[&](MenuFuncData data){
ChangeKeybindDisplayType(KEY); ChangeKeybindDisplayType(KEY);
Component<MenuLabel>(INPUT_KEY_DISPLAY,"Keyboard Mapping Label")->SetLabel("Keyboard Mappings"); Component<MenuLabel>(INPUT_KEY_DISPLAY,"Keyboard Mapping Label")->SetLabel("Keyboard Mappings");
Menu::OpenMenu(INPUT_KEY_DISPLAY); Menu::OpenMenu(INPUT_KEY_DISPLAY);
return true; return true;
},vf2d{1.5f,2.f})END; },vf2d{1.5f,2.f})END;
settingsList->ADD("Controller Bindings Button",MenuComponent)(geom2d::rect<float>{{28,168.f},vf2d{settingsList->rect.size.x-12-56,24}},"Controller Bindings",[&](MenuFuncData data){ settingsList->ADD("Controller Bindings Button",MenuComponent)(geom2d::rect<float>{{28,188.f},vf2d{settingsList->rect.size.x-12-56,24}},"Controller Bindings",[&](MenuFuncData data){
ChangeKeybindDisplayType(CONTROLLER); ChangeKeybindDisplayType(CONTROLLER);
Component<MenuLabel>(INPUT_KEY_DISPLAY,"Keyboard Mapping Label")->SetLabel("Controller Mappings"); Component<MenuLabel>(INPUT_KEY_DISPLAY,"Keyboard Mapping Label")->SetLabel("Controller Mappings");
STEAMINPUT( STEAMINPUT(
@ -287,20 +293,19 @@ void Menu::InitializeSettingsWindow(){
.right="Keyboard Play Auto-Aim Checkbox",}}, .right="Keyboard Play Auto-Aim Checkbox",}},
{"VSync Checkbox",{ {"VSync Checkbox",{
.up="Controller Rumble Checkbox", .up="Controller Rumble Checkbox",
.down="Button Set Toggle Box", .down="Auto Pause Checkbox",
.left="Fullscreen Toggle Checkbox", .left="Fullscreen Toggle Checkbox",
.right="Fullscreen Toggle Checkbox",}}, .right="Fullscreen Toggle Checkbox",}},
{"Auto Pause Checkbox",{
.up="VSync Checkbox",
.down="Button Set Toggle Box",}},
{"Fullscreen Toggle Checkbox",{ {"Fullscreen Toggle Checkbox",{
.up="Keyboard Play Auto-Aim Checkbox", .up="Keyboard Play Auto-Aim Checkbox",
.down="Button Set Toggle Box", .down="Auto Pause Checkbox",
.left="VSync Checkbox", .left="VSync Checkbox",
.right="VSync Checkbox",}}, .right="VSync Checkbox",}},
{"Button Set Toggle Box",{ {"Button Set Toggle Box",{
#ifdef __EMSCRIPTEN__ .up="Auto Pause Checkbox",
.up="VSync Checkbox",
#else
.up="Fullscreen Toggle Checkbox",
#endif
.down="Keyboard Bindings Button",}}, .down="Keyboard Bindings Button",}},
{"Keyboard Bindings Button",{ {"Keyboard Bindings Button",{
.up="Button Set Toggle Box", .up="Button Set Toggle Box",

@ -11,25 +11,6 @@ Upon completion of a stage in time trial mode if the player beat their previous
For each class and stage combination there will be a "dev time" For each class and stage combination there will be a "dev time"
Settings menu doesn't scroll back up properly while the scrollbar does? Settings menu doesn't scroll back up properly while the scrollbar does?
Merchant descriptions have no newlines.
Amount to sell shows total of that accessory you have instead of 1/1.
Bosses can get stuck outside the arena?
Traveling merchants of different colors/looks. Traveling merchants of different colors/looks.
Steel Weapons appear in the demo for Chapter 2. Steel Weapons appear in the demo for Chapter 2.
Update display counters on the overworld map. Look into removing OVERRIDE from rumble settings. It looks like it was used to purposefully disable rumble, but looks very unnecessary.
Pressing movement keys that negate each other shouldn't cause a walking animation to occur.
>As the player navigates around the map, the blank map canvas gets updated based on distance.
>If a chunk has not been explored yet, it gets flagged as explored (probably unlock the chunks around the player as well).
>When a map is visited later, all visited chunks are revealed again.
============================================
Consider a "killed by player" / "marked by player" flag for monsters to determine if a player gets credit for a monster kill (for achievements)
Make another actions config file for the main build (The app # is different)
Review other games and see what the screen does when the player takes damage. Vignette effect
Look at green slime remains count for crafting.
Textured ground tiles

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 1 #define VERSION_MAJOR 1
#define VERSION_MINOR 1 #define VERSION_MINOR 1
#define VERSION_PATCH 0 #define VERSION_PATCH 0
#define VERSION_BUILD 8852 #define VERSION_BUILD 8902
#define stringify(a) stringify_(a) #define stringify(a) stringify_(a)
#define stringify_(a) #a #define stringify_(a) #a

Binary file not shown.

After

Width:  |  Height:  |  Size: 592 B

@ -16,6 +16,9 @@ gfx_config = gfx/gfx.txt
# Save File Server Name # Save File Server Name
save_server = https://projectdivar.com:4505/AiL save_server = https://projectdivar.com:4505/AiL
# Steam API. Set to False to disable using Steam.
steam_api = True
# Map Files Loading Config # Map Files Loading Config
map_config = levels.txt map_config = levels.txt

@ -85,6 +85,7 @@ Images
GFX_SwordSlash = swordslash.png GFX_SwordSlash = swordslash.png
GFX_CustomFont = font.png GFX_CustomFont = font.png
GFX_Vignette = vignette.png GFX_Vignette = vignette.png
GFX_Checkmark = checkmark.png
# Ability Icons # Ability Icons
GFX_Warrior_BattleCry_Icon = Ability Icons/battlecry.png GFX_Warrior_BattleCry_Icon = Ability Icons/battlecry.png

@ -2,7 +2,7 @@ Inputs
{ {
Menu Input Names = Confirm, Back, Function 1, Function 2, Menu, Up, Right, Down, Left Menu Input Names = Confirm, Back, Function 1, Function 2, Menu, Up, Right, Down, Left
Gameplay Input Names = Basic Attack, Defensive, Ability 1, Ability 2, Ability 3, Ability 4, Item 1, Item 2, Item 3 Gameplay Input Names = Basic Attack, Defensive, Ability 1, Ability 2, Ability 3, Ability 4, Item 1, Item 2, Item 3, Toggle Minimap
KEY_CONFIRM = Confirm KEY_CONFIRM = Confirm
@ -24,4 +24,5 @@ Inputs
Player::KEY_ITEM1=Item 1 Player::KEY_ITEM1=Item 1
Player::KEY_ITEM2=Item 2 Player::KEY_ITEM2=Item 2
Player::KEY_ITEM3=Item 3 Player::KEY_ITEM3=Item 3
KEY_TOGGLE_MAP=Toggle Minimap
} }

@ -1,18 +1,18 @@
"controller_mappings" "controller_mappings"
{ {
"version" "3" "version" "3"
"revision" "87" "revision" "88"
"title" "Generic Gamepad" "title" "Generic Gamepad"
"description" "Default Generic Gamepad controls" "description" "Default Generic Gamepad controls"
"creator" "76561198025675819" "creator" "76561198025675819"
"progenitor" "" "progenitor" "game://controller_generic.vdf"
"url" "autosave://C:\\Program Files (x86)\\Steam\\steamapps\\common\\Steam Controller Configs\\65410091\\config\\2895980\\controller_generic.vdf" "url" "game://controller_generic.vdf"
"export_type" "personal_local" "export_type" "personal_local"
"controller_type" "controller_generic" "controller_type" "controller_generic"
"controller_caps" "1573375" "controller_caps" "1573375"
"major_revision" "0" "major_revision" "0"
"minor_revision" "0" "minor_revision" "0"
"Timestamp" "1711752971" "Timestamp" "1713016743"
"actions" "actions"
{ {
"InGameControls" "InGameControls"
@ -61,6 +61,7 @@
} }
"Fast_Scroll_Up" "#ScrollUp" "Fast_Scroll_Up" "#ScrollUp"
"Fast_Scroll_Down" "#ScrollDown" "Fast_Scroll_Down" "#ScrollDown"
"Toggle_Map" "#ToggleMap"
} }
} }
} }
@ -97,6 +98,7 @@
"Scroll" "Scroll Menu/Manual Aim" "Scroll" "Scroll Menu/Manual Aim"
"ScrollUp" "Fast Scroll Menu Up" "ScrollUp" "Fast Scroll Menu Up"
"ScrollDown" "Fast Scroll Menu Down" "ScrollDown" "Fast Scroll Menu Down"
"ToggleMap" "Toggle Minimap"
} }
} }
"group" "group"
@ -531,6 +533,22 @@
"description" "" "description" ""
"inputs" "inputs"
{ {
"click"
{
"activators"
{
"Full_Press"
{
"bindings"
{
"binding" "game_action InGameControls Toggle_Map, #ToggleMap, , "
}
}
}
"disabled_activators"
{
}
}
} }
"settings" "settings"
{ {

@ -1,18 +1,18 @@
"controller_mappings" "controller_mappings"
{ {
"version" "3" "version" "3"
"revision" "85" "revision" "86"
"title" "Switch Pro" "title" "Switch Pro"
"description" "Default Switch Pro configuration." "description" "Default Switch Pro configuration."
"creator" "76561198025675819" "creator" "76561198025675819"
"progenitor" "" "progenitor" "game://controller_switch_pro.vdf"
"url" "autosave://C:\\Program Files (x86)\\Steam\\steamapps\\common\\Steam Controller Configs\\65410091\\config\\2895980\\controller_switch_pro.vdf" "url" "game://controller_switch_pro.vdf"
"export_type" "personal_local" "export_type" "personal_local"
"controller_type" "controller_switch_pro" "controller_type" "controller_switch_pro"
"controller_caps" "613772287" "controller_caps" "613772287"
"major_revision" "0" "major_revision" "0"
"minor_revision" "0" "minor_revision" "0"
"Timestamp" "1711752483" "Timestamp" "1713016698"
"actions" "actions"
{ {
"InGameControls" "InGameControls"
@ -61,6 +61,7 @@
} }
"Fast_Scroll_Up" "#ScrollUp" "Fast_Scroll_Up" "#ScrollUp"
"Fast_Scroll_Down" "#ScrollDown" "Fast_Scroll_Down" "#ScrollDown"
"Toggle_Map" "#ToggleMap"
} }
} }
} }
@ -97,6 +98,7 @@
"Scroll" "Scroll Menu/Manual Aim" "Scroll" "Scroll Menu/Manual Aim"
"ScrollUp" "Fast Scroll Menu Up" "ScrollUp" "Fast Scroll Menu Up"
"ScrollDown" "Fast Scroll Menu Down" "ScrollDown" "Fast Scroll Menu Down"
"ToggleMap" "Toggle Minimap"
} }
} }
"group" "group"
@ -531,6 +533,22 @@
"description" "" "description" ""
"inputs" "inputs"
{ {
"click"
{
"activators"
{
"Full_Press"
{
"bindings"
{
"binding" "game_action InGameControls Toggle_Map, #ToggleMap, , "
}
}
}
"disabled_activators"
{
}
}
} }
"settings" "settings"
{ {

@ -1,18 +1,18 @@
"controller_mappings" "controller_mappings"
{ {
"version" "3" "version" "3"
"revision" "78" "revision" "79"
"title" "Xbox/Playstation" "title" "Xbox/Playstation"
"description" "Default Xbox/Playstation controls" "description" "Default Xbox/Playstation controls"
"creator" "76561198025675819" "creator" "-1"
"progenitor" "" "progenitor" "game://controller_xboxone.vdf"
"url" "autosave://C:\\Program Files (x86)\\Steam\\steamapps\\common\\Steam Controller Configs\\65410091\\config\\2895980\\controller_xbox360.vdf" "url" "game://controller_xboxone.vdf"
"export_type" "personal_local" "export_type" "personal_local"
"controller_type" "controller_xbox360" "controller_type" "controller_xbox360"
"controller_caps" "1590271" "controller_caps" "1590271"
"major_revision" "0" "major_revision" "0"
"minor_revision" "0" "minor_revision" "0"
"Timestamp" "1711752757" "Timestamp" "1713016732"
"actions" "actions"
{ {
"InGameControls" "InGameControls"
@ -61,6 +61,7 @@
} }
"Fast_Scroll_Up" "#ScrollUp" "Fast_Scroll_Up" "#ScrollUp"
"Fast_Scroll_Down" "#ScrollDown" "Fast_Scroll_Down" "#ScrollDown"
"Toggle_Map" "#ToggleMap"
} }
} }
} }
@ -97,6 +98,7 @@
"Scroll" "Scroll Menu/Manual Aim" "Scroll" "Scroll Menu/Manual Aim"
"ScrollUp" "Fast Scroll Menu Up" "ScrollUp" "Fast Scroll Menu Up"
"ScrollDown" "Fast Scroll Menu Down" "ScrollDown" "Fast Scroll Menu Down"
"ToggleMap" "Toggle Minimap"
} }
} }
"group" "group"
@ -531,6 +533,22 @@
"description" "" "description" ""
"inputs" "inputs"
{ {
"click"
{
"activators"
{
"Full_Press"
{
"bindings"
{
"binding" "game_action InGameControls Toggle_Map, #ToggleMap, , "
}
}
}
"disabled_activators"
{
}
}
} }
"settings" "settings"
{ {

@ -44,6 +44,7 @@
"Lock/Unlock_Accessory" "#Select" "Lock/Unlock_Accessory" "#Select"
"Fast_Scroll_Up" "#ScrollUp" "Fast_Scroll_Up" "#ScrollUp"
"Fast_Scroll_Down" "#ScrollDown" "Fast_Scroll_Down" "#ScrollDown"
"Toggle_Map" "#ToggleMap"
} }
} }
} }
@ -77,6 +78,7 @@
"Scroll" "Scroll Menu/Manual Aim" "Scroll" "Scroll Menu/Manual Aim"
"ScrollUp" "Fast Scroll Menu Up" "ScrollUp" "Fast Scroll Menu Up"
"ScrollDown" "Fast Scroll Menu Down" "ScrollDown" "Fast Scroll Menu Down"
"ToggleMap" "Toggle Minimap"
} }
} }
"configurations" "configurations"

@ -1021,6 +1021,7 @@ namespace olc
// Called when a console command is executed // Called when a console command is executed
virtual bool OnConsoleCommand(const std::string& sCommand); virtual bool OnConsoleCommand(const std::string& sCommand);
virtual void OnRequestCompleted(const std::string_view receivedData)const; virtual void OnRequestCompleted(const std::string_view receivedData)const;
virtual void OnWindowLoseFocus()const;
virtual olc::rcode SendRequest(std::string_view url,std::string_view data); virtual olc::rcode SendRequest(std::string_view url,std::string_view data);
@ -4619,6 +4620,7 @@ namespace olc
bool PixelGameEngine::OnConsoleCommand(const std::string& sCommand) { UNUSED(sCommand); return false; } bool PixelGameEngine::OnConsoleCommand(const std::string& sCommand) { UNUSED(sCommand); return false; }
void PixelGameEngine::OnRequestCompleted(const std::string_view receivedData)const{} void PixelGameEngine::OnRequestCompleted(const std::string_view receivedData)const{}
void PixelGameEngine::OnWindowLoseFocus()const{}
olc::rcode PixelGameEngine::SendRequest(std::string_view url,std::string_view data){platform->SendRequest(url,data);return olc::rcode::OK;}; olc::rcode PixelGameEngine::SendRequest(std::string_view url,std::string_view data){platform->SendRequest(url,data);return olc::rcode::OK;};
@ -4698,6 +4700,7 @@ namespace olc
olc_UpdateKeyState(i,false); olc_UpdateKeyState(i,false);
} }
} }
if(!state)OnWindowLoseFocus();
bHasInputFocus = state; bHasInputFocus = state;
} }

Loading…
Cancel
Save