Skip to content

Commit

Permalink
Add scripting documentation for WorldMapSector
Browse files Browse the repository at this point in the history
  • Loading branch information
Vankata453 authored Jul 31, 2024
1 parent 5a50578 commit 0e542a3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/worldmap/worldmap_sector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ class WorldMap;

/** Represents one of (potentially) multiple, separate parts of a WorldMap.
WorldMap variant of Sector, utilizing only its base features. */
/**
* @scripting
* @summary This class provides additional controlling functions for a worldmap sector, other than the ones listed at ${SRG_REF_GameObjectManager}.
* @instances An instance under ""worldmap.settings"" is available from scripts and the console.
*/
class WorldMapSector final : public Base::Sector
{
friend class WorldMapSectorParser;
Expand Down Expand Up @@ -104,38 +109,45 @@ class WorldMapSector final : public Base::Sector
bool in_worldmap() const override { return true; }

/**
* @scripting
* Returns Tux's X position on the worldmap.
*/
float get_tux_x() const;
/**
* @scripting
* Returns Tux's Y position on the worldmap.
*/
float get_tux_y() const;

/**
* @scripting
* Changes the current sector of the worldmap to a specified new sector.
* @param string $sector
*/
void set_sector(const std::string& sector);
/**
* @scripting
* Changes the current sector of the worldmap to a specified new sector,
moving Tux to the specified spawnpoint.
* @param string $sector
* @param string $spawnpoint
*/
void spawn(const std::string& sector, const std::string& spawnpoint);
/**
* @scripting
* Moves Tux to the specified spawnpoint.
* @param string $spawnpoint
*/
void move_to_spawnpoint(const std::string& spawnpoint);
void move_to_spawnpoint(const std::string& spawnpoint, bool pan);

/**
* @scripting
* Gets the path to the worldmap file. Useful for saving worldmap-specific data.
*/
std::string get_filename() const;
/**
* @scripting
* Overrides the "Title Screen Level" property for the world with ""filename"".
The newly set level will be used for the title screen, after exiting the world.
* @param string $filename
Expand Down

0 comments on commit 0e542a3

Please sign in to comment.