From bcf301ce6a782401630571aef7228e31ca6a61c5 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sat, 3 Aug 2019 18:37:22 -0400 Subject: [PATCH] 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 --- .../newview/app_settings/settings_ascent.xml | 13 +++++++ indra/newview/llmenucommands.cpp | 1 - indra/newview/lltoolbar.cpp | 2 ++ indra/newview/llviewermenu.cpp | 33 ++++++++++++++++++ .../textures/icn_toolbar_marketplace.tga | Bin 0 -> 49 bytes .../xui/en-us/floater_toolbar_prefs.xml | 3 +- .../skins/default/xui/en-us/menu_viewer.xml | 3 ++ .../skins/default/xui/en-us/panel_toolbar.xml | 7 +++- 8 files changed, 59 insertions(+), 3 deletions(-) create mode 100644 indra/newview/skins/default/textures/icn_toolbar_marketplace.tga diff --git a/indra/newview/app_settings/settings_ascent.xml b/indra/newview/app_settings/settings_ascent.xml index 3995b31a3..65398b513 100644 --- a/indra/newview/app_settings/settings_ascent.xml +++ b/indra/newview/app_settings/settings_ascent.xml @@ -1829,6 +1829,19 @@ Changing this setting only affects new text. IsCOA 1 + ToolbarVisibleMarketplace + + Comment + Whether or not the button for marketplace is on the toolbar + Persist + 1 + Type + Boolean + Value + 0 + IsCOA + 1 + ToolbarVisibleMarketplaceListings Comment diff --git a/indra/newview/llmenucommands.cpp b/indra/newview/llmenucommands.cpp index 2246deaff..ae140fa2f 100644 --- a/indra/newview/llmenucommands.cpp +++ b/indra/newview/llmenucommands.cpp @@ -205,7 +205,6 @@ struct MenuFloaterDict : public LLSingleton 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 ("about land"); diff --git a/indra/newview/lltoolbar.cpp b/indra/newview/lltoolbar.cpp index ecdcc8062..5a28dfcd6 100644 --- a/indra/newview/lltoolbar.cpp +++ b/indra/newview/lltoolbar.cpp @@ -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)); } diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 7dc638f3a..6fc140e07 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -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 event, const LLSD& userdata) + { + show_web_floater(userdata.asStringRef()); + return true; + } +}; + class VisibleSecondLife : public view_listener_t { bool handleEvent(LLPointer 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()) { diff --git a/indra/newview/skins/default/textures/icn_toolbar_marketplace.tga b/indra/newview/skins/default/textures/icn_toolbar_marketplace.tga new file mode 100644 index 0000000000000000000000000000000000000000..49e5d11a21f391e18b563286837733b8990f34b7 GIT binary patch literal 49 rcmZQz;9`IQMg~R(1rCP)|Np~87(#+VUBf(sJ^lT3BiuZFT=f_Lkxd94 literal 0 HcmV?d00001 diff --git a/indra/newview/skins/default/xui/en-us/floater_toolbar_prefs.xml b/indra/newview/skins/default/xui/en-us/floater_toolbar_prefs.xml index 913368808..49e96df14 100644 --- a/indra/newview/skins/default/xui/en-us/floater_toolbar_prefs.xml +++ b/indra/newview/skins/default/xui/en-us/floater_toolbar_prefs.xml @@ -82,7 +82,8 @@ - + + diff --git a/indra/newview/skins/default/xui/en-us/menu_viewer.xml b/indra/newview/skins/default/xui/en-us/menu_viewer.xml index 64196b92d..d698e3d24 100644 --- a/indra/newview/skins/default/xui/en-us/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en-us/menu_viewer.xml @@ -605,6 +605,9 @@ + + + diff --git a/indra/newview/skins/default/xui/en-us/panel_toolbar.xml b/indra/newview/skins/default/xui/en-us/panel_toolbar.xml index d52d80a7b..069b308b2 100644 --- a/indra/newview/skins/default/xui/en-us/panel_toolbar.xml +++ b/indra/newview/skins/default/xui/en-us/panel_toolbar.xml @@ -152,7 +152,7 @@ @@ -417,6 +417,11 @@ + + +