Merge develop

develop
Japa Illo 2017-06-24 11:00:14 +05:30
commit c9b5df8989
19 changed files with 110 additions and 46 deletions

@ -1,9 +1,12 @@
sudo: false
language: cpp
cache:
pip: true
directories:
- $HOME/lua53
addons:
apt:
packages: &default_packages
- lua5.2
- libxml-libxml-perl
- libxml-libxslt-perl
- zlib1g-dev:i386
@ -19,8 +22,10 @@ matrix:
- gcc-4.8-multilib
- g++-4.8-multilib
before_install:
pip install --user "sphinx==1.4" "requests[security]"
- pip install --user "sphinx==1.4" "requests[security]"
- sh travis/build-lua.sh
script:
- export PATH="$PATH:$HOME/lua53/bin"
- git tag tmp-travis-build
- sh travis/git-info.sh
- sphinx-build -qW -j3 . docs/html
@ -28,7 +33,7 @@ script:
- python travis/lint.py
- python travis/authors-rst.py
- python travis/script-docs.py
- python travis/script-syntax.py --ext=lua --cmd="luac5.2 -p" || true
- python travis/script-syntax.py --ext=lua --cmd="luac5.3 -p"
- python travis/script-syntax.py --ext=rb --cmd="ruby -c"
- mkdir build-travis
- cd build-travis

@ -15,5 +15,5 @@ If you're an end-user, modder, or interested in contributing to DFHack -
go read those docs.
If that's unclear or you need more help, try
[the Bay12 forums thread](http://www.bay12forums.com/smf/index.php?topic=139553)
[the Bay12 forums thread](http://www.bay12forums.com/smf/index.php?topic=164123)
or the #dfhack IRC channel on freenode.

@ -13,15 +13,14 @@ the `binpatch` command.
We recommend using a script or plugin instead of a raw patch if
at all possible - that way your work will work for many versions
across multiple operating systems. There's a reason nobody has
written patches since ``0.34.11``!
across multiple operating systems.
.. contents::
Getting a patch
===============
There are no binary patches available for Dwarf Fortress versions after 0.34.11
There are no binary patches available for Dwarf Fortress versions after 0.34.11.
This system is kept for the chance that someone will find it useful, so some
hints on how to write your own follow. This will require disassembly and
@ -29,7 +28,7 @@ decent skill in `memory research <contributing-memory-research>`.
* The patches are expected to be encoded in text format used by IDA.
* See :commit:`8a9e3d1a728` for examples.
* See `the patches folder in commit b0e1b51 <https://github.com/DFHack/dfhack/tree/b0e1b51d2ac08dd8c914f6ec299c5b355525a9aa/patches/>`_ for examples.
* :issue:`546` is about the future of the binpatches, and may be useful reading.

@ -104,7 +104,8 @@ of DFhack, rather than plugins or scripts.
.. contents::
:local:
.. _cls:
.. _alias:
alias
-----
@ -129,6 +130,9 @@ be passed to the underlying command in order. An example with `devel/print-args`
example
text
.. _cls:
cls
---
Clear the terminal. Does not delete command history.

@ -10,7 +10,7 @@ Most commands offered by plugins are listed here,
hopefully organised in a way you will find useful.
.. contents::
:depth: 2
:depth: 3
===============================
Data inspection and visualizers

@ -1486,7 +1486,9 @@ static const LuaWrapper::FunctionReg dfhack_gui_module[] = {
WRAPM(Gui, showZoomAnnouncement),
WRAPM(Gui, showPopupAnnouncement),
WRAPM(Gui, showAutoAnnouncement),
WRAPM(Gui, resetDwarfmodeView),
WRAPM(Gui, revealInDwarfmodeMap),
WRAPM(Gui, refreshSidebar),
WRAPM(Gui, getDepthAt),
{ NULL, NULL }
};

@ -148,6 +148,7 @@ namespace DFHack
DFHACK_EXPORT void resetDwarfmodeView(bool pause = false);
DFHACK_EXPORT bool revealInDwarfmodeMap(df::coord pos, bool center = false);
DFHACK_EXPORT bool refreshSidebar();
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);

@ -14,6 +14,8 @@ local world_map = df.global.world.map
AREA_MAP_WIDTH = 23
MENU_WIDTH = 30
refreshSidebar = dfhack.gui.refreshSidebar
function getPanelLayout()
local dims = dfhack.gui.getDwarfmodeViewDims()
local area_pos = df.global.ui_area_map_width

@ -109,6 +109,10 @@ function Pages:getSelected()
return self.selected, self.subviews[self.selected]
end
function Pages:getSelectedPage()
return self.subviews[self.selected]
end
----------------
-- Edit field --
----------------

@ -1594,6 +1594,26 @@ bool Gui::revealInDwarfmodeMap(df::coord pos, bool center)
return true;
}
bool Gui::refreshSidebar()
{
auto scr = getViewscreenByType<df::viewscreen_dwarfmodest>(0);
if (scr)
{
if (df::global::window_z && *df::global::window_z == 0)
{
scr->feed_key(interface_key::CURSOR_UP_Z);
scr->feed_key(interface_key::CURSOR_DOWN_Z);
}
else
{
scr->feed_key(interface_key::CURSOR_DOWN_Z);
scr->feed_key(interface_key::CURSOR_UP_Z);
}
return true;
}
return false;
}
bool Gui::getViewCoords (int32_t &x, int32_t &y, int32_t &z)
{
x = *df::global::window_x;

@ -1 +1 @@
Subproject commit 29ba19bf7a4bab69854c99135f3a66fcdb2227ed
Subproject commit 3322beb2e7f4b28ff8e573e9bec738c77026b8e9

@ -868,8 +868,7 @@ struct jobutils_hook : public df::viewscreen_dwarfmodest
void move_cursor(df::coord &pos)
{
Gui::setCursorCoords(pos.x, pos.y, pos.z);
send_key(interface_key::CURSOR_DOWN_Z);
send_key(interface_key::CURSOR_UP_Z);
Gui::refreshSidebar();
}
void move_cursor(coord32_t &pos)

@ -107,8 +107,7 @@ struct buildingplan_hook : public df::viewscreen_dwarfmodest
planmode_enabled[type] = !planmode_enabled[type];
if (!planmode_enabled[type])
{
send_key(interface_key::CURSOR_DOWN_Z);
send_key(interface_key::CURSOR_UP_Z);
Gui::refreshSidebar();
planner.in_dummmy_screen = false;
}
return true;
@ -140,8 +139,7 @@ struct buildingplan_hook : public df::viewscreen_dwarfmodest
{
if (ui_build_selector->errors.size() == 0 && planner.allocatePlannedBuilding(type))
{
send_key(interface_key::CURSOR_DOWN_Z);
send_key(interface_key::CURSOR_UP_Z);
Gui::refreshSidebar();
if (planner.inQuickFortMode())
{
planner.in_dummmy_screen = true;

@ -147,8 +147,7 @@ static void send_key(const df::interface_key &key)
static void move_cursor(df::coord &pos)
{
Gui::setCursorCoords(pos.x, pos.y, pos.z);
send_key(interface_key::CURSOR_DOWN_Z);
send_key(interface_key::CURSOR_UP_Z);
Gui::refreshSidebar();
}
static void open_stats_srceen();

@ -507,16 +507,7 @@ struct mousequery_hook : public df::viewscreen_dwarfmodest
return;
Gui::setCursorCoords(mpos.x, mpos.y, mpos.z);
if (mpos.z == 0)
{
sendKey(interface_key::CURSOR_UP_Z);
sendKey(interface_key::CURSOR_DOWN_Z);
}
else
{
sendKey(interface_key::CURSOR_DOWN_Z);
sendKey(interface_key::CURSOR_UP_Z);
}
Gui::refreshSidebar();
}
bool inBuildPlacement()

@ -981,8 +981,7 @@ public:
void move_cursor(const df::coord &pos)
{
Gui::setCursorCoords(pos.x, pos.y, pos.z);
send_key(interface_key::CURSOR_DOWN_Z);
send_key(interface_key::CURSOR_UP_Z);
Gui::refreshSidebar();
}
void send_key(const df::interface_key &key)

@ -52,20 +52,7 @@ struct stable_cursor_hook : df::viewscreen_dwarfmodest
last_cursor.isValid() && cur_cursor.isValid())
{
Gui::setCursorCoords(last_cursor.x, last_cursor.y, last_cursor.z);
// Force update of ui state
set<df::interface_key> tmp;
if (last_cursor.z < 2)
tmp.insert(interface_key::CURSOR_UP_Z);
else
tmp.insert(interface_key::CURSOR_DOWN_Z);
INTERPOSE_NEXT(feed)(&tmp);
tmp.clear();
if (last_cursor.z < 2)
tmp.insert(interface_key::CURSOR_DOWN_Z);
else
tmp.insert(interface_key::CURSOR_UP_Z);
INTERPOSE_NEXT(feed)(&tmp);
Gui::refreshSidebar();
}
else if (!is_default && cur_cursor.isValid())
{

@ -1 +1 @@
Subproject commit d461a8417260cba96db7028ef0602a787e48274b
Subproject commit 1ba8f81cacefba76bc97a56b2683e2002ee31ff4

@ -0,0 +1,54 @@
#!/bin/sh
set -e
LUA_ROOT="$HOME/lua53"
LUA_URL="http://www.lua.org/ftp/lua-5.3.3.tar.gz"
LUA_TAR=$(basename "$LUA_URL")
LUA_DIR="$LUA_ROOT/${LUA_TAR%.tar.*}"
LUA_SHA1="a0341bc3d1415b814cc738b2ec01ae56045d64ef"
echo LUA_ROOT $LUA_ROOT
echo LUA_TAR $LUA_TAR
echo LUA_DIR $LUA_DIR
sha1() {
python -c 'import hashlib, sys; print(hashlib.sha1(open(sys.argv[1],"rb").read()).hexdigest())' "$1"
}
download() {
echo "Downloading $LUA_URL"
wget -O "$LUA_ROOT/$LUA_TAR" "$LUA_URL"
tar xvf "$LUA_ROOT/$LUA_TAR"
}
build() {
cd "$LUA_DIR/src"
make generic
}
main() {
mkdir -p "$LUA_ROOT"
cd "$LUA_ROOT"
mkdir -p bin
if [ "$(sha1 "$LUA_ROOT/$LUA_TAR" 2>/dev/null)" != "$LUA_SHA1" ]; then
download
build
else
echo "Already downloaded"
if [ -x "$LUA_DIR/src/luac" ]; then
echo "Already built"
else
build
fi
fi
echo "Linking"
ln -sf "$LUA_DIR/src/lua" "$LUA_ROOT/bin/lua5.3"
ln -sf "$LUA_DIR/src/luac" "$LUA_ROOT/bin/luac5.3"
echo "Done"
}
main