2024-02-25 14:46:47 +00:00
|
|
|
#pragma once
|
2023-06-20 04:33:09 +00:00
|
|
|
|
|
|
|
#include "StarWorldClient.hpp"
|
|
|
|
#include "StarWorldCamera.hpp"
|
|
|
|
#include "StarChatBubbleSeparation.hpp"
|
|
|
|
#include "StarTextPainter.hpp"
|
|
|
|
|
|
|
|
namespace Star {
|
|
|
|
|
|
|
|
STAR_CLASS(WorldClient);
|
|
|
|
STAR_CLASS(NameplatePainter);
|
|
|
|
|
|
|
|
class NameplatePainter {
|
|
|
|
public:
|
|
|
|
NameplatePainter();
|
|
|
|
|
2023-07-20 14:58:49 +00:00
|
|
|
void update(float dt, WorldClientPtr const& world, WorldCamera const& camera, bool inspectionMode);
|
2023-06-20 04:33:09 +00:00
|
|
|
void render();
|
|
|
|
|
|
|
|
private:
|
|
|
|
struct Nametag {
|
|
|
|
String name;
|
|
|
|
Maybe<String> statusText;
|
|
|
|
Vec3B color;
|
|
|
|
float opacity;
|
|
|
|
EntityId entityId;
|
|
|
|
};
|
|
|
|
|
|
|
|
TextPositioning namePosition(Vec2F bubblePosition) const;
|
|
|
|
TextPositioning statusPosition(Vec2F bubblePosition) const;
|
|
|
|
RectF determineBoundBox(Vec2F bubblePosition, Nametag const& nametag) const;
|
|
|
|
|
2023-06-23 10:24:40 +00:00
|
|
|
bool m_showMasterNames;
|
2023-06-20 04:33:09 +00:00
|
|
|
float m_opacityRate;
|
2023-06-23 10:24:40 +00:00
|
|
|
float m_inspectOpacityRate;
|
2023-06-20 04:33:09 +00:00
|
|
|
Vec2F m_offset;
|
|
|
|
Vec2F m_statusOffset;
|
2024-04-21 20:07:59 +00:00
|
|
|
TextStyle m_textStyle;
|
|
|
|
TextStyle m_statusTextStyle;
|
2023-06-20 04:33:09 +00:00
|
|
|
float m_opacityBoost;
|
|
|
|
|
|
|
|
WorldCamera m_camera;
|
|
|
|
|
|
|
|
Set<EntityId> m_entitiesWithNametags;
|
|
|
|
BubbleSeparator<Nametag> m_nametags;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|