Add Default Avatar Picker Floater (World->Default Avatars)
Default Avatars button option added to Toolbar prefs. Adds debug setting ToolbarVisibleAvatar Hooks into "avatar_picker_url" login response on opensim. Also includes hooking up of DestinationGuideShown to startup, which was left unstaged from the initial commit of the Destination Guide.
This commit is contained in:
@@ -183,6 +183,7 @@ set(viewer_SOURCE_FILES
|
||||
llfloateractivespeakers.cpp
|
||||
llfloaterauction.cpp
|
||||
llfloaterautoreplacesettings.cpp
|
||||
llfloateravatar.cpp
|
||||
llfloateravatarinfo.cpp
|
||||
llfloateravatarlist.cpp
|
||||
llfloateravatarpicker.cpp
|
||||
@@ -711,6 +712,7 @@ set(viewer_HEADER_FILES
|
||||
llfloateractivespeakers.h
|
||||
llfloaterauction.h
|
||||
llfloaterautoreplacesettings.h
|
||||
llfloateravatar.h
|
||||
llfloateravatarinfo.h
|
||||
llfloateravatarlist.h
|
||||
llfloateravatarpicker.h
|
||||
|
||||
@@ -243,6 +243,22 @@
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>FloaterAvatarRect</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Avatar picker floater position</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Rect</string>
|
||||
<key>Value</key>
|
||||
<array>
|
||||
<integer>0</integer>
|
||||
<integer>0</integer>
|
||||
<integer>0</integer>
|
||||
<integer>0</integer>
|
||||
</array>
|
||||
</map>
|
||||
<key>FloaterAvatarTextRect</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
@@ -3128,6 +3144,17 @@ This should be as low as possible, but too low may break functionality</string>
|
||||
<key>Value</key>
|
||||
<integer>2</integer>
|
||||
</map>
|
||||
<key>AvatarPickerURL</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Avatar picker contents</string>
|
||||
<key>Persist</key>
|
||||
<integer>0</integer>
|
||||
<key>Type</key>
|
||||
<string>String</string>
|
||||
<key>Value</key>
|
||||
<string>http://lecs-viewer-web-components.s3.amazonaws.com/v3.0/[GRID_LOWERCASE]/avatars.html</string>
|
||||
</map>
|
||||
<key>AvatarRotateThresholdSlow</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
@@ -14716,6 +14743,17 @@ This should be as low as possible, but too low may break functionality</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>ShowAvatarFloater</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Display avatar picker floater on login</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>ShowAxes</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
||||
@@ -1019,6 +1019,17 @@
|
||||
<key>Value</key>
|
||||
<boolean>0</boolean>
|
||||
</map>
|
||||
<key>ToolbarVisibleAvatar</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Whether or not the button for default avatars is on the toolbar</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<boolean>0</boolean>
|
||||
</map>
|
||||
<key>ToolbarVisibleBeacons</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
||||
65
indra/newview/llfloateravatar.cpp
Normal file
65
indra/newview/llfloateravatar.cpp
Normal file
@@ -0,0 +1,65 @@
|
||||
/**
|
||||
* @file llfloateravatar.h
|
||||
* @author Leyla Farazha
|
||||
* @brief floater for the avatar changer
|
||||
*
|
||||
* $LicenseInfo:firstyear=2011&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2011, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
/**
|
||||
* Floater that appears when buying an object, giving a preview
|
||||
* of its contents and their permissions.
|
||||
*/
|
||||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include "llfloateravatar.h"
|
||||
#include "llmediactrl.h"
|
||||
#include "lluictrlfactory.h"
|
||||
#include "llweb.h"
|
||||
|
||||
|
||||
LLFloaterAvatar::LLFloaterAvatar(const LLSD& key)
|
||||
: LLFloater(key)
|
||||
{
|
||||
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_avatar.xml", NULL, false);
|
||||
}
|
||||
|
||||
LLFloaterAvatar::~LLFloaterAvatar()
|
||||
{
|
||||
}
|
||||
|
||||
BOOL LLFloaterAvatar::postBuild()
|
||||
{
|
||||
enableResizeCtrls(true, true, false);
|
||||
LLMediaCtrl* avatar_picker = findChild<LLMediaCtrl>("avatar_picker_contents");
|
||||
if (avatar_picker)
|
||||
{
|
||||
avatar_picker->setErrorPageURL(gSavedSettings.getString("GenericErrorPageURL"));
|
||||
std::string url = gSavedSettings.getString("AvatarPickerURL");
|
||||
url = LLWeb::expandURLSubstitutions(url, LLSD());
|
||||
avatar_picker->navigateTo(url, "text/html");
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
44
indra/newview/llfloateravatar.h
Normal file
44
indra/newview/llfloateravatar.h
Normal file
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* @file llfloateravatar.h
|
||||
* @author Leyla Farazha
|
||||
* @brief floater for the avatar changer
|
||||
*
|
||||
* $LicenseInfo:firstyear=2011&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2011, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_FLOATER_AVATAR_H
|
||||
#define LL_FLOATER_AVATAR_H
|
||||
|
||||
#include "llfloater.h"
|
||||
|
||||
class LLFloaterAvatar:
|
||||
public LLFloater
|
||||
, public LLFloaterSingleton<LLFloaterAvatar>
|
||||
{
|
||||
friend class LLUISingleton<LLFloaterAvatar, VisibilityPolicy<LLFloater> >;
|
||||
private:
|
||||
LLFloaterAvatar(const LLSD& key);
|
||||
/*virtual*/ ~LLFloaterAvatar();
|
||||
/*virtual*/ BOOL postBuild();
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -41,7 +41,7 @@
|
||||
// Helpers
|
||||
//
|
||||
|
||||
static std::string getLoginUriDomain()
|
||||
std::string getLoginUriDomain()
|
||||
{
|
||||
LLURI uri(gHippoGridManager->getConnectedGrid()->getLoginUri());
|
||||
std::string hostname = uri.hostName(); // Ie, "login.<gridid>.lindenlab.com"
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
#include "llfloaterabout.h"
|
||||
#include "llfloateractivespeakers.h"
|
||||
#include "llfloaterautoreplacesettings.h"
|
||||
#include "llfloateravatar.h"
|
||||
#include "llfloateravatarlist.h"
|
||||
#include "llfloaterbeacons.h"
|
||||
#include "llfloaterblacklist.h"
|
||||
@@ -221,6 +222,7 @@ struct MenuFloaterDict : public LLSingleton<MenuFloaterDict>
|
||||
registerFloater<LLFloaterActiveSpeakers> ("active speakers");
|
||||
registerFloater<JCFloaterAreaSearch> ("areasearch");
|
||||
registerFloater<LLFloaterAutoReplaceSettings> ("autoreplace");
|
||||
registerFloater<LLFloaterAvatar> ("avatar");
|
||||
registerFloater<LLFloaterBeacons> ("beacons");
|
||||
registerFloater<LLFloaterCamera> ("camera controls");
|
||||
registerFloater<LLFloaterChat> ("chat history");
|
||||
|
||||
@@ -116,9 +116,11 @@
|
||||
#include "llfeaturemanager.h"
|
||||
#include "llfirstuse.h"
|
||||
#include "llfloateractivespeakers.h"
|
||||
#include "llfloateravatar.h"
|
||||
#include "llfloaterbeacons.h"
|
||||
#include "llfloatercamera.h"
|
||||
#include "llfloaterchat.h"
|
||||
#include "llfloaterdestinations.h"
|
||||
#include "llfloatergesture.h"
|
||||
#include "llfloaterhud.h"
|
||||
#include "llfloaterinventory.h"
|
||||
@@ -1265,6 +1267,7 @@ bool idle_startup()
|
||||
requested_options.push_back("login-flags");
|
||||
requested_options.push_back("global-textures");
|
||||
// <singu> Opensim requested options
|
||||
requested_options.push_back("avatar_picker_url");
|
||||
requested_options.push_back("destination_guide_url");
|
||||
// </singu>
|
||||
if(gSavedSettings.getBOOL("ConnectAsGod"))
|
||||
@@ -2439,6 +2442,14 @@ bool idle_startup()
|
||||
{
|
||||
LLFloaterBeacons::showInstance();
|
||||
}
|
||||
if (gSavedSettings.getBOOL("ShowAvatarFloater"))
|
||||
{
|
||||
LLFloaterAvatar::showInstance();
|
||||
}
|
||||
if (gSavedSettings.getBOOL("DestinationGuideShown"))
|
||||
{
|
||||
LLFloaterDestinations::showInstance();
|
||||
}
|
||||
|
||||
LLMessageSystem* msg = gMessageSystem;
|
||||
msg->setHandlerFuncFast(_PREHASH_SoundTrigger, hooked_process_sound_trigger);
|
||||
@@ -4199,6 +4210,9 @@ bool process_login_success_response(std::string& password, U32& first_sim_size_x
|
||||
if (opensim)
|
||||
{
|
||||
gSavedSettings.setString("SearchURL", tmp); // Singu Note: For web search purposes, always set this setting
|
||||
tmp = response["avatar_picker_url"].asString();
|
||||
gSavedSettings.setString("AvatarPickerURL", tmp);
|
||||
gMenuBarView->getChildView("Avatar Picker")->setVisible(!tmp.empty());
|
||||
gSavedSettings.setString("DestinationGuideURL", response["destination_guide_url"].asString());
|
||||
}
|
||||
tmp = response["currency"].asString();
|
||||
|
||||
@@ -41,23 +41,23 @@
|
||||
#include "llagent.h"
|
||||
#include "llappviewer.h"
|
||||
#include "llfloaterwebcontent.h"
|
||||
#include "hippogridmanager.h"
|
||||
#include "llparcel.h"
|
||||
#include "llsd.h"
|
||||
#include "llalertdialog.h"
|
||||
#include "llui.h"
|
||||
#include "lluri.h"
|
||||
#include "sgversion.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llviewermedia.h"
|
||||
#include "llviewernetwork.h"
|
||||
#include "llviewerparcelmgr.h"
|
||||
#include "llviewerregion.h"
|
||||
#include "llviewerwindow.h"
|
||||
#include "llnotificationsutil.h"
|
||||
#include "llalertdialog.h"
|
||||
|
||||
#include "sgversion.h"
|
||||
|
||||
bool on_load_url_external_response(const LLSD& notification, const LLSD& response, bool async );
|
||||
|
||||
|
||||
class URLLoader : public LLAlertDialog::URLLoader
|
||||
{
|
||||
virtual void load(const std::string& url , bool force_open_externally)
|
||||
@@ -208,17 +208,11 @@ std::string LLWeb::escapeURL(const std::string& url)
|
||||
return escaped_url;
|
||||
}
|
||||
|
||||
std::string getLoginUriDomain();
|
||||
//static
|
||||
std::string LLWeb::expandURLSubstitutions(const std::string &url,
|
||||
const LLSD &default_subs)
|
||||
{
|
||||
gCurrentVersion = llformat("%s %d.%d.%d.%d",
|
||||
gVersionChannel,
|
||||
gVersionMajor,
|
||||
gVersionMinor,
|
||||
gVersionPatch,
|
||||
gVersionBuild );
|
||||
|
||||
LLSD substitution = default_subs;
|
||||
substitution["VERSION"] = gCurrentVersion;
|
||||
substitution["VERSION_MAJOR"] = gVersionMajor;
|
||||
@@ -226,8 +220,15 @@ std::string LLWeb::expandURLSubstitutions(const std::string &url,
|
||||
substitution["VERSION_PATCH"] = gVersionPatch;
|
||||
substitution["VERSION_BUILD"] = gVersionBuild;
|
||||
substitution["CHANNEL"] = gVersionChannel;
|
||||
substitution["GRID"] = LLViewerLogin::getInstance()->getGridLabel();
|
||||
substitution["GRID_LOWERCASE"] = utf8str_tolower(LLViewerLogin::getInstance()->getGridLabel());
|
||||
const HippoGridInfo* grid(gHippoGridManager->getCurrentGrid());
|
||||
std::string gridId(grid->isSecondLife() ? getLoginUriDomain() : grid->getGridName());
|
||||
if (grid->isSecondLife())
|
||||
{
|
||||
gridId = gridId.substr(0, gridId.find('.'));
|
||||
}
|
||||
|
||||
substitution["GRID"] = gridId;
|
||||
substitution["GRID_LOWERCASE"] = utf8str_tolower(gridId);
|
||||
substitution["OS"] = LLAppViewer::instance()->getOSInfo().getOSStringSimple();
|
||||
substitution["SESSION_ID"] = gAgent.getSessionID();
|
||||
substitution["FIRST_LOGIN"] = gAgent.isFirstLogin();
|
||||
|
||||
BIN
indra/newview/skins/default/textures/icn_toolbar_avatar.tga
Normal file
BIN
indra/newview/skins/default/textures/icn_toolbar_avatar.tga
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 22 B |
26
indra/newview/skins/default/xui/en-us/floater_avatar.xml
Normal file
26
indra/newview/skins/default/xui/en-us/floater_avatar.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<floater
|
||||
positioning="cascading"
|
||||
legacy_header_height="225"
|
||||
can_minimize="true"
|
||||
can_close="true"
|
||||
can_resize="true"
|
||||
min_height="230"
|
||||
min_width="515"
|
||||
height="220"
|
||||
layout="topleft"
|
||||
name="Avatar"
|
||||
single_instance="true"
|
||||
help_topic="avatar"
|
||||
rect_control="FloaterAvatarRect"
|
||||
control_name="ShowAvatarFloater"
|
||||
title="Choose An Avatar"
|
||||
width="700">
|
||||
<web_browser
|
||||
bottom="-220"
|
||||
height="200"
|
||||
width="700"
|
||||
follows="all"
|
||||
name="avatar_picker_contents"
|
||||
trusted_content="true"/>
|
||||
</floater>
|
||||
@@ -75,9 +75,10 @@
|
||||
<check_box bottom_delta="-20" label="Texture Category Console" name="texture_category_console_btn" follows="left|right" control_name="ToolbarVisibleTextureCategoryConsole" visibility_control="AuditTexture"/>
|
||||
<check_box bottom_delta="-20" label="Texture Size Console" name="texture_size_console_btn" follows="left|right" control_name="ToolbarVisibleTextureSizeConsole" visibility_control="AuditTexture"/>
|
||||
<check_box bottom_delta="-20" label="Inventory" name="directory_btn" follows="left|right" control_name="ToolbarVisibleInventory"/>
|
||||
<check_box bottom_delta="-20" label="Default Avatars" name="default_avatars_btn" follows="left|right" control_name="ToolbarVisibleAvatar"/>
|
||||
<check_box bottom_delta="-20" label="Make Outfit" name="make_outfit_btn" follows="left|right" control_name="ToolbarVisibleOutfit"/>
|
||||
<check_box bottom_delta="-20" label="Outfits" name="outfits_btn" follows="left|right" control_name="ToolbarVisibleInventoryOutfits"/>
|
||||
<check_box bottom="-38" label="Favorites" name="favs_btn" follows="left|right" control_name="ToolbarVisibleInventoryFavs" left_delta="160"/>
|
||||
<check_box bottom="-38" label="Outfits" name="outfits_btn" follows="left|right" control_name="ToolbarVisibleInventoryOutfits" left_delta="160"/>
|
||||
<check_box bottom_delta="-20" label="Favorites" name="favs_btn" follows="left|right" control_name="ToolbarVisibleInventoryFavs"/>
|
||||
<check_box bottom_delta="-20" label="Outbox" name="outbox_btn" follows="left|right" control_name="ToolbarVisibleOutbox"/>
|
||||
<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"/>
|
||||
|
||||
@@ -590,6 +590,11 @@
|
||||
<menu_item_call bottom="-29" height="19" label="Favorites" left="0" name="Favorites" width="166">
|
||||
<on_click function="ShowFloater" userdata="floater_inventory_favs.xml" />
|
||||
</menu_item_call>
|
||||
<menu_item_check label="Default Avatars" name="Avatar Picker">
|
||||
<on_click function="ShowFloater" userdata="avatar"/>
|
||||
<on_check function="FloaterVisible" userdata="avatar"/>
|
||||
<!--on_visible /-->
|
||||
</menu_item_check>
|
||||
<menu_item_check label="Destinations" name="Destinations">
|
||||
<on_click function="ShowFloater" userdata="destinations"/>
|
||||
<on_check function="FloaterVisible" userdata="destinations"/>
|
||||
|
||||
@@ -384,6 +384,11 @@
|
||||
<button.commit_callback function="ShowFloater" parameter="inventory"/>
|
||||
</button>
|
||||
</layout_panel>
|
||||
<layout_panel name="panelavatar" height="24" width="50" user_resize="false" visibility_control="ToolbarVisibleAvatar">
|
||||
<button bottom="0" height="24" label="Default Avatars" image_overlay="icn_toolbar_avatar.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" name="avatar_btn" width="50" follows="left|right">
|
||||
<button.commit_callback function="ShowFloater" parameter="avatar"/>
|
||||
</button>
|
||||
</layout_panel>
|
||||
<layout_panel name="paneloutfit" height="24" width="50" user_resize="false" visibility_control="ToolbarVisibleOutfit">
|
||||
<button bottom="0" height="24" label="Make Outfit" name="make_outfit_btn" image_overlay="icn_toolbar_make_outfit.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="outfit"/>
|
||||
|
||||
Reference in New Issue
Block a user