mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-12 19:18:20 +00:00
Encapsulate CMotd::m_aServerMotd
with getter
This commit is contained in:
parent
f7d7592cb7
commit
53635deb35
|
@ -495,9 +495,9 @@ void CMenus::RenderServerInfo(CUIRect MainView)
|
||||||
Motd.y += ScrollOffset.y;
|
Motd.y += ScrollOffset.y;
|
||||||
|
|
||||||
CUIRect MotdTextArea;
|
CUIRect MotdTextArea;
|
||||||
Motd.HSplitTop((str_countchr(m_pClient->m_Motd.m_aServerMotd, '\n') + 1) * MotdFontSize, &MotdTextArea, &Motd);
|
Motd.HSplitTop((str_countchr(m_pClient->m_Motd.ServerMotd(), '\n') + 1) * MotdFontSize, &MotdTextArea, &Motd);
|
||||||
s_ScrollRegion.AddRect(MotdTextArea);
|
s_ScrollRegion.AddRect(MotdTextArea);
|
||||||
TextRender()->Text(MotdTextArea.x, MotdTextArea.y, MotdFontSize, m_pClient->m_Motd.m_aServerMotd, MotdTextArea.w);
|
TextRender()->Text(MotdTextArea.x, MotdTextArea.y, MotdFontSize, m_pClient->m_Motd.ServerMotd(), MotdTextArea.w);
|
||||||
|
|
||||||
s_ScrollRegion.End();
|
s_ScrollRegion.End();
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,12 +7,13 @@
|
||||||
class CMotd : public CComponent
|
class CMotd : public CComponent
|
||||||
{
|
{
|
||||||
// motd
|
// motd
|
||||||
|
char m_aServerMotd[900];
|
||||||
int64_t m_ServerMotdTime;
|
int64_t m_ServerMotdTime;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
char m_aServerMotd[900];
|
|
||||||
|
|
||||||
virtual int Sizeof() const override { return sizeof(*this); }
|
virtual int Sizeof() const override { return sizeof(*this); }
|
||||||
|
|
||||||
|
const char *ServerMotd() const { return m_aServerMotd; }
|
||||||
void Clear();
|
void Clear();
|
||||||
bool IsActive();
|
bool IsActive();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue