Skip to content

Commit

Permalink
Door locked checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
rainlizard committed Mar 27, 2024
1 parent 26a5c6b commit 361c87f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 16 deletions.
4 changes: 1 addition & 3 deletions Scenes/PlacingSettings.gd
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,7 @@ func update_placing_tab():
value = creatureLevel
FIELDS.DOOR_LOCKED:
description = "Door locked" # 14
match doorLocked:
0: value = "False"
1: value = "True"
value = doorLocked
FIELDS.POINT_RANGE:
description = "Point range"
value = pointRange
Expand Down
4 changes: 1 addition & 3 deletions Scenes/ThingDetails.gd
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,7 @@ func thing_details(id):
value = id.boxNumber
15:
description = "Door locked" # 14
match id.doorLocked:
0: value = "False"
1: value = "True"
value = id.doorLocked
16:
description = "Unknown 14"
value = id.data14
Expand Down
19 changes: 9 additions & 10 deletions Scenes/TwoColumnData.gd
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,12 @@ func add_item(leftString, rightString):
var nodeRightColumn
match leftString:
"Door locked":
nodeRightColumn = OptionButton.new()
nodeRightColumn.add_item("False")
nodeRightColumn.add_item("True")

nodeRightColumn.connect("item_selected",self,"_on_optionbutton_item_selected", [leftString])
nodeRightColumn.connect("toggled",self,"_on_optionbutton_toggled", [nodeRightColumn])
for i in nodeRightColumn.get_item_count():
if nodeRightColumn.get_item_text(nodeRightColumn.get_item_index(i)) == rightString:
nodeRightColumn.selected = i
nodeRightColumn = CheckBox.new()
nodeRightColumn.size_flags_horizontal = Control.SIZE_EXPAND
match int(rightString):
0: nodeRightColumn.pressed = false
1: nodeRightColumn.pressed = true
nodeRightColumn.connect("toggled",self,"_on_optionbutton_item_selected", [leftString])
"Ownership":
nodeRightColumn = OptionButton.new()
nodeRightColumn.focus_mode = 0 # Fixes clicking on the menu
Expand Down Expand Up @@ -294,7 +291,9 @@ func _on_optionbutton_item_selected(indexSelected, leftString):
value = Constants.listOrientations[indexSelected]
"Door locked":
property_name = "doorLocked"
value = indexSelected
match indexSelected:
false: value = 0
true: value = 1
if name == "ThingListData":
if is_instance_valid(inst):
inst.set(property_name, value) # Must be set before update_spinning_key()
Expand Down

0 comments on commit 361c87f

Please sign in to comment.