Skip to content

Commit

Permalink
feat: Local Lua Debugger support for VSCode! (#671)
Browse files Browse the repository at this point in the history
* Added Local Lua Debugger support for VSCode!

* Add README credit

* Don't know the syntax lol

* Okay ignore this
  • Loading branch information
BenDol authored Dec 8, 2023
1 parent 5ba0768 commit e9ab654
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
- Smooth Walk Elevation Feature by [@SkullzOTS](https://github.com/SkullzOTS)
- View Feature: [Gyazo](https://i.gyazo.com/af0ed0f15a9e4d67bd4d0b2847bd6be7.gif)
- To enable just go to [modules/game_features/features.lua](https://github.com/mehah/otclient/blob/main/modules/game_features/features.lua#L5), and uncomment line 5 (g_game.enableFeature(GameSmoothWalkElevation)).
- Lua Debugger for VSCode [see wiki](https://github.com/mehah/otclient/wiki/Lua-Debugging-(VSCode)) [@BenDol](https://github.com/BenDol)

##### Sponsored (Features)
- Shader with Framebuffer | ([@SkullzOTS](https://github.com/SkullzOTS), [@Mryukiimaru](https://github.com/Mryukiimaru), [@JeanTheOne](https://github.com/JeanTheOne), [@KizaruHere](https://github.com/KizaruHere))
Expand Down
8 changes: 8 additions & 0 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ g_logger.info(g_app.getName() .. ' ' .. g_app.getVersion() .. ' rev ' .. g_app.g
g_app.getBuildCommit() .. ') built on ' .. g_app.getBuildDate() .. ' for arch ' ..
g_app.getBuildArch())

-- setup lua debugger
if os.getenv("LOCAL_LUA_DEBUGGER_VSCODE") == "1" then
require("lldebugger").start()
g_logger.debug("Started LUA debugger.")
else
g_logger.debug("LUA debugger not started (not launched with VSCode local-lua).")
end

-- add data directory to the search path
if not g_resources.addSearchPath(g_resources.getWorkDir() .. 'data', true) then
g_logger.fatal('Unable to add data directory to the search path.')
Expand Down

0 comments on commit e9ab654

Please sign in to comment.