17 #ifndef HEADER_SUPERTUX_EDITOR_LAYERS_WIDGET_HPP 18 #define HEADER_SUPERTUX_EDITOR_LAYERS_WIDGET_HPP 25 #include "editor/widget.hpp" 27 #include "editor/object_icon.hpp" 28 #include "editor/object_info.hpp" 29 #include "math/fwd.hpp" 30 #include "util/uid.hpp" 45 enum class HoveredItem {
46 NONE, SPAWNPOINTS, SECTOR, LAYERS
53 virtual void update(
float dt_sec)
override;
55 virtual bool event(
const SDL_Event& ev)
override;
56 virtual bool on_mouse_button_up(
const SDL_MouseButtonEvent& button)
override;
57 virtual bool on_mouse_button_down(
const SDL_MouseButtonEvent& button)
override;
58 virtual bool on_mouse_motion(
const SDL_MouseMotionEvent& motion)
override;
59 virtual bool on_mouse_wheel(
const SDL_MouseWheelEvent& wheel)
override;
61 virtual void setup()
override;
62 virtual void resize()
override;
66 void refresh_sector_text();
67 void refresh_layers();
69 void add_layer(
GameObject* layer,
bool initial =
false);
71 void update_current_tip();
73 bool has_mouse_focus()
const;
75 TileMap* get_selected_tilemap()
const;
76 void set_selected_tilemap(
TileMap* tilemap);
79 Vector get_layer_coords(
const int pos)
const;
80 int get_layer_pos(
const Vector& coords)
const;
85 std::vector<std::unique_ptr<LayerIcon>> m_layer_icons;
86 UID m_selected_tilemap;
89 std::unique_ptr<EditorTilebox> m_add_layer_box;
90 bool m_add_layer_box_visible;
93 const int m_Xpos = 32;
98 std::string m_sector_text;
99 int m_sector_text_width;
101 HoveredItem m_hovered_item;
102 unsigned int m_hovered_layer;
104 std::unique_ptr<Tip> m_object_tip;
106 bool m_has_mouse_focus;
Definition: object_icon.hpp:28
Definition: layer_icon.hpp:25
This class is responsible for: Updating and drawing the object.
Definition: game_object.hpp:83
The tilebox allows selection of tiles or objects from a specified tilegroup/objectgroup.
Definition: tilebox.hpp:44
Definition: editor.hpp:49
This class is responsible for managing an array of tiles.
Definition: tilemap.hpp:49
This class provides functions for drawing things on screen.
Definition: drawing_context.hpp:42