1 /************************************************************************
3 * voxelands - 3d voxel world sandbox game
4 * Copyright (C) Lisa 'darkrose' Milne 2013-2015 <lisa@ltmnet.com>
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 * See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>
19 * License updated from GPLv2 or later to GPLv3 or later by Lisa Milne
21 ************************************************************************/
23 #ifndef GUIMULTIPLAYERMENU_HEADER
24 #define GUIMULTIPLAYERMENU_HEADER
26 #include "common_irrlicht.h"
28 #include "modalMenu.h"
34 #include "guiPauseMenu.h"
35 #include "guiMainMenu.h"
39 GUI_ID_START_BUTTON
= 101,
40 GUI_ID_CONNECT_BUTTON
,
41 // full list/favourites
45 GUI_ID_REFRESH_BUTTON
,
52 GUI_ID_TAB_MP_MAINMENU
,
54 GUI_ID_TAB_MP_FAVOURITES
,
72 struct MultiplayerMenuData
74 MultiplayerMenuData():
76 selected_tab(TAB_MP_LIST
),
85 std::vector
<ServerInfo
> servers
;
86 std::vector
<ServerInfo
> favourites
;
87 // server address/port/etc is stored in here
91 class GUIMultiplayerMenu
: public GUIModalMenu
95 gui::IGUIEnvironment
* env
,
96 gui::IGUIElement
* parent
,
99 IMenuManager
*menumgr
,
100 IGameCallback
*gamecallback
102 ~GUIMultiplayerMenu();
104 void removeChildren();
106 Remove and re-add (or reposition) stuff
108 void regenerateGui(v2u32 screensize
);
114 bool OnEvent(const SEvent
& event
);
117 MultiplayerMenuData m_data
;
119 IGameCallback
*m_gamecallback
;
124 bool saveFavourites();
125 bool parseFile(std::string data
, std::vector
<ServerInfo
> &list
);