Gleb Mazovetskiy
8514cc80a9
Migrate embedded button data to PCX
...
It is a bit smaller that way.
Also renders the non-embedded dialogs as PCX.
The embedded dialog is still raw pixel data because it is larger as PCX.
4 years ago
Gleb Mazovetskiy
5df03f56e3
DiabloUI: Render scrollbar as PCX
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
Gleb Mazovetskiy
c2917b1dc8
DiabloUi: Load animated PCX sprites as CEL
...
Reduces memory usage in menu (and thus the overall allocator pressure)
4 years ago
staphen
90132b23cc
Fix viewport size of UiList in constructor
4 years ago
Bubio
9574fb30fe
FIX: Selecting Quit Game opens into the Support menu #4334
4 years ago
ephphatha
5d3f161e7b
Use string_view for UiEdit hint
...
Now that platforms with C APIs have been updated to take string_views in the C++ wrappers
4 years ago
Anders Jenbo
1409e604f5
Reduce string conversions
4 years ago
ephphatha
88d9d0ffab
Use string_view for UiArtTextButton, UiButton
4 years ago
Andrew James
5046b1288d
Apply clang-tidy configuration to (some of) ui_item.h ( #3719 )
4 years ago
obligaron
721e05d5e0
Add DrawStringWithColors support to UiListItem
4 years ago
Gleb Mazovetskiy
c57644970f
Move `UiFlags` and `UiPanels` into their own files
...
The first breaks circular dependency between `DiabloUI` and `text_render`.
The latter one moves `UiPanels` to a more appropriate place.
4 years ago
obligaron
78c0ec1f49
Pass viewportSize to UiList constructor and calculate height from it
4 years ago
Gleb Mazovetskiy
7e1fea6f76
clang-format all files in {Source,test}/
...
Also includes a few manual tweaks to comments and newlines for better results.
Co-authored-by: Anders Jenbo <anders@jenbo.dk>
4 years ago
obligaron
55dea2e39e
Introduce UiFlags::NeedsNextElement
4 years ago
obligaron
918122ecb1
UiListItem can have individual UiFlags
4 years ago
staphen
ffbbcc6d62
Support unencrypted multiplayer games with no password
4 years ago
ephphatha
a13cb6ec7e
Providing a basic template specialisation approach to using enums as flags only for certain types.
...
Now hopefully works with GCC 6?
4 years ago
Gleb Mazovetskiy
ff9affa513
Fix a couple of noisy MSVC warnings
5 years ago
Anders Jenbo
4dd8b121ec
Replace TTF with PCX font
5 years ago
Anders Jenbo
7771a08d03
Translatable mainpanel
5 years ago
Anders Jenbo
7169882b1f
✨ Implement new font rendering
5 years ago
Aaron Sun
3ee90ca629
Add options for sub-panel alignment
5 years ago
ephphatha
8930b789d6
Rename UiType members to follow naming convention
...
Convention seems to be that scrollbar is treated as a single unhyphenated word so the UiScrollbar class was renamed to match.
5 years ago
ephphatha
0575716eac
Rename UiFlags members to group related options
5 years ago
ephphatha
bd140142c3
Convert UiType to a scoped enum
5 years ago
ephphatha
7d93cada67
Refactor UiItemBase and derived types to reduce duplicate constructors
...
Using optional arguments where possible so that all use cases can share the same constructor. Also moving member initialisation to the initialiser list syntax as this makes it clear that the derived class is only setting properties on that class, leaving the parent constructor to initialise members of the parent class.
5 years ago
ephphatha
4ad53232a0
Convert the UiFlags enum to a scoped enum type
...
Replace operator&& with named function
5 years ago
Anders Jenbo
a19e7b2a3b
Remove some more use of miniwin
5 years ago
obligaron
1956c6a1c2
Fix some 64bit warnings
5 years ago
obligaron
91fe708e8f
Fix warnings in ui_item.h
5 years ago
Vladimir Olteanu
ed9b105299
DiabloUI: make UiArtText follow mutating char*
5 years ago
Vladimir Olteanu
c57560674e
Use smart pointers for UI items
...
vector::push_back(new Foo(...)) leaks if resizing fails
5 years ago
staphen
9ca9de3eba
Add virtual keyboard hints and 3DS keyboard improvements
5 years ago
thebigMuh
7fbcfeb35c
Adding text rendering flag to adjust spacing to fit horizontally
...
Now also works for multiline strings
5 years ago
Anders Jenbo
68923c6c33
✨ Generic game text render function
...
This should gradually replace all the direct rendering of game texts
throughout the code. The interface is made to closly mirror that of the
art fonts as that is what will eventually be used for rendering Unicode
fonts both in the menus and ingame.
fixup! ✨ Generic game text render function
5 years ago
Gleb Mazovetskiy
295b5bce81
🧹 DiabloUI: Clean up text render cache
...
Cleans up the handling of text render cache for `UiText` and `UiButton`.
This also happens to fix a memory leak (`FreeCache` was never called).
5 years ago
Anders Jenbo
8c821e98d3
🚚 Restructure files
5 years ago
Anders Jenbo
6e1a106a38
🚚 Move header we implement into the project
5 years ago
Anders Jenbo
819fd40376
🎨 Consistent enum value style ( #1458 )
5 years ago
Anders Jenbo
e7ae8ddd04
🚚 Move all enums to there respective headers
5 years ago
Anders Jenbo
bfb3c11c2b
🎨 Change namespace to devilution
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
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
c32f33f19f
Use safe ranges instead of decltype() for C++03 compatability
...
SDL2 uses int, but SDL1.2 uses Uint16 and Sint16.
6 years ago
Anders Jenbo
69ad34f58f
Consistently use NULL instead of nullptr
...
While nullptr does have extra checking, most of the code uses NULL and
nullptr makes it harder to port the code to some targets like the
original XBox
6 years ago
Anders Jenbo
ba9288c6cf
Unify error dialogs, for looks and portability
...
- Use UiOkDialog() to display all error messages
- Add SDL simple message, and console fallbacks to UiOkDialog()
- Boot graphics early on to facilitate most error messages with build in
gui
- Some more miniwin clean ups
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
aa3a8fecd5
DiabloUI: Dialog positioning and other tweaks
7 years ago
Gleb Mazovetskiy
458fbcef88
DiabloUI: Implement some dialogs
...
Partially addresses #303
7 years ago