aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorArmin Weatherwax2010-08-27 00:46:11 +0200
committerMcCabe Maxsted2010-08-29 01:29:25 -0700
commita9a37eb135994e3b0b237d99838f3a8f3d4a5ec6 (patch)
treeb19f82f5ed8226d04f1a699c49eabeba1b1cb830
parentKatharine Berry: Don't let people add notecarded windlight entries to the day... (diff)
downloadmeta-impy-a9a37eb135994e3b0b237d99838f3a8f3d4a5ec6.zip
meta-impy-a9a37eb135994e3b0b237d99838f3a8f3d4a5ec6.tar.gz
meta-impy-a9a37eb135994e3b0b237d99838f3a8f3d4a5ec6.tar.bz2
meta-impy-a9a37eb135994e3b0b237d99838f3a8f3d4a5ec6.tar.xz
Katharine Berry: More centralised .wl checks.
-rw-r--r--linden/indra/newview/llinventorybridge.cpp34
-rw-r--r--linden/indra/newview/llinventorybridge.h3
-rwxr-xr-x[-rw-r--r--]linden/indra/newview/llviewermessage.cpp0
3 files changed, 31 insertions, 6 deletions
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()
3065 if (item) 3065 if (item)
3066 { 3066 {
3067 bool is_windlight = (getName().length() > 2 && getName().compare(getName().length() - 3, 3, ".wl") == 0); 3067 bool is_windlight = (getName().length() > 2 && getName().compare(getName().length() - 3, 3, ".wl") == 0);
3068 if(!is_windlight) 3068 if(isSkySetting())
3069 {
3070 LLWLParamManager::instance()->loadPresetNotecard(item->getName(), item->getAssetUUID(), mUUID);
3071 }
3072 else
3073 {
3069 open_notecard(item, getPrefix() + item->getName(), LLUUID::null, FALSE); 3074 open_notecard(item, getPrefix() + item->getName(), LLUUID::null, FALSE);
3075 }
3070 } 3076 }
3071} 3077}
3072 3078
@@ -3089,11 +3095,13 @@ void LLNotecardBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
3089 3095
3090 else 3096 else
3091 { 3097 {
3092 bool is_windlight = (getName().length() > 2 && getName().compare(getName().length() - 3, 3, ".wl") == 0);
3093 3098
3094 if(is_windlight) 3099 if(isWindLight())
3095 { 3100 {
3096 items.push_back(std::string("Use WindLight Settings")); 3101 if(isSkySetting())
3102 {
3103 items.push_back(std::string("Use WindLight Settings"));
3104 }
3097 items.push_back(std::string("Edit WindLight Settings")); 3105 items.push_back(std::string("Edit WindLight Settings"));
3098 } 3106 }
3099 items.push_back(std::string("Properties")); 3107 items.push_back(std::string("Properties"));
@@ -3123,8 +3131,7 @@ void LLNotecardBridge::performAction(LLFolderView* folder, LLInventoryModel* mod
3123 3131
3124LLUIImagePtr LLNotecardBridge::getIcon() const 3132LLUIImagePtr LLNotecardBridge::getIcon() const
3125{ 3133{
3126 bool is_windlight = (getName().length() > 2 && getName().compare(getName().length() - 3, 3, ".wl") == 0); 3134 if(isSkySetting())
3127 if(is_windlight)
3128 { 3135 {
3129 return LLUI::getUIImage("Inv_WindLight"); 3136 return LLUI::getUIImage("Inv_WindLight");
3130 } 3137 }
@@ -3134,6 +3141,21 @@ LLUIImagePtr LLNotecardBridge::getIcon() const
3134 } 3141 }
3135} 3142}
3136 3143
3144bool LLNotecardBridge::isSkySetting() const
3145{
3146 return (getName().length() > 2 && getName().compare(getName().length() - 3, 3, ".wl") == 0);
3147}
3148
3149bool LLNotecardBridge::isWaterSetting() const
3150{
3151 return (getName().length() > 2 && getName().compare(getName().length() - 3, 3, ".ww") == 0);
3152}
3153
3154bool LLNotecardBridge::isWindLight() const
3155{
3156 return (isSkySetting() || isWaterSetting());
3157}
3158
3137// +=================================================+ 3159// +=================================================+
3138// | LLGestureBridge | 3160// | LLGestureBridge |
3139// +=================================================+ 3161// +=================================================+
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:
475 virtual const std::string& getPrefix() { return sPrefix; } 475 virtual const std::string& getPrefix() { return sPrefix; }
476 476
477 virtual LLUIImagePtr getIcon() const; 477 virtual LLUIImagePtr getIcon() const;
478 bool isSkySetting() const;
479 bool isWaterSetting() const;
480 bool isWindLight() const;
478 virtual void openItem(); 481 virtual void openItem();
479 virtual void buildContextMenu(LLMenuGL& menu, U32 flags); 482 virtual void buildContextMenu(LLMenuGL& menu, U32 flags);
480 virtual void performAction(LLFolderView* folder, LLInventoryModel* model, std::string action); 483 virtual void performAction(LLFolderView* folder, LLInventoryModel* model, std::string action);
diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp
index af4b8d8..af4b8d8 100644..100755
--- a/linden/indra/newview/llviewermessage.cpp
+++ b/linden/indra/newview/llviewermessage.cpp