[Orxonox-commit 3036] r7732 - in code/trunk/data/gui: layouts scripts
konrad at orxonox.net
konrad at orxonox.net
Wed Dec 8 15:29:29 CET 2010
Author: konrad
Date: 2010-12-08 15:29:28 +0100 (Wed, 08 Dec 2010)
New Revision: 7732
Modified:
code/trunk/data/gui/layouts/CreditsMenu.layout
code/trunk/data/gui/layouts/MultiplayerMenu.layout
code/trunk/data/gui/scripts/CreditsMenu.lua
code/trunk/data/gui/scripts/MultiplayerMenu.lua
code/trunk/data/gui/scripts/QuestGUI.lua
Log:
Credits Menu is now scrollable
Modified: code/trunk/data/gui/layouts/CreditsMenu.layout
===================================================================
--- code/trunk/data/gui/layouts/CreditsMenu.layout 2010-12-08 14:11:59 UTC (rev 7731)
+++ code/trunk/data/gui/layouts/CreditsMenu.layout 2010-12-08 14:29:28 UTC (rev 7732)
@@ -1,34 +1,60 @@
<?xml version="1.0" encoding="UTF-8"?>
<GUILayout >
- <Window Type="MenuWidgets/StaticImage" Name="orxonox/CreditsBackground" >
- <Property Name="FrameEnabled" Value="False" />
+ <Window Type="DefaultWindow" Name="orxonox/CreditsMenu/Background" >
<Property Name="InheritsAlpha" Value="False" />
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
- <Property Name="BackgroundEnabled" Value="False" />
<Window Type="MenuWidgets/StaticText" Name="orxonox/CreditsWindow" >
- <Property Name="Text" Value="Credits" />
+ <Property Name="Text" Value="Keybindings" />
<Property Name="Alpha" Value="0.8" />
+ <Property Name="InheritsAlpha" Value="False" />
<Property Name="HorzFormatting" Value="HorzCentred" />
- <Property Name="InheritsAlpha" Value="False" />
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="VertFormatting" Value="TopAligned" />
- <Property Name="UnifiedAreaRect" Value="{{0.25,0},{0.3625,0},{0.75,0},{0.6375,0}}" />
- <Window Type="MenuWidgets/StaticText" Name="orxonox/CreditsText" >
- <Property Name="Text">Orxonox version 0.0.3
+ <Property Name="UnifiedAreaRect" Value="{{0.15,0},{0.2125,0},{0.85,0},{0.6375,0}}" />
+ <Window Type="MenuWidgets/StaticText" Name="orxonox/CreditsMenuWrapper" >
+ <Property Name="TextColours" Value="FF4444FF" />
+ <Property Name="InheritsAlpha" Value="False" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="HorzFormatting" Value="HorzCentred" />
+ <Property Name="VertFormatting" Value="TopAligned" />
+ <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.15,0},{0.95,0},{0.92,0}}" />
+ <Window Type="MenuWidgets/ScrollablePane" Name="orxonox/CreditsMenuPane" >
+ <Property Name="ContentArea" Value="l:0 t:0 r:0 b:0" />
+ <Property Name="HorzStepSize" Value="0.005" />
+ <Property Name="VertStepSize" Value="0.005" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="HorzOverlapSize" Value="0.01" />
+ <Property Name="UnifiedAreaRect" Value="{{0.005,0},{0.01,0},{0.995,0},{0.99,0}}" />
+ <Property Name="VertOverlapSize" Value="0.01" />
+ <Property Name="HorzScrollPosition" Value="0" />
+ <Property Name="VertScrollPosition" Value="0" />
+ <Window Type="MenuWidgets/StaticText" Name="orxonox/CreditsText" >
+ <Property Name="TextColours" Value="FF4444FF" />
+ <Property Name="InheritsAlpha" Value="False" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="HorzFormatting" Value="HorzCentred" />
+ <Property Name="VertFormatting" Value="TopAligned" />
+ <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
+ <Property Name="Text">Orxonox version 0.0.3
Programming Language: C++ - lua - tcl
Environment: OpenAL - Ogre - OIS - CEGUI - enet - ODE
Licence: GNU General Public Licence - Creative Commons
-http://www.orxonox.net</Property>
- <Property Name="TextColours" Value="FF4444FF" />
- <Property Name="InheritsAlpha" Value="False" />
- <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
- <Property Name="HorzFormatting" Value="HorzCentred" />
- <Property Name="VertFormatting" Value="TopAligned" />
- <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.2,0},{0.95,0},{0.9,0}}" />
+http://www.orxonox.net
+n
+n
+n
+n
+n
+n
+n
+n
+n </Property>
+ </Window>
+ </Window>
</Window>
</Window>
<Window Type="MenuWidgets/Button" Name="orxonox/CreditsBackButton" >
@@ -39,3 +65,8 @@
</Window>
</Window>
</GUILayout>
+
+
+
+
+
Modified: code/trunk/data/gui/layouts/MultiplayerMenu.layout
===================================================================
--- code/trunk/data/gui/layouts/MultiplayerMenu.layout 2010-12-08 14:11:59 UTC (rev 7731)
+++ code/trunk/data/gui/layouts/MultiplayerMenu.layout 2010-12-08 14:29:28 UTC (rev 7732)
@@ -19,6 +19,20 @@
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.15,0},{0.95,0},{0.8,0}}" />
</Window>
+ <Window Type="MenuWidgets/RadioButton" Name="orxonox/MultiplayerLanButton" >
+ <Property Name="Text" Value="LAN"/>
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0.2,0},{0.87,0},{0.4,0},{0.97,0}}" />
+ <Event Name="SelectStateChanged" Function="MultiplayerMenu.LanButton_clicked"/>
+ </Window>
+ <Window Type="MenuWidgets/RadioButton" Name="orxonox/MultiplayerInternetButton" >
+ <Property Name="Text" Value="Internet" />
+ <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+ <Property Name="UnifiedAreaRect" Value="{{0.6,0},{0.87,0},{0.8,0},{0.97,0}}" />
+ <Event Name="SelectStateChanged" Function="MultiplayerMenu.InternetButton_clicked"/>
+ </Window>
+
+
</Window>
<Window Type="MenuWidgets/Button" Name="orxonox/MultiplayerBackButton" >
<Property Name="Text" Value="Back" />
Modified: code/trunk/data/gui/scripts/CreditsMenu.lua
===================================================================
--- code/trunk/data/gui/scripts/CreditsMenu.lua 2010-12-08 14:11:59 UTC (rev 7731)
+++ code/trunk/data/gui/scripts/CreditsMenu.lua 2010-12-08 14:29:28 UTC (rev 7732)
@@ -3,6 +3,7 @@
local P = createMenuSheet("CreditsMenu")
P.buttonList = {}
+P.scrollbarWidth = 13
function P.onLoad()
local item = {
@@ -16,6 +17,15 @@
--indices to iterate through buttonlist
P.oldindex = -2
P.index = -1
+
+ local description = winMgr:getWindow("orxonox/CreditsText")
+ description:setProperty("HorzFormatting", "WordWrapLeftAligned")
+ description:setProperty("VertFormatting", "TopAligned")
+ description:setText(" Orxonox version 0.0.3 \n\n Programming Language: C++ - lua - tcl \n Environment: OpenAL - Ogre - OIS - CEGUI - enet - ODE \n Licence: GNU General Public Licence - Creative Commons \n http://www.orxonox.net \n \n Credits:")
+
+ description:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0)))
+ height = getStaticTextWindowHeight(description)
+ description:setHeight(CEGUI.UDim(0, height))
end
function P.CreditsBackButton_clicked(e)
Modified: code/trunk/data/gui/scripts/MultiplayerMenu.lua
===================================================================
--- code/trunk/data/gui/scripts/MultiplayerMenu.lua 2010-12-08 14:11:59 UTC (rev 7731)
+++ code/trunk/data/gui/scripts/MultiplayerMenu.lua 2010-12-08 14:29:28 UTC (rev 7732)
@@ -4,6 +4,10 @@
P.buttonList = {}
+--joinMode is 1 for choice "LAN" and 2 for "Internet"
+--initial status 0
+P.joinMode = 0
+
function P.onLoad()
P.multiplayerMode = "startClient"
@@ -25,7 +29,6 @@
["function"] = P.MultiplayerBackButton_clicked
}
P.buttonList[4] = item
-
end
function P.onShow()
@@ -36,22 +39,36 @@
P.index = -1
end
+function P.LanButton_clicked(e)
+ P.joinMode = 1
+end
+
+function P.InternetButton_clicked(e)
+ P.joinMode = 2
+end
+
function P.MultiplayerHostButton_clicked(e)
showMenuSheet("HostMenu", true)
end
function P.MultiplayerJoinButton_clicked(e)
- local choice = winMgr:getWindow("orxonox/MultiplayerListbox"):getFirstSelectedItem()
- if choice then
- local client = orxonox.Client:getInstance()
- local index = tolua.cast(choice, "CEGUI::ListboxItem"):getID()
- client:setDestination( P.serverList[index][2], 55556 )
+ local choice = winMgr:getWindow("orxonox/MultiplayerListbox"):getFirstSelectedItem()
+
+ if P.joinMode == 2 then
+ if choice then
+ local client = orxonox.Client:getInstance()
+ local index = tolua.cast(choice, "CEGUI::ListboxItem"):getID()
+ client:setDestination( P.serverList[index][2], 55556 )
+ else
+ return
+ end
+ orxonox.execute("startClient")
+ hideAllMenuSheets()
else
- return
+ --wait for Sandro's function
end
- orxonox.execute("startClient")
- hideAllMenuSheets()
+
end
function P.MultiplayerBackButton_clicked(e)
Modified: code/trunk/data/gui/scripts/QuestGUI.lua
===================================================================
--- code/trunk/data/gui/scripts/QuestGUI.lua 2010-12-08 14:11:59 UTC (rev 7731)
+++ code/trunk/data/gui/scripts/QuestGUI.lua 2010-12-08 14:29:28 UTC (rev 7732)
@@ -20,7 +20,7 @@
local questsList = winMgr:getWindow("orxonox/QuestGUI/QuestsList")
P.player = orxonox.GUIManager:getInstance():getPlayer(P.name)
- P.rootWindow = P.createQuestGUI();
+ P.rootWindow = P.createQuestGUI()
questsList:addChildWindow(P.rootWindow)
end
@@ -73,7 +73,7 @@
i = i+1
end
- return index;
+ return index
end
function P.cleanup()
@@ -139,7 +139,7 @@
status:setHeight(CEGUI.UDim(0, height))
offset = offset + height
- local descriptionTitle = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Description/Title");
+ local descriptionTitle = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Description/Title")
window:addChildWindow(descriptionTitle)
descriptionTitle:setProperty("HorzFormatting", "HorzCentred")
descriptionTitle:setProperty("VertFormatting", "TopAligned")
@@ -150,7 +150,7 @@
descriptionTitle:setHeight(CEGUI.UDim(0, height))
offset = offset + height
- local description = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Description");
+ local description = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Description")
window:addChildWindow(description)
description:setProperty("HorzFormatting", "WordWrapLeftAligned")
description:setProperty("VertFormatting", "TopAligned")
@@ -164,7 +164,7 @@
-- Display the hints of this quest
local numHints = orxonox.QuestManager:getInstance():getNumHints(quest, P.player)
if numHints > 0 then
- local hintsTitle = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Hints/Title");
+ local hintsTitle = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Hints/Title")
window:addChildWindow(hintsTitle)
hintsTitle:setProperty("HorzFormatting", "HorzCentred")
hintsTitle:setProperty("VertFormatting", "TopAligned")
@@ -246,7 +246,7 @@
local offset = 0
- local descriptionTitle = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Description/Title");
+ local descriptionTitle = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Description/Title")
window:addChildWindow(descriptionTitle)
descriptionTitle:setProperty("HorzFormatting", "HorzCentred")
descriptionTitle:setProperty("VertFormatting", "TopAligned")
@@ -257,7 +257,7 @@
descriptionTitle:setHeight(CEGUI.UDim(0, height))
offset = offset + height
- local description = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Description");
+ local description = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Description")
window:addChildWindow(description)
description:setProperty("HorzFormatting", "WordWrapLeftAligned")
description:setProperty("VertFormatting", "TopAligned")
More information about the Orxonox-commit
mailing list