heroesLayout->CalculatePositions(background->w, background->h, heroesPositions);
attackChoices.resize(heroes.size());
for (vector<Hero>::size_type i(0), end(heroes.size()); i < end; ++i) {
- // TODO: extract menu dimensions to resources
- Menu</* Spell */ void *> spellMenu(res->normalFont, 12, 6, 8, 2, 32);
- spellMenu.Add("Strong : 3", 0);
- spellMenu.Add("Stronger : 8", 0);
- spellMenu.Add("Champion :16", 0);
- spellMenu.Add("Rally :10", 0);
- spellMenu.Add("Valor :30", 0);
- spellMenus.push_back(spellMenu);
+ spellMenus.push_back(res->spellMenuPrototype);
+ // TODO: insert real spell menu entries
+ spellMenus.back().Add("Reset : 0", 0);
+ spellMenus.back().Add("Strong : 3", 0);
+ spellMenus.back().Add("Stronger : 8", 0);
+ spellMenus.back().Add("Champion :16", 0);
+ spellMenus.back().Add("Rally :10", 0);
+ spellMenus.back().Add("Valor :30", 0);
+ spellMenus.back().Add("Poison : 2", 0);
+ spellMenus.back().Add("Release : 2", 0);
+ spellMenus.back().Add("Waken : 4", 0);
+ spellMenus.back().Add("Fake : 4", 0);
+ spellMenus.back().Add("Trick : 5", 0);
heroTags.push_back(HeroTag(&heroes[i], &attackChoices[i], res, HeroTag::Alignment((i + 1) % 2)));
}
}
class Sprite;
+// TODO: disabled entries + alternate font for those
+// TODO: sprite for the cursor
+// TODO: animation when top row changes
template<class T>
class Menu {
public:
- Menu(const Font *font, int charsPerEntry, int rows, int rowGap = 0, int cols = 1, int colGap = 0);
+ explicit Menu(const Font *font = NULL, int charsPerEntry = 16, int rows = 1, int rowGap = 0, int cols = 1, int colGap = 0);
public:
int Width() const;
#include "graphics/Font.h"
#include "graphics/Frame.h"
#include "graphics/Gauge.h"
+#include "graphics/Menu.h"
#include "graphics/Sprite.h"
#include "sdl/InitImage.h"
#include "sdl/InitScreen.h"
using graphics::Font;
using graphics::Frame;
using graphics::Gauge;
+using graphics::Menu;
using graphics::Sprite;
using sdl::InitImage;
using sdl::InitScreen;
normalFont.MapChar('?', 10, 0);
battleRes.normalFont = &normalFont;
+ battleRes.spellMenuPrototype = Menu</* Spell */ void *>(&normalFont, 12, 6, 8, 2, 32);
+
BattleState *battleState(new BattleState(bg, monstersLayout, heroesLayout, &battleRes));
battleState->AddMonster(monster);
battleState->AddMonster(monster);