[Orxonox-commit 2939] r7639 - in code/branches/releasetodo: data/gui/layouts data/gui/scripts src/orxonox
dafrick at orxonox.net
dafrick at orxonox.net
Thu Nov 11 12:30:38 CET 2010
Author: dafrick
Date: 2010-11-11 12:30:38 +0100 (Thu, 11 Nov 2010)
New Revision: 7639
Modified:
code/branches/releasetodo/data/gui/layouts/SingleplayerMenu.layout
code/branches/releasetodo/data/gui/scripts/SingleplayerMenu.lua
code/branches/releasetodo/src/orxonox/LevelInfo.cc
Log:
Some performance an GUI enhancement.
Modified: code/branches/releasetodo/data/gui/layouts/SingleplayerMenu.layout
===================================================================
--- code/branches/releasetodo/data/gui/layouts/SingleplayerMenu.layout 2010-11-11 10:21:28 UTC (rev 7638)
+++ code/branches/releasetodo/data/gui/layouts/SingleplayerMenu.layout 2010-11-11 11:30:38 UTC (rev 7639)
@@ -19,17 +19,11 @@
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.15,0},{0.95,0},{0.85,0}}" />
</Window>
- <Window Type="MenuWidgets/RadioButton" Name="orxonox/SingleplayerShowRestrictedButton" >
- <Property Name="Text" Value="show only restricted" />
- <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
- <Property Name="UnifiedAreaRect" Value="{{0.15,0},{0.87,0},{0.5,0},{.97,0}}" />
- <Event Name="SelectStateChanged" Function="SingleplayerMenu.SingleplayerShowRestrictedButton_clicked"/>
- </Window>
- <Window Type="MenuWidgets/RadioButton" Name="orxonox/SingleplayerShowAllButton" >
+ <Window Type="MenuWidgets/Checkbox" Name="orxonox/SingleplayerShowAllCheckbox" >
<Property Name="Text" Value="show all" />
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
- <Property Name="UnifiedAreaRect" Value="{{0.65,0},{0.87,0},{0.85,0},{.97,0}}" />
- <Event Name="SelectStateChanged" Function="SingleplayerMenu.SingleplayerShowAllButton_clicked"/>
+ <Property Name="UnifiedAreaRect" Value="{{0.65,0},{0.87,0},{0.8,0},{.97,0}}" />
+ <Event Name="CheckStateChanged" Function="SingleplayerMenu.SingleplayerShowAll_clicked"/>
</Window>
</Window>
<Window Type="MenuWidgets/Button" Name="orxonox/SingleplayerStartButton" >
Modified: code/branches/releasetodo/data/gui/scripts/SingleplayerMenu.lua
===================================================================
--- code/branches/releasetodo/data/gui/scripts/SingleplayerMenu.lua 2010-11-11 10:21:28 UTC (rev 7638)
+++ code/branches/releasetodo/data/gui/scripts/SingleplayerMenu.lua 2010-11-11 11:30:38 UTC (rev 7639)
@@ -7,9 +7,9 @@
P.showAll = false
function P.onLoad()
- local window = winMgr:getWindow("orxonox/SingleplayerShowRestrictedButton")
- local button = tolua.cast(window,"CEGUI::RadioButton")
- button:setSelected(true)
+ local window = winMgr:getWindow("orxonox/SingleplayerShowAllCheckbox")
+ local button = tolua.cast(window,"CEGUI::Checkbox")
+ button:setSelected(false)
P.createLevelList()
end
@@ -63,16 +63,15 @@
end
end
-function P.SingleplayerShowRestrictedButton_clicked(e)
- P.showAll = false
- P.createLevelList()
+function P.SingleplayerShowAll_clicked(e)
+ local checkbox = tolua.cast(winMgr:getWindow("orxonox/SingleplayerShowAllCheckbox"), "CEGUI::Checkbox")
+ local show = checkbox:isSelected()
+ if show ~= P.showAll then
+ P.showAll = show
+ P.createLevelList()
+ end
end
-function P.SingleplayerShowAllButton_clicked(e)
- P.showAll = true
- P.createLevelList()
-end
-
function P.SingleplayerBackButton_clicked(e)
hideMenuSheet(P.name)
end
Modified: code/branches/releasetodo/src/orxonox/LevelInfo.cc
===================================================================
--- code/branches/releasetodo/src/orxonox/LevelInfo.cc 2010-11-11 10:21:28 UTC (rev 7638)
+++ code/branches/releasetodo/src/orxonox/LevelInfo.cc 2010-11-11 11:30:38 UTC (rev 7639)
@@ -119,10 +119,10 @@
{
if(!this->validateTag(tag))
{
- COUT(2) << "Bad tag '" << tag << "' in " << this->getXMLFilename() << ". Ignoring..." << std::endl;
+ COUT(2) << "Bad LevelInfo tag '" << tag << "' in " << this->getXMLFilename() << ". Ignoring..." << std::endl;
return false;
}
- bool success = this->tags_.insert(std::string(tag)).second;
+ bool success = this->tags_.insert(*LevelInfoItem::possibleTags_s.find(tag)).second;
if(update && success)
this->tagsUpdated();
return success;
More information about the Orxonox-commit
mailing list