summaryrefslogtreecommitdiff
path: root/src/server.h
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2013-04-13 18:20:22 -0400
committerkwolekr <kwolekr@minetest.net>2013-04-18 02:19:31 -0400
commit666aae359310483b7ad0f2bba1f4c31d8a58c737 (patch)
tree0860272e892a8c6669988bd603b6e582c29a3ce9 /src/server.h
parent49f6e347f01f72e8854308d5a54aaae337489555 (diff)
downloadminetest-666aae359310483b7ad0f2bba1f4c31d8a58c737.tar.gz
minetest-666aae359310483b7ad0f2bba1f4c31d8a58c737.tar.bz2
minetest-666aae359310483b7ad0f2bba1f4c31d8a58c737.zip
Split HUD code off to hud.cpp, make into a class, extensive Lua HUD modification
Diffstat (limited to 'src/server.h')
-rw-r--r--src/server.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/server.h b/src/server.h
index ef0c45a6a..52606b0cb 100644
--- a/src/server.h
+++ b/src/server.h
@@ -28,6 +28,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "map.h"
#include "inventory.h"
#include "ban.h"
+#include "hud.h"
#include "gamedef.h"
#include "serialization.h" // For SER_FMT_VER_INVALID
#include "mods.h"
@@ -51,6 +52,7 @@ class EventManager;
class PlayerSAO;
class IRollbackManager;
class EmergeManager;
+//struct HudElement;
class ServerError : public std::exception
{
@@ -534,11 +536,11 @@ public:
}
bool showFormspec(const char *name, const std::string &formspec, const std::string &formname);
- bool hudadd(const char *pname, const u32 &id, HudElement *element);
- bool hudrm(const char *pname, const u32 &id);
- bool hudchange(const char *pname, const u32 &id, const u8 &stat, v2f data);
- bool hudchange(const char *pname, const u32 &id, const u8 &stat, std::string data);
- bool hudchange(const char *pname, const u32 &id, const u8 &stat, u32 data);
+
+ u32 hudAdd(Player *player, HudElement *element);
+ bool hudRemove(Player *player, u32 id);
+ bool hudChange(Player *player, u32 id, HudElementStat stat, void *value);
+
private:
// con::PeerHandler implementation.
@@ -578,11 +580,9 @@ private:
void SendPlayerPrivileges(u16 peer_id);
void SendPlayerInventoryFormspec(u16 peer_id);
void SendShowFormspecMessage(u16 peer_id, const std::string formspec, const std::string formname);
- void SendHUDAdd(u16 peer_id, const u32 id, HudElement* form);
- void SendHUDRm(u16 peer_id, const u32 id);
- void SendHUDChange(u16 peer_id, const u32 id, const u8 stat, v2f data);
- void SendHUDChange(u16 peer_id, const u32 id, const u8 stat, std::string data);
- void SendHUDChange(u16 peer_id, const u32 id, const u8 stat, u32 data);
+ void SendHUDAdd(u16 peer_id, u32 id, HudElement *form);
+ void SendHUDRemove(u16 peer_id, u32 id);
+ void SendHUDChange(u16 peer_id, u32 id, HudElementStat stat, void *value);
/*
Send a node removal/addition event to all clients except ignore_id.
Additionally, if far_players!=NULL, players further away than