From a9a37eb135994e3b0b237d99838f3a8f3d4a5ec6 Mon Sep 17 00:00:00 2001 From: Armin Weatherwax Date: Fri, 27 Aug 2010 00:46:11 +0200 Subject: Katharine Berry: More centralised .wl checks. --- linden/indra/newview/llinventorybridge.cpp | 34 ++++++++++++++++++++++++------ linden/indra/newview/llinventorybridge.h | 3 +++ linden/indra/newview/llviewermessage.cpp | 0 3 files changed, 31 insertions(+), 6 deletions(-) mode change 100644 => 100755 linden/indra/newview/llviewermessage.cpp diff --git a/linden/indra/newview/llinventorybridge.cpp b/linden/indra/newview/llinventorybridge.cpp index db7a955..a3fc36e 100644 --- a/linden/indra/newview/llinventorybridge.cpp +++ b/linden/indra/newview/llinventorybridge.cpp @@ -3065,8 +3065,14 @@ void LLNotecardBridge::openItem() if (item) { bool is_windlight = (getName().length() > 2 && getName().compare(getName().length() - 3, 3, ".wl") == 0); - if(!is_windlight) + if(isSkySetting()) + { + LLWLParamManager::instance()->loadPresetNotecard(item->getName(), item->getAssetUUID(), mUUID); + } + else + { open_notecard(item, getPrefix() + item->getName(), LLUUID::null, FALSE); + } } } @@ -3089,11 +3095,13 @@ void LLNotecardBridge::buildContextMenu(LLMenuGL& menu, U32 flags) else { - bool is_windlight = (getName().length() > 2 && getName().compare(getName().length() - 3, 3, ".wl") == 0); - if(is_windlight) + if(isWindLight()) { - items.push_back(std::string("Use WindLight Settings")); + if(isSkySetting()) + { + items.push_back(std::string("Use WindLight Settings")); + } items.push_back(std::string("Edit WindLight Settings")); } items.push_back(std::string("Properties")); @@ -3123,8 +3131,7 @@ void LLNotecardBridge::performAction(LLFolderView* folder, LLInventoryModel* mod LLUIImagePtr LLNotecardBridge::getIcon() const { - bool is_windlight = (getName().length() > 2 && getName().compare(getName().length() - 3, 3, ".wl") == 0); - if(is_windlight) + if(isSkySetting()) { return LLUI::getUIImage("Inv_WindLight"); } @@ -3134,6 +3141,21 @@ LLUIImagePtr LLNotecardBridge::getIcon() const } } +bool LLNotecardBridge::isSkySetting() const +{ + return (getName().length() > 2 && getName().compare(getName().length() - 3, 3, ".wl") == 0); +} + +bool LLNotecardBridge::isWaterSetting() const +{ + return (getName().length() > 2 && getName().compare(getName().length() - 3, 3, ".ww") == 0); +} + +bool LLNotecardBridge::isWindLight() const +{ + return (isSkySetting() || isWaterSetting()); +} + // +=================================================+ // | LLGestureBridge | // +=================================================+ diff --git a/linden/indra/newview/llinventorybridge.h b/linden/indra/newview/llinventorybridge.h index b703d07..d6001b7 100644 --- a/linden/indra/newview/llinventorybridge.h +++ b/linden/indra/newview/llinventorybridge.h @@ -475,6 +475,9 @@ public: virtual const std::string& getPrefix() { return sPrefix; } virtual LLUIImagePtr getIcon() const; + bool isSkySetting() const; + bool isWaterSetting() const; + bool isWindLight() const; virtual void openItem(); virtual void buildContextMenu(LLMenuGL& menu, U32 flags); virtual void performAction(LLFolderView* folder, LLInventoryModel* model, std::string action); diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp old mode 100644 new mode 100755 -- cgit v1.1