private void OnResize() { if (Service.Has <ChatControl>()) { Service.Remove <ChatControl>(); } ClearControls(); Size = new Point(m_WorldWidth + BorderWidth * 2, m_WorldHeight + BorderHeight * 2); AddControl(m_Border = new ResizePic(this, 0, 0, 0xa3c, Width, Height)); AddControl(m_Viewport = new WorldViewport(this, BorderWidth, BorderHeight, m_WorldWidth, m_WorldHeight)); AddControl(m_ChatWindow = new ChatControl(this, BorderWidth, BorderHeight, m_WorldWidth, m_WorldHeight)); Service.Add <ChatControl>(m_ChatWindow); }
private void OnResize() { if (ServiceRegistry.ServiceExists <ChatControl>()) { ServiceRegistry.Unregister <ChatControl>(); } ClearControls(); Size = new Point(m_WorldWidth + BorderWidth * 2, m_WorldHeight + BorderHeight * 2); AddControl(m_Border = new ResizePic(this, 0, 0, 0xa3c, Width, Height)); AddControl(m_Viewport = new WorldViewport(this, BorderWidth, BorderHeight, m_WorldWidth, m_WorldHeight)); AddControl(m_ChatWindow = new ChatControl(this, BorderWidth, BorderHeight, 400, m_WorldHeight)); ServiceRegistry.Register <ChatControl>(m_ChatWindow); }
private void OnResize() { if (ServiceRegistry.ServiceExists<ChatControl>()) ServiceRegistry.Unregister<ChatControl>(); ClearControls(); Size = new Point(m_WorldWidth + BorderWidth * 2, m_WorldHeight + BorderHeight * 2); AddControl(m_Border = new ResizePic(this, 0, 0, 0xa3c, Width, Height)); AddControl(m_Viewport = new WorldViewport(this, BorderWidth, BorderHeight, m_WorldWidth, m_WorldHeight)); AddControl(m_ChatWindow = new ChatControl(this, BorderWidth, BorderHeight, m_WorldWidth, m_WorldHeight)); ServiceRegistry.Register<ChatControl>(m_ChatWindow); }
private void OnResize() { if (ServiceRegistry.ServiceExists<ChatControl>()) ServiceRegistry.Unregister<ChatControl>(); ClearControls(); // border for dragging AddControl(new ResizePic(this, 0, 0, 0xa3c, Width, Height)); // world control! AddControl(new WorldControl(this, BorderWidth, BorderHeight, m_WorldWidth, m_WorldHeight)); // chat! AddControl(m_ChatWindow = new ChatControl(this, BorderWidth, BorderHeight, 400, m_WorldHeight)); ServiceRegistry.Register<ChatControl>(m_ChatWindow); }