diff options
| author | Mnikolenko Productengine <mnikolenko@productengine.com> | 2026-08-28 14:03:48 +0300 |
|---|---|---|
| committer | Mnikolenko Productengine <mnikolenko@productengine.com> | 2026-08-28 14:04:37 +0300 |
| commit | 6d7abb3f97d64d0232e6499cd1e05baa31d73e5c (patch) | |
| tree | 288622869f9fafff7c95eb92058453db7fc79c93 | |
| parent | 14833e7f291985f722a5ed8a12f799e9c2a35078 (diff) | |
#6174 Update and simplify UI
| -rw-r--r-- | indra/newview/llfloatermaturitydialog.cpp | 23 | ||||
| -rw-r--r-- | indra/newview/llfloatermaturitydialog.h | 3 | ||||
| -rw-r--r-- | indra/newview/llviewermessage.cpp | 14 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/floater_maturity_dialog.xml | 91 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/notifications.xml | 11 |
5 files changed, 69 insertions, 73 deletions
diff --git a/indra/newview/llfloatermaturitydialog.cpp b/indra/newview/llfloatermaturitydialog.cpp index c93ce88fba..afa9a70024 100644 --- a/indra/newview/llfloatermaturitydialog.cpp +++ b/indra/newview/llfloatermaturitydialog.cpp @@ -29,7 +29,6 @@ #include "llfloatermaturitydialog.h" #include "llbutton.h" -#include "llcombobox.h" #include "llagent.h" #include "lltextbox.h" #include "llviewercontrol.h" @@ -43,10 +42,6 @@ LLFloaterMaturityDialog::LLFloaterMaturityDialog(const LLSD& key) bool LLFloaterMaturityDialog::postBuild() { setCanDrag(false); - LLComboBox* combo = getChild<LLComboBox>("maturity_combo"); - combo->setCommitCallback([this](LLUICtrl*, const LLSD&) { updateContinueButton(); }); - // Ensure the dropdown list renders on top of buttons and labels below the combo - sendChildToFront(combo); getChild<LLButton>("continue_btn")->setCommitCallback( [this](LLUICtrl*, const LLSD&) { onContinue(); }); getChild<LLButton>("cancel_btn")->setCommitCallback( @@ -59,33 +54,33 @@ void LLFloaterMaturityDialog::onOpen(const LLSD& key) { LLModalDialog::onOpen(key); - mPreviousMaturity = gSavedSettings.getU32("PreferredMaturity"); mRegionAccess = static_cast<U8>(key.asInteger()); LLStringUtil::format_map_t args; args["[MATURITY]"] = LLViewerRegion::accessToString(mRegionAccess); getChild<LLTextBox>("location_rated_lbl")->setText(getString("location_rated_string", args)); - getChild<LLTextBox>("include_adult_lbl")->setText(getString("update_maturity_string", args)); + getChild<LLTextBox>("current_maturity_lbl")->setText(getString("update_maturity_string", args)); + getChild<LLButton>("continue_btn")->setLabel(getString("allow_maturity_string", args)); - updateContinueButton(); centerOnScreen(); } +void LLFloaterMaturityDialog::draw() +{ + // Skip floater shadow/background; icon child provides the visual background + LLView::draw(); +} + void LLFloaterMaturityDialog::onContinue() { + gSavedSettings.setU32("PreferredMaturity", static_cast<U32>(mRegionAccess)); gAgent.restartFailedTeleportRequest(); closeFloater(); } void LLFloaterMaturityDialog::onCancel() { - gSavedSettings.setU32("PreferredMaturity", mPreviousMaturity); gAgent.clearTeleportRequest(); closeFloater(); } -void LLFloaterMaturityDialog::updateContinueButton() -{ - U32 current = gSavedSettings.getU32("PreferredMaturity"); - getChild<LLButton>("continue_btn")->setEnabled(current >= mRegionAccess); -} diff --git a/indra/newview/llfloatermaturitydialog.h b/indra/newview/llfloatermaturitydialog.h index 9b888bed22..4ca1a53c2a 100644 --- a/indra/newview/llfloatermaturitydialog.h +++ b/indra/newview/llfloatermaturitydialog.h @@ -34,6 +34,7 @@ class LLFloaterMaturityDialog : public LLModalDialog public: bool postBuild() override; void onOpen(const LLSD& key) override; + void draw() override; private: LLFloaterMaturityDialog(const LLSD& key); @@ -41,8 +42,6 @@ private: void onContinue(); void onCancel(); - void updateContinueButton(); U8 mRegionAccess = SIM_ACCESS_ADULT; - U32 mPreviousMaturity = SIM_ACCESS_PG; }; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 059a71c044..240de962e6 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -4928,6 +4928,7 @@ bool handle_teleport_access_blocked(LLSD& llsdBlock, const std::string & notific { U8 regionAccess = static_cast<U8>(llsdBlock["_region_access"].asInteger()); std::string regionMaturity = LLViewerRegion::accessToString(regionAccess); + llsdBlock["REGIONMATURITY_CAP"] = regionMaturity; LLStringUtil::toLower(regionMaturity); llsdBlock["REGIONMATURITY"] = regionMaturity; @@ -5005,8 +5006,17 @@ bool handle_teleport_access_blocked(LLSD& llsdBlock, const std::string & notific { if (notificationID == "RegionTPAccessBlocked") { - LLFloaterReg::showInstance("maturity_dialog", LLSD((S32)regionAccess)); - skip_notif = true; + bool can_change_maturity = (regionAccess == SIM_ACCESS_MATURE) ? gAgent.isMature() : gAgent.isAdult(); + if (can_change_maturity) + { + LLFloaterReg::showInstance("maturity_dialog", LLSD((S32)regionAccess)); + skip_notif = true; + } + else + { + gAgent.clearTeleportRequest(); + tp_failure_notification = LLNotificationsUtil::add("RegionTPAccessBlocked_NotifyAdultsOnly", llsdBlock); + } } else { diff --git a/indra/newview/skins/default/xui/en/floater_maturity_dialog.xml b/indra/newview/skins/default/xui/en/floater_maturity_dialog.xml index 2ad39c683f..35769534ac 100644 --- a/indra/newview/skins/default/xui/en/floater_maturity_dialog.xml +++ b/indra/newview/skins/default/xui/en/floater_maturity_dialog.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <floater - height="220" - width="430" + height="185" + width="540" layout="topleft" name="floater_maturity_dialog" title="MATURITY" @@ -13,13 +13,26 @@ can_drag_on_left="false" can_minimize="false" single_instance="true" - can_close="false"> + can_close="false" + background_visible="false"> <floater.string name="location_rated_string" value="The location you've chosen is rated [MATURITY]."/> <floater.string name="update_maturity_string" - value="Include [MATURITY] in your maturity preference to continue."/> + value="Your current maturity preference doesn't include [MATURITY] content. Allowing it will update your preference."/> + <floater.string + name="allow_maturity_string" + value="Allow [MATURITY] content"/> + <icon + color="FloaterFocusBackgroundColor" + follows="left|right|bottom|top" + image_name="Rounded_Square" + layout="topleft" + left="0" + top="0" + height="185" + width="540"/> <text type="string" length="1" @@ -27,78 +40,46 @@ font="SansSerifMediumBold" text_color="White" layout="topleft" - left="15" + left="20" height="18" - top="15" + top="20" right="-10" - name="location_rated_lbl"/> + name="location_rated_lbl"> + The location you've chosen is rated Adult. + </text> <text type="string" length="1" follows="top|left|right" text_color="White" layout="topleft" - left="15" - height="16" + left="20" + height="32" top_pad="10" right="-10" + word_wrap="true" name="current_maturity_lbl"> -Your current maturity preference: - </text> - - <combo_box - control_name="PreferredMaturity" - follows="top|left" - height="23" - layout="topleft" - left="16" - top_pad="8" - name="maturity_combo" - width="192"> - <combo_box.item - label="General, Moderate, Adult" - name="Desired_Adult" - value="42" /> - <combo_box.item - label="General and Moderate" - name="Desired_Mature" - value="21" /> - <combo_box.item - label="General" - name="Desired_PG" - value="13" /> - </combo_box> - - <text - type="string" - length="1" - follows="top|left|right" - text_color="White" - layout="topleft" - left="15" - height="16" - top_pad="18" - right="-10" - name="include_adult_lbl"/> + Your current maturity preference doesn't include Adult content. Allowing it will update your preference. + </text> <button follows="top|left" layout="topleft" - height="23" - label="Continue to location" - left="65" - top_pad="20" + height="28" + label="Allow content" + left="20" + top_pad="18" name="continue_btn" - width="155" /> + width="245" /> <button follows="top|left" layout="topleft" - height="24" + height="28" label="Cancel" left_pad="10" name="cancel_btn" - width="155" /> + width="245" /> <text type="string" @@ -107,9 +88,9 @@ Your current maturity preference: text_color="White" link_color="White" layout="topleft" - left="15" + left="20" height="16" - top_pad="28" + top_pad="25" right="-10" parse_urls="true" name="learn_more_lbl"> diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 733734a0d2..51a42f0ce7 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -5691,6 +5691,17 @@ You won't receive any more notifications that you're about to visit a region wit <notification icon="alertmodal.tga" + name="RegionTPAccessBlocked_NotifyAdultsOnly" + type="alertmodal"> + <tag>fail</tag> + The region you are trying to visit is rated [REGIONMATURITY_CAP], which is not available on your account type. + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + + <notification + icon="alertmodal.tga" name="LandClaimAccessBlocked" type="alertmodal"> The land you're trying to claim has a maturity rating exceeding your current preferences. You can change your preferences using Me > Preferences > General. |
