[Orxonox-commit 3696] r8377 - in code/branches/tutoriallevel2: data/gui/scripts src/modules/notifications src/modules/questsystem src/orxonox/interfaces
dafrick at orxonox.net
dafrick at orxonox.net
Mon May 2 13:33:24 CEST 2011
Author: dafrick
Date: 2011-05-02 13:33:24 +0200 (Mon, 02 May 2011)
New Revision: 8377
Modified:
code/branches/tutoriallevel2/data/gui/scripts/NotificationLayer.lua
code/branches/tutoriallevel2/src/modules/notifications/NotificationDispatcher.cc
code/branches/tutoriallevel2/src/modules/questsystem/QuestDescription.cc
code/branches/tutoriallevel2/src/orxonox/interfaces/NotificationListener.h
Log:
Text coloring in notification queue now working.
Modified: code/branches/tutoriallevel2/data/gui/scripts/NotificationLayer.lua
===================================================================
--- code/branches/tutoriallevel2/data/gui/scripts/NotificationLayer.lua 2011-05-02 11:31:18 UTC (rev 8376)
+++ code/branches/tutoriallevel2/data/gui/scripts/NotificationLayer.lua 2011-05-02 11:33:24 UTC (rev 8377)
@@ -30,7 +30,7 @@
["edit"] = nil,
["visible"] = false,
["fontSize"] = 12,
- ["fontColor"] = "#FFFFFFFF",
+ ["fontColor"] = "FFFFFFFF",
["items"] = {},
["first"] = 1,
["last"] = 1
@@ -195,7 +195,7 @@
end
-- Change the font size and font color of all notifications in a queueHeightHelper
--- The parameters are (in order) 'name of the queue', 'font size', 'RGBA of the font color in hex notation'.
+-- The parameters are (in order) 'name of the queue', 'font size', 'ARGB of the font color in hex notation'.
function P.changeQueueFont(queueName, size, color)
local queue = P.queueList[queueName]
local queueWindow = queue.window
@@ -226,7 +226,8 @@
item:setFont("BlueHighway-" .. queue.fontSize)
end
if changeColor then
- --item:setProperty("TextColours", "tl:[" .. queue.fontColor .. "] tr:[" .. queue.fontColor .. "] bl:[" .. queue.fontColor .. "] br:[" .. queue.fontColor .. "]")
+ item:setProperty("TextColours", "tl:" .. queue.fontColor .. " tr:" .. queue.fontColor .. " bl:" .. queue.fontColor .. " br:" .. queue.fontColor .. "")
+ cout(0, "tl:[" .. queue.fontColor .. "] tr:[" .. queue.fontColor .. "] bl:[" .. queue.fontColor .. "] br:[" .. queue.fontColor .. "]")
end
end
Modified: code/branches/tutoriallevel2/src/modules/notifications/NotificationDispatcher.cc
===================================================================
--- code/branches/tutoriallevel2/src/modules/notifications/NotificationDispatcher.cc 2011-05-02 11:31:18 UTC (rev 8376)
+++ code/branches/tutoriallevel2/src/modules/notifications/NotificationDispatcher.cc 2011-05-02 11:33:24 UTC (rev 8377)
@@ -112,7 +112,7 @@
if(GameMode::isStandalone() || Host::getPlayerID() == clientId || this->getSyncMode() == 0x0)
{
const std::string message = this->createNotificationMessage();
- NotificationListener::sendNotification(message, clientId, this->getSender());
+ NotificationListener::sendNotification(message, this->getSender(), notificationMessageMode::message, notificationSendMode::network, clientId);
}
else if(GameMode::isServer())
{
Modified: code/branches/tutoriallevel2/src/modules/questsystem/QuestDescription.cc
===================================================================
--- code/branches/tutoriallevel2/src/modules/questsystem/QuestDescription.cc 2011-05-02 11:31:18 UTC (rev 8376)
+++ code/branches/tutoriallevel2/src/modules/questsystem/QuestDescription.cc 2011-05-02 11:33:24 UTC (rev 8377)
@@ -118,7 +118,7 @@
return false;
}
- NotificationListener::sendNotification(message, player->getClientID(), QuestDescription::SENDER);
+ NotificationListener::sendNotification(message, QuestDescription::SENDER, notificationMessageMode::message, notificationSendMode::network, player->getClientID());
return true;
}
Modified: code/branches/tutoriallevel2/src/orxonox/interfaces/NotificationListener.h
===================================================================
--- code/branches/tutoriallevel2/src/orxonox/interfaces/NotificationListener.h 2011-05-02 11:31:18 UTC (rev 8376)
+++ code/branches/tutoriallevel2/src/orxonox/interfaces/NotificationListener.h 2011-05-02 11:33:24 UTC (rev 8377)
@@ -47,7 +47,23 @@
namespace orxonox
{
- class Notification;
+
+ namespace notificationMessageMode
+ {
+ enum Value {
+ message,
+ command
+ };
+ }
+
+ namespace notificationSendMode
+ {
+ enum Value {
+ local,
+ network,
+ broadcast
+ };
+ }
/**
@brief
@@ -70,10 +86,12 @@
static const std::string ALL; //!< Static string to indicate a sender that sends to all NotificationListeners.
static const std::string NONE; //!< Static string to indicare a sender that sends to no specific NotificationListener.
- static void sendNotification(const std::string& message, unsigned int clientId, const std::string& sender = NotificationListener::NONE, bool isLocal = false);
+ static void sendNotification(const std::string& message, const std::string& sender = NotificationListener::NONE, notificationMessageMode::Value messageMode = notificationMessageMode::message, notificationSendMode::Value sendMode = notificationSendMode::local, unsigned int clientId = 0);
+ static void sendNotificationHelper(const std::string& message, const std::string& sender, unsigned int messageMode);
virtual bool registerNotification(const std::string& message, const std::string& sender)
{ return false; }
+ virtual void executeCommand(const std::string& command, const std::string& sender) {}
};
}
More information about the Orxonox-commit
mailing list