obligaron
22ec684671
Fix some MSVC warnings
2 years ago
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())
```
2 years ago
Gleb Mazovetskiy
b265bbdbb4
Skip console autocomplete when navigating history
2 years ago
Gleb Mazovetskiy
e02dc1f9dd
Console input: Word-wrap-related cursor fixes
...
1. Handle word breaks in the prompt, e.g. `"> " -> "\n"`.
2. Handle word breaks in the original newline for all whitespace, not just `"\n"`.
2 years ago
Gleb Mazovetskiy
4f23762308
Console: Fix crash when there is too much input
...
It doesn't make the field scrollable but at least it doesn't crash.
2 years ago
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.
2 years ago
Gleb Mazovetskiy
b30b712cbb
Lua: Add basic autocomplete in the console
2 years ago
Gleb Mazovetskiy
4a7fa5d13e
Lua console: Add a prelude file
...
Runs lua/repl_prelude.lua at console initialization.
The default prelude contains global assignments for all devilutionx
modules. This should save us on typing.
2 years ago
Gleb Mazovetskiy
dbfa204944
Lua: Set `warn` function
...
Previously, warnings went nowhere.
2 years ago
Gleb Mazovetskiy
17d5f05ada
Fix some compilation warnings
2 years ago
Gleb Mazovetskiy
a9c0f5764c
Console: Use a REPL environment to run code
...
In the REPL environment, we set `print` to print to the UI console
instead of stdout.
2 years ago
Gleb Mazovetskiy
d8c328ad68
Console: Add Ctrl+L binding to clear the console
2 years ago
Gleb Mazovetskiy
63da74300b
Console: Scrolling and history navigation
...
Scrolling: PageUp/Down and mouse wheel.
History navigation:
* Up/Down navigates the input history.
* Shift+Up/Down navigates the output history (allowing us to copy/paste the
outputs, I imagine this will be very handy).
* Duplicates are skipped.
2 years ago
Gleb Mazovetskiy
3ea4996367
Add a basic Quake-style console
...
Enabled only in Debug mode.
Runs Lua similar to the `lua` CLI.
Supports multiline input with Shift+Enter.
Missing features:
1. Scrollback.
2. Input history on up/down.
Open with backtick, close with Esc.
2 years ago
Gleb Mazovetskiy
e5881688f4
`text_render`: Replace optional args with struct
...
4 options args are a bit unwieldy, especially when you want
to pass only the first and the last one.
With a struct, there is no need to specify the default values
for the args in between.
2 years ago
qndel
9abfa51898
fix typo in comment
2 years ago
Gleb Mazovetskiy
88bbf4f913
Improve DiabloMsg handling
...
1. Simplified implementation.
2. Now adjusts the box size to fit the content (e.g. when wrapping
failed or when there are too many lines).
2 years ago
ephphatha
5d50b5520d
Add PlayerData lookup helper to avoid manual casts
...
This lets us remove the PlayersData global, and we can use a helper in the player class for convenience.
3 years ago
Gleb Mazovetskiy
5355146d51
Use structured bindings
3 years ago
ephphatha
e6890cc5cc
Move MaxCharacterLevel to playerdat and add helpers for the various uses
3 years ago
ephphatha
14639cd096
Replace _pNextExper with getter method
...
No real need to persist this value
3 years ago
ephphatha
da76e131e4
Add getter/setter for character levels to ensure _pNextExper stays synced
3 years ago
Gleb Mazovetskiy
9e8465e152
Clean up spell book rendering
3 years ago
KPhoenix
ba6cc56ae8
None to Empty
3 years ago
KPhoenix
6dde0f8a23
Add enum class for spell icons
3 years ago
Gleb Mazovetskiy
d262589021
Support `const` inventory iterators
...
Previously, inventory iterators could only be used with non-const
objects, leading to suboptimal const correctness.
Adds support for `const` objects to inventory iterators via
C++17 CTAD.
3 years ago
Gleb Mazovetskiy
d5446f2f01
Use `std::variant` in `StringOrView`
...
We also add a direct string move-assignment (`operator=(std::string &&)`),
which results in better codegen.
As a consequence, we have to replace `= {}` assignments with `= StringOrView {}`
because `= {}` is now ambiguous.
3 years ago
Gleb Mazovetskiy
8c1a847f41
Remove utils/stdcompat/string_view.hpp
3 years ago
Gleb Mazovetskiy
14540164a7
Remove utils/stdcompat/optional.hpp
3 years ago
Gleb Mazovetskiy
8101e2c0ba
Add `c_any_of` and friends
...
Adds handy helpers for performing algorithms on the entire container.
They're prefixed with `c_` for container.
This naming convention is identical to some popular C++ libraries, such
as Abseil.
3 years ago
Gleb Mazovetskiy
fee948b9c5
Fix character panel label for CJK
...
We fixed clipping in text rendering between 1.4 and 1.5.
This surfaced a bug in the char panel label height.
3 years ago
Gleb Mazovetskiy
5bf0b8bc96
Add more missing <cstdint> includes
...
https://github.com/diasurgical/devilutionX/pull/6095 only added includes
for `uint32_t`, this PR also adds the includes for the remaining
integral types.
3 years ago
ephphatha
829d6b0d4a
address clang-format violations
3 years ago
ephphatha
2ce420425e
Remake talkbutton.clx as a sheet of two sprites
3 years ago
ephphatha
a9f9e2b451
Unroll loop for building alt button states to allow optimising talkbutton.clx
3 years ago
staphen
6bcb4d70e4
Use padmapper bindings on spell icons
3 years ago
qndel
ce2ce86070
inspect players command
3 years ago
obligaron
c945dc8a46
Make SpellPages const
3 years ago
Eric Robinson
f75f66d54b
Add `playerdat` ( #5763 )
3 years ago
Gleb Mazovetskiy
ebcd6b222d
Optimize `SpellData` size: 40 bytes -> 24
3 years ago
Gleb Mazovetskiy
b61dac853b
Add `GetSpellData(SpellID)`
3 years ago
KPhoenix
d813f13700
`enum spell_id` -> `enum class SpellID`
3 years ago
Gleb Mazovetskiy
1788d2f8ec
Remove miniwin
...
Event handling code moved to `engine/events.{hpp,cpp}`.
3 years ago
DakkJaniels
0c1c8d0aa0
fix speedbook crash ( #5730 )
3 years ago
Eric Robinson
049f75515b
Fix bug in ef3a57b7 ( #5732 )
3 years ago
Eric Robinson
ef3a57b7d9
`enum spell_type` -> `enum class SpellType` ( #5674 )
3 years ago
Anders Jenbo
e50e21e0e4
Use outline for spell icon texts
3 years ago
Gleb Mazovetskiy
46e755f680
Simplify spell icon handling
...
Hide the internals of spell icon rendering behind simple functions.
3 years ago
Gleb Mazovetskiy
74ca2ab0db
Use no-background spell icons with UNPACKED_MPQS
...
Spell icons size: 200 KiB -> 81 KiB
Fixes #5470
3 years ago
Gleb Mazovetskiy
6dca019de2
Use `function_ref` instead of `function`
...
`function_ref` is a lightweight function pointer,
whereas `std::function` always involves a heap allocation.
3 years ago