Added rudimentary menu buttons, not yet connected to anything... it feels a bit hackish, to be honest, but I don't think we'll ever have too many to worry about, and if so, we can think about refactoring then

This commit is contained in:
2011-07-02 17:34:11 -04:00
parent c1ea399448
commit d04cde49c8
5 changed files with 144 additions and 2 deletions

16
game.h
View File

@ -9,6 +9,7 @@
#include "gamedata.h"
#include "gamestate.h"
#include "menubutton.h"
#include <stack>
#include <SDL_ttf.h>
@ -31,19 +32,30 @@ class Game : public GameState
void on_lbutton_down(int x, int y);
void on_rbutton_down(int mX, int mY);
void on_key_down(SDLKey sym, SDLMod mod, Uint16 unicode);
void on_mouse_move(int mX, int mY, int relX, int relY, bool left,
bool right, bool middle);
private:
void draw_stats(Vertex* v);
void draw_button(MenuButton* button);
// data
GameData data;
static int NODE_RADIUS;
// the x,y position of the mouse cursor
int cursor_x;
int cursor_y;
// surfaces containing textures to draw
SDL_Surface* background;
TTF_Font* font;
// menu buttons
MenuButton move_button;
MenuButton build_button;
MenuButton attack_button;
static int NODE_RADIUS;
#ifdef DEBUG
void print_debug_info();
#endif