summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorEugene Mutavchi <emutavchi@productengine.com>2010-02-23 18:48:30 +0200
committerEugene Mutavchi <emutavchi@productengine.com>2010-02-23 18:48:30 +0200
commitbbb6a7efb01623eab72c4d06cc2965f31cceeeac (patch)
tree44c05a150f762c52dba435c8e276c280cc6e7c2f /indra
parent1bd720eefbd37fc123bf8d24f1134c0cb6d00b82 (diff)
Implemented major sub-task EXT-5556 (hard-coded: menu Build > Object > Take. The word "Take" is hard-coded)
--HG-- branch : product-engine
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llviewermenu.cpp38
-rw-r--r--indra/newview/skins/default/xui/en/menu_object.xml28
-rw-r--r--indra/newview/skins/default/xui/en/menu_viewer.xml30
3 files changed, 52 insertions, 44 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 02bde51fb6..15c72fdef1 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -4422,35 +4422,22 @@ bool visible_take_object()
return !is_selection_buy_not_take() && enable_take();
}
+bool tools_visible_buy_object()
+{
+ return is_selection_buy_not_take();
+}
+
+bool tools_visible_take_object()
+{
+ return !is_selection_buy_not_take();
+}
+
class LLToolsEnableBuyOrTake : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
bool is_buy = is_selection_buy_not_take();
bool new_value = is_buy ? enable_buy_object() : enable_take();
-
- // Update label
- std::string label;
- std::string buy_text;
- std::string take_text;
- std::string param = userdata.asString();
- std::string::size_type offset = param.find(",");
- if (offset != param.npos)
- {
- buy_text = param.substr(0, offset);
- take_text = param.substr(offset+1);
- }
- if (is_buy)
- {
- label = buy_text;
- }
- else
- {
- label = take_text;
- }
- gMenuHolder->childSetText("Pie Object Take", label);
- gMenuHolder->childSetText("Menu Object Take", label);
-
return new_value;
}
};
@@ -7802,12 +7789,11 @@ void initialize_menus()
view_listener_t::addMenu(new LLToolsEnableUnlink(), "Tools.EnableUnlink");
view_listener_t::addMenu(new LLToolsEnableBuyOrTake(), "Tools.EnableBuyOrTake");
enable.add("Tools.EnableTakeCopy", boost::bind(&enable_object_take_copy));
+ enable.add("Tools.VisibleBuyObject", boost::bind(&tools_visible_buy_object));
+ enable.add("Tools.VisibleTakeObject", boost::bind(&tools_visible_take_object));
view_listener_t::addMenu(new LLToolsEnableSaveToInventory(), "Tools.EnableSaveToInventory");
view_listener_t::addMenu(new LLToolsEnableSaveToObjectInventory(), "Tools.EnableSaveToObjectInventory");
- /*view_listener_t::addMenu(new LLToolsVisibleBuyObject(), "Tools.VisibleBuyObject");
- view_listener_t::addMenu(new LLToolsVisibleTakeObject(), "Tools.VisibleTakeObject");*/
-
// Help menu
// most items use the ShowFloater method
diff --git a/indra/newview/skins/default/xui/en/menu_object.xml b/indra/newview/skins/default/xui/en/menu_object.xml
index d66818e91a..9436b2cd73 100644
--- a/indra/newview/skins/default/xui/en/menu_object.xml
+++ b/indra/newview/skins/default/xui/en/menu_object.xml
@@ -124,16 +124,28 @@
</menu_item_call>
</context_menu>
<menu_item_separator layout="topleft" />
- <menu_item_call
- enabled="false"
+ <menu_item_call
+ label="Buy"
+ layout="topleft"
+ name="Pie Object Bye">
+ <menu_item_call.on_click
+ function="Tools.BuyOrTake"/>
+ <menu_item_call.on_visible
+ function="Tools.VisibleBuyObject"/>
+ <menu_item_call.on_enable
+ function="Tools.EnableBuyOrTake"/>
+ </menu_item_call>
+ <menu_item_call
label="Take"
+ layout="topleft"
name="Pie Object Take">
- <menu_item_call.on_click
- function="Tools.BuyOrTake" />
- <menu_item_call.on_enable
- function="Tools.EnableBuyOrTake"
- parameter="Buy,Take" />
- </menu_item_call>
+ <menu_item_call.on_click
+ function="Tools.BuyOrTake"/>
+ <menu_item_call.on_visible
+ function="Tools.VisibleTakeObject"/>
+ <menu_item_call.on_enable
+ function="Tools.EnableBuyOrTake"/>
+ </menu_item_call>
<menu_item_call
enabled="false"
label="Take Copy"
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 4c4867b862..158e764eae 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -719,16 +719,26 @@
name="Object"
tear_off="true">
<menu_item_call
- label="Buy"
- layout="topleft"
- name="Menu Object Take"
- visible="true">
- <menu_item_call.on_click
- function="Tools.BuyOrTake" />
- <menu_item_call.on_enable
- function="Tools.EnableBuyOrTake"
- name="EnableBuyOrTake"
- parameter="Buy,Take" />
+ label="Buy"
+ layout="topleft"
+ name="Menu Object Buy">
+ <menu_item_call.on_click
+ function="Tools.BuyOrTake"/>
+ <menu_item_call.on_visible
+ function="Tools.VisibleBuyObject"/>
+ <menu_item_call.on_enable
+ function="Tools.EnableBuyOrTake"/>
+ </menu_item_call>
+ <menu_item_call
+ label="Take"
+ layout="topleft"
+ name="Menu Object Take">
+ <menu_item_call.on_click
+ function="Tools.BuyOrTake"/>
+ <menu_item_call.on_visible
+ function="Tools.VisibleTakeObject"/>
+ <menu_item_call.on_enable
+ function="Tools.EnableBuyOrTake"/>
</menu_item_call>
<menu_item_call
label="Take Copy"