Skip to content

Commit

Permalink
Added links to the slabset.toml files in Slabset Editor
Browse files Browse the repository at this point in the history
  • Loading branch information
rainlizard committed Jun 1, 2024
1 parent 1a8fa9c commit ce06a96
Show file tree
Hide file tree
Showing 7 changed files with 171 additions and 102 deletions.
1 change: 1 addition & 0 deletions Autoload/Utils.gd
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,4 @@ func super_merge(dict1, dict2):
else:
merged[key] = dict2[key]
return merged

1 change: 0 additions & 1 deletion Scenes/ConfigFilesListWindow.gd
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ func update_everything():
for child in gridParent.get_children():
child.queue_free()

print(oCfgLoader.paths_loaded)

for cfg_type in [oCfgLoader.LOAD_CFG_FXDATA, oCfgLoader.LOAD_CFG_CAMPAIGN, oCfgLoader.LOAD_CFG_CURRENT_MAP]:
if oCfgLoader.paths_loaded.has(cfg_type) == false:
Expand Down
2 changes: 1 addition & 1 deletion Scenes/Editor.gd
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func _notification(what):
elif what == MainLoop.NOTIFICATION_WM_FOCUS_IN:
Engine.target_fps = framerate_limit
elif what == MainLoop.NOTIFICATION_WM_FOCUS_OUT:
Engine.target_fps = min(12, framerate_limit)
Engine.target_fps = int(min(12, framerate_limit))

func just_opened_editor():
yield(get_tree(),'idle_frame')
Expand Down
227 changes: 128 additions & 99 deletions Scenes/Main.tscn

Large diffs are not rendered by default.

37 changes: 37 additions & 0 deletions Scenes/SlabsetPathsLabel.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
extends PanelContainer
onready var oCfgLoader = Nodelist.list["oCfgLoader"]

onready var containerForLabels = $ScrollContainer/VBoxContainer

func start():
for i in containerForLabels.get_children():
i.queue_free()

for cfg_type in [oCfgLoader.LOAD_CFG_FXDATA, oCfgLoader.LOAD_CFG_CAMPAIGN, oCfgLoader.LOAD_CFG_CURRENT_MAP]:
if oCfgLoader.paths_loaded.has(cfg_type) == false:
continue

# var addToGrid

# match cfg_type:
# oCfgLoader.LOAD_CFG_FXDATA:
# addToGrid = oFileListGridA
# oCfgLoader.LOAD_CFG_CAMPAIGN:
# addToGrid = oFileListGridB
# oCfgLoader.LOAD_CFG_CURRENT_MAP:
# addToGrid = oFileListGridC

for path in oCfgLoader.paths_loaded[cfg_type]:
if path:
if path.to_lower().ends_with("slabset.toml"):
add_linkbutton(path)

func add_linkbutton(path):
var id = LinkButton.new()
id.connect("pressed", self, "_on_linkbutton_pressed", [path])
id.underline = LinkButton.UNDERLINE_MODE_ON_HOVER
id.text = path.get_base_dir().get_file().plus_file(path.get_file())
containerForLabels.add_child(id)

func _on_linkbutton_pressed(path):
OS.shell_open(path)
4 changes: 4 additions & 0 deletions Scenes/SlabsetWindow.gd
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ onready var oVarButtonsApplyToAllCheckBox = Nodelist.list["oVarButtonsApplyToAll
onready var oOverheadGraphics = Nodelist.list["oOverheadGraphics"]
onready var oAddCustomSlabWindow = Nodelist.list["oAddCustomSlabWindow"]
onready var oCurrentMap = Nodelist.list["oCurrentMap"]
onready var oSlabsetPathsLabel = Nodelist.list["oSlabsetPathsLabel"]

var clipboard = {
"dat": [],
Expand Down Expand Up @@ -99,8 +100,11 @@ func _on_SlabsetWindow_visibility_changed():
oDkSlabsetVoxelView._on_SlabsetIDSpinBox_value_changed(oSlabsetIDSpinBox.value)
_on_SlabsetIDSpinBox_value_changed(oSlabsetIDSpinBox.value)

oSlabsetPathsLabel.start()

yield(get_tree(),'idle_frame')
oDkSlabsetVoxelView.oAllVoxelObjects.visible = true

elif visible == false:
if is_instance_valid(oPickSlabWindow):
oPickSlabWindow.add_slabs()
Expand Down
1 change: 0 additions & 1 deletion Scenes/ThingInstance.gd
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ func set_texture_based_on_thingtype():

func set_grow_direction():
# Change Grow Direction so the art pokes out from the base.
var texpath = $ThingTexture.texture.get_path()

# Return if we want to grow from center
if thingType == Things.TYPE.OBJECT:
Expand Down

0 comments on commit ce06a96

Please sign in to comment.