Add in ability to redefine keybinds. Keybinds currently do not translate to actual key controls (?) Replaced all 2023 copyright references with 2024, fix copyright symbols.

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
pull/35/head
Nic0Nic0Nii 10 months ago
parent ef63a07f5c
commit 1f244777c9
  1. 2
      Adventures in Lestoria/Adventures in Lestoria.rc
  2. 18
      Adventures in Lestoria/AdventuresInLestoria.cpp
  3. 2
      Adventures in Lestoria/AttributableStat.cpp
  4. 2
      Adventures in Lestoria/Audio.cpp
  5. 2
      Adventures in Lestoria/Audio.h
  6. 2
      Adventures in Lestoria/BitwiseEnum.h
  7. 2
      Adventures in Lestoria/BuyItemWindow.cpp
  8. 6
      Adventures in Lestoria/CREDITS
  9. 2
      Adventures in Lestoria/Checkbox.h
  10. 2
      Adventures in Lestoria/ConsumableCraftItemWindow.cpp
  11. 2
      Adventures in Lestoria/CraftItemWindow.cpp
  12. 2
      Adventures in Lestoria/CraftingRequirement.cpp
  13. 2
      Adventures in Lestoria/CraftingRequirement.h
  14. 2
      Adventures in Lestoria/DynamicCounter.cpp
  15. 2
      Adventures in Lestoria/DynamicCounter.h
  16. 2
      Adventures in Lestoria/EnhancementStatsLabel.h
  17. 2
      Adventures in Lestoria/EnvironmentalAudio.cpp
  18. 2
      Adventures in Lestoria/EnvironmentalAudio.h
  19. 2
      Adventures in Lestoria/Frog.cpp
  20. 2
      Adventures in Lestoria/FrogTongue.cpp
  21. 2
      Adventures in Lestoria/FunctionPriming.h
  22. 2
      Adventures in Lestoria/GameEvent.cpp
  23. 2
      Adventures in Lestoria/GameEvent.h
  24. 1
      Adventures in Lestoria/GameState.h
  25. 2
      Adventures in Lestoria/IT.cpp
  26. 2
      Adventures in Lestoria/IT.h
  27. 2
      Adventures in Lestoria/InputControllerWindow.cpp
  28. 2
      Adventures in Lestoria/InputHelper.cpp
  29. 2
      Adventures in Lestoria/InputHelper.h
  30. 24
      Adventures in Lestoria/InputKeyboardWindow.cpp
  31. 2
      Adventures in Lestoria/InputNewKeybindWindow.cpp
  32. 2
      Adventures in Lestoria/InventoryCreator.cpp
  33. 2
      Adventures in Lestoria/InventoryCreator.h
  34. 2
      Adventures in Lestoria/ItemMenuLabel.h
  35. 10
      Adventures in Lestoria/Key.cpp
  36. 7
      Adventures in Lestoria/Key.h
  37. 2
      Adventures in Lestoria/LICENSE_OLC-3.txt
  38. 2
      Adventures in Lestoria/LoadFileButton.h
  39. 2
      Adventures in Lestoria/Merchant.cpp
  40. 2
      Adventures in Lestoria/Merchant.h
  41. 2
      Adventures in Lestoria/NPC.cpp
  42. 2
      Adventures in Lestoria/PlayerMoneyLabel.h
  43. 2
      Adventures in Lestoria/RequiredMaterialsList.h
  44. 2
      Adventures in Lestoria/SaveFileNameButton.h
  45. 2
      Adventures in Lestoria/SellItemWindow.cpp
  46. 2
      Adventures in Lestoria/ShermanWindow.cpp
  47. 2
      Adventures in Lestoria/Slider.h
  48. 2
      Adventures in Lestoria/StatLabel.h
  49. 2
      Adventures in Lestoria/State_GameHub.cpp
  50. 2
      Adventures in Lestoria/State_GameHub.h
  51. 59
      Adventures in Lestoria/State_Keybind.cpp
  52. 46
      Adventures in Lestoria/State_Keybind.h
  53. 4
      Adventures in Lestoria/State_OverworldMap.cpp
  54. 1
      Adventures in Lestoria/State_OverworldMap.h
  55. 2
      Adventures in Lestoria/TextEntryLabel.h
  56. 2
      Adventures in Lestoria/TitleScreen.cpp
  57. 2
      Adventures in Lestoria/TitleScreen.h
  58. 2
      Adventures in Lestoria/UserIDMenu.cpp
  59. 2
      Adventures in Lestoria/Version.h
  60. 2
      Adventures in Lestoria/Wisp.cpp
  61. 2
      Adventures in Lestoria/Wolf.cpp
  62. 4
      Adventures in Lestoria/miniaudio.h
  63. 2
      Adventures in Lestoria/olcPGEX_MiniAudio.h
  64. 4
      Adventures in Lestoria/olcPixelGameEngine.h
  65. 2
      Adventures in Lestoria/olcUTIL_Geometry2D.h

@ -34,7 +34,7 @@ BEGIN
VALUE "FileDescription", "Adventures in Lestoria"
VALUE "FileVersion", "0.2.1.5299"
VALUE "InternalName", "Crawler.exe"
VALUE "LegalCopyright", "Copyright © 2023-2024"
VALUE "LegalCopyright", "Copyright © 2024-2024"
VALUE "OriginalFilename", "Adventures in Lestoria.exe"
VALUE "ProductName", "Adventures in Lestoria"
VALUE "ProductVersion", "0.2.1.5299"

@ -3079,5 +3079,21 @@ const uint8_t AiL::BossEncounterMobCount()const{
void AiL::GetAnyKeyPress(Key key){
GameState::STATE->GetAnyKeyPress(key);
if(key!=0){
#pragma region New keyboard input binding listener
if(Menu::stack.back()==Menu::menus[NEW_INPUT]){ //We are requesting a brand new input.
if(key==ESCAPE){ //If we hit escape we don't bother with setting the input and leave immediately.
Menu::CloseMenu();
return;
}
using A=Attribute;
if(InputGroup::menuNamesToInputGroups.count(Menu::menus[NEW_INPUT]->S(A::KEYBIND))){
InputGroup::menuNamesToInputGroups[Menu::menus[NEW_INPUT]->S(A::KEYBIND)]->SetNewPrimaryKeybind(Input{KEY,key});
Menu::CloseMenu();
}
}
#pragma endregion
GameState::STATE->GetAnyKeyPress(key);
}
}

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -1,7 +1,7 @@
The inspiration that started it all, Pokemon-based Nico Yazawa sprite:
https://www.deviantart.com/kirbysmith/art/Nico-Yazawa-Love-Live-Pokemon-Sprites-548007023
olcPixelGameEngine Copyright 2023 OneLoneCoder.com under the OLC-3 License
olcPixelGameEngine Copyright© 2024 OneLoneCoder.com under the OLC-3 License
*** Minifantasy - Tiny Overworld v1.0 ***
@ -27,5 +27,5 @@ Nb Pixel Font Bundle: https://nimblebeastscollective.itch.io/nb-pixel-font-bundl
Nb Pixel Font Bundle 2: https://nimblebeastscollective.itch.io/nb-pixel-font-bundle-2
Ogg Vorbis audio decoder - v1.22 - public domain http://nothings.org/stb_vorbis/
miniaudio library Copyright 2023 by David Reid under the MIT No Attribution License
olcPGEX_MiniAudio Copyright 2023 by Moros Smith under the OLC-3 License
miniaudio library Copyright© 2024 by David Reid under the MIT No Attribution License
olcPGEX_MiniAudio Copyright© 2024 by Moros Smith under the OLC-3 License

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright <EFBFBD> 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright <EFBFBD> 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright <EFBFBD> 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright <EFBFBD> 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright <EFBFBD> 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -39,6 +39,7 @@ All rights reserved.
#include <map>
#include <iostream>
#include "Error.h"
#include "Key.h"
class AiL;

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/
@ -42,6 +42,8 @@ All rights reserved.
#include "Key.h"
#include "InputDisplayComponent.h"
using A=Attribute;
INCLUDE_WINDOW_SIZE
void Menu::InitializeKeyboardInputWindow(){
@ -66,9 +68,14 @@ void Menu::InitializeKeyboardInputWindow(){
inputKeyboardWindow->ADD(std::format("Input_{}_{} Background",row,col),MenuLabel)(geom2d::rect<float>{vf2d{4,36}+vf2d{inputWindowWidth/2.f*col,row*12.f},{inputWindowWidth/4.f,11.f}},inputDisplayName,1.f,ComponentAttr::FIT_TO_LABEL|ComponentAttr::SHADOW)END;
inputKeyboardWindow->ADD(std::format("Input_{}_{} Input Displayer",row,col),InputDisplayComponent)(geom2d::rect<float>{vf2d{4,36}+vf2d{inputWindowWidth/2.f*col,row*12.f}+vf2d{inputWindowWidth/4.f,-1.f},vf2d{inputWindowWidth/4.f,11.f}},*InputGroup::menuNamesToInputGroups[inputDisplayName],InputType::KEY,[](MenuFuncData data){
auto inputChangeButton=inputKeyboardWindow->ADD(std::format("Input_{}_{} Input Displayer",row,col),InputDisplayComponent)(geom2d::rect<float>{vf2d{4,36}+vf2d{inputWindowWidth/2.f*col,row*12.f}+vf2d{inputWindowWidth/4.f,-1.f},vf2d{inputWindowWidth/4.f,11.f}},*InputGroup::menuNamesToInputGroups[inputDisplayName],InputType::KEY,[](MenuFuncData data){
Menu::menus[NEW_INPUT]->B(A::IS_KEYBOARD)=true;
Menu::menus[NEW_INPUT]->S(A::KEYBIND)=data.component.lock()->S(A::KEYBIND);
Menu::OpenMenu(NEW_INPUT);
return true;
})END;
inputChangeButton->S(A::KEYBIND)=inputDisplayName; //Store the keybind in this button to pass along information.
}
}
@ -82,10 +89,21 @@ void Menu::InitializeKeyboardInputWindow(){
inputKeyboardWindow->ADD(std::format("GameplayInput_{}_{} Background",row,col),MenuLabel)(geom2d::rect<float>{vf2d{4,104}+vf2d{inputWindowWidth/2.f*col,row*12.f},{inputWindowWidth/4.f,11.f}},inputDisplayName,1.f,ComponentAttr::FIT_TO_LABEL|ComponentAttr::SHADOW)END;
inputKeyboardWindow->ADD(std::format("Input_{}_{} Gameplay Input Displayer",row,col),InputDisplayComponent)(geom2d::rect<float>{vf2d{4,104}+vf2d{inputWindowWidth/2.f*col,row*12.f}+vf2d{inputWindowWidth/4.f,-1.f},vf2d{inputWindowWidth/4.f,11.f}},*InputGroup::menuNamesToInputGroups[inputDisplayName],InputType::KEY,[](MenuFuncData data){
auto inputChangeButton=inputKeyboardWindow->ADD(std::format("Input_{}_{} Gameplay Input Displayer",row,col),InputDisplayComponent)(geom2d::rect<float>{vf2d{4,104}+vf2d{inputWindowWidth/2.f*col,row*12.f}+vf2d{inputWindowWidth/4.f,-1.f},vf2d{inputWindowWidth/4.f,11.f}},*InputGroup::menuNamesToInputGroups[inputDisplayName],InputType::KEY,[](MenuFuncData data){
Menu::menus[NEW_INPUT]->B(A::IS_KEYBOARD)=true;
std::string keybindName=data.component.lock()->S(A::KEYBIND);
Menu::menus[NEW_INPUT]->S(A::KEYBIND)=keybindName;
Component<MenuLabel>(NEW_INPUT,"New Keybind Label")->SetLabel(std::format("Press a new key for '{}'\n\nPress Esc to cancel.",keybindName));
Menu::OpenMenu(NEW_INPUT);
return true;
})END;
inputChangeButton->S(A::KEYBIND)=inputDisplayName; //Store the keybind in this button to pass along information.
}
}
inputKeyboardWindow->ADD("Confirm Button",MenuComponent)(geom2d::rect<float>{{menuSize.x/2-48.f,170.f},{96.f,20.f}},"Back",[](MenuFuncData data){
Menu::CloseMenu();
return true;
})END;
}

@ -46,5 +46,5 @@ void Menu::InitializeNewKeybindInputWindow(){
newKeybindWindow->B(A::IS_KEYBOARD)=true;
newKeybindWindow->S(A::KEYBIND)="";
newKeybindWindow->ADD("New Keybind Label",MenuLabel)(geom2d::rect<float>{{0.f,24.f},{192.f,96.f}},"Press a new key for '{}'\n\nPress Esc to cancel.",1.5f,ComponentAttr::BACKGROUND|ComponentAttr::OUTLINE|ComponentAttr::SHADOW)END;
newKeybindWindow->ADD("New Keybind Label",MenuLabel)(geom2d::rect<float>{{0.f,0.f},{192.f,96.f}},"",1.5f,ComponentAttr::BACKGROUND|ComponentAttr::OUTLINE|ComponentAttr::SHADOW)END;
}

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright <EFBFBD> 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -539,8 +539,12 @@ const InputEngageGroup InputEngageGroup::operator=(const InputEngageGroup&rhs){
void InputGroup::RemovePrimaryKeybind(InputType type){
std::erase(keyOrder.front());
keyOrder.erase(keyOrder.begin());
}
void InputGroup::AddPrimaryKeybind(InputType type){
void InputGroup::AddPrimaryKeybind(Input key){
keyOrder.insert(keyOrder.begin(),{key.GetType(),key.key});
}
void InputGroup::SetNewPrimaryKeybind(Input key){
RemovePrimaryKeybind(key.GetType());
AddPrimaryKeybind(key);
}

@ -85,16 +85,17 @@ public:
class InputGroup{
friend class AiL;
friend class Menu;
friend class State_Keybind;
friend class State_OverworldMap;
std::set<Input>keys;
std::vector<Input>keyOrder; //A list of keys inserted in order, for primary key mapping.
static safemap<std::string,InputGroup*>menuNamesToInputGroups;
void RemovePrimaryKeybind(InputType type);
void AddPrimaryKeybind(Input key);
public:
InputGroup();
void AddKeybind(Input bind);
void RemoveKeybind(Input bind);
void RemovePrimaryKeybind(InputType type);
void AddPrimaryKeybind(InputType type);
void SetNewPrimaryKeybind(Input key);
const bool Pressed()const;
const bool Held()const;
const bool Released()const;

@ -1,7 +1,7 @@
License (OLC-3)
~~~~~~~~~~~~~~~
Copyright 2018 - 2023 OneLoneCoder.com
Copyright 2018 -© 2024 OneLoneCoder.com
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright <EFBFBD> 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright <EFBFBD> 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright <EFBFBD> 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -1,59 +0,0 @@
#pragma region License
/*
License (OLC-3)
~~~~~~~~~~~~~~~
Copyright 2024 Joshua Sigona <sigonasr2@gmail.com>
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions or derivations of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions or derivative works in binary form must reproduce the above
copyright notice. This list of conditions and the following disclaimer must be
reproduced in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may
be used to endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/
#pragma endregion
#include "State_Keybind.h"
#include "VisualNovel.h"
#include "Menu.h"
#include "Key.h"
using A=Attribute;
void State_Keybind::OnStateChange(GameState*prevState){
Menu::CloseAllMenus();
};
void State_Keybind::OnUserUpdate(AiL*game){
};
void State_Keybind::Draw(AiL*game){
};
void State_Keybind::GetAnyKeyPress(Key key){
Input previousPrimaryKey=InputGroup::menuNamesToInputGroups[Menu::menus[NEW_INPUT].S(A::KEYBIND)]->keyOrder[0];
InputGroup::menuNamesToInputGroups[Menu::menus[NEW_INPUT].S(A::KEYBIND)]->RemoveKeybind({KEY,previousPrimaryKey});
}

@ -1,46 +0,0 @@
#pragma region License
/*
License (OLC-3)
~~~~~~~~~~~~~~~
Copyright 2024 Joshua Sigona <sigonasr2@gmail.com>
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions or derivations of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions or derivative works in binary form must reproduce the above
copyright notice. This list of conditions and the following disclaimer must be
reproduced in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may
be used to endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/
#pragma endregion
#pragma once
#include "GameState.h"
class State_Keybind:public GameState{
virtual void OnStateChange(GameState*prevState)override final;
virtual void OnUserUpdate(AiL*game)override final;
virtual void Draw(AiL*game)override final;
virtual void GetAnyKeyPress(Key key)override final;
};

@ -253,4 +253,6 @@ void State_OverworldMap::ResetConnectionPoints(){
for(ConnectionPoint&cp:connections){
cp.visited=false;
}
}
}
void State_OverworldMap::GetAnyKeyPress(Key key){}

@ -59,4 +59,5 @@ public:
virtual void Draw(AiL*game)override final;
static void StartLevel();
static void UpdateCurrentConnectionPoint(const ConnectionPoint&connection);
virtual void GetAnyKeyPress(Key key)override final;
};

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright ?? 2023 The FreeType
Portions of this software are copyright ??© 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType
Portions of this software are copyright © 2024 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved.
*/

@ -1,5 +1,5 @@
/*
Copyright 2023 David Reid
Copyright© 2024 David Reid
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
@ -18,7 +18,7 @@ SOFTWARE.
*/
/*
Audio playback and capture library. Choice of public domain or MIT-0. See license statements at the end of this file.
miniaudio - v0.11.18 - 2023-08-07
miniaudio - v0.11.18 -© 2024-08-07
David Reid - mackron@gmail.com

@ -20,7 +20,7 @@ for cross-platform.
License (OLC-3)
~~~~~~~~~~~~~~~
Copyright 2023 Moros Smith <moros1138@gmail.com>
Copyright© 2024 Moros Smith <moros1138@gmail.com>
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

@ -201,7 +201,7 @@ certainly enjoyed my tea and flapjacks :D
Author
~~~~~~
David Barr, aka javidx9, (c) OneLoneCoder 2018, 2019, 2020, 2021, 2022, 2023, 2024
David Barr, aka javidx9, (c) OneLoneCoder 2018, 2019, 2020, 2021, 2022,© 2024, 2024
*/
#pragma endregion
@ -4643,7 +4643,7 @@ namespace olc
{
pKeys[i].bPressed = !pKeys[i].bHeld;
pKeys[i].bHeld = true;
GetAnyKeyPress(i);
GetAnyKeyPress(Key(i));
}
else
{

@ -49,7 +49,7 @@
Authors
~~~~~~~
David Barr, aka javidx9, (c) OneLoneCoder 2019, 2020, 2021, 2022, 2023, 2024
David Barr, aka javidx9, (c) OneLoneCoder 2019, 2020, 2021, 2022,© 2024, 2024
With significant contributions from:

Loading…
Cancel
Save