mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-27 17:28:41 +00:00
Add support for per-player FOV overrides and multipliers
This commit is contained in:
parent
5c9983400f
commit
47da640d77
13 changed files with 168 additions and 62 deletions
18
src/player.h
18
src/player.h
|
@ -32,6 +32,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#define PLAYERNAME_ALLOWED_CHARS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_"
|
||||
#define PLAYERNAME_ALLOWED_CHARS_USER_EXPL "'a' to 'z', 'A' to 'Z', '0' to '9', '-', '_'"
|
||||
|
||||
struct PlayerFovSpec
|
||||
{
|
||||
f32 fov;
|
||||
bool is_multiplier;
|
||||
};
|
||||
|
||||
struct PlayerControl
|
||||
{
|
||||
PlayerControl() = default;
|
||||
|
@ -178,6 +184,16 @@ public:
|
|||
void setWieldIndex(u16 index);
|
||||
u16 getWieldIndex() const { return m_wield_index; }
|
||||
|
||||
void setFov(const PlayerFovSpec &spec)
|
||||
{
|
||||
m_fov_spec = spec;
|
||||
}
|
||||
|
||||
const PlayerFovSpec &getFov() const
|
||||
{
|
||||
return m_fov_spec;
|
||||
}
|
||||
|
||||
u32 keyPressed = 0;
|
||||
|
||||
HudElement* getHud(u32 id);
|
||||
|
@ -187,10 +203,12 @@ public:
|
|||
|
||||
u32 hud_flags;
|
||||
s32 hud_hotbar_itemcount;
|
||||
|
||||
protected:
|
||||
char m_name[PLAYERNAME_SIZE];
|
||||
v3f m_speed;
|
||||
u16 m_wield_index = 0;
|
||||
PlayerFovSpec m_fov_spec = { 0.0f, false };
|
||||
|
||||
std::vector<HudElement *> hud;
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue