Skip to content

Commit 2a73b60

Browse files
committed
initial slabset things ui
1 parent 559cd9f commit 2a73b60

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

Autoload/Slabset.gd

+10
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,16 @@ func load_slabset():
6262

6363
print('Created Slabset : '+str(OS.get_ticks_msec()-CODETIME_START)+'ms')
6464

65+
# IsLight [0-1]
66+
# Variation
67+
# Subtile [0-9]
68+
# RelativeX
69+
# RelativeY
70+
# RelativeZ
71+
# Thing type
72+
# Thing subtype
73+
# Effect range
74+
6575
func create_object_list(tng_buffer):
6676
tng_buffer.seek(0)
6777
numberOfThings = tng_buffer.get_u16() # It says 359, however there are actually 362 entries in the file.

Scenes/SlabsetWindow.gd

+38-1
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ func variation_changed(variation):
126126
constructString += "Near water"
127127

128128
oVariationInfoLabel.text = constructString
129+
update_slabthings()
129130

130131
#enum dir {
131132
# s = 0
@@ -184,7 +185,7 @@ func _on_SlabsetHelpButton_pressed():
184185
var helptxt = ""
185186
helptxt += "Slabset is loaded from /data/slabs.dat \n"
186187
helptxt += "Columnset is loaded from /data/slabs.clm \n"
187-
helptxt += "Objectset is loaded from /data/slabs.tng \n"
188+
helptxt += "The attached objects are loaded from /data/slabs.tng \n"
188189
helptxt += "These sets determine the slab's appearance when placed. \n"
189190
helptxt += "To mod the slabs that are placed in-game you'll need to export .cfg files and use them in a mappack/campaign."
190191

@@ -274,6 +275,42 @@ func _on_ExportSlabsetClmDialog_file_selected(filePath):
274275
else:
275276
oMessage.big("Error", "Couldn't save file, maybe try saving to another directory.")
276277

278+
# [0] IsLight [0-1]
279+
# [1] Variation
280+
# [2] Subtile [0-9]
281+
# [3] RelativeX
282+
# [4] RelativeY
283+
# [5] RelativeZ
284+
# [6] Thing type
285+
# [7] Thing subtype
286+
# [8] Effect range
287+
288+
func update_slabthings():
289+
var slabID = int(oSlabsetIDSpinBox.value)
290+
var variation = (slabID * 28) + int(oVariationNumberSpinBox.value)
291+
if variation >= Slabset.tng.size():
292+
print("Hide the section")
293+
return
294+
var listOfObjectsOnThisVariation = Slabset.tng[variation]
295+
if listOfObjectsOnThisVariation.size() == 0:
296+
print("Hide the section")
297+
return
298+
print("-------------------")
299+
print(slabID)
300+
print(listOfObjectsOnThisVariation)
301+
var obj = listOfObjectsOnThisVariation[0] # Get first object on variation
302+
303+
oObjObjectIndexSpinBox.value = 0
304+
#oObjAddButton.value = 0
305+
#oObjDeleteButton.value = 0
306+
oObjThingTypeSpinBox.value = obj[6]
307+
oObjSubtypeSpinBox.value = obj[7]
308+
oObjIsLightSpinBox.value = obj[0]
309+
oObjEffectRangeSpinBox.value = obj[8]
310+
oObjSubtileSpinBox.value = obj[2]
311+
oObjRelativeXSpinBox.value = obj[3]
312+
oObjRelativeYSpinBox.value = obj[4]
313+
oObjRelativeZSpinBox.value = obj[5]
277314

278315
func _on_ObjAddButton_pressed():
279316
pass # Replace with function body.

0 commit comments

Comments
 (0)