Skip to content

Commit c6d1422

Browse files
committed
* 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
1 parent d79188d commit c6d1422

6 files changed

Lines changed: 24 additions & 20 deletions

File tree

indra/newview/fscommon.cpp

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ bool FSCommon::is_irc_me_prefix(std::string_view text)
9292
std::string FSCommon::unescape_name(std::string_view name)
9393
{
9494
// bugfix for SL-46920: preventing filenames that break stuff.
95-
char * curl_str = curl_unescape(name.data(), static_cast<int>(name.size())); // Calling data() should be ok here because we also pass the length
95+
char* curl_str = curl_unescape(name.data(), static_cast<int>(name.size())); // Calling data() should be ok here because we also pass the length
9696
std::string unescaped_name(curl_str);
9797
curl_free(curl_str);
98-
curl_str = NULL;
98+
curl_str = nullptr;
9999

100100
return unescaped_name;
101101
}
@@ -301,11 +301,12 @@ bool FSCommon::isLinden(const LLUUID& av_id)
301301
if (LLGridManager::getInstance()->isInOpenSim())
302302
{
303303
LLViewerRegion* region = gAgent.getRegion();
304-
if (!region) return false;
305-
bool is_god = false;
304+
if (!region)
305+
return false;
306+
307+
bool is_god{ false };
306308
// <FS:CR> They may not be "Lindens" per se, but opensim has gods.
307-
std::set<std::string> gods = region->getGods();
308-
if (!gods.empty())
309+
if (std::set<std::string> gods = region->getGods(); !gods.empty())
309310
{
310311
is_god = (gods.find(first_name + " " + last_name) != gods.end()
311312
|| gods.find(last_name) != gods.end());
@@ -453,7 +454,7 @@ std::string FSCommon::getAvatarNameByDisplaySettings(const LLAvatarName& av_name
453454
std::string name;
454455
static LLCachedControl<bool> NameTagShowUsernames(gSavedSettings, "NameTagShowUsernames");
455456
static LLCachedControl<bool> UseDisplayNames(gSavedSettings, "UseDisplayNames");
456-
if ((NameTagShowUsernames) && (UseDisplayNames))
457+
if (NameTagShowUsernames && UseDisplayNames)
457458
{
458459
name = av_name.getCompleteName();
459460
}
@@ -494,21 +495,21 @@ bool FSCommon::isDefaultTexture(const LLUUID& asset_id)
494495

495496
bool FSCommon::isLegacySkin()
496497
{
497-
std::string current_skin = gSavedSettings.getString("FSInternalSkinCurrent");
498-
return (current_skin == "Vintage");
498+
static bool is_legacy_skin = gSavedSettings.getString("FSInternalSkinCurrent") == "Vintage";
499+
return is_legacy_skin;
499500
}
500501

501502
bool FSCommon::isFilterEditorKeyCombo(KEY key, MASK mask)
502503
{
503-
return (mask == MASK_CONTROL && key == 'F' && gSavedSettings.getBOOL("FSSelectLocalSearchEditorOnShortcut"));
504+
static LLCachedControl<bool> select_search_on_shortcut(gSavedSettings, "FSSelectLocalSearchEditorOnShortcut");
505+
return (mask == MASK_CONTROL && key == 'F' && select_search_on_shortcut);
504506
}
505507

506508
LLUUID FSCommon::getGroupForRezzing()
507509
{
508510
LLUUID group_id{ gAgent.getGroupID() };
509-
LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
510511

511-
if (parcel && gSavedSettings.getBOOL("RezUnderLandGroup"))
512+
if (LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); parcel && gSavedSettings.getBOOL("RezUnderLandGroup"))
512513
{
513514
// In both cases, group-owned or not, the group ID is the same;
514515
// No need to query the parcel owner ID as it will be either

indra/newview/llagentbenefits.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ S32 LLAgentBenefits::get2KTextureUploadCost(S32 area) const
307307
{
308308
// <FS:Ansariel> OpenSim legacy economy
309309
//return m_texture_upload_cost;
310-
return LLGridManager::instance().isInSecondLife() ? m_texture_upload_cost : LLGlobalEconomy::instance().getPriceUpload();
310+
return getTextureUploadCost();
311311
// </FS:Ansariel>
312312
}
313313
return m_2k_texture_upload_cost[0];

indra/newview/llstartup.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,10 @@ bool idle_startup()
742742
gSavedSettings.setBOOL("FSInternalShowNavbarFavoritesPanel", gSavedSettings.getBOOL("ShowNavbarFavoritesPanel"));
743743
// </FS:Ansariel>
744744

745+
// <FS:Ansariel> Added to determine if toolbar gets hidden when empty
746+
if (gToolBarView)
747+
gToolBarView->setHideBottomOnEmpty(FSCommon::isLegacySkin());
748+
745749
if (LLFeatureManager::getInstance()->isSafe())
746750
{
747751
LLNotificationsUtil::add("DisplaySetToSafe");

indra/newview/lltoolbarview.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,6 @@ bool LLToolBarView::postBuild()
131131
// <FS:Ansariel> Member variable needed for console chat bottom offset
132132
mBottomChatStack = findChild<LLView>("bottom_chat_stack");
133133

134-
// <FS:Ansariel> Added to determine if toolbar gets hidden when empty
135-
mHideBottomOnEmpty = FSCommon::isLegacySkin();
136-
137134
return true;
138135
}
139136

indra/newview/lltoolbarview.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,12 @@ class LLToolBarView : public LLUICtrl
102102
bool isModified() const;
103103

104104
// <FS:Ansariel> Getters for member variables needed for console chat bottom offset
105-
LLView* getBottomChatStack() const { return mBottomChatStack; };
105+
LLView* getBottomChatStack() const { return mBottomChatStack; }
106106
// </FS:Ansariel>
107107

108+
// <FS:Ansariel> Added to determine if toolbar gets hidden when empty
109+
void setHideBottomOnEmpty(bool hideBottomOnEmpty) { mHideBottomOnEmpty = hideBottomOnEmpty; }
110+
108111
protected:
109112
friend class LLUICtrlFactory;
110113
LLToolBarView(const Params&);

indra/newview/llviewerwindow.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7336,10 +7336,9 @@ void LLViewerWindow::setUIVisibility(bool visible)
73367336
// Beq Note: Added a skin check to fix FIRE-29517 "hitch when entering mouselook"
73377337
// This was caused having to search for a non-existent childview. If another skin other than vintage
73387338
// ever needs chat_bar_utility_bar_stack in the future, this will need to be updated.
7339-
if (gSavedSettings.getString("FSInternalSkinCurrent") == "Vintage")
7339+
if (FSCommon::isLegacySkin())
73407340
{
7341-
LLView* utilityBarStack = mRootView->findChildView("chat_bar_utility_bar_stack");
7342-
if (utilityBarStack)
7341+
if (LLView* utilityBarStack = mRootView->findChildView("chat_bar_utility_bar_stack"); utilityBarStack)
73437342
{
73447343
utilityBarStack->setVisible(visible);
73457344
}

0 commit comments

Comments
 (0)