summaryrefslogtreecommitdiff
path: root/library/include
diff options
context:
space:
mode:
authorAlexander Gavrilov2012-09-20 11:11:20 +0400
committerAlexander Gavrilov2012-09-20 11:11:20 +0400
commitc39a33722316ee91f7a42abcd76149788dd19196 (patch)
treee057fabb61758db013f91f633ca5a97bbbd166a2 /library/include
parent7ce772ae0ea69ab26009a27d71bd681382ecfac7 (diff)
downloaddfhack-c39a33722316ee91f7a42abcd76149788dd19196.tar.gz
dfhack-c39a33722316ee91f7a42abcd76149788dd19196.tar.bz2
dfhack-c39a33722316ee91f7a42abcd76149788dd19196.tar.xz
Add unit/item/job/building getter hook vmethods to dfhack_viewscreen.
Diffstat (limited to 'library/include')
-rw-r--r--library/include/modules/Screen.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/library/include/modules/Screen.h b/library/include/modules/Screen.h
index 4f47205f..fdad6c8a 100644
--- a/library/include/modules/Screen.h
+++ b/library/include/modules/Screen.h
@@ -33,6 +33,14 @@ distribution.
#include "df/graphic.h"
#include "df/viewscreen.h"
+namespace df
+{
+ struct job;
+ struct item;
+ struct unit;
+ struct building;
+}
+
/**
* \defgroup grp_screen utilities for painting to the screen
* @ingroup grp_screen
@@ -134,6 +142,7 @@ namespace DFHack
virtual ~dfhack_viewscreen();
static bool is_instance(df::viewscreen *screen);
+ static dfhack_viewscreen *try_cast(df::viewscreen *screen);
virtual void logic();
virtual void render();
@@ -146,6 +155,10 @@ namespace DFHack
virtual std::string getFocusString() = 0;
virtual void onShow() {};
virtual void onDismiss() {};
+ virtual df::unit *getSelectedUnit() { return NULL; }
+ virtual df::item *getSelectedItem() { return NULL; }
+ virtual df::job *getSelectedJob() { return NULL; }
+ virtual df::building *getSelectedBuilding() { return NULL; }
};
class DFHACK_EXPORT dfhack_lua_viewscreen : public dfhack_viewscreen {
@@ -178,5 +191,10 @@ namespace DFHack
virtual void onShow();
virtual void onDismiss();
+
+ virtual df::unit *getSelectedUnit();
+ virtual df::item *getSelectedItem();
+ virtual df::job *getSelectedJob();
+ virtual df::building *getSelectedBuilding();
};
}