* Add some improvements to check for Vintage skin

* Fix logic for hiding the bottom tool on Vintage that has never actually worked properly due to startup order
master
Ansariel 2025-06-10 14:44:21 +02:00
parent d79188dfe4
commit c6d1422067
6 changed files with 24 additions and 20 deletions

View File

@ -92,10 +92,10 @@ bool FSCommon::is_irc_me_prefix(std::string_view text)
std::string FSCommon::unescape_name(std::string_view name)
{
// bugfix for SL-46920: preventing filenames that break stuff.
char * curl_str = curl_unescape(name.data(), static_cast<int>(name.size())); // Calling data() should be ok here because we also pass the length
char* curl_str = curl_unescape(name.data(), static_cast<int>(name.size())); // Calling data() should be ok here because we also pass the length
std::string unescaped_name(curl_str);
curl_free(curl_str);
curl_str = NULL;
curl_str = nullptr;
return unescaped_name;
}
@ -301,11 +301,12 @@ bool FSCommon::isLinden(const LLUUID& av_id)
if (LLGridManager::getInstance()->isInOpenSim())
{
LLViewerRegion* region = gAgent.getRegion();
if (!region) return false;
bool is_god = false;
if (!region)
return false;
bool is_god{ false };
// <FS:CR> They may not be "Lindens" per se, but opensim has gods.
std::set<std::string> gods = region->getGods();
if (!gods.empty())
if (std::set<std::string> gods = region->getGods(); !gods.empty())
{
is_god = (gods.find(first_name + " " + last_name) != gods.end()
|| gods.find(last_name) != gods.end());
@ -453,7 +454,7 @@ std::string FSCommon::getAvatarNameByDisplaySettings(const LLAvatarName& av_name
std::string name;
static LLCachedControl<bool> NameTagShowUsernames(gSavedSettings, "NameTagShowUsernames");
static LLCachedControl<bool> UseDisplayNames(gSavedSettings, "UseDisplayNames");
if ((NameTagShowUsernames) && (UseDisplayNames))
if (NameTagShowUsernames && UseDisplayNames)
{
name = av_name.getCompleteName();
}
@ -494,21 +495,21 @@ bool FSCommon::isDefaultTexture(const LLUUID& asset_id)
bool FSCommon::isLegacySkin()
{
std::string current_skin = gSavedSettings.getString("FSInternalSkinCurrent");
return (current_skin == "Vintage");
static bool is_legacy_skin = gSavedSettings.getString("FSInternalSkinCurrent") == "Vintage";
return is_legacy_skin;
}
bool FSCommon::isFilterEditorKeyCombo(KEY key, MASK mask)
{
return (mask == MASK_CONTROL && key == 'F' && gSavedSettings.getBOOL("FSSelectLocalSearchEditorOnShortcut"));
static LLCachedControl<bool> select_search_on_shortcut(gSavedSettings, "FSSelectLocalSearchEditorOnShortcut");
return (mask == MASK_CONTROL && key == 'F' && select_search_on_shortcut);
}
LLUUID FSCommon::getGroupForRezzing()
{
LLUUID group_id{ gAgent.getGroupID() };
LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
if (parcel && gSavedSettings.getBOOL("RezUnderLandGroup"))
if (LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); parcel && gSavedSettings.getBOOL("RezUnderLandGroup"))
{
// In both cases, group-owned or not, the group ID is the same;
// No need to query the parcel owner ID as it will be either

View File

@ -307,7 +307,7 @@ S32 LLAgentBenefits::get2KTextureUploadCost(S32 area) const
{
// <FS:Ansariel> OpenSim legacy economy
//return m_texture_upload_cost;
return LLGridManager::instance().isInSecondLife() ? m_texture_upload_cost : LLGlobalEconomy::instance().getPriceUpload();
return getTextureUploadCost();
// </FS:Ansariel>
}
return m_2k_texture_upload_cost[0];

View File

@ -742,6 +742,10 @@ bool idle_startup()
gSavedSettings.setBOOL("FSInternalShowNavbarFavoritesPanel", gSavedSettings.getBOOL("ShowNavbarFavoritesPanel"));
// </FS:Ansariel>
// <FS:Ansariel> Added to determine if toolbar gets hidden when empty
if (gToolBarView)
gToolBarView->setHideBottomOnEmpty(FSCommon::isLegacySkin());
if (LLFeatureManager::getInstance()->isSafe())
{
LLNotificationsUtil::add("DisplaySetToSafe");

View File

@ -131,9 +131,6 @@ bool LLToolBarView::postBuild()
// <FS:Ansariel> Member variable needed for console chat bottom offset
mBottomChatStack = findChild<LLView>("bottom_chat_stack");
// <FS:Ansariel> Added to determine if toolbar gets hidden when empty
mHideBottomOnEmpty = FSCommon::isLegacySkin();
return true;
}

View File

@ -102,9 +102,12 @@ public:
bool isModified() const;
// <FS:Ansariel> Getters for member variables needed for console chat bottom offset
LLView* getBottomChatStack() const { return mBottomChatStack; };
LLView* getBottomChatStack() const { return mBottomChatStack; }
// </FS:Ansariel>
// <FS:Ansariel> Added to determine if toolbar gets hidden when empty
void setHideBottomOnEmpty(bool hideBottomOnEmpty) { mHideBottomOnEmpty = hideBottomOnEmpty; }
protected:
friend class LLUICtrlFactory;
LLToolBarView(const Params&);

View File

@ -7336,10 +7336,9 @@ void LLViewerWindow::setUIVisibility(bool visible)
// Beq Note: Added a skin check to fix FIRE-29517 "hitch when entering mouselook"
// This was caused having to search for a non-existent childview. If another skin other than vintage
// ever needs chat_bar_utility_bar_stack in the future, this will need to be updated.
if (gSavedSettings.getString("FSInternalSkinCurrent") == "Vintage")
if (FSCommon::isLegacySkin())
{
LLView* utilityBarStack = mRootView->findChildView("chat_bar_utility_bar_stack");
if (utilityBarStack)
if (LLView* utilityBarStack = mRootView->findChildView("chat_bar_utility_bar_stack"); utilityBarStack)
{
utilityBarStack->setVisible(visible);
}