mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
srb2::Draw: TextElement enhancements
- Add default constructor - Add text method with no arguments: returns TextElement that inherits font and flags from drawer
This commit is contained in:
parent
1d1d1d8a27
commit
0d765d9fd1
1 changed files with 5 additions and 1 deletions
|
|
@ -75,6 +75,8 @@ public:
|
||||||
class TextElement
|
class TextElement
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
explicit TextElement() {}
|
||||||
|
|
||||||
explicit TextElement(std::string string) : string_(string) {}
|
explicit TextElement(std::string string) : string_(string) {}
|
||||||
|
|
||||||
template <class... Args>
|
template <class... Args>
|
||||||
|
|
@ -157,6 +159,8 @@ public:
|
||||||
template <class... Args>
|
template <class... Args>
|
||||||
void text(fmt::format_string<Args...> format, Args&&... args) const { text(fmt::format(format, args...)); }
|
void text(fmt::format_string<Args...> format, Args&&... args) const { text(fmt::format(format, args...)); }
|
||||||
|
|
||||||
|
TextElement text() const { return TextElement().font(font_).flags(flags_); }
|
||||||
|
|
||||||
void patch(patch_t* patch) const;
|
void patch(patch_t* patch) const;
|
||||||
void patch(const char* name) const;
|
void patch(const char* name) const;
|
||||||
|
|
||||||
|
|
@ -238,7 +242,7 @@ public:
|
||||||
|
|
||||||
#define VOID_METHOD(Name) \
|
#define VOID_METHOD(Name) \
|
||||||
template <typename... Args>\
|
template <typename... Args>\
|
||||||
void Name (Args&&... args) const { return chain_.Name(std::forward<Args>(args)...); }
|
auto Name (Args&&... args) const { return chain_.Name(std::forward<Args>(args)...); }
|
||||||
|
|
||||||
VOID_METHOD(text);
|
VOID_METHOD(text);
|
||||||
VOID_METHOD(patch);
|
VOID_METHOD(patch);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue