From 6d7abb3f97d64d0232e6499cd1e05baa31d73e5c Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 28 Aug 2026 14:03:48 +0300 Subject: #6174 Update and simplify UI --- indra/newview/llfloatermaturitydialog.cpp | 23 +++--- indra/newview/llfloatermaturitydialog.h | 3 +- indra/newview/llviewermessage.cpp | 14 +++- .../default/xui/en/floater_maturity_dialog.xml | 91 +++++++++------------- .../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("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("continue_btn")->setCommitCallback( [this](LLUICtrl*, const LLSD&) { onContinue(); }); getChild("cancel_btn")->setCommitCallback( @@ -59,33 +54,33 @@ void LLFloaterMaturityDialog::onOpen(const LLSD& key) { LLModalDialog::onOpen(key); - mPreviousMaturity = gSavedSettings.getU32("PreferredMaturity"); mRegionAccess = static_cast(key.asInteger()); LLStringUtil::format_map_t args; args["[MATURITY]"] = LLViewerRegion::accessToString(mRegionAccess); getChild("location_rated_lbl")->setText(getString("location_rated_string", args)); - getChild("include_adult_lbl")->setText(getString("update_maturity_string", args)); + getChild("current_maturity_lbl")->setText(getString("update_maturity_string", args)); + getChild("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(mRegionAccess)); gAgent.restartFailedTeleportRequest(); closeFloater(); } void LLFloaterMaturityDialog::onCancel() { - gSavedSettings.setU32("PreferredMaturity", mPreviousMaturity); gAgent.clearTeleportRequest(); closeFloater(); } -void LLFloaterMaturityDialog::updateContinueButton() -{ - U32 current = gSavedSettings.getU32("PreferredMaturity"); - getChild("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(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 @@ + can_close="false" + background_visible="false"> + value="Your current maturity preference doesn't include [MATURITY] content. Allowing it will update your preference."/> + + + name="location_rated_lbl"> + The location you've chosen is rated Adult. + -Your current maturity preference: - - - - - - - - - + Your current maturity preference doesn't include Adult content. Allowing it will update your preference. +