summaryrefslogtreecommitdiff
path: root/src/player.h
diff options
context:
space:
mode:
authorTeTpaAka <TeTpaAka@users.noreply.github.com>2015-05-26 14:10:08 +0200
committerest31 <MTest31@outlook.com>2015-05-28 16:46:35 +0200
commitc0335f7d13ee46c6a46d0ceebea96960439ec9fd (patch)
tree20183ec9aac1dd1dfdd6f193430fb331268b92b0 /src/player.h
parent990a96578f20244626b6b9f67f8e79a7e2e614ea (diff)
downloadminetest-c0335f7d13ee46c6a46d0ceebea96960439ec9fd.tar.gz
minetest-c0335f7d13ee46c6a46d0ceebea96960439ec9fd.tar.bz2
minetest-c0335f7d13ee46c6a46d0ceebea96960439ec9fd.zip
Add some missing getter functions to the lua API
ObjectRef: get_properties get_armor_groups get_animation get_attach get_bone_position Players: get_physics_override hud_get_hotbar_itemcount hud_get_hotbar_image hud_get_hotbar_selected_image get_sky get_day_night_ratio get_local_animation get_eye_offset Global: minetest.get_gen_notify minetest.get_noiseparams
Diffstat (limited to 'src/player.h')
-rw-r--r--src/player.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/player.h b/src/player.h
index 7d8d245e3..4db0e4c58 100644
--- a/src/player.h
+++ b/src/player.h
@@ -215,6 +215,56 @@ public:
return size;
}
+ void setHotbarItemcount(s32 hotbar_itemcount) {
+ hud_hotbar_itemcount = hotbar_itemcount;
+ }
+ s32 getHotbarItemcount() {
+ return hud_hotbar_itemcount;
+ }
+ void setHotbarImage(std::string name) {
+ hud_hotbar_image = name;
+ }
+ std::string getHotbarImage() {
+ return hud_hotbar_image;
+ }
+ void setHotbarSelectedImage(std::string name) {
+ hud_hotbar_selected_image = name;
+ }
+ std::string getHotbarSelectedImage() {
+ return hud_hotbar_selected_image;
+ }
+
+ void setSky(const video::SColor &bgcolor, const std::string &type,
+ const std::vector<std::string> &params) {
+ m_sky_bgcolor = bgcolor;
+ m_sky_type = type;
+ m_sky_params = params;
+ }
+ void getSky(video::SColor *bgcolor, std::string *type,
+ std::vector<std::string> *params) {
+ *bgcolor = m_sky_bgcolor;
+ *type = m_sky_type;
+ *params = m_sky_params;
+ }
+ void overrideDayNightRatio(bool do_override, float ratio) {
+ m_day_night_ratio_do_override = do_override;
+ m_day_night_ratio = ratio;
+ }
+ void getDayNightRatio(bool *do_override, float *ratio) {
+ *do_override = m_day_night_ratio_do_override;
+ *ratio = m_day_night_ratio;
+ }
+ void setLocalAnimations(v2s32 frames[4], float frame_speed) {
+ for (int i = 0; i < 4; i++)
+ local_animations[i] = frames[i];
+ local_animation_speed = frame_speed;
+ }
+ void getLocalAnimations(v2s32 *frames, float *frame_speed) {
+ for (int i = 0; i < 4; i++)
+ frames[i] = local_animations[i];
+ *frame_speed = local_animation_speed;
+ }
+
virtual bool isLocal() const
{ return false; }
virtual PlayerSAO *getPlayerSAO()
@@ -255,6 +305,8 @@ public:
bool is_climbing;
bool swimming_vertical;
bool camera_barely_in_ceiling;
+ v3f eye_offset_first;
+ v3f eye_offset_third;
Inventory inventory;
@@ -308,6 +360,8 @@ public:
u32 hud_flags;
s32 hud_hotbar_itemcount;
+ std::string hud_hotbar_image;
+ std::string hud_hotbar_selected_image;
protected:
IGameDef *m_gamedef;
@@ -322,6 +376,13 @@ protected:
bool m_dirty;
std::vector<HudElement *> hud;
+
+ std::string m_sky_type;
+ video::SColor m_sky_bgcolor;
+ std::vector<std::string> m_sky_params;
+
+ bool m_day_night_ratio_do_override;
+ float m_day_night_ratio;
private:
// Protect some critical areas
// hud for example can be modified by EmergeThread