Planeshift
Classes | Public Member Functions | Protected Member Functions | Protected Attributes

psEntityLabels Class Reference

class psEntityLabels serves for creation and management of 2D sprites hanging above cel-entities that display entity names and possibly guilds More...

#include <entitylabels.h>

List of all members.

Classes

struct  labelRow
 This describes one row of text displayed on entity label. More...

Public Member Functions

void Configure (psEntityLabelVisib visCreatures, psEntityLabelVisib visItems, bool showGuild, int *colors)
 Sets options for label behaviour:
void GetConfiguration (psEntityLabelVisib &visCreatures, psEntityLabelVisib &visItems, bool &showGuild, int *colors)
 Gets options for label behaviour:
bool HandleEvent (iEvent &Event)
 This is called before the scene is painted on screen:
bool Initialize (iObjectRegistry *object_reg, psCelClient *celClient)
void LoadAllEntityLabels ()
 (re)loads all entity labels
bool LoadFromFile ()
 Reads options for label behaviour from file:
void OnObjectArrived (GEMClientObject *object)
 This must be called when client receives cel entity from server:
 psEntityLabels ()
virtual void RemoveObject (GEMClientObject *object)
 This is called before some entity is deleted.
void RepaintAllLabels ()
 Used to repaint labels.
void RepaintObjectLabel (GEMClientObject *object)
bool SaveToFile ()
 Saves options for label behaviour to file:
virtual ~psEntityLabels ()

Protected Member Functions

void CreateLabelOfObject (GEMClientObject *object)
 Creates label and its texture.
 DeclareGenericEventHandler (EventHandler, psEntityLabels,"planeshift.entityevent")
 Declare our event handler.
void DeleteLabelOfObject (GEMClientObject *object)
 Deletes label from entity.
void HideAllLabels ()
 Hides all labels.
bool MatchVisibility (GEMOBJECT_TYPE type, psEntityLabelVisib vis)
void RefreshGuildLabels ()
 Refreshes just the actors with guild names (used on showGuild change)
void SetObjectText (GEMClientObject *object)
 Determines what will be written in label.
void ShowLabelOfObject (GEMClientObject *object, bool show)
 Shows or hides label of given entity (only sets visibility, doesn't create/destruct it) This is used when visibility mode is OnMouseOver - labels are created for all entities, but only one is set visible (or none at all).
void UpdateMouseover ()
 Updates label visibility for entities under the cursor.
void UpdateTarget ()
 Updates label visibility for targeted entities.
void UpdateVisibility ()
 Updates label visibility based on range.

Protected Attributes

psCelClientcelClient
int entityColors [ENTITY_TYPES_AMOUNT]
 Entity labels colors.
csRef< EventHandler > eventhandler
csRef< iEventQueue > eventQueue
 References to some system-wide objects that we use.
bool showGuild
GEMClientObjectunderMouse
 Entity that is under mouse cursor (or NULL)
GEMClientObjectunderTarget
 Entity which was targeted (or NULL)
iVFS * vfs
psEntityLabelVisib visCreatures
 Configuration options.
psEntityLabelVisib visItems

Detailed Description

class psEntityLabels serves for creation and management of 2D sprites hanging above cel-entities that display entity names and possibly guilds

Definition at line 69 of file entitylabels.h.


Constructor & Destructor Documentation

psEntityLabels::psEntityLabels ( )
virtual psEntityLabels::~psEntityLabels ( ) [virtual]

Member Function Documentation

void psEntityLabels::Configure ( psEntityLabelVisib  visCreatures,
psEntityLabelVisib  visItems,
bool  showGuild,
int colors 
)

Sets options for label behaviour:

void psEntityLabels::CreateLabelOfObject ( GEMClientObject object) [protected]

Creates label and its texture.

psEntityLabels::DeclareGenericEventHandler ( EventHandler  ,
psEntityLabels  ,
"planeshift.entityevent"   
) [protected]

Declare our event handler.

void psEntityLabels::DeleteLabelOfObject ( GEMClientObject object) [protected]

Deletes label from entity.

void psEntityLabels::GetConfiguration ( psEntityLabelVisib visCreatures,
psEntityLabelVisib visItems,
bool &  showGuild,
int colors 
)

Gets options for label behaviour:

bool psEntityLabels::HandleEvent ( iEvent &  Event)

This is called before the scene is painted on screen:

void psEntityLabels::HideAllLabels ( ) [protected]

Hides all labels.

bool psEntityLabels::Initialize ( iObjectRegistry *  object_reg,
psCelClient celClient 
)
void psEntityLabels::LoadAllEntityLabels ( )

(re)loads all entity labels

bool psEntityLabels::LoadFromFile ( )

Reads options for label behaviour from file:

bool psEntityLabels::MatchVisibility ( GEMOBJECT_TYPE  type,
psEntityLabelVisib  vis 
) [protected]
void psEntityLabels::OnObjectArrived ( GEMClientObject object)

This must be called when client receives cel entity from server:

void psEntityLabels::RefreshGuildLabels ( ) [protected]

Refreshes just the actors with guild names (used on showGuild change)

virtual void psEntityLabels::RemoveObject ( GEMClientObject object) [virtual]

This is called before some entity is deleted.

void psEntityLabels::RepaintAllLabels ( )

Used to repaint labels.

void psEntityLabels::RepaintObjectLabel ( GEMClientObject object)
bool psEntityLabels::SaveToFile ( )

Saves options for label behaviour to file:

void psEntityLabels::SetObjectText ( GEMClientObject object) [protected]

Determines what will be written in label.

void psEntityLabels::ShowLabelOfObject ( GEMClientObject object,
bool  show 
) [protected]

Shows or hides label of given entity (only sets visibility, doesn't create/destruct it) This is used when visibility mode is OnMouseOver - labels are created for all entities, but only one is set visible (or none at all).

void psEntityLabels::UpdateMouseover ( ) [protected]

Updates label visibility for entities under the cursor.

void psEntityLabels::UpdateTarget ( ) [protected]

Updates label visibility for targeted entities.

void psEntityLabels::UpdateVisibility ( ) [protected]

Updates label visibility based on range.


Member Data Documentation

Definition at line 201 of file entitylabels.h.

int psEntityLabels::entityColors[ENTITY_TYPES_AMOUNT] [protected]

Entity labels colors.

Definition at line 184 of file entitylabels.h.

csRef<EventHandler> psEntityLabels::eventhandler [protected]

Definition at line 205 of file entitylabels.h.

csRef<iEventQueue> psEntityLabels::eventQueue [protected]

References to some system-wide objects that we use.

Definition at line 199 of file entitylabels.h.

bool psEntityLabels::showGuild [protected]

Definition at line 181 of file entitylabels.h.

Entity that is under mouse cursor (or NULL)

Definition at line 189 of file entitylabels.h.

Entity which was targeted (or NULL)

Definition at line 194 of file entitylabels.h.

iVFS* psEntityLabels::vfs [protected]

Definition at line 200 of file entitylabels.h.

Configuration options.

Definition at line 179 of file entitylabels.h.

Definition at line 180 of file entitylabels.h.


The documentation for this class was generated from the following file: