diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 9650f36724e3e43ee0d2b4ccfbf63babc96ab537..5e0679095eb92c9838cc1060a36369dbf2cbc00d 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -115,6 +115,8 @@ set(viewer_SOURCE_FILES alcontrolcache.cpp alfloaterparticleeditor.cpp alfloaterregiontracker.cpp + alpanelquicksettings.cpp + alpanelquicksettingspulldown.cpp alunzip.cpp alviewermenu.cpp groupchatlistener.cpp @@ -762,6 +764,8 @@ set(viewer_HEADER_FILES alcontrolcache.h alfloaterparticleeditor.h alfloaterregiontracker.h + alpanelquicksettings.h + alpanelquicksettingspulldown.h alunzip.h alviewermenu.h groupchatlistener.h diff --git a/indra/newview/alpanelquicksettings.cpp b/indra/newview/alpanelquicksettings.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2dc4d0158199cd00e581316d3dc5cfc6ee5eb221 --- /dev/null +++ b/indra/newview/alpanelquicksettings.cpp @@ -0,0 +1,170 @@ +/** + * @file alpanelquicksettings.cpp + * @brief Base panel for quick settings popdown and floater + * + * $LicenseInfo:firstyear=2013&license=viewerlgpl$ + * Alchemy Viewer Source Code + * Copyright (C) 2013-2014, Alchemy Viewer Project. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "alpanelquicksettings.h" + +#include "llbutton.h" +#include "llcheckboxctrl.h" +#include "llcombobox.h" +#include "llslider.h" +#include "llspinctrl.h" + +#include "llagent.h" +#include "llviewercontrol.h" +#include "llviewerregion.h" +#include "llvoavatar.h" +#include "llvoavatarself.h" + +static LLPanelInjector<ALPanelQuickSettings> t_quick_settings("quick_settings"); + +ALPanelQuickSettings::ALPanelQuickSettings() + : LLPanel(), + mRegionSettingsCheckBox(nullptr), + mHoverSlider(nullptr), + mHoverSpinner(nullptr) +{ +} + +ALPanelQuickSettings::~ALPanelQuickSettings() +{ + if (mRegionChangedSlot.connected()) + { + mRegionChangedSlot.disconnect(); + } +} + +// virtual +BOOL ALPanelQuickSettings::postBuild() +{ + refresh(); + + // Hover height + mHoverSlider = getChild<LLSlider>("hover_slider_bar"); + mHoverSlider->setMinValue(MIN_HOVER_Z); + mHoverSlider->setMaxValue(MAX_HOVER_Z); + mHoverSlider->setMouseUpCallback(boost::bind(&ALPanelQuickSettings::onHoverSliderFinalCommit, this)); + mHoverSlider->setCommitCallback(boost::bind(&ALPanelQuickSettings::onHoverSliderMoved, this, _2)); + + mHoverSpinner = getChild<LLSpinCtrl>("hover_spinner"); + mHoverSpinner->setMinValue(MIN_HOVER_Z); + mHoverSpinner->setMaxValue(MAX_HOVER_Z); + + // Initialize slider from pref setting. + syncFromPreferenceSetting(); + + // Update slider on future pref changes. + gSavedPerAccountSettings.getControl("AvatarHoverOffsetZ")->getCommitSignal()->connect(boost::bind(&ALPanelQuickSettings::syncFromPreferenceSetting, this)); + + updateEditHoverEnabled(); + + if (!mRegionChangedSlot.connected()) + { + mRegionChangedSlot = gAgent.addRegionChangedCallback(boost::bind(&ALPanelQuickSettings::onRegionChanged, this)); + } + // Set up based on initial region. + onRegionChanged(); + + return LLPanel::postBuild(); +} + +// virtual +void ALPanelQuickSettings::refresh() +{ + LLPanel::refresh(); +} + +void ALPanelQuickSettings::syncFromPreferenceSetting() +{ + F32 value = gSavedPerAccountSettings.getF32("AvatarHoverOffsetZ"); + mHoverSlider->setValue(value, FALSE); + mHoverSpinner->setValue(value); + + if (isAgentAvatarValid()) + { + LLVector3 offset(0.0, 0.0, llclamp(value, MIN_HOVER_Z, MAX_HOVER_Z)); + LL_INFOS("Avatar") << "setting hover from preference setting " << offset[2] << LL_ENDL; + gAgentAvatarp->setHoverOffset(offset); + } +} + +void ALPanelQuickSettings::onHoverSliderMoved(const LLSD& val) +{ + if (isAgentAvatarValid()) + { + auto value = static_cast<F32>(val.asReal()); + LLVector3 offset(0.0, 0.0, llclamp(value, MIN_HOVER_Z, MAX_HOVER_Z)); + LL_INFOS("Avatar") << "setting hover from slider moved" << offset[2] << LL_ENDL; + gAgentAvatarp->setHoverOffset(offset, false); + } +} + +// Do send-to-the-server work when slider drag completes, or new +// value entered as text. +void ALPanelQuickSettings::onHoverSliderFinalCommit() +{ + F32 value = mHoverSlider->getValueF32(); + gSavedPerAccountSettings.setF32("AvatarHoverOffsetZ", value); + if (isAgentAvatarValid()) + { + LLVector3 offset(0.0, 0.0, llclamp(value, MIN_HOVER_Z, MAX_HOVER_Z)); + LL_INFOS("Avatar") << "setting hover from slider final commit " << offset[2] << LL_ENDL; + gAgentAvatarp->setHoverOffset(offset, true); // will send update this time. + } +} + +void ALPanelQuickSettings::onRegionChanged() +{ + LLViewerRegion *region = gAgent.getRegion(); + if (region && region->simulatorFeaturesReceived()) + { + updateEditHoverEnabled(); + } + else if (region) + { + region->setSimulatorFeaturesReceivedCallback(boost::bind(&ALPanelQuickSettings::onSimulatorFeaturesReceived, this, _1)); + } +} + +void ALPanelQuickSettings::onSimulatorFeaturesReceived(const LLUUID ®ion_id) +{ + LLViewerRegion *region = gAgent.getRegion(); + if (region && (region->getRegionID() == region_id)) + { + updateEditHoverEnabled(); + } +} + +void ALPanelQuickSettings::updateEditHoverEnabled() +{ + bool enabled = gAgent.getRegion() && gAgent.getRegion()->avatarHoverHeightEnabled(); + mHoverSlider->setEnabled(enabled); + mHoverSpinner->setEnabled(enabled); + if (enabled) + { + syncFromPreferenceSetting(); + } +} diff --git a/indra/newview/alpanelquicksettings.h b/indra/newview/alpanelquicksettings.h new file mode 100644 index 0000000000000000000000000000000000000000..fca55b8e3b73b590ae8a861b90ea603e30b5cbca --- /dev/null +++ b/indra/newview/alpanelquicksettings.h @@ -0,0 +1,63 @@ +/** + * @file alpanelquicksettings.h + * @brief Base panel for quick settings popdown and floater + * + * $LicenseInfo:firstyear=2013&license=viewerlgpl$ + * Alchemy Viewer Source Code + * Copyright (C) 2013-2014, Alchemy Viewer Project. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * $/LicenseInfo$ + */ + +#ifndef AL_ALPANELQUICKSETTINGS_H +#define AL_ALPANELQUICKSETTINGS_H + +#include "llpanel.h" + +class LLButton; +class LLCheckBoxCtrl; +class LLComboBox; +class LLSlider; +class LLSpinCtrl; + +class ALPanelQuickSettings final : public LLPanel +{ +public: + ALPanelQuickSettings(); + ~ALPanelQuickSettings(); + + BOOL postBuild() override; + void refresh() override; + +private: + void onHoverSliderMoved(const LLSD& val); + void onHoverSliderFinalCommit(); + void syncFromPreferenceSetting(); + + void onRegionChanged(); + void onSimulatorFeaturesReceived(const LLUUID ®ion_id); + void updateEditHoverEnabled(); + + LLCheckBoxCtrl* mRegionSettingsCheckBox; + + LLSlider* mHoverSlider; + LLSpinCtrl* mHoverSpinner; + + boost::signals2::connection mRegionChangedSlot; +}; + +#endif // AL_ALPANELQUICKSETTINGS_H diff --git a/indra/newview/alpanelquicksettingspulldown.cpp b/indra/newview/alpanelquicksettingspulldown.cpp new file mode 100644 index 0000000000000000000000000000000000000000..fe42de53f9ad99cececa66231a5456e7ceef9343 --- /dev/null +++ b/indra/newview/alpanelquicksettingspulldown.cpp @@ -0,0 +1,38 @@ +/** + * @file alpanelquicksettingspulldown.cpp + * @brief Quick Settings popdown panel + * + * $LicenseInfo:firstyear=2013&license=viewerlgpl$ + * Alchemy Viewer Source Code + * Copyright (C) 2013-2014, Alchemy Viewer Project. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "alpanelquicksettingspulldown.h" + +///---------------------------------------------------------------------------- +/// Class ALPanelQuickSettingsPulldown +///---------------------------------------------------------------------------- + +// Default constructor +ALPanelQuickSettingsPulldown::ALPanelQuickSettingsPulldown() : LLPanelPulldown() +{ + buildFromFile("panel_quick_settings_pulldown.xml"); +} diff --git a/indra/newview/alpanelquicksettingspulldown.h b/indra/newview/alpanelquicksettingspulldown.h new file mode 100644 index 0000000000000000000000000000000000000000..2d58839f7160fde683e4d6903ee3d48ef4c43ed2 --- /dev/null +++ b/indra/newview/alpanelquicksettingspulldown.h @@ -0,0 +1,39 @@ +/** + * @file alpanelquicksettingspulldown.h + * @brief Quick Settings popdown panel + * + * $LicenseInfo:firstyear=2013&license=viewerlgpl$ + * Alchemy Viewer Source Code + * Copyright (C) 2013-2014, Alchemy Viewer Project. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * $/LicenseInfo$ + */ + +#ifndef AL_ALPANELQUICKSETTINGSPULLDOWN_H +#define AL_ALPANELQUICKSETTINGSPULLDOWN_H + +#include "llpanelpulldown.h" + +class LLFrameTimer; + +class ALPanelQuickSettingsPulldown final : public LLPanelPulldown +{ +public: + ALPanelQuickSettingsPulldown(); +}; + +#endif // AL_ALPANELQUICKSETTINGSPULLDOWN_H diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml index e8b76f67b98b57edcbf146c778418280452f7e23..7d6c6705e2819e666ce97e10e36db1743c7cdfde 100644 --- a/indra/newview/app_settings/commands.xml +++ b/indra/newview/app_settings/commands.xml @@ -65,6 +65,16 @@ is_running_function="Floater.IsOpen" is_running_parameters="compass" /> + <command name="debug" + available_in_toybox="true" + icon="Command_Debug_Icon" + label_ref="Command_Debug_Label" + tooltip_ref="Command_Debug_Tooltip" + execute_function="Floater.ToggleOrBringToFront" + execute_parameters="settings_debug" + is_running_function="Floater.IsOpen" + is_running_parameters="settings_debug" + /> <command name="destinations" available_in_toybox="true" icon="Command_Destinations_Icon" @@ -204,6 +214,16 @@ execute_function="Avatar.ToggleMyProfile" is_running_function="Avatar.IsMyProfileOpen" /> + <command name="quick_settings" + available_in_toybox="true" + icon="Command_Scripts_Icon" + label_ref="Command_Quick_Settings_Label" + tooltip_ref="Command_Quick_Settings_Tooltip" + execute_function="Floater.ToggleOrBringToFront" + execute_parameters="quick_settings" + is_running_function="Floater.IsOpen" + is_running_parameters="quick_settings" + /> <command name="regiontracker" available_in_toybox="true" icon="Command_RegionTracker_Icon" @@ -214,6 +234,26 @@ is_running_function="Floater.IsOpen" is_running_parameters="region_tracker" /> + <command name="scripts" + available_in_toybox="true" + icon="Command_Scripts_Icon" + label_ref="Command_Scripts_Label" + tooltip_ref="Command_Scripts_Tooltip" + execute_function="Floater.ToggleOrBringToFront" + execute_parameters="my_scripts" + is_running_function="Floater.IsOpen" + is_running_parameters="my_scripts" + /> + <command name="stats" + available_in_toybox="true" + icon="Command_Stats_Icon" + label_ref="Command_Stats_Label" + tooltip_ref="Command_Stats_Tooltip" + execute_function="Floater.ToggleOrBringToFront" + execute_parameters="stats" + is_running_function="Floater.IsOpen" + is_running_parameters="stats" + /> <command name="search" available_in_toybox="true" icon="Command_Search_Icon" @@ -292,4 +332,14 @@ is_running_function="Floater.IsOpen" is_running_parameters="my_environments" /> + <command name="webbrowser" + available_in_toybox="true" + icon="Command_Webbrowser_Icon" + label_ref="Command_Webbrowser_Label" + tooltip_ref="Command_Webbrowser_Tooltip" + execute_function="Advanced.WebContentTest" + execute_parameters="https://www.google.com" + is_running_function="Floater.IsOpen" + is_running_parameters="web_content" + /> </commands> diff --git a/indra/newview/llfloatersettingsdebug.cpp b/indra/newview/llfloatersettingsdebug.cpp index 13646fe7c47a9436a76c362c4c7516ae9d432c83..abbb1e16497bc13e4bec96075e841534f1dfd5b2 100644 --- a/indra/newview/llfloatersettingsdebug.cpp +++ b/indra/newview/llfloatersettingsdebug.cpp @@ -40,7 +40,7 @@ LLFloaterSettingsDebug::LLFloaterSettingsDebug(const LLSD& key) -: LLFloater(key) +: LLFloater(key.asString().empty() ? LLSD("all") : key) { mCommitCallbackRegistrar.add("SettingSelect", boost::bind(&LLFloaterSettingsDebug::onSettingSelect, this,_1)); mCommitCallbackRegistrar.add("CommitSettings", boost::bind(&LLFloaterSettingsDebug::onCommitSettings, this)); diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 895f18530c9cffe59884da412293083a2d552235..84d97efb995de5a2a28ca43ac6db788787d46afc 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -29,6 +29,7 @@ #include "llstatusbar.h" // viewer includes +#include "alpanelquicksettingspulldown.h" #include "llagent.h" #include "llagentcamera.h" #include "llbutton.h" @@ -110,6 +111,8 @@ LLStatusBar::LLStatusBar(const LLRect& rect) mTextTime(NULL), mSGBandwidth(NULL), mSGPacketLoss(NULL), + mPanelPopupHolder(nullptr), + mBtnQuickSettings(nullptr), mBtnVolume(NULL), mBoxBalance(NULL), mBalance(0), @@ -162,6 +165,8 @@ BOOL LLStatusBar::postBuild() { gMenuBarView->setRightMouseDownCallback(boost::bind(&show_navbar_context_menu, _1, _2, _3)); + mPanelPopupHolder = gViewerWindow->getRootView()->getChildView("popup_holder"); + mTextTime = getChild<LLTextBox>("TimeText" ); getChild<LLUICtrl>("buyL")->setCommitCallback( @@ -178,6 +183,9 @@ BOOL LLStatusBar::postBuild() mIconPresetsGraphic = getChild<LLIconCtrl>( "presets_icon_graphic" ); mIconPresetsGraphic->setMouseEnterCallback(boost::bind(&LLStatusBar::onMouseEnterPresets, this)); + mBtnQuickSettings = getChild<LLButton>("quick_settings_btn"); + mBtnQuickSettings->setMouseEnterCallback(boost::bind(&LLStatusBar::onMouseEnterQuickSettings, this)); + mBtnVolume = getChild<LLButton>( "volume_btn" ); mBtnVolume->setClickedCallback( onClickVolume, this ); mBtnVolume->setMouseEnterCallback(boost::bind(&LLStatusBar::onMouseEnterVolume, this)); @@ -246,6 +254,11 @@ BOOL LLStatusBar::postBuild() mPanelVolumePulldown->setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT); mPanelVolumePulldown->setVisible(FALSE); + mPanelQuickSettingsPulldown = new ALPanelQuickSettingsPulldown(); + addChild(mPanelQuickSettingsPulldown); + mPanelQuickSettingsPulldown->setFollows(FOLLOWS_TOP | FOLLOWS_RIGHT); + mPanelQuickSettingsPulldown->setVisible(FALSE); + mPanelNearByMedia = new LLPanelNearByMedia(); addChild(mPanelNearByMedia); mPanelNearByMedia->setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT); @@ -348,6 +361,7 @@ void LLStatusBar::setVisibleForMouselook(bool visible) mTextTime->setVisible(visible); getChild<LLUICtrl>("balance_bg")->setVisible(visible); mBoxBalance->setVisible(visible); + mBtnQuickSettings->setVisible(visible); mBtnVolume->setVisible(visible); mMediaToggle->setVisible(visible); mSGBandwidth->setVisible(visible); @@ -498,7 +512,6 @@ void LLStatusBar::onClickBuyCurrency() void LLStatusBar::onMouseEnterPresetsCamera() { - LLView* popup_holder = gViewerWindow->getRootView()->getChildView("popup_holder"); LLIconCtrl* icon = getChild<LLIconCtrl>( "presets_icon_camera" ); LLRect icon_rect = icon->getRect(); LLRect pulldown_rect = mPanelPresetsCameraPulldown->getRect(); @@ -508,7 +521,7 @@ void LLStatusBar::onMouseEnterPresetsCamera() pulldown_rect.getWidth(), pulldown_rect.getHeight()); - pulldown_rect.translate(popup_holder->getRect().getWidth() - pulldown_rect.mRight, 0); + pulldown_rect.translate(mPanelPopupHolder->getRect().getWidth() - pulldown_rect.mRight, 0); mPanelPresetsCameraPulldown->setShape(pulldown_rect); // show the master presets pull-down @@ -522,7 +535,6 @@ void LLStatusBar::onMouseEnterPresetsCamera() void LLStatusBar::onMouseEnterPresets() { - LLView* popup_holder = gViewerWindow->getRootView()->getChildView("popup_holder"); LLIconCtrl* icon = getChild<LLIconCtrl>( "presets_icon_graphic" ); LLRect icon_rect = icon->getRect(); LLRect pulldown_rect = mPanelPresetsPulldown->getRect(); @@ -532,7 +544,7 @@ void LLStatusBar::onMouseEnterPresets() pulldown_rect.getWidth(), pulldown_rect.getHeight()); - pulldown_rect.translate(popup_holder->getRect().getWidth() - pulldown_rect.mRight, 0); + pulldown_rect.translate(mPanelPopupHolder->getRect().getWidth() - pulldown_rect.mRight, 0); mPanelPresetsPulldown->setShape(pulldown_rect); // show the master presets pull-down @@ -543,9 +555,32 @@ void LLStatusBar::onMouseEnterPresets() mPanelPresetsPulldown->setVisible(TRUE); } +void LLStatusBar::onMouseEnterQuickSettings() +{ + LLRect qs_rect = mPanelQuickSettingsPulldown->getRect(); + LLRect qs_btn_rect = mBtnQuickSettings->getRect(); + qs_rect.setLeftTopAndSize(qs_btn_rect.mLeft - + (qs_rect.getWidth() - qs_btn_rect.getWidth()) / 2, + qs_btn_rect.mBottom, + qs_rect.getWidth(), + qs_rect.getHeight()); + // force onscreen + qs_rect.translate(mPanelPopupHolder->getRect().getWidth() - qs_rect.mRight, 0); + + // show the master volume pull-down + mPanelQuickSettingsPulldown->setShape(qs_rect); + LLUI::getInstance()->clearPopups(); + LLUI::getInstance()->addPopup(mPanelQuickSettingsPulldown); + + mPanelNearByMedia->setVisible(FALSE); + mPanelVolumePulldown->setVisible(FALSE); + //mPanelAOPulldown->setVisible(FALSE); + //mPanelAvatarComplexityPulldown->setVisible(FALSE); + mPanelQuickSettingsPulldown->setVisible(TRUE); +} + void LLStatusBar::onMouseEnterVolume() { - LLView* popup_holder = gViewerWindow->getRootView()->getChildView("popup_holder"); LLButton* volbtn = getChild<LLButton>( "volume_btn" ); LLRect vol_btn_rect = volbtn->getRect(); LLRect volume_pulldown_rect = mPanelVolumePulldown->getRect(); @@ -555,7 +590,7 @@ void LLStatusBar::onMouseEnterVolume() volume_pulldown_rect.getWidth(), volume_pulldown_rect.getHeight()); - volume_pulldown_rect.translate(popup_holder->getRect().getWidth() - volume_pulldown_rect.mRight, 0); + volume_pulldown_rect.translate(mPanelPopupHolder->getRect().getWidth() - volume_pulldown_rect.mRight, 0); mPanelVolumePulldown->setShape(volume_pulldown_rect); @@ -565,12 +600,12 @@ void LLStatusBar::onMouseEnterVolume() mPanelPresetsCameraPulldown->setVisible(FALSE); mPanelPresetsPulldown->setVisible(FALSE); mPanelNearByMedia->setVisible(FALSE); + mPanelQuickSettingsPulldown->setVisible(FALSE); mPanelVolumePulldown->setVisible(TRUE); } void LLStatusBar::onMouseEnterNearbyMedia() { - LLView* popup_holder = gViewerWindow->getRootView()->getChildView("popup_holder"); LLRect nearby_media_rect = mPanelNearByMedia->getRect(); LLButton* nearby_media_btn = getChild<LLButton>( "media_toggle_btn" ); LLRect nearby_media_btn_rect = nearby_media_btn->getRect(); @@ -580,7 +615,7 @@ void LLStatusBar::onMouseEnterNearbyMedia() nearby_media_rect.getWidth(), nearby_media_rect.getHeight()); // force onscreen - nearby_media_rect.translate(popup_holder->getRect().getWidth() - nearby_media_rect.mRight, 0); + nearby_media_rect.translate(mPanelPopupHolder->getRect().getWidth() - nearby_media_rect.mRight, 0); // show the master volume pull-down mPanelNearByMedia->setShape(nearby_media_rect); @@ -589,12 +624,13 @@ void LLStatusBar::onMouseEnterNearbyMedia() mPanelPresetsCameraPulldown->setVisible(FALSE); mPanelPresetsPulldown->setVisible(FALSE); + mPanelQuickSettingsPulldown->setVisible(FALSE); mPanelVolumePulldown->setVisible(FALSE); mPanelNearByMedia->setVisible(TRUE); } -static void onClickVolume(void* data) +void LLStatusBar::onClickVolume(void* data) { // toggle the master mute setting bool mute_audio = LLAppViewer::instance()->getMasterSystemAudioMute(); diff --git a/indra/newview/llstatusbar.h b/indra/newview/llstatusbar.h index 3002b91c107479ec544d0e33c0003232c6f47aef..307f42499636aa66dd53e1b5cb2dc47f80e3c3c4 100644 --- a/indra/newview/llstatusbar.h +++ b/indra/newview/llstatusbar.h @@ -41,6 +41,7 @@ class LLUICtrl; class LLUUID; class LLFrameTimer; class LLStatGraph; +class ALPanelQuickSettingsPulldown; class LLPanelPresetsCameraPulldown; class LLPanelPresetsPulldown; class LLPanelVolumePulldown; @@ -55,17 +56,17 @@ namespace ll struct SearchData; } } -class LLStatusBar +class LLStatusBar final : public LLPanel { public: LLStatusBar(const LLRect& rect ); /*virtual*/ ~LLStatusBar(); - /*virtual*/ void draw(); + /*virtual*/ void draw() override; - /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override; + /*virtual*/ BOOL postBuild() override; // MANIPULATORS void setBalance(S32 balance); @@ -80,7 +81,7 @@ class LLStatusBar void setLandCredit(S32 credit); void setLandCommitted(S32 committed); - void refresh(); + void refresh() override; void setVisibleForMouselook(bool visible); // some elements should hide in mouselook @@ -93,7 +94,7 @@ class LLStatusBar S32 getSquareMetersCommitted() const; S32 getSquareMetersLeft() const; - LLPanelNearByMedia* getNearbyMediaPanel() { return mPanelNearByMedia; } + LLPanelNearByMedia* getNearbyMediaPanel() const { return mPanelNearByMedia; } private: @@ -102,10 +103,12 @@ class LLStatusBar void onMouseEnterPresetsCamera(); void onMouseEnterPresets(); + void onMouseEnterQuickSettings(); void onMouseEnterVolume(); void onMouseEnterNearbyMedia(); void onClickScreen(S32 x, S32 y); + static void onClickVolume(void* data); static void onClickMediaToggle(void* data); static void onClickBalance(void* data); @@ -119,14 +122,16 @@ class LLStatusBar void updateMenuSearchPosition(); // depends onto balance position void updateBalancePanelPosition(); -private: + LLTextBox *mTextTime; LLStatGraph *mSGBandwidth; LLStatGraph *mSGPacketLoss; + LLView *mPanelPopupHolder; LLIconCtrl *mIconPresetsCamera; LLIconCtrl *mIconPresetsGraphic; + LLButton *mBtnQuickSettings; LLButton *mBtnVolume; LLTextBox *mBoxBalance; LLButton *mMediaToggle; @@ -140,6 +145,7 @@ class LLStatusBar LLFrameTimer* mHealthTimer; LLPanelPresetsCameraPulldown* mPanelPresetsCameraPulldown; LLPanelPresetsPulldown* mPanelPresetsPulldown; + ALPanelQuickSettingsPulldown* mPanelQuickSettingsPulldown; LLPanelVolumePulldown* mPanelVolumePulldown; LLPanelNearByMedia* mPanelNearByMedia; }; diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index a1dc9427aa6e02aa778b7f1a93373a0a93d714ff..ea4931c5c9248c8417bd4ac2826ff807b8a57627 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -391,6 +391,7 @@ void LLViewerFloaterReg::registerFloaters() // *NOTE: Please keep these alphabetized for easier merges LLFloaterReg::add("particle_editor", "floater_particle_editor.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<ALFloaterParticleEditor>); + LLFloaterReg::add("quick_settings", "floater_quick_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloater>); LLFloaterReg::add("region_tracker", "floater_region_tracker.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<ALFloaterRegionTracker>); LLFloaterReg::registerControlVariables(); // Make sure visibility and rect controls get preserved when saving diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 43552fb807676183ec8f304bf88d101d98008cc4..9b9ea093beee39c360fe1563501fbce752fd42d7 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -134,6 +134,7 @@ with the same filename but different name <texture name="Command_Build_Icon" file_name="toolbar_icons/build.png" preload="true" /> <texture name="Command_Chat_Icon" file_name="toolbar_icons/chat.png" preload="true" /> <texture name="Command_Compass_Icon" file_name="toolbar_icons/land.png" preload="true" /> + <texture name="Command_Debug_Icon" file_name="toolbar_icons/debug.png" preload="true" /> <texture name="Command_Destinations_Icon" file_name="toolbar_icons/destinations.png" preload="true" /> <texture name="Command_Gestures_Icon" file_name="toolbar_icons/gestures.png" preload="true" /> <texture name="Command_Grid_Status_Icon" file_name="toolbar_icons/grid_status.png" preload="true" /> @@ -146,6 +147,7 @@ with the same filename but different name <texture name="Command_MiniMap_Icon" file_name="toolbar_icons/mini_map.png" preload="true" /> <texture name="Command_Move_Icon" file_name="toolbar_icons/move.png" preload="true" /> <texture name="Command_Environments_Icon" file_name="toolbar_icons/environments.png" preload="true" /> + <texture name="Command_Panic_Icon" file_name="toolbar_icons/panic.png" preload="true" /> <texture name="Command_People_Icon" file_name="toolbar_icons/people.png" preload="true" /> <texture name="Command_Picks_Icon" file_name="toolbar_icons/picks.png" preload="true" /> <texture name="Command_Places_Icon" file_name="toolbar_icons/places.png" preload="true" /> @@ -153,11 +155,15 @@ with the same filename but different name <texture name="Command_Profile_Icon" file_name="toolbar_icons/profile.png" preload="true" /> <texture name="Command_RegionTracker_Icon" file_name="toolbar_icons/regiontracker.png" preload="true" /> <texture name="Command_Report_Abuse_Icon" file_name="toolbar_icons/report_abuse.png" preload="true" /> + <texture name="Command_Scripts_Icon" file_name="toolbar_icons/script.png" preload="true" /> + <texture name="Command_Stats_Icon" file_name="toolbar_icons/stats.png" preload="true" /> <texture name="Command_Search_Icon" file_name="toolbar_icons/search.png" preload="true" /> <texture name="Command_Snapshot_Icon" file_name="toolbar_icons/snapshot.png" preload="true" /> <texture name="Command_Speak_Icon" file_name="toolbar_icons/speak.png" preload="true" /> <texture name="Command_View_Icon" file_name="toolbar_icons/view.png" preload="true" /> <texture name="Command_Voice_Icon" file_name="toolbar_icons/nearbyvoice.png" preload="true" /> + <texture name="Command_Webbrowser_Icon" file_name="toolbar_icons/web.png" preload="true" /> + <texture name="Caret_Top_Icon" file_name="toolbar_icons/caret_top.png" preload="true" scale.left="1" scale.top="28" scale.right="15" scale.bottom="5" /> <texture name="Caret_Bottom_Icon" file_name="toolbar_icons/caret_bottom.png" preload="true" scale.left="1" scale.top="23" scale.right="15" scale.bottom="1" /> <texture name="Caret_Right_Icon" file_name="toolbar_icons/caret_right.png" preload="true" scale.left="5" scale.top="15" scale.right="28" scale.bottom="1" /> <texture name="Caret_Left_Icon" file_name="toolbar_icons/caret_left.png" preload="true" scale.left="1" scale.top="15" scale.right="23" scale.bottom="1" /> diff --git a/indra/newview/skins/default/textures/toolbar_icons/caret_top.png b/indra/newview/skins/default/textures/toolbar_icons/caret_top.png new file mode 100644 index 0000000000000000000000000000000000000000..8af3f86049fb8cd578f84c07c016cf01341bd8eb Binary files /dev/null and b/indra/newview/skins/default/textures/toolbar_icons/caret_top.png differ diff --git a/indra/newview/skins/default/textures/toolbar_icons/debug.png b/indra/newview/skins/default/textures/toolbar_icons/debug.png new file mode 100644 index 0000000000000000000000000000000000000000..e1061febde09daed401c8fed3bf2af9e8b8efc56 Binary files /dev/null and b/indra/newview/skins/default/textures/toolbar_icons/debug.png differ diff --git a/indra/newview/skins/default/textures/toolbar_icons/panic.png b/indra/newview/skins/default/textures/toolbar_icons/panic.png new file mode 100644 index 0000000000000000000000000000000000000000..8b0831014d87b08d4058c5a2a6b9b917a367b255 Binary files /dev/null and b/indra/newview/skins/default/textures/toolbar_icons/panic.png differ diff --git a/indra/newview/skins/default/textures/toolbar_icons/script.png b/indra/newview/skins/default/textures/toolbar_icons/script.png new file mode 100644 index 0000000000000000000000000000000000000000..32f5d71f3a5c59ca4e994761d17e0459b9d3da3a Binary files /dev/null and b/indra/newview/skins/default/textures/toolbar_icons/script.png differ diff --git a/indra/newview/skins/default/textures/toolbar_icons/speak_small.png b/indra/newview/skins/default/textures/toolbar_icons/speak_small.png new file mode 100644 index 0000000000000000000000000000000000000000..934691f7e16c7090d12a2e5ca1b0fe3575ed0d24 Binary files /dev/null and b/indra/newview/skins/default/textures/toolbar_icons/speak_small.png differ diff --git a/indra/newview/skins/default/textures/toolbar_icons/stats.png b/indra/newview/skins/default/textures/toolbar_icons/stats.png new file mode 100644 index 0000000000000000000000000000000000000000..941c965e7292487caf99b5f7c4fff0b0cd5fc74d Binary files /dev/null and b/indra/newview/skins/default/textures/toolbar_icons/stats.png differ diff --git a/indra/newview/skins/default/textures/toolbar_icons/web.png b/indra/newview/skins/default/textures/toolbar_icons/web.png new file mode 100644 index 0000000000000000000000000000000000000000..28e131bd3bc9d25bc1585d7fd0f07bfd632c8c21 Binary files /dev/null and b/indra/newview/skins/default/textures/toolbar_icons/web.png differ diff --git a/indra/newview/skins/default/xui/en/floater_quick_settings.xml b/indra/newview/skins/default/xui/en/floater_quick_settings.xml new file mode 100644 index 0000000000000000000000000000000000000000..35f23a230232df2b35e9b3109af345fe1245aba1 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_quick_settings.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + width="300" + height="159" + layout="topleft" + min_height="159" + min_width="300" + name="floater_quick_settings" + positioning="cascading" + title="QUICK SETTINGS" + save_rect="true" + can_resize="true" + can_resize_height="false"> + <panel + name="quick_settings" + class="quick_settings" + filename="panel_quick_settings.xml" + layout="topleft" + follows="all" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/panel_quick_settings.xml b/indra/newview/skins/default/xui/en/panel_quick_settings.xml new file mode 100644 index 0000000000000000000000000000000000000000..414be9f8cb0eafb352293071395528369815650f --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_quick_settings.xml @@ -0,0 +1,218 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + class="quick_settings" + layout="topleft" + width="300" + height="209" + name="quick_settings"> + <text + follows="left|top" + height="15" + left="10" + top_pad="2" + width="120" + layout="topleft" + value="Draw Distance:"/> + <slider_bar + top_pad="-16" + height="20" + increment="32" + initial_value="96" + follows="left|top|right" + layout="topleft" + max_val="512" + min_val="64" + left="93" + right="-68" + name="draw_dist_slider_bar" + control_name="RenderFarClip"/> + <spinner + top_pad="-21" + height="20" + label="" + label_width="0" + right="-8" + decimal_digits="0" + follows="top|right" + layout="topleft" + max_val="512" + min_val="64" + width="55" + increment="32" + name="draw_dist_spinner" + control_name="RenderFarClip"/> + <text + follows="left|top" + height="15" + left="10" + top_pad="3" + width="120" + layout="topleft" + value="Level of Detail:"/> + <slider_bar + top_pad="-16" + height="20" + increment="0.1" + initial_value="96" + follows="left|top|right" + layout="topleft" + max_val="2" + min_val="0.0" + left="93" + right="-68" + name="lod_slider_bar" + control_name="RenderVolumeLODFactor"/> + <spinner + top_pad="-21" + height="20" + label_width="0" + right="-8" + decimal_digits="2" + follows="top|right" + layout="topleft" + max_val="2.0" + min_val="0.0" + width="55" + increment="0.1" + name="lod_spinner" + control_name="RenderVolumeLODFactor"/> + <text + follows="left|top" + height="15" + left="10" + top_pad="3" + width="120" + layout="topleft" + value="Max Particles:"/> + <slider_bar + top_pad="-16" + height="20" + increment="6" + initial_value="96" + follows="left|top|right" + layout="topleft" + max_val="8192" + min_val="0" + left="93" + right="-68" + name="max_particles_slider_bar" + control_name="RenderMaxPartCount"/> + <spinner + top_pad="-21" + height="20" + label_width="0" + right="-8" + decimal_digits="0" + follows="top|right" + layout="topleft" + max_val="8192" + min_val="0" + width="55" + increment="12" + name="max_particles_spinner" + control_name="RenderMaxPartCount"/> + <text + follows="left|top" + height="15" + left="10" + top_pad="3" + width="120" + layout="topleft" + value="Max Avatars:"/> + <slider_bar + top_pad="-16" + height="20" + increment="1" + initial_value="96" + follows="left|top|right" + layout="topleft" + max_val="65" + min_val="1" + left="93" + right="-68" + name="max_avatar_slider_bar" + control_name="RenderAvatarMaxVisible"/> + <spinner + top_pad="-21" + height="20" + label_width="0" + right="-8" + decimal_digits="0" + follows="top|right" + layout="topleft" + max_val="65" + min_val="1" + width="55" + increment="1" + name="max_avatar_spinner" + control_name="RenderAvatarMaxVisible" /> + <text + follows="left|top" + height="15" + left="10" + top_pad="3" + width="120" + layout="topleft" + value="Max Bandwidth:" /> + <slider_bar + top_pad="-16" + height="20" + increment="64" + initial_value="100" + follows="left|top|right" + layout="topleft" + max_val="6000" + min_val="100" + left="93" + right="-68" + name="bandwith_slider_bar" + control_name="ThrottleBandwidthKBPS" /> + <spinner + top_pad="-21" + height="20" + label_width="0" + right="-8" + decimal_digits="0" + follows="top|right" + layout="topleft" + max_val="6000" + min_val="100" + width="55" + increment="100" + name="bandwith_spinner" + control_name="ThrottleBandwidthKBPS"/> + <text + follows="left|top" + height="15" + left="10" + top_pad="3" + width="120" + layout="topleft" + value="Hover Height:" /> + <slider_bar + enabled="false" + top_pad="-16" + height="20" + left="93" + right="-68" + follows="left|top|right" + layout="topleft" + increment="0.001" + initial_value="0.0" + name="hover_slider_bar"/> + <spinner + enabled="false" + top_pad="-21" + height="20" + label_width="0" + right="-8" + decimal_digits="3" + follows="top|right" + layout="topleft" + max_val="2.0" + min_val="-2.0" + width="55" + increment="0.001" + name="hover_spinner" + control_name="AvatarHoverOffsetZ"/> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_quick_settings_pulldown.xml b/indra/newview/skins/default/xui/en/panel_quick_settings_pulldown.xml new file mode 100644 index 0000000000000000000000000000000000000000..91da126ebd7e7b96a2fd877dbf3b0375b2265024 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_quick_settings_pulldown.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + bg_opaque_image="Volume_Background" + bg_alpha_image="Volume_Background" + background_opaque="true" + background_visible="true" + layout="topleft" + width="300" + height="140" + name="quick_settings_pulldown"> + <panel + name="quick_settings" + class="quick_settings" + filename="panel_quick_settings.xml" + layout="topleft"/> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_status_bar.xml b/indra/newview/skins/default/xui/en/panel_status_bar.xml index ada980cda19616fcf60d14e6635fca3b0dc5df3f..b5130cc01a5bfbd1d8570723c3e19153aa57c9ee 100644 --- a/indra/newview/skins/default/xui/en/panel_status_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_status_bar.xml @@ -142,7 +142,7 @@ left_pad="0" name="TimeText" tool_tip="Current time (Pacific)" - width="145"> + width="135"> 24:00 AM PST </text> <icon @@ -186,4 +186,18 @@ top="2" name="volume_btn" width="16" /> + <button + follows="right|top" + height="16" + image_selected="Icon_Gear_Background" + image_pressed="Icon_Gear_Background" + image_unselected="Icon_Gear_Foreground" + left_pad="5" + top="2" + name="quick_settings_btn" + width="16"> + <click_callback + function="Floater.ToggleOrBringToFront" + parameter="quick_settings" /> + </button> </panel> diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 859e030ccbb73b07c31f2549148b0773225bc1dc..fcff4499c5c880016ba941500f0185e6a759e67a 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -4120,6 +4120,7 @@ Try enclosing path to the editor with double quotes. <string name="Command_Chat_Label">Chat</string> <string name="Command_Conversations_Label">Conversations</string> <string name="Command_Compass_Label">Compass</string> + <string name="Command_Debug_Label">Debug Settings</string> <string name="Command_Destinations_Label">Destinations</string> <string name="Command_Environments_Label">My Environments</string> <string name="Command_Gestures_Label">Gestures</string> @@ -4131,26 +4132,33 @@ Try enclosing path to the editor with double quotes. <string name="Command_MarketplaceListings_Label">Marketplace</string> <string name="Command_MiniMap_Label">Mini-map</string> <string name="Command_Move_Label">Walk / run / fly</string> + <string name="Command_Panic_Label">Panic!</string> <string name="Command_People_Label">People</string> <string name="Command_Picks_Label">Picks</string> <string name="Command_Places_Label">Places</string> <string name="Command_Preferences_Label">Preferences</string> <string name="Command_Profile_Label">Profile</string> + <string name="Command_Quick_Settings_Label">Quick Settings</string> <string name="Command_RegionTracker_Label">Region Tracker</string> <string name="Command_Report_Abuse_Label">Report Abuse</string> + <string name="Command_Scripts_Label">My Scripts</string> + <string name="Command_Stats_Label">Statistics</string> <string name="Command_Search_Label">Search</string> <string name="Command_Snapshot_Label">Snapshot</string> <string name="Command_Speak_Label">Speak</string> - <string name="Command_View_Label">Camera controls</string> - <string name="Command_Voice_Label">Voice settings</string> + <string name="Command_View_Label">Camera</string> + <string name="Command_Voice_Label">Voice Settings</string> + <string name="Command_Webbrowser_Label">Web Browser</string> <string name="Command_AboutLand_Tooltip">Information about the land you're visiting</string> + <string name="Command_AnimationOverride_Tooltip">Animation Override</string> <string name="Command_Appearance_Tooltip">Change your avatar</string> <string name="Command_Avatar_Tooltip">Choose a complete avatar</string> <string name="Command_Build_Tooltip">Building objects and reshaping terrain</string> <string name="Command_Chat_Tooltip">Chat with people nearby using text</string> <string name="Command_Conversations_Tooltip">Converse with everyone</string> <string name="Command_Compass_Tooltip">Compass</string> + <string name="Command_Debug_Tooltip">Debug settings for advanced users</string> <string name="Command_Destinations_Tooltip">Destinations of interest</string> <string name="Command_Environments_Tooltip">My Environments</string> <string name="Command_Gestures_Tooltip">Gestures for your avatar</string> @@ -4162,18 +4170,23 @@ Try enclosing path to the editor with double quotes. <string name="Command_MarketplaceListings_Tooltip">Sell your creation</string> <string name="Command_MiniMap_Tooltip">Show nearby people</string> <string name="Command_Move_Tooltip">Moving your avatar</string> + <string name="Command_Panic_Tooltip">Press this if you're in trouble</string> <string name="Command_People_Tooltip">Friends, groups, and nearby people</string> <string name="Command_Picks_Tooltip">Places to show as favorites in your profile</string> <string name="Command_Places_Tooltip">Places you've saved</string> <string name="Command_Preferences_Tooltip">Preferences</string> <string name="Command_Profile_Tooltip">Edit or view your profile</string> + <string name="Command_Quick_Settings_Tooltip">Quick preferences</string> <string name="Command_RegionTracker_Tooltip">Track various regions status</string> <string name="Command_Report_Abuse_Tooltip">Report Abuse</string> + <string name="Command_Scripts_Tooltip">Scripts attached to your avatar</string> + <string name="Command_Stats_Tooltip">Statistics like FPS, network usage and sim performance</string> <string name="Command_Search_Tooltip">Find places, events, people</string> <string name="Command_Snapshot_Tooltip">Take a picture</string> <string name="Command_Speak_Tooltip">Speak with people nearby using your microphone</string> <string name="Command_View_Tooltip">Changing camera angle</string> <string name="Command_Voice_Tooltip">Volume controls for calls and people near you in world</string> + <string name="Command_Webbrowser_Tooltip">Open a web browser inside [APP_NAME]</string> <string name="Toolbar_Bottom_Tooltip">currently in your bottom toolbar</string> <string name="Toolbar_Left_Tooltip" >currently in your left toolbar</string>