6 Commits

Author SHA1 Message Date
Gleb Mazovetskiy 17e6da40f8 Lua: Improve function/property handling
1. Follows advice from
   https://sol2.readthedocs.io/en/latest/functions.html to use
   `set_function` when binding functions.
2. Adds autocomplete support for userdata methods.
3. Simplifies property bindings and improves string handling.
2025-07-20 17:46:35 +02:00
Gleb Mazovetskiy c31836eab8 Split up engine.{h,cpp}
Untangles dependencies by splitting up `engine.{h,cpp}` into 3 files:

1. `primitive_render`
2. `ticks` -- only contains `GetAnimationFrame` for now.
3. `GetWidth2` renamed to `CalculateSpriteTileCenterX` and moved to `levels/dun_tile.hpp`.
2025-01-09 08:51:55 +00:00
Gleb Mazovetskiy a49b1f2d58 Extract Is{Any,None}Of out of engine.hpp
Untangles some of the dependencies
2025-01-08 09:54:56 +09:00
Gleb Mazovetskiy a2b94cc03c Lua: Migrate and organize the rest of debug cmds
Fully migrates debug commands to Lua and organizes them into logical
groups.

The CLI `+` syntax now runs Lua, e.g.:

```bash
build/devilutionx '+dev.player.trn.plr("infra")'
```

Chat hotkeys run Lua code if they start with `/lua`, e.g.:

```ini
[NetMsg]
QuickMessage1=/lua message(dev.player.info())
```
2023-11-07 22:27:48 +00:00
staphen 7df7b35123 Clean up warnings and debugger errors related to the Lua console 2023-11-05 11:50:41 +00:00
Gleb Mazovetskiy 8bffbedcb4 Migrate some debug.cpp commands to Lua
Introduces a new `devilutionx.dev` Lua module, automatically loaded in
the console prelude.

Arguments and basic help are shown in autocompletion.
2023-11-04 20:28:27 +00:00