Skip to content

Commit 6ab15d3

Browse files
committed
cfg refactor wip 8
1 parent cdcf5f4 commit 6ab15d3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+152
-127
lines changed

Autoload/Graphics.gd

+27-27
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ var sprite_id = {
9494
"LIGHTNING" : preload("res://dk_images/trapdoor_64/trap_lightning_std.png"),
9595
"WORD_OF_POWER" : preload("res://dk_images/trapdoor_64/trap_wop_std.png"),
9696
"LAVA" : preload("res://dk_images/trapdoor_64/trap_lava_std.png"),
97-
"TNT" : preload("res://used_images/tnt.png"),
97+
"TNT" : preload("res://extra_images/tnt.png"),
9898
# Spellbooks
9999
"SPELLBOOK_ARMG" : preload("res://dk_images/keepower_64/armagedn_std.png"),
100100
"SPELLBOOK_POSS" : preload("res://dk_images/keepower_64/possess_std.png"),
@@ -116,11 +116,11 @@ var sprite_id = {
116116
"SPELLBOOK_DWAL" : preload("res://dk_images/keepower_64/dstwall_std.png"),
117117
"SPELLBOOK_TBMB" : preload("res://edited_images/timebomb.png"),
118118
# Decorations/Furniture
119-
"BANNER" : preload("res://used_images/banner.png"),
120-
"FERN" : preload("res://used_images/fern.png"),
121-
"FERN_BROWN" : preload("res://used_images/fern_brown.png"),
122-
"FERN_SMALL" : preload("res://used_images/fern_small.png"),
123-
"FERN_SMALL_BROWN" : preload("res://used_images/fern_small_brown.png"),
119+
"BANNER" : preload("res://extra_images/banner.png"),
120+
"FERN" : preload("res://extra_images/fern.png"),
121+
"FERN_BROWN" : preload("res://extra_images/fern_brown.png"),
122+
"FERN_SMALL" : preload("res://extra_images/fern_small.png"),
123+
"FERN_SMALL_BROWN" : preload("res://extra_images/fern_small_brown.png"),
124124
"FLAGPOLE_BLACKFLAG" : preload("res://dk_images/furniture/flagpole_blackflag_tp/AnimFlagpoleBlack.tres"),
125125
"FLAGPOLE_ORANGEFLAG" : preload("res://dk_images/furniture/flagpole_orangeflag_tp/AnimFlagpoleOrange.tres"),
126126
"FLAGPOLE_PURPLEFLAG" : preload("res://dk_images/furniture/flagpole_purpleflag_tp/AnimFlagpolePurple.tres"),
@@ -130,24 +130,24 @@ var sprite_id = {
130130
"HEARTFLAME_ORANGE" : preload("res://edited_images/heartflames/heartflame_orange/AnimOrangeHeartFlame.tres"),
131131
"HEARTFLAME_PURPLE" : preload("res://edited_images/heartflames/heartflame_purple/AnimPurpleHeartFlame.tres"),
132132
"HEARTFLAME_WHITE" : preload("res://edited_images/heartflames/heartflame_white/AnimWhiteHeartFlame.tres"),
133-
"ICE_PILLAR" : preload("res://used_images/ice_pillar.png"),
134-
"ICE_PILLAR_SMALL" : preload("res://used_images/ice_rock.png"),
135-
"JUNGLE_CATTAILS" : preload("res://used_images/cattails.png"),
136-
"JUNGLE_LILYPAD" : preload("res://used_images/lilypad.png"),
133+
"ICE_PILLAR" : preload("res://extra_images/ice_pillar.png"),
134+
"ICE_PILLAR_SMALL" : preload("res://extra_images/ice_rock.png"),
135+
"JUNGLE_CATTAILS" : preload("res://extra_images/cattails.png"),
136+
"JUNGLE_LILYPAD" : preload("res://extra_images/lilypad.png"),
137137
"KNIGHTSTATUE" : preload("res://dk_images/statues/anim0958/r1frame01.png"),
138-
"LANTERNPOST_STAND" : preload("res://used_images/lantern_pst.png"),
139-
"LAVA_PILLAR" : preload("res://used_images/lava_pillar.png"),
140-
"LAVA_PILLAR_SMALL" : preload("res://used_images/lava_rock.png"),
141-
"MUSHROOM_GREEN_LUM" : preload("res://used_images/mushroom_green.png"),
142-
"MUSHROOM_RED_LUM" : preload("res://used_images/mushroom_red.png"),
143-
"MUSHROOM_YELLOW_LUM" : preload("res://used_images/mushroom_yellow.png"),
144-
"POTION_BROWN" : preload("res://used_images/potion_brown.png"),
145-
"POTION_RED" : preload("res://used_images/potion_red.png"),
146-
"POTION_WHITE" : preload("res://used_images/potion_white.png"),
147-
"POTION_YELLOW" : preload("res://used_images/potion_yellow.png"),
148-
"ROCK_PILLAR" : preload("res://used_images/rock_pillar.png"),
149-
"ROCK_PILLAR_SMALL" : preload("res://used_images/rock.png"),
150-
"DRUID_LAIR" : preload("res://used_images/lair_druid.png"),
138+
"LANTERNPOST_STAND" : preload("res://extra_images/lantern_pst.png"),
139+
"LAVA_PILLAR" : preload("res://extra_images/lava_pillar.png"),
140+
"LAVA_PILLAR_SMALL" : preload("res://extra_images/lava_rock.png"),
141+
"MUSHROOM_GREEN_LUM" : preload("res://extra_images/mushroom_green.png"),
142+
"MUSHROOM_RED_LUM" : preload("res://extra_images/mushroom_red.png"),
143+
"MUSHROOM_YELLOW_LUM" : preload("res://extra_images/mushroom_yellow.png"),
144+
"POTION_BROWN" : preload("res://extra_images/potion_brown.png"),
145+
"POTION_RED" : preload("res://extra_images/potion_red.png"),
146+
"POTION_WHITE" : preload("res://extra_images/potion_white.png"),
147+
"POTION_YELLOW" : preload("res://extra_images/potion_yellow.png"),
148+
"ROCK_PILLAR" : preload("res://extra_images/rock_pillar.png"),
149+
"ROCK_PILLAR_SMALL" : preload("res://extra_images/rock.png"),
150+
"DRUID_LAIR" : preload("res://extra_images/lair_druid.png"),
151151
# Creatures
152152
"POWER_SIGHT" : preload("res://dk_images/magic_fogs/anim0854/AnimCastedSight.tres"),
153153
"WIZARD" : preload("res://edited_images/creatr_icon_64/wizrd_std.png"),
@@ -212,8 +212,8 @@ var sprite_id = {
212212
"ORC_PORTRAIT" : preload("res://dk_images/creature_portrait_64/creatr_portrt_orc.png"),
213213
"FLOATING_SPIRIT" : preload("res://dk_images/magic_dust/anim0981/r1frame02.png"),
214214
"FLOATING_SPIRIT_PORTRAIT" : preload("res://dk_images/magic_dust/anim0981/r1frame02.png"),
215-
"DRUID" : preload("res://used_images/druid.png"),
216-
"DRUID_PORTRAIT" : preload("res://used_images/druid_portrait.png"),
217-
"TIME_MAGE" : preload("res://used_images/time_mage.png"),
218-
"TIME_MAGE_PORTRAIT" : preload("res://used_images/time_mage_portrait.png"),
215+
"DRUID" : preload("res://extra_images/druid.png"),
216+
"DRUID_PORTRAIT" : preload("res://extra_images/druid_portrait.png"),
217+
"TIME_MAGE" : preload("res://extra_images/time_mage.png"),
218+
"TIME_MAGE_PORTRAIT" : preload("res://extra_images/time_mage_portrait.png"),
219219
}

Autoload/Things.gd

+17
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,23 @@ enum TYPE {
2929
EXTRA = 696969
3030
}
3131

32+
var default_data = {}
33+
func _init():
34+
# This only takes 1ms
35+
default_data["DATA_EXTRA"] = DATA_EXTRA.duplicate(true)
36+
default_data["DATA_DOOR"] = DATA_DOOR.duplicate(true)
37+
default_data["DATA_TRAP"] = DATA_TRAP.duplicate(true)
38+
default_data["DATA_EFFECTGEN"] = DATA_EFFECTGEN.duplicate(true)
39+
default_data["DATA_CREATURE"] = DATA_CREATURE.duplicate(true)
40+
default_data["DATA_OBJECT"] = DATA_OBJECT.duplicate(true)
41+
42+
func reset_thing_data_to_default(): # Reset data. Takes 1ms.
43+
DATA_EXTRA = default_data["DATA_EXTRA"].duplicate(true)
44+
DATA_DOOR = default_data["DATA_DOOR"].duplicate(true)
45+
DATA_TRAP = default_data["DATA_TRAP"].duplicate(true)
46+
DATA_EFFECTGEN = default_data["DATA_EFFECTGEN"].duplicate(true)
47+
DATA_CREATURE = default_data["DATA_CREATURE"].duplicate(true)
48+
DATA_OBJECT = default_data["DATA_OBJECT"].duplicate(true)
3249

3350
func fetch_sprite(thing_type, sub_type):
3451
var sub_type_data = data_structure(thing_type).get(sub_type)

Scenes/FxData.gd renamed to Scenes/CfgLoader.gd

+5
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,17 @@ func start():
2121
print('Parsed all dkcfg files: ' + str(OS.get_ticks_msec() - CODETIME_START) + 'ms')
2222

2323
var CODETIME_LOADCFG_START = OS.get_ticks_msec()
24+
# Step 1: set object data to default
25+
Things.reset_thing_data_to_default()
26+
# Step 2: load data from /fxdata/ config files
2427
load_objects_data()
2528
load_creatures_data()
2629
load_trapdoor_data()
30+
# Step 3: load data from local config files (map00001.objects.cfg)
2731
print('Loaded things from cfg files: ' + str(OS.get_ticks_msec() - CODETIME_LOADCFG_START) + 'ms')
2832

2933

34+
3035
func load_objects_data():
3136
for section in objects_cfg:
3237
if section.begins_with("object"):

Scenes/Main.tscn

+3-3
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@
168168
[ext_resource path="res://Scenes/UndoStates.gd" type="Script" id=166]
169169
[ext_resource path="res://Scenes/ThreadedSaveUndo.gd" type="Script" id=167]
170170
[ext_resource path="res://Scenes/Guidelines.gd" type="Script" id=168]
171-
[ext_resource path="res://Scenes/FxData.gd" type="Script" id=169]
171+
[ext_resource path="res://Scenes/CfgLoader.gd" type="Script" id=169]
172172
[ext_resource path="res://Scenes/OldCfgCode.gd" type="Script" id=170]
173173

174174
[sub_resource type="CubeMesh" id=2]
@@ -334,10 +334,10 @@ script = ExtResource( 37 )
334334
[node name="Game" type="Node" parent="."]
335335
script = ExtResource( 30 )
336336
337-
[node name="FxData" type="Node" parent="."]
337+
[node name="CfgLoader" type="Node" parent="."]
338338
script = ExtResource( 169 )
339339
340-
[node name="OLD_UNUSED_CfgCode" type="Node" parent="FxData"]
340+
[node name="OLD_UNUSED_CfgCode" type="Node" parent="CfgLoader"]
341341
script = ExtResource( 170 )
342342
343343
[node name="TextureCache" type="Node" parent="."]

Scenes/OldCfgCode.gd

+1-8
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,7 @@ var default_data = {}
2727

2828

2929

30-
#func _init():
31-
# # This only takes 1ms
32-
# default_data["DATA_EXTRA"] = DATA_EXTRA.duplicate(true)
33-
# default_data["DATA_DOOR"] = DATA_DOOR.duplicate(true)
34-
# default_data["DATA_TRAP"] = DATA_TRAP.duplicate(true)
35-
# default_data["DATA_EFFECTGEN"] = DATA_EFFECTGEN.duplicate(true)
36-
# default_data["DATA_CREATURE"] = DATA_CREATURE.duplicate(true)
37-
# default_data["DATA_OBJECT"] = DATA_OBJECT.duplicate(true)
30+
3831
#
3932
#
4033
#func reset_thing_data_to_default():

Scenes/OpenMap.gd

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ onready var oResizeCurrentMapSize = Nodelist.list["oResizeCurrentMapSize"]
4949
onready var oOwnerSelection = Nodelist.list["oOwnerSelection"]
5050
onready var oScriptGenerator = Nodelist.list["oScriptGenerator"]
5151
onready var oOnlyOwnership = Nodelist.list["oOnlyOwnership"]
52-
onready var oFxData = Nodelist.list["oFxData"]
52+
onready var oCfgLoader = Nodelist.list["oCfgLoader"]
5353

5454
var TOTAL_TIME_TO_OPEN_MAP
5555

@@ -111,7 +111,7 @@ func open_map(filePath):
111111

112112
var map = filePath.get_basename()
113113

114-
oFxData.start()
114+
oCfgLoader.start()
115115

116116
# Open all map file types
117117
oCurrentMap.currentFilePaths = get_accompanying_files(map)
File renamed without changes.

used_images/banner.png.import renamed to extra_images/banner.png.import

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
importer="texture"
44
type="StreamTexture"
5-
path="res://.import/banner.png-9be04942c9c5198ab90865299103459d.stex"
5+
path="res://.import/banner.png-c2bf33e6565c83ced32f8bd540e04d4f.stex"
66
metadata={
77
"vram_texture": false
88
}
99

1010
[deps]
1111

12-
source_file="res://used_images/banner.png"
13-
dest_files=[ "res://.import/banner.png-9be04942c9c5198ab90865299103459d.stex" ]
12+
source_file="res://extra_images/banner.png"
13+
dest_files=[ "res://.import/banner.png-c2bf33e6565c83ced32f8bd540e04d4f.stex" ]
1414

1515
[params]
1616

File renamed without changes.

used_images/cattails.png.import renamed to extra_images/cattails.png.import

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
importer="texture"
44
type="StreamTexture"
5-
path="res://.import/cattails.png-48c6d31d00288640cca773b1567dc84b.stex"
5+
path="res://.import/cattails.png-5d3f768e8ae52687133f36d497c842c0.stex"
66
metadata={
77
"vram_texture": false
88
}
99

1010
[deps]
1111

12-
source_file="res://used_images/cattails.png"
13-
dest_files=[ "res://.import/cattails.png-48c6d31d00288640cca773b1567dc84b.stex" ]
12+
source_file="res://extra_images/cattails.png"
13+
dest_files=[ "res://.import/cattails.png-5d3f768e8ae52687133f36d497c842c0.stex" ]
1414

1515
[params]
1616

File renamed without changes.

used_images/druid.png.import renamed to extra_images/druid.png.import

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
importer="texture"
44
type="StreamTexture"
5-
path="res://.import/druid.png-96f709d99ac9800469bf05f2c9638e60.stex"
5+
path="res://.import/druid.png-ed538b42adab8948dd01b4043287cac8.stex"
66
metadata={
77
"vram_texture": false
88
}
99

1010
[deps]
1111

12-
source_file="res://used_images/druid.png"
13-
dest_files=[ "res://.import/druid.png-96f709d99ac9800469bf05f2c9638e60.stex" ]
12+
source_file="res://extra_images/druid.png"
13+
dest_files=[ "res://.import/druid.png-ed538b42adab8948dd01b4043287cac8.stex" ]
1414

1515
[params]
1616

File renamed without changes.

used_images/druid_portrait.png.import renamed to extra_images/druid_portrait.png.import

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
importer="texture"
44
type="StreamTexture"
5-
path="res://.import/druid_portrait.png-e456008afd51b193dff7abcc8b0380f5.stex"
5+
path="res://.import/druid_portrait.png-0bb0303453604e2986388d1bf6f7260a.stex"
66
metadata={
77
"vram_texture": false
88
}
99

1010
[deps]
1111

12-
source_file="res://used_images/druid_portrait.png"
13-
dest_files=[ "res://.import/druid_portrait.png-e456008afd51b193dff7abcc8b0380f5.stex" ]
12+
source_file="res://extra_images/druid_portrait.png"
13+
dest_files=[ "res://.import/druid_portrait.png-0bb0303453604e2986388d1bf6f7260a.stex" ]
1414

1515
[params]
1616

File renamed without changes.

used_images/fern.png.import renamed to extra_images/fern.png.import

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
importer="texture"
44
type="StreamTexture"
5-
path="res://.import/fern.png-15a40304e0fae568fb2f86a3ba4d85b3.stex"
5+
path="res://.import/fern.png-29bd828ce49cfdeba230da469ab20897.stex"
66
metadata={
77
"vram_texture": false
88
}
99

1010
[deps]
1111

12-
source_file="res://used_images/fern.png"
13-
dest_files=[ "res://.import/fern.png-15a40304e0fae568fb2f86a3ba4d85b3.stex" ]
12+
source_file="res://extra_images/fern.png"
13+
dest_files=[ "res://.import/fern.png-29bd828ce49cfdeba230da469ab20897.stex" ]
1414

1515
[params]
1616

File renamed without changes.

used_images/fern_brown.png.import renamed to extra_images/fern_brown.png.import

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
importer="texture"
44
type="StreamTexture"
5-
path="res://.import/fern_brown.png-1a715c696472eb4943e092719f3a3809.stex"
5+
path="res://.import/fern_brown.png-e380cab0f2b8ecd31c2890cf92085406.stex"
66
metadata={
77
"vram_texture": false
88
}
99

1010
[deps]
1111

12-
source_file="res://used_images/fern_brown.png"
13-
dest_files=[ "res://.import/fern_brown.png-1a715c696472eb4943e092719f3a3809.stex" ]
12+
source_file="res://extra_images/fern_brown.png"
13+
dest_files=[ "res://.import/fern_brown.png-e380cab0f2b8ecd31c2890cf92085406.stex" ]
1414

1515
[params]
1616

File renamed without changes.

used_images/fern_small.png.import renamed to extra_images/fern_small.png.import

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
importer="texture"
44
type="StreamTexture"
5-
path="res://.import/fern_small.png-5a61522e3a4ccbbfbb0f65ebcaead162.stex"
5+
path="res://.import/fern_small.png-dba9ccdf259768ac76e74765a653a4ef.stex"
66
metadata={
77
"vram_texture": false
88
}
99

1010
[deps]
1111

12-
source_file="res://used_images/fern_small.png"
13-
dest_files=[ "res://.import/fern_small.png-5a61522e3a4ccbbfbb0f65ebcaead162.stex" ]
12+
source_file="res://extra_images/fern_small.png"
13+
dest_files=[ "res://.import/fern_small.png-dba9ccdf259768ac76e74765a653a4ef.stex" ]
1414

1515
[params]
1616

File renamed without changes.

used_images/fern_small_brown.png.import renamed to extra_images/fern_small_brown.png.import

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
importer="texture"
44
type="StreamTexture"
5-
path="res://.import/fern_small_brown.png-41329c08ae81db4776b234b31a161c84.stex"
5+
path="res://.import/fern_small_brown.png-c59fa118d591e5aa4af854c65c65ef1b.stex"
66
metadata={
77
"vram_texture": false
88
}
99

1010
[deps]
1111

12-
source_file="res://used_images/fern_small_brown.png"
13-
dest_files=[ "res://.import/fern_small_brown.png-41329c08ae81db4776b234b31a161c84.stex" ]
12+
source_file="res://extra_images/fern_small_brown.png"
13+
dest_files=[ "res://.import/fern_small_brown.png-c59fa118d591e5aa4af854c65c65ef1b.stex" ]
1414

1515
[params]
1616

File renamed without changes.

used_images/ice_pillar.png.import renamed to extra_images/ice_pillar.png.import

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
importer="texture"
44
type="StreamTexture"
5-
path="res://.import/ice_pillar.png-884f0c1378683b8f983ca962b7165bb0.stex"
5+
path="res://.import/ice_pillar.png-aada8d0918cf95a770ea51ca6e513ca7.stex"
66
metadata={
77
"vram_texture": false
88
}
99

1010
[deps]
1111

12-
source_file="res://used_images/ice_pillar.png"
13-
dest_files=[ "res://.import/ice_pillar.png-884f0c1378683b8f983ca962b7165bb0.stex" ]
12+
source_file="res://extra_images/ice_pillar.png"
13+
dest_files=[ "res://.import/ice_pillar.png-aada8d0918cf95a770ea51ca6e513ca7.stex" ]
1414

1515
[params]
1616

File renamed without changes.

used_images/ice_rock.png.import renamed to extra_images/ice_rock.png.import

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
importer="texture"
44
type="StreamTexture"
5-
path="res://.import/ice_rock.png-fa1c1a930138e6d30e3a3b302d54d442.stex"
5+
path="res://.import/ice_rock.png-4a1712fe5ad648823f206a73708694c0.stex"
66
metadata={
77
"vram_texture": false
88
}
99

1010
[deps]
1111

12-
source_file="res://used_images/ice_rock.png"
13-
dest_files=[ "res://.import/ice_rock.png-fa1c1a930138e6d30e3a3b302d54d442.stex" ]
12+
source_file="res://extra_images/ice_rock.png"
13+
dest_files=[ "res://.import/ice_rock.png-4a1712fe5ad648823f206a73708694c0.stex" ]
1414

1515
[params]
1616

File renamed without changes.

used_images/lair_druid.png.import renamed to extra_images/lair_druid.png.import

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
importer="texture"
44
type="StreamTexture"
5-
path="res://.import/lair_druid.png-3b4bc07b01abd7e969cf0d4660fb6bc0.stex"
5+
path="res://.import/lair_druid.png-8950102b4465793e4fcea4cba9607c7b.stex"
66
metadata={
77
"vram_texture": false
88
}
99

1010
[deps]
1111

12-
source_file="res://used_images/lair_druid.png"
13-
dest_files=[ "res://.import/lair_druid.png-3b4bc07b01abd7e969cf0d4660fb6bc0.stex" ]
12+
source_file="res://extra_images/lair_druid.png"
13+
dest_files=[ "res://.import/lair_druid.png-8950102b4465793e4fcea4cba9607c7b.stex" ]
1414

1515
[params]
1616

File renamed without changes.

0 commit comments

Comments
 (0)