661 Commits
Author SHA1 Message Date
Gleb Mazovetskiy 647f8c38e4 Slightly improve CJK infobox rendering
It still isn't perfect (there just isn't enough space) but we now
cut off fewer pixels at the bottom.
2024-01-11 09:34:35 +00:00
obligaron b32cc11ad9 Disable chat in singleplayer also for debug builds 2024-01-10 22:18:58 +01:00
Krzysztof Pawlik 43cc74c94e Do not translate chat box commands. 2023-11-15 01:12:55 +01:00
Krzysztof Pawlik 48d0b9da18 Fix typo: "unkown" -> "unknown". 2023-11-14 21:43:10 +01:00
Krzysztof Pawlik 6bc478a694 Reuse two strings, add missing translation. 2023-11-14 21:43:10 +01:00
ephphatha 3b458376bb Use a pointer to a player instance instead of network id for cursor hovering 2023-11-09 17:40:50 +01: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
Gleb Mazovetskiy c5a5dc9f5c Fix a few MSVC warnings 2023-11-05 12:57:59 +00:00
Gleb Mazovetskiy 55b0fc5c26 Text inputs: Selection, copy, cut
Adds shift selection, Ctrl+C, and Ctrl+X handling.

Also fixes left-right movement for non-ASCII characters.
2023-10-30 20:34:12 +00:00
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.
2023-10-25 09:19:14 +01:00
Gleb Mazovetskiy 09ab58343c Migrate gold drop/withdrawal to text_input
With this, all text input is handled in a unified way.
2023-10-24 20:11:04 +01:00
Gleb Mazovetskiy fdb5738815 Add cursor support to DiabloUI and chat
Supports move left/right/home/end, backspace, delete, and Ctrl+V.
2023-10-24 01:56:54 +01:00
qndel ee2b61dae6 Clean up SDL_GetClipboardText in chat paste (#6731) 2023-10-20 16:24:48 +00:00
qndel a9c49b13a1 add pasting to chat 2023-10-20 16:00:36 +02:00
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).
2023-10-14 09:45:24 +01:00
Gleb Mazovetskiy d1d27c8368 Rename error -> diablo_msg 2023-10-14 09:45:24 +01:00
Gleb Mazovetskiy 270a064fe6 Fix "Level Up" label in French
Fixes #6615
2023-10-14 00:14:42 +02:00
Eric Robinson ffc7190898 Automap: Add minimap display option (#6612) 2023-09-26 03:37:35 +02:00
Eric Robinson 4c7e2edd06 Automap: Transparency (#6607) 2023-09-24 21:30:44 +00:00
Anders Jenbo d725fdb4f3 Add screen reader support 2023-09-24 14:16:39 +02:00
Gleb Mazovetskiy 848f234aed Add automap type cycling controls
Makes cycling the automap type separate from toggling it on/off.

The TAB key can still be used for quick on/off as usual, while
the new Cycle key ("m" by default) can be used to switch between available
display types.

`Get/NextDebugMonster` debug keybind changed to "v" to avoid a conflict.
2023-09-20 04:50:52 +01:00
ephphatha 24a20ce8e2 Extract uses of MyPlayer to prevent future crashes in tests/game init 2023-09-20 05:49:54 +02:00
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.
2023-09-20 05:49:54 +02:00
qndel a4c4fd6c9b fix inspect on players where one name is a substring of another 2023-09-05 00:25:08 +02:00
ephphatha da76e131e4 Add getter/setter for character levels to ensure _pNextExper stays synced 2023-08-24 05:46:44 +02:00
Gleb Mazovetskiy ebe8c6e576 Add tl::expected and use it in ParseInt
`std::expected` has been standardized for C++23.
2023-08-19 17:13:54 +09:00
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.
2023-08-16 06:01:03 +09:00
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.
2023-08-14 10:55:02 +01:00
Gleb Mazovetskiy 8c1a847f41 Remove utils/stdcompat/string_view.hpp 2023-08-14 09:59:14 +01:00
Gleb Mazovetskiy c19bfe87fa Remove utils/stdcompat/algorithm.hpp 2023-08-14 01:54:29 +01:00
Gleb Mazovetskiy 14540164a7 Remove utils/stdcompat/optional.hpp 2023-08-14 01:54:29 +01:00
Gleb MazovetskiyandAndrew James 53db86ee9a Use std::from_chars instead of std::stoi
Adds a `ParseInt` function which uses `std::from_chars`.

From `std::from_chars` documentation:
> Unlike other parsing functions in C++ and C libraries,
> std::from_chars is locale-independent, non-allocating, and non-throwing.

Co-authored-by: Andrew James <[email protected]>
2023-08-13 21:43:53 +02:00
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.
2023-08-12 16:24:01 +01:00
Anders Jenbo ad7020be20 Change syntax for optional and required arguments to match various CLI tools 2023-06-26 18:52:39 +02:00
Gleb Mazovetskiy 1167b92692 Remove uses of std::tolower
`std::tolower` relies on the C locale, which we try to avoid.
2023-06-18 04:55:47 +01:00
staphen c2698fc357 [Seedinfo] Display flags for quest state instead of seed 2023-06-05 08:14:56 +02:00
staphen 1cb367ab91 Move seedinfo to text commands 2023-06-04 02:36:52 +02:00
Anders Jenbo 01a7966f1d Empty cursor when closing inventory
Fixes #4205
2023-06-03 20:25:50 +02:00
Gleb Mazovetskiy 4fa3732526 Add missing <cstdint> includes
Done with the following script:

```ruby
Dir["Source/**/*.{h,c,cc,cpp,hpp}"].each do |path|
  v = File.read(path)
  next if !v.include?("uint32_t") || v.include?("cstdint")

  lines = v.lines
  line_num = if lines[2].start_with?(" *")
    lines.index { |l| l.start_with?(" */") } + 3
  else
    3
  end

  lines.insert(line_num, "#include <cstdint>\n")

  File.write(path, lines.join(""))
end
```

then fixed-up manually
2023-05-10 13:50:12 +01:00
ephphatha b102dccf81 Fix OOB array access when spawning arena pots
calling this with a full inventory would write past the end of InvList, potentially causing a crash or data corruption.
2023-05-06 14:43:21 +01:00
FluffyQuack d27eafaf15 Gradually turn durability icon from gold to red 2023-04-16 17:10:44 +02:00
ephphatha 829d6b0d4a address clang-format violations 2023-04-16 08:44:22 +02:00
ephphatha 3690759eb9 Add comments for the logic used when drawing voice buttons 2023-04-16 08:44:22 +02:00
qndel ce2ce86070 inspect players command 2023-04-14 02:40:17 +02:00
obligaron b916c8e428 Introduce Open/Close/ToggleCharPanel 2023-04-14 02:40:17 +02:00
obligaron 1522dc7031 Multiplayer: Add arena potions 2023-04-13 21:20:53 +02:00
obligaron 590c990c80 Introduce Item::getName 2023-04-13 00:07:00 +02:00
obligaron 2296bf5625 Use StashStruct::EmptyCell instead for empty stash item check 2023-03-21 14:15:00 -04:00
Eric Robinson f75f66d54b Add playerdat (#5763) 2023-02-10 12:56:28 +00:00
KPhoenix a1fbf5253f enum talk_id -> enum class TalkID 2023-02-09 13:04:01 +01:00