Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions indra/llui/lltextbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ LLTextBase::Params::Params()
track_end("track_end", false),
read_only("read_only", false),
skip_link_underline("skip_link_underline", false),
link_color("link_color"),
spellcheck("spellcheck", false),
v_pad("v_pad", 0),
h_pad("h_pad", 0),
Expand Down Expand Up @@ -196,6 +197,8 @@ LLTextBase::LLTextBase(const LLTextBase::Params &p)
mReadOnly(p.read_only),
mSkipTripleClick(false),
mSkipLinkUnderline(p.skip_link_underline),
mHasLinkColor(p.link_color.isProvided()),
mLinkColor(p.link_color.isProvided() ? p.link_color() : LLUIColor()),
mSpellCheck(p.spellcheck),
mSpellCheckStart(-1),
mSpellCheckEnd(-1),
Expand Down Expand Up @@ -2426,6 +2429,11 @@ void LLTextBase::appendTextImpl(const std::string& new_text, const LLStyle::Para

LLStyle::Params link_params(style_params);
link_params.overwriteFrom(match.getStyle());
if (mHasLinkColor)
{
link_params.color = mLinkColor;
link_params.readonly_color = mLinkColor;
}

// output the text before the Url
if (start > 0)
Expand Down
5 changes: 4 additions & 1 deletion indra/llui/lltextbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,8 @@ class LLTextBase
bg_writeable_color,
bg_focus_color,
text_selected_color,
bg_selected_color;
bg_selected_color,
link_color;

Optional<bool> bg_visible,
border_visible,
Expand Down Expand Up @@ -777,6 +778,8 @@ class LLTextBase
bool mAlwaysShowIcons;

bool mSkipLinkUnderline;
bool mHasLinkColor;
LLUIColor mLinkColor;

// support widgets
LLHandle<LLContextMenu> mPopupMenuHandle;
Expand Down
2 changes: 2 additions & 0 deletions indra/newview/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ set(viewer_SOURCE_FILES
llfloaterloadprefpreset.cpp
llfloatermarketplacelistings.cpp
llfloatermap.cpp
llfloatermaturitydialog.cpp
llfloatermediasettings.cpp
llfloatermemleak.cpp
llfloatermodelpreview.cpp
Expand Down Expand Up @@ -948,6 +949,7 @@ set(viewer_HEADER_FILES
llfloatermap.h
llfloatermarketplace.h
llfloatermarketplacelistings.h
llfloatermaturitydialog.h
llfloatermediasettings.h
llfloatermemleak.h
llfloatermodelpreview.h
Expand Down
86 changes: 86 additions & 0 deletions indra/newview/llfloatermaturitydialog.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/**
* @file llfloatermaturitydialog.cpp
* @brief LLFloaterMaturityDialog class implementation
*
* $LicenseInfo:firstyear=2026&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2026, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/

#include "llviewerprecompiledheaders.h"

#include "llfloatermaturitydialog.h"

#include "llbutton.h"
#include "llagent.h"
#include "lltextbox.h"
#include "llviewercontrol.h"
#include "llviewerregion.h"

LLFloaterMaturityDialog::LLFloaterMaturityDialog(const LLSD& key)
: LLModalDialog(key, true)
{
}

bool LLFloaterMaturityDialog::postBuild()
{
setCanDrag(false);
getChild<LLButton>("continue_btn")->setCommitCallback(
[this](LLUICtrl*, const LLSD&) { onContinue(); });
getChild<LLButton>("cancel_btn")->setCommitCallback(
[this](LLUICtrl*, const LLSD&) { onCancel(); });

return true;
}

void LLFloaterMaturityDialog::onOpen(const LLSD& key)
{
LLModalDialog::onOpen(key);

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>("current_maturity_lbl")->setText(getString("update_maturity_string", args));
getChild<LLButton>("continue_btn")->setLabel(getString("allow_maturity_string", args));

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()
{
gAgent.clearTeleportRequest();
closeFloater();
}

47 changes: 47 additions & 0 deletions indra/newview/llfloatermaturitydialog.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/**
* @file llfloatermaturitydialog.h
* @brief LLFloaterMaturityDialog class definition
*
* $LicenseInfo:firstyear=2026&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2026, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/

#pragma once

#include "llmodaldialog.h"

class LLFloaterMaturityDialog : public LLModalDialog
{
friend class LLFloaterReg;
public:
bool postBuild() override;
void onOpen(const LLSD& key) override;
void draw() override;

private:
LLFloaterMaturityDialog(const LLSD& key);
~LLFloaterMaturityDialog() = default;

void onContinue();
void onCancel();

U8 mRegionAccess = SIM_ACCESS_ADULT;
};
2 changes: 2 additions & 0 deletions indra/newview/llviewerfloaterreg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
#include "llfloatermap.h"
#include "llfloatermarketplace.h"
#include "llfloatermarketplacelistings.h"
#include "llfloatermaturitydialog.h"
#include "llfloatermediasettings.h"
#include "llfloatermemleak.h"
#include "llfloatermodelpreview.h"
Expand Down Expand Up @@ -424,6 +425,7 @@ void LLViewerFloaterReg::registerFloaters()
LLFloaterReg::add("marketplace", "floater_marketplace.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMarketplace>);
LLFloaterReg::add("marketplace_listings", "floater_marketplace_listings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMarketplaceListings>);
LLFloaterReg::add("marketplace_validation", "floater_marketplace_validation.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMarketplaceValidation>);
LLFloaterReg::add("maturity_dialog", "floater_maturity_dialog.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMaturityDialog>);
LLFloaterReg::add("message_critical", "floater_critical.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterTOS>);
LLFloaterReg::add("message_tos", "floater_tos.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterTOS>);
LLFloaterReg::add("moveview", "floater_moveview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMove>);
Expand Down
34 changes: 27 additions & 7 deletions indra/newview/llviewermessage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4928,10 +4928,12 @@ 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;

LLNotificationPtr tp_failure_notification;
bool skip_notif = false;
std::string notifySuffix;

if (notificationID == std::string("TeleportEntryAccessBlocked"))
Expand Down Expand Up @@ -5001,21 +5003,39 @@ bool handle_teleport_access_blocked(LLSD& llsdBlock, const std::string & notific
}
} // End of special handling for "TeleportEntryAccessBlocked"
else
{ // Normal case, no message munging
gAgent.clearTeleportRequest();
if (LLNotifications::getInstance()->templateExists(notificationID))
{
if (notificationID == "RegionTPAccessBlocked")
{
tp_failure_notification = LLNotificationsUtil::add(notificationID, llsdBlock, llsdBlock);
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
{
llsdBlock["MESSAGE"] = defaultMessage;
tp_failure_notification = LLNotificationsUtil::add("GenericAlertOK", llsdBlock);
// Normal case, no message munging
gAgent.clearTeleportRequest();
if (LLNotifications::getInstance()->templateExists(notificationID))
{
tp_failure_notification = LLNotificationsUtil::add(notificationID, llsdBlock, llsdBlock);
}
else
{
llsdBlock["MESSAGE"] = defaultMessage;
tp_failure_notification = LLNotificationsUtil::add("GenericAlertOK", llsdBlock);
}
}
returnValue = true;
}

if ((tp_failure_notification == NULL) || tp_failure_notification->isIgnored())
if (((tp_failure_notification == NULL) || tp_failure_notification->isIgnored()) && !skip_notif)
{
// Given a simple notification if no tp_failure_notification is set or it is ignore
LLNotificationsUtil::add(notificationID + notifySuffix, llsdBlock);
Expand Down
100 changes: 100 additions & 0 deletions indra/newview/skins/default/xui/en/floater_maturity_dialog.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater
height="185"
width="540"
layout="topleft"
name="floater_maturity_dialog"
title="MATURITY"
show_title="false"
header_height="0"
bg_opaque_image="Window_NoTitle_Foreground"
bg_alpha_image="Window_NoTitle_Background"
can_resize="false"
can_drag_on_left="false"
can_minimize="false"
single_instance="true"
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="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"
follows="top|left|right"
font="SansSerifMediumBold"
text_color="White"
layout="topleft"
left="20"
height="18"
top="20"
right="-10"
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="20"
height="32"
top_pad="10"
right="-10"
word_wrap="true"
name="current_maturity_lbl">
Your current maturity preference doesn't include Adult content. Allowing it will update your preference.
</text>

<button
follows="top|left"
layout="topleft"
height="28"
label="Allow content"
left="20"
top_pad="18"
name="continue_btn"
width="245" />

<button
follows="top|left"
layout="topleft"
height="28"
label="Cancel"
left_pad="10"
name="cancel_btn"
width="245" />

<text
type="string"
length="1"
follows="top|left|right"
text_color="White"
link_color="White"
layout="topleft"
left="20"
height="16"
top_pad="25"
right="-10"
parse_urls="true"
name="learn_more_lbl">
[https://lindenlab.freshdesk.com/support/solutions/articles/31000135220-i-can-t-access-adult-land-and-content- Learn more] about maturity ratings.
</text>

</floater>
11 changes: 11 additions & 0 deletions indra/newview/skins/default/xui/en/notifications.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5689,6 +5689,17 @@ You won't receive any more notifications that you're about to visit a region wit
yestext="OK"/>
</notification>

<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"
Expand Down
Loading