Merge remote-tracking branch 'main_repository/develop' into work_orders_manager_enhancement

develop
Mikhail Panov 2023-09-22 18:30:21 +03:00
commit 9c866d5134
22 changed files with 239 additions and 192 deletions

@ -92,13 +92,6 @@ jobs:
repository: ${{ inputs.structures_ref && github.repository || 'DFHack/df-structures' }}
ref: ${{ inputs.structures_ref }}
path: library/xml
- name: Clone structures (temporary override)
if: '!inputs.structures_ref'
uses: actions/checkout@v3
with:
repository: DFHack/df-structures
ref: refs/heads/linux
path: library/xml
- name: Fetch ccache
if: inputs.platform-files
uses: actions/cache/restore@v3

@ -7,8 +7,8 @@ cmake_policy(SET CMP0074 NEW)
project(dfhack)
# set up versioning.
set(DF_VERSION "50.09")
set(DFHACK_RELEASE "r4")
set(DF_VERSION "50.10")
set(DFHACK_RELEASE "r1")
set(DFHACK_PRERELEASE FALSE)
set(DFHACK_VERSION "${DF_VERSION}-${DFHACK_RELEASE}")

Before

Width:  |  Height:  |  Size: 997 B

After

Width:  |  Height:  |  Size: 997 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

@ -1431,7 +1431,7 @@ doors/farming_doors
,,c,c,c,c,c,c,c,c,c,,,,`,,`,,,,c,c,c,c,c,c,c,c,c
,,c,c,c,c,c,c,c,c,,,c,`,`,`,`,`,c,,,c,c,c,c,c,c,c,c
,,c,c,c,c,c,c,c,c,,"c{name=""Unprepared fish"" take_from=""Starting food""}:+unpreparedfish",c,,,`,,,"c{name=""Rawhides"" take_from=""Starting cloth/trash""}:+rawhides",c,,c,c,c,c,c,c,c,c
,,c,c,c,c,c,c,c,,,c,c,,"c{name=""Refuse feeder"" give_to=""Rawhides"" take_from=""Starting cloth/trash""}:+cat_refuse/type(1x3)","y{name=""Corpse feeder"" take_from=""Starting cloth/trash""}:+cat_refuse/corpses,bodyparts(2x3)",~,,c,c,,,c,c,c,c,c,c,c
,,c,c,c,c,c,c,c,,,c,c,,"c{name=""Refuse feeder"" give_to=""Rawhides"" take_from=""Starting cloth/trash""}:+cat_refuse/type(1x3)","y2{name=""Corpse feeder"" take_from=""Starting cloth/trash""}:+cat_refuse/corpses,bodyparts(2x3)",~,,c,c,,,c,c,c,c,c,c,c
,,c,c,c,c,c,c,c,,`,`,`,,~,~,~,,`,`,`,,c,c,c,c,c,c,c
,,c,c,c,c,c,c,c,,`,`,`,,~,~,~,,`,`,`,,c,c,c,c,c,c,c
,,c,c,c,c,c,c,c,,`,`,`,,,`,,,`,`,`,,c,c,c,c,c,c,c
@ -1687,7 +1687,7 @@ build2/industry_build2
,,w,`,`,`,`,`,`,"w{name=""Wood feeder""}(2x5)",,"g{name=""Goods feeder"" containers=0}:+cat_food/tallow+wax-crafts-goblets(3x3)",,`,,`,`,`,`,`,,"hlS{name=""Cloth/bones feeder"" containers=0}:+cat_refuse/skulls/,bones/,hair/,shells/,teeth/,horns/-adamantinethread(5x5)",,,~,~,`,`,`,`,`,`,c
,,w,`,`,`,`,`,`,~,~,~,~,~,`,`,,,,`,`,~,~,~,~,~,`,`,`,`,`,`,c
,,`,`,`,`,`,"c{name=""Goods/wood quantum"" quantum=true give_to=""Pots,Barrels,Jugs,Bags,Seeds feeder""}:+all",`,~,~,~,~,~,,`,,`,,`,,~,~,~,~,~,`,"r{name=""Cloth/bones quantum"" quantum=true}:+all",`,`,`,`,c
,,"c{name=""Lye"" barrels=0}:+miscliquid",`,`,`,`,`,`,~,~,"u{name=""Furniture feeder""}:-sand(3x2)",~,~,`,`,,,,`,`,~,~,~,~,~,`,`,`,`,`,`,c
,,"c{name=""Lye"" barrels=0}:+miscliquid",`,`,`,`,`,`,~,~,"u2{name=""Furniture feeder""}:-sand(3x2)",~,~,`,`,,,,`,`,~,~,~,~,~,`,`,`,`,`,`,c
,,c,`,`,`,`,`,`,~,~,~,~,~,,`,`,`,`,`,,~,~,~,~,~,`,`,`,`,`,`,c
,,c,`,`,`,`,`,`,`,`,`,`,`,,,`,,`,,,`,`,`,`,`,`,`,`,`,`,`,c
,,c,`,`,`,`,`,`,`,`,`,`,`,`,"bnpdz{name=""Bar/military feeder"" containers=0}:-potash+adamantinethread(5x3)",,,,~,`,`,`,`,`,`,`,`,`,`,`,`,c

Can't render this file because it has a wrong number of fields in line 53.

@ -45,67 +45,75 @@ Here are some common tasks people use DFHack tools to accomplish:
- Quickly scan the map for visible ores of specific types so you can focus
your mining efforts
Some tools are one-shot commands. For example, you can run `unforbid all <unforbid>`
to claim all (reachable) items on the map after a messy siege.
Other tools must be `enabled <enable>` and then they will run in the background.
For example, `enable seedwatch <seedwatch>` will start monitoring your stocks of
seeds and prevent your chefs from cooking seeds that you need for planting.
Tools that are enabled in the context of a fort will save their state with that
fort, and they will remember that they are enabled the next time you load your save.
A third class of tools add information to the screen or provide new integrated
functionality via the DFHack `overlay` framework. For example, the `unsuspend`
tool, in addition to its basic function of unsuspending all building construction
jobs, can also overlay a marker on suspended buildings to indicate that they are
suspended (and will use different markers to tell you whether this is a problem).
Some tools are one-shot commands. For example, you can run
`unforbid all <unforbid>` to claim all (reachable) items on the map after a
messy siege.
Other tools must be `enabled <enable>` once and then they will run in the
background. For example, once enabled, `seedwatch` will start monitoring your
stocks of seeds and prevent your chefs from cooking seeds that you need for
planting. Tools that are enabled in the context of a fort will save their state
with that fort, and they will remember that they are enabled the next time you
load your save.
A third class of tools adds information to the screen or provides new integrated
functionality via the DFHack `overlay` framework. For example, the `sort` tool
adds widgets to the squad member selection screen that allow you to search,
sort, and filter the list of military candidates. You don't have to run any
command to get the benefits of the tool, it appears automatically when you're
on the relevant screen.
How can I figure out which commands to run?
-------------------------------------------
There are several ways to scan DFHack tools and find the ones you need right now.
There are several ways to scan DFHack tools and find the ones you need right
now.
The first place to check is the DFHack logo hover hotspot. It's in the upper
left corner of the screen by default, though you can move it anywhere you want
with the `gui/overlay` configuration UI.
The first place to check is the DFHack logo menu. It's in the upper left corner
of the screen by default, though you can move it anywhere you want with the
`gui/overlay` configuration UI.
When you hover the mouse over the logo (or hit the Ctrl-Shift-C keyboard shortcut)
a list of DFHack tools relevant to the current context comes up. For example, when
you have a unit selected, the hotspot will show a list of tools that inspect
units, allow you to edit them, or maybe even teleport them. Next to each tool,
you'll see the hotkey you can hit to invoke the command without even opening the
hover list.
When you click on the logo (or hit the Ctrl-Shift-C keyboard shortcut), a short
list of popular, relevant DFHack tools comes up. These are the tools that have
been assigned hotkeys that are active in the current context. For example, when
you're looking at a fort map, the list will contain fortress design tools like
`gui/quickfort` and `gui/design`. You can click on the tools in the list, or
note the hotkeys listed next to them and maybe use them to launch the tool next
time without even opening the logo menu.
The second place to check is the DFHack control panel: `gui/control-panel`. It
will give you an overview of which tools are currently enabled, and will allow
you to toggle them on or off, see help text for them, or launch their dedicated
configuration UIs. You can open the control panel from anywhere with the
Ctrl-Shift-E hotkey or by selecting it from the logo hover list.
Ctrl-Shift-E hotkey or by selecting it from the logo menu list.
In the control panel, you can also select which tools you'd like to be
automatically enabled when you start a new fort. There are also system settings
you can change, like whether DFHack windows will pause the game when they come
up.
Finally, you can explore the full extent of the DFHack catalog in `gui/launcher`,
which is always listed first in the DFHack logo hover list. You can also bring up
the launcher by tapping the backtick key (\`) or hitting Ctrl-Shift-D. In the
launcher, you can quickly autocomplete any command name by selecting it in the
list on the right side of the window. Commands are ordered by how often you run
them, so your favorite commands will always be on top. You can also pull full
commandlines out of your history with Alt-S or by clicking on the "history search"
hotkey hint.
Once you have typed (or autocompleted, or searched for) a command, other commands
related to the one you have selected will appear in the right-hand panel. Scanning
through that list is a great way to learn about new tools that you might find
useful. You can also see how commands are grouped by running the `tags` command.
automatically enabled and popular commands you'd like to run when you start a
new fort. On the "Preferences" tab, there are settings you can change, like
whether you want to limit DFHack functionality to interface improvements,
bugfixes, and productivity tools, hiding the god-mode tools ("mortal mode") or
whether you want DFHack windows to pause the game when they come up.
Finally, you can explore the full extent of the DFHack catalog in
`gui/launcher`, which is always listed first in the DFHack logo menu list. You
can also bring up the launcher by tapping the backtick key (\`) or hitting
Ctrl-Shift-D. In the launcher, you can quickly autocomplete any command name by
selecting it in the list on the right side of the window. Commands are ordered
by how often you run them, so your favorite commands will always be on top. You
can also pull full commandlines out of your history with Alt-S or by clicking
on the "history search" hotkey hint.
Once you have typed (or autocompleted, or searched for) a command, other
commands related to the one you have selected will appear in the right-hand
panel. Scanning through that list is a great way to learn about new tools that
you might find useful. You can also see how commands are grouped by running the
`tags` command.
The bottom panel will show the full help text for the command you are running,
allowing you to refer to the usage documentation and examples when you are typing
your command. After you run a command, the bottom panel switches to command output
mode, but you can get back to the help text by hitting Ctrl-T or clicking on the
``Help`` tab.
allowing you to refer to the usage documentation and examples when you are
typing your command. After you run a command, the bottom panel switches to
command output mode, but you can get back to the help text by hitting Ctrl-T or
clicking on the ``Help`` tab.
How do DFHack in-game windows work?
-----------------------------------
@ -122,84 +130,88 @@ you type at the keyboard. Hit Esc or right click to close the window or cancel
the current action. You can click anywhere on the screen that is not a DFHack
window to unfocus the window and let it just sit in the background. It won't
respond to key presses or mouse clicks until you click on it again to give it
focus. If no DFHack windows are focused, you can right click directly on a window
to close it without left clicking to focus it first.
focus. If no DFHack windows are focused, you can right click directly on a
window to close it without left clicking to focus it first.
DFHack windows are draggable from the title bar or from anywhere on the window
that doesn't have a mouse-clickable widget on it. Many are resizable as well
(if the tool window has components that can reasonably be resized).
You can generally use DFHack tools without interrupting the game. That is, if the
game is unpaused, it can continue to run while a DFHack window is open. If configured
to do so in `gui/control-panel`, tools will initially pause the game to let you
focus on the task at hand, but you can unpause like normal if you want. You can
also interact with the map, scrolling it with the keyboard or mouse and selecting
units, buildings, and items. Some tools will intercept all mouse clicks to allow
you to select regions on the map. When these tools have focus, you will not be able
to use the mouse to interact with map elements or pause/unpause the game. Therefore,
these tools will pause the game when they open, regardless of your settings in
`gui/control-panel`. You can still unpause with the keyboard (spacebar by default),
though.
You can generally use DFHack tools without interrupting the game. That is, if
the game is unpaused, it can continue to run while a DFHack window is open. If
configured to do so in `gui/control-panel`, tools will initially pause the game
to let you focus on the task at hand, but you can unpause like normal if you
want. You can also interact with the map, scrolling it with the keyboard or
mouse and selecting units, buildings, and items. Some tools will intercept all
mouse clicks to allow you to select regions of the map. When these tools have
focus, you will not be able to use the mouse to interact with map elements or
pause/unpause the game. Therefore, these tools will pause the game when they
open, regardless of your settings in `gui/control-panel`. You can still unpause
with the keyboard (spacebar by default), though.
Where do I go next?
-------------------
To recap:
You can get to popular, relevant tools for the current context by hovering
the mouse over the DFHack logo or by hitting Ctrl-Shift-C.
You can get to popular, relevant tools for the current context by clicking on
the DFHack logo or by hitting Ctrl-Shift-C.
You can enable DFHack tools and configure settings with `gui/control-panel`,
which you can access directly with the Ctrl-Shift-E hotkey.
which you can open from the DFHack logo or access directly with the
Ctrl-Shift-E hotkey.
You can get to the launcher and its integrated autocomplete, history search,
and help text by hitting backtick (\`) or Ctrl-Shift-D, or, of course, by
running it from the logo hover list.
running it from the logo menu list.
With those three interfaces, you have the complete DFHack tool suite at your
fingertips. So what to run first? Here are a few commands to get you started.
You can run them all from the launcher.
fingertips. So what to run first? Here are a few examples to get you started.
First, let's import some useful manager orders to keep your fort stocked with
basic necessities. Run ``orders import library/basic``. If you go to your
manager orders screen, you can see all the orders that have been created for you.
Note that you could have imported the orders directly from this screen as well,
using the DFHack `overlay` widget at the bottom of the manager orders panel.
Next, try setting up `autochop` to automatically designate trees for chopping when
you get low on usable logs. Run `gui/control-panel` and select ``autochop`` in the
``Fort`` list. Click on the button to the left of the name or hit Enter to enable
it. You can then click on the configure button (the gear icon) to launch
`gui/autochop` if you'd like to customize its settings. If you have the extra
screen space, you can go ahead and set the `gui/autochop` window to minimal mode
(click on the hint near the upper right corner of the window or hit Alt-M) and
click on the map so the window loses keyboard focus. As you play the game, you can
glance at the live status panel to check on your stocks of wood.
Finally, let's do some fort design copy-pasting. Go to some bedrooms that you have
set up in your fort. Run `gui/blueprint`, set a name for your blueprint by
clicking on the name field (or hitting the 'n' hotkey), typing "rooms" (or whatever)
and hitting Enter to set. Then draw a box around the target area by clicking with
the mouse. When you select the second corner, the blueprint will be saved to your
``blueprints`` subfolder.
Now open up `gui/quickfort`. You can search for the blueprint you just created by
typing its name, but it should be up near the top already. If you copied a dug-out
area with furniture in it, your blueprint will have two labels: "/dig" and "/build".
Click on the "/dig" blueprint or select it with the keyboard arrow keys and hit Enter.
You can rotate or flip the blueprint around if you need to with the transform hotkeys.
You'll see a preview of where the blueprint will be applied as you move the mouse
cursor around the map. Red outlines mean that the blueprint may fail to fully apply
at that location, so be sure to choose a spot where all the preview tiles are shown
with green diamonds. Click the mouse or hit Enter to apply the blueprint and
designate the tiles for digging. Your dwarves will come and dig it out as if you
had designated the tiles yourself.
Once the area is dug out, run `gui/quickfort` again and select the "/build" blueprint
this time. Apply the blueprint in the dug-out area, and your furniture will be
designated. It's just that easy! Note that `quickfort` uses `buildingplan` to place
buildings, so you don't even need to have the relevant furniture or building
materials in stock. The planned furniture/buildings will get built whenever you are
able to produce the building materials.
manager orders screen, you can see all the orders that have been created for
you. Note that you could have imported the orders directly from this screen as
well, using the DFHack `overlay` widget at the bottom of the manager orders
panel.
Next, try setting up `autochop` to automatically designate trees for chopping
when you get low on usable logs. Run `gui/control-panel` and select
``autochop`` in the ``Fort`` list. Click on the button to the left of the name
or hit Enter to enable it. You can then click on the configure button (the gear
icon) to launch `gui/autochop` if you'd like to customize its settings. If you
have the extra screen space, you can go ahead and set the `gui/autochop` window
to minimal mode (click on the hint near the upper right corner of the window or
hit Alt-M) and click on the map so the window loses keyboard focus. As you play
the game, you can glance at the live status panel to check on your stocks of
wood.
Finally, let's do some fort design copy-pasting. Go to some bedrooms that you
have set up in your fort. Run `gui/blueprint`, set a name for your blueprint by
clicking on the name field (or hitting the 'n' hotkey), typing "rooms" (or
whatever) and hitting Enter to set. Then draw a box around the target area by
clicking with the mouse. When you select the second corner, the blueprint will
be saved to your ``dfhack-config/blueprints`` subfolder.
Now open up `gui/quickfort`. You can search for the blueprint you just created
by typing its name, but it should be up near the top already. If you copied a
dug-out area with furniture in it, your blueprint will have two labels: "/dig"
and "/build". Click on the "/dig" blueprint or select it with the keyboard
arrow keys and hit Enter. You can rotate or flip the blueprint around if you
need to with the transform hotkeys. You'll see a preview of where the blueprint
will be applied as you move the mouse cursor around the map. Red outlines mean
that the blueprint may fail to fully apply at that location, so be sure to
choose a spot where all the preview tiles are shown with green diamonds. Click
the mouse or hit Enter to apply the blueprint and designate the tiles for
digging. Your dwarves will come and dig it out as if you had designated the
tiles yourself.
Once the area is dug out, run `gui/quickfort` again and select your "/build"
blueprint this time. Hit ``o`` to generate manager orders for the required
furniture. Apply the blueprint in the dug-out area, and your furniture will be
designated. It's just that easy! Note that `quickfort` uses `buildingplan` to
place buildings, so you don't even need to have the relevant furniture or
building materials in stock yet. The planned furniture/buildings will get built
whenever you are able to produce the building materials.
There are many, many more tools to explore. Have fun!

@ -83,6 +83,7 @@ Herwig Hochleitner bendlas
Hevlikn Hevlikn
Ian S kremlin-
IndigoFenix
Jacek Konieczny Jajcus
James 20k
James Gilles kazimuth
James Logsdon jlogsdon

@ -67,6 +67,12 @@ Template for new versions:
## Removed
# 50.10-r1
## Fixes
- Linux launcher: allow Steam Overlay and game streaming to function
- `autobutcher`: don't ignore semi-wild units when marking units for slaughter
# 50.09-r4
## New Features

@ -19,14 +19,17 @@ Usage
Menu overlay widget
-------------------
The in-game hotkeys menu is registered with the `overlay` framework and can be
enabled as a hotspot in the upper-left corner of the screen. You can bring up
the menu by hovering the mouse cursor over the hotspot and can select a command
to run from the list by clicking on it with the mouse or by using the keyboard
to select a command with the arrow keys and hitting :kbd:`Enter`.
The in-game hotkeys menu is registered with the `overlay` framework and appears
as a DFHack logo in the upper-left corner of the screen. You can bring up the
menu by clicking on the logo or by hitting the global :kbd:`Ctrl`:kbd:`Shift`:kbd:`c` hotkey. You can select a command to run from
the list by clicking on it with the mouse or by using the keyboard to select a
command with the arrow keys and hitting :kbd:`Enter`.
The menu closes automatically when an action is taken or when you click or
right click anywhere else on the screen.
A short description of the command will appear in a nearby textbox. If you'd
like to see the full help text for the command or edit the command before
running, you can open it for editing in `gui/launcher` by right clicking on the
running, you can open it for editing in `gui/launcher` by shift clicking on the
command, left clicking on the arrow to the left of the command, or by pressing
the right arrow key while the command is selected.

@ -1033,7 +1033,11 @@ command_result Core::runCommand(color_ostream &con, const std::string &first_, s
}
else if (first == "die")
{
#ifdef WIN32
TerminateProcess(GetCurrentProcess(),666);
#else
std::_Exit(666);
#endif
}
else if (first == "kill-lua")
{

@ -48,6 +48,8 @@ namespace df {
STL_OPAQUE_IDENTITY_TRAITS(fstream);
STL_OPAQUE_IDENTITY_TRAITS(mutex);
STL_OPAQUE_IDENTITY_TRAITS(future<void>);
STL_OPAQUE_IDENTITY_TRAITS(function<void()>);
STL_OPAQUE_IDENTITY_TRAITS(optional<std::function<void()> >);
buffer_container_identity buffer_container_identity::base_instance;
}

@ -138,7 +138,7 @@ void Process::getMemRanges( vector<t_memrange> & ranges )
{
t_memrange temp;
temp.name[0] = 0;
sscanf(buffer, "%zx-%zx %s %zx %2zx:%2zx %zu %[^\n]",
sscanf(buffer, "%zx-%zx %s %zx %zx:%zx %zu %[^\n]",
&start,
&end,
(char*)&permissions,

@ -25,11 +25,13 @@ distribution.
#pragma once
#include <deque>
#include <future>
#include <map>
#include <optional>
#include <sstream>
#include <string>
#include <unordered_map>
#include <vector>
#include <future>
#include "DataDefs.h"
@ -573,6 +575,20 @@ namespace df
OPAQUE_IDENTITY_TRAITS(std::fstream);
OPAQUE_IDENTITY_TRAITS(std::mutex);
OPAQUE_IDENTITY_TRAITS(std::future<void>);
OPAQUE_IDENTITY_TRAITS(std::function<void()>);
OPAQUE_IDENTITY_TRAITS(std::optional<std::function<void()> >);
#ifdef BUILD_DFHACK_LIB
template<typename T>
struct DFHACK_EXPORT identity_traits<std::shared_ptr<T>> {
static opaque_identity *get() {
typedef std::shared_ptr<T> type;
static std::string name = std::string("shared_ptr<") + typeid(T).name() + ">";
static opaque_identity identity(sizeof(type), allocator_noassign_fn<type>, name);
return &identity;
}
};
#endif
template<> struct DFHACK_EXPORT identity_traits<bool> {
static bool_identity identity;
@ -653,6 +669,10 @@ namespace df
static container_identity *get();
};
template<class KT, class T> struct identity_traits<std::unordered_map<KT, T>> {
static container_identity *get();
};
template<> struct identity_traits<BitArray<int> > {
static bit_array_identity identity;
static bit_container_identity *get() { return &identity; }
@ -730,6 +750,13 @@ namespace df
return &identity;
}
template<class KT, class T>
inline container_identity *identity_traits<std::unordered_map<KT, T>>::get() {
typedef std::unordered_map<KT, T> container;
static ro_stl_assoc_container_identity<container> identity("unordered_map", identity_traits<KT>::get(), identity_traits<T>::get());
return &identity;
}
template<class T>
inline bit_container_identity *identity_traits<BitArray<T> >::get() {
static bit_array_identity identity(identity_traits<T>::get());

@ -962,6 +962,7 @@ int dfhack_lua_viewscreen::do_input(lua_State *L)
if (!self) return 0;
auto keys = (std::set<df::interface_key>*)lua_touserdata(L, 2);
if (!keys) return 0;
lua_getfield(L, -1, "onInput");

@ -1 +1 @@
Subproject commit d72558199aca591cc6cf778d0fe75dba8793059e
Subproject commit 041493b221e0799c106abeac1f86df4535ab80d3

@ -60,7 +60,7 @@ fi
case "$1" in
-g | --gdb)
shift
echo "set exec-wrapper env LD_LIBRARY_PATH='$LD_LIBRARY_PATH' LD_PRELOAD='$PRELOAD_LIB' MALLOC_PERTURB_=45" > gdbcmd.tmp
echo "set exec-wrapper env LD_LIBRARY_PATH='$LD_LIBRARY_PATH' LD_PRELOAD='${LD_PRELOAD:+$LD_PRELOAD:}$PRELOAD_LIB' MALLOC_PERTURB_=45" > gdbcmd.tmp
gdb $DF_GDB_OPTS -x gdbcmd.tmp --args ./dwarfort "$@"
rm gdbcmd.tmp
ret=$?
@ -95,35 +95,35 @@ case "$1" in
;;
-h | --helgrind)
shift
LD_PRELOAD="$PRELOAD_LIB" setarch "$setarch_arch" -R valgrind $DF_HELGRIND_OPTS --tool=helgrind --log-file=helgrind.log ./dwarfort "$@"
LD_PRELOAD="${LD_PRELOAD:+$LD_PRELOAD:}$PRELOAD_LIB" setarch "$setarch_arch" -R valgrind $DF_HELGRIND_OPTS --tool=helgrind --log-file=helgrind.log ./dwarfort "$@"
ret=$?
;;
-v | --valgrind)
shift
LD_PRELOAD="$PRELOAD_LIB" setarch "$setarch_arch" -R valgrind $DF_VALGRIND_OPTS --log-file=valgrind.log ./dwarfort "$@"
LD_PRELOAD="${LD_PRELOAD:+$LD_PRELOAD:}$PRELOAD_LIB" setarch "$setarch_arch" -R valgrind $DF_VALGRIND_OPTS --log-file=valgrind.log ./dwarfort "$@"
ret=$?
;;
-c | --callgrind)
shift
LD_PRELOAD="$PRELOAD_LIB" setarch "$setarch_arch" -R valgrind $DF_CALLGRIND_OPTS --tool=callgrind --separate-threads=yes --dump-instr=yes --instr-atstart=no --log-file=callgrind.log ./dwarfort "$@"
LD_PRELOAD="${LD_PRELOAD:+$LD_PRELOAD:}$PRELOAD_LIB" setarch "$setarch_arch" -R valgrind $DF_CALLGRIND_OPTS --tool=callgrind --separate-threads=yes --dump-instr=yes --instr-atstart=no --log-file=callgrind.log ./dwarfort "$@"
ret=$?
;;
--strace)
shift
strace -f setarch "$setarch_arch" -R env LD_PRELOAD="$PRELOAD_LIB" ./dwarfort "$@" 2> strace.log
strace -f setarch "$setarch_arch" -R env LD_PRELOAD="${LD_PRELOAD:+$LD_PRELOAD:}$PRELOAD_LIB" ./dwarfort "$@" 2> strace.log
ret=$?
;;
-x | --exec)
exec setarch "$setarch_arch" -R env LD_PRELOAD="$PRELOAD_LIB" ./dwarfort "$@"
exec setarch "$setarch_arch" -R env LD_PRELOAD="${LD_PRELOAD:+$LD_PRELOAD:}$PRELOAD_LIB" ./dwarfort "$@"
# script does not resume
;;
--sc | --sizecheck)
PRELOAD_LIB="${PRELOAD_LIB:+$PRELOAD_LIB:}./hack/libsizecheck.so"
MALLOC_PERTURB_=45 setarch "$setarch_arch" -R env LD_PRELOAD="$PRELOAD_LIB" ./dwarfort "$@"
MALLOC_PERTURB_=45 setarch "$setarch_arch" -R env LD_PRELOAD="${LD_PRELOAD:+$LD_PRELOAD:}$PRELOAD_LIB" ./dwarfort "$@"
ret=$?
;;
*)
setarch "$setarch_arch" -R env LD_PRELOAD="$PRELOAD_LIB" ./dwarfort "$@"
setarch "$setarch_arch" -R env LD_PRELOAD="${LD_PRELOAD:+$LD_PRELOAD:}$PRELOAD_LIB" ./dwarfort "$@"
ret=$?
;;
esac

@ -746,7 +746,8 @@ static bool isInappropriateUnit(df::unit *unit) {
static bool isProtectedUnit(df::unit *unit) {
return Units::isWar(unit) // ignore war dogs etc
|| Units::isHunter(unit) // ignore hunting dogs etc
|| Units::isMarkedForTraining(unit) // ignore units marked for any kind of training
|| Units::isMarkedForWarTraining(unit) // ignore units marked for any kind of training
|| Units::isMarkedForHuntTraining(unit)
// ignore creatures in built cages which are defined as rooms to leave zoos alone
// (TODO: better solution would be to allow some kind of slaughter cages which you can place near the butcher)
|| (isContainedInItem(unit) && isInBuiltCageRoom(unit)) // !!! see comments in isBuiltCageRoom()

@ -377,10 +377,14 @@ void Checker::dispatch_container(const QueueItem & item, const CheckedStructure
{
// TODO: check DfArray
}
else if (base_container.substr(0, 4) == "map<")
else if (base_container.starts_with("map<"))
{
// TODO: check map
}
else if (base_container.starts_with("unordered_map<"))
{
// TODO: check unordered_map
}
else
{
UNEXPECTED;

@ -82,7 +82,7 @@ haul_delete_stop.message = "Are you sure you want to delete this stop?"
depot_remove = defconf('depot-remove')
function depot_remove.intercept_key(key)
if df.global.game.main_interface.current_hover == 299 and
if df.global.game.main_interface.current_hover == 301 and
key == MOUSE_LEFT and
df.building_tradedepotst:is_instance(dfhack.gui.getSelectedBuilding(true)) then
for _, caravan in pairs(df.global.plotinfo.caravans) do
@ -98,7 +98,7 @@ depot_remove.message = "Are you sure you want to remove this depot?\n" ..
squad_disband = defconf('squad-disband')
function squad_disband.intercept_key(key)
return key == MOUSE_LEFT and df.global.game.main_interface.current_hover == 341
return key == MOUSE_LEFT and df.global.game.main_interface.current_hover == 343
end
squad_disband.title = "Disband squad"
squad_disband.message = "Are you sure you want to disband this squad?"

@ -5,7 +5,8 @@ local helpdb = require('helpdb')
local overlay = require('plugins.overlay')
local widgets = require('gui.widgets')
local textures = dfhack.textures.loadTileset('hack/data/art/dfhack.png', 8, 12)
local logo_textures = dfhack.textures.loadTileset('hack/data/art/logo.png', 8, 12)
local logo_hovered_textures = dfhack.textures.loadTileset('hack/data/art/logo_hovered.png', 8, 12)
local function get_command(cmdline)
local first_word = cmdline:trim():split(' +')[1]
@ -26,9 +27,9 @@ end
HotspotMenuWidget = defclass(HotspotMenuWidget, overlay.OverlayWidget)
HotspotMenuWidget.ATTRS{
default_pos={x=2,y=2},
default_pos={x=5,y=1},
default_enabled=true,
hotspot=true,
version=2,
viewscreens={
'adopt_region',
'choose_game_type',
@ -47,55 +48,47 @@ HotspotMenuWidget.ATTRS{
'update_region',
'world'
},
overlay_onupdate_max_freq_seconds=0,
frame={w=4, h=3}
}
function HotspotMenuWidget:init()
self.mouseover = false
end
function HotspotMenuWidget:overlay_onupdate()
local hasMouse = self:getMousePos()
if hasMouse and not self.mouseover then
self.mouseover = true
return true
local to_pen = dfhack.pen.parse
local function tp(idx, ch)
return to_pen{
tile=function() return dfhack.textures.getTexposByHandle(logo_textures[idx]) end,
ch=ch,
fg=COLOR_GREY,
}
end
self.mouseover = hasMouse
local function tph(idx, ch)
return to_pen{
tile=function() return dfhack.textures.getTexposByHandle(logo_hovered_textures[idx]) end,
ch=ch,
fg=COLOR_WHITE,
}
end
function HotspotMenuWidget:overlay_trigger()
return MenuScreen{hotspot=self}:show()
local function get_tile_token(idx, ch)
return {
tile=tp(idx, ch),
htile=tph(idx, ch),
width=1,
}
end
local dscreen = dfhack.screen
function HotspotMenuWidget:onRenderBody(dc)
local x, y = dc.x, dc.y
local tp = function(offset)
return dfhack.textures.getTexposByHandle(textures[offset])
self:addviews{
widgets.Label{
text={
get_tile_token(1, '!'), get_tile_token(2, 'D'), get_tile_token(3, 'F'), get_tile_token(4, '!'), NEWLINE,
get_tile_token(5, '!'), get_tile_token(6, 'H'), get_tile_token(7, 'a'), get_tile_token(8, '!'), NEWLINE,
get_tile_token(9, '!'), get_tile_token(10, 'c'), get_tile_token(11, 'k'), get_tile_token(12, '!'),
},
on_click=function() dfhack.run_command('hotkeys') end,
},
}
end
if tp(1) == nil then
dscreen.paintString(COLOR_WHITE, x, y + 0, '!DF!')
dscreen.paintString(COLOR_WHITE, x, y + 1, '!Ha!')
dscreen.paintString(COLOR_WHITE, x, y + 2, '!ck!')
else
dscreen.paintTile(COLOR_WHITE, x + 0, y + 0, '!', tp(1))
dscreen.paintTile(COLOR_WHITE, x + 1, y + 0, 'D', tp(2))
dscreen.paintTile(COLOR_WHITE, x + 2, y + 0, 'F', tp(3))
dscreen.paintTile(COLOR_WHITE, x + 3, y + 0, '!', tp(4))
dscreen.paintTile(COLOR_WHITE, x + 0, y + 1, '!', tp(5))
dscreen.paintTile(COLOR_WHITE, x + 1, y + 1, 'H', tp(6))
dscreen.paintTile(COLOR_WHITE, x + 2, y + 1, 'a', tp(7))
dscreen.paintTile(COLOR_WHITE, x + 3, y + 1, '!', tp(8))
dscreen.paintTile(COLOR_WHITE, x + 0, y + 2, '!', tp(9))
dscreen.paintTile(COLOR_WHITE, x + 1, y + 2, 'c', tp(10))
dscreen.paintTile(COLOR_WHITE, x + 2, y + 2, 'k', tp(11))
dscreen.paintTile(COLOR_WHITE, x + 3, y + 2, '!', tp(12))
end
function HotspotMenuWidget:overlay_trigger()
return MenuScreen{hotspot=self}:show()
end
-- register the menu hotspot with the overlay
@ -170,10 +163,16 @@ end
function Menu:init()
local hotkeys, bindings = getHotkeys()
if #hotkeys == 0 then
hotkeys = {''}
bindings = {['']='gui/launcher'}
end
local is_inverted = not not self.hotspot.frame.b
local choices,list_width = get_choices(hotkeys, bindings, is_inverted)
list_width = math.max(35, list_width)
local list_frame = copyall(self.hotspot.frame)
local list_widget_frame = {h=math.min(#choices, MAX_LIST_HEIGHT)}
local quickstart_frame = {}
@ -272,7 +271,7 @@ end
function Menu:onInput(keys)
if keys.LEAVESCREEN or keys._MOUSE_R_DOWN then
return false
elseif keys.STANDARDSCROLL_RIGHT then
elseif keys.KEYBOARD_CURSOR_RIGHT then
self:onSubmit2(self.subviews.list:getSelected())
return true
elseif keys._MOUSE_L_DOWN then
@ -283,7 +282,7 @@ function Menu:onInput(keys)
df.global.enabler.mouse_lbut = 0
return true
end
if not self:getMouseFramePos() and not self.hotspot:getMousePos() then
if not self:getMouseFramePos() then
self.parent_view:dismiss()
return true
end
@ -298,7 +297,7 @@ function Menu:onRenderFrame(dc, rect)
self.initialize()
self.initialize = nil
end
Menu.super.onRenderFrame(dc, rect)
Menu.super.onRenderFrame(self, dc, rect)
end
function Menu:getMouseFramePos()
@ -307,7 +306,7 @@ function Menu:getMouseFramePos()
end
function Menu:onRenderBody(dc)
local panel = self.subviews.list_panel
Menu.super.onRenderBody(self, dc)
local list = self.subviews.list
local idx = list:getIdxUnderMouse()
if idx and idx ~= self.last_mouse_idx then
@ -317,13 +316,6 @@ function Menu:onRenderBody(dc)
list:setSelected(idx)
self.last_mouse_idx = idx
end
if self:getMouseFramePos() then
self.mouseover = true
elseif self.mouseover then
-- once the mouse has entered the list area, leaving the frame should
-- close the menu screen
self.parent_view:dismiss()
end
end
-- ---------- --

@ -581,7 +581,8 @@ end
TitleVersionOverlay = defclass(TitleVersionOverlay, OverlayWidget)
TitleVersionOverlay.ATTRS{
default_pos={x=7, y=2},
default_pos={x=11, y=1},
version=2,
default_enabled=true,
viewscreens='title/Default',
frame={w=35, h=5},

@ -1 +1 @@
Subproject commit 0f457b56595f0e7eaba8300a6870af406b1154f6
Subproject commit e0591830b72cdfaec5c9bdb1bf713a74fe744788