From 0f7927ab8aadc2c6f42c70d2809b357efc4ddb2f Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sat, 19 Mar 2005 00:03:33 +0000 Subject: Added handling of window close button. --- ChangeLog | 8 ++++---- src/being.cpp | 4 ++-- src/game.cpp | 7 +++++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index e7a662bc..821a7b43 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,9 @@ 0.0.11 (.... 2005) - Fixed get item button and chatWindow: Enter (de)focuses chat window - Added walking with mouse by clicking where you want to go +- Added diagonal walking with keyboard - Added a choice dialog of how many items to drop +- Added handling of window close button - Chat now appears in a window - Beings now walk a lot smoother - More complete support for new map format (collision, compression) @@ -37,12 +39,11 @@ 0.0.8 (30 Oct 2004) - Added sound support for macosx - Added primitive inventory -- Added action failed messages for all skills and known reasons - (0x0110 handled) +- Added action failed messages for all skills and known reasons (R 0x0110) - Added sit capability with the right level - Added "dead" message and restart packet - Added skill dialog -- Added skill update (0x0141 handled) +- Added skill update (R 0x0141) - Added colored text for damage - Added monster death animation - Added icon to win32 executable @@ -59,7 +60,6 @@ - Added 2xSaI engine - Added patch client v0.1 to Win32 version - 0.0.7e (31 Aug 2004) - Tons of bugfixes & improvements (again) - MacOS X support diff --git a/src/being.cpp b/src/being.cpp index 93496ea6..a02ad79f 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -160,12 +160,12 @@ void Being::nextStep() if (newX > oldX) { if (newY > oldY) direction = SE; else if (newY < oldY) direction = NE; - else direction = EAST; + else direction = EAST; } else if (newX < oldX) { if (newY > oldY) direction = SW; else if (newY < oldY) direction = NW; - else direction = WEST; + else direction = WEST; } else { if (newY > oldY) direction = SOUTH; diff --git a/src/game.cpp b/src/game.cpp index 2c0b4f72..e7eebbe6 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -339,8 +339,7 @@ void do_input() } } } // End key down - - if (event.type == SDL_MOUSEBUTTONDOWN) + else if (event.type == SDL_MOUSEBUTTONDOWN) { int mx = event.button.x / 32 + camera_x; int my = event.button.y / 32 + camera_y; @@ -364,6 +363,10 @@ void do_input() } } } + else if (event.type == SDL_QUIT) + { + state = EXIT; + } // Push input to GUI when not used if (!used) { -- cgit v1.2.3-70-g09d2