Merge branch 'develop' into github-actions

develop
lethosor 2020-04-10 23:30:22 -04:00
commit adad0e36bc
5 changed files with 94 additions and 1 deletions

@ -34,6 +34,7 @@ Clayton Hughes
Clément Vuchener cvuchener Clément Vuchener cvuchener
Dan Amlund danamlund Dan Amlund danamlund
Daniel Brooks db48x Daniel Brooks db48x
David Nilsolm
David Corbett dscorbett David Corbett dscorbett
David Seguin dseguin David Seguin dseguin
David Timm dtimm David Timm dtimm

@ -42,6 +42,9 @@ changelog.txt uses a syntax similar to RST, with a few special sequences:
## Fixes ## Fixes
- `tweak` embark-profile-name: fixed handling of the native shift+space key - `tweak` embark-profile-name: fixed handling of the native shift+space key
## Misc Improvements
- `search`: added support for the fortress mode justice screen
## Lua ## Lua
- ``pairs()`` now returns available class methods for DF types - ``pairs()`` now returns available class methods for DF types

@ -68,6 +68,8 @@ namespace DFHack
IDTYPE_UNION IDTYPE_UNION
}; };
// pointer flags (bitfield), stored in the count field of struct_field_info
// if mode is POINTER.
enum pointer_identity_flags { enum pointer_identity_flags {
PTRFLAG_IS_ARRAY = 1, PTRFLAG_IS_ARRAY = 1,
PTRFLAG_HAS_BAD_POINTERS = 2, PTRFLAG_HAS_BAD_POINTERS = 2,
@ -164,7 +166,12 @@ namespace DFHack
// Bitfields // Bitfields
struct bitfield_item_info { struct bitfield_item_info {
// the name of the field, or null if the field is unnamed
const char *name; const char *name;
// size is positive for defined fields, zero for bits past the end
// of the field, and negative for padding on multi-bit fields
//
// ex. if bits[2].size is -2, then bits[0].size is at least 3
int size; int size;
}; };

@ -1 +1 @@
Subproject commit 596e3032417fb3d8dbe7d62a544ddd415ae2d89f Subproject commit e4522edf112824fb0edac874cec0d0f7f9c33c5f

@ -25,6 +25,7 @@
#include "df/viewscreen_buildinglistst.h" #include "df/viewscreen_buildinglistst.h"
#include "df/viewscreen_dwarfmodest.h" #include "df/viewscreen_dwarfmodest.h"
#include "df/viewscreen_joblistst.h" #include "df/viewscreen_joblistst.h"
#include "df/viewscreen_justicest.h"
#include "df/viewscreen_kitchenprefst.h" #include "df/viewscreen_kitchenprefst.h"
#include "df/viewscreen_layer_militaryst.h" #include "df/viewscreen_layer_militaryst.h"
#include "df/viewscreen_layer_noblelistst.h" #include "df/viewscreen_layer_noblelistst.h"
@ -2327,6 +2328,85 @@ IMPLEMENT_HOOKS(df::viewscreen_layer_stone_restrictionst, stone_search);
// END: Stone status screen search // END: Stone status screen search
// //
//
// START: Justice screen conviction search
//
typedef search_generic<df::viewscreen_justicest, df::unit*> justice_conviction_search_base;
class justice_conviction_search : public justice_conviction_search_base
{
public:
bool can_init (df::viewscreen_justicest *screen)
{
return screen->cur_column == df::viewscreen_justicest::ConvictChoices;
}
string get_element_description (df::unit *unit) const
{
return get_unit_description(unit);
}
void render() const
{
print_search_option(37);
}
vector<df::unit*> *get_primary_list()
{
return &viewscreen->convict_choices;
}
virtual int32_t *get_viewscreen_cursor()
{
return &viewscreen->cursor_right;
}
};
IMPLEMENT_HOOKS(df::viewscreen_justicest, justice_conviction_search);
//
// END: Justice screen conviction search
//
//
// START: Justice screen interrogation search
//
typedef search_generic<df::viewscreen_justicest, df::unit*> justice_interrogation_search_base;
class justice_interrogation_search : public justice_interrogation_search_base
{
public:
bool can_init (df::viewscreen_justicest *screen)
{
return screen->cur_column == df::viewscreen_justicest::InterrogateChoices;
}
string get_element_description (df::unit *unit) const
{
return get_unit_description(unit);
}
void render() const
{
print_search_option(37);
}
vector<df::unit*> *get_primary_list()
{
return &viewscreen->interrogate_choices;
}
virtual int32_t *get_viewscreen_cursor()
{
return &viewscreen->cursor_right;
}
};
IMPLEMENT_HOOKS(df::viewscreen_justicest, justice_interrogation_search);
//
// END: Justice screen conviction search
//
#define SEARCH_HOOKS \ #define SEARCH_HOOKS \
HOOK_ACTION(unitlist_search_hook) \ HOOK_ACTION(unitlist_search_hook) \
@ -2350,6 +2430,8 @@ IMPLEMENT_HOOKS(df::viewscreen_layer_stone_restrictionst, stone_search);
HOOK_ACTION(location_assign_occupation_search_hook) \ HOOK_ACTION(location_assign_occupation_search_hook) \
HOOK_ACTION(kitchen_pref_search_hook) \ HOOK_ACTION(kitchen_pref_search_hook) \
HOOK_ACTION(stone_search_hook) \ HOOK_ACTION(stone_search_hook) \
HOOK_ACTION(justice_conviction_search_hook) \
HOOK_ACTION(justice_interrogation_search_hook) \
DFhackCExport command_result plugin_enable ( color_ostream &out, bool enable) DFhackCExport command_result plugin_enable ( color_ostream &out, bool enable)