Peoplemon  0.1.0
Peoplemon 3 game source documentation
Public Types | Public Member Functions | List of all members
editor::page::Tileset Class Reference

Subpage for tileset editing and use. Used by the map editor page. More...

#include <Tileset.hpp>

Public Types

enum  Active {
  Tiles , Animations , CollisionTiles , TownTiles ,
  CatchTiles , LevelTiles
}
 
using DeleteCb = std::function< void(core::map::Tile::IdType, bool)>
 

Public Member Functions

 Tileset (bl::engine::Engine &engine, const DeleteCb &deleteCb, MapArea &map)
 Creates the GUI elements. More...
 
bool loadTileset (const std::string &tileset)
 Loads the given tileset and updates the GUI elements. More...
 
void setGUI (bl::gui::GUI *gui)
 Sets the parent GUI object. More...
 
bl::gui::Element::Ptr getContent ()
 Returns the gui element to pack. More...
 
Active getActiveTool () const
 Returns what is currently selected as the active edit type. More...
 
core::map::Tile::IdType getActiveTile () const
 Returns the id of the active tile. More...
 
core::map::Tile::IdType getActiveAnim () const
 Returns the id of the active animation. More...
 
core::map::Collision getActiveCollision () const
 Returns the active collision type. More...
 
std::uint8_t getActiveCatch () const
 Returns the active catch type. More...
 
std::uint8_t getActiveTown () const
 Returns the currently selected town. More...
 
core::map::LevelTransition getActiveLevel () const
 Returns the actively selected level transition type. More...
 
bool unsavedChanges () const
 Returns whether or not the tileset is in a dirty state. More...
 
void markSaved ()
 Marks the tileset clean. More...
 
void refresh ()
 Refreshes the GUI. More...
 

Detailed Description

Subpage for tileset editing and use. Used by the map editor page.

Definition at line 27 of file Tileset.hpp.

Member Typedef Documentation

◆ DeleteCb

using editor::page::Tileset::DeleteCb = std::function<void(core::map::Tile::IdType, bool)>

Definition at line 30 of file Tileset.hpp.

Member Enumeration Documentation

◆ Active

Enumerator
Tiles 
Animations 
CollisionTiles 
TownTiles 
CatchTiles 
LevelTiles 

Definition at line 29 of file Tileset.hpp.

Constructor & Destructor Documentation

◆ Tileset()

editor::page::Tileset::Tileset ( bl::engine::Engine &  engine,
const DeleteCb deleteCb,
MapArea map 
)

Creates the GUI elements.

Parameters
engineThe game engine instance
deleteCbCalled when a tile or animation is removed
mapThe map being edited

Definition at line 32 of file Tileset.cpp.

Member Function Documentation

◆ getActiveAnim()

core::map::Tile::IdType editor::page::Tileset::getActiveAnim ( ) const

Returns the id of the active animation.

Definition at line 183 of file Tileset.cpp.

◆ getActiveCatch()

std::uint8_t editor::page::Tileset::getActiveCatch ( ) const

Returns the active catch type.

Definition at line 187 of file Tileset.cpp.

◆ getActiveCollision()

core::map::Collision editor::page::Tileset::getActiveCollision ( ) const

Returns the active collision type.

Definition at line 185 of file Tileset.cpp.

◆ getActiveLevel()

core::map::LevelTransition editor::page::Tileset::getActiveLevel ( ) const

Returns the actively selected level transition type.

Definition at line 191 of file Tileset.cpp.

◆ getActiveTile()

core::map::Tile::IdType editor::page::Tileset::getActiveTile ( ) const

Returns the id of the active tile.

Definition at line 181 of file Tileset.cpp.

◆ getActiveTool()

Tileset::Active editor::page::Tileset::getActiveTool ( ) const

Returns what is currently selected as the active edit type.

Definition at line 179 of file Tileset.cpp.

◆ getActiveTown()

std::uint8_t editor::page::Tileset::getActiveTown ( ) const

Returns the currently selected town.

Definition at line 189 of file Tileset.cpp.

◆ getContent()

Element::Ptr editor::page::Tileset::getContent ( )

Returns the gui element to pack.

Definition at line 177 of file Tileset.cpp.

◆ loadTileset()

bool editor::page::Tileset::loadTileset ( const std::string &  tileset)

Loads the given tileset and updates the GUI elements.

Parameters
tilesetThe path to the tileset to load
Returns
True on success, false on error

Definition at line 193 of file Tileset.cpp.

◆ markSaved()

void editor::page::Tileset::markSaved ( )

Marks the tileset clean.

Definition at line 250 of file Tileset.cpp.

◆ refresh()

void editor::page::Tileset::refresh ( )

Refreshes the GUI.

Definition at line 252 of file Tileset.cpp.

◆ setGUI()

void editor::page::Tileset::setGUI ( bl::gui::GUI *  gui)

Sets the parent GUI object.

Definition at line 172 of file Tileset.cpp.

◆ unsavedChanges()

bool editor::page::Tileset::unsavedChanges ( ) const

Returns whether or not the tileset is in a dirty state.

Definition at line 248 of file Tileset.cpp.


The documentation for this class was generated from the following files: