Commit Graph

236 Commits (c543a17250150723eb9babd1729258645dea400c)

Author SHA1 Message Date
Pauli 1fc37f8ddc Checke Console::lineedit error return values
Console::lineedit can return -1 to indicate input error and -2 to
indicate the program is closing. But most users don't check possible
unusual return values which can lead to exit hang.
2018-06-22 17:57:37 +03:00
lethosor fe458d3ac1 Merge remote-tracking branch 'grubsteak/patch-2' into develop 2018-06-08 22:05:20 -04:00
Pauli e3df5cd765 Port profiler to lua 5.3 and dfhack
Changes include
* table.getn(obj) -> #obj
* Making sure string.rep gets an integer parameter
* Optimized profiling hooks (call profiler cost from factor 40 to 10)
* Specialized parameter name lookup code for c++ __index metamod calls
* Collect source lines in time sampling variant
* Simplified prevent to always filter all children
2018-06-06 19:18:18 +03:00
Daniel Silverstone 96ba5116f7 Add lua Pepperfish Profiler code
Pepperfish Profiler can produce time sampled profiles and call entry
exit profiles. Code is verbatim copy from the lua wiki [1]. This commit
won't work alone but it exists to give author credit correctly to
Daniel.

[1] http://lua-users.org/wiki/PepperfishProfiler

Authors:
Daniel Silverstone <dsilvers@pepperfish.net>
Tom Spilman <tom@sickheadgames.com>
Ben Wilhelm <zorba-pepperfish@pavlovian.net>
2018-06-06 17:27:40 +03:00
lethosor eb199d97b5 Prepend script name to qerror messages, if applicable
Resolves #1282
2018-05-20 09:30:46 -04:00
grubsteak 7e3c8c9965
added fast keys for workshop gui overlay 2018-05-19 20:25:24 -05:00
Lethosor 9ca79d050d
Merge pull request #1259 from AtomicChicken/syndrome-util-updates
syndrome-util: added function to remove syndrome wound data
2018-05-18 14:10:14 -04:00
AtomicChicken c58ffdb922
Added function to remove syndrome wound data
The presence of syndrome data in unit.syndromes.active generates corresponding wound data in unit.body.wounds. This wound data acts to produce all of the syndrome's actual effects, including but not limited to flag changes, interaction abilities, body transformation and display name alterations. Wound data persists when syndrome data is cleared from unit.syndromes.active. Since syndrome-util did not touch wound data at all, the erase function was completely ineffective at actually removing syndromes.

Note that syndromes also generate a bunch of data in the historical figure information of units. I have observed that this historical data is sufficient to restore the syndrome in a unit following map reload (at least in adventure mode), so its clearance (which needs to also include any corresponding interaction effects) will have to be addressed in a future update. As is, syndrome erasure remains incomplete.
2018-04-20 17:14:03 +02:00
lethosor 5081710900 Merge remote-tracking branch 'ThiagoLira/develop' into develop
Also fixed whitespace from #1251

Closes #1186
2018-04-04 17:13:07 -04:00
ThiagoLira b7bd88352e fixed bug causing gui scripts to fail when sidebar is closed 2018-04-04 17:42:46 -03:00
Lethosor 464052fe52
Merge pull request #1237 from warmist/warmist-patch-1
Fix parse_inset in gui.lua
2018-03-11 12:11:24 -04:00
Warmist 25d2938477
Fix parse_inset in gui.lua
It was used in different order than the return happened.
2018-03-11 12:40:30 +02:00
lethosor db95796d4c Many build fixes 2018-03-10 16:53:45 -05:00
lethosor 325e0b0e33 binpatch.lua: check for empty patches 2018-01-31 09:57:11 -05:00
lethosor 2202c781f7 Add a dfhack.script_help() function to assist scripts 2018-01-25 10:55:00 -05:00
lethosor e6651171bf json: Improve IO-related error messages 2017-12-25 14:40:06 -05:00
Quietust 88c7e493b8 Merge ui_area_map_width into ui_menu_width, now a 2-byte array 2017-12-03 20:34:59 -06:00
Ben Lubar 7fed961fcd
Make repeatUtil.cancel work even when called from the callback. Closes #1122. 2017-07-11 15:10:42 -05:00
lethosor cc0220f030 Add a "key" option to EditField and FilteredList 2017-06-27 21:10:14 -04:00
lethosor db375ae83b Add a Pages:getSelectedPage() helper
Equivalent to select(2, pages:getSelected()), but more readable.
2017-06-23 12:46:46 -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 ae1aa49089 Add map parameter to Lua paintTile() and use in Painter
Also updated gui/siege-engine.lua
2017-06-02 12:42:51 -04:00
lethosor 346e8b91a9 Use getDwarfmodeViewDims() in getPanelLayout()
Allows C++ hooks to affect Lua scripts as well
2017-06-01 23:36:02 -04:00
lethosor e51c5fc2cc Allow key_pen option in some widget text 2017-05-28 23:11:37 -04:00
lethosor 8bda738466 df_expr_to_ref: support integer array indices 2017-05-07 16:31:30 -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 318cf92f0b Merge pull request #1079 from Amostubal/patch-1
fix of relations errors.
2017-04-25 21:21:03 -04:00
Amostubal bc47803948 fix of relations errors.
There is a lot more errors in this file, mostly called unk variables... I bet they have names, I've tried to figure out what they were renamed too, but I'm not fully understanding the xml.
2017-04-24 07:07:08 -05:00
lethosor c21b7bf941 Add a Painter:key_string() method 2017-03-01 15:56:50 -05:00
Milo Christiansen 8bd92b6a08 Add a Lua module for getting a tile's material (#1031) 2016-12-27 16:49:46 -05:00
lethosor b1e3c1088c Give loadfile() result a better name for tracebacks 2016-10-19 09:53:12 -04:00
lethosor 85ebbf0e9c Fix df_expr_to_ref for raw userdata 2016-08-24 17:18:55 -04:00
lethosor 6ce470ad57 Add basic lua expression support to memview
Currently just supports basic field accesses (world.x, screen.y.z).
No support for world.x - 4, etc.

Closes #976
2016-08-24 16:26:34 -04:00
lethosor 7487f44fc8 Implement a helper to create lua environments with shortcuts (e.g. scr, unit)
Used in gui/gm-editor and lua

Closes #977
2016-08-23 21:47:41 -04:00
lethosor 2dccd1d0ff Add CheckedArray:__tostring() method 2016-08-22 23:18:30 -04:00
lethosor 0b6597ddb2 Stop field_offset from crashing due to missing vtables
Now, a pointer to NULL is cast to the type in question, avoiding the need to
call new() or delete() with potentially-misaligned types. Also,
virtual_identity::find has been tweaked to prevent it from crashing on NULL
vtable pointers.

This was suggested by Angavrilov.
2016-08-18 15:59:46 -04:00
lethosor c2997b9c79 Fix save_dir 2016-08-18 15:47:40 -04:00
lethosor ee7357b60e x86: fix vector validity check 2016-08-05 17:51:08 -04:00
lethosor e8fe72826f Add new integer types to memscan and update find-offsets 2016-07-29 00:05:12 -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
Warmist 6c64b3441d Fixes to gui/advfort.lua 2016-05-20 13:55:59 +03:00
lethosor c1e44c178f Add on_click/on_rclick handlers to widgets.Label
Closes #919
2016-05-09 21:30:34 -04:00
lethosor b36193857c Add string:startswith(), endswith() 2016-04-16 17:13:41 -04:00
Warmist 7c91b8f755 Add more informative focus_path
This with conjunction of changes in eventful will make the sidebar overlay more bug-free :)
2016-04-10 16:53:18 +03:00
Warmist 8b8ce4eff9 Spelling mistake 2016-04-10 15:45:43 +03:00
Warmist d1c45d00d2 Fix some bugs in workshopOverlay
Fix bugs relating to "remove building"/"suspend remove" part of overlay.
2016-04-10 14:44:09 +03:00
Warmist 80521d1bb1 add onGetSelectedBuilding to workshop overlay
This will make other stuff that depends on dfhack.gui.getSelectedBuilding work with workshop overlay
2016-04-10 12:28:15 +03:00
lethosor 49863a9f32 Add a file-like lua JSON wrapper 2016-04-08 17:40:14 -04:00
lethosor b8bbf5f545 field_offset: Use actual type instances instead of reinterpret_cast(type, 1)
ui_build_selector is a virtual class as of 0.42.06, so reinterpret_cast-ing it
with bad addresses will crash. 'df.new(df.ui_build_selector)' works just fine.
2016-03-22 17:27:53 -04:00
lethosor 7da3c65079 Fix display of arrows in lua filtered list widgets
Fixes #718
2015-10-30 19:16:29 -04:00