[Orxonox-commit 7188] r11805 - in code/branches/cegui0.8_ogre1.9/data/gui: layouts scripts
landauf at orxonox.net
landauf at orxonox.net
Sat Feb 24 02:50:16 CET 2018
Author: landauf
Date: 2018-02-24 02:50:16 +0100 (Sat, 24 Feb 2018)
New Revision: 11805
Modified:
code/branches/cegui0.8_ogre1.9/data/gui/layouts/HighscoreMenu.layout
code/branches/cegui0.8_ogre1.9/data/gui/scripts/CampaignMenu.lua
code/branches/cegui0.8_ogre1.9/data/gui/scripts/HighscoreMenu.lua
Log:
migrated HighscoreMenu.lua and CampaignMenu.lua to cegui 0.8
Modified: code/branches/cegui0.8_ogre1.9/data/gui/layouts/HighscoreMenu.layout
===================================================================
--- code/branches/cegui0.8_ogre1.9/data/gui/layouts/HighscoreMenu.layout 2018-02-24 01:21:24 UTC (rev 11804)
+++ code/branches/cegui0.8_ogre1.9/data/gui/layouts/HighscoreMenu.layout 2018-02-24 01:50:16 UTC (rev 11805)
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='utf-8'?>
<GUILayout version="4">
- <Window name="Background" type="DefaultWindow">
+ <Window name="HighscoreBackground" type="DefaultWindow">
<Property name="InheritsAlpha" value="False" />
<Property name="MaxSize" value="{{1,0},{1,0}}" />
<Property name="Area" value="{{0,0},{0,0},{1,0},{1,0}}" />
@@ -8,7 +8,7 @@
<Property name="Text" value="Highscore" />
<Property name="Alpha" value="0.8" />
<Property name="InheritsAlpha" value="False" />
- <Property name="HorzFormatting" value="HorzCentred" />
+ <Property name="HorzFormatting" value="CentreAligned" />
<Property name="MaxSize" value="{{1,0},{1,0}}" />
<Property name="VertFormatting" value="TopAligned" />
<Property name="Area" value="{{0.15,0},{0.1,0},{0.85,0},{0.85,0}}" />
Modified: code/branches/cegui0.8_ogre1.9/data/gui/scripts/CampaignMenu.lua
===================================================================
--- code/branches/cegui0.8_ogre1.9/data/gui/scripts/CampaignMenu.lua 2018-02-24 01:21:24 UTC (rev 11804)
+++ code/branches/cegui0.8_ogre1.9/data/gui/scripts/CampaignMenu.lua 2018-02-24 01:50:16 UTC (rev 11805)
@@ -7,28 +7,28 @@
end
function P.updateButtons()
- P.updateButton(0, winMgr:getWindow("orxonox/Mission1Button"))
- P.updateButton(0, winMgr:getWindow("orxonox/Mission1Text"))
- P.updateButton(1, winMgr:getWindow("orxonox/Mission2Button"))
- P.updateButton(1, winMgr:getWindow("orxonox/Mission2Text"))
- P.updateButton(2, winMgr:getWindow("orxonox/Mission3Button"))
- P.updateButton(2, winMgr:getWindow("orxonox/Mission3Text"))
- P.updateButton(3, winMgr:getWindow("orxonox/Mission4Button"))
- P.updateButton(3, winMgr:getWindow("orxonox/Mission4Text"))
- P.updateButton(4, winMgr:getWindow("orxonox/Mission5Button"))
- P.updateButton(4, winMgr:getWindow("orxonox/Mission5Text"))
- P.updateButton(5, winMgr:getWindow("orxonox/Mission6Button"))
- P.updateButton(5, winMgr:getWindow("orxonox/Mission6Text"))
- P.updateButton(6, winMgr:getWindow("orxonox/Mission7Button"))
- P.updateButton(6, winMgr:getWindow("orxonox/Mission7Text"))
- P.updateButton(7, winMgr:getWindow("orxonox/Mission8Button"))
- P.updateButton(7, winMgr:getWindow("orxonox/Mission8Text"))
- P.updateButton(8, winMgr:getWindow("orxonox/Mission9Button"))
- P.updateButton(8, winMgr:getWindow("orxonox/Mission9Text"))
+ P.updateButton(0, P.window:getChild("Mission1Button"))
+ P.updateButton(0, P.window:getChild("Mission1Text"))
+ P.updateButton(1, P.window:getChild("Mission2Button"))
+ P.updateButton(1, P.window:getChild("Mission2Text"))
+ P.updateButton(2, P.window:getChild("Mission3Button"))
+ P.updateButton(2, P.window:getChild("Mission3Text"))
+ P.updateButton(3, P.window:getChild("Mission4Button"))
+ P.updateButton(3, P.window:getChild("Mission4Text"))
+ P.updateButton(4, P.window:getChild("Mission5Button"))
+ P.updateButton(4, P.window:getChild("Mission5Text"))
+ P.updateButton(5, P.window:getChild("Mission6Button"))
+ P.updateButton(5, P.window:getChild("Mission6Text"))
+ P.updateButton(6, P.window:getChild("Mission7Button"))
+ P.updateButton(6, P.window:getChild("Mission7Text"))
+ P.updateButton(7, P.window:getChild("Mission8Button"))
+ P.updateButton(7, P.window:getChild("Mission8Text"))
+ P.updateButton(8, P.window:getChild("Mission9Button"))
+ P.updateButton(8, P.window:getChild("Mission9Text"))
if (P.getIndexOfLastFinishedMission() == orxonox.LevelManager:getInstance():getNumberOfCampaignMissions() - 1) then
- local label = winMgr:getWindow("orxonox/CampaignMenuCongratulation")
+ local label = P.window:getChild("CampaignMenuCongratulation")
label:setProperty("Visible","True")
end
end
Modified: code/branches/cegui0.8_ogre1.9/data/gui/scripts/HighscoreMenu.lua
===================================================================
--- code/branches/cegui0.8_ogre1.9/data/gui/scripts/HighscoreMenu.lua 2018-02-24 01:21:24 UTC (rev 11804)
+++ code/branches/cegui0.8_ogre1.9/data/gui/scripts/HighscoreMenu.lua 2018-02-24 01:50:16 UTC (rev 11805)
@@ -38,10 +38,10 @@
function P.onHide()
-- delete old windows to reload them on show
- local tabControl = winMgr:getWindow("orxonox/HighscoreTabControl")
+ local tabControl = P.window:getChild("HighscoreWindow/HighscoreTabControl")
for k,v in pairs(P.tabList) do
- local default = winMgr:getWindow(v)
- tabControl:removeChildWindow(default)
+ local default = tabControl:getChild(v)
+ tabControl:removeChild(default)
winMgr:destroyWindow(default)
end
end
@@ -60,7 +60,7 @@
end
function P.createFilterTab(name, tag)
-- create unique tab window name
- local tabName = "orxonox/HighscoreLevelTab"
+ local tabName = "HighscoreLevelTab"
if tag ~= nil then
tabName = tabName..tag
end
@@ -69,11 +69,11 @@
-- create new tab window with desired name
local default = (winMgr:createWindow("DefaultWindow", tabName))
default:setText(name)
- default:setProperty("UnifiedMaxSize", "{{1,0},{1,0}}")
- default:setProperty("UnifiedAreaRect", "{{0,0},{0,0},{1,0},{1,0}}")
+ default:setProperty("MaxSize", "{{1,0},{1,0}}")
+ default:setProperty("Area", "{{0,0},{0,0},{1,0},{1,0}}")
local pane = winMgr:createWindow("MenuWidgets/ScrollablePane", tabName .. "pane")
- pane:setSize(CEGUI.UVector2(CEGUI.UDim(1,0),CEGUI.UDim(1,0)))
- default:addChildWindow(pane)
+ pane:setSize(CEGUI.USize(CEGUI.UDim(1,0),CEGUI.UDim(1,0)))
+ default:addChild(pane)
local offset = 2
@@ -84,14 +84,14 @@
local line = P.createPickupEntry(tabName .. k,k,tag)
table.insert(P.linesList, line)
line:setYPosition(CEGUI.UDim(0,offset))
- offset = offset + line:getHeight():asAbsolute(1)+2
- pane:addChildWindow(line)
+ offset = offset + P.imageHeight +2
+ pane:addChild(line)
end
end
- local tabControl = winMgr:getWindow("orxonox/HighscoreTabControl")
- tabControl:addChildWindow(default)
+ local tabControl = P.window:getChild("HighscoreWindow/HighscoreTabControl")
+ tabControl:addChild(default)
@@ -98,31 +98,31 @@
end
function P.createPickupEntry(parent,k,tag)
- local name = "orxonox/HiscoreEntry" .. parent
+ local name = "HiscoreEntry" .. parent
local splitlist = P.Split(P.highscoreList[k],"./.")
local item = winMgr:createWindow("DefaultWindow", name)
- item:setSize(CEGUI.UVector2(CEGUI.UDim(1, 0), CEGUI.UDim(0, P.imageHeight)))
+ item:setSize(CEGUI.USize(CEGUI.UDim(1, 0), CEGUI.UDim(0, P.imageHeight)))
item:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, 0)))
local player = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Player")
player:setText(splitlist[1])
player:setPosition(CEGUI.UVector2(CEGUI.UDim(0.005,0), CEGUI.UDim(0,0)))
- player:setSize(CEGUI.UVector2(CEGUI.UDim(0.49, 0), CEGUI.UDim(0, P.imageHeight)))
+ player:setSize(CEGUI.USize(CEGUI.UDim(0.49, 0), CEGUI.UDim(0, P.imageHeight)))
- item:addChildWindow(player)
+ item:addChild(player)
local score = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Score")
score:setText(splitlist[3])
score:setPosition(CEGUI.UVector2(CEGUI.UDim(0.5,0), CEGUI.UDim(0,0)))
- score:setSize(CEGUI.UVector2(CEGUI.UDim(0.495, 0), CEGUI.UDim(0, P.imageHeight)))
+ score:setSize(CEGUI.USize(CEGUI.UDim(0.495, 0), CEGUI.UDim(0, P.imageHeight)))
- item:addChildWindow(score)
+ item:addChild(score)
return item
end
function P.HighscoreGetSelectedLevel()
-- choose the active listbox
- local tabControl = CEGUI.toTabControl(winMgr:getWindow("orxonox/HighscoreTabControl"))
+ local tabControl = CEGUI.toTabControl(P.window:getChild("HighscoreWindow/HighscoreTabControl"))
local listbox = CEGUI.toListbox(tabControl:getTabContentsAtIndex(tabControl:getSelectedTabIndex()))
local choice = listbox:getFirstSelectedItem()
if choice ~= nil then
More information about the Orxonox-commit
mailing list