~tuxpup/love-debugger

Fork of https://github.com/Ranguna/LOVEDEBUG that restores support for LÖVE 10.2
add DataDumper class from the lua wiki
copy files over from upstream, without history, to dance around an issue with a blob that really has their repo over-large.

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~tuxpup/love-debugger
read/write
git@git.sr.ht:~tuxpup/love-debugger

You can also use your local clone with git send-email.

#LÖVE debugging tools

This is a collection of things I find useful debugging LÖVE programs:

  • DataDumper tool from the lua-users wiki

  • A fork of this LÖVE debugger. Because GD-50 currently requires an old build of LÖVE 10.2, the current versions floating around don't work. This is forked right at the point where LÖVE 10 support was dropped.

#DataDumper

Pretty-prints tables for inspection at runtime. Not efficient or anything, but should be seldom used.

Sample:

function dump(...)
    print(DataDumper(...), "\n---")
end

dump({foo=1, bar=2, baz=3})

#LoveDebug

LoveDebug - A whole new way of debugging your game, original created by kalle2990

Tired of having to restart your whole game when an error occurs or attaching a console, which you have to switch to, just to see your debug printings? Tired of adding extra variables in text to your graphical experience, taking space and looks misplaced? Tired of not having the possibility to execute scripts in-game without attaching a GUI or even writing one yourself? Now all of this is unnecessary!

LoveDebug is a community-driven open-development project, the creator has stopped posting in a while so everyone's free to do whatever they want with this code, specially adding new functionalities.


Installing LoveDebug:

  • Put 'lovedebug.lua' wherever you want in your project. (Ex: root of the working directory)
  • Add require('lovedebug') to the beginning of you code in main.lua Ex:
require("lovedebug")

function love.load()
end
  • Launch your game and press Ctrl/Shift + F8
  • And there you have it, your own onscreen interactive console.

#Functionalities:

Key features:

  • Press CTRL/Shift + F8 to Show/Hide the console.
  • Type _DebugSettings.Settings() to see a list of available variables that you can change.
  • Hotswap your code. Press F5 while you are at the console to reload your code or simply set _DebugSettings.LiveAuto to true to automatically reload your code when it has been changed, control the files that should be monitored by editing _DebugSettings.LiveFile
  • HUD feed of everything that is going on under the hood of you application in real time.
  • Code auto completion. Use the arrow keys while you are coding in the console to browse a list of possible auto completions and press tab to auto complete the word.
  • Use Shift+Arrow keys to browse input history.
  • Copy and Paste by pressing Ctrl+C/V

Full Functionality list:

  • A scrollable list of the output.
  • Some errors are redirected to the console instead of crashing löve.
  • Only prints the same error once, useful for errors in love.update, can be toggled.
  • Semi-transparent console overlay, the console's color can be changed in _DebugSettings.OverlayColor
  • Ctrl/Shift + F8 toggle of the console
  • Text input for executing lua snippets right in your console
  • Graphic feedback telling about unseen lines ("..." on the bottom right)
  • Variable proposal and auto completion (select a proposal by using the arrow keys and press tab to auto complete).
  • Fast jumping to the bottom of the console by pressing lCtrl+Middle mouse button or by providing a code to the console.
  • Use the home and end keys to jump to the end or to beginning of the line.
  • Browse code history by using the arrow keys while pressing the Shift key.
  • LiveCoding, you can reload your code by pressing F5 while at the console or by setting _DebugSettings.LiveAuto to true and you can reload more than one file, see _DebugSettings.Settings().
  • Type 'clear' and press enter to clear the console.
  • Type Ctrl+C/V to copy or paste text into the console input.
  • HUD with the latest prints and errors that your application emitted.
  • Add your own ;)
Do not follow this link