--- /dev/null
+#include "CapsuleFeedMenu.h"
+
+#include "CapsuleMenu.h"
+#include "Resources.h"
+#include "../app/Application.h"
+#include "../app/Input.h"
+#include "../common/Inventory.h"
+#include "../common/Item.h"
+#include "../common/GameConfig.h"
+#include "../common/GameState.h"
+#include "../graphics/Font.h"
+#include "../graphics/Frame.h"
+
+using app::Input;
+using common::Capsule;
+using common::Inventory;
+using common::Item;
+using geometry::Vector;
+using graphics::Font;
+using graphics::Frame;
+
+namespace menu {
+
+CapsuleFeedMenu::CapsuleFeedMenu(CapsuleMenu *parent)
+: parent(parent)
+, menu(*parent->Res().capsuleFeedMenuProperties)
+, itemMenu(*parent->Res().inventoryMenuProperties) {
+ menu.Add(parent->Res().itemMenuSelectText, CHOICE_SELECT);
+ menu.Add(parent->Res().itemMenuSortText, CHOICE_SORT);
+ LoadInventory();
+}
+
+
+void CapsuleFeedMenu::OnEnterState(SDL_Surface *) {
+ menu.SetSelected();
+ itemMenu.SetActive();
+}
+
+void CapsuleFeedMenu::LoadInventory() {
+ const Inventory &inv(parent->Game().state->inventory);
+ itemMenu.Clear();
+ itemMenu.Reserve(inv.MaxItems());
+ for (int i(0); i < inv.MaxItems(); ++i) {
+ const Item *item(inv.ItemAt(i));
+ if (item) {
+ // TODO: find out which items are impossible to feed to a capsule
+ itemMenu.Add(item->Name(), item, true, item->MenuIcon(), inv.ItemCountAt(i));
+ } else {
+ itemMenu.AddEmptyEntry();
+ }
+ }
+}
+
+void CapsuleFeedMenu::OnExitState(SDL_Surface *) {
+
+}
+
+void CapsuleFeedMenu::OnResumeState(SDL_Surface *) {
+
+}
+
+void CapsuleFeedMenu::OnPauseState(SDL_Surface *) {
+
+}
+
+
+void CapsuleFeedMenu::OnResize(int width, int height) {
+
+}
+
+
+void CapsuleFeedMenu::HandleEvents(const Input &input) {
+ if (menu.IsActive()) {
+ if (input.JustPressed(Input::PAD_LEFT)) {
+ menu.PreviousItem();
+ }
+ if (input.JustPressed(Input::PAD_RIGHT)) {
+ menu.NextItem();
+ }
+ } else {
+ if (input.JustPressed(Input::PAD_UP)) {
+ itemMenu.PreviousItem();
+ }
+ if (input.JustPressed(Input::PAD_DOWN)) {
+ itemMenu.NextItem();
+ }
+ }
+
+ if (input.JustPressed(Input::ACTION_A)) {
+ if (menu.IsActive()) {
+ if (menu.Selected() == CHOICE_SORT) {
+ parent->Game().state->inventory.Sort();
+ LoadInventory();
+ } else {
+ menu.SetSelected();
+ itemMenu.SetActive();
+ }
+ } else if (itemMenu.IsActive()) {
+ itemMenu.SetDualSelection();
+ } else if (itemMenu.SelectedIndex() == itemMenu.SecondaryIndex()) {
+ switch (menu.Selected()) {
+ case CHOICE_SELECT:
+ if (true /* can feed */) {
+ // TODO: implement capsule feeding
+ }
+ itemMenu.SetActive();
+ break;
+ case CHOICE_SORT:
+ // invalid state, recover
+ menu.SetActive();
+ itemMenu.SetInactive();
+ break;
+ }
+ } else {
+ parent->Game().state->inventory.SwapEntriesAt(
+ itemMenu.SelectedIndex(),
+ itemMenu.SecondaryIndex());
+ itemMenu.SwapSelected();
+ itemMenu.SetActive();
+ }
+ }
+ if (input.JustPressed(Input::ACTION_B)) {
+ if (menu.IsActive()) {
+ Ctrl().PopState();
+ } else if (itemMenu.IsActive()) {
+ menu.SetActive();
+ itemMenu.SetInactive();
+ } else {
+ itemMenu.SetActive();
+ }
+ }
+}
+
+void CapsuleFeedMenu::UpdateWorld(float deltaT) {
+
+}
+
+void CapsuleFeedMenu::Render(SDL_Surface *screen) {
+ const Font &font(*parent->Res().statusFont);
+ const Vector<int> offset((screen->w - Width()) / 2, (screen->h - Height()) / 2);
+ const Vector<int> nameOffset(
+ font.CharWidth(),
+ 2 * font.CharHeight() - font.CharHeight() / 8);
+ const Vector<int> spriteOffset(
+ 3 * font.CharWidth() + font.CharWidth() * 3 / 4,
+ 4 * font.CharHeight() + font.CharHeight() / 4);
+ const Vector<int> hungerOffset(
+ 13 * font.CharWidth(),
+ 9 * font.CharHeight() + font.CharHeight() / 8);
+ const Vector<int> menuOffset(
+ font.CharWidth(),
+ 13 * font.CharHeight() + font.CharHeight() / 8);
+ const Vector<int> itemsOffset(
+ font.CharWidth(),
+ 16 * font.CharHeight() + font.CharHeight() / 8);
+
+ parent->RenderBackground(screen);
+ RenderName(screen, offset + nameOffset);
+ RenderSprite(screen, offset + spriteOffset);
+ RenderHunger(screen, offset + hungerOffset);
+ RenderMenu(screen, offset + menuOffset);
+ RenderItems(screen, offset + itemsOffset);
+}
+
+void CapsuleFeedMenu::RenderName(SDL_Surface *screen, const Vector<int> &offset) const {
+ const Font &font(*parent->Res().statusFont);
+ const Vector<int> separatorOffset(5 * font.CharWidth(), 0);
+ const Vector<int> nameOffset(6 * font.CharWidth(), 0);
+
+ font.DrawString(parent->Res().capsuleNameLabel, screen, offset, 5);
+ font.DrawChar(':', screen, offset + separatorOffset);
+ font.DrawString(GetCapsule().Name(), screen, offset + nameOffset);
+}
+
+void CapsuleFeedMenu::RenderSprite(SDL_Surface *screen, const Vector<int> &offset) const {
+ // TODO: sitting ground
+ GetCapsule().BattleSprite()->Draw(screen, offset);
+}
+
+void CapsuleFeedMenu::RenderHunger(SDL_Surface *screen, const Vector<int> &offset) const {
+ const Font &font(*parent->Res().normalFont);
+ const Frame &frame(*parent->Res().statusFrame);
+ const Vector<int> textOffset(2 * font.CharWidth(), font.CharHeight());
+
+ frame.Draw(screen, offset, 18 * font.CharWidth(), 3 * font.CharHeight());
+ font.DrawString(parent->Res().capsuleNotHungryText, screen, offset + textOffset, 15);
+}
+
+void CapsuleFeedMenu::RenderMenu(SDL_Surface *screen, const Vector<int> &offset) const {
+ const Font &font(*parent->Res().normalFont);
+ const Frame &frame(*parent->Res().statusFrame);
+ const Vector<int> labelOffset(2 * font.CharWidth(), font.CharHeight());
+ const Vector<int> menubgOffset(8 * font.CharWidth(), 0);
+ const Vector<int> menuOffset(11 * font.CharWidth(), font.CharHeight());
+
+ frame.Draw(screen, offset, 8 * font.CharWidth(), 3 * font.CharHeight());
+ font.DrawString(parent->Res().capsuleFeedLabel, screen, offset + labelOffset);
+ frame.Draw(screen, offset + menubgOffset, 22 * font.CharWidth(), 3 * font.CharHeight());
+ menu.Draw(screen, offset + menuOffset);
+}
+
+void CapsuleFeedMenu::RenderItems(SDL_Surface *screen, const Vector<int> &offset) const {
+ const Font &font(*parent->Res().normalFont);
+ const Frame &frame(*parent->Res().statusFrame);
+ const Vector<int> menuOffset(3 * font.CharWidth(), font.CharHeight() * 5 / 4);
+
+ frame.Draw(screen, offset, 30 * font.CharWidth(), 11 * font.CharHeight());
+ itemMenu.Draw(screen, offset + menuOffset);
+}
+
+
+int CapsuleFeedMenu::Width() const {
+ return parent->Width();
+}
+
+int CapsuleFeedMenu::Height() const {
+ return parent->Height();
+}
+
+const Capsule &CapsuleFeedMenu::GetCapsule() const {
+ return parent->GetCapsule();
+}
+
+}
--- /dev/null
+#ifndef MENU_CAPSULEFEEDMENU_H_
+#define MENU_CAPSULEFEEDMENU_H_
+
+#include "fwd.h"
+#include "../app/State.h"
+#include "../common/fwd.h"
+#include "../geometry/Vector.h"
+#include "../graphics/Menu.h"
+
+namespace menu {
+
+class CapsuleMenu;
+
+class CapsuleFeedMenu
+: public app::State {
+
+public:
+ explicit CapsuleFeedMenu(CapsuleMenu *parent);
+
+public:
+ virtual void HandleEvents(const app::Input &);
+ virtual void UpdateWorld(float deltaT);
+ virtual void Render(SDL_Surface *);
+
+public:
+ int Width() const;
+ int Height() const;
+
+private:
+ virtual void OnEnterState(SDL_Surface *screen);
+ virtual void OnExitState(SDL_Surface *screen);
+ virtual void OnResumeState(SDL_Surface *screen);
+ virtual void OnPauseState(SDL_Surface *screen);
+
+ virtual void OnResize(int width, int height);
+
+ const common::Capsule &GetCapsule() const;
+
+ void LoadInventory();
+
+ void RenderName(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
+ void RenderSprite(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
+ void RenderHunger(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
+ void RenderMenu(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
+ void RenderItems(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
+
+private:
+ CapsuleMenu *parent;
+ enum Choice {
+ CHOICE_SELECT,
+ CHOICE_SORT,
+ };
+ graphics::Menu<Choice> menu;
+ graphics::Menu<const common::Item *> itemMenu;
+
+};
+
+}
+
+#endif /* MENU_CAPSULEFEEDMENU_H_ */
#include "CapsuleMenu.h"
+#include "CapsuleFeedMenu.h"
#include "PartyMenu.h"
#include "Resources.h"
#include "../app/Application.h"
CapsuleMenu::CapsuleMenu(PartyMenu *parent)
: parent(parent)
-, menu(*parent->Res().capsuleMenuProperties) {
- menu.Add(parent->Res().capsuleFeedLabel, 0);
- menu.Add(parent->Res().capsuleChangeLabel, 1);
- menu.Add(parent->Res().capsuleNameLabel, 2);
+, menu(*Res().capsuleMenuProperties) {
+ menu.Add(Res().capsuleFeedLabel, CHOICE_FEED);
+ menu.Add(Res().capsuleChangeLabel, CHOICE_CHANGE);
+ menu.Add(Res().capsuleNameLabel, CHOICE_NAME);
}
}
void CapsuleMenu::OnResumeState(SDL_Surface *) {
-
+ menu.SetActive();
}
void CapsuleMenu::OnPauseState(SDL_Surface *) {
menu.NextItem();
}
- if (input.JustPressed(Input::ACTION_B)) {
+ if (input.JustPressed(Input::ACTION_A)) {
+ switch (menu.Selected()) {
+ case CHOICE_FEED:
+ Ctrl().PushState(new CapsuleFeedMenu(this));
+ menu.SetSelected();
+ break;
+ case CHOICE_CHANGE:
+ // push change menu
+ menu.SetSelected();
+ break;
+ case CHOICE_NAME:
+ // push name menu
+ menu.SetSelected();
+ break;
+ }
+ } else if (input.JustPressed(Input::ACTION_B)) {
Ctrl().PopState();
}
}
}
void CapsuleMenu::Render(SDL_Surface *screen) {
- const Font &font(*parent->Res().statusFont);
+ const Font &font(*Res().statusFont);
const Vector<int> offset((screen->w - Width()) / 2, (screen->h - Height()) / 2);
const Vector<int> capsuleOffset(
6 * font.CharWidth(),
}
void CapsuleMenu::RenderBackground(SDL_Surface *screen) const {
- parent->Res().capsulebg->Render(screen, Vector<int>(), Vector<int>(screen->w, screen->h));
+ Res().capsulebg->Render(screen, Vector<int>(), Vector<int>(screen->w, screen->h));
}
void CapsuleMenu::RenderCapsule(SDL_Surface *screen, const Vector<int> &offset) const {
void CapsuleMenu::RenderInfo(SDL_Surface *screen, const Vector<int> &offset) const {
const Capsule &capsule(GetCapsule());
- const Font &font(*parent->Res().statusFont);
+ const Font &font(*Res().statusFont);
const Vector<int> delimiterOffset(5 * font.CharWidth(), 0);
const Vector<int> valueOffset(6 * font.CharWidth(), 0);
const Vector<int> lineBreak(0, font.CharHeight() + font.CharHeight() / 2);
Vector<int> lineHead(offset);
- font.DrawString(parent->Res().capsuleNameLabel, screen, lineHead, 5);
+ font.DrawString(Res().capsuleNameLabel, screen, lineHead, 5);
font.DrawChar(':', screen, lineHead + delimiterOffset);
font.DrawString(capsule.Name(), screen, lineHead + valueOffset);
lineHead += lineBreak;
- font.DrawString(parent->Res().capsuleClassLabel, screen, lineHead, 5);
+ font.DrawString(Res().capsuleClassLabel, screen, lineHead, 5);
font.DrawChar(':', screen, lineHead + delimiterOffset);
font.DrawString(capsule.ClassName(), screen, lineHead + valueOffset);
lineHead += lineBreak;
- font.DrawString(parent->Res().capsuleAlignmentLabel, screen, lineHead, 5);
+ font.DrawString(Res().capsuleAlignmentLabel, screen, lineHead, 5);
font.DrawChar(':', screen, lineHead + delimiterOffset);
font.DrawString(capsule.Alignment(), screen, lineHead + valueOffset);
lineHead += lineBreak;
- font.DrawString(parent->Res().capsuleTribeLabel, screen, lineHead, 5);
+ font.DrawString(Res().capsuleTribeLabel, screen, lineHead, 5);
font.DrawChar(':', screen, lineHead + delimiterOffset);
font.DrawString(capsule.Tribe(), screen, lineHead + valueOffset);
lineHead += lineBreak;
- font.DrawString(parent->Res().capsuleAttack1Label, screen, lineHead, 5);
+ font.DrawString(Res().capsuleAttack1Label, screen, lineHead, 5);
font.DrawChar(':', screen, lineHead + delimiterOffset);
if (capsule.Attack1()) {
font.DrawString(capsule.Attack1()->Name(), screen, lineHead + valueOffset);
} else {
- font.DrawString(parent->Res().capsuleNoAttackText, screen, lineHead + valueOffset);
+ font.DrawString(Res().capsuleNoAttackText, screen, lineHead + valueOffset);
}
lineHead += lineBreak;
- font.DrawString(parent->Res().capsuleAttack1Label, screen, lineHead, 5);
+ font.DrawString(Res().capsuleAttack1Label, screen, lineHead, 5);
font.DrawChar(':', screen, lineHead + delimiterOffset);
if (capsule.Attack2()) {
font.DrawString(capsule.Attack2()->Name(), screen, lineHead + valueOffset);
} else {
- font.DrawString(parent->Res().capsuleNoAttackText, screen, lineHead + valueOffset);
+ font.DrawString(Res().capsuleNoAttackText, screen, lineHead + valueOffset);
}
lineHead += lineBreak;
- font.DrawString(parent->Res().capsuleAttack1Label, screen, lineHead, 5);
+ font.DrawString(Res().capsuleAttack1Label, screen, lineHead, 5);
font.DrawChar(':', screen, lineHead + delimiterOffset);
if (capsule.Attack3()) {
font.DrawString(capsule.Attack3()->Name(), screen, lineHead + valueOffset);
} else {
- font.DrawString(parent->Res().capsuleNoAttackText, screen, lineHead + valueOffset);
+ font.DrawString(Res().capsuleNoAttackText, screen, lineHead + valueOffset);
}
}
void CapsuleMenu::RenderStats(SDL_Surface *screen, const Vector<int> &offset) const {
const Capsule &capsule(GetCapsule());
Stats stats(capsule.GetStats());
- const Font &font(*parent->Res().statusFont);
+ const Font &font(*Res().statusFont);
const Vector<int> lineBreak(0, font.CharHeight());
Vector<int> lineHead(offset);
- RenderStatsLine(screen, lineHead, parent->Res().hpLabel, capsule.MaxHealth());
+ RenderStatsLine(screen, lineHead, Res().hpLabel, capsule.MaxHealth());
lineHead += lineBreak;
- RenderStatsLine(screen, lineHead, parent->Res().atpLabel, stats.Attack());
+ RenderStatsLine(screen, lineHead, Res().atpLabel, stats.Attack());
lineHead += lineBreak;
- RenderStatsLine(screen, lineHead, parent->Res().dfpLabel, stats.Defense());
+ RenderStatsLine(screen, lineHead, Res().dfpLabel, stats.Defense());
lineHead += lineBreak;
- RenderStatsLine(screen, lineHead, parent->Res().strLabel, stats.Strength());
+ RenderStatsLine(screen, lineHead, Res().strLabel, stats.Strength());
lineHead += lineBreak;
- RenderStatsLine(screen, lineHead, parent->Res().aglLabel, stats.Agility());
+ RenderStatsLine(screen, lineHead, Res().aglLabel, stats.Agility());
lineHead += lineBreak;
- RenderStatsLine(screen, lineHead, parent->Res().intLabel, stats.Intelligence());
+ RenderStatsLine(screen, lineHead, Res().intLabel, stats.Intelligence());
lineHead += lineBreak;
- RenderStatsLine(screen, lineHead, parent->Res().gutLabel, stats.Gut());
+ RenderStatsLine(screen, lineHead, Res().gutLabel, stats.Gut());
lineHead += lineBreak;
- RenderStatsLine(screen, lineHead, parent->Res().mgrLabel, stats.MagicResistance());
+ RenderStatsLine(screen, lineHead, Res().mgrLabel, stats.MagicResistance());
lineHead = offset + Vector<int>(18 * font.CharWidth(), 0);
- font.DrawStringRight(parent->Res().levelLabel, screen, lineHead);
+ font.DrawStringRight(Res().levelLabel, screen, lineHead);
lineHead += lineBreak;
font.DrawNumberRight(capsule.Level(), screen, lineHead);
lineHead += 2 * lineBreak;
- font.DrawStringRight(parent->Res().experienceLabel, screen, lineHead);
+ font.DrawStringRight(Res().experienceLabel, screen, lineHead);
lineHead += lineBreak;
font.DrawNumberRight(capsule.Experience(), screen, lineHead);
lineHead += 2 * lineBreak;
- font.DrawStringRight(parent->Res().nextLevelLabel, screen, lineHead);
+ font.DrawStringRight(Res().nextLevelLabel, screen, lineHead);
lineHead += lineBreak;
font.DrawNumberRight(capsule.NextLevel(), screen, lineHead);
}
void CapsuleMenu::RenderStatsLine(SDL_Surface *screen, const geometry::Vector<int> &offset, const char *name, int value) const {
- const Font &font(*parent->Res().statusFont);
+ const Font &font(*Res().statusFont);
const Vector<int> numberOffset(4 * font.CharWidth(), 0);
font.DrawString(name, screen, offset, 4);
}
void CapsuleMenu::RenderMenu(SDL_Surface *screen, const Vector<int> &offset) const {
- const Font &font(*parent->Res().normalFont);
- const Frame &frame(*parent->Res().statusFrame);
+ const Font &font(*Res().normalFont);
+ const Frame &frame(*Res().statusFrame);
const Vector<int> menuOffset(3 * font.CharWidth(), font.CharHeight());
frame.Draw(screen, offset, 30 * font.CharWidth(), 3 * font.CharHeight());
menu.Draw(screen, offset + menuOffset);
}
+
+common::GameConfig &CapsuleMenu::Game() {
+ return parent->Game();
+}
+
+const common::GameConfig &CapsuleMenu::Game() const {
+ return parent->Game();
+}
+
+Resources &CapsuleMenu::Res() {
+ return parent->Res();
+}
+
+const Resources &CapsuleMenu::Res() const {
+ return parent->Res();
+}
+
+
int CapsuleMenu::Width() const {
return parent->Width();
}
}
const Capsule &CapsuleMenu::GetCapsule() const {
- return *parent->Game().state->capsule;
+ return *Game().state->capsule;
}
}
virtual void UpdateWorld(float deltaT);
virtual void Render(SDL_Surface *);
+ void RenderBackground(SDL_Surface *screen) const;
+ void RenderCapsule(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
+ void RenderInfo(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
+ void RenderWheel(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
+ void RenderStats(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
+ void RenderStatsLine(SDL_Surface *screen, const geometry::Vector<int> &offset, const char *name, int value) const;
+ void RenderMenu(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
+
public:
+ common::GameConfig &Game();
+ const common::GameConfig &Game() const;
+ Resources &Res();
+ const Resources &Res() const;
+ const common::Capsule &GetCapsule() const;
+
int Width() const;
int Height() const;
virtual void OnResize(int width, int height);
- const common::Capsule &GetCapsule() const;
-
- void RenderBackground(SDL_Surface *screen) const;
- void RenderCapsule(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
- void RenderInfo(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
- void RenderWheel(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
- void RenderStats(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
- void RenderStatsLine(SDL_Surface *screen, const geometry::Vector<int> &offset, const char *name, int value) const;
- void RenderMenu(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
-
private:
PartyMenu *parent;
- graphics::Menu<int> menu;
+ enum Choice {
+ CHOICE_FEED,
+ CHOICE_CHANGE,
+ CHOICE_NAME,
+ };
+ graphics::Menu<Choice> menu;
};
, itemMenuUseText(0)
, itemMenuSortText(0)
, itemMenuDropText(0)
+, itemMenuSelectText(0)
, inventoryMenuProperties(0)
, capsulebg(0)
, capsuleMenuProperties(0)
+, capsuleFeedMenuProperties(0)
, capsuleFeedLabel(0)
, capsuleChangeLabel(0)
, capsuleAttack2Label(0)
, capsuleAttack3Label(0)
, capsuleNoAttackText(0)
+, capsuleNotHungryText(0)
{ }
td.AddField("itemMenuUseText", FieldDescription(((char *)&r.itemMenuUseText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
td.AddField("itemMenuSortText", FieldDescription(((char *)&r.itemMenuSortText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
td.AddField("itemMenuDropText", FieldDescription(((char *)&r.itemMenuDropText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
+ td.AddField("itemMenuSelectText", FieldDescription(((char *)&r.itemMenuSelectText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
td.AddField("inventoryMenu", FieldDescription(((char *)&r.inventoryMenuProperties) - ((char *)&r), MenuProperties::TYPE_ID).SetReferenced().SetDescription("properties of the inventory menu"));
td.AddField("spellMenu", FieldDescription(((char *)&r.spellMenuProperties) - ((char *)&r), MenuProperties::TYPE_ID).SetReferenced().SetDescription("properties of the spell menu"));
td.AddField("capsulebg", FieldDescription(((char *)&r.capsulebg) - ((char *)&r), Texture::TYPE_ID).SetReferenced().SetDescription("background texture for the capsule menus"));
td.AddField("capsuleMenu", FieldDescription(((char *)&r.capsuleMenuProperties) - ((char *)&r), MenuProperties::TYPE_ID).SetReferenced().SetDescription("properties of the capsule main menu (the bottom bar)"));
+ td.AddField("capsuleFeedMenu", FieldDescription(((char *)&r.capsuleFeedMenuProperties) - ((char *)&r), MenuProperties::TYPE_ID).SetReferenced().SetDescription("properties of the capsule feed menu (above the inventory)"));
td.AddField("capsuleFeedLabel", FieldDescription(((char *)&r.capsuleFeedLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
td.AddField("capsuleChangeLabel", FieldDescription(((char *)&r.capsuleChangeLabel) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
td.AddField("capsuleAttack2Label", FieldDescription(((char *)&r.capsuleAttack2Label) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
td.AddField("capsuleAttack3Label", FieldDescription(((char *)&r.capsuleAttack3Label) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
td.AddField("capsuleNoAttackText", FieldDescription(((char *)&r.capsuleNoAttackText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
+ td.AddField("capsuleNotHungryText", FieldDescription(((char *)&r.capsuleNotHungryText) - ((char *)&r), Interpreter::STRING_ID).SetReferenced());
}
void Resources::Construct(void *data) {
const char *itemMenuUseText;
const char *itemMenuSortText;
const char *itemMenuDropText;
+ const char *itemMenuSelectText;
graphics::MenuProperties *inventoryMenuProperties;
graphics::Texture *capsulebg;
graphics::MenuProperties *capsuleMenuProperties;
+ graphics::MenuProperties *capsuleFeedMenuProperties;
const char *capsuleFeedLabel;
const char *capsuleChangeLabel;
const char *capsuleAttack2Label;
const char *capsuleAttack3Label;
const char *capsuleNoAttackText;
+ const char *capsuleNotHungryText;
Resources();
namespace menu {
+class CapsuleFeedMenu;
class CapsuleMenu;
class ChangeHero;
class ConfigMenu;
itemMenuUseText: "USE",
itemMenuSortText: "SORT",
itemMenuDropText: "DROP",
+ itemMenuSelectText: "SELECT",
inventoryMenu: MenuProperties {
cols: 1,
rows: 6,
font: menuFont,
thirdColumnHack: 2
},
+ capsuleFeedMenu: MenuProperties {
+ cols: 2,
+ rows: 1,
+ charsPerEntry: 7,
+ colGap: 32,
+ cursor: menuCursor,
+ selectedCursor: menuActiveCursor,
+ font: menuFont
+ },
capsuleFeedLabel: "FEED",
capsuleChangeLabel: "CHANGE",
capsuleNameLabel: "NAME",
capsuleAttack1Label: "SP.1",
capsuleAttack2Label: "SP.2",
capsuleAttack3Label: "SP.3",
- capsuleNoAttackText: "Nothing"
+ capsuleNoAttackText: "Nothing",
+ capsuleNotHungryText: "I'm not hungry."
}