Commit Graph

242 Commits (d414e60ff0445b777fe7b01d3f7efa13cceaa087)

Author SHA1 Message Date
lethosor de731b0299 Move save_dir back into cur_savegame and update submodules 2016-08-14 12:41:09 -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 163207e362 Give more feedback for DF detection failures with mismatched XML versions
This may help address issues where people forget to read the documentation,
don't run "git submodule update", and end up with a df-structures version
that's too old (which is somewhat common, it turns out).
2016-06-30 20:42:27 -04:00
lethosor 022a1bf9e8 Wrap script descriptions in `ls` output and remove description length cap 2016-06-14 21:24:27 -04:00
lethosor b115fdc73f Load script paths from dfhack-config/script-paths.txt 2016-03-27 15:56:23 -04:00
lethosor c23ac50250 Always run dfhack.init-example if dfhack.init doesn't exist
This previously only happened if no files matching *dfhack*.init
existed
2015-12-27 16:39:10 -05:00
lethosor 5263d425a2 Merge remote-tracking branch 'BenLubar/benlubar-init-args' into develop 2015-12-26 13:47:58 -05:00
Ben Lubar 106891f6e0 vim-style +-args. for example, "./dfhack +echo foo" would be equivalent to running ./dfhack and then typing "echo foo" into the console. uses shell argument splitting, so "./dfhack +somecommand 'foo bar' baz" does the right thing. See DFHack#755. 2015-12-26 12:10:44 -06:00
lethosor 9a82f59518 Merge remote-tracking branch 'BenLubar/benlubar-init-args' into develop 2015-12-26 11:49:45 -05:00
lethosor 14f1e6b06c Improve prerelease warning somewhat 2015-12-22 19:34:54 -05:00
Ben Lubar 9bccf457c5 Check for ui_sidebar_menus being null before using it. 2015-12-17 10:54:19 -06:00
Ben Lubar 80ec5ab043 vim-style +-args. for example, "./dfhack +echo foo" would be equivalent to running ./dfhack and then typing "echo foo" into the console. uses shell argument splitting, so "./dfhack +somecommand 'foo bar' baz" does the right thing. See DFHack#755. 2015-12-13 14:03:25 -06:00
lethosor 83603fcf45 Add prerelease build flag and warning script 2015-12-11 20:27:46 -05:00
lethosor df4fb70be2 Provide more suggestions for unrecognized commands 2015-11-25 20:22:14 -05:00
lethosor 875ecf7827 Update Core::top_viewscreen before calling state change handlers
This was previously done right before SC_VIEWSCREEN_CHANGED events
were handled, meaning that code handling earlier events that used
top_viewscreen (rather than getCurViewscreen()) could refer to an
invalid viewscreen, i.e. in the tick after it was deleted.

Fixes #747
2015-11-14 21:48:51 -05:00
lethosor 2882422a3e Don't require short script help to start with a space
Ref #742
2015-11-09 22:58:46 -05:00
lethosor 8412a496dd Remove extra check for "type" command 2015-11-05 19:09:14 -05:00
lethosor 83991d2a22 plug: Don't color loaded plugins 2015-10-30 18:45:55 -04:00
lethosor 1250bb5204 type: Provide more useful information (script paths, plugin names) 2015-10-27 17:34:32 -04:00
lethosor c44ac8ec6e Improve handling of fatal errors and errors in dfhack.lua
* Several fatal errors that occurred during core initialization didn't
  stop initialization or set 'errorstate' properly, which caused
  update hooks and other code to crash later. This has been fixed and
  should address crashes like the one mentioned in #470.
* Errors when loading dfhack.lua now cause Lua::Open() to fail, which
  triggers a fatal error in Core::Init()
* Failure to initialize the console no longer results in a call to
  fatal() (since it didn't actually stop initialization previously)
2015-10-17 21:18:04 -04:00
lethosor 5387c03ea0 DFHackVersion: Expose whether the built commit is tagged 2015-10-17 15:35:40 -04:00
lethosor c2267013b4 plug: List enabled state 2015-10-03 13:42:20 -04:00
lethosor b16e59b91c Check for existence of save folder before attempting to log events
cur_savegame.save_dir can be populated when the save directory does
not yet exist after world generation (since the game can be aborted
at that stage without saving).
2015-09-26 14:26:44 -04:00
lethosor fa60ccdd52 Don't find scripts from the last loaded world's raw/scripts folder 2015-09-26 14:26:13 -04:00
lethosor 91a1836439 Fix a few issues with init file variations
* GCC does not allow std::string instances or enums without a base
  type to be passed as varargs
* Fixed path concatenation issue causing dfhack.init to not be loaded
2015-09-21 18:57:58 -04:00
expwnent af90d14cb2 Use shenanigans to make a certain table const. 2015-09-21 17:24:51 -04:00
expwnent 5bf3093139 Now it looks for dfhack*.init instead of just dfhack.init, onLoad*.init instead of just onLoad.init, etc. 2015-09-15 07:27:42 -04:00
lethosor 9eb86c7e38 Support additional script search paths
These can currently be added/removed from C++ or through the Lua API.
2015-09-06 16:23:02 -04:00
lethosor 66c7a461fd Don't attempt to copy non-files into dfhack-config 2015-09-03 15:02:51 -04:00
lethosor 9eac4585b1 keybinding: support 0-9, F10-F12 2015-09-02 15:56:53 -04:00
lethosor a5f15b279c plug: Include deleted plugins in full list 2015-08-14 19:32:41 -04:00
lethosor 4fc6cb6f17 Several PluginManager improvements
* load/unload/reload are no longer restricted to plugins that exist
  on startup
* Names passed to DFHACK_PLUGIN must match the plugin's filename
  (remotefortressreader vs RemoteFortressReader, counters vs probe)
* "plug" output lists all plugins and state/command information
* Deleted plugins can be reloaded again if they are replaced
* load/unload/reload don't fail silently with broken plugins
* Built-in commands are recognized internally (e.g. "help help"
  does not display "help is not a recognized command"), although help
  for them is not yet implemented
* New command: "type" (bash-like) - shows where/how a command is
  implemented
* "plug" can accept multiple plugin names
* "ls" displays more information about unloaded/unrecognized plugins
* "load all" changed to "load -all" (or "load --all", "load -a", ...)
2015-08-14 16:11:23 -04:00
lethosor f46d3d137f Allow multiple contexts to be specified when adding keybindings 2015-08-06 20:41:54 -04:00
lethosor cc5045d6df Fix Alt-E/U/N bindings on OS X 2015-07-29 10:32:19 -04:00
lethosor f387eb2960 Fix an issue where Ctrl-*-A and Ctrl-*-Z keybindings were not properly detected 2015-07-29 09:35:09 -04:00
lethosor 27295a9b6f Log DFHack and save-specific information on world (un)load events 2015-07-23 23:24:00 -04:00
lethosor ee7a2c7db7 Add git commit information to libdfhack-version
git is run every time 'make' is run, but the generated include file
is only updated when necessary. Plugins will be loaded successfully
if their DFHack version matches core's (assuming OpenLibrary()
succeeds), but will produce a warning if their git commit doesn't
match core's.
2015-06-24 19:32:45 -04:00
lethosor 5bb5d87ad8 Install default dfhack-config files
Files from the "dfhack-config" source directory are now installed to
"dfhack-config/default" and copied to "dfhack-config" on startup if
they don't already exist. Previously, config files weren't available
at all unless they were manually installed (93c9a41).
2015-06-18 08:59:01 -04:00
lethosor 96f3bdafb4 Implement an internal command to interrupt running Lua scripts
This inserts a debug hook that runs every 256 instructions by
default, which has a minimal impact on performance.
2015-05-24 19:06:01 -04:00
lethosor 42a6cfaee6 Improve Lua enable/disable error handling 2015-05-08 18:03:19 -04:00
lethosor eaf282c18e Allow lua scripts to be enabled and disabled with built-in commands 2015-05-08 18:03:19 -04:00
lethosor 4b124bc022 Avoid including DFHackVersion.h in PluginManager.h
Changes to DFHackVersion.h previously required recompiling nearly all
of the DFHack core.
2015-04-03 14:02:14 -04:00
lethosor 786581689f Move get_dfhack_version() to a separate namespace and add a few other version-related functions 2015-04-02 16:37:58 -04:00
lethosor 331be2b589 Make "keybinding list" accept a context
See #588
2015-03-30 19:03:16 -04:00
lethosor 1591e67bf2 Replace backslashes with forward slashes in command names 2015-03-06 16:53:57 -05:00
lethosor 0c09feae5b Prevent backslashes from being used in command names 2015-02-27 18:46:29 -05:00
lethosor 0f77a1a578 Move DFHack version to a separate (static) library
This allows the DFHack version to be changed without recompiling
everything
2015-02-19 12:08:23 -05:00
lethosor 10cfef0553 Fix whitespace issues 2015-02-14 22:53:06 -05:00
lethosor 56dfc66309 Implement map load/unload scripts and allow additional scripts to be registered 2015-02-11 15:03:47 -05:00
lethosor 15d3b7831f hide/show: Provide feedback on unsupported platforms 2015-02-08 09:30:40 -05:00