[Orxonox-commit 3962] r8636 - in code/branches/tutoriallevel3: data/gui/scripts data/levels data/levels/includes src/modules/notifications
dafrick at orxonox.net
dafrick at orxonox.net
Sat May 28 16:21:15 CEST 2011
Author: dafrick
Date: 2011-05-28 16:21:14 +0200 (Sat, 28 May 2011)
New Revision: 8636
Added:
code/branches/tutoriallevel3/data/levels/includes/notifications.oxi
Modified:
code/branches/tutoriallevel3/data/gui/scripts/NotificationLayer.lua
code/branches/tutoriallevel3/data/levels/FPSTest.oxw
code/branches/tutoriallevel3/data/levels/asteroids.oxw
code/branches/tutoriallevel3/data/levels/dynamicMatch.oxw
code/branches/tutoriallevel3/data/levels/earth.oxw
code/branches/tutoriallevel3/data/levels/emptyLevel.oxw
code/branches/tutoriallevel3/data/levels/events.oxw
code/branches/tutoriallevel3/data/levels/fightInOurBack.oxw
code/branches/tutoriallevel3/data/levels/lastManStanding.oxw
code/branches/tutoriallevel3/data/levels/lastTeamStanding.oxw
code/branches/tutoriallevel3/data/levels/lastTeamStandingII.oxw
code/branches/tutoriallevel3/data/levels/notifications.oxw
code/branches/tutoriallevel3/data/levels/pickups.oxw
code/branches/tutoriallevel3/data/levels/pirateAttack.oxw
code/branches/tutoriallevel3/data/levels/planets.oxw
code/branches/tutoriallevel3/data/levels/pong.oxw
code/branches/tutoriallevel3/data/levels/presentation.oxw
code/branches/tutoriallevel3/data/levels/presentation09.oxw
code/branches/tutoriallevel3/data/levels/presentation09b.oxw
code/branches/tutoriallevel3/data/levels/presentationDM.oxw
code/branches/tutoriallevel3/data/levels/presentationFS10.oxw
code/branches/tutoriallevel3/data/levels/presentationFS102.oxw
code/branches/tutoriallevel3/data/levels/presentationFS10Ed.oxw
code/branches/tutoriallevel3/data/levels/presentationHS09.oxw
code/branches/tutoriallevel3/data/levels/presentationHS09b.oxw
code/branches/tutoriallevel3/data/levels/princessAeryn.oxw
code/branches/tutoriallevel3/data/levels/quests.oxw
code/branches/tutoriallevel3/data/levels/screenshot.oxw
code/branches/tutoriallevel3/data/levels/sound.oxw
code/branches/tutoriallevel3/data/levels/teamBaseMatch.oxw
code/branches/tutoriallevel3/data/levels/teamDeathMatch.oxw
code/branches/tutoriallevel3/data/levels/testStars.oxw
code/branches/tutoriallevel3/data/levels/testSwallow.oxw
code/branches/tutoriallevel3/data/levels/theTimeMachine.oxw
code/branches/tutoriallevel3/data/levels/tutorial.oxw
code/branches/tutoriallevel3/data/levels/underAttack.oxw
code/branches/tutoriallevel3/data/levels/waypoints.oxw
code/branches/tutoriallevel3/src/modules/notifications/NotificationManager.cc
code/branches/tutoriallevel3/src/modules/notifications/NotificationQueue.cc
code/branches/tutoriallevel3/src/modules/notifications/NotificationQueue.h
code/branches/tutoriallevel3/src/modules/notifications/NotificationQueueCEGUI.cc
code/branches/tutoriallevel3/src/modules/notifications/NotificationQueueCEGUI.h
Log:
Making NotificationQueue XML-loadable. Adding notifications to all levels.
Modified: code/branches/tutoriallevel3/data/gui/scripts/NotificationLayer.lua
===================================================================
--- code/branches/tutoriallevel3/data/gui/scripts/NotificationLayer.lua 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/data/gui/scripts/NotificationLayer.lua 2011-05-28 14:21:14 UTC (rev 8636)
@@ -26,7 +26,7 @@
{
["window"] = queue,
["name"] = name,
- ["maxSize"] = size,
+ ["maxSize"] = size,
["visible"] = false,
["fontSize"] = 12,
["fontColor"] = "FFFFFFFF",
@@ -48,6 +48,7 @@
local queue = P.queueList[queueName]
if queue ~= nil then
+ queue.window:getParent():removeChildWindow(queue.window)
winMgr:destroyWindow(queue.window)
end
P.queueList[queueName] = nil
Modified: code/branches/tutoriallevel3/data/levels/FPSTest.oxw
===================================================================
--- code/branches/tutoriallevel3/data/levels/FPSTest.oxw 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/data/levels/FPSTest.oxw 2011-05-28 14:21:14 UTC (rev 8636)
@@ -20,6 +20,7 @@
<templates>
<Template link=lodtemplate_default />
</templates>
+ <?lua include("includes/notifications.oxi") ?>
<Scene
ambientlight = "0.1, 0.1, 0.1"
Modified: code/branches/tutoriallevel3/data/levels/asteroids.oxw
===================================================================
--- code/branches/tutoriallevel3/data/levels/asteroids.oxw 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/data/levels/asteroids.oxw 2011-05-28 14:21:14 UTC (rev 8636)
@@ -13,6 +13,7 @@
<templates>
<Template link=lodtemplate_default />
</templates>
+ <?lua include("includes/notifications.oxi") ?>
<Scene
ambientlight = "0.5, 0.5, 0.5"
Modified: code/branches/tutoriallevel3/data/levels/dynamicMatch.oxw
===================================================================
--- code/branches/tutoriallevel3/data/levels/dynamicMatch.oxw 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/data/levels/dynamicMatch.oxw 2011-05-28 14:21:14 UTC (rev 8636)
@@ -15,6 +15,7 @@
<templates>
<Template link=lodtemplate_default />
</templates>
+ <?lua include("includes/notifications.oxi") ?>
<Scene
ambientlight = "0.5, 0.5, 0.5"
Modified: code/branches/tutoriallevel3/data/levels/earth.oxw
===================================================================
--- code/branches/tutoriallevel3/data/levels/earth.oxw 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/data/levels/earth.oxw 2011-05-28 14:21:14 UTC (rev 8636)
@@ -18,6 +18,7 @@
<templates>
<Template link="lodtemplate_default" />
</templates>
+ <?lua include("includes/notifications.oxi") ?>
<Scene
ambientlight = "0.8, 0.8, 0.8"
Modified: code/branches/tutoriallevel3/data/levels/emptyLevel.oxw
===================================================================
--- code/branches/tutoriallevel3/data/levels/emptyLevel.oxw 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/data/levels/emptyLevel.oxw 2011-05-28 14:21:14 UTC (rev 8636)
@@ -22,6 +22,7 @@
<templates>
<Template link=lodtemplate_default />
</templates>
+ <?lua include("includes/notifications.oxi") ?>
<Scene
ambientlight = "0.8, 0.8, 0.8"
Modified: code/branches/tutoriallevel3/data/levels/events.oxw
===================================================================
--- code/branches/tutoriallevel3/data/levels/events.oxw 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/data/levels/events.oxw 2011-05-28 14:21:14 UTC (rev 8636)
@@ -19,6 +19,7 @@
<templates>
<Template link=lodtemplate_default />
</templates>
+ <?lua include("includes/notifications.oxi") ?>
<Scene
ambientlight = "0.5, 0.5, 0.5"
Modified: code/branches/tutoriallevel3/data/levels/fightInOurBack.oxw
===================================================================
--- code/branches/tutoriallevel3/data/levels/fightInOurBack.oxw 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/data/levels/fightInOurBack.oxw 2011-05-28 14:21:14 UTC (rev 8636)
@@ -67,6 +67,7 @@
<templates>
<Template link=lodtemplate_default />
</templates>
+ <?lua include("includes/notifications.oxi") ?>
<!-- Ausgang: Szene ===> ambientlight/skybox -->
<Scene
Added: code/branches/tutoriallevel3/data/levels/includes/notifications.oxi
===================================================================
--- code/branches/tutoriallevel3/data/levels/includes/notifications.oxi (rev 0)
+++ code/branches/tutoriallevel3/data/levels/includes/notifications.oxi 2011-05-28 14:21:14 UTC (rev 8636)
@@ -0,0 +1,20 @@
+<Script code="showGUI NotificationLayer false true" needsGraphics="true" />
+
+<NotificationQueueCEGUI
+ name="all"
+ targets="questsystem, commandNotification, simpleNotification"
+ displaySize="0.5, 0, 0, 0"
+ position="0, 10, 0.3, 0"
+/>
+
+<NotificationQueueCEGUI
+ name="info"
+ targets="gameinfo"
+ size=1
+ displayTime=-1
+ position="0.2, 0, 0.8, 0"
+ fontSize="24"
+ fontColor="1, 1, 0, 0.8"
+ alignment="HorzCentred"
+ displaySize="0.6, 0, 0, 0"
+/>
\ No newline at end of file
Modified: code/branches/tutoriallevel3/data/levels/lastManStanding.oxw
===================================================================
--- code/branches/tutoriallevel3/data/levels/lastManStanding.oxw 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/data/levels/lastManStanding.oxw 2011-05-28 14:21:14 UTC (rev 8636)
@@ -22,6 +22,7 @@
<templates>
<Template link=lodtemplate_default />
</templates>
+ <?lua include("includes/notifications.oxi") ?>
<Scene
ambientlight = "0.8, 0.8, 0.8"
Modified: code/branches/tutoriallevel3/data/levels/lastTeamStanding.oxw
===================================================================
--- code/branches/tutoriallevel3/data/levels/lastTeamStanding.oxw 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/data/levels/lastTeamStanding.oxw 2011-05-28 14:21:14 UTC (rev 8636)
@@ -26,6 +26,7 @@
ambientlight = "0.8, 0.8, 0.8"
skybox = "Orxonox/skypanoramagen1"
>
+ <?lua include("includes/notifications.oxi") ?>
<?lua
include("includes/pickups.oxi")
Modified: code/branches/tutoriallevel3/data/levels/lastTeamStandingII.oxw
===================================================================
--- code/branches/tutoriallevel3/data/levels/lastTeamStandingII.oxw 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/data/levels/lastTeamStandingII.oxw 2011-05-28 14:21:14 UTC (rev 8636)
@@ -21,6 +21,7 @@
<templates>
<Template link=lodtemplate_default />
</templates>
+ <?lua include("includes/notifications.oxi") ?>
<Scene
ambientlight = "0.8, 0.8, 0.8"
Modified: code/branches/tutoriallevel3/data/levels/notifications.oxw
===================================================================
--- code/branches/tutoriallevel3/data/levels/notifications.oxw 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/data/levels/notifications.oxw 2011-05-28 14:21:14 UTC (rev 8636)
@@ -18,14 +18,13 @@
<templates>
<Template link=lodtemplate_default />
</templates>
+ <?lua include("includes/notifications.oxi") ?>
<Scene
ambientlight = "0.5, 0.5, 0.5"
skybox = "Orxonox/skypanoramagen1"
>
- <Script code="showGUI NotificationLayer false true" needsGraphics="true" />
-
<Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
<CommandNotification preMessage="Open the PickupInventory by pressing '" postMessage="'." command="OrxonoxOverlay toggleVisibility PickupInventory">
Modified: code/branches/tutoriallevel3/data/levels/pickups.oxw
===================================================================
--- code/branches/tutoriallevel3/data/levels/pickups.oxw 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/data/levels/pickups.oxw 2011-05-28 14:21:14 UTC (rev 8636)
@@ -22,6 +22,7 @@
<templates>
<Template link=lodtemplate_default />
</templates>
+ <?lua include("includes/notifications.oxi") ?>
<Scene
ambientlight = "0.8, 0.8, 0.8"
Modified: code/branches/tutoriallevel3/data/levels/pirateAttack.oxw
===================================================================
--- code/branches/tutoriallevel3/data/levels/pirateAttack.oxw 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/data/levels/pirateAttack.oxw 2011-05-28 14:21:14 UTC (rev 8636)
@@ -34,6 +34,7 @@
<templates>
<Template link=lodtemplate_default />
</templates>
+ <?lua include("includes/notifications.oxi") ?>
<Scene
ambientlight = "0.3, 0.3, 0.3"
Modified: code/branches/tutoriallevel3/data/levels/planets.oxw
===================================================================
--- code/branches/tutoriallevel3/data/levels/planets.oxw 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/data/levels/planets.oxw 2011-05-28 14:21:14 UTC (rev 8636)
@@ -18,6 +18,7 @@
<templates>
<Template link="lodtemplate_default" />
</templates>
+ <?lua include("includes/notifications.oxi") ?>
<Scene
ambientlight = "0.8, 0.8, 0.8"
Modified: code/branches/tutoriallevel3/data/levels/pong.oxw
===================================================================
--- code/branches/tutoriallevel3/data/levels/pong.oxw 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/data/levels/pong.oxw 2011-05-28 14:21:14 UTC (rev 8636)
@@ -55,6 +55,7 @@
<templates>
<Template link=lodtemplate_default />
</templates>
+ <?lua include("includes/notifications.oxi") ?>
<WorldAmbientSound source="mainmenu.ogg" playOnLoad=true />
Modified: code/branches/tutoriallevel3/data/levels/presentation.oxw
===================================================================
--- code/branches/tutoriallevel3/data/levels/presentation.oxw 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/data/levels/presentation.oxw 2011-05-28 14:21:14 UTC (rev 8636)
@@ -18,6 +18,7 @@
<templates>
<Template link=lodtemplate_default />
</templates>
+ <?lua include("includes/notifications.oxi") ?>
<Scene
ambientlight = "0.3, 0.3, 0.3"
Modified: code/branches/tutoriallevel3/data/levels/presentation09.oxw
===================================================================
--- code/branches/tutoriallevel3/data/levels/presentation09.oxw 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/data/levels/presentation09.oxw 2011-05-28 14:21:14 UTC (rev 8636)
@@ -20,6 +20,7 @@
<templates>
<Template link=lodtemplate_default />
</templates>
+ <?lua include("includes/notifications.oxi") ?>
<Scene
ambientlight = "0.5, 0.5, 0.5"
Modified: code/branches/tutoriallevel3/data/levels/presentation09b.oxw
===================================================================
--- code/branches/tutoriallevel3/data/levels/presentation09b.oxw 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/data/levels/presentation09b.oxw 2011-05-28 14:21:14 UTC (rev 8636)
@@ -22,6 +22,7 @@
<templates>
<Template link=lodtemplate_default />
</templates>
+ <?lua include("includes/notifications.oxi") ?>
<Scene
ambientlight = "0.5, 0.5, 0.5"
Modified: code/branches/tutoriallevel3/data/levels/presentationDM.oxw
===================================================================
--- code/branches/tutoriallevel3/data/levels/presentationDM.oxw 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/data/levels/presentationDM.oxw 2011-05-28 14:21:14 UTC (rev 8636)
@@ -19,6 +19,7 @@
<templates>
<Template link=lodtemplate_default />
</templates>
+ <?lua include("includes/notifications.oxi") ?>
<Scene
ambientlight = "0.5, 0.5, 0.5"
Modified: code/branches/tutoriallevel3/data/levels/presentationFS10.oxw
===================================================================
--- code/branches/tutoriallevel3/data/levels/presentationFS10.oxw 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/data/levels/presentationFS10.oxw 2011-05-28 14:21:14 UTC (rev 8636)
@@ -25,6 +25,7 @@
<templates>
<Template link=lodtemplate_default />
</templates>
+ <?lua include("includes/notifications.oxi") ?>
<Scene
ambientlight = "0.8, 0.8, 0.8"
Modified: code/branches/tutoriallevel3/data/levels/presentationFS102.oxw
===================================================================
--- code/branches/tutoriallevel3/data/levels/presentationFS102.oxw 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/data/levels/presentationFS102.oxw 2011-05-28 14:21:14 UTC (rev 8636)
@@ -20,6 +20,7 @@
<templates>
<Template link=lodtemplate_default />
</templates>
+ <?lua include("includes/notifications.oxi") ?>
<Scene
ambientlight = "0.1, 0.1, 0.1"
Modified: code/branches/tutoriallevel3/data/levels/presentationFS10Ed.oxw
===================================================================
--- code/branches/tutoriallevel3/data/levels/presentationFS10Ed.oxw 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/data/levels/presentationFS10Ed.oxw 2011-05-28 14:21:14 UTC (rev 8636)
@@ -20,6 +20,7 @@
<templates>
<Template link=lodtemplate_default />
</templates>
+ <?lua include("includes/notifications.oxi") ?>
<Scene
ambientlight = "0.1, 0.1, 0.1"
Modified: code/branches/tutoriallevel3/data/levels/presentationHS09.oxw
===================================================================
--- code/branches/tutoriallevel3/data/levels/presentationHS09.oxw 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/data/levels/presentationHS09.oxw 2011-05-28 14:21:14 UTC (rev 8636)
@@ -23,6 +23,7 @@
<templates>
<Template link=lodtemplate_default />
</templates>
+ <?lua include("includes/notifications.oxi") ?>
<Scene
ambientlight = "0.6, 0.4, 0.4"
Modified: code/branches/tutoriallevel3/data/levels/presentationHS09b.oxw
===================================================================
--- code/branches/tutoriallevel3/data/levels/presentationHS09b.oxw 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/data/levels/presentationHS09b.oxw 2011-05-28 14:21:14 UTC (rev 8636)
@@ -28,6 +28,7 @@
<templates>
<Template link=lodtemplate_default />
</templates>
+ <?lua include("includes/notifications.oxi") ?>
<Scene
ambientlight = "0.8, 0.8, 0.8"
Modified: code/branches/tutoriallevel3/data/levels/princessAeryn.oxw
===================================================================
--- code/branches/tutoriallevel3/data/levels/princessAeryn.oxw 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/data/levels/princessAeryn.oxw 2011-05-28 14:21:14 UTC (rev 8636)
@@ -23,6 +23,7 @@
<templates>
<Template link=lodtemplate_default />
</templates>
+ <?lua include("includes/notifications.oxi") ?>
<Scene
ambientlight = "0.3, 0.3, 0.3"
Modified: code/branches/tutoriallevel3/data/levels/quests.oxw
===================================================================
--- code/branches/tutoriallevel3/data/levels/quests.oxw 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/data/levels/quests.oxw 2011-05-28 14:21:14 UTC (rev 8636)
@@ -18,6 +18,7 @@
<templates>
<Template link=lodtemplate_default />
</templates>
+ <?lua include("includes/notifications.oxi") ?>
<Scene
ambientlight = "0.5, 0.5, 0.5"
Modified: code/branches/tutoriallevel3/data/levels/screenshot.oxw
===================================================================
--- code/branches/tutoriallevel3/data/levels/screenshot.oxw 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/data/levels/screenshot.oxw 2011-05-28 14:21:14 UTC (rev 8636)
@@ -21,6 +21,7 @@
<templates>
<Template link=lodtemplate_default />
</templates>
+ <?lua include("includes/notifications.oxi") ?>
<Scene
ambientlight = "0.7, 0.6, 0.6"
Modified: code/branches/tutoriallevel3/data/levels/sound.oxw
===================================================================
--- code/branches/tutoriallevel3/data/levels/sound.oxw 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/data/levels/sound.oxw 2011-05-28 14:21:14 UTC (rev 8636)
@@ -22,6 +22,7 @@
<templates>
<Template link=lodtemplate_default />
</templates>
+ <?lua include("includes/notifications.oxi") ?>
<Scene
ambientlight = "0.8, 0.8, 0.8"
Modified: code/branches/tutoriallevel3/data/levels/teamBaseMatch.oxw
===================================================================
--- code/branches/tutoriallevel3/data/levels/teamBaseMatch.oxw 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/data/levels/teamBaseMatch.oxw 2011-05-28 14:21:14 UTC (rev 8636)
@@ -22,6 +22,7 @@
<templates>
<Template link=lodtemplate_default />
</templates>
+ <?lua include("includes/notifications.oxi") ?>
<Scene
ambientlight = "0.5, 0.5, 0.5"
Modified: code/branches/tutoriallevel3/data/levels/teamDeathMatch.oxw
===================================================================
--- code/branches/tutoriallevel3/data/levels/teamDeathMatch.oxw 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/data/levels/teamDeathMatch.oxw 2011-05-28 14:21:14 UTC (rev 8636)
@@ -21,6 +21,7 @@
<templates>
<Template link=lodtemplate_default />
</templates>
+ <?lua include("includes/notifications.oxi") ?>
<Scene
ambientlight = "0.7, 0.6, 0.6"
Modified: code/branches/tutoriallevel3/data/levels/testStars.oxw
===================================================================
--- code/branches/tutoriallevel3/data/levels/testStars.oxw 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/data/levels/testStars.oxw 2011-05-28 14:21:14 UTC (rev 8636)
@@ -22,6 +22,7 @@
<templates>
<Template link=lodtemplate_default />
</templates>
+ <?lua include("includes/notifications.oxi") ?>
<Scene
ambientlight = "0.8, 0.8, 0.8"
Modified: code/branches/tutoriallevel3/data/levels/testSwallow.oxw
===================================================================
--- code/branches/tutoriallevel3/data/levels/testSwallow.oxw 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/data/levels/testSwallow.oxw 2011-05-28 14:21:14 UTC (rev 8636)
@@ -21,6 +21,7 @@
<templates>
<Template link=lodtemplate_default />
</templates>
+ <?lua include("includes/notifications.oxi") ?>
<Scene
ambientlight = "0.5, 0.5, 0.5"
Modified: code/branches/tutoriallevel3/data/levels/theTimeMachine.oxw
===================================================================
--- code/branches/tutoriallevel3/data/levels/theTimeMachine.oxw 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/data/levels/theTimeMachine.oxw 2011-05-28 14:21:14 UTC (rev 8636)
@@ -67,6 +67,8 @@
<templates>
<Template link=lodtemplate_default />
</templates>
+ <?lua include("includes/notifications.oxi") ?>
+
<Scene
ambientlight="0.8,0.8,0.8"
skybox="Orxonox/skypanoramagen2"
Modified: code/branches/tutoriallevel3/data/levels/tutorial.oxw
===================================================================
--- code/branches/tutoriallevel3/data/levels/tutorial.oxw 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/data/levels/tutorial.oxw 2011-05-28 14:21:14 UTC (rev 8636)
@@ -18,6 +18,7 @@
<templates>
<Template link=lodtemplate_default />
</templates>
+ <?lua include("includes/notifications.oxi") ?>
<Scene
ambientlight = "0.5, 0.5, 0.5"
Modified: code/branches/tutoriallevel3/data/levels/underAttack.oxw
===================================================================
--- code/branches/tutoriallevel3/data/levels/underAttack.oxw 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/data/levels/underAttack.oxw 2011-05-28 14:21:14 UTC (rev 8636)
@@ -14,6 +14,7 @@
<templates>
<Template link=lodtemplate_default />
</templates>
+ <?lua include("includes/notifications.oxi") ?>
<Scene
ambientlight = "0.5, 0.5, 0.5"
Modified: code/branches/tutoriallevel3/data/levels/waypoints.oxw
===================================================================
--- code/branches/tutoriallevel3/data/levels/waypoints.oxw 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/data/levels/waypoints.oxw 2011-05-28 14:21:14 UTC (rev 8636)
@@ -20,6 +20,7 @@
<templates>
<Template link=lodtemplate_default />
</templates>
+ <?lua include("includes/notifications.oxi") ?>
<Scene
ambientlight = "0.5, 0.5, 0.5"
Modified: code/branches/tutoriallevel3/src/modules/notifications/NotificationManager.cc
===================================================================
--- code/branches/tutoriallevel3/src/modules/notifications/NotificationManager.cc 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/src/modules/notifications/NotificationManager.cc 2011-05-28 14:21:14 UTC (rev 8636)
@@ -410,7 +410,7 @@
*/
void NotificationManager::loadQueues(void)
{
- NotificationQueueCEGUI* allQueue = new NotificationQueueCEGUI("all");
+ /*NotificationQueueCEGUI* allQueue = new NotificationQueueCEGUI("all");
allQueue->setDisplaySize(Vector2(0.5, 0));
allQueue->setPosition(Vector4(0.0, 10, 0.3, 0));
@@ -419,7 +419,7 @@
infoQueue->setFontSize(24);
infoQueue->setFontColor(Vector4(1.0, 1.0, 0.0, 0.8));
infoQueue->setAlignment("HorzCentred");
- infoQueue->setDisplaySize(Vector2(0.6, 0.0));
+ infoQueue->setDisplaySize(Vector2(0.6, 0.0));*/
}
// Notification class
Modified: code/branches/tutoriallevel3/src/modules/notifications/NotificationQueue.cc
===================================================================
--- code/branches/tutoriallevel3/src/modules/notifications/NotificationQueue.cc 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/src/modules/notifications/NotificationQueue.cc 2011-05-28 14:21:14 UTC (rev 8636)
@@ -37,40 +37,81 @@
#include <sstream>
#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
#include "util/SubString.h"
namespace orxonox
{
+ CreateFactory(NotificationQueue);
+
/**
@brief
- Constructor. Creates and initializes the object.
+ Default constructor. Registers and initializes the object.
+ @param creator
+ The creator of the NotificationQueue.
+ */
+ NotificationQueue::NotificationQueue(BaseObject* creator) : BaseObject(creator), registered_(false)
+ {
+ RegisterObject(NotificationQueue);
+
+ this->initialize();
+ }
+
+ // TODO move to docu.
+ /**
+ @brief
+ Constructor. Registers and initializes the object.
+ @param creator
+ The creator of the NotificationQueue
@param name
The name of the new NotificationQueue. It needs to be unique
@param senders
The senders that are targets of this NotificationQueue, i.e. the names of senders whose Notifications this NotificationQueue displays.
- The senders need to be separated by commas.
+ The senders need to be seperated by commas.
@param size
The size (the maximum number of displayed Notifications) of this NotificationQueue.
@param displayTime
The time during which a Notification is (at most) displayed.
*/
- NotificationQueue::NotificationQueue(const std::string& name, const std::string& senders, unsigned int size, unsigned int displayTime)
+
+ /**
+ @brief
+ Destructor.
+ */
+ NotificationQueue::~NotificationQueue()
{
- this->registered_ = false;
+ this->targets_.clear();
- RegisterRootObject(NotificationQueue);
+ if(this->isRegistered()) // If the NotificationQueue is registered.
+ {
+ this->clear(true);
- // Initialize.
+ // Unregister with the NotificationManager.
+ NotificationManager::getInstance().unregisterQueue(this);
+ }
+ }
+
+ /**
+ @brief
+ Initializes the NotificationQueue.
+ */
+ void NotificationQueue::initialize(void)
+ {
this->size_ = 0;
this->tickTime_ = 0.0f;
+ this->maxSize_ = NotificationQueue::DEFAULT_SIZE;
+ this->displayTime_ = NotificationQueue::DEFAULT_DISPLAY_TIME;
- // Sets the input values.
- this->setTargets(senders);
- this->name_ = name;
- this->maxSize_ = size;
- this->setDisplayTime(displayTime);
+ this->creationTime_ = std::time(0);
+ }
+ /**
+ @brief
+ Creates the NotificationQueue.
+ */
+ void NotificationQueue::create(void)
+ {
// Register the NotificationQueue with the NotificationManager.
bool queueRegistered = NotificationManager::getInstance().registerQueue(this);
this->registered_ = true;
@@ -86,25 +127,6 @@
/**
@brief
- Destructor.
- */
- NotificationQueue::~NotificationQueue()
- {
- this->targets_.clear();
-
- if(this->registered_) // If the NotificationQueue is registered.
- {
- this->clear(true);
-
- // Unregister with the NotificationManager.
- NotificationManager::getInstance().unregisterQueue(this);
- }
-
- COUT(3) << "NotificationQueue '" << this->getName() << "' destroyed." << std::endl;
- }
-
- /**
- @brief
Updates the queue from time to time.
@param dt
The time interval that has passed since the last tick.
@@ -114,7 +136,7 @@
this->tickTime_ += dt; // Add the time interval that has passed to the time counter.
if(this->displayTime_ != INF && this->tickTime_ >= 1.0) // If the time counter is greater than 1s all Notifications that have expired are removed, if it is smaller we wait to the next tick.
{
- this->timeLimit_.time = std::time(0)-this->displayTime_; // Container containig the current time.
+ this->timeLimit_.time = std::time(0)-this->displayTime_; // Container containing the current time.
std::multiset<NotificationContainer*, NotificationContainerCompare>::iterator it = this->ordering_.begin();
// Iterate through all elements whose creation time is smaller than the current time minus the display time.
@@ -128,6 +150,17 @@
}
}
+ void NotificationQueue::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(NotificationQueue, XMLPort, xmlelement, mode);
+
+ XMLPortParam(NotificationQueue, "targets", setTargets, getTargets, xmlelement, mode).defaultValues(NotificationListener::ALL);
+ XMLPortParam(NotificationQueue, "size", setMaxSize, getMaxSize, xmlelement, mode);
+ XMLPortParam(NotificationQueue, "displayTime", setDisplayTime, getDisplayTime, xmlelement, mode);
+
+ this->create();
+ }
+
/**
@brief
Updates the NotificationQueue.
@@ -147,9 +180,12 @@
if(!notifications->empty())
{
- // Add all Notifications.
+ // Add all Notifications that have been created after this NotificationQueue was created.
for(std::multimap<std::time_t, Notification*>::iterator it = notifications->begin(); it != notifications->end(); it++)
- this->push(it->second, it->first);
+ {
+ if(it->first >= this->creationTime_)
+ this->push(it->second, it->first);
+ }
}
delete notifications;
@@ -304,9 +340,15 @@
if(this->maxSize_ == size)
return;
+ if(size == 0)
+ {
+ COUT(2) << "Trying to set maximal size of NotificationQueue '" << this->getName() << "' to 0. Ignoring..." << endl;
+ return;
+ }
+
this->maxSize_ = size;
- if(this->registered_)
+ if(this->isRegistered())
this->update();
}
@@ -321,9 +363,14 @@
if(this->displayTime_ == time)
return;
+ if(time != NotificationQueue::INF && time <= 0)
+ {
+ COUT(2) << "Trying to set display time of NotificationQueue '" << this->getName() << "' to non-positive value. Ignoring..." << endl;
+ }
+
this->displayTime_ = time;
- if(this->registered_)
+ if(this->isRegistered())
this->update();
}
@@ -366,7 +413,7 @@
this->targets_.insert(string[i]);
// TODO: Why?
- if(this->registered_)
+ if(this->isRegistered())
{
NotificationManager::getInstance().unregisterQueue(this);
NotificationManager::getInstance().registerQueue(this);
Modified: code/branches/tutoriallevel3/src/modules/notifications/NotificationQueue.h
===================================================================
--- code/branches/tutoriallevel3/src/modules/notifications/NotificationQueue.h 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/src/modules/notifications/NotificationQueue.h 2011-05-28 14:21:14 UTC (rev 8636)
@@ -44,6 +44,7 @@
#include "NotificationManager.h"
+#include "core/BaseObject.h"
#include "tools/interfaces/Tickable.h"
namespace orxonox
@@ -87,40 +88,42 @@
@ingroup Notifications
*/
- class _NotificationsExport NotificationQueue : public Tickable
+ class _NotificationsExport NotificationQueue : public BaseObject, public Tickable
{
public:
- NotificationQueue(const std::string& name, const std::string& senders = NotificationListener::ALL, unsigned int size = NotificationQueue::DEFAULT_SIZE, unsigned int displayTime = NotificationQueue::DEFAULT_DISPLAY_TIME);
+ NotificationQueue(BaseObject* creator);
+ NotificationQueue(BaseObject* creator, const std::string& name, const std::string& senders = NotificationListener::ALL, unsigned int size = NotificationQueue::DEFAULT_SIZE, unsigned int displayTime = NotificationQueue::DEFAULT_DISPLAY_TIME);
virtual ~NotificationQueue();
- virtual void tick(float dt); //!< To update from time to time.
+ virtual void tick(float dt); // To update from time to time.
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
- void update(void); //!< Updates the NotificationQueue.
- void update(Notification* notification, const std::time_t & time); //!< Updates the NotificationQueue by adding an new Notification.
+ void update(void); // Updates the NotificationQueue.
+ void update(Notification* notification, const std::time_t & time); // Updates the NotificationQueue by adding an new Notification.
// tolua_begin
/**
@brief Get the name of the NotificationQueue.
@return Returns the name.
*/
- inline const std::string& getName() const
- { return this->name_; }
+ inline const std::string& getName(void) const
+ { return this->BaseObject::getName(); }
- void setMaxSize(unsigned int size); //!< Sets the maximum number of displayed Notifications.
+ void setMaxSize(unsigned int size); // Sets the maximum number of displayed Notifications.
/**
@brief Returns the maximum number of Notifications displayed.
@return Returns maximum size.
*/
- inline unsigned int getMaxSize() const
+ inline unsigned int getMaxSize(void) const
{ return this->maxSize_; }
- void setDisplayTime(int time); //!< Sets the maximum number of seconds a Notification is displayed.
+ void setDisplayTime(int time); // Sets the maximum number of seconds a Notification is displayed.
/**
@brief Returns the time interval the Notification is displayed.
@return Returns the display time.
*/
- inline int getDisplayTime() const
+ inline int getDisplayTime(void) const
{ return this->displayTime_; }
// tolua_end
@@ -128,19 +131,26 @@
@brief Returns the current number of Notifications displayed.
@return Returns the size of the NotificationQueue.
*/
- inline unsigned int getSize() const
+ inline unsigned int getSize(void) const
{ return this->size_; }
/**
@brief Returns the targets of this NotificationQueue, reps. the senders which Notifications are displayed in this NotificationQueue.
@return Returns a set of strings holding the different targets.
*/
- inline const std::set<std::string> & getTargetsSet()
+ inline const std::set<std::string> & getTargetsSet(void)
{ return this->targets_; }
- void setTargets(const std::string & targets); //!< Set the targets of this NotificationQueue.
- const std::string& getTargets(void) const; //!< Returns a string consisting of the concatenation of the targets.
+ void setTargets(const std::string & targets); // Set the targets of this NotificationQueue.
+ const std::string& getTargets(void) const; // Returns a string consisting of the concatenation of the targets.
+ /**
+ @brief Check whether the NotificationQueue is registered with the NotificationManager.
+ @return Returns true if it is registered, false if not.
+ */
+ inline bool isRegistered(void)
+ { return this->registered_; }
+
bool tidy(void); // Pops all Notifications from the NotificationQueue.
protected:
@@ -159,16 +169,20 @@
*/
virtual void notificationRemoved(unsigned int index) {}
- virtual void clear(bool noGraphics = false); //!< Clears the NotificationQueue by removing all NotificationContainers.
+ virtual void clear(bool noGraphics = false); // Clears the NotificationQueue by removing all NotificationContainers.
protected:
static const unsigned int DEFAULT_SIZE = 5; //!< The default maximum number of Notifications displayed.
static const unsigned int DEFAULT_DISPLAY_TIME = 30; //!< The default display time.
static const int INF = -1; //!< Constant denoting infinity.
+ virtual void create(void); // Creates the NotificationQueue.
+
private:
- std::string name_; //!< The name of the NotificationQueue.
+ void initialize(void); // Initializes the NotificationQueue.
+ time_t creationTime_; // The time this NotificationQueue was created.
+
unsigned int maxSize_; //!< The maximal number of Notifications displayed.
unsigned int size_; //!< The number of Notifications displayed.
int displayTime_; //!< The time a Notification is displayed.
@@ -185,9 +199,9 @@
void setName(const std::string& name); //!< Sets the name of the NotificationQueue.
- void push(Notification* notification, const std::time_t & time); //!< Adds (pushes) a Notification to the NotificationQueue.
- void pop(void); //!< Removes (pops) the least recently added Notification form the NotificationQueue.
- void remove(const std::multiset<NotificationContainer*, NotificationContainerCompare>::iterator& containerIterator); //!< Removes the Notification that is stored in the input NotificationContainer.
+ void push(Notification* notification, const std::time_t & time); // Adds (pushes) a Notification to the NotificationQueue.
+ void pop(void); // Removes (pops) the least recently added Notification form the NotificationQueue.
+ void remove(const std::multiset<NotificationContainer*, NotificationContainerCompare>::iterator& containerIterator); // Removes the Notification that is stored in the input NotificationContainer.
};
Modified: code/branches/tutoriallevel3/src/modules/notifications/NotificationQueueCEGUI.cc
===================================================================
--- code/branches/tutoriallevel3/src/modules/notifications/NotificationQueueCEGUI.cc 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/src/modules/notifications/NotificationQueueCEGUI.cc 2011-05-28 14:21:14 UTC (rev 8636)
@@ -46,29 +46,49 @@
namespace orxonox
{
+ CreateFactory(NotificationQueueCEGUI);
+
// Register tolua_open function when loading the library.
DeclareToluaInterface(Notifications);
/*static*/ const std::string NotificationQueueCEGUI::NOTIFICATION_LAYER("NotificationLayer");
- NotificationQueueCEGUI::NotificationQueueCEGUI(const std::string& name, const std::string& senders, unsigned int size, unsigned int displayTime) : NotificationQueue(name, senders, size, displayTime)
+ NotificationQueueCEGUI::NotificationQueueCEGUI(BaseObject* creator) : NotificationQueue(creator)
{
RegisterObject(NotificationQueueCEGUI);
+ this->initialize();
+ }
+
+ NotificationQueueCEGUI::~NotificationQueueCEGUI()
+ {
+ if(GameMode::showsGraphics())
+ GUIManager::getInstance().getLuaState()->doString(NotificationQueueCEGUI::NOTIFICATION_LAYER + ".removeQueue(\"" + this->getName() + "\")");
+ }
+
+ /**
+ @brief
+ Initializes The NotificationQueueCEGUI.
+ */
+ void NotificationQueueCEGUI::initialize(void)
+ {
this->displaySize_ = Vector4(1.0, 0.0, 0.0, 0.0);
this->position_ = Vector4(0.0, 0.0, 0.0, 0.0);
this->alignment_ = "LeftAligned";
this->fontSize_ = 12;
this->fontColor_ = Vector4(1.0, 1.0, 1.0, 1.0);
this->fontColorStr_ = "FFFFFFFF";
-
- // Create the NotificationQueueCEGUI in lua.
- this->create();
}
-
- NotificationQueueCEGUI::~NotificationQueueCEGUI()
+
+ void NotificationQueueCEGUI::XMLPort(Element& xmlelement, XMLPort::Mode mode)
{
-
+ SUPER(NotificationQueueCEGUI, XMLPort, xmlelement, mode);
+
+ XMLPortParam(NotificationQueueCEGUI, "position", setPosition, getPosition, xmlelement, mode);
+ XMLPortParam(NotificationQueueCEGUI, "fontSize", setFontSize, getFontSize, xmlelement, mode);
+ XMLPortParam(NotificationQueueCEGUI, "fontColor", setFontColor, getFontColor, xmlelement, mode);
+ XMLPortParam(NotificationQueueCEGUI, "alignment", setAlignment, getAlignment, xmlelement, mode);
+ XMLPortParam(NotificationQueueCEGUI, "displaySize", setDisplaySize, getDisplaySize, xmlelement, mode);
}
/**
@@ -265,7 +285,9 @@
*/
void NotificationQueueCEGUI::create(void)
{
- if(GameMode::showsGraphics())
+ this->NotificationQueue::create();
+
+ if(this->isRegistered() && GameMode::showsGraphics())
GUIManager::getInstance().getLuaState()->doString(NotificationQueueCEGUI::NOTIFICATION_LAYER + ".createQueue(\"" + this->getName() + "\", " + multi_cast<std::string>(this->getMaxSize()) + ")");
}
Modified: code/branches/tutoriallevel3/src/modules/notifications/NotificationQueueCEGUI.h
===================================================================
--- code/branches/tutoriallevel3/src/modules/notifications/NotificationQueueCEGUI.h 2011-05-28 14:15:12 UTC (rev 8635)
+++ code/branches/tutoriallevel3/src/modules/notifications/NotificationQueueCEGUI.h 2011-05-28 14:21:14 UTC (rev 8636)
@@ -69,18 +69,15 @@
{ // tolua_export
public:
- NotificationQueueCEGUI(const std::string& name, const std::string& senders = NotificationListener::ALL, unsigned int size = NotificationQueue::DEFAULT_SIZE, unsigned int displayTime = NotificationQueue::DEFAULT_DISPLAY_TIME);
+ NotificationQueueCEGUI(BaseObject* creator);
virtual ~NotificationQueueCEGUI();
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
void destroy(bool noGraphics = false); // Destroys the NotificationQueue.
- /**
- @brief Set the size of the window that displays the NotificationQueue.
- @param size A vector whose first component is the relative width of the window (a value between 0 and 1) and whose second component is the absolute width in pixels (additional to the relative width, can be negative). The height is set such that exactly as many Notifications fit as is the maximum size of the NotificationQueue (in terms of the number of Notifications).
- */
- inline void setDisplaySize(const Vector2& size)
- { this->setDisplaySize(Vector4(size.x, size.y, 0.0, 0.0)); }
void setDisplaySize(const Vector4& size); // Set the size of the window that displays the NotificationQueue.
+
/**
@brief Get the size of the window that displays the NotificationQueue.
@return Returns a vector with the display size.
@@ -129,6 +126,8 @@
static NotificationQueueCEGUI* getQueue(const std::string& name); // tolua_export // Get the NotificationQueueCEGUI with the input name.
protected:
+ virtual void create(void); // Creates the NotificationQueue in lua.
+
virtual void notificationPushed(Notification* notification); // Is called by the NotificationQueue when a notification was pushed
virtual void notificationPopped(void); // Is called by the NotificationQueue when a notification was popped.
virtual void notificationRemoved(unsigned int index); // Is called when a notification was removed.
@@ -145,9 +144,9 @@
unsigned int fontSize_; //!< The font size of the Notifications text.
Vector4 fontColor_; //!< The font color of the Notifications text as a vector, in RGBA form, with values from 0 to 1.
std::string fontColorStr_; //!< The font color of the Notifications text as a string with the ARGB hexadecimal values.
-
- void create(void); // Creates the NotificationQueue in lua.
+ void initialize(void); // Initializes The NotificationQueueCEGUI.
+
}; // tolua_export
} // tolua_export
More information about the Orxonox-commit
mailing list