OpenMoHAA 0.82.1
Loading...
Searching...
No Matches
uilangamelist.h
1/*
2===========================================================================
3Copyright (C) 2023 the OpenMoHAA team
4
5This file is part of OpenMoHAA source code.
6
7OpenMoHAA source code is free software; you can redistribute it
8and/or modify it under the terms of the GNU General Public License as
9published by the Free Software Foundation; either version 2 of the License,
10or (at your option) any later version.
11
12OpenMoHAA source code is distributed in the hope that it will be
13useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with OpenMoHAA source code; if not, write to the Free Software
19Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20===========================================================================
21*/
22
23#pragma once
24
25class UILanGameList : public UIWidget
26{
27protected:
28 bool m_created;
29 UIVertScroll *m_Vscroll;
30 class UIHorizScroll *m_Hscroll;
31 UIReggedMaterial *m_noservers_mat;
32 UILabel *m_noservers_wid;
33 UIReggedMaterial *m_fill_mat;
34 Container<UIWidget *> m_widgetlist;
35 Container<UIWidget *> m_titlewidgets;
36 Container<UIWidget *> m_miscwidgets;
37 int m_activerow;
38 int m_activeitem;
40 int m_iNumColumns;
41 int m_iPrevNumServers;
42 int m_iCurrNumServers;
43 float m_fCurColumnWidth;
44
45public:
46 CLASS_PROTOTYPE(UILanGameList);
47
48protected:
49 void CreateServerWidgets(void);
50 void DestroyServerWidgets(void);
51 void RepositionServerWidgets(void);
52 void DrawNoServers(UIRect2D frame);
53 void AddColumn(str sName, UIReggedMaterial *pMaterial, int iWidth, Container<str> *csEntries);
54 void AddNoServer(void);
55 virtual void UpdateServers(void);
56
57protected:
58 void FrameInitialized(void) override;
59 void EventScanNetwork(Event *ev);
60 void EventScaningNetwork(Event *ev);
61
62public:
63 UILanGameList();
64 ~UILanGameList();
65
66 bool isDying(void);
67 void Draw() override;
68 qboolean KeyEvent(int key, unsigned int time) override;
69 void Highlight(UIWidget *wid);
70 void Connect(void);
71 void EventConnect(Event *ev);
72 void PlayEnterSound(void);
73 qboolean SetActiveRow(UIWidget *w);
74 void Realign(void) override;
75};
76
77class UILanGameListLabel : public UILabel
78{
79 int m_iLastPressedTime;
80 UILanGameList *m_list;
81
82public:
83 CLASS_PROTOTYPE(UILanGameListLabel);
84
85 UILanGameListLabel();
86 UILanGameListLabel(UILanGameList *list);
87
88 void Pressed(Event *ev);
89 void Unpressed(Event *ev);
90};
Definition container.h:85
Definition listener.h:246
Definition uihorizscroll.h:35
Definition uilabel.h:41
Definition uilangamelist.h:26
Definition uirect2d.h:29
Definition uiwidget.h:36
Definition uivertscroll.h:33
Definition str.h:77