Skip to content

Commit 71c97ea

Browse files
change if undo_redo statements for the linter
1 parent 1aa2ef8 commit 71c97ea

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

addons/block_code/ui/main_panel.gd

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -144,30 +144,36 @@ func save_script():
144144
var resource_path_split = block_script.resource_path.split("::", true, 1)
145145
var resource_scene = resource_path_split[0]
146146

147-
if undo_redo: undo_redo.create_action("Modify %s's block code script" % _context.parent_node.name, UndoRedo.MERGE_DISABLE, _context.block_code_node)
147+
if undo_redo:
148+
undo_redo.create_action("Modify %s's block code script" % _context.parent_node.name, UndoRedo.MERGE_DISABLE, _context.block_code_node)
148149

149150
if resource_scene and scene_node and resource_scene != scene_node.scene_file_path:
150151
# This resource is from another scene. Since the user is changing it
151152
# here, we'll make a copy for this scene rather than changing it in the
152153
# other scene file.
153-
if undo_redo: undo_redo.add_undo_property(_context.block_code_node, "block_script", _context.block_script)
154+
if undo_redo:
155+
undo_redo.add_undo_property(_context.block_code_node, "block_script", _context.block_script)
154156
block_script = block_script.duplicate(true)
155-
if undo_redo: undo_redo.add_do_property(_context.block_code_node, "block_script", block_script)
157+
if undo_redo:
158+
undo_redo.add_do_property(_context.block_code_node, "block_script", block_script)
156159

157-
if undo_redo: undo_redo.add_undo_property(block_script, "block_serialization_trees", block_script.block_serialization_trees)
160+
if undo_redo:
161+
undo_redo.add_undo_property(block_script, "block_serialization_trees", block_script.block_serialization_trees)
158162
_block_canvas.rebuild_ast_list()
159163
_block_canvas.rebuild_block_serialization_trees()
160-
if undo_redo: undo_redo.add_do_property(block_script, "block_serialization_trees", block_script.block_serialization_trees)
164+
if undo_redo:
165+
undo_redo.add_do_property(block_script, "block_serialization_trees", block_script.block_serialization_trees)
161166

162167
var generated_script = _block_canvas.generate_script_from_current_window()
163168
if generated_script != block_script.generated_script:
164-
if undo_redo: undo_redo.add_undo_property(block_script, "generated_script", block_script.generated_script)
165-
if undo_redo: undo_redo.add_do_property(block_script, "generated_script", generated_script)
166-
pass
169+
if undo_redo:
170+
undo_redo.add_undo_property(block_script, "generated_script", block_script.generated_script)
171+
undo_redo.add_do_property(block_script, "generated_script", generated_script)
167172

168173
block_script.version = Constants.CURRENT_DATA_VERSION
169174

170-
if undo_redo: undo_redo.commit_action()
175+
if undo_redo:
176+
undo_redo.commit_action()
171177

172178

173179
func _input(event):

0 commit comments

Comments
 (0)