Skip to content

Commit

Permalink
Screen
Browse files Browse the repository at this point in the history
  • Loading branch information
ArctanDeveloper committed Nov 8, 2024
1 parent 1506b98 commit 754c3da
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,38 @@ int main() {
quit = true;
}), {});

commandHandler.AddCommand(Command("screen", "Gets the screen.", [&](const CommandHandler& handler, const std::vector<Parameter>& parameters) {
switch (screenStack.top()) {
case ScreenType::Inventory:
std::cout << "Screen is: Inventory" << std::endl;
break;
case ScreenType::Crafting:
std::cout << "Screen is: Crafting" << std::endl;
break;
case ScreenType::InspectionLog:
std::cout << "Screen is: Inspection Log" << std::endl;
break;
case ScreenType::ItemInspectionLog:
std::cout << "Screen is: Item Inspection Log" << std::endl;
break;
case ScreenType::TileInspectionLog:
std::cout << "Screen is: Tile Inspection Log" << std::endl;
break;
case ScreenType::RecipeInspectionLog:
std::cout << "Screen is: Recipe Inspection Log" << std::endl;
break;
case ScreenType::Game:
std::cout << "Screen is: Game" << std::endl;
break;
case ScreenType::MainMenu:
std::cout << "Screen is: Main Menu" << std::endl;
break;
default:
std::cout << "Not a valid command for this screen." << std::endl;
break;
}
}), {});

commandHandler.AddCommand(Command("help", [&](const CommandHandler& handler, const std::vector<Parameter>& parameters) {
std::cout << "Available commands:" << std::endl;
for (Command command : handler.commands) {
Expand Down Expand Up @@ -134,6 +166,8 @@ int main() {
switch (screenStack.top()) {
case ScreenType::Game:
screenStack.push(ScreenType::Inventory);


break;
default:
std::cout << "Not a valid command for this screen." << std::endl;
Expand Down

0 comments on commit 754c3da

Please sign in to comment.