Skip to content

Commit

Permalink
initial slabset things ui
Browse files Browse the repository at this point in the history
  • Loading branch information
rainlizard committed Nov 9, 2023
1 parent 559cd9f commit 2a73b60
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
10 changes: 10 additions & 0 deletions Autoload/Slabset.gd
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ func load_slabset():

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

# IsLight [0-1]
# Variation
# Subtile [0-9]
# RelativeX
# RelativeY
# RelativeZ
# Thing type
# Thing subtype
# Effect range

func create_object_list(tng_buffer):
tng_buffer.seek(0)
numberOfThings = tng_buffer.get_u16() # It says 359, however there are actually 362 entries in the file.
Expand Down
39 changes: 38 additions & 1 deletion Scenes/SlabsetWindow.gd
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ func variation_changed(variation):
constructString += "Near water"

oVariationInfoLabel.text = constructString
update_slabthings()

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

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

# [0] IsLight [0-1]
# [1] Variation
# [2] Subtile [0-9]
# [3] RelativeX
# [4] RelativeY
# [5] RelativeZ
# [6] Thing type
# [7] Thing subtype
# [8] Effect range

func update_slabthings():
var slabID = int(oSlabsetIDSpinBox.value)
var variation = (slabID * 28) + int(oVariationNumberSpinBox.value)
if variation >= Slabset.tng.size():
print("Hide the section")
return
var listOfObjectsOnThisVariation = Slabset.tng[variation]
if listOfObjectsOnThisVariation.size() == 0:
print("Hide the section")
return
print("-------------------")
print(slabID)
print(listOfObjectsOnThisVariation)
var obj = listOfObjectsOnThisVariation[0] # Get first object on variation

oObjObjectIndexSpinBox.value = 0
#oObjAddButton.value = 0
#oObjDeleteButton.value = 0
oObjThingTypeSpinBox.value = obj[6]
oObjSubtypeSpinBox.value = obj[7]
oObjIsLightSpinBox.value = obj[0]
oObjEffectRangeSpinBox.value = obj[8]
oObjSubtileSpinBox.value = obj[2]
oObjRelativeXSpinBox.value = obj[3]
oObjRelativeYSpinBox.value = obj[4]
oObjRelativeZSpinBox.value = obj[5]

func _on_ObjAddButton_pressed():
pass # Replace with function body.
Expand Down

0 comments on commit 2a73b60

Please sign in to comment.