Add a tutorial task that requires the player to equip a crafted piece of gear. Release Build 8467.

This commit is contained in:
2024-03-26 22:45:09 -05:00
parent ea74eec6f8
commit daa90538ad
6 changed files with 44 additions and 3 deletions
+38
View File
@@ -61,6 +61,7 @@ enum class TutorialTaskName{
USE_DEFENSIVE,
USE_RECOVERY_ITEMS,
BLACKSMITH,
EQUIP_GEAR,
NONE,
};
@@ -316,4 +317,41 @@ private:
float textWidth=game->GetTextSizeProp(helpText).x;
game->DrawShadowStringPropDecal({game->ScreenWidth()/2.f-textWidth/2.f,48.f},helpText);
}
};
class EquipGearTask:public TutorialTask{
public:
inline EquipGearTask():TutorialTask(){};
private:
InputGroup startGroup;
virtual inline void OnActivate()override final{
startGroup.ClearAllKeybinds();
ADDKEYBIND(startGroup,game->KEY_MENU,CONTROLLER);
ADDKEYBIND(startGroup,game->KEY_MENU,KEY);
ADDKEYBIND(startGroup,game->KEY_MENU,STEAM);
Component<MenuComponent>(SHERMAN,"Leave Button")->SetGrayedOut(true);
Component<MenuComponent>(MenuType::PAUSE,"Return to Camp Button")->SetGrayedOut(true);
}
virtual inline bool CompleteCondition()override final{
for(int i=int(EquipSlot::HELMET);i<=int(EquipSlot::RING2);i<<=1){
EquipSlot slot=EquipSlot(i);
if(!ISBLANK(Inventory::GetEquip(slot)))return true;
}
return false;
}
virtual inline void OnComplete()override final{
Component<MenuComponent>(SHERMAN,"Leave Button")->SetGrayedOut(false);
Component<MenuComponent>(MenuType::PAUSE,"Return to Camp Button")->SetGrayedOut(false);
}
virtual inline void Draw()const override final{
if(Input::UsingGamepad()){
STEAMINPUT(
startGroup.DrawInput(game,{game->ScreenWidth()/2.f,48.f},"Open the #FFCF0CCharacter#FFFFFF menu and equip your new gear.",180,InputType::STEAM);
)else{
startGroup.DrawInput(game,{game->ScreenWidth()/2.f,48.f},"Open the #FFCF0CCharacter#FFFFFF menu and equip your new gear.",180,InputType::CONTROLLER);
}
}else{
startGroup.DrawInput(game,{game->ScreenWidth()/2.f,48.f},"Open the #FFCF0CCharacter#FFFFFF menu and equip your new gear.",180,InputType::KEY);
}
}
};