diff options
| author | oy <Tom_Adams@web.de> | 2011-07-03 00:36:07 +0200 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2011-07-03 00:36:07 +0200 |
| commit | 7648ba30246ca8a692c27328145225535b8f300e (patch) | |
| tree | 041882dd4a3605f5031b27dee22b08d7463bbb8c /src/game/client | |
| parent | 6b4080aee8b19fe6d3aba5b716d6287d51e369fd (diff) | |
| download | zcatch-7648ba30246ca8a692c27328145225535b8f300e.tar.gz zcatch-7648ba30246ca8a692c27328145225535b8f300e.zip | |
added a different mouse sens for menus/editor
Diffstat (limited to 'src/game/client')
| -rw-r--r-- | src/game/client/components/emoticon.cpp | 1 | ||||
| -rw-r--r-- | src/game/client/components/menus.cpp | 1 | ||||
| -rw-r--r-- | src/game/client/components/spectator.cpp | 1 | ||||
| -rw-r--r-- | src/game/client/ui.cpp | 7 | ||||
| -rw-r--r-- | src/game/client/ui.h | 1 |
5 files changed, 11 insertions, 0 deletions
diff --git a/src/game/client/components/emoticon.cpp b/src/game/client/components/emoticon.cpp index 741a604f..bedfaafb 100644 --- a/src/game/client/components/emoticon.cpp +++ b/src/game/client/components/emoticon.cpp @@ -54,6 +54,7 @@ bool CEmoticon::OnMouseMove(float x, float y) if(!m_Active) return false; + UI()->ConvertMouseMove(&x, &y); m_SelectorMouse += vec2(x,y); return true; } diff --git a/src/game/client/components/menus.cpp b/src/game/client/components/menus.cpp index 9826d863..4f3d2da7 100644 --- a/src/game/client/components/menus.cpp +++ b/src/game/client/components/menus.cpp @@ -1348,6 +1348,7 @@ bool CMenus::OnMouseMove(float x, float y) if(!m_MenuActive) return false; + UI()->ConvertMouseMove(&x, &y); m_MousePos.x += x; m_MousePos.y += y; if(m_MousePos.x < 0) m_MousePos.x = 0; diff --git a/src/game/client/components/spectator.cpp b/src/game/client/components/spectator.cpp index e98df118..c69a7669 100644 --- a/src/game/client/components/spectator.cpp +++ b/src/game/client/components/spectator.cpp @@ -139,6 +139,7 @@ bool CSpectator::OnMouseMove(float x, float y) if(!m_Active) return false; + UI()->ConvertMouseMove(&x, &y); m_SelectorMouse += vec2(x,y); return true; } diff --git a/src/game/client/ui.cpp b/src/game/client/ui.cpp index 2161bc77..00a30c15 100644 --- a/src/game/client/ui.cpp +++ b/src/game/client/ui.cpp @@ -53,6 +53,13 @@ int CUI::MouseInside(const CUIRect *r) return 0; } +void CUI::ConvertMouseMove(float *x, float *y) +{ + float Fac = (float)(g_Config.m_UiMousesens)/g_Config.m_InpMousesens; + *x = *x*Fac; + *y = *y*Fac; +} + CUIRect *CUI::Screen() { float Aspect = Graphics()->ScreenAspect(); diff --git a/src/game/client/ui.h b/src/game/client/ui.h index 017abf7c..7cd78d6f 100644 --- a/src/game/client/ui.h +++ b/src/game/client/ui.h @@ -79,6 +79,7 @@ public: const void *LastActiveItem() const { return m_pLastActiveItem; } int MouseInside(const CUIRect *pRect); + void ConvertMouseMove(float *x, float *y); CUIRect *Screen(); void ClipEnable(const CUIRect *pRect); |