Commit Graph

732 Commits (4eb767c3f00ab8de73a17ba3d7e0027f16afed1f)

Author SHA1 Message Date
lethosor 9df35dd844 revealInDwarfmodeMap: use map y dimensions 2017-06-02 00:40:59 -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 f59be2a9a0 Expand focus strings for jobmanagement and workquota_condition viewscreens 2017-05-27 00:57:16 -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 adb14491d0 Fix loop in Designations::unmarkPlant() 2017-05-05 17:24:51 -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
lethosor 19695b4ee7 EventManager/eventful: Pass building ID pointers to event handlers
Previously, there was some disagreement over whether event handlers such as
Buildings::updateBuildings() took building pointers or building IDs shoved
into pointers. It turned out to be the latter, which, unfortunately, did not
compile on x64. Passing building IDs isn't possible in all cases, because
building event handlers can be called for recently-deleted buildings too.
Pointers to building IDs do work reliably, though.

Fixes #1003
2017-02-17 22:53:48 -05: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 de0e211e07 Figured I could like test my code. 2016-11-24 23:35:03 -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 8b964ca2dc Wipe job_items vector 2016-11-21 06:51:21 -08:00
Stephen Baynham fba32f2e2f Also disconnect the job from its items. 2016-11-17 23:25:48 -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 70d3c07cdb Initial lua getDwarfmodeViewDims rewrite 2016-10-07 23:51:58 -04:00
lethosor 70ac99cbfa Fix Buildings::setOwner() persistence
Needed to set bld->owner_id for changes to persist across save/load

Fixes #983, thanks to Quietust
2016-08-21 20:58:40 -04:00
lethosor de731b0299 Move save_dir back into cur_savegame and update submodules 2016-08-14 12:41:09 -04:00
lethosor e965f5318f Replace many includes with forward declarations in modules/Maps.h 2016-08-13 21:44:01 -04:00
lethosor 215afa34f3 Update for 64-bit unit changes
Includes xml, stonesense, scripts

Ref DFHack/df-structures@25cb373
2016-08-10 23:50:00 -04:00
lethosor 79377669a1 Merge remote-tracking branch 'NCommander/dwarfvet' into develop 2016-07-29 16:25:53 -04:00
lethosor 41a81f9021 Fix some more warnings (GCC 4.8) 2016-07-28 11:00:52 -04:00
Vitaly Pronkin fe18f176f7 More 64-bit fixes
Cherry-picked from 7eb3ba6
- Lua update already done in e2c6350, 4dd411e
- Excluded library/modules/Buildings.cpp
2016-07-26 23:47:53 -04:00
lethosor 2455e36510 Initial 64-bit support 2016-07-03 23:32:43 -04:00
Michael Casadevall a03b32846a Modify DFHack to handle new produce() prototype. Major thanks to lethosor, and ragundo for their help in this
Signed-off-by: Michael Casadevall <mcasadevall@ubuntu.com>
2016-06-13 16:57:45 -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 a89251cdf8 Find job in job screen 2016-05-14 16:07:27 -04:00
lethosor 55e58e5f06 Update handling of viewscreen_workshop_profilest in Gui module, search/sort plugins 2016-05-14 11:43:37 -04:00
lethosor fee6e57b40 Disable viewscreen_layer_workshop_profilest focus handler for now 2016-05-11 17:52:56 -04:00
lethosor 402a96b0e6 Expose new unit functions to lua and add some basic safety checks 2016-04-23 21:52:50 -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
expwnent f8ff447cb5 Add a check to the histfig fix and tweak NEWS. 2016-03-10 08:50:03 -05:00
expwnent fd132d3fe7 Fix persistent histfig crashbug. 2016-03-10 08:38:55 -05:00
sv-esk 9da79544de fix Units::isCitizen
fixes a lot of issues where plugins ignore non-dwarf citizens and work
with dwarf mercenaries and bards, where it shouldnot
2016-03-04 22:48:33 +02:00
sv-esk d508028bcc fix job-duplicate (do not clone posting_index)
if job cannot be done right now, game puts it in df.global.world.job_postings
when job finally can be done, game removes job from postings and clears posting_index
that index should not be cloned by job-duplicate(new jobs(added by vanilla way) have that value -1 always anyway)
cloning posting_index into the new job causes that job to be ignored
2016-03-03 21:32:16 +02:00
lethosor 5bb19a230f getKillCount: also search kills->events 2016-02-25 15:34:56 -05:00
lethosor 25507a10f9 Add Units::getKillCount() and expose it to Lua 2016-02-25 15:21:14 -05:00
lethosor 3e44aabf12 Expose Units::getSquadName to lua 2016-02-25 15:19:35 -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 248331a196 buildingplan: Support floodgates, grates, bars
See #808
2016-01-31 14:50:07 -05:00
Ben Lubar a316dfa074 set floodgate flags correctly when allocating it in lua or c++
https://github.com/DFHack/dfhack/blob/0.42.04-alpha2/plugins/ruby/building.rb#L63
2016-01-29 14:50:50 -06:00
Ben Lubar 675d173266 set civzone number when constructing a civzone 2016-01-18 14:46:39 -06:00
lethosor 0bcc8dc443 exportlegends: fix day/month issues more reliably
Fixes #783, #791
2016-01-09 19:28:12 -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