Reviewing the progress so far

This commit is contained in:
Kayne Ruse
2013-06-05 03:50:46 +10:00
parent 0cfb47e641
commit dfac9c1518
3 changed files with 10 additions and 5 deletions
+4 -3
View File
@@ -122,6 +122,7 @@ void Lobby::Render(SDL_Surface* const screen) {
//if a server has been selected, and this is the selected server
if (selectedServer && selectedServer == &serverVector[i]) {
//draw the orange box
SDL_FillRect(screen, &clip, SDL_MapRGB(screen->format, 255, 127, 39));
}
font.DrawStringTo(serverVector[i].name, screen, clip.x, clip.y);
@@ -148,14 +149,14 @@ void Lobby::MouseButtonUp(SDL_MouseButtonEvent const& button) {
if (buttonMap["ping"]->MouseButtonUp(button) == Button::State::HOVER) {
PingNetwork();
}
if (buttonMap["join"]->MouseButtonUp(button) == Button::State::HOVER) {
else if (buttonMap["join"]->MouseButtonUp(button) == Button::State::HOVER) {
JoinRequest(selectedServer);
}
if (buttonMap["back"]->MouseButtonUp(button) == Button::State::HOVER) {
else if (buttonMap["back"]->MouseButtonUp(button) == Button::State::HOVER) {
SetNextScene(SceneList::MAINMENU);
}
//select a server (clicked within the bounds of the server box)
if (button.x > listBox.x && button.y > listBox.y && button.y < serverVector.size() * font.GetCharH() + listBox.y) {
else if (button.x > listBox.x && button.y > listBox.y && button.y < serverVector.size() * font.GetCharH() + listBox.y) {
selectedServer = &serverVector[(button.y-listBox.y)/font.GetCharH()];
}
else {