Menu framework in place
This commit is contained in:
+21
-4
@@ -12,6 +12,9 @@ Lobby::Lobby() {
|
||||
#ifdef DEBUG
|
||||
cout << "entering Lobby" << endl;
|
||||
#endif
|
||||
refreshButton.Setup(50, 50, surfaceMgr->Get("button"), surfaceMgr->Get("font"), "Refresh");
|
||||
joinButton.Setup(50, 100, surfaceMgr->Get("button"), surfaceMgr->Get("font"), "Join");
|
||||
backButton.Setup(50, 150, surfaceMgr->Get("button"), surfaceMgr->Get("font"), "Back");
|
||||
}
|
||||
|
||||
Lobby::~Lobby() {
|
||||
@@ -37,7 +40,9 @@ void Lobby::FrameEnd() {
|
||||
}
|
||||
|
||||
void Lobby::Render(SDL_Surface* const screen) {
|
||||
//
|
||||
refreshButton.DrawTo(screen);
|
||||
joinButton.DrawTo(screen);
|
||||
backButton.DrawTo(screen);
|
||||
}
|
||||
|
||||
//-------------------------
|
||||
@@ -45,15 +50,27 @@ void Lobby::Render(SDL_Surface* const screen) {
|
||||
//-------------------------
|
||||
|
||||
void Lobby::MouseMotion(SDL_MouseMotionEvent const& motion) {
|
||||
//
|
||||
refreshButton.MouseMotion(motion);
|
||||
joinButton.MouseMotion(motion);
|
||||
backButton.MouseMotion(motion);
|
||||
}
|
||||
|
||||
void Lobby::MouseButtonDown(SDL_MouseButtonEvent const& button) {
|
||||
//
|
||||
refreshButton.MouseButtonDown(button);
|
||||
joinButton.MouseButtonDown(button);
|
||||
backButton.MouseButtonDown(button);
|
||||
}
|
||||
|
||||
void Lobby::MouseButtonUp(SDL_MouseButtonEvent const& button) {
|
||||
//
|
||||
if (refreshButton.MouseButtonUp(button) == Button::State::HOVER) {
|
||||
//ping the server
|
||||
}
|
||||
if (joinButton.MouseButtonUp(button) == Button::State::HOVER) {
|
||||
//join a server
|
||||
}
|
||||
if (backButton.MouseButtonUp(button) == Button::State::HOVER) {
|
||||
QuitEvent();
|
||||
}
|
||||
}
|
||||
|
||||
void Lobby::KeyDown(SDL_KeyboardEvent const& key) {
|
||||
|
||||
Reference in New Issue
Block a user