merge with tip

meow-7.2.2
Arrehn 2011-01-09 20:35:46 -05:00
commit 7d019ff9e2
15 changed files with 2278 additions and 33 deletions

View File

@ -1722,9 +1722,9 @@ void LLFloater::draw()
{
static LLUIColor titlebar_focus_color = LLUIColorTable::instance().getColor("TitleBarFocusColor");
const LLFontGL* font = LLFontGL::getFontSansSerif();
//const LLFontGL* font = LLFontGL::getFontSansSerif();
LLRect r = getRect();
gl_rect_2d_offset_local(0, r.getHeight(), r.getWidth(), r.getHeight() - (S32)font->getLineHeight() - 1,
gl_rect_2d_offset_local(0, r.getHeight(), r.getWidth(), r.getHeight() - mHeaderHeight,
titlebar_focus_color % mCurrentTransparency, 0, TRUE);
}
}

View File

@ -66,6 +66,7 @@ include_directories(
)
set(viewer_SOURCE_FILES
chatbar_as_cmdline.cpp
kcwlinterface.cpp
llagent.cpp
llagentaccess.cpp
@ -605,6 +606,7 @@ endif (LINUX)
set(viewer_HEADER_FILES
CMakeLists.txt
ViewerInstall.cmake
chatbar_as_cmdline.h
kcwlinterface.h
llagent.h
llagentaccess.h

View File

@ -10597,7 +10597,7 @@
<key>Type</key>
<string>S32</string>
<key>Value</key>
<real>7</real>
<real>4</real>
</map>
<key>UIImgDefaultEyesUUID</key>
<map>
@ -12567,6 +12567,226 @@
<key>Value</key>
<real>300.0</real>
</map>
<key>PhoenixCmdLine</key>
<map>
<key>Comment</key>
<string>Enable usage of chat bar as a command line</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>PhoenixCmdLineMapToKeepPos</key>
<map>
<key>Comment</key>
<string>Whether to use current local pos on tp to the new sim</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>PhoenixCmdLineAO</key>
<map>
<key>Comment</key>
<string>Turn AO on/off</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string>cao</string>
</map>
<key>PhoenixCmdLineAutocorrect</key>
<map>
<key>Comment</key>
<string>Command for adding new entries to autocorrect</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string>/addac</string>
</map>
<key>PhoenixCmdLineMedia</key>
<map>
<key>Comment</key>
<string>Chat command for setting a media url</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string>/media</string>
</map>
<key>PhoenixCmdLineMusic</key>
<map>
<key>Comment</key>
<string>Chat command for setting a music url</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string>/music</string>
</map>
<key>PhoenixCmdLineClearChat</key>
<map>
<key>Comment</key>
<string>Clear chat hsitory to stop lag from chat spam</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string>clrchat</string>
</map>
<key>PhoenixCmdLineHeight</key>
<map>
<key>Comment</key>
<string>Teleport to height function command</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string>gth</string>
</map>
<key>PhoenixCmdLinePos</key>
<map>
<key>Comment</key>
<string>Teleport to position function command</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string>gtp</string>
</map>
<key>PhoenixCmdLineGround</key>
<map>
<key>Comment</key>
<string>Teleport to ground function command</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string>flr</string>
</map>
<key>PhoenixCmdLineTeleportHome</key>
<map>
<key>Comment</key>
<string>Teleport to home function command</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string>tph</string>
</map>
<key>PhoenixCmdLineRezPlatform</key>
<map>
<key>Comment</key>
<string>Rez a platform underneath you</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string>rezplat</string>
</map>
<key>PhoenixCmdLinePlatformSize</key>
<map>
<key>Comment</key>
<string>How wide the rezzed platform will appear to be.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>F32</string>
<key>Value</key>
<real>30</real>
</map>
<key>PhoenixCmdLineMapTo</key>
<map>
<key>Comment</key>
<string>Teleport to a region by name rapidly</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string>mapto</string>
</map>
<key>PhoenixCmdLineDrawDistance</key>
<map>
<key>Comment</key>
<string>Change draw distance quickly</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string>dd</string>
</map>
<key>PhoenixCmdTeleportToCam</key>
<map>
<key>Comment</key>
<string>Teleport to your camera</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string>tp2cam</string>
</map>
<key>PhoenixCmdLineKeyToName</key>
<map>
<key>Comment</key>
<string>Use a fast key to name query</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string>key2name</string>
</map>
<key>PhoenixCmdLineOfferTp</key>
<map>
<key>Comment</key>
<string>Offer a teleport to target avatar</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string>offertp</string>
</map>
<key>PhoenixCmdLineCalc</key>
<map>
<key>Comment</key>
<string>Calculates an expression</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string>calc</string>
</map>
<key>PhoenixCmdLineTP2</key>
<map>
<key>Comment</key>
<string>Teleport to a person by name, partials work.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string>tp2</string>
</map>
<key>PhoenixWLParcelEnabled</key>
<map>
<key>Comment</key>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,36 @@
/* Copyright (c) 2010
*
* Modular Systems All rights reserved.
*
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
* conditions are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* 3. Neither the name Modular Systems nor the names of its contributors
* may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY MODULAR SYSTEMS AND CONTRIBUTORS “AS IS”
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MODULAR SYSTEMS OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "llviewerprecompiledheaders.h"
#include "llchatbar.h"
bool cmd_line_chat(std::string revised_text, EChatType type, bool from_gesture = false);

View File

@ -380,6 +380,28 @@ const LLUUID LLInventoryModel::findCategoryUUIDForType(LLFolderType::EType prefe
return rv;
}
LLUUID LLInventoryModel::findCategoryByName(std::string name)
{
LLUUID root_id = gInventory.getRootFolderID();
if(root_id.notNull())
{
cat_array_t* cats = NULL;
cats = get_ptr_in_map(mParentChildCategoryTree, root_id);
if(cats)
{
S32 count = cats->count();
for(S32 i = 0; i < count; ++i)
{
if(cats->get(i)->getName() == name)
{
return cats->get(i)->getUUID();
}
}
}
}
return LLUUID::null;
}
// Convenience function to create a new category. You could call
// updateCategory() with a newly generated UUID category, but this
// version will take care of details like what the name should be

View File

@ -351,6 +351,7 @@ public:
// Creation
//--------------------------------------------------------------------
public:
LLUUID findCategoryByName(std::string name);
// Returns the UUID of the new category. If you want to use the default
// name based on type, pass in a NULL to the 'name' parameter.
LLUUID createNewCategory(const LLUUID& parent_id,

View File

@ -64,6 +64,8 @@
#include "llfavoritesbar.h"
#include "llagentui.h"
#include "llstatusbar.h"
#include <boost/regex.hpp>
//-- LLTeleportHistoryMenuItem -----------------------------------------------
@ -710,6 +712,7 @@ void LLNavigationBar::handleLoginComplete()
{
LLTeleportHistory::getInstance()->handleLoginComplete();
LLPanelTopInfoBar::instance().handleLoginComplete();
gStatusBar->handleLoginComplete();
mCmbLocation->handleLoginComplete();
}

View File

@ -50,6 +50,7 @@
// [RLVa:KB] - Checked: 2010-02-27 (RLVa-1.2.0b)
#include "rlvhandler.h"
// [/RLVa:KB]
#include "chatbar_as_cmdline.h"
S32 LLNearbyChatBar::sLastSpecialChatChannel = 0;
@ -639,7 +640,7 @@ void LLNearbyChatBar::sendChat( EChatType type )
type = processChatTypeTriggers(type, utf8_revised_text);
if (!utf8_revised_text.empty())
if (!utf8_revised_text.empty() && cmd_line_chat(utf8_revised_text, type))
{
// Chat with animation
sendChatFromViewer(utf8_revised_text, type, TRUE);

View File

@ -67,6 +67,15 @@
#include "llviewerthrottle.h"
#include "lluictrlfactory.h"
#include "llagentui.h"
#include "llclipboard.h"
#include "lllandmarkactions.h"
#include "lllocationinputctrl.h"
#include "llparcel.h"
#include "llsidetray.h"
#include "llslurl.h"
#include "llviewerinventory.h"
#include "lltoolmgr.h"
#include "llfocusmgr.h"
#include "llappviewer.h"
@ -108,6 +117,23 @@ const S32 TEXT_HEIGHT = 18;
static void onClickVolume(void*);
class LLStatusBar::LLParcelChangeObserver : public LLParcelObserver
{
public:
LLParcelChangeObserver(LLStatusBar* topInfoBar) : mTopInfoBar(topInfoBar) {}
private:
/*virtual*/ void changed()
{
if (mTopInfoBar)
{
mTopInfoBar->updateParcelIcons();
}
}
LLStatusBar* mTopInfoBar;
};
LLStatusBar::LLStatusBar(const LLRect& rect)
: LLPanel(),
mTextTime(NULL),
@ -126,6 +152,9 @@ LLStatusBar::LLStatusBar(const LLRect& rect)
mBalanceTimer = new LLFrameTimer();
mHealthTimer = new LLFrameTimer();
LLUICtrl::CommitCallbackRegistry::currentRegistrar()
.add("TopInfoBar.Action", boost::bind(&LLStatusBar::onContextMenuItemClicked, this, _2));
buildFromFile("panel_status_bar.xml");
}
@ -137,6 +166,27 @@ LLStatusBar::~LLStatusBar()
delete mHealthTimer;
mHealthTimer = NULL;
if (mParcelChangedObserver)
{
LLViewerParcelMgr::getInstance()->removeObserver(mParcelChangedObserver);
delete mParcelChangedObserver;
}
if (mParcelPropsCtrlConnection.connected())
{
mParcelPropsCtrlConnection.disconnect();
}
if (mParcelMgrConnection.connected())
{
mParcelMgrConnection.disconnect();
}
if (mShowCoordsCtrlConnection.connected())
{
mShowCoordsCtrlConnection.disconnect();
}
// LLView destructor cleans up children
}
@ -149,6 +199,8 @@ LLStatusBar::~LLStatusBar()
void LLStatusBar::draw()
{
refresh();
updateParcelInfoText();
updateHealth();
LLPanel::draw();
}
@ -227,6 +279,34 @@ BOOL LLStatusBar::postBuild()
mPanelNearByMedia->setVisible(FALSE);
mScriptOut = getChildView("scriptout");
mInfoBtn = getChild<LLButton>("place_info_btn");
mInfoBtn->setClickedCallback(boost::bind(&LLStatusBar::onInfoButtonClicked, this));
mParcelInfoText = getChild<LLTextBox>("parcel_info_text");
mDamageText = getChild<LLTextBox>("damage_text");
initParcelIcons();
mParcelChangedObserver = new LLParcelChangeObserver(this);
LLViewerParcelMgr::getInstance()->addObserver(mParcelChangedObserver);
// Connecting signal for updating parcel icons on "Show Parcel Properties" setting change.
LLControlVariable* ctrl = gSavedSettings.getControl("NavBarShowParcelProperties").get();
if (ctrl)
{
mParcelPropsCtrlConnection = ctrl->getSignal()->connect(boost::bind(&LLStatusBar::updateParcelIcons, this));
}
// Connecting signal for updating parcel text on "Show Coordinates" setting change.
ctrl = gSavedSettings.getControl("NavBarShowCoordinates").get();
if (ctrl)
{
mShowCoordsCtrlConnection = ctrl->getSignal()->connect(boost::bind(&LLStatusBar::onNavBarShowParcelPropertiesCtrlChanged, this));
}
mParcelMgrConnection = LLViewerParcelMgr::getInstance()->addAgentParcelChangedCallback(
boost::bind(&LLStatusBar::onAgentParcelChange, this));
return TRUE;
}
@ -543,3 +623,279 @@ public:
};
// register with command dispatch system
LLBalanceHandler gBalanceHandler;
void LLStatusBar::initParcelIcons()
{
mParcelIcon[VOICE_ICON] = getChild<LLIconCtrl>("voice_icon");
mParcelIcon[FLY_ICON] = getChild<LLIconCtrl>("fly_icon");
mParcelIcon[PUSH_ICON] = getChild<LLIconCtrl>("push_icon");
mParcelIcon[BUILD_ICON] = getChild<LLIconCtrl>("build_icon");
mParcelIcon[SCRIPTS_ICON] = getChild<LLIconCtrl>("scripts_icon");
mParcelIcon[DAMAGE_ICON] = getChild<LLIconCtrl>("damage_icon");
mParcelIcon[VOICE_ICON]->setMouseDownCallback(boost::bind(&LLStatusBar::onParcelIconClick, this, VOICE_ICON));
mParcelIcon[FLY_ICON]->setMouseDownCallback(boost::bind(&LLStatusBar::onParcelIconClick, this, FLY_ICON));
mParcelIcon[PUSH_ICON]->setMouseDownCallback(boost::bind(&LLStatusBar::onParcelIconClick, this, PUSH_ICON));
mParcelIcon[BUILD_ICON]->setMouseDownCallback(boost::bind(&LLStatusBar::onParcelIconClick, this, BUILD_ICON));
mParcelIcon[SCRIPTS_ICON]->setMouseDownCallback(boost::bind(&LLStatusBar::onParcelIconClick, this, SCRIPTS_ICON));
mParcelIcon[DAMAGE_ICON]->setMouseDownCallback(boost::bind(&LLStatusBar::onParcelIconClick, this, DAMAGE_ICON));
mDamageText->setText(LLStringExplicit("100%"));
}
void LLStatusBar::handleLoginComplete()
{
// An agent parcel update hasn't occurred yet, so
// we have to manually set location and the icons.
update();
}
void LLStatusBar::onNavBarShowParcelPropertiesCtrlChanged()
{
std::string new_text;
// don't need to have separate show_coords variable; if user requested the coords to be shown
// they will be added during the next call to the draw() method.
buildLocationString(new_text, false);
setParcelInfoText(new_text);
}
void LLStatusBar::buildLocationString(std::string& loc_str, bool show_coords)
{
LLAgentUI::ELocationFormat format =
(show_coords ? LLAgentUI::LOCATION_FORMAT_FULL : LLAgentUI::LOCATION_FORMAT_NO_COORDS);
if (!LLAgentUI::buildLocationString(loc_str, format))
{
loc_str = "???";
}
}
void LLStatusBar::setParcelInfoText(const std::string& new_text)
{
const LLFontGL* font = mParcelInfoText->getDefaultFont();
S32 new_text_width = font->getWidth(new_text);
mParcelInfoText->setText(new_text);
LLRect rect = mParcelInfoText->getRect();
rect.setOriginAndSize(rect.mLeft, rect.mBottom, new_text_width, rect.getHeight());
mParcelInfoText->reshape(rect.getWidth(), rect.getHeight(), TRUE);
mParcelInfoText->setRect(rect);
layoutParcelIcons();
}
void LLStatusBar::update()
{
std::string new_text;
// don't need to have separate show_coords variable; if user requested the coords to be shown
// they will be added during the next call to the draw() method.
buildLocationString(new_text, false);
setParcelInfoText(new_text);
updateParcelIcons();
}
void LLStatusBar::updateParcelInfoText()
{
static LLUICachedControl<bool> show_coords("NavBarShowCoordinates", false);
if (show_coords)
{
std::string new_text;
buildLocationString(new_text, show_coords);
setParcelInfoText(new_text);
}
}
void LLStatusBar::updateParcelIcons()
{
LLViewerParcelMgr* vpm = LLViewerParcelMgr::getInstance();
LLViewerRegion* agent_region = gAgent.getRegion();
LLParcel* agent_parcel = vpm->getAgentParcel();
if (!agent_region || !agent_parcel)
return;
if (gSavedSettings.getBOOL("NavBarShowParcelProperties"))
{
LLParcel* current_parcel;
LLViewerRegion* selection_region = vpm->getSelectionRegion();
LLParcel* selected_parcel = vpm->getParcelSelection()->getParcel();
// If agent is in selected parcel we use its properties because
// they are updated more often by LLViewerParcelMgr than agent parcel properties.
// See LLViewerParcelMgr::processParcelProperties().
// This is needed to reflect parcel restrictions changes without having to leave
// the parcel and then enter it again. See EXT-2987
if (selected_parcel && selected_parcel->getLocalID() == agent_parcel->getLocalID()
&& selection_region == agent_region)
{
current_parcel = selected_parcel;
}
else
{
current_parcel = agent_parcel;
}
bool allow_voice = vpm->allowAgentVoice(agent_region, current_parcel);
bool allow_fly = vpm->allowAgentFly(agent_region, current_parcel);
bool allow_push = vpm->allowAgentPush(agent_region, current_parcel);
bool allow_build = vpm->allowAgentBuild(current_parcel); // true when anyone is allowed to build. See EXT-4610.
bool allow_scripts = vpm->allowAgentScripts(agent_region, current_parcel);
bool allow_damage = vpm->allowAgentDamage(agent_region, current_parcel);
// Most icons are "block this ability"
mParcelIcon[VOICE_ICON]->setVisible( !allow_voice );
mParcelIcon[FLY_ICON]->setVisible( !allow_fly );
mParcelIcon[PUSH_ICON]->setVisible( !allow_push );
mParcelIcon[BUILD_ICON]->setVisible( !allow_build );
mParcelIcon[SCRIPTS_ICON]->setVisible( !allow_scripts );
mParcelIcon[DAMAGE_ICON]->setVisible( allow_damage );
mDamageText->setVisible(allow_damage);
layoutParcelIcons();
}
else
{
for (S32 i = 0; i < ICON_COUNT; ++i)
{
mParcelIcon[i]->setVisible(false);
}
mDamageText->setVisible(false);
}
}
void LLStatusBar::updateHealth()
{
static LLUICachedControl<bool> show_icons("NavBarShowParcelProperties", false);
// *FIXME: Status bar owns health information, should be in agent
if (show_icons && gStatusBar)
{
static S32 last_health = -1;
S32 health = gStatusBar->getHealth();
if (health != last_health)
{
std::string text = llformat("%d%%", health);
mDamageText->setText(text);
last_health = health;
}
}
}
void LLStatusBar::layoutParcelIcons()
{
// TODO: remove hard-coded values and read them as xml parameters
static const int FIRST_ICON_HPAD = 16;
static const int LAST_ICON_HPAD = 11;
S32 left = mParcelInfoText->getRect().mRight + FIRST_ICON_HPAD;
left = layoutWidget(mDamageText, left);
for (int i = ICON_COUNT - 1; i >= 0; --i)
{
left = layoutWidget(mParcelIcon[i], left);
}
}
S32 LLStatusBar::layoutWidget(LLUICtrl* ctrl, S32 left)
{
// TODO: remove hard-coded values and read them as xml parameters
static const int ICON_HPAD = 2;
if (ctrl->getVisible())
{
LLRect rect = ctrl->getRect();
rect.mRight = left + rect.getWidth();
rect.mLeft = left;
ctrl->setRect(rect);
left += rect.getWidth() + ICON_HPAD;
}
return left;
}
void LLStatusBar::onParcelIconClick(EParcelIcon icon)
{
switch (icon)
{
case VOICE_ICON:
LLNotificationsUtil::add("NoVoice");
break;
case FLY_ICON:
LLNotificationsUtil::add("NoFly");
break;
case PUSH_ICON:
LLNotificationsUtil::add("PushRestricted");
break;
case BUILD_ICON:
LLNotificationsUtil::add("NoBuild");
break;
case SCRIPTS_ICON:
{
LLViewerRegion* region = gAgent.getRegion();
if(region && region->getRegionFlags() & REGION_FLAGS_ESTATE_SKIP_SCRIPTS)
{
LLNotificationsUtil::add("ScriptsStopped");
}
else if(region && region->getRegionFlags() & REGION_FLAGS_SKIP_SCRIPTS)
{
LLNotificationsUtil::add("ScriptsNotRunning");
}
else
{
LLNotificationsUtil::add("NoOutsideScripts");
}
break;
}
case DAMAGE_ICON:
LLNotificationsUtil::add("NotSafe");
break;
case ICON_COUNT:
break;
// no default to get compiler warning when a new icon gets added
}
}
void LLStatusBar::onAgentParcelChange()
{
update();
}
void LLStatusBar::onContextMenuItemClicked(const LLSD::String& item)
{
if (item == "landmark")
{
LLViewerInventoryItem* landmark = LLLandmarkActions::findLandmarkForAgentPos();
if(landmark == NULL)
{
LLSideTray::getInstance()->showPanel("panel_places", LLSD().with("type", "create_landmark"));
}
else
{
LLSideTray::getInstance()->showPanel("panel_places",
LLSD().with("type", "landmark").with("id",landmark->getUUID()));
}
}
else if (item == "copy")
{
LLSLURL slurl;
LLAgentUI::buildSLURL(slurl, false);
LLUIString location_str(slurl.getSLURLString());
gClipboard.copyFromString(location_str);
}
}
void LLStatusBar::onInfoButtonClicked()
{
LLSideTray::getInstance()->showPanel("panel_places", LLSD().with("type", "agent"));
}

View File

@ -43,6 +43,42 @@ class LLFrameTimer;
class LLStatGraph;
class LLPanelVolumePulldown;
class LLPanelNearByMedia;
class LLIconCtrl;
class LLParcelChangeObserver;
class LLRegionDetails
{
public:
LLRegionDetails() :
mRegionName("Unknown"),
mParcelName("Unknown"),
mAccessString("Unknown"),
mX(0),
mY(0),
mZ(0),
mArea (0),
mForSale(FALSE),
mOwner("Unknown"),
mTraffic(0),
mBalance(0),
mPing(0)
{
}
std::string mRegionName;
std::string mParcelName;
std::string mAccessString;
S32 mX;
S32 mY;
S32 mZ;
S32 mArea;
BOOL mForSale;
std::string mOwner;
F32 mTraffic;
S32 mBalance;
std::string mTime;
U32 mPing;
};
class LLStatusBar
: public LLPanel
@ -73,6 +109,11 @@ public:
void setVisibleForMouselook(bool visible);
// some elements should hide in mouselook
/**
* Updates location and parcel icons on login complete
*/
void handleLoginComplete();
// ACCESSORS
S32 getBalance() const;
S32 getHealth() const;
@ -81,6 +122,7 @@ public:
S32 getSquareMetersCredit() const;
S32 getSquareMetersCommitted() const;
S32 getSquareMetersLeft() const;
LLRegionDetails mRegionDetails;
LLPanelNearByMedia* getNearbyMediaPanel() { return mPanelNearByMedia; }
@ -94,10 +136,100 @@ private:
void onClickScreen(S32 x, S32 y);
static void onClickMediaToggle(void* data);
class LLParcelChangeObserver;
friend class LLParcelChangeObserver;
enum EParcelIcon
{
VOICE_ICON = 0,
FLY_ICON,
PUSH_ICON,
BUILD_ICON,
SCRIPTS_ICON,
DAMAGE_ICON,
ICON_COUNT
};
/**
* Initializes parcel icons controls. Called from the constructor.
*/
void initParcelIcons();
/**
* Handles clicks on the parcel icons.
*/
void onParcelIconClick(EParcelIcon icon);
/**
* Handles clicks on the info buttons.
*/
void onInfoButtonClicked();
/**
* Called when agent changes the parcel.
*/
void onAgentParcelChange();
/**
* Called when context menu item is clicked.
*/
void onContextMenuItemClicked(const LLSD::String& userdata);
/**
* Called when user checks/unchecks Show Coordinates menu item.
*/
void onNavBarShowParcelPropertiesCtrlChanged();
/**
* Shorthand to call updateParcelInfoText() and updateParcelIcons().
*/
void update();
/**
* Updates parcel info text (mParcelInfoText).
*/
void updateParcelInfoText();
/**
* Updates parcel icons (mParcelIcon[]).
*/
void updateParcelIcons();
/**
* Updates health information (mDamageText).
*/
void updateHealth();
/**
* Lays out all parcel icons starting from right edge of the mParcelInfoText + 11px
* (see screenshots in EXT-5808 for details).
*/
void layoutParcelIcons();
/**
* Lays out a widget. Widget's rect mLeft becomes equal to the 'left' argument.
*/
S32 layoutWidget(LLUICtrl* ctrl, S32 left);
/**
* Generates location string and returns it in the loc_str parameter.
*/
void buildLocationString(std::string& loc_str, bool show_coords);
/**
* Sets new value to the mParcelInfoText and updates the size of the top bar.
*/
void setParcelInfoText(const std::string& new_text);
private:
LLTextBox *mTextBalance;
LLTextBox *mTextHealth;
LLTextBox *mTextTime;
LLTextBox* mTextParcelName;
LLStatGraph *mSGBandwidth;
LLStatGraph *mSGPacketLoss;
@ -114,6 +246,16 @@ private:
LLFrameTimer* mHealthTimer;
LLPanelVolumePulldown* mPanelVolumePulldown;
LLPanelNearByMedia* mPanelNearByMedia;
LLButton* mInfoBtn;
LLTextBox* mParcelInfoText;
LLTextBox* mDamageText;
LLIconCtrl* mParcelIcon[ICON_COUNT];
LLParcelChangeObserver* mParcelChangedObserver;
boost::signals2::connection mParcelPropsCtrlConnection;
boost::signals2::connection mShowCoordsCtrlConnection;
boost::signals2::connection mParcelMgrConnection;
};
// *HACK: Status bar owns your cached money balance. JC

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -21,6 +21,97 @@
image_name="menu_bar.tga"
left="0"
width="1000" / -->
<button
follows="left|top"
height="16"
hover_glow_amount="0.15"
image_disabled="Info_Off"
image_disabled_selected="Info_Off"
image_selected="Info_Off"
image_unselected="Info_Off"
left="500"
name="place_info_btn"
top="2"
width="16"/>
<text
follows="left|top|right"
font="DejaVu"
height="16"
layout="topleft"
left_pad="11"
length="1"
name="parcel_info_text"
top="3"
type="string"
width="1"/>
<icon
enabled="true"
follows="right|top"
height="18"
image_name="Parcel_VoiceNo_Dark"
name="voice_icon"
top="1"
visible="false"
width="22"
/>
<icon
follows="right|top"
height="18"
image_name="Parcel_FlyNo_Dark"
name="fly_icon"
top="1"
visible="false"
width="22"
/>
<icon
follows="right|top"
height="18"
image_name="Parcel_PushNo_Dark"
name="push_icon"
top="1"
visible="false"
width="22"
/>
<icon
follows="right|top"
height="18"
image_name="Parcel_BuildNo_Dark"
name="build_icon"
top="1"
visible="false"
width="22"
/>
<icon
follows="right|top"
height="18"
image_name="Parcel_ScriptsNo_Dark"
name="scripts_icon"
top="1"
visible="false"
width="22"
/>
<icon
follows="right|top"
height="13"
image_name="Parcel_Health_Dark"
left="2"
name="damage_icon"
top="3"
visible="false"
width="14"
/>
<text
follows="right|top"
font="SansSerifSmall"
halign="right"
height="18"
name="damage_text"
top="5"
visible="false"
width="35"
/>
<panel.string
name="packet_loss_tooltip">
Packet Loss
@ -43,7 +134,7 @@
</panel.string>
<panel
height="18"
left="-315"
left="-225"
width="95"
top="1"
follows="right|top"
@ -97,29 +188,9 @@
left_pad="0"
name="TimeText"
tool_tip="Current time (Pacific)"
width="145">
width="80">
24:00 AM PST
</text>
<!-- Draw distance widget here -->
<slider
control_name="RenderFarClip"
decimal_digits="0"
follows="right|top"
height="15"
increment="16"
initial_value="64"
layout="topleft"
tool_tip="Maximum distance away from camera to be rezzed (meters)"
top="5"
label="Draw:"
label_length="40"
left_delta="-250"
max_val="992"
min_val="32"
name="drawdistance"
top_delta="0"
width="130" />
<!-- End Draw distance widget here -->
<button
follows="right|top"
height="16"
@ -128,7 +199,7 @@
image_pressed="Pause_Press"
image_pressed_selected="Play_Press"
is_toggle="true"
left_delta="420"
left_delta="85"
top="1"
name="media_toggle_btn"
tool_tip="Start/Stop All Media (Music, Video, Web pages)"

View File

@ -1,14 +1,15 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<!-- See also settings.xml UIFloater* settings for configuration -->
<floater
name="floater"
bg_opaque_color="FloaterFocusBackgroundColor"
bg_alpha_color="FloaterDefaultBackgroundColor"
bg_opaque_image="Window_Foreground"
bg_alpha_image="Window_Background"
name="floater"
background_visible="true"
background_opaque="false"
header_height="25"
bg_opaque_color="DkGray"
bg_alpha_color="DkGray"
header_height="20"
close_image="Icon_Close_Foreground"
restore_image="Icon_Restore_Foreground"
minimize_image="Icon_Minimize_Foreground"