diff options
author | Johanna Ploog <j-p-e-g@users.sourceforge.net> | 2010-12-27 14:57:07 +0100 |
---|---|---|
committer | Johanna Ploog <j-p-e-g@users.sourceforge.net> | 2010-12-27 14:58:51 +0100 |
commit | ac035c03f4d7cc7118fb8c2190e0336d83239c15 (patch) | |
tree | 38e6bd10bc527225f09b30245ef956107acda8ea /crawl-ref/source/tilereg-cmd.cc | |
parent | deb340c83f9f44aecb5f8a2d2b340ea90e56e2e8 (diff) | |
download | crawl-ref-ac035c03f4d7cc7118fb8c2190e0336d83239c15.tar.gz crawl-ref-ac035c03f4d7cc7118fb8c2190e0336d83239c15.zip |
Add (preliminary tiles) for some of the commands.
Diffstat (limited to 'crawl-ref/source/tilereg-cmd.cc')
-rw-r--r-- | crawl-ref/source/tilereg-cmd.cc | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/crawl-ref/source/tilereg-cmd.cc b/crawl-ref/source/tilereg-cmd.cc index 42600fc07d..fdea7e093a 100644 --- a/crawl-ref/source/tilereg-cmd.cc +++ b/crawl-ref/source/tilereg-cmd.cc @@ -14,6 +14,8 @@ #include "enum.h" #include "libutil.h" #include "macro.h" +#include "misc.h" +#include "tiledef-dngn.h" #include "tiledef-icons.h" #include "tilepick.h" @@ -77,14 +79,11 @@ bool CommandRegion::update_tip_text(std::string& tip) if (item_idx >= m_items.size() || m_items[item_idx].empty()) return (false); - const int flag = m_items[item_idx].flag; - if (flag & TILEI_FLAG_INVALID) - tip = "This command is currently not available."; - else - { - // TODO: Map command -> action description. - tip = "[L-Click] Do this"; - } + // TODO: Map command -> action description. + const command_type cmd = (command_type) m_items[item_idx].idx; + tip = make_stringf("[L-Click] %s (%%)", + command_to_name(cmd).c_str()); + insert_commands(tip, cmd); // tip += "\n[R-Click] Describe"; @@ -110,6 +109,8 @@ void CommandRegion::pack_buffers() if (i >= (int)m_items.size()) break; + m_buf.add_dngn_tile(TILE_ITEM_SLOT, x, y); + InventoryTile &item = m_items[i++]; if (item.flag & TILEI_FLAG_INVALID) m_buf.add_icons_tile(TILEI_MESH, x, y); @@ -123,16 +124,26 @@ void CommandRegion::pack_buffers() } } -static bool _command_not_applicable(const command_type) +static bool _command_not_applicable(const command_type cmd) { - return (false); + switch (cmd) + { + case CMD_REST: + case CMD_EXPLORE: + case CMD_INTERLEVEL_TRAVEL: + return (!i_feel_safe(false)); + case CMD_DISPLAY_RELIGION: + return (you.religion == GOD_NO_GOD); + default: + return (false); + } } static const command_type _common_commands[] = { // action commands - CMD_REST, CMD_USE_ABILITY, CMD_PRAY, - CMD_EXPLORE, CMD_INTERLEVEL_TRAVEL, CMD_SEARCH_STASHES, + CMD_REST, CMD_EXPLORE, CMD_INTERLEVEL_TRAVEL, + CMD_USE_ABILITY, CMD_PRAY, CMD_SEARCH_STASHES, // informational commands CMD_REPLAY_MESSAGES, CMD_RESISTS_SCREEN, CMD_DISPLAY_OVERMAP, |