summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermenu.cpp
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2010-02-11 10:09:23 -0800
committerJames Cook <james@lindenlab.com>2010-02-11 10:09:23 -0800
commit9dd7924b19651abf393f7b0dee632904a6b8e52a (patch)
treeb22f8ca3ecdf4ec8e5288102912dccdd7289f51f /indra/newview/llviewermenu.cpp
parent301f250c1cd77711c0234d8ed4089453712f834e (diff)
parent39fe664b97b946daf7984b946fede6f04ae731c4 (diff)
Merge
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rw-r--r--indra/newview/llviewermenu.cpp78
1 files changed, 39 insertions, 39 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 6f6932367f..7fc7f2101a 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -603,6 +603,10 @@ class LLAdvancedToggleHUDInfo : public view_listener_t
{
gDisplayFOV = !(gDisplayFOV);
}
+ else if ("badge" == info_type)
+ {
+ gDisplayBadge = !(gDisplayBadge);
+ }
return true;
}
};
@@ -625,6 +629,10 @@ class LLAdvancedCheckHUDInfo : public view_listener_t
{
new_value = gDisplayFOV;
}
+ else if ("badge" == info_type)
+ {
+ new_value = gDisplayBadge;
+ }
return new_value;
}
};
@@ -5267,7 +5275,7 @@ class LLWorldCreateLandmark : public view_listener_t
void handle_look_at_selection(const LLSD& param)
{
- const F32 PADDING_FACTOR = 2.f;
+ const F32 PADDING_FACTOR = 1.75f;
BOOL zoom = (param.asString() == "zoom");
if (!LLSelectMgr::getInstance()->getSelection()->isEmpty())
{
@@ -5287,9 +5295,14 @@ void handle_look_at_selection(const LLSD& param)
}
if (zoom)
{
+ // Make sure we are not increasing the distance between the camera and object
+ LLVector3d orig_distance = gAgent.getCameraPositionGlobal() - LLSelectMgr::getInstance()->getSelectionCenterGlobal();
+ distance = llmin(distance, (F32) orig_distance.length());
+
gAgent.setCameraPosAndFocusGlobal(LLSelectMgr::getInstance()->getSelectionCenterGlobal() + LLVector3d(obj_to_cam * distance),
LLSelectMgr::getInstance()->getSelectionCenterGlobal(),
object_id );
+
}
else
{
@@ -5529,50 +5542,55 @@ void handle_buy_currency()
LLFloaterBuyCurrency::buyCurrency();
}
-
-
-class LLFloaterVisible : public view_listener_t
+class LLShowHelp : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
- std::string floater_name = userdata.asString();
- bool new_value = false;
- {
- new_value = LLFloaterReg::instanceVisible(floater_name);
- }
- return new_value;
+ std::string help_topic = userdata.asString();
+ LLViewerHelp* vhelp = LLViewerHelp::getInstance();
+ vhelp->showTopic(help_topic);
+ return true;
}
};
-class LLShowHelp : public view_listener_t
+class LLShowSidetrayPanel : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
- std::string help_topic = userdata.asString();
- LLViewerHelp* vhelp = LLViewerHelp::getInstance();
- vhelp->showTopic(help_topic);
+ std::string panel_name = userdata.asString();
+ // Toggle the panel
+ if (!LLSideTray::getInstance()->isPanelActive(panel_name))
+ {
+ // LLFloaterInventory::showAgentInventory();
+ LLSideTray::getInstance()->showPanel(panel_name, LLSD());
+ }
+ else
+ {
+ LLSideTray::getInstance()->collapseSideBar();
+ }
return true;
}
};
-class LLShowSidetrayPanel : public view_listener_t
+class LLSidetrayPanelVisible : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
std::string panel_name = userdata.asString();
- // Open up either the sidepanel or new floater.
+ // Toggle the panel
if (LLSideTray::getInstance()->isPanelActive(panel_name))
{
- LLFloaterInventory::showAgentInventory();
+ return true;
}
else
{
- LLSideTray::getInstance()->showPanel(panel_name, LLSD());
+ return false;
}
- return true;
+
}
};
+
bool callback_show_url(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
@@ -7122,25 +7140,7 @@ void handle_buy_currency_test(void*)
LLStringUtil::format_map_t replace;
replace["[AGENT_ID]"] = gAgent.getID().asString();
replace["[SESSION_ID]"] = gAgent.getSecureSessionID().asString();
-
- // *TODO: Replace with call to LLUI::getLanguage() after windows-setup
- // branch merges in. JC
- std::string language = "en";
- language = gSavedSettings.getString("Language");
- if (language.empty() || language == "default")
- {
- language = gSavedSettings.getString("InstallLanguage");
- }
- if (language.empty() || language == "default")
- {
- language = gSavedSettings.getString("SystemLanguage");
- }
- if (language.empty() || language == "default")
- {
- language = "en";
- }
-
- replace["[LANGUAGE]"] = language;
+ replace["[LANGUAGE]"] = LLUI::getLanguage();
LLStringUtil::format(url, replace);
llinfos << "buy currency url " << url << llendl;
@@ -7972,8 +7972,8 @@ void initialize_menus()
enable.add("EnableEdit", boost::bind(&enable_object_edit));
enable.add("VisibleBuild", boost::bind(&enable_object_build));
- view_listener_t::addMenu(new LLFloaterVisible(), "FloaterVisible");
view_listener_t::addMenu(new LLShowSidetrayPanel(), "ShowSidetrayPanel");
+ view_listener_t::addMenu(new LLSidetrayPanelVisible(), "SidetrayPanelVisible");
view_listener_t::addMenu(new LLSomethingSelected(), "SomethingSelected");
view_listener_t::addMenu(new LLSomethingSelectedNoHUD(), "SomethingSelectedNoHUD");
view_listener_t::addMenu(new LLEditableSelected(), "EditableSelected");