diff options
author | Florian Diebold <flodiebold@gmail.com> | 2012-08-09 15:20:50 +0200 |
---|---|---|
committer | Florian Diebold <flodiebold@gmail.com> | 2012-11-23 21:28:20 +0100 |
commit | d87e009ff1d73614382db51c083f8cda41377174 (patch) | |
tree | d0f5ab620ed461aac0f0aae04ab881769642af40 /crawl-ref/source/tileweb.h | |
parent | 84556d014c5b2f27b5419ced63d631d998ceff0d (diff) | |
download | crawl-ref-d87e009ff1d73614382db51c083f8cda41377174.tar.gz crawl-ref-d87e009ff1d73614382db51c083f8cda41377174.zip |
Webtiles: Send inventory contents to the client.
This also fixes the wielded weapon and quiver not being shown.
Diffstat (limited to 'crawl-ref/source/tileweb.h')
-rw-r--r-- | crawl-ref/source/tileweb.h | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/crawl-ref/source/tileweb.h b/crawl-ref/source/tileweb.h index 367a32aff9..d9c6b341d8 100644 --- a/crawl-ref/source/tileweb.h +++ b/crawl-ref/source/tileweb.h @@ -34,6 +34,8 @@ enum WebtilesUIState struct player_info { + player_info(); + std::string name; std::string job_title; bool wizard; @@ -42,6 +44,8 @@ struct player_info bool under_penance; uint8_t piety_rank; + uint8_t form; + int hp, hp_max, real_hp_max; int mp, mp_max; @@ -65,6 +69,11 @@ struct player_info coord_def position; std::vector<status_info> status; + + FixedVector<item_info, ENDOFPACK> inv; + FixedVector<int8_t, NUM_EQUIP> equip; + int8_t quiver_item; + std::string unarmed_attack; }; class TilesFramework @@ -271,19 +280,8 @@ protected: map<uint32_t, coord_def>& new_monster_locs, bool force_full); void _send_player(bool force_full = false); - - void _update_string(bool force, std::string& current, - const std::string& next, - const std::string& name); - template<class T> void _update_int(bool force, T& current, T next, - const std::string& name) - { - if (force || (current != next)) - { - json_write_int(name, next); - current = next; - } - } + void _send_item(item_info& current, const item_info& next, + bool force_full); }; // Main interface for tiles functions |