[Orxonox-commit 1520] r6238 - in code/branches/presentation2/data/gui: layouts scripts

cmueri at orxonox.net cmueri at orxonox.net
Fri Dec 4 00:20:58 CET 2009


Author: cmueri
Date: 2009-12-04 00:20:57 +0100 (Fri, 04 Dec 2009)
New Revision: 6238

Modified:
   code/branches/presentation2/data/gui/layouts/GraphicsMenu.layout
   code/branches/presentation2/data/gui/layouts/MouseControlsMenu.layout
   code/branches/presentation2/data/gui/scripts/MouseControlsMenu.lua
Log:
The mouse controls menu has some new buttons and the sensitivity scrollbars are enabled.

Modified: code/branches/presentation2/data/gui/layouts/GraphicsMenu.layout
===================================================================
--- code/branches/presentation2/data/gui/layouts/GraphicsMenu.layout	2009-12-03 21:23:32 UTC (rev 6237)
+++ code/branches/presentation2/data/gui/layouts/GraphicsMenu.layout	2009-12-03 23:20:57 UTC (rev 6238)
@@ -76,7 +76,7 @@
             <Event Name="Clicked" Function="GraphicsMenu.GraphicsBackButton_clicked"/>
         </Window>
         <Window Type="TaharezLook/StaticText" Name="orxonox/GraphicsAvailable" >
-            <Property Name="Text" Value="Changes in graphics settings are not yet available." />
+            <Property Name="Text" Value="All the graphics functions are not yet available." />
             <Property Name="TextColours" Value="FFFF0000" />
             <Property Name="InheritsAlpha" Value="False" />
             <Property Name="HorzFormatting" Value="HorzCentred" />

Modified: code/branches/presentation2/data/gui/layouts/MouseControlsMenu.layout
===================================================================
--- code/branches/presentation2/data/gui/layouts/MouseControlsMenu.layout	2009-12-03 21:23:32 UTC (rev 6237)
+++ code/branches/presentation2/data/gui/layouts/MouseControlsMenu.layout	2009-12-03 23:20:57 UTC (rev 6238)
@@ -15,14 +15,14 @@
             <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
             <Property Name="VertFormatting" Value="TopAligned" />
             <Property Name="UnifiedAreaRect" Value="{{0.25,0},{0.325,0},{0.75,0},{0.6,0}}" />
-            <Window Type="TaharezLook/StaticText" Name="orxonox/MouseSensitivity" >
-                <Property Name="Text" Value="Mouse sensitivity" />
+            <Window Type="TaharezLook/StaticText" Name="orxonox/MouseNormalSensitivity" >
+                <Property Name="Text" Value="Sensitivity (normal mode)                                      " />
                 <Property Name="InheritsAlpha" Value="False" />
                 <Property Name="HorzFormatting" Value="HorzCentred" />
                 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                 <Property Name="VertFormatting" Value="TopAligned" />
                 <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.2,0},{0.95,0},{0.45,0}}" />
-                <Window Type="TaharezLook/HorizontalScrollbar" Name="orxonox/MouseScrollbar" >
+                <Window Type="TaharezLook/HorizontalScrollbar" Name="orxonox/MouseNormalScrollbar" >
                     <Property Name="PageSize" Value="0" />
                     <Property Name="StepSize" Value="1" />
                     <Property Name="OverlapSize" Value="0" />
@@ -30,32 +30,51 @@
                     <Property Name="ScrollPosition" Value="0" />
                     <Property Name="StepSize" Value="0.1" />
                     <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
-                    <Property Name="UnifiedAreaRect" Value="{{0.02,0},{0.6,0},{0.98,0},{0.8,0}}" />
-                    <Event Name="ThumbTrackStarted" Function="MouseControlsMenu.MouseControlsMouseScrollbar_started" />
-                    <Event Name="ThumbTrackEnded" Function="MouseControlsMenu.MouseControlsMouseScrollbar_ended" />
-                    <Event Name="ScrollPosChanged" Function="MouseControlsMenu.MouseControlsMouseScrollbar_changed" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.02,0},{0.6,0},{0.565,0},{0.8,0}}" />
+                    <Event Name="ThumbTrackStarted" Function="MouseControlsMenu.MouseControlsMouseNormalScrollbar_started" />
+                    <Event Name="ThumbTrackEnded" Function="MouseControlsMenu.MouseControlsMouseNormalScrollbar_ended" />
+                    <Event Name="ScrollPosChanged" Function="MouseControlsMenu.MouseControlsMouseNormalScrollbar_changed" />
                 </Window>
+                <Window Type="TaharezLook/RadioButton" Name="orxonox/MouseNormalButton" >
+                    <Property Name="Text" Value="Normal mouse input" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.61,0},{0.5,0},{0.975,0},{0.85,0}}" />
+                    <Event Name="SelectStateChanged" Function="MouseControlsMenu.MouseNormalButton_clicked" />
+                </Window>
             </Window>
-            <Window Type="TaharezLook/StaticText" Name="orxonox/MouseControlMode" >
-                <Property Name="Text" Value="Mouse control mode" />
+            <Window Type="TaharezLook/StaticText" Name="orxonox/MouseDeriveSensitivity" >
+                <Property Name="Text" Value="Sensitivity (derive mode)                                      " />
                 <Property Name="InheritsAlpha" Value="False" />
                 <Property Name="HorzFormatting" Value="HorzCentred" />
                 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                 <Property Name="VertFormatting" Value="TopAligned" />
-                <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.55,0},{0.95,0},{0.9,0}}" />
-                <Window Type="TaharezLook/RadioButton" Name="orxonox/MouseControlButton1" >
-                    <Property Name="Text" Value="Default control mode" />
+                <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.55,0},{0.95,0},{0.8,0}}" />
+                <Window Type="TaharezLook/HorizontalScrollbar" Name="orxonox/MouseDeriveScrollbar" >
+                    <Property Name="PageSize" Value="0" />
+                    <Property Name="StepSize" Value="1" />
+                    <Property Name="OverlapSize" Value="0" />
+                    <Property Name="DocumentSize" Value="1" />
+                    <Property Name="ScrollPosition" Value="0" />
+                    <Property Name="StepSize" Value="0.1" />
                     <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
-                    <Property Name="UnifiedAreaRect" Value="{{0.03,0},{0.6,0},{0.47,0},{0.8,0}}" />
-                    <Event Name="SelectStateChanged" Function="MouseControlsMenu.MouseControlsDefaultButton_clicked" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.02,0},{0.6,0},{0.565,0},{0.8,0}}" />
+                    <Event Name="ThumbTrackStarted" Function="MouseControlsMenu.MouseControlsMouseDeriveScrollbar_started" />
+                    <Event Name="ThumbTrackEnded" Function="MouseControlsMenu.MouseControlsMouseDeriveScrollbar_ended" />
+                    <Event Name="ScrollPosChanged" Function="MouseControlsMenu.MouseControlsMouseDeriveScrollbar_changed" />
                 </Window>
-                <Window Type="TaharezLook/RadioButton" Name="orxonox/MouseControlButton2" >
-                    <Property Name="Text" Value=".............................................." />
+                <Window Type="TaharezLook/RadioButton" Name="orxonox/MouseDeriveButton" >
+                    <Property Name="Text" Value="Derive mouse input" />
                     <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
-                    <Property Name="UnifiedAreaRect" Value="{{0.53,0},{0.6,0},{0.97,0},{0.8,0}}" />
-                    <Event Name="SelectStateChanged" Function="MouseControlsMenu.MouseControls_______Button_clicked" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.61,0},{0.5,0},{0.975,0},{0.85,0}}" />
+                    <Event Name="SelectStateChanged" Function="MouseControlsMenu.MouseDeriveButton_clicked" />
                 </Window>
             </Window>
+            <Window Type="TaharezLook/Checkbox" Name="orxonox/MouseInvertCheckbox" >
+                <Property Name="Text" Value="Invert mouse" />
+                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.39,0},{0.85,0},{0.61,0},{0.95,0}}" />
+                <Event Name="CheckStateChanged" Function="MouseControlsMenu.MouseInvertCheckbox_clicked" />
+            </Window>
         </Window>
         <Window Type="TaharezLook/Button" Name="orxonox/MouseControlsBackButton" >
             <Property Name="Text" Value="Back" />
@@ -64,7 +83,7 @@
             <Event Name="Clicked" Function="MouseControlsMenu.MouseControlsBackButton_clicked"/>
         </Window>
         <Window Type="TaharezLook/StaticText" Name="orxonox/MouseControlsAvailable" >
-            <Property Name="Text" Value="Changes in mouse controls settings are not yet available." />
+            <Property Name="Text" Value="The button functions are not yet available." />
             <Property Name="TextColours" Value="FFFF0000" />
             <Property Name="InheritsAlpha" Value="False" />
             <Property Name="HorzFormatting" Value="HorzCentred" />

Modified: code/branches/presentation2/data/gui/scripts/MouseControlsMenu.lua
===================================================================
--- code/branches/presentation2/data/gui/scripts/MouseControlsMenu.lua	2009-12-03 21:23:32 UTC (rev 6237)
+++ code/branches/presentation2/data/gui/scripts/MouseControlsMenu.lua	2009-12-03 23:20:57 UTC (rev 6238)
@@ -11,35 +11,100 @@
 P.filename = "MouseControlsMenu"
 P.layoutString = "MouseControlsMenu.layout"
 
-local scrollbar_active = false
+function P:init()
+    block = false
+    mousenormalscrollbarwindow = tolua.cast(winMgr:getWindow("orxonox/MouseNormalScrollbar"),"CEGUI::Scrollbar")
+    mousederivescrollbarwindow = tolua.cast(winMgr:getWindow("orxonox/MouseDeriveScrollbar"),"CEGUI::Scrollbar")
+    normalwindow = tolua.cast(winMgr:getWindow("orxonox/MouseNormalButton"),"CEGUI::RadioButton")
+    derivewindow = tolua.cast(winMgr:getWindow("orxonox/MouseDeriveButton"),"CEGUI::RadioButton")
+    invertwindow = tolua.cast(winMgr:getWindow("orxonox/MouseInvertCheckbox"),"CEGUI::Checkbox")
+    mousenormalscrollbar_active = false
+    mousederivescrollbar_active = false
+    derive_active = orxonox.getConfig("KeyBinder","bDeriveMouseInput_")
+    invert_active = false
+    mousenormalsensitivity = orxonox.getConfig("KeyBinder","mouseSensitivity_")
+    mousederivesensitivity = orxonox.getConfig("KeyBinder","mouseSensitivityDerived_")
+    mousenormalscrollbarwindow:setScrollPosition((math.log(14*mousenormalsensitivity-6))/(6*math.log(2)))
+    mousederivescrollbarwindow:setScrollPosition((math.log(14*mousederivesensitivity-6))/(6*math.log(2)))
+    if derive_active == "true" then
+        normal_active = false
+        derive_active = true
+        derivewindow:setSelected(derive_active)
+    else
+        normal_active = true
+        derive_active = false
+        normalwindow:setSelected(normal_active)
+    end
+    if invert_active == "true" then
+        invert_active = true
+    else
+        invert_active = false
+    end
+end
 
-function P.MouseControlsMouseScrollbar_changed(e)
-    if scrollbar_active == false then
-        -- mouse sensitivity
-        debug("event: mouse sensitivity")
+function P.MouseControlsMouseNormalScrollbar_changed(e)
+    if mousenormalscrollbar_active == false then
+        scrollposition = mousenormalscrollbarwindow:getScrollPosition()
+        mousenormalsensitivity = (math.pow(64,scrollposition)+6)/14
+        orxonox.CommandExecutor:execute("config KeyBinder mouseSensitivity_ " .. mousenormalsensitivity)
     end
 end
 
-function P.MouseControlsMouseScrollbar_started(e)
-    scrollbar_active = true
+function P.MouseControlsMouseNormalScrollbar_started(e)
+    mousenormalscrollbar_active = true
 end
 
-function P.MouseControlsMouseScrollbar_ended(e)
-    -- mouse sensitivity
-    debug("event: mouse sensitivity")
-    scrollbar_active = false
+function P.MouseControlsMouseNormalScrollbar_ended(e)
+    scrollposition = mousenormalscrollbarwindow:getScrollPosition()
+    mousenormalsensitivity = (math.pow(64,scrollposition)+6)/14
+    orxonox.CommandExecutor:execute("config KeyBinder mouseSensitivity_ " .. mousenormalsensitivity)
+    mousenormalscrollbar_active = false
 end
 
-function P.MouseControlsDefaultButton_clicked(e)
-    -- default control mode
-    debug("event: default control mode")
+function P.MouseControlsMouseDeriveScrollbar_changed(e)
+    if mousederivescrollbar_active == false then
+        scrollposition = mousederivescrollbarwindow:getScrollPosition()
+        mousederivesensitivity = (math.pow(64,scrollposition)+6)/14
+        orxonox.CommandExecutor:execute("config KeyBinder mouseSensitivityDerived_ " .. mousederivesensitivity)
+    end
 end
 
-function P.MouseControls_______Button_clicked(e)
-    -- .......
-    debug("event: .......")
+function P.MouseControlsMouseDeriveScrollbar_started(e)
+    mousederivescrollbar_active = true
 end
 
+function P.MouseControlsMouseDeriveScrollbar_ended(e)
+    scrollposition = mousederivescrollbarwindow:getScrollPosition()
+    mousederivesensitivity = (math.pow(64,scrollposition)+6)/14
+    orxonox.CommandExecutor:execute("config KeyBinder mouseSensitivityDerived_ " .. mousederivesensitivity)
+    mousederivescrollbar_active = false
+end
+
+function P.MouseNormalButton_clicked(e)
+    if block == false then
+        block = true
+        derivewindow:setSelected(false)
+        block = false
+        -- normal mouse input
+        debug("event: normal mouse input")
+    end
+end
+
+function P.MouseDeriveButton_clicked(e)
+    if block == false then
+        block = true
+        normalwindow:setSelected(false)
+        block = false
+        -- derive mouse input
+        debug("event: derive mouse input")
+    end
+end
+
+function P.MouseInvertCheckbox_clicked(e)
+    -- invert mouse
+    debug("event: invert mouse")
+end
+
 function P.MouseControlsBackButton_clicked(e)
     hideGUI(P.filename)
 end




More information about the Orxonox-commit mailing list