summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterevent.cpp
diff options
context:
space:
mode:
authorRoxie Linden <roxie@lindenlab.com>2010-03-01 18:09:04 -0800
committerRoxie Linden <roxie@lindenlab.com>2010-03-01 18:09:04 -0800
commit1147cb1afbc21e1251614895844e95bca9b6b5bc (patch)
treeda01f6c0e6b61a7c0637a371c946ea69b46f9dff /indra/newview/llfloaterevent.cpp
parentb11a625e6ff89470d25273fa426ed13f7abc4a6a (diff)
parent0600083891ab5b2c6a79097f65945bcb2d049bed (diff)
Automated merge from trunk
Diffstat (limited to 'indra/newview/llfloaterevent.cpp')
-rw-r--r--indra/newview/llfloaterevent.cpp53
1 files changed, 43 insertions, 10 deletions
diff --git a/indra/newview/llfloaterevent.cpp b/indra/newview/llfloaterevent.cpp
index 389c4d93a4..84a5c3dc77 100644
--- a/indra/newview/llfloaterevent.cpp
+++ b/indra/newview/llfloaterevent.cpp
@@ -58,6 +58,7 @@
#include "llviewercontrol.h"
#include "llweb.h"
#include "llworldmap.h"
+#include "llworldmapmessage.h"
#include "lluictrlfactory.h"
#include "lltrans.h"
@@ -215,16 +216,15 @@ void LLFloaterEvent::processEventInfoReply(LLMessageSystem *msg, void **)
std::string desc = floater->mEventInfo.mSimName + llformat(" (%d, %d, %d)", region_x, region_y, region_z);
floater->mTBLocation->setText(desc);
- if (floater->mEventInfo.mEventFlags & EVENT_FLAG_MATURE)
- {
- floater->childSetVisible("event_mature_yes", TRUE);
- floater->childSetVisible("event_mature_no", FALSE);
- }
- else
- {
- floater->childSetVisible("event_mature_yes", FALSE);
- floater->childSetVisible("event_mature_no", TRUE);
- }
+ floater->childSetVisible("rating_icon_m", FALSE);
+ floater->childSetVisible("rating_icon_r", FALSE);
+ floater->childSetVisible("rating_icon_pg", FALSE);
+ floater->childSetValue("rating_value", floater->getString("unknown"));
+
+ //for some reason there's not adult flags for now, so see if region is adult and then
+ //set flags
+ LLWorldMapMessage::url_callback_t cb = boost::bind( &regionInfoCallback, floater->mEventInfo.mID, _1);
+ LLWorldMapMessage::getInstance()->sendNamedRegionRequest(floater->mEventInfo.mSimName, cb, std::string("unused"), false);
if (floater->mEventInfo.mUnixTime < time_corrected())
{
@@ -249,6 +249,39 @@ void LLFloaterEvent::processEventInfoReply(LLMessageSystem *msg, void **)
}
}
+//static
+void LLFloaterEvent::regionInfoCallback(U32 event_id, U64 region_handle)
+{
+ LLSimInfo* sim_info = LLWorldMap::getInstance()->simInfoFromHandle(region_handle);
+ LLFloaterEvent* floater = LLFloaterReg::getTypedInstance<LLFloaterEvent>("event");
+
+ if (sim_info && floater && (event_id == floater->getEventID()))
+ {
+ // update the event with the maturity info
+ if (sim_info->isAdult())
+ {
+ floater->childSetVisible("rating_icon_m", FALSE);
+ floater->childSetVisible("rating_icon_r", TRUE);
+ floater->childSetVisible("rating_icon_pg", FALSE);
+ floater->childSetValue("rating_value", floater->getString("adult"));
+
+ }
+ else if (floater->mEventInfo.mEventFlags & EVENT_FLAG_MATURE)
+ {
+ floater->childSetVisible("rating_icon_m", TRUE);
+ floater->childSetVisible("rating_icon_r", FALSE);
+ floater->childSetVisible("rating_icon_pg", FALSE);
+ floater->childSetValue("rating_value", floater->getString("moderate"));
+ }
+ else
+ {
+ floater->childSetVisible("rating_icon_m", FALSE);
+ floater->childSetVisible("rating_icon_r", FALSE);
+ floater->childSetVisible("rating_icon_pg", TRUE);
+ floater->childSetValue("rating_value", floater->getString("general"));
+ }
+ }
+}
void LLFloaterEvent::draw()
{