summaryrefslogtreecommitdiff
path: root/library/include
diff options
context:
space:
mode:
authorAlexander Gavrilov2012-09-02 14:10:58 +0400
committerAlexander Gavrilov2012-09-02 14:10:58 +0400
commit3713c5ea9eaab262be1d08a92781f62bbb6cf95a (patch)
tree473208e4f48d20b52d12be37491ef1bf9b78a92b /library/include
parentfebfc9aa5b87928432060c9c55f2710a2a6201cc (diff)
downloaddfhack-3713c5ea9eaab262be1d08a92781f62bbb6cf95a.tar.gz
dfhack-3713c5ea9eaab262be1d08a92781f62bbb6cf95a.tar.bz2
dfhack-3713c5ea9eaab262be1d08a92781f62bbb6cf95a.tar.xz
Add some APIs required by steam engine to the core.
Diffstat (limited to 'library/include')
-rw-r--r--library/include/modules/Gui.h19
-rw-r--r--library/include/modules/Maps.h6
2 files changed, 25 insertions, 0 deletions
diff --git a/library/include/modules/Gui.h b/library/include/modules/Gui.h
index 58f22241..97e8bd42 100644
--- a/library/include/modules/Gui.h
+++ b/library/include/modules/Gui.h
@@ -32,6 +32,7 @@ distribution.
#include "DataDefs.h"
#include "df/init.h"
#include "df/ui.h"
+#include "df/announcement_type.h"
namespace df {
struct viewscreen;
@@ -92,14 +93,32 @@ namespace DFHack
// Show a plain announcement, or a titan-style popup message
DFHACK_EXPORT void showAnnouncement(std::string message, int color = 7, bool bright = true);
+ DFHACK_EXPORT void showZoomAnnouncement(df::announcement_type type, df::coord pos, std::string message, int color = 7, bool bright = true);
DFHACK_EXPORT void showPopupAnnouncement(std::string message, int color = 7, bool bright = true);
+ // Show an announcement with effects determined by announcements.txt
+ DFHACK_EXPORT void showAutoAnnouncement(df::announcement_type type, df::coord pos, std::string message, int color = 7, bool bright = true);
+
/*
* Cursor and window coords
*/
DFHACK_EXPORT df::coord getViewportPos();
DFHACK_EXPORT df::coord getCursorPos();
+ static const int AREA_MAP_WIDTH = 23;
+ static const int MENU_WIDTH = 30;
+
+ struct DwarfmodeDims {
+ int map_x1, map_x2, menu_x1, menu_x2, area_x1, area_x2;
+ int y1, y2;
+ bool menu_on, area_on, menu_forced;
+ };
+
+ DFHACK_EXPORT DwarfmodeDims getDwarfmodeViewDims();
+
+ DFHACK_EXPORT void resetDwarfmodeView(bool pause = false);
+ DFHACK_EXPORT bool revealInDwarfmodeMap(df::coord pos, bool center = false);
+
DFHACK_EXPORT bool getViewCoords (int32_t &x, int32_t &y, int32_t &z);
DFHACK_EXPORT bool setViewCoords (const int32_t x, const int32_t y, const int32_t z);
diff --git a/library/include/modules/Maps.h b/library/include/modules/Maps.h
index e6e9682e..984cf16c 100644
--- a/library/include/modules/Maps.h
+++ b/library/include/modules/Maps.h
@@ -50,6 +50,7 @@ distribution.
#include "df/tile_dig_designation.h"
#include "df/tile_traffic.h"
#include "df/feature_init.h"
+#include "df/flow_type.h"
/**
* \defgroup grp_maps Maps module and its types
@@ -232,6 +233,9 @@ extern DFHACK_EXPORT void getSize(uint32_t& x, uint32_t& y, uint32_t& z);
/// get the position of the map on world map
extern DFHACK_EXPORT void getPosition(int32_t& x, int32_t& y, int32_t& z);
+extern DFHACK_EXPORT bool isValidTilePos(int32_t x, int32_t y, int32_t z);
+inline bool isValidTilePos(df::coord pos) { return isValidTilePos(pos.x, pos.y, pos.z); }
+
/**
* Get the map block or NULL if block is not valid
*/
@@ -272,6 +276,8 @@ inline df::coord2d getTileBiomeRgn(df::coord pos) {
// Enables per-frame updates for liquid flow and/or temperature.
DFHACK_EXPORT void enableBlockUpdates(df::map_block *blk, bool flow = false, bool temperature = false);
+DFHACK_EXPORT df::flow_info *spawnFlow(df::coord pos, df::flow_type type, int mat_type = 0, int mat_index = -1, int density = 100);
+
/// sorts the block event vector into multiple vectors by type
/// mineral veins, what's under ice, blood smears and mud
extern DFHACK_EXPORT bool SortBlockEvents(df::map_block *block,