Feature: GS methods to scroll viewport for players (#6745)

This commit is contained in:
Pavel Stupnikov
2018-04-24 20:19:01 +03:00
committed by frosch
parent 34b63930f5
commit 8e4bce58ea
8 changed files with 128 additions and 1 deletions

View File

@@ -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 */