diff --git a/Autoload/Slabs.gd b/Autoload/Slabs.gd index 03201423..281f2291 100644 --- a/Autoload/Slabs.gd +++ b/Autoload/Slabs.gd @@ -286,11 +286,7 @@ PURPLE_PATH, ] func is_door(slabID): - if data.has(slabID) == false: - var oMessage = Nodelist.list["oMessage"] - oMessage.quick("Door ID missing from structure") - return false - - if data[slabID][BITMASK_TYPE] == BITMASK_DOOR1 or data[slabID][BITMASK_TYPE] == BITMASK_DOOR2: - return true + if data.has(slabID) == true: + if data[slabID][BITMASK_TYPE] == BITMASK_DOOR1 or data[slabID][BITMASK_TYPE] == BITMASK_DOOR2: + return true return false diff --git a/Autoload/Things.gd b/Autoload/Things.gd index 30251bf8..709b77d5 100644 --- a/Autoload/Things.gd +++ b/Autoload/Things.gd @@ -249,10 +249,10 @@ var DATA_OBJECT = { 049 : ["Hero Gate", null,null, preload("res://dk_images/crucials/anim0780/AnimHeroGate.res"), null, TAB_ACTION], 050 : ["Spinning Key 2", null,null, preload("res://dk_images/traps_doors/anim0811/AnimSpinningKey.res"), null, TAB_MISC], 051 : ["Armour Effect", null,null, null, null, TAB_MISC], -052 : ["Treasury Gold 1 (800)", null,null, preload("res://dk_images/valuables/gold_hoard1_tp/AnimGoldHoard1.res"), null, TAB_GOLD], -053 : ["Treasury Gold 2 (1200)", null,null, preload("res://dk_images/valuables/gold_hoard2_tp/AnimGoldHoard2.res"), null, TAB_GOLD], -054 : ["Treasury Gold 3 (1600)", null,null, preload("res://dk_images/valuables/gold_hoard3_tp/AnimGoldHoard3.res"), null, TAB_GOLD], -055 : ["Treasury Gold 4 (2000)", null,null, preload("res://dk_images/valuables/gold_hoard4_tp/AnimGoldHoard4.res"), null, TAB_GOLD], +052 : ["Treasury Gold 1 (800)", null,null, preload("res://dk_images/valuables/gold_hoard2_tp/AnimGoldHoard2.res"), null, TAB_GOLD], +053 : ["Treasury Gold 2 (1200)", null,null, preload("res://dk_images/valuables/gold_hoard3_tp/AnimGoldHoard3.res"), null, TAB_GOLD], +054 : ["Treasury Gold 3 (1600)", null,null, preload("res://dk_images/valuables/gold_hoard4_tp/AnimGoldHoard4.res"), null, TAB_GOLD], +055 : ["Treasury Gold 4 (2000)", null,null, preload("res://dk_images/valuables/gold_hoard5_tp/AnimGoldHoard5.res"), null, TAB_GOLD], 056 : ["Treasury Gold 5 (2400)", null,null, preload("res://dk_images/valuables/gold_hoard5_tp/AnimGoldHoard5.res"), null, TAB_GOLD], 057 : ["Lair: Wizard", null,null, preload("res://edited_images/lair/creature_generic/anim0126/AnimLairGeneric.res"), null, TAB_LAIR], 058 : ["Lair: Barbarian", null,null, preload("res://edited_images/lair/creature_generic/anim0126/AnimLairGeneric.res"), null, TAB_LAIR], diff --git a/Scenes/DisplaySlxNumbers.gd b/Scenes/DisplaySlxNumbers.gd index 6abc0831..4822bb77 100644 --- a/Scenes/DisplaySlxNumbers.gd +++ b/Scenes/DisplaySlxNumbers.gd @@ -1,6 +1,7 @@ extends Node2D onready var oDataSlx = Nodelist.list["oDataSlx"] onready var oSlabStyle = Nodelist.list["oSlabStyle"] +onready var oSelector = Nodelist.list["oSelector"] var tileDrawDist = 96 var draw_grid = false @@ -15,6 +16,7 @@ func update_grid(): func _draw(): if oSlabStyle.visible == false: return + if oSelector.mode != oSelector.MODE_TILE: return oDataSlx.slxImgData.lock() for x in M.xSize: diff --git a/Scenes/MapBrowser.gd b/Scenes/MapBrowser.gd index d0989981..90e7e756 100644 --- a/Scenes/MapBrowser.gd +++ b/Scenes/MapBrowser.gd @@ -18,6 +18,7 @@ onready var oMapBrowserTabPlay = Nodelist.list["oMapBrowserTabPlay"] onready var oMapBrowserTabContainer = Nodelist.list["oMapBrowserTabContainer"] onready var oRandomMapContainer = Nodelist.list["oRandomMapContainer"] onready var oMenu = Nodelist.list["oMenu"] +onready var oInspector = Nodelist.list["oInspector"] func _ready(): @@ -41,6 +42,7 @@ func _on_MapBrowser_about_to_show(): oDynamicMapTree.update_dynamic_tree() oLineEditFilter.grab_focus() + oInspector.deselect() func _on_DynamicMapTree_item_activated(): var selectedTreeItem = oDynamicMapTree.get_selected() diff --git a/Scenes/Selection.gd b/Scenes/Selection.gd index a5e439e6..21b202d2 100644 --- a/Scenes/Selection.gd +++ b/Scenes/Selection.gd @@ -131,8 +131,6 @@ func update_paint(): func construct_shape_for_placement(constructType): - if paintSlab == null: return - oEditor.mapHasBeenEdited = true var shapePositionArray = [] match constructType: @@ -215,16 +213,17 @@ func construct_shape_for_placement(constructType): var updateNearby = some_manual_placements_dont_update_nearby() oSlabPlacement.generate_slabs_based_on_id(shapePositionArray, updateNearby) else: - # Slab placement - var useOwner = paintOwnership - - oSlabPlacement.place_shape_of_slab_id(shapePositionArray, paintSlab, useOwner) - - if oMirrorPlacementCheckBox.pressed == true: - oSlabPlacement.mirror_placement(shapePositionArray, oSlabPlacement.MIRROR_SLAB_AND_OWNER) - - var updateNearby = some_manual_placements_dont_update_nearby() - oSlabPlacement.generate_slabs_based_on_id(shapePositionArray, updateNearby) + if paintSlab != null: + # Slab placement + var useOwner = paintOwnership + + oSlabPlacement.place_shape_of_slab_id(shapePositionArray, paintSlab, useOwner) + + if oMirrorPlacementCheckBox.pressed == true: + oSlabPlacement.mirror_placement(shapePositionArray, oSlabPlacement.MIRROR_SLAB_AND_OWNER) + + var updateNearby = some_manual_placements_dont_update_nearby() + oSlabPlacement.generate_slabs_based_on_id(shapePositionArray, updateNearby) func some_manual_placements_dont_update_nearby(): # Fake Slabs don't update the surroundings (! HAD TO COMMENT THIS OUT BECAUSE IT BREAKS CUSTOM SLABSET SLABS) diff --git a/Scenes/Selector.gd b/Scenes/Selector.gd index 06878e77..f4a595cf 100644 --- a/Scenes/Selector.gd +++ b/Scenes/Selector.gd @@ -35,6 +35,7 @@ onready var oDataClm = Nodelist.list["oDataClm"] onready var oDataClmPos = Nodelist.list["oDataClmPos"] onready var oSlabSideViewer = Nodelist.list["oSlabSideViewer"] onready var oAddCustomSlabWindow = Nodelist.list["oAddCustomSlabWindow"] +onready var oDisplaySlxNumbers = Nodelist.list["oDisplaySlxNumbers"] onready var TILE_SIZE = Constants.TILE_SIZE onready var SUBTILE_SIZE = Constants.SUBTILE_SIZE @@ -258,7 +259,7 @@ func adjust_range(instance, property_name, increment, message_prefix): var newRange = clamp(instance.get(property_name) + increment, 0, 32767) instance.set(property_name, newRange) oThingDetails.update_details() - oMessage.quick(message_prefix + str(newRange)) + #oMessage.quick(message_prefix + str(newRange)) get_tree().set_input_as_handled() var originalPosition = Vector2(instance.locationX, instance.locationY) oInstances.mirror_adjusted_value(instance, property_name, originalPosition) @@ -322,6 +323,7 @@ func change_mode(changeModeTo): oEditingTools.switched_to_slab_mode() oInspector.deselect() oBrushPreview.update_img() + oDisplaySlxNumbers.update_grid() MODE_SUBTILE: position = cursorSubtile * SUBTILE_SIZE $SubtileSelector.visible = true @@ -330,6 +332,7 @@ func change_mode(changeModeTo): oEditingTools.switched_to_thing_mode() oEditingMode.switch_mode("Thing") oBrushPreview.update_img() + oDisplaySlxNumbers.update_grid() func world2tile(pos): return Vector2(floor(pos.x/TILE_SIZE),floor(pos.y/TILE_SIZE))