For some reason, if we store a t_string in the class and attempt to parse it later, it breaks text boxes (text will be there but not render) (see #9995). Using an std::string does not have that problem. I don't know why.
I considered a variant<typed_formula, t_string>, but since attribute_value is a variant under the hood, it seemed simpler to just use it directly. If that turns out to be a performance hit, we can deal with that later...
Closes#10001
- We now store the attribute list as a class member which is populated in the ctor.
- parse_text_as_formula = false will use a custom formula to resolve the value as a string.
the message now makes it obvious the 'name' key is faulty and covers the case where it is empty. Originally, it only notified that the formula was invalid.
Resolves#9009, closes#9384. Besides the issues that came from having both int and bool conversions (even with bool marked explicit), it doesn't make sense to use int for all numeric assignments. I didn't test whether it would be an issue in practice, but it seems better to let callers be explicit about what type they want for numeric values than risking overflow or wrapping for very large values.
A rich text label widget that can show text marked up with help markup.
Also includes the GUI Test Window, accessible in the title screen after launching wesnoth using --clock option. It can be used as dialog template/example or as a place to test GUI2 code.
assert() is not a good way to handle incorrect user input,
It is a debugging tool that should only be used for
conditions that the program guarantees to be true
(unless there a is a bug in the c++ code).
UI elements with blur effects (such as translucent windows) now defer
rendering for one frame, so they can snapshot the area underneath
for blurring.
In the future this should be done as multiple passes in one frame,
but for now this is fine.
The only real change is that in stead of passing around CVideo
pointers and calling things via CVideo::get_singleton().foo()
one simply does not pass around pointers, and calls video::foo().
Squashed from new_rendering:
* Ported over the basic text texture cache
* Font/Text: fixed bad hashing leading to duplicate textures
* Use text texture drawing method instead of surface one
* Cleaned up and optimized pango_text rendering pipeline
* Font/Text: removed get_width and get_height in favor of just get_size
* Font/Text: guard against caching a null texture
This breaks the credits screen. The game will crash when it tries to
display it.
- Removed overload of set_resolution taking two ints
- Removed get_width and get_height in favor of draw_area
- Removed some dead code
- Minor formatting cleanup