mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-22 17:18:39 +00:00
Add option to give every object a nametag
or change the nametag text of players
This commit is contained in:
parent
19f73e4efc
commit
9eee3c3f46
9 changed files with 111 additions and 95 deletions
|
@ -757,8 +757,6 @@ PlayerSAO::PlayerSAO(ServerEnvironment *env_, Player *player_, u16 peer_id_,
|
|||
m_bone_position_sent(false),
|
||||
m_attachment_parent_id(0),
|
||||
m_attachment_sent(false),
|
||||
m_nametag_color(video::SColor(255, 255, 255, 255)),
|
||||
m_nametag_sent(false),
|
||||
// public
|
||||
m_physics_override_speed(1),
|
||||
m_physics_override_jump(1),
|
||||
|
@ -857,7 +855,7 @@ std::string PlayerSAO::getClientInitializationData(u16 protocol_version)
|
|||
os<<serializeLongString(gob_cmd_update_physics_override(m_physics_override_speed,
|
||||
m_physics_override_jump, m_physics_override_gravity, m_physics_override_sneak,
|
||||
m_physics_override_sneak_glitch)); // 5
|
||||
os << serializeLongString(gob_cmd_update_nametag_attributes(m_nametag_color)); // 6
|
||||
os << serializeLongString(gob_cmd_update_nametag_attributes(m_prop.nametag_color)); // 6 (GENERIC_CMD_UPDATE_NAMETAG_ATTRIBUTES) : Deprecated, for backwards compatibility only.
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1012,14 +1010,6 @@ void PlayerSAO::step(float dtime, bool send_recommended)
|
|||
ActiveObjectMessage aom(getId(), true, str);
|
||||
m_messages_out.push(aom);
|
||||
}
|
||||
|
||||
if (m_nametag_sent == false) {
|
||||
m_nametag_sent = true;
|
||||
std::string str = gob_cmd_update_nametag_attributes(m_nametag_color);
|
||||
// create message and add to list
|
||||
ActiveObjectMessage aom(getId(), true, str);
|
||||
m_messages_out.push(aom);
|
||||
}
|
||||
}
|
||||
|
||||
void PlayerSAO::setBasePosition(const v3f &position)
|
||||
|
@ -1270,17 +1260,6 @@ void PlayerSAO::notifyObjectPropertiesModified()
|
|||
m_properties_sent = false;
|
||||
}
|
||||
|
||||
void PlayerSAO::setNametagColor(video::SColor color)
|
||||
{
|
||||
m_nametag_color = color;
|
||||
m_nametag_sent = false;
|
||||
}
|
||||
|
||||
video::SColor PlayerSAO::getNametagColor()
|
||||
{
|
||||
return m_nametag_color;
|
||||
}
|
||||
|
||||
Inventory* PlayerSAO::getInventory()
|
||||
{
|
||||
return m_inventory;
|
||||
|
@ -1396,4 +1375,3 @@ bool PlayerSAO::getCollisionBox(aabb3f *toset) {
|
|||
bool PlayerSAO::collideWithObjects(){
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue