Removed ESC key exit, and tweaked some comments

This commit is contained in:
Kayne Ruse
2014-06-15 22:24:50 +10:00
parent 61848db65b
commit 5c74ecdd72
18 changed files with 33 additions and 103 deletions
+3 -10
View File
@@ -123,7 +123,7 @@ void InCombat::Render(SDL_Surface* const screen) {
void InCombat::QuitEvent() {
//exit the game AND the server
RequestDisconnect();
SetNextScene(SceneList::MAINMENU);
SetNextScene(SceneList::QUIT);
}
void InCombat::MouseMotion(SDL_MouseMotionEvent const& motion) {
@@ -139,11 +139,7 @@ void InCombat::MouseButtonUp(SDL_MouseButtonEvent const& button) {
}
void InCombat::KeyDown(SDL_KeyboardEvent const& key) {
switch(key.keysym.sym) {
case SDLK_ESCAPE:
QuitEvent();
break;
}
//
}
void InCombat::KeyUp(SDL_KeyboardEvent const& key) {
@@ -201,10 +197,7 @@ void InCombat::SendPlayerUpdate() {
// newPacket.motion = localCharacter->motion;
// newPacket.stats = localCharacter->stats;
//TODO: equipment
//TODO: items
//TODO: buffs
//TODO: debuffs
//TODO: gameplay components: equipment, items, buffs, debuffs
network.SendTo(Channels::SERVER, &newPacket);
}
+3 -11
View File
@@ -135,7 +135,7 @@ void InWorld::Render(SDL_Surface* const screen) {
//draw characters
for (auto& it : characterMap) {
//TODO: drawing order according to Y origin
//BUG: #29 drawing order according to Y origin
it.second.DrawTo(screen, camera.x, camera.y);
}
@@ -152,7 +152,7 @@ void InWorld::Render(SDL_Surface* const screen) {
void InWorld::QuitEvent() {
//exit the game AND the server
RequestDisconnect();
SetNextScene(SceneList::MAINMENU);
SetNextScene(SceneList::QUIT);
}
void InWorld::MouseMotion(SDL_MouseMotionEvent const& motion) {
@@ -176,11 +176,6 @@ void InWorld::MouseButtonUp(SDL_MouseButtonEvent const& button) {
void InWorld::KeyDown(SDL_KeyboardEvent const& key) {
switch(key.keysym.sym) {
case SDLK_ESCAPE: {
QuitEvent();
}
break;
//player movement
case SDLK_LEFT:
if (localCharacter) {
@@ -386,10 +381,7 @@ void InWorld::SendPlayerUpdate() {
newPacket.motion = localCharacter->motion;
newPacket.stats = localCharacter->stats;
//TODO: equipment
//TODO: items
//TODO: buffs
//TODO: debuffs
//TODO: gameplay components: equipment, items, buffs, debuffs
network.SendTo(Channels::SERVER, &newPacket);
}
+4 -5
View File
@@ -69,6 +69,9 @@ LobbyMenu::LobbyMenu(
//set the server list's position
listBox = {300, 50, 200, font.GetCharH()};
//BUGFIX: Eat incoming packets
while(network.Receive());
}
LobbyMenu::~LobbyMenu() {
@@ -187,11 +190,7 @@ void LobbyMenu::MouseButtonUp(SDL_MouseButtonEvent const& button) {
}
void LobbyMenu::KeyDown(SDL_KeyboardEvent const& key) {
switch(key.keysym.sym) {
case SDLK_ESCAPE:
SetNextScene(SceneList::MAINMENU);
break;
}
//
}
void LobbyMenu::KeyUp(SDL_KeyboardEvent const& key) {
+1 -5
View File
@@ -113,11 +113,7 @@ void MainMenu::MouseButtonUp(SDL_MouseButtonEvent const& button) {
}
void MainMenu::KeyDown(SDL_KeyboardEvent const& key) {
switch(key.keysym.sym) {
case SDLK_ESCAPE:
QuitEvent();
break;
}
//
}
void MainMenu::KeyUp(SDL_KeyboardEvent const& key) {
+1 -5
View File
@@ -90,11 +90,7 @@ void OptionsMenu::MouseButtonUp(SDL_MouseButtonEvent const& button) {
}
void OptionsMenu::KeyDown(SDL_KeyboardEvent const& key) {
switch(key.keysym.sym) {
case SDLK_ESCAPE:
SetNextScene(SceneList::MAINMENU);
break;
}
//
}
void OptionsMenu::KeyUp(SDL_KeyboardEvent const& key) {
+5 -10
View File
@@ -90,9 +90,8 @@ void Restart::Update(double delta) {
QuitEvent();
}
while(network.Receive()) {
//EAT INCOMING PACKETS
}
//BUGFIX: Eat incoming packets
while(network.Receive());
}
void Restart::RenderFrame() {
@@ -112,7 +111,7 @@ void Restart::Render(SDL_Surface* const screen) {
//-------------------------
void Restart::QuitEvent() {
SetNextScene(SceneList::MAINMENU);
SetNextScene(SceneList::QUIT);
}
void Restart::MouseMotion(SDL_MouseMotionEvent const& motion) {
@@ -125,16 +124,12 @@ void Restart::MouseButtonDown(SDL_MouseButtonEvent const& button) {
void Restart::MouseButtonUp(SDL_MouseButtonEvent const& button) {
if (backButton.MouseButtonUp(button) == Button::State::HOVER) {
QuitEvent();
SetNextScene(SceneList::MAINMENU);
}
}
void Restart::KeyDown(SDL_KeyboardEvent const& key) {
switch(key.keysym.sym) {
case SDLK_ESCAPE:
QuitEvent();
break;
}
//
}
void Restart::KeyUp(SDL_KeyboardEvent const& key) {