nanoMMO 0.97.8
Building an MMO: The Engineering Series
Loading...
Searching...
No Matches
nameplates.h
Go to the documentation of this file.
1#ifndef NANOMMO_CLIENT_NAMEPLATES_H_
2#define NANOMMO_CLIENT_NAMEPLATES_H_
3
4#include <raylib.h>
5
6#include <cstdint>
7#include <map>
8#include <optional>
9#include <string_view>
10#include <vector>
11
12#include "client/animator.h"
13#include "client/settings.h"
14#include "client/telegraphs.h"
15
16namespace nanommo {
17
18/// In metres above a figure's feet, where its nameplate goes.
19float Above(const Figure& figure);
20
21/// Whether a figure has a nameplate over it: once its name has come, as names
22/// come once a second, and not while it's a dead monster, which there's
23/// nothing left to fight.
24bool HasNameplate(const Figure& figure);
25
26/// The mark before a player's name, or a herald's, in their faction's colour,
27/// or none for one in no faction, or in one this client's content hasn't got.
28std::optional<Color> FactionMark(const Figure& figure);
29
30/// What the player's taking notice of, which says whose nameplates show:
31/// the one the pointer's on, by Who, the one they've picked, and those the
32/// settings show always.
33struct Noticed {
35 std::optional<uint64_t> pointed;
36 uint32_t target = 0;
37 uint32_t target_player = 0;
38};
39
40/// Whether the figure's name shows: while it's pointed at or picked, and
41/// otherwise as the settings say for its kind, or for you. Over an NPC with a
42/// quest for you, its mark shows anyway, so that it can be found.
43bool ShowsName(const Figure& figure, const Noticed& noticed);
44
45/// Over each figure whose name shows, its name, and its level and health, but
46/// for an NPC's, as the settings say. Under a monster's health, its skill on
47/// its way, if it has one: a bar that fills as its shape does, in its colour,
48/// and its name. The names of the players in the guild at war with yours, by
49/// its name, are red, and a player's faction, or a herald's, is a diamond of
50/// its colour before the name.
51void DrawNameplates(const std::vector<Figure>& figures, const Camera3D& camera,
52 const std::map<uint32_t, Telegraph>& telegraphs = {},
53 std::string_view enemy = {}, const Noticed& noticed = {});
54
55} // namespace nanommo
56
57#endif // NANOMMO_CLIENT_NAMEPLATES_H_
Definition chat.cc:9
void DrawNameplates(const std::vector< Figure > &figures, const Camera3D &camera, const std::map< uint32_t, Telegraph > &telegraphs, std::string_view enemy, const Noticed &noticed)
float Above(const Figure &figure)
In metres above a figure's feet, where its nameplate goes.
Definition nameplates.cc:87
bool HasNameplate(const Figure &figure)
Definition nameplates.cc:98
std::optional< Color > FactionMark(const Figure &figure)
Definition nameplates.cc:91
bool ShowsName(const Figure &figure, const Noticed &noticed)
std::optional< uint64_t > pointed
Definition nameplates.h:35
NameplateSettings settings
Definition nameplates.h:34
uint32_t target
Definition nameplates.h:36
uint32_t target_player
Definition nameplates.h:37