diff options
Diffstat (limited to 'src/script/api/script_viewport.hpp')
-rw-r--r-- | src/script/api/script_viewport.hpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/script/api/script_viewport.hpp b/src/script/api/script_viewport.hpp index 542b58095..cae1a5930 100644 --- a/src/script/api/script_viewport.hpp +++ b/src/script/api/script_viewport.hpp @@ -13,6 +13,8 @@ #define SCRIPT_VIEWPORT_HPP #include "script_object.hpp" +#include "script_client.hpp" +#include "script_company.hpp" /** * Class that manipulates the user's viewport. @@ -28,6 +30,38 @@ public: * @pre ScriptMap::IsValidTile(tile). */ static void ScrollTo(TileIndex tile); + + /** + * Scroll the viewport of all players to the given tile, + * where the tile will be in the center of the screen. + * @param tile The tile to put in the center of the screen. + * @pre ScriptObject::GetCompany() == OWNER_DEITY + * @pre ScriptMap::IsValidTile(tile) + */ + static bool ScrollEveryoneTo(TileIndex tile); + + /** + * Scroll the viewports of all players in the company to the given tile, + * where the tile will be in the center of the screen. + * @param company The company which players to scroll the viewport of. + * @param tile The tile to put in the center of the screen. + * @pre ScriptObject::GetCompany() == OWNER_DEITY + * @pre ScriptMap::IsValidTile(tile) + * @pre ResolveCompanyID(company) != COMPANY_INVALID + */ + static bool ScrollCompanyClientsTo(ScriptCompany::CompanyID company, TileIndex tile); + + /** + * Scroll the viewport of the client to the given tile, + * where the tile will be in the center of the screen. + * @param client The client to scroll the viewport of. + * @param tile The tile to put in the center of the screen. + * @pre ScriptGame::IsMultiplayer() + * @pre ScriptObject::GetCompany() == OWNER_DEITY + * @pre ScriptMap::IsValidTile(tile) + * @pre ResolveClientID(client) != CLIENT_INVALID + */ + static bool ScrollClientTo(ScriptClient::ClientID client, TileIndex tile); }; #endif /* SCRIPT_ADMIN_HPP */ |