Tied level entry button to map loading and gameplay.
This commit is contained in:
@@ -30,6 +30,7 @@ void State_OverworldMap::OnStateChange(GameState*prevState){
|
||||
COMPONENT(MenuLabel,OVERWORLD_LEVEL_SELECT,"Chapter Label")->SetLabel("Chapter "+std::to_string(game->GetCurrentChapter()));
|
||||
COMPONENT(MenuLabel,OVERWORLD_LEVEL_SELECT,"Stage Label")->SetLabel(currentConnectionPoint->name);
|
||||
COMPONENT(EncountersSpawnListScrollableWindowComponent,OVERWORLD_LEVEL_SELECT,"Spawns List")->UpdateSpawns(currentConnectionPoint->spawns);
|
||||
COMPONENT(MenuComponent,OVERWORLD_LEVEL_SELECT,"Enter Button")->Enable(currentConnectionPoint->levelDataExists);
|
||||
Menu::OpenMenu(OVERWORLD_LEVEL_SELECT,false);
|
||||
};
|
||||
void State_OverworldMap::OnUserUpdate(Crawler*game){
|
||||
@@ -67,6 +68,7 @@ void State_OverworldMap::OnUserUpdate(Crawler*game){
|
||||
}
|
||||
COMPONENT(MenuLabel,OVERWORLD_LEVEL_SELECT,"Stage Label")->SetLabel(currentConnectionPoint->name);
|
||||
COMPONENT(EncountersSpawnListScrollableWindowComponent,OVERWORLD_LEVEL_SELECT,"Spawns List")->UpdateSpawns(currentConnectionPoint->spawns);
|
||||
COMPONENT(MenuComponent,OVERWORLD_LEVEL_SELECT,"Enter Button")->Enable(currentConnectionPoint->levelDataExists);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -133,4 +135,9 @@ ConnectionPoint&State_OverworldMap::ConnectionPointFromIndex(int ind){
|
||||
|
||||
ConnectionPoint&State_OverworldMap::GetCurrentConnectionPoint(){
|
||||
return *((State_OverworldMap*)(GameState::states.at(States::OVERWORLD_MAP)))->currentConnectionPoint;
|
||||
}
|
||||
|
||||
void State_OverworldMap::StartLevel(){
|
||||
game->LoadLevel(LEVEL_NAMES.at(State_OverworldMap::GetCurrentConnectionPoint().map));
|
||||
GameState::ChangeState(States::GAME_RUN);
|
||||
}
|
||||
Reference in New Issue
Block a user