Minimap follows camera instead of player. Minimap view setting is now saved in player configuration. Added controller option for minimap toggle input. Release Build 8875.
This commit is contained in:
parent
1680b37671
commit
77e2a654f4
@ -146,6 +146,8 @@ InputGroup AiL::KEY_SHOULDER2;
|
||||
InputGroup AiL::KEY_CHANGE_LOADOUT;
|
||||
InputGroup AiL::KEY_MOUSE_RIGHT;
|
||||
|
||||
InputGroup AiL::KEY_TOGGLE_MAP;
|
||||
|
||||
#ifndef __EMSCRIPTEN__
|
||||
::discord::Core*Discord{};
|
||||
#endif
|
||||
@ -2770,6 +2772,14 @@ bool Steam_Init(){
|
||||
|
||||
int main()
|
||||
{
|
||||
if(!std::filesystem::exists("assets/config/configuration.txt")){
|
||||
ERR("WARNING! Could not find initial config file! Aborting.");
|
||||
return false;
|
||||
}
|
||||
{
|
||||
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()){
|
||||
@ -2778,6 +2788,8 @@ int main()
|
||||
LOG("Steam API failed to initialize!");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
{
|
||||
AiL demo;
|
||||
|
||||
@ -3169,6 +3181,10 @@ void AiL::InitializeDefaultKeybinds(){
|
||||
KEY_UNEQUIP.AddKeybind({CONTROLLER,static_cast<int>(GPButtons::FACE_U)});
|
||||
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});
|
||||
|
||||
#define TieMenuNameToMenuInputGroup(KEY_NAME) \
|
||||
@ -3196,6 +3212,7 @@ void AiL::InitializeDefaultKeybinds(){
|
||||
TieMenuNameToGameplayInputGroup(Player::KEY_ITEM1);
|
||||
TieMenuNameToGameplayInputGroup(Player::KEY_ITEM2);
|
||||
TieMenuNameToGameplayInputGroup(Player::KEY_ITEM3);
|
||||
TieMenuNameToGameplayInputGroup(KEY_TOGGLE_MAP);
|
||||
|
||||
InputGroup::menuNamesToInputGroups.SetInitialized();
|
||||
}
|
||||
@ -3740,7 +3757,7 @@ void AiL::UpdateDiscordStatus(std::string levelName,std::string className){
|
||||
}
|
||||
SteamFriends()->SetRichPresence("steam_display","#Status");
|
||||
}else{
|
||||
if(Steam_Init()){
|
||||
if("steam_api"_B&&Steam_Init()){
|
||||
retry=true;
|
||||
LOG("Steam API Initialized successfully!");
|
||||
}
|
||||
@ -3786,6 +3803,7 @@ void AiL::ResetGame(bool changeToMainMenu){
|
||||
SetChapter(1);
|
||||
SaveFile::SetSaveFileName("");
|
||||
Tutorial::Initialize();
|
||||
minimap.SetMinimapMode(MinimapMode::SMALL);
|
||||
minimap.EraseChunkData();
|
||||
}
|
||||
|
||||
|
@ -123,6 +123,8 @@ public:
|
||||
|
||||
static InputGroup KEY_MOUSE_RIGHT;
|
||||
|
||||
static InputGroup KEY_TOGGLE_MAP;
|
||||
|
||||
static float SIZE_CHANGE_SPEED;
|
||||
double levelTime=0.;
|
||||
Camera2D camera;
|
||||
|
@ -239,15 +239,21 @@ void Menu::InitializeKeyboardInputWindow(){
|
||||
}},
|
||||
{"Input_3_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",
|
||||
.right="Input_3_0 Gameplay Input Displayer",
|
||||
}},
|
||||
{"Input_4_0 Gameplay Input Displayer",{
|
||||
.up="Input_3_0 Gameplay Input Displayer",
|
||||
.down="Confirm Button",
|
||||
.left="Input_3_1 Gameplay Input Displayer",
|
||||
.right="Input_3_1 Gameplay Input Displayer",
|
||||
.left="Input_4_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",{
|
||||
.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::FAST_SCROLL_UP]={"Fast_Scroll_Up",{}};
|
||||
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,
|
||||
FAST_SCROLL_UP,
|
||||
FAST_SCROLL_DOWN,
|
||||
TOGGLE_MAP,
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -149,7 +149,7 @@ void Minimap::Reset(){
|
||||
}
|
||||
|
||||
void Minimap::Update(){
|
||||
if(game->GetKey(TAB).bPressed){
|
||||
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;
|
||||
@ -202,12 +202,12 @@ void Minimap::Draw(){
|
||||
if(!game->InBossEncounter()){
|
||||
switch(displayMode){
|
||||
case MinimapMode::SMALL:{
|
||||
mapCircleHud.DrawRotatedDecal(minimapPos,cover.Decal(),0.f,game->GetPlayer()->GetPos()/game->GetCurrentMapData().tilewidth,vf2d{0.5f,0.5f});
|
||||
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->GetPlayer()->GetPos()/game->GetCurrentMapData().tilewidth,vf2d{2.f,2.f},{255,255,255,48});
|
||||
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;
|
||||
}
|
||||
@ -221,3 +221,11 @@ void Minimap::EraseChunkData(){
|
||||
const std::unordered_map<MapName,std::unordered_set<std::string>>&Minimap::GetChunkData(){
|
||||
return loadedChunks;
|
||||
}
|
||||
|
||||
const MinimapMode&Minimap::GetMinimapMode()const{
|
||||
return displayMode;
|
||||
}
|
||||
|
||||
void Minimap::SetMinimapMode(MinimapMode newMode){
|
||||
displayMode=newMode;
|
||||
}
|
@ -56,6 +56,9 @@ public:
|
||||
void EraseChunkData();
|
||||
|
||||
const std::unordered_map<MapName,std::unordered_set<std::string>>&GetChunkData();
|
||||
|
||||
const MinimapMode&GetMinimapMode()const;
|
||||
void SetMinimapMode(MinimapMode newMode);
|
||||
private:
|
||||
ViewPort mapCircleHud;
|
||||
ViewPort mapCircleLargeHud;
|
||||
|
@ -136,6 +136,7 @@ const void SaveFile::SaveGame(){
|
||||
saveFile["Save Name"].SetString(std::string(GetSaveFileName()));
|
||||
saveFile["Game Time"].SetReal(game->GetRuntime());
|
||||
saveFile["TravelingMerchant"].SetString(std::string(Merchant::GetCurrentTravelingMerchant().GetKeyName()));
|
||||
saveFile["Minimap Display Mode"].SetInt(int(game->minimap.GetMinimapMode()));
|
||||
|
||||
#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!
|
||||
@ -403,6 +404,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
|
||||
//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;
|
||||
|
@ -39,7 +39,7 @@ All rights reserved.
|
||||
#define VERSION_MAJOR 1
|
||||
#define VERSION_MINOR 1
|
||||
#define VERSION_PATCH 0
|
||||
#define VERSION_BUILD 8868
|
||||
#define VERSION_BUILD 8875
|
||||
|
||||
#define stringify(a) stringify_(a)
|
||||
#define stringify_(a) #a
|
||||
|
@ -16,6 +16,9 @@ gfx_config = gfx/gfx.txt
|
||||
# Save File Server Name
|
||||
save_server = https://projectdivar.com:4505/AiL
|
||||
|
||||
# Steam API. Set to False to disable using Steam.
|
||||
steam_api = True
|
||||
|
||||
# Map Files Loading Config
|
||||
map_config = levels.txt
|
||||
|
||||
|
@ -2,7 +2,7 @@ Inputs
|
||||
{
|
||||
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
|
||||
@ -24,4 +24,5 @@ Inputs
|
||||
Player::KEY_ITEM1=Item 1
|
||||
Player::KEY_ITEM2=Item 2
|
||||
Player::KEY_ITEM3=Item 3
|
||||
KEY_TOGGLE_MAP=Toggle Minimap
|
||||
}
|
@ -1,18 +1,18 @@
|
||||
"controller_mappings"
|
||||
{
|
||||
"version" "3"
|
||||
"revision" "87"
|
||||
"revision" "88"
|
||||
"title" "Generic Gamepad"
|
||||
"description" "Default Generic Gamepad controls"
|
||||
"creator" "76561198025675819"
|
||||
"progenitor" ""
|
||||
"url" "autosave://C:\\Program Files (x86)\\Steam\\steamapps\\common\\Steam Controller Configs\\65410091\\config\\2895980\\controller_generic.vdf"
|
||||
"progenitor" "game://controller_generic.vdf"
|
||||
"url" "game://controller_generic.vdf"
|
||||
"export_type" "personal_local"
|
||||
"controller_type" "controller_generic"
|
||||
"controller_caps" "1573375"
|
||||
"major_revision" "0"
|
||||
"minor_revision" "0"
|
||||
"Timestamp" "1711752971"
|
||||
"Timestamp" "1713016743"
|
||||
"actions"
|
||||
{
|
||||
"InGameControls"
|
||||
@ -61,6 +61,7 @@
|
||||
}
|
||||
"Fast_Scroll_Up" "#ScrollUp"
|
||||
"Fast_Scroll_Down" "#ScrollDown"
|
||||
"Toggle_Map" "#ToggleMap"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -97,6 +98,7 @@
|
||||
"Scroll" "Scroll Menu/Manual Aim"
|
||||
"ScrollUp" "Fast Scroll Menu Up"
|
||||
"ScrollDown" "Fast Scroll Menu Down"
|
||||
"ToggleMap" "Toggle Minimap"
|
||||
}
|
||||
}
|
||||
"group"
|
||||
@ -531,6 +533,22 @@
|
||||
"description" ""
|
||||
"inputs"
|
||||
{
|
||||
"click"
|
||||
{
|
||||
"activators"
|
||||
{
|
||||
"Full_Press"
|
||||
{
|
||||
"bindings"
|
||||
{
|
||||
"binding" "game_action InGameControls Toggle_Map, #ToggleMap, , "
|
||||
}
|
||||
}
|
||||
}
|
||||
"disabled_activators"
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
"settings"
|
||||
{
|
||||
|
@ -1,18 +1,18 @@
|
||||
"controller_mappings"
|
||||
{
|
||||
"version" "3"
|
||||
"revision" "85"
|
||||
"revision" "86"
|
||||
"title" "Switch Pro"
|
||||
"description" "Default Switch Pro configuration."
|
||||
"creator" "76561198025675819"
|
||||
"progenitor" ""
|
||||
"url" "autosave://C:\\Program Files (x86)\\Steam\\steamapps\\common\\Steam Controller Configs\\65410091\\config\\2895980\\controller_switch_pro.vdf"
|
||||
"progenitor" "game://controller_switch_pro.vdf"
|
||||
"url" "game://controller_switch_pro.vdf"
|
||||
"export_type" "personal_local"
|
||||
"controller_type" "controller_switch_pro"
|
||||
"controller_caps" "613772287"
|
||||
"major_revision" "0"
|
||||
"minor_revision" "0"
|
||||
"Timestamp" "1711752483"
|
||||
"Timestamp" "1713016698"
|
||||
"actions"
|
||||
{
|
||||
"InGameControls"
|
||||
@ -61,6 +61,7 @@
|
||||
}
|
||||
"Fast_Scroll_Up" "#ScrollUp"
|
||||
"Fast_Scroll_Down" "#ScrollDown"
|
||||
"Toggle_Map" "#ToggleMap"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -97,6 +98,7 @@
|
||||
"Scroll" "Scroll Menu/Manual Aim"
|
||||
"ScrollUp" "Fast Scroll Menu Up"
|
||||
"ScrollDown" "Fast Scroll Menu Down"
|
||||
"ToggleMap" "Toggle Minimap"
|
||||
}
|
||||
}
|
||||
"group"
|
||||
@ -531,6 +533,22 @@
|
||||
"description" ""
|
||||
"inputs"
|
||||
{
|
||||
"click"
|
||||
{
|
||||
"activators"
|
||||
{
|
||||
"Full_Press"
|
||||
{
|
||||
"bindings"
|
||||
{
|
||||
"binding" "game_action InGameControls Toggle_Map, #ToggleMap, , "
|
||||
}
|
||||
}
|
||||
}
|
||||
"disabled_activators"
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
"settings"
|
||||
{
|
||||
|
@ -1,18 +1,18 @@
|
||||
"controller_mappings"
|
||||
{
|
||||
"version" "3"
|
||||
"revision" "78"
|
||||
"revision" "79"
|
||||
"title" "Xbox/Playstation"
|
||||
"description" "Default Xbox/Playstation controls"
|
||||
"creator" "76561198025675819"
|
||||
"progenitor" ""
|
||||
"url" "autosave://C:\\Program Files (x86)\\Steam\\steamapps\\common\\Steam Controller Configs\\65410091\\config\\2895980\\controller_xbox360.vdf"
|
||||
"creator" "-1"
|
||||
"progenitor" "game://controller_xboxone.vdf"
|
||||
"url" "game://controller_xboxone.vdf"
|
||||
"export_type" "personal_local"
|
||||
"controller_type" "controller_xbox360"
|
||||
"controller_caps" "1590271"
|
||||
"major_revision" "0"
|
||||
"minor_revision" "0"
|
||||
"Timestamp" "1711752757"
|
||||
"Timestamp" "1713016732"
|
||||
"actions"
|
||||
{
|
||||
"InGameControls"
|
||||
@ -61,6 +61,7 @@
|
||||
}
|
||||
"Fast_Scroll_Up" "#ScrollUp"
|
||||
"Fast_Scroll_Down" "#ScrollDown"
|
||||
"Toggle_Map" "#ToggleMap"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -97,6 +98,7 @@
|
||||
"Scroll" "Scroll Menu/Manual Aim"
|
||||
"ScrollUp" "Fast Scroll Menu Up"
|
||||
"ScrollDown" "Fast Scroll Menu Down"
|
||||
"ToggleMap" "Toggle Minimap"
|
||||
}
|
||||
}
|
||||
"group"
|
||||
@ -531,6 +533,22 @@
|
||||
"description" ""
|
||||
"inputs"
|
||||
{
|
||||
"click"
|
||||
{
|
||||
"activators"
|
||||
{
|
||||
"Full_Press"
|
||||
{
|
||||
"bindings"
|
||||
{
|
||||
"binding" "game_action InGameControls Toggle_Map, #ToggleMap, , "
|
||||
}
|
||||
}
|
||||
}
|
||||
"disabled_activators"
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
"settings"
|
||||
{
|
||||
|
@ -44,6 +44,7 @@
|
||||
"Lock/Unlock_Accessory" "#Select"
|
||||
"Fast_Scroll_Up" "#ScrollUp"
|
||||
"Fast_Scroll_Down" "#ScrollDown"
|
||||
"Toggle_Map" "#ToggleMap"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -77,6 +78,7 @@
|
||||
"Scroll" "Scroll Menu/Manual Aim"
|
||||
"ScrollUp" "Fast Scroll Menu Up"
|
||||
"ScrollDown" "Fast Scroll Menu Down"
|
||||
"ToggleMap" "Toggle Minimap"
|
||||
}
|
||||
}
|
||||
"configurations"
|
||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user