Commit Graph

376 Commits (cd7fe8a213b20ac8a05ce631fadd078a16f90a1d)

Author SHA1 Message Date
Myk Taylor ae872e812f properly detect valid tiles for civzones 2020-08-15 17:24:12 -07:00
lethosor 8c5b21b7ee
Fix a couple warnings in the Units module (#1615) 2020-08-08 14:35:12 -04:00
Ryan Bennitt 9510dd52e1 Add Goal to Manipulator Detail Modes 2020-08-04 23:01:28 +01:00
Myk Taylor e17d492203 address PR review comments on api docs 2020-07-23 21:55:05 -07:00
Myk Taylor 16cfd34678 recurs-ify default config copying logic
I refactored Filesystem::listdir_recursive to support removing the path
prefix from the returned files list. There are no current calls that
make use of the prefix parameter, so I converted it into a boolean.
Current usages will use the new default parameter and will not see any
changed behavior.
2020-07-18 22:22:37 -07:00
Myk Taylor c19fc1f349 gcc-4.8 compatibility 2020-07-15 21:35:21 -07:00
lethosor 7c1d1c43e5 Merge remote-tracking branch 'PatrikLundell/stocks' into develop
Conflicts:
	docs/changelog.txt
2020-04-25 21:12:27 -04:00
Ben Lubar ffb3c29cfc
simplify Graphic module. update structures.
it appears that all this added complexity including an extra pointer dereference was to avoid including the vector header.
2020-03-08 00:12:48 -06:00
PatrikLundell 121497a466 Propagated getBookTitle to Lua 2020-01-26 11:47:47 +01:00
PatrikLundell 876ac6c056 Renamed to getBookTitle, cut down on virtual_cast 2020-01-25 21:46:10 +01:00
PatrikLundell c6bbf39c6c Issue #1262. Added Items::getTitle and used in stocks 2020-01-25 12:43:02 +01:00
lethosor 5eca50476e Merge remote-tracking branch 'nornagon/unit-description' into develop 2020-01-13 23:31:23 -05:00
Jeremy Apthorp 50e696acf6 getDescription => getPhysicalDescription 2019-12-14 09:36:47 -08:00
Jeremy Apthorp 910f965838 wip 2019-12-07 22:17:59 -08:00
lethosor f3658db85f Merge branch 'develop' into avoid_rebuilding_df_statics_if_core_h_changes 2019-10-03 23:23:36 -04:00
lethosor 07575095fd Merge branch 'develop' into persist 2019-08-22 22:00:50 -04:00
Pauli f0632347d0 Remove Core.h include from DataDefs.h
Core.h isn't required for DataDefs.h which removes Core.h dependency
from DataStatics*.
2018-12-30 17:08:42 -05:00
Ben Lubar a672ffcb95
Use viewscreen_savegamest instead of viewscreen_optionst 2018-08-26 19:05:44 -05:00
Ben Lubar 4e690df96a
Add Persistence module.
Alter World to use Persistence instead of storing data in historical figures.

Fake historical figures will be converted to the new format when a world is loaded.

Added plugin_save and plugin_load functions to the plugin API.

Made the weird int7/int28 code that was in the old persistence API slightly safer.
2018-08-26 18:27:58 -05:00
Kelly Kinkade 59d70d6687 Add function to infer biome type to Maps module
This moves code intended to infer biome type currently living in a
couple of plugins into the Maps module, so that this code can be shared
more easily by multiple plugins, as discussed in #1392.
2018-08-15 20:28:18 -05:00
Ben Lubar 4837e65322
Add an identity to dfhack_viewscreen and dfhack_lua_viewscreen. 2018-07-22 17:31:39 -05:00
lethosor 9ee368d456 Merge remote-tracking branch 'suokko/MapCache_reduce_latency_from_designation_to_jobs' into develop 2018-07-11 11:51:24 -04:00
lethosor 2dac3c53c7 Add stress cutoffs to Units module, fix dwarfmonitor/manipulator
Fixes #1292
2018-07-09 15:59:12 -04:00
lethosor 037e7e4901 Merge remote-tracking branch 'suokko/spotclean_ui_state_fix_1194' into develop
Moved/adjusted changelog entry
2018-07-07 18:08:53 -04:00
lethosor 616675f0ce Merge remote-tracking branch 'suokko/kittens_data_race_fix' into develop 2018-07-03 00:30:36 -04:00
lethosor 81a7ddcf92 Merge remote-tracking branch 'suokko/screen_show_memory_leak' into develop 2018-07-02 22:58:11 -04:00
Pauli 0727403ac1 Fix devel plugins linking in linux 2018-06-30 21:12:42 +03:00
Pauli c39a882b57 Add missing Unit::isDiplomat
Fixes #1324
2018-06-29 16:19:18 +03:00
Pauli 123de7fdf7 Use constexpr to prevent attempts of linking static variable 2018-06-24 17:06:32 +03:00
Pauli 9b6781f0f2 Temporary lower command-prompt when executing the command
command-prompt viewscreen may affect command execution if they are
looking for UI state. To make commands execute simillary to hotkeys or
console commands the viewscreen needs to removed from the top position.

Fixes #1194
2018-06-20 21:51:45 +03:00
Pauli 9c59b7ff48 Fix unlikely memory leaks if Screen::show fails
The Screen::show takes ownership of the screen pointer. I decided to
switch the parameter to std::unique_ptr to make the pointer ownership
explicit. The unique_ptr then provides automatic screen destruction in
Screen::show unless pointer is inserted or is already in the linked list
that is managed by df.
2018-06-19 16:41:31 +03:00
Pauli 1b5ec7ce69 Update jobs when committing MapCache changes
The map_block->designation.{dig,smooth} are reset to zeros when a job
posting is created for the designation. The job is then used to override
the designation state in the map_block. To make the new designation set
propogate to jobs the job structure would require updating. The update
would be possible a complex operation. The simple alternative is to
remove the job and let df create a new job in the next tick.

Fixes #1229
2018-06-18 16:34:09 +03:00
Pauli 6a151353e3 Use automatic return type for index_tile 2018-06-18 16:23:57 +03:00
lethosor 10e6016989 Merge branch 'units_dead' into develop
Closes #1297
2018-06-13 15:38:35 -04:00
PatrikLundell f329774059 dead & killed flag separation
squashed 4 commits from #1297
2018-06-13 15:37:45 -04:00
lethosor 03968db344 Fix GCC warnings in 'tweak kitchen-prefs-all' and dev plugins 2018-06-01 10:02:38 -04:00
lethosor 7a04fefb0b Remove Vermin module (unused and obsolete) 2018-06-01 00:22:10 -04:00
lethosor 17ba492992 Add some exclusion functions to Kitchen module, expose to Lua, fix build 2018-05-17 19:34:03 -04:00
lethosor 97a79893e7 Change Kitchen.{h,cpp} to title case 2018-05-17 11:08:13 -04:00
lethosor e9ec08f419 Add Buildings::getRoomDescription(), moved from search plugin, +cleanup 2018-05-12 17:00:21 -04:00
lethosor c15571caa0 Move isRouteVehicle, isSquadEquipment from workflow to Items module 2018-05-12 14:49:30 -04:00
lethosor a34b34d3cb Move a few item functions from autotrade/stocks into DFHack::Items 2018-05-12 12:04:46 -04:00
lethosor 2a52582c1f Add Gui::inRenameBuilding 2018-05-09 10:23:05 -04:00
lethosor 1ba5477b63 Add designation priority support to MapCache and dig plugin
Fixes #481
2018-01-21 19:27:16 -05:00
lethosor 10e13c532a Add "tweak cage-butcher" and some extra Building module functions
* Buildings::markedForRemoval()
* Buildings::getCageOccupants()

Closes #906
2017-06-25 15:27:21 -04:00
lethosor ae809afde7 Add Gui::refreshSidebar()
This handles feeding CURSOR_DOWN_Z and CURSOR_UP_Z properly, avoiding issues
when on the lowest z-level.
2017-06-23 00:02:21 -04:00
lethosor 27343e3253 Add unit and tile visibility functions 2017-06-10 21:54:08 -04:00
lethosor 778ffb0971 More Units module cleanup, modernize getUnitsInBox 2017-06-10 21:02:30 -04:00
lethosor 1321a64613 Remove lots of old/unused functions from the Units module 2017-06-10 17:21:34 -04:00
lethosor 43c4a88068 Move some checks in paintTile/readTile after hooks are called 2017-06-02 00:40:14 -04:00
lethosor 05f322ca30 Merge remote-tracking branch 'lethosor/lua-dmdims' into develop 2017-06-01 23:34:35 -04:00
lethosor 939aff3231 readTile(): add hook support and map parameter 2017-05-31 12:12:15 -04:00
lethosor 55931703ac Designate the correct tile for trees with multi-tile trunks
DF always designates the southeast trunk tile, while plant.pos is the center,
which is sometimes inaccessible (see #1014)
2017-05-05 21:25:25 -04:00
lethosor d3c496cc2b Add getSelectedPlant() and related functions
Currently only works with the center tile of multi-tile trees
2017-05-05 14:45:46 -04:00
lethosor 1e469453fc Add Designations module, currently supporting plant/tree designations
This makes it easier for tools to properly handle designating and undesignating
trees for chopping and plants for gathering, which changed significantly in
0.40.20.

Ref #531 (?), #656, #1014, #1018, #1030, #1076
2017-05-04 21:47:12 -04:00
lethosor 71b553b305 Add a few functions to retrieve unit social activities 2017-04-28 17:25:58 -04:00
David Corbett acdb369aa8 Avoid non-trivial bitfield constructors 2016-12-09 13:41:14 -05:00
lethosor 8521b830b2 Merge remote-tracking branch 'CannibalVox/job_remove' into develop 2016-12-05 15:24:37 -05:00
Stephen Baynham 595f3857b6 Reverse the param order of these two methods
The current way doesn't match other Job module methods
2016-12-01 20:13:49 -08:00
Stephen Baynham 7920f71517 Bad formatting 2016-11-25 00:25:18 -08:00
Stephen Baynham e490afdf00 Rebuilt slightly to offer bool return val
We fail on unknown general ref types now, without modifying the job at
all yet
2016-11-24 22:36:11 -08:00
Stephen Baynham 74f5df99db Add job remove method
Job remove eliminates a job's worker & holder references, if any, puts
the worker on cd, if appropriate, removes the job's postings, eliminates
the job from the global linked list, and then finally deletes it.  This
code was tested by incorporating it into autochop and it does make the
plugin work.  However, chop jobs don't have holder building references,
and anyway, with DF being 90% edge case by volume, this could use a heck
of a lot more testing.

I saw elsewhere code that prevented worker removal if the job was a
special job, and that made me feel funny so I made the job remove method
not work if the job is a special job.
2016-11-17 19:54:41 -08:00
lethosor 8a138fcc4c Avoid polluting global namespace in MapCache.h 2016-10-15 14:53:10 -04:00
lethosor 70d3c07cdb Initial lua getDwarfmodeViewDims rewrite 2016-10-07 23:51:58 -04:00
lethosor e965f5318f Replace many includes with forward declarations in modules/Maps.h 2016-08-13 21:44:01 -04:00
lethosor 79377669a1 Merge remote-tracking branch 'NCommander/dwarfvet' into develop 2016-07-29 16:25:53 -04:00
lethosor 2455e36510 Initial 64-bit support 2016-07-03 23:32:43 -04:00
Michael Casadevall e45fbfc61d Modified dwaftvet plugin to work with latest DFHack
Initial commit of the dwarfvet plugin

Signed-off-by: Michael Casadevall <mcasadevall@ubuntu.com>
2016-06-08 04:14:59 -04:00
lethosor 52728babd4 Merge branch 'develop' into zone-unassign 2016-04-22 18:41:15 -04:00
lethosor b97d33ca28 moveToBuilding improvements
- Don't set in_building by default when use_mode is 0 (consistent with most vanilla DF items)
- make use_mode optional and default to 0 (including in Lua API)

Resolves #885
2016-04-05 11:43:02 -04:00
lethosor 25507a10f9 Add Units::getKillCount() and expose it to Lua 2016-02-25 15:21:14 -05:00
sv-esk 83c70ccb0f forbid manipulator editing non-citizens 2016-02-11 13:31:52 +02:00
James Gilles 0a670bb0db Implement #804, move some functions to Units, colorize zone output, a
little cleanup
2016-02-01 11:12:06 -05:00
lethosor d0c28d3f50 Prevent plugins with active viewscreens from being unloaded
This requires plugins to pass plugin_self to Screen::show(), but
avoids the need to implement special checks in plugin_onstatechange
for the SC_BEGIN_UNLOAD event.
2016-01-01 11:15:29 -05:00
lethosor 2a2ab00ca9 Add "map" parameter to a lot of drawing functions
Ref #746
2015-12-22 11:42:51 -05:00
lethosor 5a1e5e1464 Expose Units::casteFlagSet() 2015-12-19 11:07:35 -05:00
lethosor 2aeac718cc workflow: Account for job postings correctly and fix existing issues
Without removing postings correctly, it was possible to end up with
multiple workers assigned to a job that workflow had suspended
multiple times, which caused crashes if more than one worker was
assigned to the same job by DF.

This adds an additional command, fix-job-postings, that runs
automatically when loading a world and fixes:
- Multiple job postings that point to the same job
- Job postings that point to a job where posting_index == -1
  (i.e. jobs that should have no posting assigned)

Fixes #741
2015-11-25 20:33:13 -05:00
lethosor 610170b0b0 Add hooks for getDwarfmodeViewDims and getDepthAt (new) 2015-11-15 11:54:34 -05:00
lethosor fcfffd1cb6 Track state of gui hooks
Also fix a bug in drawborder() and expand color-dfhack-text to test
multiple hooks
2015-11-15 11:54:34 -05:00
lethosor fff9072b07 Add initial support for hooking into Gui-related functions 2015-11-15 11:54:34 -05:00
DoctorVanGogh e9be1aa657 Fix for construction over existing construction & on top of walls
Fix to allow constructions on top of (natural) down stairs
2015-11-06 19:00:43 +01:00
lethosor ac71fa8070 Add isValidLabor() to Units module
Closes #711 and could avoid potential issues when editing units from
other civs with manipulator.
2015-10-30 18:41:09 -04:00
lethosor 8de710f1c1 Add Renderer module - safer way to install custom renderers 2015-10-21 17:18:39 -04:00
lethosor 3f5c002634 Pass virtual_identity by reference 2015-10-03 09:27:24 -04:00
lethosor d343dfd8a0 Add a function to find viewscreens (or parents) of a given type
This makes it possible for some plugins to detect the game state more
reliably - for example, prospector would previously fail when
embarking if the viewscreen_choose_start_sitest instance had any
children.
2015-10-02 21:50:55 -04:00
lethosor 36fde3d7e3 Allow Lua screens to allow OPTIONS to work 2015-06-05 18:45:52 -04:00
lethosor bbb41078e7 Expose PenArray dimensions and tiles to Lua 2015-03-28 18:35:07 -04:00
lethosor e2b6ae9beb Allocate Lua PenArray objects using an existing buffer 2015-03-28 11:27:47 -04:00
lethosor 99f4ea4d2b Implement a PenArray class for caching parts of rendered screens 2015-03-27 22:56:30 -04:00
lethosor afca7419dc Add gametype checks to World.cpp 2015-03-09 20:08:21 -04:00
lethosor 10cfef0553 Fix whitespace issues 2015-02-14 22:53:06 -05:00
expwnent e9b4fc513a Merge remote-tracking branch 'cdombroski/zone-plugin-cleanup' into temp
Conflicts:
	NEWS
	plugins/zone.cpp
2015-01-31 21:01:41 -05:00
lethosor 066adfdf95 Implement a function to list directories recursively 2015-01-30 17:29:17 -05:00
Chris Dombroski f608235b1e Fix some Lua things 2015-01-29 19:56:50 -05:00
Chris Dombroski f2eec3198c Rename findPenPitAtCoord 2015-01-29 15:02:54 -05:00
Chris Dombroski 86495270a6 Remove duplicate isMilkable definition. 2015-01-29 14:40:09 -05:00
Chris Dombroski 48b6cf1beb Export functions to Buildings.h 2015-01-29 13:57:50 -05:00
lethosor daf739fcec Remove FIFO support 2015-01-28 21:39:17 -05:00
Chris Dombroski c179f5b913 Extract some stuff from zone.cpp to plugins/Units.{h,cpp} 2015-01-28 21:28:32 -05:00
lethosor f98e2964e6 Fix a few Windows compilation errors 2015-01-28 20:05:24 -05:00