Added controller compatibility to Artificer Enchant Window. Removed menu navigation using right analog stick. Release Build 11662.
This commit is contained in:
parent
da5d596a37
commit
36b9a071e3
@ -141,11 +141,9 @@ void Menu::InitializeArtificerDisassembleWindow(){
|
||||
artificerDisassembleWindow->SetupKeyboardNavigation(
|
||||
[](MenuType type,Data&returnData){ //On Open
|
||||
auto&items{Component<RowInventoryScrollableWindowComponent>(type,"Accessory List")->GetComponents()};
|
||||
if(items.size()>0){
|
||||
returnData=items[0];
|
||||
}else{
|
||||
returnData="Back";
|
||||
}
|
||||
if(Component<RowInventoryScrollableWindowComponent>(type,"Accessory List")->GetSelectedChild())returnData=Component<RowInventoryScrollableWindowComponent>(type,"Accessory List")->GetSelectedChild().value().get().GetName();
|
||||
else if(items.size()>0)returnData=items[0];
|
||||
else returnData="Back";
|
||||
},
|
||||
{ //Button Key
|
||||
{game->KEY_SCROLL,{"Navigate",[](MenuType type){}}},
|
||||
|
@ -172,7 +172,10 @@ void Menu::InitializeArtificerEnchantWindow(){
|
||||
|
||||
artificerEnchantWindow->SetupKeyboardNavigation(
|
||||
[](MenuType type,Data&returnData){ //On Open
|
||||
returnData="";
|
||||
auto&items{Component<RowInventoryScrollableWindowComponent>(type,"Accessory List")->GetComponents()};
|
||||
if(Component<RowInventoryScrollableWindowComponent>(type,"Accessory List")->GetSelectedChild())returnData=Component<RowInventoryScrollableWindowComponent>(type,"Accessory List")->GetSelectedChild().value().get().GetName();
|
||||
else if(items.size()>0)returnData=items[0];
|
||||
else returnData="Back";
|
||||
},
|
||||
{ //Button Key
|
||||
{game->KEY_SCROLL,{"Navigate",[](MenuType type){}}},
|
||||
@ -180,12 +183,54 @@ void Menu::InitializeArtificerEnchantWindow(){
|
||||
Menu::CloseMenu();
|
||||
}}},
|
||||
{game->KEY_CONFIRM,{"Select",[](MenuType type){}}},
|
||||
{{game->KEY_SHOULDER2,Pressed},{"Scroll Up/Down",[](MenuType type){}}},
|
||||
{{game->KEY_SHOULDER,Pressed},{"Scroll Up/Down",[](MenuType type){}}},
|
||||
{{game->KEY_FASTSCROLLUP,PressedDAS},{"Scroll",[](MenuType type){
|
||||
Menu::menus[type]->GetSelection().lock()->parentComponent.lock()->DecreaseSelectionIndex(3.f);
|
||||
}}},
|
||||
{{game->KEY_FASTSCROLLDOWN,PressedDAS},{"Scroll",[](MenuType type){
|
||||
Menu::menus[type]->GetSelection().lock()->parentComponent.lock()->IncreaseSelectionIndex(3.f);
|
||||
}}},
|
||||
{{game->KEY_SCROLLVERT_R,Analog,InputEngageGroup::NOT_VISIBLE},{"Scroll Enchants",[](MenuType type){
|
||||
Component<ScrollableWindowComponent>(type,"Enchant Container")->Scroll(game->KEY_SCROLLVERT.Analog());
|
||||
}}},
|
||||
}
|
||||
,{ //Button Navigation Rules
|
||||
{"Sample Button",{
|
||||
.up="",
|
||||
.down="",
|
||||
.left="",
|
||||
.right="",}},
|
||||
});
|
||||
{"Accessory List",{
|
||||
.up=[&](MenuType type,Data&returnData){
|
||||
Menu::ScrollUp(type,"Accessory List",returnData,"Back");
|
||||
},
|
||||
.down=[&](MenuType type,Data&returnData){
|
||||
Menu::ScrollDown(type,"Accessory List",returnData,"Back");
|
||||
},
|
||||
.left="Back",
|
||||
.right=[&](MenuType type,Data&returnData){
|
||||
Menu::menus[type]->GetSelection().lock()->Click();
|
||||
returnData="Fragment Enchant Button";
|
||||
},}},
|
||||
{"Back",{
|
||||
.up=[&](MenuType type,Data&returnData){
|
||||
if(Component<RowInventoryScrollableWindowComponent>(type,"Accessory List")->GetSelectedChild())returnData=Component<RowInventoryScrollableWindowComponent>(type,"Accessory List")->GetSelectedChild().value().get().GetName();
|
||||
else returnData=Component<RowInventoryScrollableWindowComponent>(type,"Accessory List")->GetComponents().back().lock()->GetName();
|
||||
},
|
||||
.down=[&](MenuType type,Data&returnData){
|
||||
if(Component<RowInventoryScrollableWindowComponent>(type,"Accessory List")->GetSelectedChild())returnData=Component<RowInventoryScrollableWindowComponent>(type,"Accessory List")->GetSelectedChild().value().get().GetName();
|
||||
else returnData=Component<RowInventoryScrollableWindowComponent>(type,"Accessory List")->GetComponents().front().lock()->GetName();
|
||||
},
|
||||
.left="Fragment Enchant Button",
|
||||
.right="Fragment Enchant Button",}},
|
||||
{"Fragment Enchant Button",{
|
||||
.up=[&](MenuType type,Data&returnData){
|
||||
returnData=Component<RowInventoryScrollableWindowComponent>(type,"Accessory List")->GetComponents().back().lock()->GetName();
|
||||
},
|
||||
.down=[&](MenuType type,Data&returnData){
|
||||
returnData=Component<RowInventoryScrollableWindowComponent>(type,"Accessory List")->GetComponents().front().lock()->GetName();
|
||||
},
|
||||
.left=[&](MenuType type,Data&returnData){
|
||||
if(Component<RowInventoryScrollableWindowComponent>(type,"Accessory List")->GetSelectedChild())returnData=Component<RowInventoryScrollableWindowComponent>(type,"Accessory List")->GetSelectedChild().value().get().GetName();
|
||||
else returnData="Back";
|
||||
},
|
||||
.right="Back",}},
|
||||
}
|
||||
);
|
||||
}
|
@ -158,11 +158,9 @@ void Menu::InitializeArtificerRefineWindow(){
|
||||
artificerRefineWindow->SetupKeyboardNavigation(
|
||||
[](MenuType type,Data&returnData){ //On Open
|
||||
auto&items{Component<RowInventoryScrollableWindowComponent>(type,"Accessory List")->GetComponents()};
|
||||
if(items.size()>0){
|
||||
returnData=items[0];
|
||||
}else{
|
||||
returnData="Back";
|
||||
}
|
||||
if(Component<RowInventoryScrollableWindowComponent>(type,"Accessory List")->GetSelectedChild())returnData=Component<RowInventoryScrollableWindowComponent>(type,"Accessory List")->GetSelectedChild().value().get().GetName();
|
||||
else if(items.size()>0)returnData=items[0];
|
||||
else returnData="Back";
|
||||
},
|
||||
{ //Button Key
|
||||
{game->KEY_SCROLL,{"Navigate",[](MenuType type){}}},
|
||||
|
@ -100,6 +100,6 @@ void Menu::InitializeArtificerWindow(){
|
||||
.down="Leave Button",}},
|
||||
{"Leave Button",{
|
||||
.up="Help Button",
|
||||
.down="Refine Button",}},
|
||||
.down="Disassemble Button",}},
|
||||
});
|
||||
}
|
@ -409,8 +409,8 @@ void Menu::KeyboardButtonNavigation(AiL*game,vf2d menuPos){
|
||||
}
|
||||
if(navigationGroups.count(selectionButtonName)){
|
||||
Navigation nav=navigationGroups[selectionButtonName];
|
||||
|
||||
if(game->KEY_UP.PressedDAS()||game->KEY_SCROLLUP.AnalogDAS(0.5f)<-0.5f){
|
||||
const float scrollVertAnalogDAS{game->KEY_SCROLLVERT_L.AnalogDAS(0.5f)};
|
||||
if(game->KEY_UP.PressedDAS()||scrollVertAnalogDAS<-0.5f){
|
||||
SoundEffect::PlaySFX("Menu Navigate",SoundEffect::CENTERED);
|
||||
SetMouseNavigation(false);
|
||||
if(std::holds_alternative<std::string>(nav.up)&&std::get<std::string>(nav.up).length()>0)SetSelection(std::string_view(std::get<std::string>(nav.up)));
|
||||
@ -422,7 +422,7 @@ void Menu::KeyboardButtonNavigation(AiL*game,vf2d menuPos){
|
||||
SetSelection(returnData);
|
||||
}
|
||||
}
|
||||
if(game->KEY_DOWN.PressedDAS()||game->KEY_SCROLLDOWN.AnalogDAS(0.5f)>0.5f){
|
||||
if(game->KEY_DOWN.PressedDAS()||scrollVertAnalogDAS>0.5f){
|
||||
SoundEffect::PlaySFX("Menu Navigate",SoundEffect::CENTERED);
|
||||
SetMouseNavigation(false);
|
||||
if(std::holds_alternative<std::string>(nav.down)&&std::get<std::string>(nav.down).length()>0)SetSelection(std::string_view(std::get<std::string>(nav.down)));
|
||||
|
@ -73,7 +73,7 @@ enum MenuType{
|
||||
ARTIFICER_REFINE, //100% Controller Compatibility
|
||||
ARTIFICER_REFINE_RESULT,
|
||||
ARTIFICER_DISASSEMBLE, //100% Controller Compatibility
|
||||
ARTIFICER_ENCHANT,
|
||||
ARTIFICER_ENCHANT, //100% Controller Compatibility
|
||||
ARTIFICER_ENCHANT_CONFIRM,
|
||||
///////////////////////////////////////////////////////////
|
||||
/*DO NOT REMOVE!!*/ENUM_END////////////////////////////////
|
||||
|
@ -39,7 +39,7 @@ All rights reserved.
|
||||
#define VERSION_MAJOR 1
|
||||
#define VERSION_MINOR 3
|
||||
#define VERSION_PATCH 0
|
||||
#define VERSION_BUILD 11653
|
||||
#define VERSION_BUILD 11662
|
||||
|
||||
#define stringify(a) stringify_(a)
|
||||
#define stringify_(a) #a
|
||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user