Skip to content

Commit 9ff3bbc

Browse files
Change the icon of Tilemaps based on their attributes (#3282)
* Add `Tilemap` icon variants Co-authored-by: Frostwithasideofsalt <[email protected]> * Add tilemap icons based on attributes * Indentation * Fix icons for tilemaps on paths * Unnecessary changes --------- Co-authored-by: Frostwithasideofsalt <[email protected]>
1 parent 53f3bd1 commit 9ff3bbc

13 files changed

+91
-7
lines changed
206 Bytes
Loading
214 Bytes
Loading
232 Bytes
Loading
434 Bytes
Loading
362 Bytes
Loading
365 Bytes
Loading
436 Bytes
Loading

src/editor/editor.cpp

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ Editor::Editor() :
128128
m_time_since_last_save(0.f),
129129
m_scroll_speed(32.0f),
130130
m_new_scale(0.f),
131-
m_mouse_pos(0.f, 0.f)
131+
m_mouse_pos(0.f, 0.f),
132+
m_layers_widget_needs_refresh(false)
132133
{
133134
auto toolbox_widget = std::make_unique<EditorToolboxWidget>(*this);
134135
auto layers_widget = std::make_unique<EditorLayersWidget>(*this);
@@ -147,6 +148,12 @@ Editor::~Editor()
147148
{
148149
}
149150

151+
void
152+
Editor::queue_layers_refresh()
153+
{
154+
m_layers_widget_needs_refresh = true;
155+
}
156+
150157
void
151158
Editor::draw(Compositor& compositor)
152159
{
@@ -282,6 +289,15 @@ Editor::update(float dt_sec, const Controller& controller)
282289
object->editor_update();
283290
}
284291

292+
if (m_layers_widget_needs_refresh)
293+
{
294+
if (m_layers_widget)
295+
{
296+
m_layers_widget->refresh();
297+
}
298+
m_layers_widget_needs_refresh = false;
299+
}
300+
285301
for (const auto& widget : m_widgets) {
286302
widget->update(dt_sec);
287303
}

src/editor/editor.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,10 @@ class Editor final : public Screen,
158158

159159
inline Sector* get_sector() { return m_sector; }
160160

161+
inline EditorLayersWidget* get_layers_widget() const { return m_layers_widget; }
162+
163+
void queue_layers_refresh();
164+
161165
void retoggle_undo_tracking();
162166
void undo_stack_cleanup();
163167

@@ -236,6 +240,8 @@ class Editor final : public Screen,
236240

237241
Vector m_mouse_pos;
238242

243+
bool m_layers_widget_needs_refresh;
244+
239245
private:
240246
Editor(const Editor&) = delete;
241247
Editor& operator=(const Editor&) = delete;

src/object/path_object.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ PathObject::init_path(const ReaderMapping& mapping, bool running_default)
6767
d_gameobject_manager->request_name_resolve(path_ref, [this, running](UID uid){
6868
if (!m_path_uid) m_path_uid = uid;
6969
m_walker.reset(new PathWalker(m_path_uid, running));
70+
on_path_resolved();
7071
});
7172
}
7273
}

0 commit comments

Comments
 (0)