summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermenu.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-07-16 11:23:30 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-07-16 11:23:30 +0100
commit94cae52bb791b8ceef4d55eed8c8726e63572b61 (patch)
tree08955536d1fafbe3c00f260b9786b7bec01fa617 /indra/newview/llviewermenu.cpp
parent565d5dc1a9a4617874710ce7ede82a30c203f03f (diff)
parenta97485fa60f1b1f29d8109b79450ab993880529c (diff)
merge from PE's viewer-release
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rw-r--r--indra/newview/llviewermenu.cpp42
1 files changed, 11 insertions, 31 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 635cc361f3..7cca118392 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -3627,7 +3627,7 @@ class LLEnableEditShape : public view_listener_t
}
};
-bool enable_sit_object()
+bool is_object_sittable()
{
LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject();
@@ -5513,17 +5513,17 @@ bool enable_pay_object()
return false;
}
-bool visible_object_stand_up()
+bool enable_object_stand_up()
{
- // 'Object Stand Up' menu item is visible when agent is sitting on selection
+ // 'Object Stand Up' menu item is enabled when agent is sitting on selection
return sitting_on_selection();
}
-bool visible_object_sit()
+bool enable_object_sit()
{
- // 'Object Sit' menu item is visible when agent is not sitting on selection
- bool is_sit_visible = !sitting_on_selection();
- if (is_sit_visible)
+ // 'Object Sit' menu item is enabled when agent is not sitting on selection
+ bool sitting_on_sel = sitting_on_selection();
+ if (!sitting_on_sel)
{
LLMenuItemGL* sit_menu_item = gMenuHolder->getChild<LLMenuItemGL>("Object Sit");
// Init default 'Object Sit' menu item label
@@ -5541,28 +5541,9 @@ bool visible_object_sit()
}
sit_menu_item->setLabel(label);
}
- return is_sit_visible;
+ return !sitting_on_sel && is_object_sittable();
}
-class LLObjectEnableSitOrStand : public view_listener_t
-{
- bool handleEvent(const LLSD& userdata)
- {
- bool new_value = false;
- LLViewerObject* dest_object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject();
-
- if(dest_object)
- {
- if(dest_object->getPCode() == LL_PCODE_VOLUME)
- {
- new_value = true;
- }
- }
-
- return new_value;
- }
-};
-
void dump_select_mgr(void*)
{
LLSelectMgr::getInstance()->dump();
@@ -8067,7 +8048,7 @@ void initialize_menus()
view_listener_t::addMenu(new LLObjectBuild(), "Object.Build");
commit.add("Object.Touch", boost::bind(&handle_object_touch));
commit.add("Object.SitOrStand", boost::bind(&handle_object_sit_or_stand));
- enable.add("Object.EnableSit", boost::bind(&enable_sit_object));
+ enable.add("Object.EnableGearSit", boost::bind(&is_object_sittable));
commit.add("Object.Delete", boost::bind(&handle_object_delete));
view_listener_t::addMenu(new LLObjectAttachToAvatar(), "Object.AttachToAvatar");
view_listener_t::addMenu(new LLObjectReturn(), "Object.Return");
@@ -8084,12 +8065,11 @@ void initialize_menus()
commit.add("Object.Take", boost::bind(&handle_take));
enable.add("Object.EnableOpen", boost::bind(&enable_object_open));
view_listener_t::addMenu(new LLObjectEnableTouch(), "Object.EnableTouch");
- view_listener_t::addMenu(new LLObjectEnableSitOrStand(), "Object.EnableSitOrStand");
enable.add("Object.EnableDelete", boost::bind(&enable_object_delete));
enable.add("Object.EnableWear", boost::bind(&object_selected_and_point_valid));
- enable.add("Object.StandUpVisible", boost::bind(&visible_object_stand_up));
- enable.add("Object.SitVisible", boost::bind(&visible_object_sit));
+ enable.add("Object.EnableStandUp", boost::bind(&enable_object_stand_up));
+ enable.add("Object.EnableSit", boost::bind(&enable_object_sit));
view_listener_t::addMenu(new LLObjectEnableReturn(), "Object.EnableReturn");
view_listener_t::addMenu(new LLObjectEnableReportAbuse(), "Object.EnableReportAbuse");