s_mainmenu.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. Minetest
  3. Copyright (C) 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 "cpp_api/s_base.h"
  18. #include "util/string.h"
  19. #include "gui/guiMainMenu.h"
  20. class ScriptApiMainMenu : virtual public ScriptApiBase {
  21. public:
  22. /**
  23. * Hand over MainMenuDataForScript to lua to inform lua of the content
  24. * @param data the data
  25. */
  26. void setMainMenuData(MainMenuDataForScript *data);
  27. /**
  28. * process events received from formspec
  29. * @param text events in textual form
  30. */
  31. void handleMainMenuEvent(std::string text);
  32. /**
  33. * process field data recieved from formspec
  34. * @param fields data in field format
  35. */
  36. void handleMainMenuButtons(const StringMap &fields);
  37. };