Mercurial > sumwars
changeset 2720:ec0676c7fb57
Merged in vyproyects/sumwars-code-vyproyects (pull request #4)
refs #92:Change of Show item labels action. Now by pressing Alt key, by default, show item labels will be enabled/disabled
author | Stefan Stammberger <some.fusion@gmail.com> |
---|---|
date | Sun, 08 Jun 2014 10:33:19 +0200 |
parents | a70d8076c08b (current diff) bdc7974dbcf8 (diff) |
children | df5c37505a63 fcdd285aeed8 a7fe24cf22be c1ca5c8146ab |
files | |
diffstat | 5 files changed, 17 insertions(+), 27 deletions(-) [+] |
line wrap: on
line diff
--- a/src/core/document.cpp Sun Jun 08 10:14:14 2014 +0200 +++ b/src/core/document.cpp Sun Jun 08 10:33:19 2014 +0200 @@ -1423,7 +1423,7 @@ } else if (dest == SHOW_ITEMLABELS) { - getGUIState()->m_item_labels = true; + getGUIState()->m_item_labels = !getGUIState()->m_item_labels; } else if (dest >=USE_POTION && dest < USE_POTION+10) { @@ -1555,20 +1555,8 @@ bool Document::onKeyRelease(KeyCode key) { - if (m_gui_state.m_pressed_key != 0) - { - m_gui_state.m_pressed_key = 0; - } - - ShortkeyDestination dest = Options::getInstance()->getMappedDestination(key); - if (dest != 0) - { - if (dest == SHOW_ITEMLABELS) - { - getGUIState()->m_item_labels = false; - } - } - return true; + //Currently there's no key that needs to be treated at release action. + return true; } void Document::update(float time)
--- a/src/core/document.h Sun Jun 08 10:14:14 2014 +0200 +++ b/src/core/document.h Sun Jun 08 10:33:19 2014 +0200 @@ -653,7 +653,7 @@ /** * \fn bool onKeyRelease(KeyCode key) - * \brief Behandelt loslassen einer Taste + * \brief Treats and releases a key */ bool onKeyRelease(KeyCode key);
--- a/src/gui/ceguiutility.cpp Sun Jun 08 10:14:14 2014 +0200 +++ b/src/gui/ceguiutility.cpp Sun Jun 08 10:33:19 2014 +0200 @@ -773,7 +773,7 @@ return injectKeyUp (CEGUI::System::getSingletonPtr(), myKey); } - +//Alerts CEGUI about a keyup action and the key itself bool CEGUIUtility::injectKeyUp (CEGUI::System* sys, OIS::KeyCode myKey) { if (!sys)
--- a/src/gui/mainwindow.cpp Sun Jun 08 10:14:14 2014 +0200 +++ b/src/gui/mainwindow.cpp Sun Jun 08 10:33:19 2014 +0200 @@ -2855,17 +2855,19 @@ bool MainWindow::keyReleased(const OIS::KeyEvent &evt) { - + //Current key is cleared m_key =0; m_key_repeat = false; bool ret = CEGUIUtility::injectKeyUp (m_cegui_system, evt.key); + //Check if releasing key is hold player key. if (evt.key == OIS::KC_RSHIFT || evt.key == OIS::KC_LSHIFT) { m_document->getGUIState()->m_shift_hold = false; } + //Treats release action if (!ret) { ret = m_document->onKeyRelease(evt.key);
--- a/src/gui/mainwindow.h Sun Jun 08 10:14:14 2014 +0200 +++ b/src/gui/mainwindow.h Sun Jun 08 10:33:19 2014 +0200 @@ -18,15 +18,15 @@ #define __SUMWARS_GUI_MAINWINDOW_H__ -// Utility for CEGUI cross-version compatibility -#include "ceguiutility.h" +// Utility for CEGUI cross-version compatibility +#include "ceguiutility.h" // needed to be able to create the CEGUI renderer interface -#ifdef CEGUI_07 -#include "CEGUI/RendererModules/Ogre/CEGUIOgreRenderer.h" -#else -#include "CEGUI/RendererModules/Ogre/Renderer.h" -#endif +#ifdef CEGUI_07 +#include "CEGUI/RendererModules/Ogre/CEGUIOgreRenderer.h" +#else +#include "CEGUI/RendererModules/Ogre/Renderer.h" +#endif // CEGUI includes @@ -325,7 +325,7 @@ /** * \fn bool keyReleased(const OIS::KeyEvent &evt) - * \brief Behandelt Loslassen von Tasten auf der Tastatur + * \brief Treats keyboard's keys when released */ bool keyReleased(const OIS::KeyEvent &evt); @@ -478,7 +478,7 @@ /** * \var unsigned int m_key - * \brief gedrueckte Taste + * \brief Pressed key */ unsigned int m_key;