FIRE-29571: Turn "Sky" button into "Personal Lighting" button on navigation bar (and make it respect RLVa @setenv restriction)

master
Ansariel 2020-05-19 00:52:55 +02:00
parent 67d20f4f4e
commit d204cf739f
7 changed files with 63 additions and 47 deletions

View File

@ -72,6 +72,7 @@
#include "llnotificationsutil.h"// <FS:AW hypergrid support >
#include "lluictrl.h" // <FS:Zi> Make navigation bar part of the UI
#include "rlvhandler.h"
//-- LLTeleportHistoryMenuItem -----------------------------------------------
@ -279,7 +280,8 @@ LLNavigationBar::LLNavigationBar()
mNavigationPanel(NULL),
mFavoritePanel(NULL),
mNavPanWidth(0),
mSearchComboBox(NULL)
mSearchComboBox(NULL),
mRlvBehaviorCallbackConnection() // <FS:Ansariel> FIRE-11847
{
// buildFromFile( "panel_navigation_bar.xml"); // <FS:Zi> Make navigation bar part of the UI
@ -292,6 +294,13 @@ LLNavigationBar::~LLNavigationBar()
{
mTeleportFinishConnection.disconnect();
mTeleportFailedConnection.disconnect();
// <FS:Ansariel> FIRE-11847
if (mRlvBehaviorCallbackConnection.connected())
{
mRlvBehaviorCallbackConnection.disconnect();
}
// </FS:Ansariel>
}
// <FS:Zi> Make navigation bar part of the UI
@ -318,7 +327,7 @@ void LLNavigationBar::setupPanel()
mView->getChild<LLUICtrl>("navigation_bar_context_menu_panel")->
setRightMouseDownCallback(boost::bind(&LLNavigationBar::onRightMouseDown, this, _2, _3, _4));
mView->getChild<LLButton>("Sky")->setCommitCallback(boost::bind(&LLNavigationBar::onClickedSkyBtn, this)); // <FS:CR> FIRE-11847
mView->getChild<LLButton>("PersonalLighting")->setCommitCallback(boost::bind(&LLNavigationBar::onClickedLightingBtn, this)); // <FS:CR> FIRE-11847
// </FS:Zi>
fillSearchComboBox();
@ -371,6 +380,9 @@ void LLNavigationBar::setupPanel()
// return TRUE;
LLHints::getInstance()->registerHintTarget("nav_bar",mView->getHandle());
// </FS:Zi>
// <FS:Ansariel> FIRE-11847
mRlvBehaviorCallbackConnection = gRlvHandler.setBehaviourCallback(boost::bind(&LLNavigationBar::updateRlvRestrictions, this, _1, _2));
}
// <FS:Zi> No size calculations in code please. XUI handles it all now with visibility_control
@ -881,8 +893,16 @@ void LLNavigationBar::onRightMouseDown(S32 x,S32 y,MASK mask)
// </FS:Zi>
// <FS:CR> FIRE-11847
void LLNavigationBar::onClickedSkyBtn()
void LLNavigationBar::onClickedLightingBtn()
{
LLFloaterReg::showInstance("env_edit_sky", "edit");
LLFloaterReg::showInstance("env_adjust_snapshot");
}
void LLNavigationBar::updateRlvRestrictions(ERlvBehaviour behavior, ERlvParamType type)
{
if (behavior == RLV_BHVR_SETENV)
{
mView->getChild<LLButton>("PersonalLighting")->setEnabled(type != RLV_TYPE_ADD);
}
}
// </FS:CR> FIRE-11847

View File

@ -33,6 +33,7 @@
#include "llbutton.h"
#include "lllayoutstack.h"
#include "llinitdestroyclass.h"
#include "rlvdefines.h"
class LLLocationInputCtrl;
class LLMenuGL;
@ -151,7 +152,11 @@ private:
void fillSearchComboBox();
void onClickedSkyBtn(); // <FS:CR> FIRE-11847
// <FS:CR> FIRE-11847
void onClickedLightingBtn();
boost::signals2::connection mRlvBehaviorCallbackConnection;
void updateRlvRestrictions(ERlvBehaviour behavior, ERlvParamType type);
// </FS:CR>
// <FS:Zi> Make navigation bar part of the UI
// static void destroyClass()

View File

@ -3,12 +3,12 @@
<layout_stack name="navigation_favorites_bar_visibility_stack">
<layout_panel name="navigation_bar_visibility_panel">
<layout_stack name="location_search_layout">
<layout_panel name="navigation_buttons_visibility_panel" right="223">
<layout_panel name="navigation_buttons_visibility_panel" right="253">
<pull_button name="back_btn" tool_tip="Zum vorherigen Standort zurückgehen"/>
<pull_button name="forward_btn" tool_tip="Einen Standort weiter gehen"/>
<button name="home_btn" tool_tip="Zu meinem Zuhause teleportieren"/>
<button name="About_Land" label="Land" tool_tip="Landinformationen anzeigen"/>
<button name="Sky" label="Himmel" tool_tip="Öffnet das Fenster mit den Himmel-Voreinstellungen" width="60"/>
<button name="PersonalLighting" label="Beleuchtung" tool_tip="Öffnet das Fenster mit den persönlichen Beleuchtungseinstellungen" width="90"/>
</layout_panel>
<layout_panel name="location_bar_visibility_panel">
<location_input label="Standort" name="location_combo"/>

View File

@ -65,7 +65,7 @@
mouse_opaque="false"
name="navigation_buttons_visibility_panel"
layout="topleft"
right="193"
right="223"
height="22"
auto_resize="false">
@ -113,7 +113,7 @@
left_pad="7"
name="About_Land"
label="Land"
tool_tip="Pops up Land Information window"
tool_tip="Opens Land Information window"
top_delta="0"
width="43">
<button.init_callback
@ -129,11 +129,11 @@
use_ellipses="true"
layout="topleft"
left_pad="7"
name="Sky"
label="Sky"
tool_tip="Pops up Sky Editor window"
name="PersonalLighting"
label="Lighting"
tool_tip="Opens the Personal Lighting window"
top_delta="0"
width="30" />
width="60" />
<!-- end of Windlight Button -->
</layout_panel>

View File

@ -38,7 +38,7 @@
width="1024">
<!-- This panel takes up the right click menu, so it only shows when clicking
inactive parts. Will be bound to right click in code, so keep the name intact. -->
inactive parts. Will be bound to right click in code, so keep the name intact. -->
<panel
name="navigation_bar_context_menu_panel"
layout="topleft"
@ -65,11 +65,11 @@
mouse_opaque="false"
name="navigation_buttons_visibility_panel"
layout="topleft"
right="193"
right="223"
height="22"
auto_resize="false">
<pull_button
<pull_button
follows="left|top"
direction="down"
height="23"
@ -108,32 +108,32 @@
<button
follows="left|top"
height="23"
use_ellipses="true"
use_ellipses="true"
layout="topleft"
left_pad="7"
name="About_Land"
label="Land"
tool_tip="Pops up Land Information window"
tool_tip="Opens Land Information window"
top_delta="0"
width="43">
<button.init_callback
function="Button.SetFloaterToggle"
parameter="about_land" />
</button>
function="Button.SetFloaterToggle"
parameter="about_land" />
</button>
<!-- end of About Land Button -->
<!-- Windlight Button here -->
<button
follows="left|top"
height="23"
use_ellipses="true"
use_ellipses="true"
layout="topleft"
left_pad="7"
name="Sky"
label="Sky"
tool_tip="Pops up Sky Editor window"
name="PersonalLighting"
label="Lighting"
tool_tip="Opens the Personal Lighting window"
top_delta="0"
width="30" />
width="60" />
<!-- end of Windlight Button -->
</layout_panel>
@ -161,7 +161,7 @@
top="0"
width="587">
<combo_list
mouse_wheel_opaque="true"/>
mouse_wheel_opaque="true"/>
</location_input>
</layout_panel>
@ -190,7 +190,7 @@
top="0"
width="234">
<combo_editor
label="Search MetaVerse"
label="Search Metaverse"
name="search_combo_editor"/>
<combo_list
draw_border="true"

View File

@ -116,7 +116,7 @@
layout="topleft"
left_pad="6"
name="About_Land"
tool_tip="Pops up Land Information window"
tool_tip="Opens Land Information window"
top_delta="0"
width="38">
<button.init_callback
@ -133,14 +133,10 @@
image_overlay="Windlight_btn"
layout="topleft"
left_pad="6"
name="Environment"
tool_tip="Pops up Environment Settings window"
name="PersonalLighting"
tool_tip="Opens the Personal Lighting window"
top_delta="0"
width="38">
<button.init_callback
function="Button.SetFloaterToggle"
parameter="env_settings" />
</button>
width="38" />
<!-- end of Windlight Button -->
</layout_panel>

View File

@ -40,7 +40,7 @@
auto_resize="false">
<!-- This panel takes up the right click menu, so it only shows when clicking
inactive parts. Will be bound to right click in code, so keep the name intact. -->
inactive parts. Will be bound to right click in code, so keep the name intact. -->
<panel
name="navigation_bar_context_menu_panel"
layout="topleft"
@ -115,7 +115,7 @@
layout="topleft"
left_pad="6"
name="About_Land"
tool_tip="Pops up Land Information window"
tool_tip="Opens Land Information window"
top_delta="0"
width="38">
<button.init_callback
@ -132,14 +132,10 @@
image_overlay="Windlight_btn"
layout="topleft"
left_pad="6"
name="Environment"
tool_tip="Pops up Environment Settings window"
name="PersonalLighting"
tool_tip="Opens the Personal Lighting window"
top_delta="0"
width="38">
<button.init_callback
function="Button.SetFloaterToggle"
parameter="env_settings" />
</button>
width="38" />
<!-- end of Windlight Button -->
</layout_panel>
@ -174,7 +170,7 @@
</layout_panel>
<!-- Contains the location bar -->
<!-- Contains the search bar, can be hidden by control values -->
<!-- Contains the search bar, can be hidden by control values --><!-- Contains the search bar, can be hidden by code -->
<layout_panel
mouse_opaque="false"
name="search_bar_visibility_panel"
@ -258,7 +254,6 @@
</layout_panel>
<!-- Favorites Bar visibility panel -->
</layout_stack>
<!-- Navigation and Favorites Bar visibility stack -->