diff options
author | Enne Walker <ennewalker@users.sourceforge.net> | 2010-02-14 21:35:45 -0500 |
---|---|---|
committer | Enne Walker <ennewalker@users.sourceforge.net> | 2010-02-14 21:39:40 -0500 |
commit | 05e7cb035ba44034e69b23aa4c97720ecd7f8139 (patch) | |
tree | d2524cbf99b9051871c4b9f5d22fdb476a0c6064 /crawl-ref/source/tilereg.h | |
parent | 940c3c2e79ca5b9cafed39b67eb8ec9a19f728c5 (diff) | |
download | crawl-ref-05e7cb035ba44034e69b23aa4c97720ecd7f8139.tar.gz crawl-ref-05e7cb035ba44034e69b23aa4c97720ecd7f8139.zip |
Generalize tab activation and tip text.
These are now virtual functions so that TabbedRegion can remain agnostic
of what regions it contains.
Diffstat (limited to 'crawl-ref/source/tilereg.h')
-rw-r--r-- | crawl-ref/source/tilereg.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/crawl-ref/source/tilereg.h b/crawl-ref/source/tilereg.h index 317c2f9e0f..3c00c40e9b 100644 --- a/crawl-ref/source/tilereg.h +++ b/crawl-ref/source/tilereg.h @@ -343,6 +343,8 @@ public: void place_cursor(const coord_def &cursor); virtual const std::string name() const = 0; + virtual bool update_tab_tip_text(std::string &tip, bool active) = 0; + virtual void activate() = 0; protected: virtual void pack_buffers() = 0; @@ -375,6 +377,7 @@ public: virtual void update(); virtual int handle_mouse(MouseEvent &event); virtual bool update_tip_text(std::string &tip); + virtual bool update_tab_tip_text(std::string &tip, bool active); virtual bool update_alt_text(std::string &alt); virtual const std::string name() const { return "Inventory"; } @@ -382,6 +385,7 @@ public: protected: virtual void pack_buffers(); virtual void draw_tag(); + virtual void activate(); }; class SpellRegion : public GridRegion @@ -393,6 +397,7 @@ public: virtual void update(); virtual int handle_mouse(MouseEvent &event); virtual bool update_tip_text(std::string &tip); + virtual bool update_tab_tip_text(std::string &tip, bool active); virtual bool update_alt_text(std::string &alt); virtual bool check_memorise(); @@ -403,6 +408,7 @@ protected: virtual void pack_buffers(); virtual void draw_tag(); + virtual void activate(); }; class MemoriseRegion : public SpellRegion @@ -414,11 +420,13 @@ public: virtual void update(); virtual int handle_mouse(MouseEvent &event); virtual bool update_tip_text(std::string &tip); + virtual bool update_tab_tip_text(std::string &tip, bool active); virtual const std::string name() const { return "Memorisation"; } protected: virtual void draw_tag(); + virtual void activate(); }; // A region that contains multiple region, selectable by tabs. @@ -442,6 +450,7 @@ public: virtual void on_resize(); virtual int handle_mouse(MouseEvent &event); virtual bool update_tip_text(std::string &tip); + virtual bool update_tab_tip_text(std::string &tip, bool active); virtual bool update_alt_text(std::string &alt); virtual const std::string name() const { return ""; } @@ -449,6 +458,7 @@ public: protected: virtual void pack_buffers(); virtual void draw_tag(); + virtual void activate() {} bool active_is_valid() const; // Returns the tab the mouse is over, -1 if none. |