Skip to content

Commit

Permalink
feat: add EffectsView + Egg Power Recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
Insektaure committed Jul 4, 2024
1 parent 155d8a5 commit 061d9de
Show file tree
Hide file tree
Showing 7 changed files with 206 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ include $(DEVKITPRO)/libnx/switch_rules
# NACP building is skipped as well.
#---------------------------------------------------------------------------------
APP_TITLE := pkDwich
APP_VERSION := 1.0.1
APP_VERSION := 1.0.2

TARGET := $(notdir $(CURDIR))
BUILD := build
Expand Down
42 changes: 42 additions & 0 deletions source/models/powers/catchingPower.hpp
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}
}
};
54 changes: 54 additions & 0 deletions source/models/powers/eggPower.hpp
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}
}
};
7 changes: 6 additions & 1 deletion source/views/main-view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "./sv/monotypeSalty-view.hpp"
#include "./sv/monotypeAlt-view.hpp"
#include "./sv/effects-view.hpp"
#include <tesla.hpp>

class pkDwich : public tsl::Gui {
Expand All @@ -10,14 +11,18 @@ class pkDwich : public tsl::Gui {

virtual tsl::elm::Element* createUI() override {

auto frame = new tsl::elm::OverlayFrame("pkDwich", "v1.0.1");
auto frame = new tsl::elm::OverlayFrame("pkDwich", "v1.0.2");
auto list = new tsl::elm::List();

list->addItem(new tsl::elm::CategoryHeader("Recipes"));

list->addItem(new MonotypeViewButton());
list->addItem(new MonotypeAltViewButton());

list->addItem(new tsl::elm::CategoryHeader("Effects"));

list->addItem(new EffectsViewButton());

frame->setContent(list);

return frame;
Expand Down
1 change: 0 additions & 1 deletion source/views/recipe-view.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma once

#include "../components/button.hpp"
#include "../models/monotypeSalty.hpp"
#include <functional>
#include <tesla.hpp>

Expand Down
66 changes: 66 additions & 0 deletions source/views/sv/catchingPower1-view.hpp
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;
};
37 changes: 37 additions & 0 deletions source/views/sv/effects-view.hpp
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>); }
};

0 comments on commit 061d9de

Please sign in to comment.