summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llfloaterevent.cpp53
-rw-r--r--indra/newview/llfloaterevent.h3
-rw-r--r--indra/newview/llworldmap.h1
-rw-r--r--indra/newview/skins/default/xui/en/floater_event.xml50
4 files changed, 88 insertions, 19 deletions
diff --git a/indra/newview/llfloaterevent.cpp b/indra/newview/llfloaterevent.cpp
index 64efa10ef9..97ebab3425 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()
{
diff --git a/indra/newview/llfloaterevent.h b/indra/newview/llfloaterevent.h
index 54aaaf6a0f..4126236964 100644
--- a/indra/newview/llfloaterevent.h
+++ b/indra/newview/llfloaterevent.h
@@ -70,7 +70,8 @@ protected:
static void onClickNotify(void*);
void onClickDeleteEvent();
-// static bool callbackCreateEventWebPage(const LLSD& notification, const LLSD& response);
+ static void regionInfoCallback(U32 event_id, U64 region_handle);
+
protected:
U32 mEventID;
diff --git a/indra/newview/llworldmap.h b/indra/newview/llworldmap.h
index 7e37727b86..e4e677eb64 100644
--- a/indra/newview/llworldmap.h
+++ b/indra/newview/llworldmap.h
@@ -123,6 +123,7 @@ public:
bool isName(const std::string& name) const;
bool isDown() { return (mAccess == SIM_ACCESS_DOWN); }
bool isPG() { return (mAccess <= SIM_ACCESS_PG); }
+ bool isAdult() { return (mAccess == SIM_ACCESS_ADULT); }
// Debug only
void dump() const; // Print the region info to the standard output
diff --git a/indra/newview/skins/default/xui/en/floater_event.xml b/indra/newview/skins/default/xui/en/floater_event.xml
index 50f0f0454c..c2fab900e3 100644
--- a/indra/newview/skins/default/xui/en/floater_event.xml
+++ b/indra/newview/skins/default/xui/en/floater_event.xml
@@ -20,6 +20,22 @@
name="dont_notify">
Don&apos;t Notify
</floater.string>
+ <floater.string
+ name="moderate">
+ Moderate
+ </floater.string>
+ <floater.string
+ name="adult">
+ Adult
+ </floater.string>
+ <floater.string
+ name="general">
+ General
+ </floater.string>
+ <floater.string
+ name="unknown">
+ Unknown
+ </floater.string>
<layout_stack
name="layout"
orientation="vertical"
@@ -144,15 +160,33 @@
name="event_location"
use_ellipses="true"
value="SampleParcel, Name Long (145, 228, 26)"
- width="310" />
+ width="310" />
<icon
- follows="top|left"
- height="16"
- image_name="Parcel_PG_Dark"
- layout="topleft"
- left="10"
- name="rating_icon"
- width="18" />
+ follows="top|left"
+ height="16"
+ image_name="Parcel_PG_Dark"
+ layout="topleft"
+ left="10"
+ name="rating_icon_pg"
+ width="18" />
+ <icon
+ follows="top|left"
+ height="16"
+ image_name="Parcel_M_Dark"
+ layout="topleft"
+ left="10"
+ name="rating_icon_m"
+ top_delta="0"
+ width="18" />
+ <icon
+ follows="top|left"
+ height="16"
+ image_name="Parcel_R_Dark"
+ layout="topleft"
+ left="10"
+ name="rating_icon_r"
+ top_delta="0"
+ width="18" />
<text
follows="left|top"
height="16"