22 #ifndef ENTITYLABEL_HEADER 23 #define ENTITYLABEL_HEADER 27 #include <csutil/ref.h> 28 #include <imesh/sprite2d.h> 29 #include <ivideo/fontserv.h> 30 #include <csutil/leakguard.h> 36 struct iPluginManager;
void UpdateTarget()
Updates label visibility for targeted entities.
csRef< iEventQueue > eventQueue
References to some system-wide objects that we use.
class psEntityLabels serves for creation and management of 2D sprites hanging above cel-entities that...
bool HandleEvent(iEvent &Event)
This is called before the scene is painted on screen:
psEntityLabelVisib visCreatures
Configuration options.
void UpdateVisibility()
Updates label visibility based on range.
DeclareGenericEventHandler(EventHandler, psEntityLabels,"planeshift.entityevent")
Declare our event handler.
labels of all entities are visible
psEntityLabelVisib visItems
void UpdateMouseover()
Updates label visibility for entities under the cursor.
only label of the targeted entity is visible
Client version of the Cel Manager Requests world loading.
virtual ~psEntityLabels()
bool MatchVisibility(GEMOBJECT_TYPE type, psEntityLabelVisib vis)
void OnObjectArrived(GEMClientObject *object)
This must be called when client receives cel entity from server:
void RepaintAllLabels()
Used to repaint labels.
bool LoadFromFile()
Reads options for label behaviour from file:
void GetConfiguration(psEntityLabelVisib &visCreatures, psEntityLabelVisib &visItems, bool &showGuild, int *colors)
Gets options for label behaviour:
csRef< EventHandler > eventhandler
default or unmovable entities
GEMClientObject * underTarget
Entity which was targeted (or NULL)
GEMClientObject * underMouse
Entity that is under mouse cursor (or NULL)
bool SaveToFile()
Saves options for label behaviour to file:
void Configure(psEntityLabelVisib visCreatures, psEntityLabelVisib visItems, bool showGuild, int *colors)
Sets options for label behaviour:
void CreateLabelOfObject(GEMClientObject *object)
Creates label and its texture.
int entityColors[ENTITY_TYPES_AMOUNT]
Entity labels colors.
An object that the client knows about.
bool Initialize(iObjectRegistry *object_reg, psCelClient *celClient)
only label of the entity under mouse is visible
This describes one row of text displayed on entity 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 ...
void RefreshGuildLabels()
Refreshes just the actors with guild names (used on showGuild change)
void HideAllLabels()
Hides all labels.
void SetObjectText(GEMClientObject *object)
Determines what will be written in label.
void LoadAllEntityLabels()
(re)loads all entity labels
grouped-with-you-and-the-same-guild chars
psEntityLabelType
psRntityLabelType defines types of entities that have own color
virtual void RemoveObject(GEMClientObject *object)
This is called before some entity is deleted.
void DeleteLabelOfObject(GEMClientObject *object)
Deletes label from entity.
psEntityLabelVisib
psEntityLabelVisib defines possible visibility modes of labels
void RepaintObjectLabel(GEMClientObject *object)