Commit Graph

1070 Commits (265f17a53fec3f7e67f2b3b86c7c294c08827879)

Author SHA1 Message Date
lethosor dfb52a2aba
Merge remote-tracking branch 'lethosor/command-prompt-fix-gui-scripts' into develop
Conflicts:
	docs/changelog.txt
2021-04-02 21:53:14 -04:00
Ben Lubar c06d1f8e52
tagged union support for lua (#1818) 2021-03-30 15:55:06 -05:00
lethosor 59b023c71d
Ensure that command-prompt is dismissed after a command creates a new screen
Fixes #1803

Running a command that created a new screen would previously result in a screen
order that looked like this, due to how `Screen::Hide` works:

- DF screen
  - `command-prompt` screen (dismissed)
    - New screen

The `command-prompt` screen remained on the stack until the new screen was
dismissed, so it would intercept viewscreen vmethod calls intended for the
DF screen.

This change adds a new behavior to `Screen::Hide` that results in this screen
order after running a command:

- DF screen
  - New screen
    - `command-prompt` screen (dismissed) - DF removes this screen immediately
2021-03-21 20:42:50 -04:00
myk002 6819ee9928
make alchemist flag valid for controllable civs 2021-02-05 16:45:39 -08:00
myk002 3ba984c22c
only reset extents if they are unusable
this allows callers of Buildings::setSize() to "pre-initialize" the
extents to declare non-rectangular structures. this allows quickfort to
create non-rectangular stockpiles, farm plots, zones, etc. the extents
are still reset as before if the size of the building doesn't match the
caller's expectations.

this commit also fixes a memory leak when setSize() allocates memory for
extents, but the memory is not deallocated if the building is ultimately
invalid for some reason.
2020-12-16 11:10:47 -08:00
lethosor 8cb38ecf5b
Merge remote-tracking branch 'myk002/myk_metalhead_mario' into develop 2020-11-13 14:04:30 -05:00
myk002 10616a387f
cleaner mask-based implementation 2020-11-12 22:44:38 -08:00
myk002 02a86d761a
identify bars as non_economic items
allows Job::isSuitableMaterial() to match metal bars as a building
material
2020-11-12 19:10:06 -08:00
lethosor 913d860ae4
Use initial working directory as process path on Linux, and expose to Lua 2020-11-12 19:07:51 -05:00
lethosor 23b230495e
Merge branch 'develop' into cwd-handling 2020-11-12 18:44:05 -05:00
lethosor ce7772a1c2
Add Filesystem::restorecwd()
This allows restoring the working directory to its original value, which may not actually be the DF root. See #1671, dfhack/scripts#152
2020-10-14 21:22:53 -04:00
Myk Taylor 9d2abafefc Merge branch 'buildingplan_refactor' into buildingplan_refactor2_squashed 2020-10-11 12:11:51 -07:00
Myk Taylor 4d7f4d80ad prep buildingplan for core algorithm changes
player-visible changes
- removed text that showed up if you used the wrong hotkeys. no other
  dfhack screen does this, and it seems unneeded. can add back if others
  think otherwise, though

internal changes
- changed signature of lua-exported isPlannableBuilding to take subtype
  and custom type in addition to building type. this is only used by
  quickfort, and it already sends all three params in preparation for
  this change
- added lua-exported scheduleCycle(), which is like doCycle(), but only
  takes effect on the next non-paused frame. this lets quickfort
  run only one buildingplan cycle regardless of how many #build
  blueprints were run
- declared a few dfhack library methods and params const so buildingplan
  could call them from const methods
- converted buildingplan internal debug logging fn to have a printf api
- reshaped buildingplan-planner API and refactored implementation in
  preparation for upcoming core algorithm changes for supporing all
  building types (no externally-visible functionality changes)
  - changed df::building_type params to type, subtype, custom tuple keys
  - introduced capability to return multiple filters per building type
    (though the current buildings all only have one filter per)
- split monolith hook functions in buildingplan.cpp into one per scope.
  this significantly cleans up the code and preps the hooks to handle
  iterating through multiple item filters.
- got rid of send_key function and replaced with better reporting of
  whether keys have been handled
2020-10-04 20:05:08 -07:00
George Murray a3c565b243 Add to_search_normalized to search for characters with accents 2020-09-24 07:31:10 -07:00
lethosor 65b8071941
Use typedefs from xlsxio in PluginStatics.h
The typedefs in the header foward-declared new structs of the same names in the DFHack namespace, e.g. DFHack::xlsxio_read_struct. Apparently the constructors that used these typedefs are not inlined on Windows, so libdfhack was compiled with a constructor taking a "DFHack::xlsxio_read_sheet_struct", and xlsxreader was looking for a constructor taking just a "xlsxio_read_sheet_struct", which didn't exist.
2020-09-18 15:05:17 -04:00
lethosor 8779ca0659
Merge remote-tracking branch 'myk002/quickfort_civzones' into develop 2020-08-21 00:34:26 -04:00
Myk Taylor e546d3eec3 rename is_civzone to the more general allow_wall 2020-08-15 20:13:48 -07:00
Myk Taylor ae872e812f properly detect valid tiles for civzones 2020-08-15 17:24:12 -07:00
Myk Taylor bda678bcd4 add some explanatory text to the top of the header 2020-08-11 19:47:04 -07:00
Myk Taylor 39ae2d95fc 2nd attempt to solve compilation errors on windows 2020-08-11 17:06:28 -07:00
Myk Taylor 4f88bb4c3d attempt to solve compilation error on windows 2020-08-11 16:54:53 -07:00
Myk Taylor 0bda289b17 move xlsxreader identity statics to dfhack lib 2020-08-11 14:51:17 -07:00
Myk Taylor a41f7c0998 convert XlsxReader module to xlsxreader plugin 2020-08-09 08:54:42 -07:00
Myk Taylor 18f4786458 Merge remote-tracking branch 'upstream/develop' into quickfort_xlsxio 2020-08-08 17:17:45 -07:00
Myk Taylor 89a6309788 build xlsxio and link it into dfhack, add lua api 2020-08-08 15: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 bb91fdcf8c Merge remote-tracking branch 'upstream/develop' into blueprint_in_blueprints 2020-07-16 09:24:52 -07:00
Myk Taylor c19fc1f349 gcc-4.8 compatibility 2020-07-15 21:35:21 -07:00
lethosor a44a2e2298 Merge branch 'develop' into lua-ref-target 2020-07-14 01:31:23 -04:00
Ben Lubar f20446534b
fix DfOtherVectors computed size 2020-05-14 14:01:12 -05:00
Ben Lubar 6c20fe4c80
implement df-other-vectors-type for lua 2020-05-09 18:28:40 -05:00
Ben Lubar 7cf9624de9
add assert to make sure other_id array index is in bounds 2020-05-09 18:28:40 -05:00
Ben Lubar fc10ed3df6
Implementation for df-other-vectors-type in C++. Still needs Lua and Ruby support. 2020-05-09 18:28:40 -05:00
lethosor 9e085b66ac Merge branch 'develop' into lua-ref-target 2020-04-27 23:24:29 -04:00
lethosor 7c1d1c43e5 Merge remote-tracking branch 'PatrikLundell/stocks' into develop
Conflicts:
	docs/changelog.txt
2020-04-25 21:12:27 -04:00
lethosor 125f4b129b Add ref_target attribute to primitive field references 2020-04-09 00:02:07 -04:00
Ben Lubar 6b810b97a0
DataDefs.h can have little a documentation 2020-04-07 13:46:44 -05:00
Ben Lubar b29d009b14
update structures; implement struct_field_info_extra 2020-03-21 13:21:35 -05: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
Ben Lubar a214e00407
allow union vectors to have tags that are bit vectors if they have exactly 2 members 2020-03-06 16:48:33 -06:00
Ben Lubar fa574cfbec
allow dfhack-run to output colors.
refactor Console-posix to avoid having a parameter equivalent to not calling the function at all.
2020-03-06 15:02:03 -06:00
Ben Lubar 84cae060b1
move find_union_tag from check-structures-sanity to DataDefs.h 2020-03-04 18:23:49 -06:00
Ben Lubar 18523a1821
Convert untagged unions to tagged. Fix some edge cases in check-structures-sanity union checking. 2020-02-29 15:08:39 -06:00
Ben Lubar 94e818fd53
reference union_identity in the df namespace 2020-02-29 13:26:42 -06:00
Ben Lubar 3ddbb5cec1
fix typo 2020-02-29 13:24:12 -06:00
Ben Lubar a30678cee3
subclass struct_identity for unions 2020-02-29 13:11:23 -06:00
Ben Lubar 0d36e62d81
fix some weird uses of the part of speech enum 2020-02-18 16:39:39 -06:00