]> git.localhorst.tv Git - l2e.git/blobdiff - src/menu/EquipMenu.h
started implementation of equipment menu
[l2e.git] / src / menu / EquipMenu.h
diff --git a/src/menu/EquipMenu.h b/src/menu/EquipMenu.h
new file mode 100644 (file)
index 0000000..39380dc
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * EquipMenu.h
+ *
+ *  Created on: Nov 18, 2012
+ *      Author: holy
+ */
+
+#ifndef MENU_EQUIPMENU_H_
+#define MENU_EQUIPMENU_H_
+
+#include "fwd.h"
+#include "../app/State.h"
+#include "../common/fwd.h"
+#include "../geometry/Vector.h"
+#include "../graphics/Menu.h"
+
+namespace menu {
+
+class EquipMenu
+: public app::State {
+
+public:
+       EquipMenu(PartyMenu *parent, int heroIndex);
+
+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);
+
+       void NextHero();
+       void PreviousHero();
+
+       const common::Hero &GetHero() const;
+
+       void LoadEquipment();
+
+       void RenderStatus(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
+       void RenderStats(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
+       void RenderStatsLine(const char *label, int number, SDL_Surface *screen, const geometry::Vector<int> &position) const;
+       void RenderEquipmentMenu(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
+       void RenderActionMenu(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
+       void RenderInventoryMenu(SDL_Surface *screen, const geometry::Vector<int> &offset) const;
+
+private:
+       PartyMenu *parent;
+       int cursor;
+       enum Choice {
+               CHOICE_EQUIP,
+               CHOICE_STRONGEST,
+               CHOICE_REMOVE,
+               CHOICE_REMOVE_ALL,
+               CHOICE_DROP,
+       };
+       graphics::Menu<Choice> actionMenu;
+       graphics::Menu<const common::Item *> equipmentMenu;
+       graphics::Menu<const common::Item *> inventoryMenu;
+
+};
+
+}
+
+#endif /* MENU_EQUIPMENU_H_ */