diff options
author | Raphael Langella <raphael.langella@gmail.com> | 2011-01-08 00:48:05 +0100 |
---|---|---|
committer | Raphael Langella <raphael.langella@gmail.com> | 2011-01-08 00:48:05 +0100 |
commit | 992a0ca00dcb1cf33bcee7c013a7a5037d9e07b1 (patch) | |
tree | c09a29cbcf21f0ac27b7a58f3b267a2ea6fbfe65 /crawl-ref/source/tilereg-tab.cc | |
parent | 7499eb241985446946244349949b532118a7f2dc (diff) | |
download | crawl-ref-992a0ca00dcb1cf33bcee7c013a7a5037d9e07b1.tar.gz crawl-ref-992a0ca00dcb1cf33bcee7c013a7a5037d9e07b1.zip |
Add a tile_layout_priority option.
Fully customizable detached tabs. It is even possible to detach the skill
and memorisation tabs. I haven't put it in the documentation as it is quite
useless and the text is already quite long.
I also put a TAG_MAJOR_VERSION condition in the skill enum so NUM_SKILL
actually does give the number of skills in the next major bumb.
Diffstat (limited to 'crawl-ref/source/tilereg-tab.cc')
-rw-r--r-- | crawl-ref/source/tilereg-tab.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/crawl-ref/source/tilereg-tab.cc b/crawl-ref/source/tilereg-tab.cc index db63904fc4..59a44a3233 100644 --- a/crawl-ref/source/tilereg-tab.cc +++ b/crawl-ref/source/tilereg-tab.cc @@ -103,6 +103,14 @@ GridRegion *TabbedRegion::get_tab_region(int idx) return (m_tabs[idx].reg); } +tileidx_t TabbedRegion::get_tab_tile(int idx) +{ + if (invalid_index(idx)) + return (NULL); + + return (m_tabs[idx].tile_tab); +} + void TabbedRegion::activate_tab(int idx) { if (invalid_index(idx)) @@ -347,4 +355,18 @@ bool TabbedRegion::update_alt_text(std::string &alt) return (get_tab_region(active_tab())->update_alt_text(alt)); } +int TabbedRegion::find_tab(std::string tab_name) const +{ + lowercase(tab_name); + std::string pluralised_name = tab_name + "s"; + for (int i = 0, size = m_tabs.size(); i < size; ++i) + { + std::string reg_name = lowercase_string(m_tabs[i].reg->name()); + if (tab_name == reg_name || pluralised_name == reg_name) + return i; + } + + return -1; +} + #endif |