diff options
author | Mariano Suligoy <marianognu.easyrpg@gmail.com> | 2019-02-23 00:04:31 -0300 |
---|---|---|
committer | Mariano Suligoy <marianognu.easyrpg@gmail.com> | 2019-02-23 00:04:31 -0300 |
commit | 5a21847f238db971d173bd3b836e6068a4bfb57c (patch) | |
tree | 9bf883fd901d08ea0eeb4759cce0f385c7ec2434 /editor/plugins/tile_set_editor_plugin.cpp | |
parent | 4f697f73a5ac567c1dc22ce44a7fab98f619dfe3 (diff) |
TileSetEditor: Show Edition Context by demand
Diffstat (limited to 'editor/plugins/tile_set_editor_plugin.cpp')
-rw-r--r-- | editor/plugins/tile_set_editor_plugin.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp index 26f8b74862..1bcb7513e0 100644 --- a/editor/plugins/tile_set_editor_plugin.cpp +++ b/editor/plugins/tile_set_editor_plugin.cpp @@ -2536,6 +2536,11 @@ void TileSetEditor::set_current_tile(int p_id) { helper->_change_notify(""); select_coord(Vector2(0, 0)); update_workspace_tile_mode(); + if (p_id == -1) { + editor->get_inspector()->edit(tileset.ptr()); + } else { + editor->get_inspector()->edit(helper); + } } } @@ -2712,7 +2717,6 @@ void TileSetEditorPlugin::edit(Object *p_node) { if (Object::cast_to<TileSet>(p_node)) { tileset_editor->edit(Object::cast_to<TileSet>(p_node)); - editor->get_inspector()->edit(tileset_editor->helper); } } @@ -2741,6 +2745,7 @@ Dictionary TileSetEditorPlugin::get_state() const { state["snap_separation"] = tileset_editor->snap_separation; state["snap_enabled"] = tileset_editor->tools[TileSetEditor::TOOL_GRID_SNAP]->is_pressed(); state["keep_inside_tile"] = tileset_editor->tools[TileSetEditor::SHAPE_KEEP_INSIDE_TILE]->is_pressed(); + state["show_information"] = tileset_editor->tools[TileSetEditor::VISIBLE_INFO]->is_pressed(); return state; } @@ -2761,11 +2766,18 @@ void TileSetEditorPlugin::set_state(const Dictionary &p_state) { if (state.has("snap_enabled")) { tileset_editor->tools[TileSetEditor::TOOL_GRID_SNAP]->set_pressed(state["snap_enabled"]); + if (tileset_editor->helper) { + tileset_editor->_on_grid_snap_toggled(state["snap_enabled"]); + } } if (state.has("keep_inside_tile")) { tileset_editor->tools[TileSetEditor::SHAPE_KEEP_INSIDE_TILE]->set_pressed(state["keep_inside_tile"]); } + + if (state.has("show_information")) { + tileset_editor->tools[TileSetEditor::VISIBLE_INFO]->set_pressed(state["show_information"]); + } } TileSetEditorPlugin::TileSetEditorPlugin(EditorNode *p_node) { |