diff options
| author | Alexander Gavrilov | 2012-04-15 21:50:22 +0400 |
|---|---|---|
| committer | Alexander Gavrilov | 2012-04-15 21:50:22 +0400 |
| commit | a1756a864cc7c7a6f498c5cfe96e0a9d0ae57828 (patch) | |
| tree | f3205fe400716aa715db34cec766e1a9ae82f420 /plugins/Dfusion | |
| parent | 14709e5d4598e11ddce6f9d2cce734528d842ca5 (diff) | |
| download | dfhack-a1756a864cc7c7a6f498c5cfe96e0a9d0ae57828.tar.gz dfhack-a1756a864cc7c7a6f498c5cfe96e0a9d0ae57828.tar.bz2 dfhack-a1756a864cc7c7a6f498c5cfe96e0a9d0ae57828.tar.xz | |
Implement a way to do prompts from core context.
The trick obviously is doing it without forcing DF to wait suspended.
Fortunately, lua has built-in coroutine support, so the interactive
prompt can simply yield and rely on the external loop to do the job.
To use this however the REPL had to be replaced with lua code.
Diffstat (limited to 'plugins/Dfusion')
| -rw-r--r-- | plugins/Dfusion/dfusion.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/plugins/Dfusion/dfusion.cpp b/plugins/Dfusion/dfusion.cpp index cfd2e27c..d8710c2d 100644 --- a/plugins/Dfusion/dfusion.cpp +++ b/plugins/Dfusion/dfusion.cpp @@ -123,8 +123,7 @@ command_result lua_run (color_ostream &out, std::vector <std::string> ¶meter { if (!parameters.empty() && parameters[0] == "--core-context") { - CoreSuspender suspend; - Lua::InterpreterLoop(out, Lua::Core::State); + Lua::InterpreterLoop(out, Lua::Core::State, "core lua"); return CR_OK; } |
