Planeshift
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>

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

Protected Member Functions

void CreateLabelOfObject (GEMClientObject *object)
 Creates label and its texture. More...
 
 DeclareGenericEventHandler (EventHandler, psEntityLabels,"planeshift.entityevent")
 Declare our event handler. More...
 
void DeleteLabelOfObject (GEMClientObject *object)
 Deletes label from entity. More...
 
void HideAllLabels ()
 Hides all labels. More...
 
bool MatchVisibility (GEMOBJECT_TYPE type, psEntityLabelVisib vis)
 
void RefreshGuildLabels ()
 Refreshes just the actors with guild names (used on showGuild change) More...
 
void SetObjectText (GEMClientObject *object)
 Determines what will be written in label. More...
 
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). More...
 
void UpdateMouseover ()
 Updates label visibility for entities under the cursor. More...
 
void UpdateTarget ()
 Updates label visibility for targeted entities. More...
 
void UpdateVisibility ()
 Updates label visibility based on range. More...
 

Protected Attributes

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

psCelClient* psEntityLabels::celClient
protected

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.

GEMClientObject* psEntityLabels::underMouse
protected

Entity that is under mouse cursor (or NULL)

Definition at line 189 of file entitylabels.h.

GEMClientObject* psEntityLabels::underTarget
protected

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.

psEntityLabelVisib psEntityLabels::visCreatures
protected

Configuration options.

Definition at line 179 of file entitylabels.h.

psEntityLabelVisib psEntityLabels::visItems
protected

Definition at line 180 of file entitylabels.h.


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