summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-10-10 17:19:42 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-10-10 17:19:42 +0000
commitb2c5d720fdf88e7e5e8ff6921e9d01cfe009a074 (patch)
tree55eb57830b45538ecdccd82769ddeba40e57be4e /src/game.cpp
parent61430703402d9f98fdf1a3f748df4f87586f73cb (diff)
downloadmana-b2c5d720fdf88e7e5e8ff6921e9d01cfe009a074.tar.gz
mana-b2c5d720fdf88e7e5e8ff6921e9d01cfe009a074.tar.bz2
mana-b2c5d720fdf88e7e5e8ff6921e9d01cfe009a074.tar.xz
mana-b2c5d720fdf88e7e5e8ff6921e9d01cfe009a074.zip
Introduced new window shortcuts and corrected position of job xp bar. Also
corrected strange commit by ElvenProgrammer.
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp127
1 files changed, 49 insertions, 78 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 8d5d0cf8..8c1eee60 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -470,43 +470,44 @@ void do_input()
// Keyboard events (for discontinuous keys)
if (event.type == SDL_KEYDOWN)
{
+ gcn::Window *requestedWindow = NULL;
+
switch (event.key.keysym.sym)
{
- // In-game Help
case SDLK_F1:
- if (helpWindow->isVisible()) {
+ // In-game Help
+ if (helpWindow->isVisible())
+ {
helpWindow->setVisible(false);
- } else {
+ }
+ else
+ {
helpWindow->loadHelp("index");
- if (helpWindow->isVisible()) helpWindow->requestMoveToTop();
+ helpWindow->requestMoveToTop();
}
used = true;
break;
- // Player sit action
- case SDLK_F5:
- if (!action_time) {
- break;
- }
-
- switch (player_node->action)
- {
- case Being::STAND:
- action(2, 0);
- break;
- case Being::SIT:
- action(3, 0);
- break;
- }
+ case SDLK_F2: requestedWindow = statusWindow; break;
+ case SDLK_F3: requestedWindow = inventoryWindow; break;
+ case SDLK_F4: requestedWindow = equipmentWindow; break;
+ case SDLK_F5: requestedWindow = skillDialog; break;
+ case SDLK_F6: requestedWindow = minimap; break;
+ case SDLK_F7: requestedWindow = chatWindow; break;
+ //case SDLK_F8: requestedWindow = buddyWindow; break;
+
+ case SDLK_F9:
+ // Setup window
+ setupWindow->setVisible(true);
+ setupWindow->requestMoveToTop();
+ used = true;
break;
- // Display path to mouse (debug purpose)
- case SDLK_F6:
- displayPathToMouse = !displayPathToMouse;
- break;
+ case SDLK_F10: requestedWindow = debugWindow; break;
+ //case SDLK_F11: requestedWindow = newSkillWindow; break;
- // Input chat window
case SDLK_RETURN:
+ // Input chat window
if (chatWindow->isFocused() ||
deathNotice != NULL ||
weightNotice != NULL)
@@ -592,62 +593,37 @@ void do_input()
break;
}
+ if (requestedWindow)
+ {
+ requestedWindow->setVisible(!requestedWindow->isVisible());
+ if (requestedWindow->isVisible())
+ {
+ requestedWindow->requestMoveToTop();
+ }
+ used = true;
+ }
+
// Keys pressed together with Alt/Meta
// Emotions and some internal gui windows
if (event.key.keysym.mod & KMOD_ALT)
{
- gcn::Window *requestedWindow = 0;
-
switch (event.key.keysym.sym)
{
- // Inventory window
- case SDLK_i:
- requestedWindow = inventoryWindow;
- break;
-
- // Statistics window
case SDLK_s:
- requestedWindow = statusWindow;
- break;
-
- // Skill window
- case SDLK_k:
- requestedWindow = skillDialog;
- break;
-
- // Equipment window
- case SDLK_e:
- requestedWindow = equipmentWindow;
- break;
-
- /*
- // Buddy window
- case SDLK_b:
- requestedWindow = buddyWindow;
- break;
- */
-
- /*
- // New skills window
- case SDLK_n:
- requestedWindow = newSkillWindow;
- break;
- */
-
- // Setup window
- case SDLK_c:
- setupWindow->setVisible(true);
- setupWindow->requestMoveToTop();
- used = true;
- break;
+ // Player sit action
+ if (!action_time) {
+ break;
+ }
- // Debug window
- case SDLK_d:
- requestedWindow = debugWindow;
+ switch (player_node->action)
+ {
+ case Being::STAND: action(2, 0); break;
+ case Being::SIT: action(3, 0); break;
+ }
break;
- // screenshot (picture, hence the p)
case SDLK_p:
+ // Screenshot (picture, hence the p)
{
SDL_Surface *screenshot = graphics->getScreenshot();
if (!saveScreenshot(screenshot))
@@ -660,16 +636,11 @@ void do_input()
default:
break;
- }
- if (requestedWindow)
- {
- requestedWindow->setVisible(!requestedWindow->isVisible());
- if (requestedWindow->isVisible())
- {
- requestedWindow->requestMoveToTop();
- }
- used = true;
+ case SDLK_f:
+ // Find path to mouse (debug purpose)
+ displayPathToMouse = !displayPathToMouse;
+ break;
}
// Emotions