Skip to content

Commit

Permalink
If map columns window is open, close it then reopen it.
Browse files Browse the repository at this point in the history
  • Loading branch information
rainlizard committed Apr 19, 2024
1 parent e08a83c commit 654d6e1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Scenes/CustomTooltip.gd
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func set_floortexture(floorTextureValue):
dataTexture.create_from_image(dataImage, 0)

dataImage.lock()
dataImage.set_pixel(0, 0, Color8(floorTextureValue >> 16 & 255, floorTextureValue >> 8 & 255, floorTextureValue & 255))
dataImage.set_pixel(0, 0, Color8(int(floorTextureValue) >> 16 & 255, int(floorTextureValue) >> 8 & 255, int(floorTextureValue) & 255))
dataImage.unlock()
dataTexture.set_data(dataImage)

Expand Down
10 changes: 7 additions & 3 deletions Scenes/OpenMap.gd
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,6 @@ func open_map(filePath):

# Always begin by clearing map
oCurrentMap.clear_map()
# Close windows that I want closed
oMapSettingsWindow.visible = false
oColumnEditor.visible = false

var map = filePath.get_basename()

Expand Down Expand Up @@ -233,6 +230,13 @@ func continue_load(map):
oMessage.quick("Fixed column index 0, re-save your map.")

oDataClm.store_default_data()

oMapSettingsWindow.visible = false


if oColumnEditor.visible == true:
oColumnEditor.visible = false
Utils.popup_centered(oColumnEditor)

func continue_load_openmap(map):
oEditor.mapHasBeenEdited = false
Expand Down
2 changes: 1 addition & 1 deletion Scenes/UndoStates.gd
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func attempt_to_save_new_undo_state(): # called by oEditor


func on_undo_state_saved(new_state):
if undo_history.size() >= 2 and are_states_equal(new_state, undo_history[1]):
if undo_history.size() >= 1 and are_states_equal(new_state, undo_history[0]):
oMessage.quick("Didn't add undo state as it is the same as the previous undo-state")
is_saving_state = false
return
Expand Down

0 comments on commit 654d6e1

Please sign in to comment.