Skip to content

Commit

Permalink
removed remnants of custom_objects.cfg, use fallback when loading obj…
Browse files Browse the repository at this point in the history
…ects.cfg
  • Loading branch information
rainlizard committed May 28, 2024
1 parent 2704201 commit bfd9d31
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 418 deletions.
153 changes: 0 additions & 153 deletions Scenes/AddCustomObjectWindow.gd

This file was deleted.

4 changes: 4 additions & 0 deletions Scenes/AddCustomSlabWindow.gd
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
extends WindowDialog
onready var oAddCustomSlabWindow = Nodelist.list["oAddCustomSlabWindow"]
onready var oColumnEditorVoxelView = Nodelist.list["oColumnEditorVoxelView"]
onready var oCustomSlabVoxelView = Nodelist.list["oCustomSlabVoxelView"]
onready var oGridContainerCustomColumns3x3 = Nodelist.list["oGridContainerCustomColumns3x3"]
Expand Down Expand Up @@ -138,6 +139,7 @@ func _on_SlabWibbleOptionButton_item_selected(index):
oWibbleEdgesSpacing.visible = false
oWibbleEdgesCheckBox.visible = false


func copy_values_from_slabset_and_index_them():
for i in 9:
var srcClmIndex = oSlabsetWindow.columnSettersArray[i].get_node("CustomSpinBox").value
Expand All @@ -148,6 +150,7 @@ func copy_values_from_slabset_and_index_them():

#oMessage.big("", "Columns in your map's .clm file have been found that match the columns from slabs.clm/dat. Any that weren't found were added.")


func get_column_indexes_on_tile(cursorTile):
for ySubtile in 3:
for xSubtile in 3:
Expand All @@ -157,6 +160,7 @@ func get_column_indexes_on_tile(cursorTile):




func update_type():
oFakeCustomColumnsPanelContainer.visible = true
oCustomSlabVoxelView.modulate.a = 1
Expand Down
35 changes: 29 additions & 6 deletions Scenes/CfgLoader.gd
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ func start(mapPath):
var file_path = cfg_dir.plus_file(file_name)
if cfg_type == LOAD_CFG_CURRENT_MAP:
file_path = cfg_dir + "." + file_name


print("CFG loader: ", file_path)

if File.new().file_exists(file_path):
match file_name:
"objects.cfg":
Expand Down Expand Up @@ -95,13 +97,34 @@ func load_objects_data(path): # 10ms
if id == 0: continue
if id >= 136 or id in [100, 101, 102, 103, 104, 105]: # Dummy Boxes should be overwritten
var objSection = objects_cfg[section]
var newName = objSection["Name"]
var animID = objSection["AnimationID"]
var newSprite = get_sprite(animID, newName)
var newGenre = objSection.get("Genre", null)
var newEditorTab = Things.GENRE_TO_TAB[newGenre]
var newName
var animID
var newSprite
var newEditorTab
var newGenre

if Things.DATA_OBJECT.has(id) == true: # Existing values are written by other calls to load_objects_data() (can be from /fxdata/, campaign, local map, etc.)
newName = objSection.get("Name", Things.DATA_OBJECT[id][Things.NAME_ID])

animID = objSection.get("AnimationID")
newSprite = get_sprite(animID, newName)
if newSprite == null: newSprite = Things.DATA_OBJECT[id][Things.SPRITE]

newGenre = objSection.get("Genre")
newEditorTab = Things.GENRE_TO_TAB.get(newGenre, Things.DATA_OBJECT[id][Things.EDITOR_TAB])
else:
newName = objSection.get("Name", "UNDEFINED_NAME")

animID = objSection.get("AnimationID")
newSprite = get_sprite(animID, newName)

newGenre = objSection.get("Genre")
newEditorTab = Things.GENRE_TO_TAB.get(newGenre, Things.TAB_DECORATION)


Things.DATA_OBJECT[id] = [newName, newSprite, newEditorTab]


var keeperfx_edited_slabs = [Slabs.GEMS] # This is to help with backwards compatibility for previous keeperfx versions that don't have these edits.
func load_terrain_data(path): # 4ms
var terrain_cfg = Utils.read_dkcfg_file(path)
Expand Down
70 changes: 0 additions & 70 deletions Scenes/CustomObjectSystem.gd

This file was deleted.

Loading

0 comments on commit bfd9d31

Please sign in to comment.