summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorAndrew Polunin <apolunin@gmail.com>2010-06-03 18:59:16 +0300
committerAndrew Polunin <apolunin@gmail.com>2010-06-03 18:59:16 +0300
commit5609f78f456a2919aa6eba76955a2438689c0689 (patch)
treec40dde84f6e72ec52e82872be6ddbcfa2f8bfb7a /indra
parent68d729dfe2c63a931c52b0f49a92bf18a270ff52 (diff)
EXT-5808 FIXED Mini-Location panel was added below Navigation Bar
- Implemented class LLPanelTopInfoBar (llpaneltopinfobar.h, llpaneltopinfobar.cpp, panel_topinfo_bar.xml). Most of it's implementation is borrowed from LLLocationInputCtrl class. - Mini-Location panel is turned off by default. - Added top bar context menu option \"Show Mini-Location Panel\". - Mini-Location panel displays the same context menu as top bar. - Added code to initialize LLPanelTopInfoBar in llviewerwindow.cpp. - Added declaration of the widget in main_view.xml Reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/464/ --HG-- branch : product-engine
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/CMakeLists.txt2
-rw-r--r--indra/newview/app_settings/settings.xml11
-rw-r--r--indra/newview/llnavigationbar.cpp2
-rw-r--r--indra/newview/llpaneltopinfobar.cpp393
-rw-r--r--indra/newview/llpaneltopinfobar.h154
-rw-r--r--indra/newview/llviewercontrol.cpp8
-rw-r--r--indra/newview/llviewerwindow.cpp15
-rw-r--r--indra/newview/skins/default/xui/en/main_view.xml11
-rw-r--r--indra/newview/skins/default/xui/en/menu_hide_navbar.xml19
-rw-r--r--indra/newview/skins/default/xui/en/panel_topinfo_bar.xml102
10 files changed, 713 insertions, 4 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index b00104c427..7dbe650625 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -356,6 +356,7 @@ set(viewer_SOURCE_FILES
llpanelprofileview.cpp
llpanelteleporthistory.cpp
llpaneltiptoast.cpp
+ llpaneltopinfobar.cpp
llpanelvolume.cpp
llpanelvolumepulldown.cpp
llparcelselection.cpp
@@ -871,6 +872,7 @@ set(viewer_HEADER_FILES
llpanelprofileview.h
llpanelteleporthistory.h
llpaneltiptoast.h
+ llpaneltopinfobar.h
llpanelvolume.h
llpanelvolumepulldown.h
llparcelselection.h
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index e86f50ce20..d06e24c0b6 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -8349,6 +8349,17 @@
<key>Value</key>
<integer>0</integer>
</map>
+ <key>ShowMiniLocationPanel</key>
+ <map>
+ <key>Comment</key>
+ <string>Show/Hide Mini-Location Panel</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
<key>SidebarCameraMovement</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp
index e5548007bd..fce666c9d4 100644
--- a/indra/newview/llnavigationbar.cpp
+++ b/indra/newview/llnavigationbar.cpp
@@ -48,6 +48,7 @@
#include "lllandmarkactions.h"
#include "lllocationhistory.h"
#include "lllocationinputctrl.h"
+#include "llpaneltopinfobar.h"
#include "llteleporthistory.h"
#include "llsearchcombobox.h"
#include "llsidetray.h"
@@ -714,6 +715,7 @@ void LLNavigationBar::onNavigationButtonHeldUp(LLButton* nav_button)
void LLNavigationBar::handleLoginComplete()
{
LLTeleportHistory::getInstance()->handleLoginComplete();
+ LLPanelTopInfoBar::instance().handleLoginComplete();
mCmbLocation->handleLoginComplete();
}
diff --git a/indra/newview/llpaneltopinfobar.cpp b/indra/newview/llpaneltopinfobar.cpp
new file mode 100644
index 0000000000..7cf574b6e5
--- /dev/null
+++ b/indra/newview/llpaneltopinfobar.cpp
@@ -0,0 +1,393 @@
+/**
+ * @file llpaneltopinfobar.cpp
+ * @brief Coordinates and Parcel Settings information panel definition
+ *
+ * $LicenseInfo:firstyear=2010&license=viewergpl$
+ *
+ * Copyright (c) 2010, Linden Research, Inc.
+ *
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab. Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ *
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at
+ * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ *
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ *
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llpaneltopinfobar.h"
+
+#include "llagent.h"
+#include "llagentui.h"
+#include "lllocationinputctrl.h"
+#include "llnotificationsutil.h"
+#include "llparcel.h"
+#include "llsidetray.h"
+#include "llstatusbar.h"
+#include "llviewercontrol.h"
+#include "llviewermenu.h"
+#include "llviewerparcelmgr.h"
+#include "llviewerregion.h"
+
+class LLPanelTopInfoBar::LLParcelChangeObserver : public LLParcelObserver
+{
+public:
+ LLParcelChangeObserver(LLPanelTopInfoBar* topInfoBar) : mTopInfoBar(topInfoBar) {}
+
+private:
+ /*virtual*/ void changed()
+ {
+ if (mTopInfoBar)
+ {
+ mTopInfoBar->updateParcelIcons();
+ }
+ }
+
+ LLPanelTopInfoBar* mTopInfoBar;
+};
+
+LLPanelTopInfoBar::LLPanelTopInfoBar(): mParcelChangedObserver(0)
+{
+ LLUICtrlFactory::getInstance()->buildPanel(this, "panel_topinfo_bar.xml");
+}
+
+LLPanelTopInfoBar::~LLPanelTopInfoBar()
+{
+ if (mParcelChangedObserver)
+ {
+ LLViewerParcelMgr::getInstance()->removeObserver(mParcelChangedObserver);
+ delete mParcelChangedObserver;
+ }
+
+ if (mParcelPropsCtrlConnection.connected())
+ {
+ mParcelPropsCtrlConnection.disconnect();
+ }
+
+ if (mParcelMgrConnection.connected())
+ {
+ mParcelMgrConnection.disconnect();
+ }
+
+ if (mShowCoordsCtrlConnection.connected())
+ {
+ mShowCoordsCtrlConnection.disconnect();
+ }
+}
+
+void LLPanelTopInfoBar::initParcelIcons()
+{
+ mParcelIcon[VOICE_ICON] = getChild<LLIconCtrl>("voice_icon");
+ mParcelIcon[FLY_ICON] = getChild<LLIconCtrl>("fly_icon");
+ mParcelIcon[PUSH_ICON] = getChild<LLIconCtrl>("push_icon");
+ mParcelIcon[BUILD_ICON] = getChild<LLIconCtrl>("build_icon");
+ mParcelIcon[SCRIPTS_ICON] = getChild<LLIconCtrl>("scripts_icon");
+ mParcelIcon[DAMAGE_ICON] = getChild<LLIconCtrl>("damage_icon");
+
+ mParcelIcon[VOICE_ICON]->setMouseDownCallback(boost::bind(&LLPanelTopInfoBar::onParcelIconClick, this, VOICE_ICON));
+ mParcelIcon[FLY_ICON]->setMouseDownCallback(boost::bind(&LLPanelTopInfoBar::onParcelIconClick, this, FLY_ICON));
+ mParcelIcon[PUSH_ICON]->setMouseDownCallback(boost::bind(&LLPanelTopInfoBar::onParcelIconClick, this, PUSH_ICON));
+ mParcelIcon[BUILD_ICON]->setMouseDownCallback(boost::bind(&LLPanelTopInfoBar::onParcelIconClick, this, BUILD_ICON));
+ mParcelIcon[SCRIPTS_ICON]->setMouseDownCallback(boost::bind(&LLPanelTopInfoBar::onParcelIconClick, this, SCRIPTS_ICON));
+ mParcelIcon[DAMAGE_ICON]->setMouseDownCallback(boost::bind(&LLPanelTopInfoBar::onParcelIconClick, this, DAMAGE_ICON));
+
+ mDamageText->setText(LLStringExplicit("100%"));
+}
+
+void LLPanelTopInfoBar::handleLoginComplete()
+{
+ // An agent parcel update hasn't occurred yet, so
+ // we have to manually set location and the icons.
+ update();
+}
+
+BOOL LLPanelTopInfoBar::handleRightMouseDown(S32 x, S32 y, MASK mask)
+{
+ show_navbar_context_menu(this, x, y);
+ return TRUE;
+}
+
+BOOL LLPanelTopInfoBar::postBuild()
+{
+ mInfoBtn = getChild<LLButton>("place_info_btn");
+ mInfoBtn->setClickedCallback(boost::bind(&LLPanelTopInfoBar::onInfoButtonClicked, this));
+
+ mParcelInfoText = getChild<LLTextBox>("parcel_info_text");
+ mDamageText = getChild<LLTextBox>("damage_text");
+
+ initParcelIcons();
+
+ mParcelChangedObserver = new LLParcelChangeObserver(this);
+ LLViewerParcelMgr::getInstance()->addObserver(mParcelChangedObserver);
+
+ // Connecting signal for updating parcel icons on "Show Parcel Properties" setting change.
+ LLControlVariable* ctrl = gSavedSettings.getControl("NavBarShowParcelProperties").get();
+ if (ctrl)
+ {
+ mParcelPropsCtrlConnection = ctrl->getSignal()->connect(boost::bind(&LLPanelTopInfoBar::updateParcelIcons, this));
+ }
+
+ // Connecting signal for updating parcel text on "Show Coordinates" setting change.
+ ctrl = gSavedSettings.getControl("NavBarShowCoordinates").get();
+ if (ctrl)
+ {
+ mShowCoordsCtrlConnection = ctrl->getSignal()->connect(boost::bind(&LLPanelTopInfoBar::onNavBarShowParcelPropertiesCtrlChanged, this));
+ }
+
+ mParcelMgrConnection = LLViewerParcelMgr::getInstance()->addAgentParcelChangedCallback(
+ boost::bind(&LLPanelTopInfoBar::onAgentParcelChange, this));
+
+ return TRUE;
+}
+
+void LLPanelTopInfoBar::onNavBarShowParcelPropertiesCtrlChanged()
+{
+ std::string new_text;
+
+ // don't need to have separate show_coords variable; if user requested the coords to be shown
+ // they will be added during the next call to the draw() method.
+ buildLocationString(new_text, false);
+ setParcelInfoText(new_text);
+}
+
+void LLPanelTopInfoBar::draw()
+{
+ updateParcelInfoText();
+ updateHealth();
+
+ LLPanel::draw();
+}
+
+void LLPanelTopInfoBar::buildLocationString(std::string& loc_str, bool show_coords)
+{
+ LLAgentUI::ELocationFormat format =
+ (show_coords ? LLAgentUI::LOCATION_FORMAT_FULL : LLAgentUI::LOCATION_FORMAT_NO_COORDS);
+
+ if (!LLAgentUI::buildLocationString(loc_str, format))
+ {
+ loc_str = "???";
+ }
+}
+
+void LLPanelTopInfoBar::setParcelInfoText(const std::string& new_text)
+{
+ const LLFontGL* font = mParcelInfoText->getDefaultFont();
+ S32 new_text_width = font->getWidth(new_text);
+
+ mParcelInfoText->setText(new_text);
+
+ LLRect rect = mParcelInfoText->getRect();
+ rect.setOriginAndSize(rect.mLeft, rect.mBottom, new_text_width, rect.getHeight());
+
+ mParcelInfoText->reshape(rect.getWidth(), rect.getHeight(), TRUE);
+ mParcelInfoText->setRect(rect);
+ layoutParcelIcons();
+}
+
+void LLPanelTopInfoBar::update()
+{
+ std::string new_text;
+
+ // don't need to have separate show_coords variable; if user requested the coords to be shown
+ // they will be added during the next call to the draw() method.
+ buildLocationString(new_text, false);
+ setParcelInfoText(new_text);
+
+ updateParcelIcons();
+}
+
+void LLPanelTopInfoBar::updateParcelInfoText()
+{
+ static LLUICachedControl<bool> show_coords("NavBarShowCoordinates", false);
+
+ if (show_coords)
+ {
+ std::string new_text;
+
+ buildLocationString(new_text, show_coords);
+ setParcelInfoText(new_text);
+ }
+}
+
+void LLPanelTopInfoBar::updateParcelIcons()
+{
+ LLViewerParcelMgr* vpm = LLViewerParcelMgr::getInstance();
+
+ LLViewerRegion* agent_region = gAgent.getRegion();
+ LLParcel* agent_parcel = vpm->getAgentParcel();
+ if (!agent_region || !agent_parcel)
+ return;
+
+ if (gSavedSettings.getBOOL("NavBarShowParcelProperties"))
+ {
+ LLParcel* current_parcel;
+ LLViewerRegion* selection_region = vpm->getSelectionRegion();
+ LLParcel* selected_parcel = vpm->getParcelSelection()->getParcel();
+
+ // If agent is in selected parcel we use its properties because
+ // they are updated more often by LLViewerParcelMgr than agent parcel properties.
+ // See LLViewerParcelMgr::processParcelProperties().
+ // This is needed to reflect parcel restrictions changes without having to leave
+ // the parcel and then enter it again. See EXT-2987
+ if (selected_parcel && selected_parcel->getLocalID() == agent_parcel->getLocalID()
+ && selection_region == agent_region)
+ {
+ current_parcel = selected_parcel;
+ }
+ else
+ {
+ current_parcel = agent_parcel;
+ }
+
+ bool allow_voice = vpm->allowAgentVoice(agent_region, current_parcel);
+ bool allow_fly = vpm->allowAgentFly(agent_region, current_parcel);
+ bool allow_push = vpm->allowAgentPush(agent_region, current_parcel);
+ bool allow_build = vpm->allowAgentBuild(current_parcel); // true when anyone is allowed to build. See EXT-4610.
+ bool allow_scripts = vpm->allowAgentScripts(agent_region, current_parcel);
+ bool allow_damage = vpm->allowAgentDamage(agent_region, current_parcel);
+
+ // Most icons are "block this ability"
+ mParcelIcon[VOICE_ICON]->setVisible( !allow_voice );
+ mParcelIcon[FLY_ICON]->setVisible( !allow_fly );
+ mParcelIcon[PUSH_ICON]->setVisible( !allow_push );
+ mParcelIcon[BUILD_ICON]->setVisible( !allow_build );
+ mParcelIcon[SCRIPTS_ICON]->setVisible( !allow_scripts );
+ mParcelIcon[DAMAGE_ICON]->setVisible( allow_damage );
+ mDamageText->setVisible(allow_damage);
+
+ layoutParcelIcons();
+ }
+ else
+ {
+ for (S32 i = 0; i < ICON_COUNT; ++i)
+ {
+ mParcelIcon[i]->setVisible(false);
+ }
+ mDamageText->setVisible(false);
+ }
+}
+
+void LLPanelTopInfoBar::updateHealth()
+{
+ static LLUICachedControl<bool> show_icons("NavBarShowParcelProperties", false);
+
+ // *FIXME: Status bar owns health information, should be in agent
+ if (show_icons && gStatusBar)
+ {
+ static S32 last_health = -1;
+ S32 health = gStatusBar->getHealth();
+ if (health != last_health)
+ {
+ std::string text = llformat("%d%%", health);
+ mDamageText->setText(text);
+ last_health = health;
+ }
+ }
+}
+
+void LLPanelTopInfoBar::layoutParcelIcons()
+{
+ // TODO: remove hard-coded values and read them as xml parameters
+ static const int FIRST_ICON_HPAD = 32;
+ static const int LAST_ICON_HPAD = 11;
+
+ S32 left = mParcelInfoText->getRect().mRight + FIRST_ICON_HPAD;
+
+ left = layoutWidget(mDamageText, left);
+
+ for (int i = ICON_COUNT - 1; i >= 0; --i)
+ {
+ left = layoutWidget(mParcelIcon[i], left);
+ }
+
+ LLRect rect = getRect();
+ rect.set(rect.mLeft, rect.mTop, left + LAST_ICON_HPAD, rect.mBottom);
+ setRect(rect);
+}
+
+S32 LLPanelTopInfoBar::layoutWidget(LLUICtrl* ctrl, S32 left)
+{
+ // TODO: remove hard-coded values and read them as xml parameters
+ static const int ICON_HPAD = 2;
+
+ if (ctrl->getVisible())
+ {
+ LLRect rect = ctrl->getRect();
+ rect.mRight = left + rect.getWidth();
+ rect.mLeft = left;
+
+ ctrl->setRect(rect);
+ left += rect.getWidth() + ICON_HPAD;
+ }
+
+ return left;
+}
+
+void LLPanelTopInfoBar::onParcelIconClick(EParcelIcon icon)
+{
+ switch (icon)
+ {
+ case VOICE_ICON:
+ LLNotificationsUtil::add("NoVoice");
+ break;
+ case FLY_ICON:
+ LLNotificationsUtil::add("NoFly");
+ break;
+ case PUSH_ICON:
+ LLNotificationsUtil::add("PushRestricted");
+ break;
+ case BUILD_ICON:
+ LLNotificationsUtil::add("NoBuild");
+ break;
+ case SCRIPTS_ICON:
+ {
+ LLViewerRegion* region = gAgent.getRegion();
+ if(region && region->getRegionFlags() & REGION_FLAGS_ESTATE_SKIP_SCRIPTS)
+ {
+ LLNotificationsUtil::add("ScriptsStopped");
+ }
+ else if(region && region->getRegionFlags() & REGION_FLAGS_SKIP_SCRIPTS)
+ {
+ LLNotificationsUtil::add("ScriptsNotRunning");
+ }
+ else
+ {
+ LLNotificationsUtil::add("NoOutsideScripts");
+ }
+ break;
+ }
+ case DAMAGE_ICON:
+ LLNotificationsUtil::add("NotSafe");
+ break;
+ case ICON_COUNT:
+ break;
+ // no default to get compiler warning when a new icon gets added
+ }
+}
+
+void LLPanelTopInfoBar::onAgentParcelChange()
+{
+ update();
+}
+
+void LLPanelTopInfoBar::onInfoButtonClicked()
+{
+ LLSideTray::getInstance()->showPanel("panel_places", LLSD().with("type", "agent"));
+}
diff --git a/indra/newview/llpaneltopinfobar.h b/indra/newview/llpaneltopinfobar.h
new file mode 100644
index 0000000000..4a85bbcd76
--- /dev/null
+++ b/indra/newview/llpaneltopinfobar.h
@@ -0,0 +1,154 @@
+/**
+ * @file llpaneltopinfobar.h
+ * @brief Coordinates and Parcel Settings information panel definition
+ *
+ * $LicenseInfo:firstyear=2010&license=viewergpl$
+ *
+ * Copyright (c) 2010, Linden Research, Inc.
+ *
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab. Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ *
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at
+ * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ *
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ *
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
+ * $/LicenseInfo$
+ */
+
+#ifndef LLPANELTOPINFOBAR_H_
+#define LLPANELTOPINFOBAR_H_
+
+#include "llpanel.h"
+
+class LLButton;
+class LLTextBox;
+class LLIconCtrl;
+class LLParcelChangeObserver;
+
+class LLPanelTopInfoBar : public LLPanel, public LLSingleton<LLPanelTopInfoBar>
+{
+ LOG_CLASS(LLPanelTopInfoBar);
+
+public:
+ LLPanelTopInfoBar();
+ ~LLPanelTopInfoBar();
+
+ /*virtual*/ BOOL postBuild();
+ /*virtual*/ void draw();
+
+ /**
+ * Updates location and parcel icons on login complete
+ */
+ void handleLoginComplete();
+
+private:
+ class LLParcelChangeObserver;
+
+ friend class LLParcelChangeObserver;
+
+ enum EParcelIcon
+ {
+ VOICE_ICON = 0,
+ FLY_ICON,
+ PUSH_ICON,
+ BUILD_ICON,
+ SCRIPTS_ICON,
+ DAMAGE_ICON,
+ ICON_COUNT
+ };
+
+ /**
+ * Initializes parcel icons controls. Called from the constructor.
+ */
+ void initParcelIcons();
+
+ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask);
+
+ /**
+ * Handles clicks on the parcel icons.
+ */
+ void onParcelIconClick(EParcelIcon icon);
+
+ /**
+ * Handles clicks on the info buttons.
+ */
+ void onInfoButtonClicked();
+
+ /**
+ * Called when agent changes the parcel.
+ */
+ void onAgentParcelChange();
+
+ /**
+ * Called when user checks/unchecks Show Coordinates menu item.
+ */
+ void onNavBarShowParcelPropertiesCtrlChanged();
+
+ /**
+ * Shorthand to call updateParcelInfoText() and updateParcelIcons().
+ */
+ void update();
+
+ /**
+ * Updates parcel info text (mParcelInfoText).
+ */
+ void updateParcelInfoText();
+
+ /**
+ * Updates parcel icons (mParcelIcon[]).
+ */
+ void updateParcelIcons();
+
+ /**
+ * Updates health information (mDamageText).
+ */
+ void updateHealth();
+
+ /**
+ * Lays out all parcel icons starting from right edge of the mParcelInfoText + 11px
+ * (see screenshots in EXT-5808 for details).
+ */
+ void layoutParcelIcons();
+
+ /**
+ * Lays out a widget. Widget's rect mLeft becomes equal to the 'left' argument.
+ */
+ S32 layoutWidget(LLUICtrl* ctrl, S32 left);
+
+ /**
+ * Generates location string and returns it in the loc_str parameter.
+ */
+ void buildLocationString(std::string& loc_str, bool show_coords);
+
+ /**
+ * Sets new value to the mParcelInfoText and updates the size of the top bar.
+ */
+ void setParcelInfoText(const std::string& new_text);
+
+ LLButton* mInfoBtn;
+ LLTextBox* mParcelInfoText;
+ LLTextBox* mDamageText;
+ LLIconCtrl* mParcelIcon[ICON_COUNT];
+ LLParcelChangeObserver* mParcelChangedObserver;
+
+ boost::signals2::connection mParcelPropsCtrlConnection;
+ boost::signals2::connection mShowCoordsCtrlConnection;
+ boost::signals2::connection mParcelMgrConnection;
+};
+
+#endif /* LLPANELTOPINFOBAR_H_ */
diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp
index f02e15706d..f4b4954cbd 100644
--- a/indra/newview/llviewercontrol.cpp
+++ b/indra/newview/llviewercontrol.cpp
@@ -74,6 +74,7 @@
#include "llfloatertools.h"
#include "llpaneloutfitsinventory.h"
#include "llpanellogin.h"
+#include "llpaneltopinfobar.h"
#ifdef TOGGLE_HACKED_GODLIKE_VIEWER
BOOL gHackGodmode = FALSE;
@@ -471,6 +472,12 @@ bool toggle_show_favorites_panel(const LLSD& newvalue)
return true;
}
+bool toggle_show_mini_location_panel(const LLSD& newvalue)
+{
+ LLPanelTopInfoBar::getInstance()->setVisible(newvalue.asBoolean());
+ return true;
+}
+
bool toggle_show_object_render_cost(const LLSD& newvalue)
{
LLFloaterTools::sShowObjectCost = newvalue.asBoolean();
@@ -615,6 +622,7 @@ void settings_setup_listeners()
gSavedSettings.getControl("AgentPause")->getSignal()->connect(boost::bind(&toggle_agent_pause, _2));
gSavedSettings.getControl("ShowNavbarNavigationPanel")->getSignal()->connect(boost::bind(&toggle_show_navigation_panel, _2));
gSavedSettings.getControl("ShowNavbarFavoritesPanel")->getSignal()->connect(boost::bind(&toggle_show_favorites_panel, _2));
+ gSavedSettings.getControl("ShowMiniLocationPanel")->getSignal()->connect(boost::bind(&toggle_show_mini_location_panel, _2));
gSavedSettings.getControl("ShowObjectRenderingCost")->getSignal()->connect(boost::bind(&toggle_show_object_render_cost, _2));
gSavedSettings.getControl("ForceShowGrid")->getSignal()->connect(boost::bind(&handleForceShowGrid, _2));
}
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index d91f232f0e..83556452c0 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -201,6 +201,7 @@
#include "llnearbychat.h"
#include "llviewerwindowlistener.h"
+#include "llpaneltopinfobar.h"
#if LL_WINDOWS
#include <tchar.h> // For Unicode conversion methods
@@ -1669,6 +1670,20 @@ void LLViewerWindow::initWorldUI()
navbar->showFavoritesPanel(FALSE);
}
+ // Top Info bar
+ LLPanel* topinfo_bar_container = getRootView()->getChild<LLPanel>("topinfo_bar_container");
+ LLPanelTopInfoBar* topinfo_bar = LLPanelTopInfoBar::getInstance();
+
+ topinfo_bar->setShape(topinfo_bar_container->getLocalRect());
+
+ topinfo_bar_container->addChild(topinfo_bar);
+ topinfo_bar_container->setVisible(TRUE);
+
+ if (!gSavedSettings.getBOOL("ShowMiniLocationPanel"))
+ {
+ topinfo_bar->setVisible(FALSE);
+ }
+
if ( gHUDView == NULL )
{
LLRect hud_rect = full_window;
diff --git a/indra/newview/skins/default/xui/en/main_view.xml b/indra/newview/skins/default/xui/en/main_view.xml
index b2e4a7ad95..79efb287cd 100644
--- a/indra/newview/skins/default/xui/en/main_view.xml
+++ b/indra/newview/skins/default/xui/en/main_view.xml
@@ -74,6 +74,17 @@
mouse_opaque="false"
name="hud container"
width="500">
+ <panel auto_resize="false"
+ follows="left|top"
+ height="19"
+ left="0"
+ mouse_opaque="false"
+ name="topinfo_bar_container"
+ tab_stop="false"
+ top="0"
+ user_resize="false"
+ visible="false"
+ width="1024"/>
<panel follows="right|top|bottom"
height="500"
mouse_opaque="false"
diff --git a/indra/newview/skins/default/xui/en/menu_hide_navbar.xml b/indra/newview/skins/default/xui/en/menu_hide_navbar.xml
index a175b3103f..3f38d734b9 100644
--- a/indra/newview/skins/default/xui/en/menu_hide_navbar.xml
+++ b/indra/newview/skins/default/xui/en/menu_hide_navbar.xml
@@ -12,10 +12,10 @@
label="Show Navigation Bar"
layout="topleft"
name="ShowNavbarNavigationPanel">
- <menu_item_check.on_click
+ <on_click
function="ToggleControl"
parameter="ShowNavbarNavigationPanel" />
- <menu_item_check.on_check
+ <on_check
function="CheckControl"
parameter="ShowNavbarNavigationPanel" />
</menu_item_check>
@@ -23,11 +23,22 @@
label="Show Favorites Bar"
layout="topleft"
name="ShowNavbarFavoritesPanel">
- <menu_item_check.on_click
+ <on_click
function="ToggleControl"
parameter="ShowNavbarFavoritesPanel" />
- <menu_item_check.on_check
+ <on_check
function="CheckControl"
parameter="ShowNavbarFavoritesPanel" />
</menu_item_check>
+ <menu_item_check
+ label="Show Mini-Location Bar"
+ layout="topleft"
+ name="ShowMiniLocationPanel">
+ <on_click
+ function="ToggleControl"
+ parameter="ShowMiniLocationPanel" />
+ <on_check
+ function="CheckControl"
+ parameter="ShowMiniLocationPanel" />
+ </menu_item_check>
</menu>
diff --git a/indra/newview/skins/default/xui/en/panel_topinfo_bar.xml b/indra/newview/skins/default/xui/en/panel_topinfo_bar.xml
new file mode 100644
index 0000000000..d3fb77f135
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/panel_topinfo_bar.xml
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<panel
+ background_visible="true"
+ background_opaque="false"
+ bg_opaque_color="Black_50"
+ bg_alpha_color="Black_50"
+ follows="left|top|right"
+ height="19"
+ layout="topleft"
+ name="topinfo_bar"
+ width="1024">
+ <button
+ border="true"
+ follows="left|top"
+ height="16"
+ hover_glow_amount="0.15"
+ image_disabled="Info_Off"
+ image_disabled_selected="Info_Off"
+ image_selected="Info_Off"
+ image_unselected="Info_Off"
+ left="11"
+ name="place_info_btn"
+ top="1"
+ width="16"/>
+ <text
+ follows="left|top|right"
+ font="DejaVu"
+ height="16"
+ layout="topleft"
+ left_pad="11"
+ length="1"
+ name="parcel_info_text"
+ top="1"
+ type="string"
+ width="1"/>
+ <icon
+ enabled="true"
+ follows="right|top"
+ height="18"
+ image_name="Parcel_VoiceNo_Light"
+ name="voice_icon"
+ top="1"
+ visible="false"
+ width="22"
+ />
+ <icon
+ follows="right|top"
+ height="18"
+ image_name="Parcel_FlyNo_Light"
+ name="fly_icon"
+ top="1"
+ visible="false"
+ width="22"
+ />
+ <icon
+ follows="right|top"
+ height="18"
+ image_name="Parcel_PushNo_Light"
+ name="push_icon"
+ top="1"
+ visible="false"
+ width="22"
+ />
+ <icon
+ follows="right|top"
+ height="18"
+ image_name="Parcel_BuildNo_Light"
+ name="build_icon"
+ top="1"
+ visible="false"
+ width="22"
+ />
+ <icon
+ follows="right|top"
+ height="18"
+ image_name="Parcel_ScriptsNo_Light"
+ name="scripts_icon"
+ top="1"
+ visible="false"
+ width="22"
+ />
+ <icon
+ follows="right|top"
+ height="13"
+ image_name="Parcel_Health_Dark"
+ left="2"
+ name="damage_icon"
+ top="3"
+ visible="false"
+ width="14"
+ />
+ <text
+ follows="right|top"
+ font="SansSerifSmall"
+ halign="right"
+ height="18"
+ name="damage_text"
+ top="5"
+ visible="false"
+ width="35"
+ />
+</panel>