Made command list able to use control_name buttons.
parent
f9ff24d22b
commit
e43e224a4e
|
|
@ -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") // <FS:Zi> 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) // <FS:Zi> Add control_name to toolbar buttons
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -96,7 +96,11 @@ public:
|
|||
Mandatory<std::string> name;
|
||||
Mandatory<std::string> tooltip_ref;
|
||||
|
||||
Mandatory<std::string> execute_function;
|
||||
// <FS:Zi> Add control_name to toolbar buttons
|
||||
// so we can have control_name instead of aall these functions.
|
||||
// Mandatory<std::string> execute_function;
|
||||
Optional<std::string> execute_function;
|
||||
// </FS:Zi>
|
||||
Optional<LLSD> execute_parameters;
|
||||
|
||||
Optional<std::string> execute_stop_function;
|
||||
|
|
@ -111,6 +115,8 @@ public:
|
|||
Optional<std::string> is_starting_function;
|
||||
Optional<LLSD> is_starting_parameters;
|
||||
|
||||
Optional<std::string> control_name; // <FS:Zi> Add control_name to toolbar buttons
|
||||
|
||||
Params();
|
||||
};
|
||||
|
||||
|
|
@ -161,6 +167,13 @@ private:
|
|||
|
||||
std::string mIsStartingFunction;
|
||||
LLSD mIsStartingParameters;
|
||||
|
||||
// <FS;Zi> Add control_variable to commands in toolbar
|
||||
std::string mControlVariable;
|
||||
|
||||
public:
|
||||
const std::string& controlVariableName() const { return mControlVariable; }
|
||||
// </FS:Zi>
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
||||
// <FS;Zi> 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;
|
||||
}
|
||||
// </FS:Zi>
|
||||
|
||||
// <FS:Zi> 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)
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
/>
|
||||
|
||||
<command name="webbrowser"
|
||||
<!-- this uses control_name instead of the execute/is_running functions -Zi -->
|
||||
<command name="defaultchatbar"
|
||||
available_in_toybox="true"
|
||||
icon="www_18"
|
||||
label_ref="Command_Webbrowser_Label"
|
||||
tooltip_ref="Command_Webbrowser_Tooltip"
|
||||
execute_function="ToggleWebBrowser"
|
||||
execute_parameters="http://www.google.com"
|
||||
is_running_function="Floater.IsOpen"
|
||||
is_running_parameters="web_content"
|
||||
icon="nearbychat_18"
|
||||
label_ref="Default_Chat_Bar_Label"
|
||||
tooltip_ref="Default_Chat_Bar_Tooltip"
|
||||
control_name="MainChatbarVisible"
|
||||
/>
|
||||
|
||||
</commands>
|
||||
|
|
|
|||
|
|
@ -3893,7 +3893,7 @@ Try enclosing path to the editor with double quotes.
|
|||
<!-- Firestorm commands -->
|
||||
<string name="Command_Quickprefs_Label">Quick prefs</string>
|
||||
<string name="Command_AO_Label">Animation Overrider</string>
|
||||
<string name="Command_Webbrowser_Label">Web Browser</string>
|
||||
<string name="Default_Chat_Bar_Label">Chat</string>
|
||||
|
||||
<string name="Command_AboutLand_Tooltip">Information about the land you're visiting</string>
|
||||
<string name="Command_Appearance_Tooltip">Change your avatar</string>
|
||||
|
|
@ -3923,7 +3923,7 @@ Try enclosing path to the editor with double quotes.
|
|||
<!-- Firestorm commands -->
|
||||
<string name="Command_Quickprefs_Tooltip">Quick preferences for changing often used settings</string>
|
||||
<string name="Command_AO_Tooltip">Animation Overrider</string>
|
||||
<string name="Command_Webbrowser_Tooltip">Opens the internal web browser</string>
|
||||
<string name="Default_Chat_Bar_Tooltip">Shows or hides the default chat bar</string>
|
||||
|
||||
<string name="Toolbar_Bottom_Tooltip">currently in your bottom toolbar</string>
|
||||
<string name="Toolbar_Left_Tooltip" >currently in your left toolbar</string>
|
||||
|
|
|
|||
Loading…
Reference in New Issue