-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add EffectsView + Egg Power Recipes
- Loading branch information
1 parent
155d8a5
commit 061d9de
Showing
7 changed files
with
206 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#pragma once | ||
|
||
#include "../recipe.hpp" | ||
|
||
Recipe CatchingPowerBug1 = { | ||
{ | ||
{"Banana", 3}, | ||
{"Chorizo", 2}, | ||
{"Sweet Herba Mystica", 1}, | ||
}, | ||
{ | ||
{"Egg Power", "Normal", 3}, | ||
{"Title Power: Normal", "Normal", 3}, | ||
{"Item Drop Power: Electric", "Normal", 3} | ||
} | ||
}; | ||
|
||
Recipe CatchingPowerBug2 = { | ||
{ | ||
{"Banana", 3}, | ||
{"Chorizo", 2}, | ||
{"Sweet Herba Mystica", 1}, | ||
}, | ||
{ | ||
{"Egg Power", "Normal", 3}, | ||
{"Title Power: Normal", "Normal", 3}, | ||
{"Item Drop Power: Electric", "Normal", 3} | ||
} | ||
}; | ||
|
||
Recipe CatchingPowerBug3 = { | ||
{ | ||
{"Banana", 3}, | ||
{"Chorizo", 2}, | ||
{"Sweet Herba Mystica", 1}, | ||
}, | ||
{ | ||
{"Egg Power", "Normal", 3}, | ||
{"Title Power: Normal", "Normal", 3}, | ||
{"Item Drop Power: Electric", "Normal", 3} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#pragma once | ||
|
||
#include "../recipe.hpp" | ||
|
||
Recipe EggPower1 = { | ||
{ | ||
{"Banana", 1}, | ||
{"Peanut Butter", 1}, | ||
}, | ||
{ | ||
{"Egg Power", "Normal", 1}, | ||
{"Item Drop Power: Electric", "Normal", 1}, | ||
{"Raid Power: Bug", "Normal", 1} | ||
} | ||
}; | ||
|
||
Recipe EggPower2 = { | ||
{ | ||
{"Banana", 1}, | ||
{"Peanut Butter", 1}, | ||
{"Butter", 1}, | ||
}, | ||
{ | ||
{"Egg Power", "Normal", 2}, | ||
{"Raid Power: Electric", "Normal", 1}, | ||
{"Exp. Point Power: Normal", "Normal", 1} | ||
} | ||
}; | ||
|
||
Recipe EggPower3 = { | ||
{ | ||
{"Banana", 3}, | ||
{"Chorizo", 2}, | ||
{"Sweet Herba Mystica", 1}, | ||
}, | ||
{ | ||
{"Egg Power", "Normal", 3}, | ||
{"Title Power: Normal", "Normal", 3}, | ||
{"Item Drop Power: Electric", "Normal", 3} | ||
} | ||
}; | ||
|
||
Recipe CatchingPower1 = { | ||
{ | ||
{"Banana", 3}, | ||
{"Chorizo", 2}, | ||
{"Sweet Herba Mystica", 1}, | ||
}, | ||
{ | ||
{"Egg Power", "Normal", 3}, | ||
{"Title Power: Normal", "Normal", 3}, | ||
{"Item Drop Power: Electric", "Normal", 3} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#pragma once | ||
|
||
#include "../../components/button.hpp" | ||
#include "../../models/powers/catchingPower.hpp" | ||
#include "../recipe-view.hpp" | ||
#include <tesla.hpp> | ||
|
||
class CatchingPower1View : public tsl::Gui { | ||
public: | ||
CatchingPower1View(const std::string &power) : power(power) { } | ||
|
||
virtual tsl::elm::Element *createUI() override { | ||
auto frame = new tsl::elm::OverlayFrame(power, "Lv.1"); | ||
auto list = new tsl::elm::List(); | ||
|
||
list->addItem(new tsl::elm::CategoryHeader("Type")); | ||
|
||
list->addItem(new RecipeViewButton("Bug", "Bug", CatchingPowerBug1)); | ||
/*list->addItem(new RecipeViewButton("Dark", "Dark", CatchingPowerDark1)); | ||
list->addItem(new RecipeViewButton("Dragon", "Dragon", CatchingPowerDragon1)); | ||
list->addItem(new RecipeViewButton("Electric", "Electric", CatchingPowerElectric1)); | ||
list->addItem(new RecipeViewButton("Fairy", "Fairy", CatchingPowerFairy1)); | ||
list->addItem(new RecipeViewButton("Fighting", "Fighting", CatchingPowerFighting1)); | ||
list->addItem(new RecipeViewButton("Fire", "Fire", CatchingPowerFire1)); | ||
list->addItem(new RecipeViewButton("Flying", "Flying", CatchingPowerFlying1)); | ||
list->addItem(new RecipeViewButton("Ghost", "Ghost", CatchingPowerGhost1)); | ||
list->addItem(new RecipeViewButton("Grass", "Grass", CatchingPowerGrass1)); | ||
list->addItem(new RecipeViewButton("Ground", "Ground", CatchingPowerGround1)); | ||
list->addItem(new RecipeViewButton("Ice", "Ice", CatchingPowerIce1)); | ||
list->addItem(new RecipeViewButton("Normal", "Normal", CatchingPowerCatchingPowerNormal1)); | ||
list->addItem(new RecipeViewButton("Psychic", "Psychic", CatchingPowerPsychic1)); | ||
list->addItem(new RecipeViewButton("Rock", "Rock", CatchingPowerRock1)); | ||
list->addItem(new RecipeViewButton("Steel", "Steel", CatchingPowerSteel1)); | ||
list->addItem(new RecipeViewButton("Water", "Water", CatchingPowerWater1));*/ | ||
|
||
frame->setContent(list); | ||
|
||
return frame; | ||
} | ||
|
||
private: | ||
std::string power; | ||
|
||
/*Recipe generateRecipeName(const std::string& powerName, const std::string& type, int level) { | ||
const std::string name = powerName + type + std::to_string(level); | ||
// populate the vector with the recipe | ||
// based on the powerName, type, and level | ||
return name; | ||
}*/ | ||
}; | ||
|
||
class CatchingPower1Button : public Button { | ||
public: | ||
CatchingPower1Button(const std::string &power, const std::string &level) | ||
: Button(level), power(power) { | ||
this->onClick([this]() { tsl::changeTo<CatchingPower1View>(this->power); }); | ||
} | ||
|
||
private: | ||
std::string power; | ||
std::string level; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#pragma once | ||
|
||
#include "../../components/button.hpp" | ||
#include "../../models/powers/eggPower.hpp" | ||
#include "./catchingPower1-view.hpp" | ||
#include "../recipe-view.hpp" | ||
#include <tesla.hpp> | ||
|
||
class EffectsView : public tsl::Gui { | ||
public: | ||
EffectsView() { } | ||
|
||
virtual tsl::elm::Element *createUI() override { | ||
auto frame = new tsl::elm::OverlayFrame("Effects", "by Power"); | ||
auto list = new tsl::elm::List(); | ||
|
||
list->addItem(new tsl::elm::CategoryHeader("Egg Power")); | ||
list->addItem(new RecipeViewButton("Lv.1", "Egg Power Lv.1", EggPower1)); | ||
list->addItem(new RecipeViewButton("Lv.2", "Egg Power Lv.2", EggPower2)); | ||
list->addItem(new RecipeViewButton("Lv.3", "Egg Power Lv.3", EggPower3)); | ||
|
||
/*list->addItem(new tsl::elm::CategoryHeader("Catching Power")); | ||
list->addItem(new CatchingPower1Button("Catching Power", "Lv.1")); | ||
list->addItem(new CatchingPower2Button("Catching Power", "Lv.2")); | ||
list->addItem(new CatchingPower3Button("Catching Power", "Lv.3"));*/ | ||
|
||
frame->setContent(list); | ||
|
||
return frame; | ||
} | ||
|
||
}; | ||
|
||
class EffectsViewButton : public Button { | ||
public: | ||
EffectsViewButton() : Button("Effects") { this->onClick(tsl::changeTo<EffectsView>); } | ||
}; |