- Check for `userdata` when doing tab auto-completion
- Auto-complete paths (identify a path by a string starting with a "/" character?)
- Add more keyboard shortcuts (candidates)
- Fix history position (should be at the end) after re-opening the DebugConsole
Further DebugConsole improvements
Moderator: Moderator
Further DebugConsole improvements
I want a place to organize my thoughts and get feedback on the in-game DebugConsole.
<DarkGod> lets say it's intended
Re: Further DebugConsole improvements
4. upon bringing up the lua console, arrow-up should scroll commands beginning with the previous command, and arrow-down should scroll through commands beginning with the very first one.
darkgod wrote:OMFG tiger eye you are my hero!
Re: Further DebugConsole improvements
Flashing cursor...
Display the parameters for a function... almost like "help"... (Ctrl-space in a lot of IDE's these days)
Display the parameters for a function... almost like "help"... (Ctrl-space in a lot of IDE's these days)
Re: Further DebugConsole improvements
delete!! I use delete more then backspace generally.
Re: Further DebugConsole improvements
Implementing this could be very tricky indeed. My first thought is to leverage the Luadoc stuff, but I have no idea how to go about doing that. It would be nice, though...Canderel wrote: Display the parameters for a function... almost like "help"... (Ctrl-space in a lot of IDE's these days)
Yup that will definitely be done.edge2054 wrote: delete!! I use delete more then backspace generally.
<DarkGod> lets say it's intended
Re: Further DebugConsole improvements
Alright, here is what I have managed thus far:
- Ctrl+A (Home), Ctrl+E (End), and Delete commands added
- Blinking cursor position
- Path auto-completion
- Check for table during auto-completion (fixes tab on userdata)
<DarkGod> lets say it's intended
Re: Further DebugConsole improvements
Lies, all lies. Make that one lie. Adding a help feature is going to be very easy and I have it nearly completed. I would appreciate suggestions on the interface for it, though. Here are some examples with the cursor denoted by the "|" character:
Also, what should the output look like? I am planning on doing something like this:
- game.zone:addEntity|
- game.zone:add|Entity
Also, what should the output look like? I am planning on doing something like this:
Code: Select all
<<< Help found in /mod/class/Actor.lua line 527 >>>
--- Setup minimap color for this entity
-- You may overload this method to customize your minimap
function _M:setupMinimapInfo(mo, map)
<DarkGod> lets say it's intended
Re: Further DebugConsole improvements
1) is obviously great. Does it give me te parameter names?
2) i think should auto-complete. ie the same as tab, then once chosen do no 1
2) i think should auto-complete. ie the same as tab, then once chosen do no 1
Re: Further DebugConsole improvements
I am not entirely certain what you mean by "parameter names". The last line of the help output will show the actual function definition, so you can see what the function expects there. Some of the function comments also have parameter explanations, for example this would be the help for engine.Actor.move:Canderel wrote:1) is obviously great. Does it give me te parameter names?
Code: Select all
<<< Help found in /engine/Map.lua line 152 >>>
--- Moves an actor on the map
-- *WARNING*: changing x and y properties manually is *WRONG* and will blow up in your face. Use this method. Always.
-- @param map the map to move onto
-- @param x coord of the destination
-- @param y coord of the destination
-- @param force if true do not check for the presence of an other entity. *Use wisely*
-- @return true if a move was *ATTEMPTED*. This means the actor will probably want to use energy
function _M:move(x, y, force)
Fair enough.2) i think should auto-complete. ie the same as tab, then once chosen do no 1
<DarkGod> lets say it's intended
Re: Further DebugConsole improvements
Yeah, just after I posted I saw you added docs up to the full declaration of the function. But was on the phone, so edit is too much hassle. :-/
Great work I must say! That thing is already so awesome it's not even funny.
Get DarkGod to add it before b38!
Only suggestion now is to display the keyboard shortcuts the first time you open the console (every game the 1st time).
Great work I must say! That thing is already so awesome it's not even funny.

Get DarkGod to add it before b38!
Only suggestion now is to display the keyboard shortcuts the first time you open the console (every game the 1st time).
Re: Further DebugConsole improvements
Great suggestion, I added a header to the latest commit. I am not going to touch this again to give you guys some time to test it and give feedback. I let DG know this is in the works so I think it will make it into b38 just fine.Canderel wrote: Only suggestion now is to display the keyboard shortcuts the first time you open the console (every game the 1st time).
<DarkGod> lets say it's intended
Re: Further DebugConsole improvements
Alright, here is a detailed changelog of what I sent DG this morning:
DG suggested adding a real cursor rather than inserting a fake character, and pointed me towards `engine.ui.Textbox` for inspiration. I also want to look at adding a scrollbar at some point (DG suggested `engine.ui.Scrollbar`), but for now I think I will be taking a break from these changes. The changes have had limited testing and I have fixed all the bugs that I and tiger_eye found. If you find anything please let me know and I will fix them and probably release an addon fix as well. Thanks again to everyone that helped!Added a welcome message and keyboard shortcuts.
Added path string auto-completion.
Added a blinking cursor.
Added Ctrl+Space to show a function's help and Ctrl+Shift+Space to show a function's entire definition.
Added Ctrl+K/Ctrl+End to delete to the end of the line.
Added ordered multi-column display to both auto-completion and table display.
Added Page Up/Down scrolling of the history.
Added special cases for table and function auto-completion where a "." and "(" are added, respectively.
Fixed a few bugs.
<DarkGod> lets say it's intended