Add Marketplace option to toolbar and add to world menu

Also hidden in this commit is the ability to add buttons/menu entries for
your favorite websites to be opened in the in-viewer browser
Just make a button that calls "ShowWebFloater" and passes the URL as param
This commit is contained in:
Lirusaito
2019-08-03 18:37:22 -04:00
parent 01b4f52fb0
commit bcf301ce6a
8 changed files with 59 additions and 3 deletions

View File

@@ -1829,6 +1829,19 @@ Changing this setting only affects new text.</string>
<key>IsCOA</key>
<integer>1</integer>
</map>
<key>ToolbarVisibleMarketplace</key>
<map>
<key>Comment</key>
<string>Whether or not the button for marketplace is on the toolbar</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<boolean>0</boolean>
<key>IsCOA</key>
<integer>1</integer>
</map>
<key>ToolbarVisibleMarketplaceListings</key>
<map>
<key>Comment</key>

View File

@@ -205,7 +205,6 @@ struct MenuFloaterDict : public LLSingleton<MenuFloaterDict>
registerFloater("test", boost::bind(LLFloaterTest::show, (void*)NULL));
// Phoenix: Wolfspirit: Enabled Show Floater out of viewer menu
registerFloater("WaterSettings", boost::bind(LLFloaterWater::show), boost::bind(LLFloaterWater::isOpen));
registerFloater("web", boost::bind(LLFloaterWebContent::showInstance, "dict web", LLFloaterWebContent::Params()));
registerFloater("Windlight", boost::bind(LLFloaterWindLight::show), boost::bind(LLFloaterWindLight::isOpen));
registerFloater("world map", boost::bind(LLFloaterWorldMap::toggle));
registerFloater<LLFloaterLand> ("about land");

View File

@@ -102,6 +102,7 @@ F32 LLToolBar::sInventoryAutoOpenTime = 1.f;
//
void show_floater(const std::string& floater_name);
void show_inv_floater(const LLSD& userdata, const std::string& field);
void show_web_floater(const std::string& type);
LLToolBar::LLToolBar()
: LLLayoutPanel()
@@ -112,6 +113,7 @@ LLToolBar::LLToolBar()
mCommitCallbackRegistrar.add("ShowInvFloater.ID", boost::bind(show_inv_floater, _2, "id"));
mCommitCallbackRegistrar.add("ShowInvFloater.Name", boost::bind(show_inv_floater, _2, "name"));
mCommitCallbackRegistrar.add("ShowInvFloater.Type", boost::bind(show_inv_floater, _2, "type"));
mCommitCallbackRegistrar.add("ShowWebFloater", boost::bind(show_web_floater, _2));
}

View File

@@ -8988,6 +8988,37 @@ class VisibleInvFloaterType : public view_listener_t
}
};
void show_web_floater(const std::string& type)
{
auto p = LLFloaterWebContent::Params();
if (!type.empty()) p.id = type;
if (type == "marketplace")
{
if (gHippoGridManager->getConnectedGrid()->isSecondLife())
p.url = "https://marketplace.secondlife.com";
else if (LLViewerRegion* region = gAgent.getRegion())
{
LLSD info;
region->getSimulatorFeatures(info);
p.url = info["MarketplaceURL"];
}
}
else if (!type.empty() && type != "dict web")
{
p.url = type; // Simple web floaters with direct urls
}
LLFloaterWebContent::showInstance(type, p);
}
class ShowWebFloater : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
show_web_floater(userdata.asStringRef());
return true;
}
};
class VisibleSecondLife : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
@@ -9727,6 +9758,8 @@ void initialize_menus()
addMenu(new VisibleInvFloaterName, "InvFloaterVisible.Name");
addMenu(new VisibleInvFloaterType, "InvFloaterVisible.Type");
addMenu(new ShowWebFloater, "ShowWebFloater");
// [RLVa:KB] - Checked: 2010-01-18 (RLVa-1.1.0m) | Added: RLVa-1.1.0m | OK
if (rlv_handler_t::isEnabled())
{

View File

@@ -82,7 +82,8 @@
<check_box bottom_delta="-20" label="Favorites" name="favs_btn" follows="left|right" control_name="ToolbarVisibleInventoryFavs"/>
<check_box bottom_delta="-20" label="Received Items" name="received_items_btn" follows="left|right" control_name="ToolbarVisibleInventoryReceivedItems"/>
<check_box bottom_delta="-20" label="Marketplace Listings" name="marketplace_listings_btn" follows="left|right" control_name="ToolbarVisibleMarketplaceListings"/>
<check_box bottom="-38" label="Preferences" name="preferences_btn" follows="left|right" control_name="ToolbarVisiblePreferences" left_delta="160"/>
<check_box bottom="-38" label="Marketplace" name="marketplace_btn" follows="left|right" control_name="ToolbarVisibleMarketplace" left_delta="160"/>
<check_box bottom_delta="-20" label="Preferences" name="preferences_btn" follows="left|right" control_name="ToolbarVisiblePreferences"/>
<check_box bottom_delta="-20" label="Joystick Config" name="joystick_btn" follows="left|right" control_name="ToolbarVisibleJoystick"/>
<check_box bottom_delta="-20" label="Autoreplace" name="auto_replace_btn" follows="left|right" control_name="ToolbarVisibleAutoReplace"/>
<check_box bottom_delta="-20" label="Display Name" name="display_name_btn" follows="left|right" control_name="ToolbarVisibleDisplayName"/>

View File

@@ -605,6 +605,9 @@
<on_click function="PromptShowURL" name="ManageMyAccount_url"
userdata="WebLaunchJoinNow,http://secondlife.com/account/" />
</menu_item_call>
<menu_item_call label="Marketplace" name="Marketplace">
<on_click function="ShowWebFloater" userdata="marketplace"/>
</menu_item_call>
<menu_item_check
label="Marketplace Listings..."
name="MarketplaceListings">

View File

@@ -152,7 +152,7 @@
</layout_panel>
<layout_panel name="panelweb" height="24" width="50" user_resize="false" visibility_control="ToolbarVisibleWeb">
<button sound_flags="0" bottom="0" height="24" label="Web Browser" name="web_browser_btn" image_overlay="icn_toolbar_web.tga" image_overlay_alignment="left" image_selected="toolbar_btn_selected.tga" image_unselected="toolbar_btn_enabled.tga" image_disabled="toolbar_btn_disabled.tga" scale_image="true" width="50" follows="left|right">
<button.commit_callback function="ShowFloater" parameter="web"/>
<button.commit_callback function="ShowWebFloater" parameter="dict web"/>
</button>
</layout_panel>
<layout_panel name="panelao" height="24" width="50" user_resize="false" visibility_control="ToolbarVisibleAO">
@@ -417,6 +417,11 @@
<button.commit_callback function="ShowFloater" parameter="marketplace_listings"/>
</button>
</layout_panel>
<layout_panel name="panelmarketplace" height="24" width="50" user_resize="false" visibility_control="ToolbarVisibleMarketplace">
<button sound_flags="0" bottom="0" height="24" label="Marketplace" name="marketplace_btn" image_overlay="icn_toolbar_marketplace.tga" image_overlay_alignment="left" image_selected="toolbar_btn_selected.tga" image_unselected="toolbar_btn_enabled.tga" image_disabled="toolbar_btn_disabled.tga" scale_image="true" width="50" follows="left|right">
<button.commit_callback function="ShowWebFloater" parameter="marketplace"/>
</button>
</layout_panel>
<layout_panel name="panelpreferences" height="24" width="50" user_resize="false" visibility_control="ToolbarVisiblePreferences">
<button sound_flags="0" bottom="0" height="24" label="Preferences" name="preferences_btn" tool_tip="Ctrl-P" image_overlay="icn_toolbar_preferences.tga" image_overlay_alignment="left" image_selected="toolbar_btn_selected.tga" image_unselected="toolbar_btn_enabled.tga" image_disabled="toolbar_btn_disabled.tga" scale_image="true" width="50" follows="left|right">
<button.commit_callback function="ShowFloater" parameter="preferences"/>