[Orxonox-commit 7180] r11797 - code/branches/cegui0.8_ogre1.9/data/gui/scripts
landauf at orxonox.net
landauf at orxonox.net
Thu Feb 22 01:03:44 CET 2018
Author: landauf
Date: 2018-02-22 01:03:44 +0100 (Thu, 22 Feb 2018)
New Revision: 11797
Modified:
code/branches/cegui0.8_ogre1.9/data/gui/scripts/CreditsMenu.lua
code/branches/cegui0.8_ogre1.9/data/gui/scripts/GUITools.lua
code/branches/cegui0.8_ogre1.9/data/gui/scripts/SingleplayerMenu.lua
Log:
updated CreditsMenu.lua and SingleplayerMenu.lua to cegui 0.8
Modified: code/branches/cegui0.8_ogre1.9/data/gui/scripts/CreditsMenu.lua
===================================================================
--- code/branches/cegui0.8_ogre1.9/data/gui/scripts/CreditsMenu.lua 2018-02-20 23:31:17 UTC (rev 11796)
+++ code/branches/cegui0.8_ogre1.9/data/gui/scripts/CreditsMenu.lua 2018-02-22 00:03:44 UTC (rev 11797)
@@ -6,16 +6,16 @@
function P.onLoad()
P:setButton(1, 1, {
- ["button"] = winMgr:getWindow("orxonox/CreditsBackButton"),
+ ["button"] = P.window:getChild("CreditsBackButton"),
["callback"] = P.CreditsBackButton_clicked
})
end
function P.onShow()
- local description = winMgr:getWindow("orxonox/CreditsText")
+ local description = P.window:getChild("CreditsWindow/CreditsMenuWrapper/CreditsMenuPane/CreditsText")
height = getStaticTextWindowHeight(description)
- description:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(0.0, height)))
+ description:setSize(CEGUI.USize(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(0.0, height)))
end
function P.CreditsBackButton_clicked(e)
Modified: code/branches/cegui0.8_ogre1.9/data/gui/scripts/GUITools.lua
===================================================================
--- code/branches/cegui0.8_ogre1.9/data/gui/scripts/GUITools.lua 2018-02-20 23:31:17 UTC (rev 11796)
+++ code/branches/cegui0.8_ogre1.9/data/gui/scripts/GUITools.lua 2018-02-22 00:03:44 UTC (rev 11797)
@@ -50,7 +50,7 @@
local lookAndFeel = CEGUI.WidgetLookManager:getSingleton():getWidgetLook(window:getLookNFeel())
local formattedArea = lookAndFeel:getNamedArea("WithFrameTextRenderArea"):getArea():getPixelRect(window)
-- Calculate the pixel height of the frame by subtracting the height of the area above from the total height of the window.
- local frameHeight = window:getUnclippedOuterRect():getHeight() - formattedArea:getHeight()
+ local frameHeight = window:getUnclippedOuterRect():get():getHeight() - formattedArea:getHeight()
local height = 0
if ORXONOX_OLD_CEGUI then
Modified: code/branches/cegui0.8_ogre1.9/data/gui/scripts/SingleplayerMenu.lua
===================================================================
--- code/branches/cegui0.8_ogre1.9/data/gui/scripts/SingleplayerMenu.lua 2018-02-20 23:31:17 UTC (rev 11796)
+++ code/branches/cegui0.8_ogre1.9/data/gui/scripts/SingleplayerMenu.lua 2018-02-22 00:03:44 UTC (rev 11797)
@@ -24,22 +24,22 @@
--buttons are arranged in a 2x3 matrix
P:setButton(1, 1, {
- ["button"] = winMgr:getWindow("orxonox/SingleplayerStartButton"),
+ ["button"] = P.window:getChild("SingleplayerStartButton"),
["callback"] = P.SingleplayerStartButton_clicked
})
P:setButton(1, 2, {
- ["button"] = winMgr:getWindow("orxonox/SingleplayerConfigButton"),
+ ["button"] = P.window:getChild("SingleplayerConfigButton"),
["callback"] = P.SingleplayerConfigButton_clicked
})
P:setButton(1, 3, {
- ["button"] = winMgr:getWindow("orxonox/SingleplayerBackButton"),
+ ["button"] = P.window:getChild("SingleplayerBackButton"),
["callback"] = P.SingleplayerBackButton_clicked
})
P:setButton(2, 2,{
- ["button"] = winMgr:getWindow("orxonox/CampaignButton"),
+ ["button"] = P.window:getChild("CampaignButton"),
["callback"] = P.CampaignButton_clicked
})
end
@@ -56,9 +56,9 @@
-- create an imageset for each screenshot
local imageName = level:getScreenshot()
if imageName ~= "" then
- CEGUI.ImagesetManager:getSingleton():createFromImageFile(levelXMLFilename..imageName, imageName)
+ CEGUI.ImageManager:getSingleton():addFromImageFile(levelXMLFilename..imageName, imageName)
else
- CEGUI.ImagesetManager:getSingleton():createFromImageFile(levelXMLFilename..imageName, "noscreenshot.png")
+ CEGUI.ImageManager:getSingleton():addFromImageFile(levelXMLFilename..imageName, "noscreenshot.png")
end
table.insert(P.levelList, level)
end
@@ -68,7 +68,7 @@
function P.createFilterTab(name, tag)
-- create unique tab window name
- local tabName = "orxonox/SingleplayerLevelTab"
+ local tabName = "SingleplayerLevelTab"
if tag ~= nil then
tabName = tabName..tag
end
@@ -75,8 +75,8 @@
-- create new tab window with desired name
local listbox = CEGUI.toListbox(winMgr:createWindow("MenuWidgets/Listbox", tabName))
listbox:setText(name)
- listbox:setProperty("UnifiedMaxSize", "{{1,0},{1,0}}")
- listbox:setProperty("UnifiedAreaRect", "{{0.05,0},{0.1,0},{0.5,0},{0.675,0}}")
+ listbox:setProperty("MaxSize", "{{1,0},{1,0}}")
+ listbox:setProperty("Area", "{{0.05,0},{0.1,0},{0.5,0},{0.675,0}}")
-- fill listbox with items
listbox:resetList()
orxonox.GUIManager:setItemTooltipsEnabledHelper(listbox, true)
@@ -97,17 +97,17 @@
end
table.insert(P.activeTabIndexes, tabIndexes)
-- listen to selection changes
- orxonox.GUIManager:subscribeEventHelper(listbox, "ItemSelectionChanged", P.name..".SingleplayerSelectionChanged")
- local tabControl = winMgr:getWindow("orxonox/SingleplayerTabControl")
- orxonox.GUIManager:subscribeEventHelper(tabControl, "TabSelectionChanged", P.name..".SingleplayerSelectionChanged")
+ orxonox.GUIManager:subscribeEventHelper(listbox, "SelectionChanged", P.name..".SingleplayerSelectionChanged")
+ local tabControl = P.window:getChild("SingleplayerWindow/SingleplayerTabControl")
+ orxonox.GUIManager:subscribeEventHelper(tabControl, "SelectionChanged", P.name..".SingleplayerSelectionChanged")
if listbox:getItemCount() > 0 then
- tabControl:addChildWindow(tabName)
+ tabControl:addChild(listbox)
end
end
function P.SingleplayerGetSelectedLevel()
-- choose the active listbox
- local tabControl = CEGUI.toTabControl(winMgr:getWindow("orxonox/SingleplayerTabControl"))
+ local tabControl = CEGUI.toTabControl(P.window:getChild("SingleplayerWindow/SingleplayerTabControl"))
local listbox = CEGUI.toListbox(tabControl:getTabContentsAtIndex(tabControl:getSelectedTabIndex()))
local choice = listbox:getFirstSelectedItem()
if choice ~= nil then
@@ -121,15 +121,15 @@
end
function P.SingleplayerSelectionChanged(e)
- local levelImage = winMgr:getWindow("orxonox/SingleplayerLevelImage")
- local levelDescription = winMgr:getWindow("orxonox/SingleplayerLevelDescription")
- local configButton = winMgr:getWindow("orxonox/SingleplayerConfigButton")
+ local levelImage = P.window:getChild("SingleplayerWindow/SingleplayerLevelImage")
+ local levelDescription = P.window:getChild("SingleplayerWindow/SingleplayerLevelDescription")
+ local configButton = P.window:getChild("SingleplayerConfigButton")
local level = P.SingleplayerGetSelectedLevel()
if level ~= nil then
local levelXMLFilename = level:getXMLFilename()
local imageName = level:getScreenshot()
-- set the screenshot and the description for the selected level
- levelImage:setProperty("Image", levelXMLFilename..imageName.."/full_image")
+ levelImage:setProperty("Image", levelXMLFilename..imageName)
levelDescription:setText(level:getDescription())
-- only enable config button for "gametype" levels
if level:hasTag("gametype") then
More information about the Orxonox-commit
mailing list