Add Lua on_mapgen_init callback, and minetest.set_mapgen_params API
[oweals/minetest.git] / src / guiMainMenu.h
index fa5f19defa1b31fdc729db00cf6912a6f4abe2fb..8697344c84e763b493daa0b76e4a50951981a36b 100644 (file)
@@ -29,11 +29,27 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 class IGameCallback;
 
+enum {
+       SERVERLIST_FAVORITES,
+       SERVERLIST_PUBLIC,
+};
+
+enum
+{
+       TAB_SINGLEPLAYER=0,
+       TAB_MULTIPLAYER,
+       TAB_ADVANCED,
+       TAB_SETTINGS,
+       TAB_CREDITS
+};
+
 struct MainMenuData
 {
        // These are in the native format of the gui elements
        // Generic
        int selected_tab;
+       std::string selected_game;
+       std::string selected_game_name;
        // Client options
        std::string servername;
        std::string serverdescription;
@@ -64,7 +80,7 @@ struct MainMenuData
        std::string create_world_gameid;
        bool only_refresh;
 
-       bool serverlist_show_available; // if false show local favorites only
+       int selected_serverlist;
 
        std::vector<WorldSpec> worlds;
        std::vector<SubgameSpec> games;
@@ -72,13 +88,9 @@ struct MainMenuData
 
        MainMenuData():
                // Generic
-               selected_tab(
-#if USE_CURL
-                   1
-#else
-                   0
-#endif
-               ),
+               selected_tab(0),
+               selected_game("minetest"),
+               selected_game_name("Minetest"),
                // Client opts
                fancy_trees(false),
                smooth_lighting(false),
@@ -91,13 +103,7 @@ struct MainMenuData
                // Actions
                only_refresh(false),
 
-               serverlist_show_available(
-#if USE_CURL
-                   true
-#else
-                   false
-#endif
-)
+               selected_serverlist(SERVERLIST_FAVORITES)
        {}
 };
 
@@ -135,6 +141,8 @@ private:
        s32 id;
        IMenuManager *menumgr;
 
+       std::vector<int> m_world_indices;
+
        bool m_is_regenerating;
        v2s32 m_topleft_client;
        v2s32 m_size_client;