Peoplemon  0.1.0
Peoplemon 3 game source documentation
EditMap.hpp
Go to the documentation of this file.
1 #ifndef EDITOR_COMPONENTS_EDITMAP_HPP
2 #define EDITOR_COMPONENTS_EDITMAP_HPP
3 
4 #include <BLIB/Cameras/2D/Camera2D.hpp>
5 #include <BLIB/Interfaces/GUI.hpp>
6 #include <Core/Items/Id.hpp>
7 #include <Core/Maps/Map.hpp>
10 
11 namespace editor
12 {
13 namespace page
14 {
15 class Map;
16 class Towns;
17 } // namespace page
18 
19 namespace component
20 {
26 class EditMap
27 : public bl::gui::Element
28 , public core::map::Map {
29 public:
31  typedef std::shared_ptr<EditMap> Ptr;
32 
34  using PositionCb = std::function<void(const sf::Vector2f& pixels, const sf::Vector2i& tiles)>;
35 
37  using ActionCb = std::function<void()>;
38 
42  enum struct RenderOverlay {
44  None,
45 
47  Collisions,
48 
50  CatchTiles,
51 
53  Towns,
54 
56  Events,
57 
59  Spawns,
60 
63  };
64 
75  static Ptr create(const PositionCb& clickCb, const PositionCb& moveCb, const ActionCb& actionCb,
76  const ActionCb& syncCb, core::system::Systems& systems);
77 
81  virtual ~EditMap();
82 
86  bool unsavedChanges() const;
87 
91  const std::string& currentFile() const;
92 
102  void newMap(const std::string& filename, const std::string& name, const std::string& tileset,
103  unsigned int width, unsigned int height);
104 
111  bool editorLoad(const std::string& filename);
112 
118  bool editorSave();
119 
123  const char* undoDescription() const;
124 
128  void undo();
129 
133  const char* redoDescription() const;
134 
138  void redo();
139 
143  void setControlsEnabled(bool enabled);
144 
151  void setLevelVisible(unsigned int level, bool visible);
152 
160  void setLayerVisible(unsigned int level, unsigned int layer, bool visible);
161 
168  void setRenderOverlay(RenderOverlay overlay, unsigned int level);
169 
173  void showGrid(bool show);
174 
181  void showSelection(const sf::IntRect& selection);
182 
190  void removeAllTiles(core::map::Tile::IdType id, bool isAnim);
191 
192  void resize(unsigned int width, unsigned int height, bool modLeft, bool modTop);
193 
199  void setName(const std::string& name);
200 
206  void setPlaylist(const std::string& playlist);
207 
214 
220  void setOnEnterScript(const std::string& script);
221 
225  const std::string& getOnEnterScript() const;
226 
232  void setOnExitScript(const std::string& script);
233 
237  const std::string& getOnExitScript() const;
238 
246  void setAmbientLight(std::uint8_t lower, std::uint8_t upper, bool sunlight);
247 
251  void appendLevel();
252 
259  void shiftLevel(unsigned int level, bool up);
260 
266  void removeLevel(unsigned int level);
267 
273  void appendBottomLayer(unsigned int level);
274 
280  void appendYsortLayer(unsigned int level);
281 
287  void appendTopLayer(unsigned int level);
288 
297  void shiftLayer(unsigned int level, unsigned int layer, bool up);
298 
305  void removeLayer(unsigned int level, unsigned int layer);
306 
316  void setTile(unsigned int level, unsigned int layer, const sf::Vector2i& position,
317  core::map::Tile::IdType id, bool isAnim);
318 
328  void setTileArea(unsigned int level, unsigned int layer, const sf::IntRect& area,
329  core::map::Tile::IdType id, bool isAnim);
330 
340  void fillTile(unsigned int level, unsigned int layer, const sf::Vector2i& position,
341  core::map::Tile::IdType id, bool isAnim);
342 
350  void setCollision(unsigned int level, const sf::Vector2i& position, core::map::Collision id);
351 
359  void setCollisionArea(unsigned int level, const sf::IntRect& area, core::map::Collision id);
360 
368  void fillCollision(unsigned int level, const sf::Vector2i& position, core::map::Collision id);
369 
377  void setCatch(unsigned int level, const sf::Vector2i& position, std::uint8_t id);
378 
386  void setCatchArea(unsigned int level, const sf::IntRect& area, std::uint8_t id);
387 
395  void fillCatch(unsigned int level, const sf::Vector2i& position, std::uint8_t id);
396 
403  bool spawnIdUnused(unsigned int id) const;
404 
413  void addSpawn(unsigned int level, const sf::Vector2i& tile, unsigned int id,
414  bl::tmap::Direction dir);
415 
422  void rotateSpawn(unsigned int level, const sf::Vector2i& tile);
423 
430  void removeSpawn(unsigned int level, const sf::Vector2i& position);
431 
437  void addNpcSpawn(const core::map::CharacterSpawn& spawn);
438 
446  const core::map::CharacterSpawn* getNpcSpawn(unsigned int level,
447  const sf::Vector2i& position) const;
448 
455  void editNpcSpawn(const core::map::CharacterSpawn* orig,
456  const core::map::CharacterSpawn& spawn);
457 
463  void removeNpcSpawn(const core::map::CharacterSpawn* spawn);
464 
472  std::pair<core::item::Id, bool> getItem(unsigned int level, const sf::Vector2i& position);
473 
482  void addOrEditItem(unsigned int level, const sf::Vector2i& position, core::item::Id item,
483  bool visible);
484 
491  void removeItem(unsigned int level, const sf::Vector2i& position);
492 
499  void setLight(const sf::Vector2i& positionPixels, unsigned int radius);
500 
506  void removeLight(const sf::Vector2i& positionPixels);
507 
513  void createEvent(const core::map::Event& event);
514 
521  const core::map::Event* getEvent(const sf::Vector2i& position);
522 
529  void editEvent(const core::map::Event* orig, const core::map::Event& event);
530 
536  void removeEvent(const core::map::Event* event);
537 
541  void addCatchRegion();
542 
546  const std::vector<core::map::CatchRegion>& catchRegions() const;
547 
554  void editCatchRegion(std::uint8_t index, const core::map::CatchRegion& zone);
555 
561  void removeCatchRegion(std::uint8_t index);
562 
566  void addTown();
567 
574  void editTown(std::uint8_t i, const core::map::Town& town);
575 
581  void removeTown(std::uint8_t i);
582 
589  void setTownTile(const sf::Vector2i& position, std::uint8_t id);
590 
597  void setTownTileArea(const sf::IntRect& area, std::uint8_t id);
598 
605  void fillTownTiles(const sf::Vector2i& position, std::uint8_t id);
606 
613  void setLevelTile(const sf::Vector2i& position, core::map::LevelTransition lt);
614 
621  void setLevelTileArea(const sf::IntRect& area, core::map::LevelTransition lt);
622 
628  void staticRender(const RenderMapWindow& params);
629 
630 private:
631  struct Action {
632  using Ptr = std::shared_ptr<Action>;
633 
634  virtual ~Action() = default;
635  virtual bool apply(component::EditMap& map) = 0;
636  virtual bool undo(component::EditMap& map) = 0;
637  virtual const char* description() const = 0;
638  };
639  std::vector<Action::Ptr> history;
640  unsigned int historyHead;
641  unsigned int saveHead;
642  void addAction(const Action::Ptr& action);
643 
644  struct EditCameraController : public bl::cam::CameraController2D {
645  EditCameraController(EditMap* owner);
646  virtual ~EditCameraController() = default;
647  virtual void update(float dt) override;
648  void reset(const sf::Vector2i& size);
649  void zoom(float z);
650  void updateDepthPlanes();
651  bl::cam::Camera2D& getCamera() { return camera(); }
652 
653  EditMap* owner;
654  bool enabled;
655  glm::vec2 mapSize;
656  float zoomAmount;
657  };
658 
659  const PositionCb clickCb;
660  const PositionCb moveCb;
661  const ActionCb actionCb;
662  const ActionCb syncCb;
663  EditCameraController* camera;
664  bool controlsEnabled;
665  std::string savefile;
666  std::vector<bool> levelFilter;
667  std::vector<std::vector<bool>> layerFilter;
668  sf::IntRect selection;
669 
670  struct SpawnGraphics {
671  bl::gfx::Sprite arrow;
672  bl::gfx::Text label;
673  };
674 
675  struct CatchTileLayerGraphics {
676  bl::gfx::BatchedShapes2D shapeBatch;
677  bl::ctr::Vector2D<bl::gfx::BatchRectangle> tiles;
678 
679  ~CatchTileLayerGraphics();
680  };
681 
682  struct BatchSpriteOverlayLayer {
683  bl::gfx::BatchedSprites batch;
684  bl::ctr::Vector2D<bl::gfx::BatchSprite> tiles;
685 
686  ~BatchSpriteOverlayLayer();
687  };
688 
689  bl::gfx::Rectangle selectRect;
690  bl::ctr::Vector2D<bl::gfx::BatchRectangle> townSquares;
691  bl::gfx::BatchedShapes2D townSquareBatch;
692  bl::gfx::VertexBuffer2D grid;
693  std::unordered_map<unsigned int, SpawnGraphics> spawnSprites;
694  std::list<CatchTileLayerGraphics> catchTileOverlay;
695  std::optional<bl::util::ImageStitcher> colStitcher;
696  bl::rc::res::TextureRef collisionTilesTexture;
697  std::vector<glm::vec2> collisionTextureCoords;
698  std::list<BatchSpriteOverlayLayer> collisionTileOverlay;
699  std::optional<bl::util::ImageStitcher> levelTransitionsStitcher;
700  bl::rc::res::TextureRef levelTransitionsTexture;
701  std::vector<glm::vec2> levelTransitionsTextureCoords;
702  std::optional<BatchSpriteOverlayLayer> levelTransitionsOverlay;
703  std::list<bl::gfx::Rectangle> eventsOverlay;
704  sf::Color currentEventFillColor;
705  float eventColorTime;
706 
707  struct ExportState {
708  std::atomic_bool exportInProgress;
709  RenderOverlay prevRenderOverlay;
710  unsigned int prevOverlayLevel;
711  sf::IntRect prevSelection;
712  glm::vec2 prevCenter;
713  float prevZoom;
714  std::uint8_t prevAmbientLightLow;
715  std::uint8_t prevAmbientLightHigh;
716  bool entitiesHidden;
717  bool prevEnabled;
718  std::atomic_bool exportComplete;
719 
720  std::string outputPath;
721  bl::rc::vk::RenderTexture::Handle renderTexture;
722  bl::cam::Camera2D* camera;
723  glm::u32vec2 center;
724  glm::u32vec2 size;
725  bl::rc::tfr::TextureExport* exportJob;
726 
727  ExportState();
728  } exportState;
729 
730  void exportRendering();
731 
732  RenderOverlay renderOverlay;
733  unsigned int overlayLevel;
734  unsigned int nextItemId;
735  bool setRenderTarget;
736 
737  EditMap(const PositionCb& cb, const PositionCb& moveCb, const ActionCb& actionCb,
738  const ActionCb& syncCb, core::system::Systems& systems);
739  bool doLoad(const std::string& file);
740  void stitchOverlayTextures();
741  bool editorActivate();
742  void setupOverlay();
743 
744  void addSpawnGfx(const core::map::Spawn& spawn);
745  void updateSpawnRotation(std::uint16_t id);
746  void updateAllDepths();
747  void updateLevelDepths(unsigned int level);
748  void swapRenderLevels(unsigned int i1, unsigned int i2);
749  void updateLayerDepths(unsigned int level, unsigned int layer);
750  void swapRenderLayers(unsigned int level, unsigned int l1, unsigned int l2);
751  void updateLayerVisibility(unsigned int level, unsigned int layer, bool hide);
752  void updateCatchTileColor(unsigned int level, unsigned int x, unsigned int y);
753  void updateTownTileColor(unsigned int x, unsigned int y);
754  void updateCollisionTileTexture(unsigned int level, unsigned int x, unsigned int y);
755  void updateLevelTransitionTexture(unsigned int x, unsigned int y);
756  void addEventGfx(unsigned int i);
757  void removeEventGfx(unsigned int i);
758  sf::Color nextEventFillColor(float dt);
759 
760  virtual sf::Vector2f minimumRequisition() const override;
761  virtual bl::gui::rdr::Component* doPrepareRender(bl::gui::rdr::Renderer& renderer) override;
762  virtual bool handleScroll(const bl::gui::Event& scroll) override;
763  virtual void update(float dt) override;
764 
765  friend class page::Map;
766  friend class page::Towns;
767  friend class rdr::EditMapComponent;
768 
769  class SetNameAction;
770  class SetPlaylistAction;
771  class SetWeatherAction;
772  class SetYSortLayerAction;
773  class SetTopLayerAction;
774  class SetScriptAction;
775  class SetAmbientLightAction;
776  class AppendLevelAction;
777  class ShiftLevelAction;
778  class RemoveLevelAction;
779  class AppendLayerAction;
780  class ShiftLayerAction;
781  class RemoveLayerAction;
782  class SetTileAction;
783  class SetTileAreaAction;
784  class FillTileAction;
785  class SetCollisionAction;
787  class FillCollisionAction;
788  class SetCatchAction;
789  class SetCatchAreaAction;
790  class FillCatchAction;
791  class AddSpawnAction;
792  class RotateSpawnAction;
793  class RemoveSpawnAction;
794  class AddNpcSpawnAction;
795  class EditNpcSpawnAction;
796  class RemoveNpcSpawnAction;
797  class AddOrEditItemAction;
798  class RemoveItemAction;
799  class SetLightAction;
800  class RemoveLightAction;
801  class AddEventAction;
802  class EditEventAction;
803  class RemoveEventAction;
804  class AddCatchRegionAction;
805  class EditCatchRegionAction;
807  class AddTownAction;
808  class EditTownAction;
809  class RemoveTownAction;
810  class SetTownTileAction;
811  class SetTownTileAreaAction;
812  class FillTownTileAction;
813  class SetLevelTileAction;
815 };
816 
817 } // namespace component
818 } // namespace editor
819 
820 #endif
Id
Represents an item in its simplist form.
Definition: Id.hpp:24
Collision
The different types of collisions in maps.
Definition: Collision.hpp:16
LevelTransition
Represents a level transition in a map. Level transitions are applied when an entity moves either ont...
All classes and functionality used for implementing the game editor.
Definition: Tile.hpp:11
Represents a class of catchable peoplemon.
Definition: CatchRegion.hpp:18
Represents a character to be spawned into a map on load.
Represents an event in a Map. A script that is run on a trigger within a given region.
Definition: Event.hpp:19
The primary map class that represents a usable map in the game.
Definition: Map.hpp:49
Weather weather
Definition: Map.hpp:320
sf::Vector2i size
Definition: Map.hpp:318
bl::resource::Ref< Tileset > tileset
Definition: Map.hpp:319
system::Systems * systems
Definition: Map.hpp:315
const std::string & name() const
Returns the name of the map.
Definition: Map.cpp:171
Basic struct representing a spawn in a Map.
Definition: Spawn.hpp:19
std::uint16_t IdType
Definition: Tile.hpp:33
Represents a town, route, or region within a map. Maps may have many towns. Individual tiles are asso...
Definition: Town.hpp:22
Type
The type of weather.
Definition: Weather.hpp:38
Owns all primary systems and a reference to the engine.
Definition: Systems.hpp:47
Wrapper over the core::Map class that is directly usable in a bl::gui::GUI.
Definition: EditMap.hpp:28
const std::string & currentFile() const
Returns the current file the map is saving to.
Definition: EditMap.cpp:143
void removeLayer(unsigned int level, unsigned int layer)
Deletes the given layer.
Definition: EditMap.cpp:610
void removeTown(std::uint8_t i)
Removes a town.
Definition: EditMap.cpp:873
bool spawnIdUnused(unsigned int id) const
Tells whether or not the given id is in use.
Definition: EditMap.cpp:636
bool editorLoad(const std::string &filename)
Loads the map contents from the given file.
Definition: EditMap.cpp:126
void resize(unsigned int width, unsigned int height, bool modLeft, bool modTop)
void setTownTile(const sf::Vector2i &position, std::uint8_t id)
Sets the town tile at the given position.
Definition: EditMap.cpp:875
std::function< void(const sf::Vector2f &pixels, const sf::Vector2i &tiles)> PositionCb
Called when the map is clicked.
Definition: EditMap.hpp:34
void createEvent(const core::map::Event &event)
Creates a new map event.
Definition: EditMap.cpp:774
const core::map::Event * getEvent(const sf::Vector2i &position)
Returns a pointer to an event that overlaps the given position.
Definition: EditMap.cpp:778
std::function< void()> ActionCb
Called on various event types.
Definition: EditMap.hpp:37
const char * redoDescription() const
Returns the description of what action will be redone if redo is called.
Definition: EditMap.cpp:532
virtual ~EditMap()
Destroy the Edit Map object.
Definition: EditMap.cpp:119
void setTile(unsigned int level, unsigned int layer, const sf::Vector2i &position, core::map::Tile::IdType id, bool isAnim)
Sets a single tile.
Definition: EditMap.cpp:558
void showGrid(bool show)
Set whether or not to render a grid between tiles.
Definition: EditMap.cpp:374
void setWeather(core::map::Weather::Type weather)
Set the weather in the map.
Definition: EditMap.cpp:554
bool unsavedChanges() const
Returns whether or not the map has been updated since last being saved.
Definition: EditMap.cpp:221
void setPlaylist(const std::string &playlist)
Sets the playlist of the map.
Definition: EditMap.cpp:550
std::pair< core::item::Id, bool > getItem(unsigned int level, const sf::Vector2i &position)
Returns spawn info the item at the given position, if any.
Definition: EditMap.cpp:815
void appendTopLayer(unsigned int level)
Creates a new (empty) top layer.
Definition: EditMap.cpp:606
void editCatchRegion(std::uint8_t index, const core::map::CatchRegion &zone)
Modifies the catch region at the given index.
Definition: EditMap.cpp:855
bool editorSave()
Saves the map to the file it was loaded from or created with.
Definition: EditMap.cpp:135
void setControlsEnabled(bool enabled)
Enables or disables the map camera and click controls.
Definition: EditMap.cpp:292
void removeNpcSpawn(const core::map::CharacterSpawn *spawn)
Removes a character spawn.
Definition: EditMap.cpp:692
void removeAllTiles(core::map::Tile::IdType id, bool isAnim)
Removes all tiles that reference the given id in the tileset. This should be called before removing a...
Definition: EditMap.cpp:392
const std::string & getOnEnterScript() const
Get the OnEnter script.
Definition: EditMap.cpp:628
void shiftLevel(unsigned int level, bool up)
Shifts the given level up or down.
Definition: EditMap.cpp:618
void removeSpawn(unsigned int level, const sf::Vector2i &position)
Removes the spawn at the given position.
Definition: EditMap.cpp:654
void addTown()
Adds a town.
Definition: EditMap.cpp:867
void appendYsortLayer(unsigned int level)
Creates a new (empty) y-sort layer.
Definition: EditMap.cpp:602
void removeLight(const sf::Vector2i &positionPixels)
Removes the light near the given position if one is there.
Definition: EditMap.cpp:842
void setOnEnterScript(const std::string &script)
Set the OnEnter script.
Definition: EditMap.cpp:624
void editNpcSpawn(const core::map::CharacterSpawn *orig, const core::map::CharacterSpawn &spawn)
Edits an existing character spawn.
Definition: EditMap.cpp:680
void removeEvent(const core::map::Event *event)
Deletes the given event.
Definition: EditMap.cpp:792
void setOnExitScript(const std::string &script)
Set the OnExit script.
Definition: EditMap.cpp:630
const std::vector< core::map::CatchRegion > & catchRegions() const
Returns a reference to all catch regions.
Definition: EditMap.cpp:851
static Ptr create(const PositionCb &clickCb, const PositionCb &moveCb, const ActionCb &actionCb, const ActionCb &syncCb, core::system::Systems &systems)
Creates a new EditMap.
Definition: EditMap.cpp:55
void addNpcSpawn(const core::map::CharacterSpawn &spawn)
Adds a character spawn to the map.
Definition: EditMap.cpp:665
void appendBottomLayer(unsigned int level)
Creates a new (empty) bottom layer.
Definition: EditMap.cpp:598
void setLevelVisible(unsigned int level, bool visible)
Shows or hides the given level.
Definition: EditMap.cpp:297
void setLayerVisible(unsigned int level, unsigned int layer, bool visible)
Shows or hides the given layer.
Definition: EditMap.cpp:313
void setCatchArea(unsigned int level, const sf::IntRect &area, std::uint8_t id)
Sets a range of catch tiles to a single value.
Definition: EditMap.cpp:590
void setCollisionArea(unsigned int level, const sf::IntRect &area, core::map::Collision id)
Sets a range of collision tiles to a single value.
Definition: EditMap.cpp:577
void redo()
Reapplies the next action in the edit history.
Definition: EditMap.cpp:524
void editEvent(const core::map::Event *orig, const core::map::Event &event)
Alters the value of the given event.
Definition: EditMap.cpp:786
void setName(const std::string &name)
Set the name of the map.
Definition: EditMap.cpp:548
const char * undoDescription() const
Returns the description of what action will be undone if undo is called.
Definition: EditMap.cpp:519
void setLight(const sf::Vector2i &positionPixels, unsigned int radius)
Spawn or modify the light near the given position to the new size.
Definition: EditMap.cpp:835
void setLevelTileArea(const sf::IntRect &area, core::map::LevelTransition lt)
Sets a selection of level tiles.
Definition: EditMap.cpp:891
void removeLevel(unsigned int level)
Removes the given level.
void rotateSpawn(unsigned int level, const sf::Vector2i &tile)
Rotates a player spawn.
Definition: EditMap.cpp:643
std::shared_ptr< EditMap > Ptr
Pointer to an EditMap.
Definition: EditMap.hpp:31
RenderOverlay
Optional render overlays depending on editor state.
Definition: EditMap.hpp:42
@ Collisions
Renders collisions for the current level.
@ Towns
Renders colored tiles to indicate towns/routes.
@ LevelTransitions
Renders level transitions.
@ CatchTiles
Renders catch tiles for the current level.
@ Events
Renders events in the map.
@ Spawns
Renders spawns in the map.
void addSpawn(unsigned int level, const sf::Vector2i &tile, unsigned int id, bl::tmap::Direction dir)
Adds a new player spawn to the map.
Definition: EditMap.cpp:638
void addCatchRegion()
Adds a new catch region to the map.
Definition: EditMap.cpp:849
void setTileArea(unsigned int level, unsigned int layer, const sf::IntRect &area, core::map::Tile::IdType id, bool isAnim)
Sets a range of tiles to a given value. Tries to avoid overcrowding for large tiles.
Definition: EditMap.cpp:563
void fillTownTiles(const sf::Vector2i &position, std::uint8_t id)
Performs a bucket fill of town tiles from the given position.
Definition: EditMap.cpp:883
void staticRender(const RenderMapWindow &params)
Renders the map contents.
Definition: EditMap.cpp:705
void setTownTileArea(const sf::IntRect &area, std::uint8_t id)
Sets a region of town tiles to the given town.
Definition: EditMap.cpp:879
void fillTile(unsigned int level, unsigned int layer, const sf::Vector2i &position, core::map::Tile::IdType id, bool isAnim)
Performs a bucket fill of tiles starting from the given position.
Definition: EditMap.cpp:568
void setRenderOverlay(RenderOverlay overlay, unsigned int level)
Sets which overlay gets rendered on top of the map.
Definition: EditMap.cpp:337
const core::map::CharacterSpawn * getNpcSpawn(unsigned int level, const sf::Vector2i &position) const
Get the Npc Spawn at the given position, if any.
Definition: EditMap.cpp:669
void showSelection(const sf::IntRect &selection)
Sets the tile selection to render. Set width or height to 0 to hide. Set width or height to negative ...
Definition: EditMap.cpp:376
void newMap(const std::string &filename, const std::string &name, const std::string &tileset, unsigned int width, unsigned int height)
Clears the current map and creates a new map with the given parameters.
Definition: EditMap.cpp:145
void editTown(std::uint8_t i, const core::map::Town &town)
Modifies an existing town.
Definition: EditMap.cpp:869
void fillCollision(unsigned int level, const sf::Vector2i &position, core::map::Collision id)
Performs a bucket fill of collisions from the given starting position.
Definition: EditMap.cpp:582
void shiftLayer(unsigned int level, unsigned int layer, bool up)
Shifts a layer up or down in the render order. This will also move layers between bottom,...
Definition: EditMap.cpp:614
void addOrEditItem(unsigned int level, const sf::Vector2i &position, core::item::Id item, bool visible)
Spawns or modifies an item at the given position and level.
Definition: EditMap.cpp:798
void removeCatchRegion(std::uint8_t index)
Removes the catch region at the given index.
Definition: EditMap.cpp:859
void removeItem(unsigned int level, const sf::Vector2i &position)
Removes the item from the given position if one is present.
Definition: EditMap.cpp:824
void setAmbientLight(std::uint8_t lower, std::uint8_t upper, bool sunlight)
Set the maps default ambient light settings.
Definition: EditMap.cpp:863
void setCatch(unsigned int level, const sf::Vector2i &position, std::uint8_t id)
Sets a single catch tile.
Definition: EditMap.cpp:586
void fillCatch(unsigned int level, const sf::Vector2i &position, std::uint8_t id)
Performs a bucket fill of catch tiles from the given position.
Definition: EditMap.cpp:594
void appendLevel()
Creates a new level.
Definition: EditMap.cpp:622
const std::string & getOnExitScript() const
Get the OnExit script.
Definition: EditMap.cpp:634
void setLevelTile(const sf::Vector2i &position, core::map::LevelTransition lt)
Sets the given level tile.
Definition: EditMap.cpp:887
void setCollision(unsigned int level, const sf::Vector2i &position, core::map::Collision id)
Sets a single collision tile.
Definition: EditMap.cpp:573
void undo()
Undoes the previous action in the edit history.
Definition: EditMap.cpp:511
GUI renderer component for the map itself.
Options window to help trigger map renderings.
Page for map editing. Tiles, levels, events, NPC's, weather, lighting, everything.
Definition: Map.hpp:29
Subpage for creating, editing, deleting, and placing towns in maps.
Definition: Towns.hpp:21