[Orxonox-commit 4029] r8703 - code/branches/presentation/data/gui/scripts

landauf at orxonox.net landauf at orxonox.net
Mon Jun 13 01:49:05 CEST 2011


Author: landauf
Date: 2011-06-13 01:49:05 +0200 (Mon, 13 Jun 2011)
New Revision: 8703

Modified:
   code/branches/presentation/data/gui/scripts/NotificationLayer.lua
Log:
two fixes for cegui 0.7

sometimes there's an exception while closing orxonox, but that's a bug in cegui: http://www.cegui.org.uk/mantis/view.php?id=423

Modified: code/branches/presentation/data/gui/scripts/NotificationLayer.lua
===================================================================
--- code/branches/presentation/data/gui/scripts/NotificationLayer.lua	2011-06-11 11:47:05 UTC (rev 8702)
+++ code/branches/presentation/data/gui/scripts/NotificationLayer.lua	2011-06-12 23:49:05 UTC (rev 8703)
@@ -61,6 +61,8 @@
         return
     end
 
+    notification = string.gsub(notification, "%[", "\\%[") -- escape '[' which is used to format text since cegui 0.7
+
     local item = winMgr:createWindow("MenuWidgets/StaticText", "orxonox/NotificationLayer/Root/Queue/" .. queueName .. "/" .. queue.last)
     item:setText(notification)
     P.setItemFontHelper(item, queue, true)
@@ -249,7 +251,8 @@
 function P.setItemFontHelper(item, queue, changeColor)
     --local item = tolua.cast(item, "CEGUI::ListboxTextItem")
     local fontMgr = CEGUI.FontManager:getSingleton()
-    if fontMgr:isFontPresent("BlueHighway-" .. queue.fontSize) then
+    if (fontMgr["isFontPresent"] and fontMgr:isFontPresent("BlueHighway-" .. queue.fontSize)) or -- cegui 0.6
+        (fontMgr["isDefined"] and fontMgr:isDefined("BlueHighway-" .. queue.fontSize)) then -- cegui 0.7
         item:setFont("BlueHighway-" .. queue.fontSize)
     else
         orxonox.GUIManager:addFontHelper("BlueHighway-" .. queue.fontSize, queue.fontSize, "bluehigh.ttf")




More information about the Orxonox-commit mailing list