Files
SingularityViewer/indra/newview/llfloateravatarlist.h
Lirusaito 0846f8a963 Fixeds and ToDones
-Color Fixies-
Fixed Gemini skin not looking as it originally did.
We now use DefaultListText to color all otherwise uncolored text in scroll list cells.
All of our dark skins have been updated to use white here, as dark skins are intended to have white text...
This includes the Dark we ship with.

LLFloaterActiveSpeakers no longer uses hard coded font colors, it uses SpeakersInactive, DefaultListText, and SpeakersGhost.

LLFloaterAvatarList no longer uses hard coded font colors, it uses DefaultListText, RadarTextChatRange, RadarTextShoutRange, and RadarTextDrawDist, in place of previously hard coded font colors
Since the tooltip defines color meaning, these new colors should only be skinned to change shade.

DefaultListText defaults to black; SpeaksInactive, gray(grey4); SpeakersGhost, Red; RadarTextChatRange, Red; RadarTextShoutRange, Yellow(yellow1); RadarTextDrawDist, Green(green2).


-Translation update and fixies-
Partial credit to viewer-development, thanks for hanging onto old strings!  Also, updated to look more like v-d in translated areas.
Punctuation strings can be used quite a lot.  Brought them all in, just in case.

AscentPrefs*:
Drag and Drop points now use CurrentlySetTo, CurrentlyNotSet, AnItemNotOnThisAccount, and NotLoggedIn. (applies, as well, to FloaterAO)
Power User message is now built from PowerUser1, PowerUser2, Unlocked:, PowerUser3, RightClick, PowerUser4 and PowerUser5; this should give translators enough space to explain any tough to translate, and make the message easier to alter in the future, if necessary.

LLCompileQueue:
Now uses translation strings from upstream
Starting, Done, Resetting, Running, and NotRunning in its xml.
CompileQueueTitle, CompileQueueStart, CompileQueueDownloadedCompiling, CompileQueueScriptNotFound, CompileQueueProblemDownloading, CompileQueueInsufficientPermDownload, CompileQueueInsufficientPermFor, CompileQueueUnknownFailure, ResetQueueTitle, ResetQueueStart, NotRunQueueTitle, and NotRunQueueStart from strings.

LLFloaterAvatarList(floater_radar) now uses has_entered, has_left, the_sim, draw_distance, shout_range, and chat_range in its xml for translatable alerts.

LLFloaterLand(floater_about_land) now uses minutes, 1_minute, 1_second, seconds, and remaining from its xml.
LLFloaterLand, LLFolderView, LLPanelDirBrowser now make use of InventoryNoMatchingItems, NoneFound, and Searching in their searches.
LLFolderView was brought closer to v-d in translation.

LLGroupNotify now uses GroupNotifyGroupNotice, GroupNotifySentBy, GroupNotifyAttached, next (also now used by LLNotify), ok, GroupNotifyGroupNotices, GroupNotifyViewPastNotices, GroupNotifyOpenAttachment, and GroupNotifySaveAttachment.

LLInventoryFilter synced with V-D for translation:
Now uses Animations, Calling Cards, Clothing, Gestures, Landmarks, Notecards, Objects, Scripts, Sounds, Textures, Snapshots, No Filters, Since Logoff, and Worn.

LLManipRotate now uses Direction_Forward, Direction_Left, Direction_Right, Direction_Back, Direction_North, Direction_South, Direction_West, Direction_East, Direction_Up, and Direction_Down, like upstream v-d.

LLPanelAvatar(panel_avatar) now uses None string in its xml for when there are no groups, also removed cruft. Though the None has not been showing up for quite some time, anyway...

LLPanelObjectInventory now uses Buy, LoadingContents and NoContents,
however the last two strings did not seem to show up anyway...
thanks to Latif Khalifa, Jean Horten, theGenius Indigo and Cubbi Bearcat for confirming this happens across many different versions and on both Windows and linux(32 and 64).

LLPreviewScript now uses CompileSuccessful, SaveComplete, ObjectOutOfRange, and CompileSuccessfulSaving.

LLScrollingPanelParam now translates Less and More.
Avatar Shape Information strings now used for customize appearance panels.

LLTextureCtrl now uses multiple_textures.

LLToolpie has been updated to use v-d include order and now uses UnmuteAvatar, MuteAvatar, UnmuteObject, and MuteObject2 strings.
LLVOAvatarSelf now uses BodyParts* strings for translation of toolpie entries pertaining to bodyparts.

LLViewerMenuFile now uses UnknownFileExtension, and UploadingCosts.

LLViewerMessage now uses Cancel(also used by LLViewerDisplay), AcquiredItems, Saved_message, IM_autoresponse_sent_item, IM_autoresponded_to, IM_announce_incoming, InvOfferDecline, InvOfferGaveYou, InvOfferOwnedByUnknownUser, InvOfferAnObjectNamed, InvOfferOwnedBy, InvOfferOwnedByUnknownGroup, and InvOfferOwnedByGroup.


-AvatarRadar Update-
AvatarRadar enhanced with code from both Cool VL Viewer and some avian corpse.
e_radar_alert_type has been reworked to allow bitwise usage in the future.

Cool stuff:
gSavedSettings for radar are now CachedControls,
entering boolean is now checked before going into the switchcase,
Style changes, yay C++ style.

Avian Flu:
Distance for shout range corrected to be 96.
handleKeyHere: If the user hits enter with an avatar on the radar selected, focus camera on selected avatar; ctrl-enter, teleport to selected avatar.

Otherwise:
Tiny spelling fixies, and a suggestive comment.
2012-08-05 20:40:02 -04:00

337 lines
8.5 KiB
C++

//
// C++ Interface: llfloateravatarlist
//
// Description:
//
//
// Original author: Dale Glass <dale@daleglass.net>, (C) 2007
// Heavily modified by Henri Beauchamp 10/2009.
//
// Copyright: See COPYING file that comes with this distribution
//
//
#include "llavatarname.h"
#include "llfloater.h"
#include "llfloaterreporter.h"
#include "lluuid.h"
#include "lltimer.h"
#include "llscrolllistctrl.h"
#include <time.h>
#include <map>
#include <set>
class LLFloaterAvatarList;
/**
* @brief This class is used to hold data about avatars.
* We cache data about avatars to avoid repeating requests in this class.
* Instances are kept in a map<LLAvatarListEntry>. We keep track of the
* frame where the avatar was last seen.
*/
class LLAvatarListEntry {
public:
enum ACTIVITY_TYPE
{
ACTIVITY_NONE, /** Avatar not doing anything */
ACTIVITY_MOVING, /** Changing position */
ACTIVITY_GESTURING, /** Playing a gesture */
ACTIVITY_REZZING, /** Rezzing objects */
ACTIVITY_PARTICLES, /** Creating particles */
ACTIVITY_TYPING, /** Typing */
ACTIVITY_NEW, /** Avatar just appeared */
ACTIVITY_SOUND, /** Playing a sound */
ACTIVITY_DEAD /** Avatar isn't around anymore, and will be removed soon from the list */
};
/**
* @brief Initializes a list entry
* @param id Avatar's key
* @param name Avatar's name
* @param position Avatar's current position
*/
LLAvatarListEntry(const LLUUID& id = LLUUID::null, const std::string &name = "", const LLVector3d &position = LLVector3d::zero);
/**
* Update world position.
* Affects age.
*/
void setPosition(LLVector3d position, bool this_sim, bool drawn, bool chatrange, bool shoutrange);
LLVector3d getPosition() { return mPosition; }
/**
* @brief Returns the age of this entry in frames
*
* This is only used for determining whether the avatar is still around.
* @see getEntryAgeSeconds
*/
bool getAlive();
/**
* @brief Returns the age of this entry in seconds
*/
F32 getEntryAgeSeconds();
/**
* @brief Returns the name of the avatar
*/
std::string getName() { return mName; }
/**
* @brief Returns the ID of the avatar
*/
LLUUID getID() { return mID; }
void setActivity(ACTIVITY_TYPE activity);
/**
* @brief Returns the activity type
*/
ACTIVITY_TYPE getActivity();
/**
* @brief Sets the 'focus' status on this entry (camera focused on this avatar)
*/
void setFocus(BOOL value) { mFocused = value; }
BOOL isFocused() { return mFocused; }
BOOL isMarked() { return mMarked; }
BOOL isDrawn() { return (mInDrawFrame != U32_MAX); }
BOOL isInSim() { return (mInSimFrame != U32_MAX); }
/**
* @brief Returns whether the item is dead and shouldn't appear in the list
* @returns TRUE if dead
*/
BOOL isDead();
void toggleMark() { mMarked = !mMarked; }
private:
friend class LLFloaterAvatarList;
LLUUID mID;
std::string mName;
LLVector3d mPosition;
LLVector3d mDrawPosition;
BOOL mMarked;
BOOL mFocused;
/**
* @brief Timer to keep track of whether avatars are still there
*/
LLTimer mUpdateTimer;
ACTIVITY_TYPE mActivityType;
LLTimer mActivityTimer;
/**
* @brief Last frame when this avatar was updated
*/
U32 mFrame;
//last frame when this avatar was in sim
U32 mInSimFrame;
//last frame when this avatar was in draw
U32 mInDrawFrame;
//last frame when this avatar was in shout range
U32 mInShoutFrame;
//last frame when this avatar was in chat range
U32 mInChatFrame;
};
/**
* @brief Avatar List
* Implements an avatar scanner in the client.
*
* This is my first attempt to modify the SL source. This code is intended
* to have a dual purpose: doing the task, and providing an example of how
* to do it. For that reason, it's going to be commented as exhaustively
* as possible.
*
* Since I'm very new to C++ any suggestions on coding, style, etc are very
* welcome.
*/
class LLFloaterAvatarList : public LLFloater, public LLSingleton<LLFloaterAvatarList>
{
/**
* @brief Creates and initializes the LLFloaterAvatarList
* Here the interface is created, and callbacks are initialized.
*/
friend class LLSingleton<LLFloaterAvatarList>;
private:
LLFloaterAvatarList();
public:
~LLFloaterAvatarList();
virtual BOOL handleKeyHere(KEY key, MASK mask);
/*virtual*/ void onClose(bool app_quitting);
/*virtual*/ void onOpen();
/*virtual*/ BOOL postBuild();
/*virtual*/ void draw();
static void createInstance(bool visible);
/**
* @brief Toggles interface visibility
* There is only one instance of the avatar scanner at any time.
*/
static void toggle(void*);
static void showInstance();
/**
* @brief Updates the internal avatar list with the currently present avatars.
*/
void updateAvatarList();
/**
* @brief Refresh avatar list (display)
*/
void refreshAvatarList();
/**
* @brief Returns the entry for an avatar, if preset
* @returns Pointer to avatar entry, NULL if not found.
*/
LLAvatarListEntry* getAvatarEntry(LLUUID avatar);
/**
* @brief Returns a string with the selected names in the list
*/
std::string getSelectedNames(const std::string& separator = ", ");
std::string getSelectedName();
LLUUID getSelectedID();
static void lookAtAvatar(LLUUID &uuid);
static void sound_trigger_hook(LLMessageSystem* msg,void **);
static void sendKeys();
private:
// when a line editor loses keyboard focus, it is committed.
// commit callbacks are named onCommitWidgetName by convention.
//void onCommitBaz(LLUICtrl* ctrl, void *userdata);
enum AVATARS_COLUMN_ORDER
{
LIST_MARK,
LIST_AVATAR_NAME,
LIST_DISTANCE,
LIST_POSITION,
LIST_ALTITUDE,
LIST_ACTIVITY,
LIST_CLIENT,
};
typedef void (*avlist_command_t)(const LLUUID &avatar, const std::string &name);
/**
* @brief Removes focus status from all avatars in list
*/
void removeFocusFromAll();
/**
* @brief Focus camera on current avatar
*/
void focusOnCurrent();
/**
* @brief Focus camera on previous avatar
* @param marked_only Whether to choose only marked avatars
*/
void focusOnPrev(BOOL marked_only);
/**
* @brief Focus camera on next avatar
* @param marked_only Whether to choose only marked avatars
*/
void focusOnNext(BOOL marked_only);
/**
* @brief Handler for the "refresh" button click.
* I am unsure whether this is actually necessary at the time.
*
* LL: By convention, button callbacks are named onClickButtonLabel
* @param userdata Pointer to user data (LLFloaterAvatarList instance)
*/
static void onClickProfile(void *userdata);
static void onClickIM(void *userdata);
static void onClickTeleportOffer(void *userdata);
static void onClickTrack(void *userdata);
static void onClickMark(void *userdata);
static void onClickFocus(void *userdata);
static void onClickPrevInList(void *userdata);
static void onClickNextInList(void *userdata);
static void onClickPrevMarked(void *userdata);
static void onClickNextMarked(void *userdata);
static void onClickGetKey(void *userdata);
static void onClickFreeze(void *userdata);
static void onClickEject(void *userdata);
static void onClickMute(void *userdata);
static void onClickAR(void *userdata);
static void onClickTeleport(void *userdata);
static void onClickEjectFromEstate(void *userdata);
static void callbackFreeze(const LLSD& notification, const LLSD& response);
static void callbackEject(const LLSD& notification, const LLSD& response);
static void callbackAR(void *userdata);
static void callbackEjectFromEstate(const LLSD& notification, const LLSD& response);
static void onSelectName(LLUICtrl*, void *userdata);
static void onCommitUpdateRate(LLUICtrl*, void *userdata);
static void onClickSendKeys(void *userdata);
static bool onConfirmRadarChatKeys(const LLSD& notification, const LLSD& response );
static void callbackIdle(void *userdata);
void doCommand(avlist_command_t cmd);
/**
* @brief Cleanup avatar list, removing dead entries from it.
* This lets dead entries remain for some time. This makes it possible
* to keep people passing by in the list long enough that it's possible
* to do something to them.
*/
void expireAvatarList();
private:
/**
* @brief Pointer to the avatar scroll list
*/
LLScrollListCtrl* mAvatarList;
std::map<LLUUID, LLAvatarListEntry> mAvatars;
/**
* @brief TRUE when Updating
*/
BOOL mUpdate;
/**
* @brief Update rate (if min frames per update)
*/
U32 mUpdateRate;
void refreshTracker();
// tracking data
BOOL mTracking; // Tracking ?
LLUUID mTrackedAvatar; // Who we are tracking
/**
* @brief Avatar the camera is focused on
*/
LLUUID mFocusedAvatar;
};