diff --git a/indra/llui/llcommandmanager.cpp b/indra/llui/llcommandmanager.cpp index 0e2f3f1961..6400e75947 100644 --- a/indra/llui/llcommandmanager.cpp +++ b/indra/llui/llcommandmanager.cpp @@ -63,6 +63,7 @@ LLCommand::Params::Params() , is_running_parameters("is_running_parameters") , is_starting_function("is_starting_function") , is_starting_parameters("is_starting_parameters") + , control_name("control_name") // Add control_name to toolbar buttons { } @@ -83,6 +84,7 @@ LLCommand::LLCommand(const LLCommand::Params& p) , mIsRunningParameters(p.is_running_parameters) , mIsStartingFunction(p.is_starting_function) , mIsStartingParameters(p.is_starting_parameters) + , mControlVariable(p.control_name) // Add control_name to toolbar buttons { } diff --git a/indra/llui/llcommandmanager.h b/indra/llui/llcommandmanager.h index a7276a48aa..f84ef05bb0 100644 --- a/indra/llui/llcommandmanager.h +++ b/indra/llui/llcommandmanager.h @@ -96,7 +96,11 @@ public: Mandatory name; Mandatory tooltip_ref; - Mandatory execute_function; + // Add control_name to toolbar buttons + // so we can have control_name instead of aall these functions. + // Mandatory execute_function; + Optional execute_function; + // Optional execute_parameters; Optional execute_stop_function; @@ -111,6 +115,8 @@ public: Optional is_starting_function; Optional is_starting_parameters; + Optional control_name; // Add control_name to toolbar buttons + Params(); }; @@ -161,6 +167,13 @@ private: std::string mIsStartingFunction; LLSD mIsStartingParameters; + +// Add control_variable to commands in toolbar + std::string mControlVariable; + +public: + const std::string& controlVariableName() const { return mControlVariable; } +// }; diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index 34a748d979..856d3c67b5 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -1017,6 +1017,16 @@ LLToolBarButton* LLToolBar::createButton(const LLCommandId& id) button_p.name = commandp->name(); button_p.label = LLTrans::getString(commandp->labelRef()); button_p.tool_tip = LLTrans::getString(commandp->tooltipRef()); + + // Add control_variable to commands in toolbar if it's not read-only + if(!mReadOnly && !commandp->controlVariableName().empty()) + { + // set up button's control name and make it a toggle, so it works properly + button_p.control_name = commandp->controlVariableName(); + button_p.is_toggle = TRUE; + } + // + // Do not add an icon if we are using text only buttons // button_p.image_overlay = LLUI::getUIImage(commandp->icon()); if(mButtonType!=BTNTYPE_TEXT_ONLY) diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml index c61f29c11e..1119a10799 100644 --- a/indra/newview/app_settings/commands.xml +++ b/indra/newview/app_settings/commands.xml @@ -5,7 +5,7 @@ icon="Command_AboutLand_Icon" label_ref="Command_AboutLand_Label" tooltip_ref="Command_AboutLand_Tooltip" - execute_function="Floater.Toggle" + execute_function="Floater.ToggleOrBringToFront" execute_parameters="about_land" is_enabled_function="RLV.EnableIfNot" is_enabled_parameters="showloc" @@ -17,7 +17,7 @@ icon="Command_Appearance_Icon" label_ref="Command_Appearance_Label" tooltip_ref="Command_Appearance_Tooltip" - execute_function="Floater.Toggle" + execute_function="Floater.ToggleOrBringToFront" execute_parameters="appearance" is_running_function="Floater.IsOpen" is_running_parameters="appearance" @@ -27,7 +27,7 @@ icon="Command_Avatar_Icon" label_ref="Command_Avatar_Label" tooltip_ref="Command_Avatar_Tooltip" - execute_function="Floater.Toggle" + execute_function="Floater.ToggleOrBringToFront" execute_parameters="avatar" is_running_function="Floater.IsOpen" is_running_parameters="avatar" @@ -49,7 +49,7 @@ icon="Command_Chat_Icon" label_ref="Command_Chat_Label" tooltip_ref="Command_Chat_Tooltip" - execute_function="Floater.Toggle" + execute_function="Floater.ToggleOrBringToFront" execute_parameters="im_container" is_running_function="Floater.IsOpen" is_running_parameters="im_container" @@ -59,7 +59,7 @@ icon="Command_Compass_Icon" label_ref="Command_Compass_Label" tooltip_ref="Command_Compass_Tooltip" - execute_function="Floater.Toggle" + execute_function="Floater.ToggleOrBringToFront" execute_parameters="compass" is_running_function="Floater.IsOpen" is_running_parameters="compass" @@ -69,7 +69,7 @@ icon="Command_Destinations_Icon" label_ref="Command_Destinations_Label" tooltip_ref="Command_Destinations_Tooltip" - execute_function="Floater.Toggle" + execute_function="Floater.ToggleOrBringToFront" execute_parameters="destinations" is_running_function="Floater.IsOpen" is_running_parameters="destinations" @@ -79,7 +79,7 @@ icon="Command_Gestures_Icon" label_ref="Command_Gestures_Label" tooltip_ref="Command_Gestures_Tooltip" - execute_function="Floater.Toggle" + execute_function="Floater.ToggleOrBringToFront" execute_parameters="gestures" is_running_function="Floater.IsOpen" is_running_parameters="gestures" @@ -97,7 +97,7 @@ icon="Command_Inventory_Icon" label_ref="Command_Inventory_Label" tooltip_ref="Command_Inventory_Tooltip" - execute_function="Floater.Toggle" + execute_function="Floater.ToggleOrBringToFront" execute_parameters="inventory" is_enabled_function="RLV.EnableIfNot" is_enabled_parameters="showinv" @@ -109,7 +109,7 @@ icon="Command_Map_Icon" label_ref="Command_Map_Label" tooltip_ref="Command_Map_Tooltip" - execute_function="Floater.Toggle" + execute_function="Floater.ToggleOrBringToFront" execute_parameters="world_map" is_enabled_function="RLV.EnableIfNot" is_enabled_parameters="showworldmap" @@ -128,7 +128,7 @@ icon="Command_MiniMap_Icon" label_ref="Command_MiniMap_Label" tooltip_ref="Command_MiniMap_Tooltip" - execute_function="Floater.Toggle" + execute_function="Floater.ToggleOrBringToFront" execute_parameters="mini_map" is_enabled_function="RLV.EnableIfNot" is_enabled_parameters="showminimap" @@ -140,7 +140,7 @@ icon="Command_Move_Icon" label_ref="Command_Move_Label" tooltip_ref="Command_Move_Tooltip" - execute_function="Floater.Toggle" + execute_function="Floater.ToggleOrBringToFront" execute_parameters="moveview" is_running_function="Floater.IsOpen" is_running_parameters="moveview" @@ -150,7 +150,7 @@ icon="Command_Outbox_Icon" label_ref="Command_Outbox_Label" tooltip_ref="Command_Outbox_Tooltip" - execute_function="Floater.Toggle" + execute_function="Floater.ToggleOrBringToFront" execute_parameters="outbox" is_running_function="Floater.IsOpen" is_running_parameters="outbox" @@ -160,7 +160,7 @@ icon="Command_People_Icon" label_ref="Command_People_Label" tooltip_ref="Command_People_Tooltip" - execute_function="Floater.Toggle" + execute_function="Floater.ToggleOrBringToFront" execute_parameters="people" is_running_function="Floater.IsOpen" is_running_parameters="people" @@ -170,7 +170,7 @@ icon="Command_Picks_Icon" label_ref="Command_Picks_Label" tooltip_ref="Command_Picks_Tooltip" - execute_function="Floater.Toggle" + execute_function="Floater.ToggleOrBringToFront" execute_parameters="picks" is_running_function="Floater.IsOpen" is_running_parameters="picks" @@ -180,7 +180,7 @@ icon="Command_Places_Icon" label_ref="Command_Places_Label" tooltip_ref="Command_Places_Tooltip" - execute_function="Floater.Toggle" + execute_function="Floater.ToggleOrBringToFront" execute_parameters="places" is_running_function="Floater.IsOpen" is_running_parameters="places" @@ -190,7 +190,7 @@ icon="Command_Preferences_Icon" label_ref="Command_Preferences_Label" tooltip_ref="Command_Preferences_Tooltip" - execute_function="Floater.Toggle" + execute_function="Floater.ToggleOrBringToFront" execute_parameters="preferences" is_running_function="Floater.IsOpen" is_running_parameters="preferences" @@ -208,7 +208,7 @@ icon="Command_Search_Icon" label_ref="Command_Search_Label" tooltip_ref="Command_Search_Tooltip" - execute_function="Floater.Toggle" + execute_function="Floater.ToggleOrBringToFront" execute_parameters="search" is_running_function="Floater.IsOpen" is_running_parameters="search" @@ -218,7 +218,7 @@ icon="Command_Snapshot_Icon" label_ref="Command_Snapshot_Label" tooltip_ref="Command_Snapshot_Tooltip" - execute_function="Floater.Toggle" + execute_function="Floater.ToggleOrBringToFront" execute_parameters="snapshot" is_running_function="Floater.IsOpen" is_running_parameters="snapshot" @@ -242,7 +242,7 @@ icon="Command_View_Icon" label_ref="Command_View_Label" tooltip_ref="Command_View_Tooltip" - execute_function="Floater.Toggle" + execute_function="Floater.ToggleOrBringToFront" execute_parameters="camera" is_running_function="Floater.IsOpen" is_running_parameters="camera" @@ -252,7 +252,7 @@ icon="Command_Voice_Icon" label_ref="Command_Voice_Label" tooltip_ref="Command_Voice_Tooltip" - execute_function="Floater.Toggle" + execute_function="Floater.ToggleOrBringToFront" execute_parameters="voice_controls" is_running_function="Floater.IsOpen" is_running_parameters="voice_controls" @@ -264,7 +264,7 @@ icon="phoenix_18" label_ref="Command_Quickprefs_Label" tooltip_ref="Command_Quickprefs_Tooltip" - execute_function="Floater.Toggle" + execute_function="Floater.ToggleOrBringToFront" execute_parameters="quickprefs" is_running_function="Floater.IsOpen" is_running_parameters="quickprefs" @@ -275,21 +275,18 @@ icon="ao_toggle_18" label_ref="Command_AO_Label" tooltip_ref="Command_AO_Tooltip" - execute_function="Floater.Toggle" + execute_function="Floater.ToggleOrBringToFront" execute_parameters="animation_overrider" is_running_function="Floater.IsOpen" is_running_parameters="animation_overrider" /> - + - diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 4a3b34dada..59787f6bcc 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -3893,7 +3893,7 @@ Try enclosing path to the editor with double quotes. Quick prefs Animation Overrider - Web Browser + Chat Information about the land you're visiting Change your avatar @@ -3923,7 +3923,7 @@ Try enclosing path to the editor with double quotes. Quick preferences for changing often used settings Animation Overrider - Opens the internal web browser + Shows or hides the default chat bar currently in your bottom toolbar currently in your left toolbar