Encapsulate CMotd::m_aServerMotd with getter

This commit is contained in:
Robert Müller 2023-02-14 23:56:07 +01:00
parent f7d7592cb7
commit 53635deb35
2 changed files with 5 additions and 4 deletions

View file

@ -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();
}

View file

@ -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();