mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +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;
|
||||
|
||||
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);
|
||||
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();
|
||||
}
|
||||
|
|
|
@ -7,12 +7,13 @@
|
|||
class CMotd : public CComponent
|
||||
{
|
||||
// motd
|
||||
char m_aServerMotd[900];
|
||||
int64_t m_ServerMotdTime;
|
||||
|
||||
public:
|
||||
char m_aServerMotd[900];
|
||||
|
||||
virtual int Sizeof() const override { return sizeof(*this); }
|
||||
|
||||
const char *ServerMotd() const { return m_aServerMotd; }
|
||||
void Clear();
|
||||
bool IsActive();
|
||||
|
||||
|
|
Loading…
Reference in a new issue