Commit Graph

71 Commits

Author SHA1 Message Date
Tom Rochette a783ef75f6 Simple Lua sandbox.
Uses an EnvironmentSandbox to restore the Environment.CurrentDirectory. Will also catch any script exception and redirect them to the Lua console.

With this change, I've tried to replace all the places where Lua is executed so that if an exception occurs, it is catched, sent to the console and a callback is executed if necessary.

This also fixes a small issue where any callback generating an exception would crash BizHawk.
2015-07-01 22:38:19 -04:00
adelikat 6982df8035 Lua console - add a null check on close, LuaImp should never be null unless something went bonkers on load 2015-03-28 01:09:50 +00:00
scepheo 48a6686f31 Lua Console: Command window gives slightly more sensible output now. 2015-02-08 23:47:15 +00:00
adelikat 53cda95ca5 Lua Console - don't nag to save a session, unless a session exists 2015-01-31 01:52:29 +00:00
scepheo 860227ee66 LuaConsole: Actually stop and restart script upon tool restart. 2015-01-29 14:50:09 +00:00
adelikat 6f2488aa57 Lua - clear out lua drawing surface on restart 2015-01-29 03:36:19 +00:00
adelikat 24a517d293 Lua - properly re-inject core dependencies on restart 2015-01-28 14:38:06 +00:00
adelikat 09072acb3b Lua Console - immediate box - in some situations wrap the text in a console.log(), such as if the user simply types a variable name 2015-01-27 23:27:44 +00:00
adelikat 3b13ea4a8f spaces to tabs, good ol whitespace commit 2015-01-27 23:18:48 +00:00
christoph.boehmwalder 99f9d91671 LuaConsole - Fixed tooltip of Duplicate button. 2015-01-03 22:40:11 +00:00
christoph.boehmwalder e11811e2f8 Lua - Added an input box to the script console for on-the-fly command input
Set ImageScaling to None for all buttons in the toolbar in order to fix scaling issues
2015-01-02 19:36:32 +00:00
adelikat b8d667812b convert Lua Console to IToolFormAutoConfig 2015-01-01 17:48:25 +00:00
adelikat a2bee4f88a Lua Console - move "Autoload Session" to the recent session menu 2015-01-01 17:28:34 +00:00
goyuken 08d09bc64f a few more itoolform cleanups 2014-12-15 18:13:54 +00:00
scepheo 769cbeb1a0 - IToolForm: Added RequiredServices attribute to define dependencies, and added EmulatorServices for ToolManager to supply them.
- IServiceProvider, BasicServiceProvider: Added compile-time unknown type versions of GetService and HasService.
- ToolManager: Added IsAvailable to test whether all dependencies for a tool are available.
2014-12-13 21:54:59 +00:00
adelikat 21889bba58 Lua Console - replace a NullEmulator check with a Global.Game != null check as that is more precisely why a check is happening 2014-11-30 18:44:20 +00:00
adelikat 4681fef0c2 Add an IsNull() extension method to IEmulator (checks for null and if NullEmulator) and replace EmuHawk NullEmulator checks with this method instead 2014-11-30 14:18:44 +00:00
adelikat 96b626434f Lua Console - on drag and drop, don't be case sensitive with the file extension 2014-11-26 17:42:30 +00:00
adelikat e4cd7a3449 Lua Console - when reporting a script error, update the number of active scripts label 2014-11-18 01:09:06 +00:00
adelikat 252ea85f99 Lua Console - add a duplicate script menu and toolbar item, functions similarly to new script except it starts with the text from the highlighted script 2014-11-09 16:18:09 +00:00
kylelyk 321c8c64bf Added documentation to IControlMainForm, renamed a few variables, moved IControlMainForm related code in MainForm to the same region. 2014-08-19 19:24:17 +00:00
adelikat fe09023ef6 When closing the lua console - clear the lua surface 2014-08-16 20:09:57 +00:00
adelikat 7ec866ced5 add some extensions to the ControlExtension class for converting cruddy .NET 1.0 collection objects to IEnumerable<T>, and start removing some code in specific forms that work around cruddy .NET 1.0 stuff 2014-07-28 03:01:57 +00:00
adelikat 5d4ff76ed6 Convert a copy/pasted method in a bunch of tool dialogs to an extension method 2014-07-28 02:31:51 +00:00
adelikat ce4ce0bacc Convert some static methods in ToolHelpers to extension methods 2014-07-28 01:51:11 +00:00
adelikat 0397ea1ff4 Remove the CustomControls/Util file and move all the classes into the Form Extensions file, since they were all extension methods for window form objects 2014-07-27 15:22:30 +00:00
adelikat 570f77cc68 Implement FastUpdate() on IToolForm. The intent here is for tools to do the minimum amount necessary when updating. This allows them to avoid slow things like drawing, but do critical activities such as Ram tools incrementing change counters, and loggers can continue logging. When Turboing, instead of bypassing tool updates, the client will run the fast update instead. Note: a few tools still need to be thought out as to what they need to do in a fast update 2014-07-25 01:55:21 +00:00
zeromus 0fe74f95e7 fix LuaConsole PWD-related bugs 2014-06-03 02:39:15 +00:00
adelikat 0782c9820d Lua - implement event.onexit() - fires when the calling script stops execution, supports multiple callbacks per script 2014-05-26 03:08:16 +00:00
adelikat ce6cd2ec5f rip out the lua writer dialog and deeming it a failed experiment. Lua Console - re-implement the new script dialog so that it calls a save file dialog, and if the user picks a file it creates a new lua script with a minimal while loop, and then invokes a new process with this newly created file for quick editing 2014-05-24 01:59:59 +00:00
adelikat 0b6795fffc Some misc cleanup of redundant qualifiers 2014-05-04 14:10:28 +00:00
adelikat 9d7c92fb6e Oops 2014-04-29 21:25:17 +00:00
adelikat 8f35b29a5c Remove extra newline in console.log/print 2014-04-29 20:39:19 +00:00
adelikat 67704b35bf Lua Console - dont' flag changes when change the on/off status of a script as that leads to being nagged too much (for instance, toggling a lua script at any time during recording and then restarting your movie). Remember the file name when creating a new session as to do a Save As during AskSave() 2014-04-22 21:35:04 +00:00
zeromus 7adc15d97e work on opengl display manager: optimized codepaths, user retroshader selection, support for importing a textureID from another core; add erase button to lua console; 2014-04-15 21:46:18 +00:00
adelikat 8ac9f7d2dd Lua Console - try to use relative paths when saving and loading lua scripts 2014-03-23 14:44:18 +00:00
adelikat 4ca0f5792b rip out some lua console code I didn't mean to check in 2014-02-16 23:06:14 +00:00
adelikat 5849d2d80d make the Select All feature built right into VirtualListView instead of writing the same code over and over in the tool dialogs, also make said code faster on large lists 2014-02-15 19:15:04 +00:00
adelikat 05823d3022 fix ButtonCount lua script to use console.log instead of the now deleted console.output, Lua - remove some todos that had been done and some rather useless cleanup 2014-02-14 01:27:38 +00:00
zeromus 96da0880b4 work towards generalizing lua display layers. "emu" and "native" surfaces now work and are accessible from lua. 2014-02-14 00:55:18 +00:00
zeromus da5daaa989 change lua console to have distinct toggle and refresh functions.. since the refresh icon being a toggle function was misleading me and refresh is what i want 100% of the time anyway 2014-02-13 23:25:36 +00:00
adelikat f3755975a1 Lua - implement Always on Top and Floating Window 2014-01-30 22:32:29 +00:00
mvl1986 0a494c386e LuaConsole now updates when a new Luascript is saved in the LuaWriter.
LineNumbers can now be shown in the Writer, only updates when a selectionchanged event occurs, not on the scrolling of the screen.

Option to toggle LineNumbers on and off

-MightyMar
2014-01-24 12:44:55 +00:00
adelikat 8ab655d963 A better fix for something I broke 2014-01-21 16:31:12 +00:00
adelikat 9df0821fcd Lua Console - convert spaces to tabs and remove a todo 2014-01-21 16:25:51 +00:00
mvl1986 a177a111b9 Line 53:
changed: LuaImp = new EmuLuaLibrary(this);
into:    LuaImp = new EmuLuaLibrary();     

-MightyMar
2014-01-21 16:24:03 +00:00
mvl1986 9963518715 Added sorting to the columns in the ListView 2014-01-17 11:51:52 +00:00
adelikat a3a8170c44 Check Global.Config.SupressAskSave in ToolManager instead of doing it in the tool dialogs themselves 2014-01-01 02:09:03 +00:00
adelikat 95c619a0b7 Lua Console - a round of code cleanup 2013-12-19 01:17:53 +00:00
adelikat b2b8edb319 Fix removing of registered functions via Lua console 2013-12-19 01:02:50 +00:00