Gleb Mazovetskiy
88f706e0d1
SDL3: Add some backports / compat helpers
5 months ago
Anders Jenbo
df82616df1
clang-tidy: auto fix headers for DiabloUI
7 months ago
Anders Jenbo
1c76897f2c
Apply simple const rules using clang-tidy
7 months ago
obligaron
d3bdd4b8cc
Change DiabloUI list callbacks indexes from int to size_t
2 years ago
Gleb Mazovetskiy
ad7ca97ae1
Fix black background palette ( #4831 )
...
Diablo and Hellfire have different palettes in `ui_art\black.pcx`.
We now ship our own tiny `black.pcx` that takes priority over the
other ones. This `black.pcx` had the Diablo palette which resulted in an
incorrect palette in the Settings screen.
Split our own `black.pcx` file into `black_diablo.pcx` and
`black_hellfire.pcx` and load the correct one depending on the mode.
4 years ago
Gleb Mazovetskiy
9e9b656b88
DiabloUI: Render backgrounds as PCX
...
The backgrounds can be quite large, for example
the Hellfire title background is a 2.4 MiB PCX file.
Previously, we converted all background to SDL surfaces.
This required extra memory, e.g. the 2.4 MiB Hellfire
title background uses 4.6 MiB as an SDL surface.
Changes the background to render directly from PCX instead
to reduce the allocator pressure.
4 years ago
obligaron
d86c4e5d84
Introduce GetUIRectangle() to distinguish between UI and main panel
4 years ago
Anders Jenbo
1409e604f5
Reduce string conversions
4 years ago
staphen
af59f7e254
Update fullscreen option in settings menu after Alt+Enter
4 years ago
obligaron
78c0ec1f49
Pass viewportSize to UiList constructor and calculate height from it
4 years ago
Anders Jenbo
6e63354cd1
Remove safe guards around strings own the input for
4 years ago
Anders Jenbo
799f1763af
Performce UTF8 aware limited string copies
4 years ago
Gleb Mazovetskiy
0c694edaba
WordWrapString: Wrap on punctuation
...
Useful for Chinese and Japanese, which do not have spaces between words,
nor whitespace after punctuation.
5 years ago
Anders Jenbo
7771a08d03
Translatable mainpanel
5 years ago
Anders Jenbo
7169882b1f
✨ Implement new font rendering
5 years ago
ephphatha
0575716eac
Rename UiFlags members to group related options
5 years ago
ephphatha
4ad53232a0
Convert the UiFlags enum to a scoped enum type
...
Replace operator&& with named function
5 years ago
Vladimir Olteanu
c57560674e
Use smart pointers for UI items
...
vector::push_back(new Foo(...)) leaks if resizing fails
5 years ago
Anders Jenbo
de4ced7e4f
Clang-tidy: readability-qualified-auto
5 years ago
Anders Jenbo
dbfa9c27a5
✨ Enable translation for all menus
5 years ago
Anders Jenbo
191d98207b
🎨 readability-identifier-naming on DiabloUI
5 years ago
Anders Jenbo
373f28736f
🎨 Acceptable parts of modernize-*
5 years ago
Anders Jenbo
b978d80119
🎨 llvm-include-order
5 years ago
Anders Jenbo
bb4e1960e7
🎨 modernize-use-nullptr
5 years ago
Gleb Mazovetskiy
9468b1da58
🧹 DiabloUI/selyesno.cpp: Move to anonymous namespace
5 years ago
Anders Jenbo
8c821e98d3
🚚 Restructure files
5 years ago
Anders Jenbo
997c1dba55
🚚 Split up all.h in to proper header relations
5 years ago
Anders Jenbo
bfb3c11c2b
🎨 Change namespace to devilution
5 years ago
Anders Jenbo
e280432b92
🚨 Fix all SDL1 warnings
5 years ago
Anders Jenbo
4e8843ee7c
Implement most of the Hellfire menu
...
Still missing is the support screen (functionally identical to the
credit screen)
This also fixes a long standing issue with the menu code where it would
some times return the index and some times the value of the selected
menu item. It now always returns the index and reciver must look up the
value.
6 years ago
Tyler
ecde1f647e
Adjust UI to any resoution
6 years ago
Anders Jenbo
d749e5e6f2
Gard against overflows in UI
6 years ago
BDC
62de5f1600
Refactor DiabloUI to dynamic C++03 compatible code
...
This will help with porting the game to the original Xbox, and also make
it easier to implement dynamic resolutions and translations.
6 years ago
Anders Jenbo
7a90b9102a
When needed, clear buffer before rendering menu
6 years ago
Anders Jenbo
ca82f81582
Move menu elements to the center of the screen
...
Previously the rendering was just shifted which gave the mouse an odd
position and made it impossible to place new elements in the left side.
6 years ago
Anders Jenbo
3ad7e21e71
Fix flashing menu transitions
...
Fixes #591
6 years ago
Anders Jenbo
f7541fbeb9
Ask before overwriting hero
6 years ago
Anders Jenbo
961e7f58c4
Implement UI errors
6 years ago
Gleb Mazovetskiy
6b9a9faebc
Fix hero dialog image
...
Regression introduced in b536d0efa2
Fixes #318
7 years ago
Gleb Mazovetskiy
b536d0efa2
DiabloUI: Handle logo like all the other elements
...
Adds the `animated` flag to `UiImage`, allowing us to
remove special handling for the logo.
7 years ago
Gleb Mazovetskiy
458fbcef88
DiabloUI: Implement some dialogs
...
Partially addresses #303
7 years ago
Gleb Mazovetskiy
17b5011916
DiabloUI: Move art and text code out of diablo.cpp
7 years ago
Gleb Mazovetskiy
78c9453e94
Make the Yes/No dialog list wrap
...
It wraps in Diablo
7 years ago
Gleb Mazovetskiy
2ba268e608
DiabloUI: Better char* handling
...
1. UI structs now use `const char*` because that's the type of C-string
literals.
2. Use `strcpy` instead of `sprintf` where possible.
7 years ago
Gleb Mazovetskiy
37936c6d15
DiabloUI: Refactor UI_Item to tagged unions
...
Makes the code easier to understand.
Also makes building lists easier.
Also fixes focus indicator in SELLOAD_DIALOG (this type of bug is
impossible with the new structs).
7 years ago
Anders Jenbo
18532e7c9b
Format SourceX and SourceS
...
Fixes #262
7 years ago
Gleb Mazovetskiy
cf0f867ca0
DrawArt via SDL
7 years ago
Anders Jenbo
903f136ad0
Match retail behaviour
7 years ago
Anders Jenbo
689e91a425
Adjust font for delete message to match original
7 years ago
danellos
798744b773
Cleaned up includes, fixed missing sound, and fixed spelling error.
7 years ago