[Orxonox-commit 1942] r6659 - code/branches/gamestate/data/gui/scripts

rgrieder at orxonox.net rgrieder at orxonox.net
Tue Mar 30 16:34:02 CEST 2010


Author: rgrieder
Date: 2010-03-30 16:34:01 +0200 (Tue, 30 Mar 2010)
New Revision: 6659

Modified:
   code/branches/gamestate/data/gui/scripts/AudioMenu.lua
   code/branches/gamestate/data/gui/scripts/GameplayMenu.lua
   code/branches/gamestate/data/gui/scripts/GraphicsMenu.lua
   code/branches/gamestate/data/gui/scripts/KeyBindMenu.lua
   code/branches/gamestate/data/gui/scripts/MouseControlsMenu.lua
   code/branches/gamestate/data/gui/scripts/MultiplayerMenu.lua
   code/branches/gamestate/data/gui/scripts/PickupInventory.lua
   code/branches/gamestate/data/gui/scripts/QuestGUI.lua
   code/branches/gamestate/data/gui/scripts/SingleplayerMenu.lua
Log:
Use "P." instead of "P:" when using our sheets as objects, not classes.
And use "P." instead of "self.".
This does not count for BasicGUI.lua because this is in fact seen as a class!!!

Modified: code/branches/gamestate/data/gui/scripts/AudioMenu.lua
===================================================================
--- code/branches/gamestate/data/gui/scripts/AudioMenu.lua	2010-03-30 13:41:15 UTC (rev 6658)
+++ code/branches/gamestate/data/gui/scripts/AudioMenu.lua	2010-03-30 14:34:01 UTC (rev 6659)
@@ -2,7 +2,7 @@
 
 local P = createSheet("AudioMenu")
 
-function P:init()
+function P.init()
     soundMgr = orxonox.SoundManager:getInstance()
     block = false
     masterscrollbar_active = false

Modified: code/branches/gamestate/data/gui/scripts/GameplayMenu.lua
===================================================================
--- code/branches/gamestate/data/gui/scripts/GameplayMenu.lua	2010-03-30 13:41:15 UTC (rev 6658)
+++ code/branches/gamestate/data/gui/scripts/GameplayMenu.lua	2010-03-30 14:34:01 UTC (rev 6659)
@@ -2,7 +2,7 @@
 
 local P = createSheet("GameplayMenu")
 
-function P:init()
+function P.init()
     dropdown = winMgr:getWindow("orxonox/ThemeCombobox")
     local themeList = {}
     table.insert(themeList, "Theme 1")

Modified: code/branches/gamestate/data/gui/scripts/GraphicsMenu.lua
===================================================================
--- code/branches/gamestate/data/gui/scripts/GraphicsMenu.lua	2010-03-30 13:41:15 UTC (rev 6658)
+++ code/branches/gamestate/data/gui/scripts/GraphicsMenu.lua	2010-03-30 14:34:01 UTC (rev 6659)
@@ -2,7 +2,7 @@
 
 local P = createSheet("GraphicsMenu")
 
-function P:init()
+function P.init()
     block = true
     file = orxonox.PathConfig:getConfigPathString() .. orxonox.getConfig("GraphicsManager", "ogreConfigFile_")
     search_mode = 0

Modified: code/branches/gamestate/data/gui/scripts/KeyBindMenu.lua
===================================================================
--- code/branches/gamestate/data/gui/scripts/KeyBindMenu.lua	2010-03-30 13:41:15 UTC (rev 6658)
+++ code/branches/gamestate/data/gui/scripts/KeyBindMenu.lua	2010-03-30 14:34:01 UTC (rev 6659)
@@ -2,7 +2,7 @@
 
 local P = createSheet("KeyBindMenu")
 
-function P:init()
+function P.init()
 
     commandList = {}
     table.insert(commandList, "fire 0")

Modified: code/branches/gamestate/data/gui/scripts/MouseControlsMenu.lua
===================================================================
--- code/branches/gamestate/data/gui/scripts/MouseControlsMenu.lua	2010-03-30 13:41:15 UTC (rev 6658)
+++ code/branches/gamestate/data/gui/scripts/MouseControlsMenu.lua	2010-03-30 14:34:01 UTC (rev 6659)
@@ -2,7 +2,7 @@
 
 local P = createSheet("MouseControlsMenu")
 
-function P:init()
+function P.init()
     block = false
     mousenormalscrollbarwindow = tolua.cast(winMgr:getWindow("orxonox/MouseNormalScrollbar"),"CEGUI::Scrollbar")
     mousederivescrollbarwindow = tolua.cast(winMgr:getWindow("orxonox/MouseDeriveScrollbar"),"CEGUI::Scrollbar")

Modified: code/branches/gamestate/data/gui/scripts/MultiplayerMenu.lua
===================================================================
--- code/branches/gamestate/data/gui/scripts/MultiplayerMenu.lua	2010-03-30 13:41:15 UTC (rev 6658)
+++ code/branches/gamestate/data/gui/scripts/MultiplayerMenu.lua	2010-03-30 14:34:01 UTC (rev 6659)
@@ -2,7 +2,7 @@
 
 local P = createSheet("MultiplayerMenu")
 
-function P:init()
+function P.init()
     listbox = winMgr:getWindow("orxonox/MultiplayerLevelListbox")
     preselect = orxonox.LevelManager:getInstance():getDefaultLevel()
     orxonox.LevelManager:getInstance():compileAvailableLevelList()

Modified: code/branches/gamestate/data/gui/scripts/PickupInventory.lua
===================================================================
--- code/branches/gamestate/data/gui/scripts/PickupInventory.lua	2010-03-30 13:41:15 UTC (rev 6658)
+++ code/branches/gamestate/data/gui/scripts/PickupInventory.lua	2010-03-30 14:34:01 UTC (rev 6659)
@@ -7,12 +7,12 @@
 P.currentUsableID_ = 0
 
 -- events
-function P:frmUpdate(e)
+function P.frmUpdate(e)
     local equipCount = orxonox.PickupInventory:getEquipmentCount()
     local usableCount = orxonox.PickupInventory:getUsableCount()
 
-    if equipCount ~= self.lastEquipmentCount_ or usableCount ~= self.lastUsableCount_ then
-        self:updateTabs()
+    if equipCount ~= P.lastEquipmentCount_ or usableCount ~= P.lastUsableCount_ then
+        P.updateTabs()
     end
 end
 
@@ -24,7 +24,7 @@
     loadedGUIs["PickupInventory"]:mItemClicked(e)
 end
 
-function P:mItemClicked(e)
+function P.mItemClicked(e)
     local w = CEGUI.toWindowEventArgs(e).window
     local name = w:getName()
     local t = name:sub(25, 27)
@@ -35,25 +35,25 @@
     end
 
     if t == "use" then
-        if self.currentUsableID_ >= 0 then
-            winMgr:getWindow("orxonox/Inventory/Title/use/" .. self.currentUsableID_):setProperty("TextColours", "tl:FFFFFFFF tr:FFFFFFFF bl:FFFFFFFF br:FFFFFFFF")
+        if P.currentUsableID_ >= 0 then
+            winMgr:getWindow("orxonox/Inventory/Title/use/" .. P.currentUsableID_):setProperty("TextColours", "tl:FFFFFFFF tr:FFFFFFFF bl:FFFFFFFF br:FFFFFFFF")
         end
         orxonox.PickupInventory:selectUsable(tonumber(i))
-        self.currentUsableID_ = tonumber(i)
+        P.currentUsableID_ = tonumber(i)
         winMgr:getWindow("orxonox/Inventory/Title/use/" .. i):setProperty("TextColours", "tl:FFFF4444 tr:FFFF4444 bl:FFFF4444 br:FFFF4444")
     end
 end
 
 -- methods
-function P:updateTabs()
+function P.updateTabs()
     local eqWin = winMgr:getWindow("orxonox/Inventory/TabControl/TabEquipment")
     local usWin = winMgr:getWindow("orxonox/Inventory/TabControl/TabUsable")
     orxonox.PickupInventory:getSingleton():clearInventory(winMgr, eqWin, usWin)
     orxonox.PickupInventory:getSingleton():updateTabs(winMgr, eqWin, usWin)
 
-    self.currentUsableID_ = orxonox.PickupInventory:getCurrentUsableIndex()
-    self.lastEquipmentCount_ = orxonox.PickupInventory:getEquipmentCount()
-    self.lastUsableCount_ = orxonox.PickupInventory:getUsableCount()
+    P.currentUsableID_ = orxonox.PickupInventory:getCurrentUsableIndex()
+    P.lastEquipmentCount_ = orxonox.PickupInventory:getEquipmentCount()
+    P.lastUsableCount_ = orxonox.PickupInventory:getUsableCount()
 end
 
 return P

Modified: code/branches/gamestate/data/gui/scripts/QuestGUI.lua
===================================================================
--- code/branches/gamestate/data/gui/scripts/QuestGUI.lua	2010-03-30 13:41:15 UTC (rev 6658)
+++ code/branches/gamestate/data/gui/scripts/QuestGUI.lua	2010-03-30 14:34:01 UTC (rev 6659)
@@ -2,9 +2,9 @@
 
 local P = createSheet("QuestGUI")
 
-function P:show()
-    self.window:show() -- TDO: Do this through parent...
-    self.visible = true
+function P.show()
+    P.window:show() -- TDO: Do this through parent...
+    P.visible = true
 
     local questManager = orxonox.QuestManager:getInstance()
 

Modified: code/branches/gamestate/data/gui/scripts/SingleplayerMenu.lua
===================================================================
--- code/branches/gamestate/data/gui/scripts/SingleplayerMenu.lua	2010-03-30 13:41:15 UTC (rev 6658)
+++ code/branches/gamestate/data/gui/scripts/SingleplayerMenu.lua	2010-03-30 14:34:01 UTC (rev 6659)
@@ -2,7 +2,7 @@
 
 local P = createSheet("SingleplayerMenu")
 
-function P:init()
+function P.init()
     listbox = winMgr:getWindow("orxonox/SingleplayerLevelListbox")
     preselect = orxonox.LevelManager:getInstance():getDefaultLevel()
     orxonox.LevelManager:getInstance():compileAvailableLevelList()




More information about the Orxonox-commit mailing list