Change checkmark from being two line decals to being a single decal. (Note: There is a bug with ViewPort PGEX's line clipping.) Fix scrolling navigation for menus where the navigation doesn't reset the actual scrolling. Corrects Issue #37. Added exit ring indicator on minimap. Auto Pause game setting added. Auto Pause behavior changed to only pause on taking damage when the window is not focused. Release Build 8901.

mac-build
sigonasr2 8 months ago
parent 3c65db545d
commit eb9114406e
  1. 6
      Adventures in Lestoria/AdventuresInLestoria.cpp
  2. 1
      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. 4
      Adventures in Lestoria/LoadGameWindow.cpp
  7. 10
      Adventures in Lestoria/Menu.cpp
  8. 4
      Adventures in Lestoria/Player.cpp
  9. 1
      Adventures in Lestoria/SaveFile.cpp
  10. 4
      Adventures in Lestoria/ScrollableWindowComponent.h
  11. 25
      Adventures in Lestoria/SettingsWindow.cpp
  12. 21
      Adventures in Lestoria/TODO.txt
  13. 2
      Adventures in Lestoria/Version.h
  14. BIN
      Adventures in Lestoria/assets/checkmark.png
  15. 1
      Adventures in Lestoria/assets/config/gfx/gfx.txt
  16. BIN
      Adventures in Lestoria/assets/gamepack.pak
  17. BIN
      x64/Release/Adventures in Lestoria.exe

@ -4075,9 +4075,3 @@ void AiL::ComputeModeColors(TilesetData&tileset){
} }
} }
} }
void AiL::OnWindowLoseFocus()const{
if(!Menu::IsMenuOpen()&&GameState::STATE==GameState::states[States::GAME_RUN]){
Menu::OpenMenu(MenuType::PAUSE);
}
}

@ -205,7 +205,6 @@ public:
bool OnUserCreate() override; bool OnUserCreate() override;
bool OnUserUpdate(float fElapsedTime) override; bool OnUserUpdate(float fElapsedTime) override;
bool OnUserDestroy() override; bool OnUserDestroy() override;
void OnWindowLoseFocus()const override final;
void GetAnyKeyPress(Key key)override final; void GetAnyKeyPress(Key key)override final;
void GetAnyKeyRelease(Key key)override final; void GetAnyKeyRelease(Key key)override final;
void GetAnyMousePress(int32_t mouseButton)override final; void GetAnyMousePress(int32_t mouseButton)override final;

@ -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;
@ -193,3 +201,7 @@ 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();
}; };

@ -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());
} }
} }

@ -803,6 +803,10 @@ bool Player::Hurt(int damage,bool onUpperLevel,float z){
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;
} }

@ -174,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);

@ -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();});

@ -142,6 +142,12 @@ void Menu::InitializeSettingsWindow(){
},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);
return true; return true;
@ -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 8879 #define VERSION_BUILD 8901
#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

@ -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

Loading…
Cancel
Save