clientlauncher.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. Minetest
  3. Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU Lesser General Public License as published by
  6. the Free Software Foundation; either version 2.1 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public License along
  13. with this program; if not, write to the Free Software Foundation, Inc.,
  14. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  15. */
  16. #pragma once
  17. #include "irrlichttypes_extrabloated.h"
  18. #include "client/inputhandler.h"
  19. #include "gameparams.h"
  20. class RenderingEngine;
  21. class ClientLauncher
  22. {
  23. public:
  24. ClientLauncher() = default;
  25. ~ClientLauncher();
  26. bool run(GameParams &game_params, const Settings &cmd_args);
  27. protected:
  28. void init_args(GameParams &game_params, const Settings &cmd_args);
  29. bool init_engine();
  30. void init_input();
  31. bool launch_game(std::string &error_message, bool reconnect_requested,
  32. GameParams &game_params, const Settings &cmd_args);
  33. void main_menu(MainMenuData *menudata);
  34. void speed_tests();
  35. bool list_video_modes = false;
  36. bool skip_main_menu = false;
  37. bool use_freetype = false;
  38. bool random_input = false;
  39. std::string address = "";
  40. std::string playername = "";
  41. std::string password = "";
  42. InputHandler *input = nullptr;
  43. MyEventReceiver *receiver = nullptr;
  44. gui::IGUISkin *skin = nullptr;
  45. gui::IGUIFont *font = nullptr;
  46. SubgameSpec gamespec;
  47. WorldSpec worldspec;
  48. bool simple_singleplayer_mode = false;
  49. // These are set up based on the menu and other things
  50. // TODO: Are these required since there's already playername, password, etc
  51. std::string current_playername = "inv£lid";
  52. std::string current_password = "";
  53. std::string current_address = "does-not-exist";
  54. int current_port = 0;
  55. };