1 #ifndef EDITOR_PAGES_MAP_HPP
2 #define EDITOR_PAGES_MAP_HPP
48 virtual void update(
float dt)
override;
56 bl::gui::ComboBox::Ptr layerSelect;
57 bl::gui::ComboBox::Ptr levelSelect;
59 bl::gui::TextEntry::Ptr nameEntry;
61 bl::gui::Label::Ptr playlistLabel;
62 bl::gui::Button::Ptr saveMapBut;
64 bl::gui::CheckButton::Ptr sunlightBut;
67 bl::gui::Button::Ptr lightingSetBut;
69 bl::gui::Notebook::Ptr objectBook;
70 bl::gui::ComboBox::Ptr spawnDirEntry;
71 bl::gui::TextEntry::Ptr lightRadiusEntry;
72 bl::gui::RadioButton::Ptr lightCreateOrEdit;
73 bl::gui::RadioButton::Ptr lightRemove;
76 bl::gui::RadioButton::Ptr createEventRadio;
77 bl::gui::RadioButton::Ptr editEventRadio;
78 bl::gui::RadioButton::Ptr deleteEventRadio;
80 bl::gui::RadioButton::Ptr spawnCreate;
81 bl::gui::RadioButton::Ptr spawnRotate;
82 bl::gui::RadioButton::Ptr spawnDelete;
84 bl::gui::RadioButton::Ptr npcSpawn;
85 bl::gui::RadioButton::Ptr npcEdit;
86 bl::gui::RadioButton::Ptr npcDelete;
88 bl::gui::RadioButton::Ptr itemSpawn;
89 bl::gui::RadioButton::Ptr itemRead;
90 bl::gui::RadioButton::Ptr itemDelete;
91 bl::gui::CheckButton::Ptr itemHidden;
93 bl::gui::Label::Ptr onEnterLabel;
94 bl::gui::Label::Ptr onExitLabel;
97 bl::gui::ComboBox::Ptr timeSetEntry;
106 enum struct Tool { Metadata, MapEdit, Events, Spawns, NPCs,
Items, Lights, Testing } activeTool;
107 enum struct Subtool { Set, Fill, Select, Clear, Add, Edit, Remove, None } activeSubtool;
109 sf::IntRect selection;
110 enum SelectionState { NoSelection, Selecting, SelectionMade } selectionState;
111 void setSelectionState(SelectionState newState);
113 bl::gui::FilePicker mapPicker;
115 void doLoadMap(
const std::string& file);
117 component::NewMapDialog newMapWindow;
118 void makeNewMap(
const std::string& file,
const std::string& name,
const std::string& tileset,
119 unsigned int w,
unsigned int h);
121 component::PlaylistEditorWindow playlistEditor;
122 void onChoosePlaylist(
const std::string& file);
125 void onLightingChange();
126 void onLightingSave();
127 void onLightingReset();
128 void setLightingDefault();
130 component::ScriptSelector scriptSelector;
131 bool choosingOnloadScript;
132 void onChooseScript(
const std::string& script);
134 component::EventEditor eventEditor;
137 void onMapClick(
const sf::Vector2f& pixels,
const sf::Vector2i& tiles);
138 void onLevelChange(
unsigned int level);
140 component::CharacterSpawnWindow characterEditor;
144 component::RenderMapWindow renderMapWindow;
145 void startMapRender();
All classes and functionality used for implementing the game editor.
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.
Owns all primary systems and a reference to the engine.
std::shared_ptr< ItemSelector > Ptr
Pointer to this component.
std::shared_ptr< LightSlider > Ptr
std::shared_ptr< WeatherSelect > Ptr
Pointer to the weather selector.
Page for editing item names, descriptions, and values.
Page for map editing. Tiles, levels, events, NPC's, weather, lighting, everything.
Map(core::system::Systems &systems)
Construct a new Map page.
virtual ~Map()=default
Destroy the Page.
void syncGui()
Updates the GUI elements to sync with the data.
virtual void update(float dt) override
Updates the game world and systems.
Base class for all editor pages.
core::system::Systems & systems
Subpage in the map editor for creating and testing game saves.
Provides controls to add, move, remove, and toggle visibility for layers.
Provides controls to add, move, remove, and toggle visibility for levels.
Section of the map area with the map itself and related controls.
Subpage for tileset editing and use. Used by the map editor page.