diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp index 3d666c10c..6cea6399c 100644 --- a/src/game/client/gameclient.cpp +++ b/src/game/client/gameclient.cpp @@ -219,7 +219,7 @@ void CGameClient::OnInit() m_pGraphics->AddWindowResizeListener(OnWindowResizeCB, this); // propagate pointers - m_UI.SetGraphics(Graphics(), TextRender()); + m_UI.Init(Graphics(), TextRender()); m_RenderTools.Init(Graphics(), UI(), this); diff --git a/src/game/client/ui.cpp b/src/game/client/ui.cpp index 7565ff43e..75bb16fb8 100644 --- a/src/game/client/ui.cpp +++ b/src/game/client/ui.cpp @@ -44,6 +44,12 @@ void CUIElement::SUIElementRect::Reset() float CUI::ms_FontmodHeight = 0.8f; +void CUI::Init(class IGraphics *pGraphics, class ITextRender *pTextRender) +{ + m_pGraphics = pGraphics; + m_pTextRender = pTextRender; +} + CUI::CUI() { m_pHotItem = 0; diff --git a/src/game/client/ui.h b/src/game/client/ui.h index b46a5a0c3..08d2e697d 100644 --- a/src/game/client/ui.h +++ b/src/game/client/ui.h @@ -200,11 +200,7 @@ public: static float ms_FontmodHeight; // TODO: Refactor: Fill this in - void SetGraphics(class IGraphics *pGraphics, class ITextRender *pTextRender) - { - m_pGraphics = pGraphics; - m_pTextRender = pTextRender; - } + void Init(class IGraphics *pGraphics, class ITextRender *pTextRender); class IGraphics *Graphics() const { return m_pGraphics; } class ITextRender *TextRender() const { return m_pTextRender; } diff --git a/src/game/editor/editor.cpp b/src/game/editor/editor.cpp index 9eb7652ef..dd1bd817d 100644 --- a/src/game/editor/editor.cpp +++ b/src/game/editor/editor.cpp @@ -6129,8 +6129,8 @@ void CEditor::Init() m_pStorage = Kernel()->RequestInterface(); m_pSound = Kernel()->RequestInterface(); CGameClient *pGameClient = (CGameClient *)Kernel()->RequestInterface(); + m_UI.Init(m_pGraphics, m_pTextRender); m_RenderTools.Init(m_pGraphics, &m_UI, pGameClient); - m_UI.SetGraphics(m_pGraphics, m_pTextRender); m_Map.m_pEditor = this; UIEx()->Init(UI(), Kernel(), RenderTools(), Input()->GetEventsRaw(), Input()->GetEventCountRaw());