From 8da4875a718f55546942aca1f1a9a049989793f1 Mon Sep 17 00:00:00 2001 From: Armin Weatherwax Date: Fri, 27 Aug 2010 02:03:17 +0200 Subject: Katharine Berry: Use correct icons for WindLight in inventory --- linden/indra/newview/llpanelinventory.cpp | 43 +++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/linden/indra/newview/llpanelinventory.cpp b/linden/indra/newview/llpanelinventory.cpp index 85f6ea2..333b83f 100644 --- a/linden/indra/newview/llpanelinventory.cpp +++ b/linden/indra/newview/llpanelinventory.cpp @@ -1377,6 +1377,9 @@ public: virtual LLUIImagePtr getIcon() const; virtual void openItem(); virtual BOOL removeItem(); + bool isSkySetting() const; + bool isWaterSetting() const; + bool isWindLight() const; }; LLTaskNotecardBridge::LLTaskNotecardBridge( @@ -1387,11 +1390,6 @@ LLTaskNotecardBridge::LLTaskNotecardBridge( { } -LLUIImagePtr LLTaskNotecardBridge::getIcon() const -{ - return get_item_icon(LLAssetType::AT_NOTECARD, LLInventoryType::IT_NOTECARD, 0, FALSE); -} - void LLTaskNotecardBridge::openItem() { if(LLPreview::show(mUUID)) @@ -1410,6 +1408,10 @@ void LLTaskNotecardBridge::openItem() return; } // [/RLVa:KB] + if(isWindLight()) + { + return; + } if(object->permModify() || gAgent.isGodlike()) { S32 left, top; @@ -1434,6 +1436,37 @@ BOOL LLTaskNotecardBridge::removeItem() LLPreview::hide(mUUID); return LLTaskInvFVBridge::removeItem(); } +LLUIImagePtr LLTaskNotecardBridge::getIcon() const +{ + if(isSkySetting()) + { + return LLUI::getUIImage("Inv_WindLight"); + } + else if(isWaterSetting()) + { + return LLUI::getUIImage("Inv_WaterLight"); + } + else + { + return get_item_icon(LLAssetType::AT_NOTECARD, LLInventoryType::IT_NOTECARD, 0, FALSE); + } +} + +bool LLTaskNotecardBridge::isSkySetting() const +{ + return (getName().length() > 2 && getName().compare(getName().length() - 3, 3, ".wl") == 0); +} + +bool LLTaskNotecardBridge::isWaterSetting() const +{ + return (getName().length() > 2 && getName().compare(getName().length() - 3, 3, ".ww") == 0); +} + +bool LLTaskNotecardBridge::isWindLight() const +{ + return (isSkySetting() || isWaterSetting()); +} + ///---------------------------------------------------------------------------- /// Class LLTaskGestureBridge -- cgit v1.1