2024-10-28 15:57:39 +01:00
|
|
|
// Luanti
|
|
|
|
// SPDX-License-Identifier: LGPL-2.1-or-later
|
|
|
|
// Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
|
2012-11-26 10:20:57 +02:00
|
|
|
|
2017-08-17 22:19:39 +02:00
|
|
|
#pragma once
|
2012-11-26 10:20:57 +02:00
|
|
|
|
2013-08-11 04:09:45 +02:00
|
|
|
#include "cpp_api/s_base.h"
|
2015-05-19 02:24:14 -04:00
|
|
|
#include "util/string.h"
|
2017-11-09 01:56:20 +03:00
|
|
|
#include "gui/guiMainMenu.h"
|
2013-08-11 04:09:45 +02:00
|
|
|
|
2015-07-17 16:40:41 +02:00
|
|
|
class ScriptApiMainMenu : virtual public ScriptApiBase {
|
2013-08-11 04:09:45 +02:00
|
|
|
public:
|
|
|
|
/**
|
2015-07-17 16:40:41 +02:00
|
|
|
* Hand over MainMenuDataForScript to lua to inform lua of the content
|
|
|
|
* @param data the data
|
2013-08-11 04:09:45 +02:00
|
|
|
*/
|
2023-12-23 13:02:17 +01:00
|
|
|
void setMainMenuData(const MainMenuDataForScript *data);
|
2013-08-11 04:09:45 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* process events received from formspec
|
|
|
|
* @param text events in textual form
|
|
|
|
*/
|
2023-12-23 13:02:17 +01:00
|
|
|
void handleMainMenuEvent(const std::string &text);
|
2013-08-11 04:09:45 +02:00
|
|
|
|
|
|
|
/**
|
2021-09-19 13:46:56 +02:00
|
|
|
* process field data received from formspec
|
2013-08-11 04:09:45 +02:00
|
|
|
* @param fields data in field format
|
|
|
|
*/
|
2015-05-19 02:24:14 -04:00
|
|
|
void handleMainMenuButtons(const StringMap &fields);
|
2025-04-20 21:57:38 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Called before the menu is closed, either to exit or to join a game
|
|
|
|
*/
|
|
|
|
void beforeClose();
|
2013-08-11 04:09:45 +02:00
|
|
|
};
|