From afe6ebd215d8ed862e9543aae24afc53d45e22f4 Mon Sep 17 00:00:00 2001 From: rainlizard Date: Mon, 30 May 2022 10:35:23 +1000 Subject: [PATCH] 0.20 --- AutoLoad/Nodelist.gd | 4 +- Scenes/ClmControls.gd | 128 +++++++++++---------- Scenes/ClmControls.tscn | 166 ++++++++++++++------------- Scenes/CustomTooltip.gd | 52 +++++++-- Scenes/Main.tscn | 88 ++++++++------ Scenes/ReadCubes.gd | 4 +- Scenes/SlabColumnEditor.gd | 2 + Scenes/SlabDisplay.gd | 1 - Scenes/SlabDisplay.tscn | 3 - Scenes/SlabStyleButton.tscn | 3 - Scenes/ViewColumn.gd | 48 +++++--- Shaders/IndividualFloorTexture.tres | 11 ++ Theme/RemoveSpinBoxArrows.png | Bin 0 -> 88 bytes Theme/RemoveSpinBoxArrows.png.import | 35 ++++++ 14 files changed, 331 insertions(+), 214 deletions(-) create mode 100644 Shaders/IndividualFloorTexture.tres create mode 100644 Theme/RemoveSpinBoxArrows.png create mode 100644 Theme/RemoveSpinBoxArrows.png.import diff --git a/AutoLoad/Nodelist.gd b/AutoLoad/Nodelist.gd index 91f12eb1..450e7ea0 100644 --- a/AutoLoad/Nodelist.gd +++ b/AutoLoad/Nodelist.gd @@ -1,8 +1,8 @@ extends Node var list = {} -func start(callingScene): #Called by Main - Nodelist.list["oMain"] = callingScene # node_added signal doesn't include the root node, probably because it has no "owner" +func start(callingScene): # Called by Main root scene + Nodelist.list["oMain"] = callingScene # Add callingScene manually since the node_added signal doesn't include adding it get_tree().connect("node_added",self,"node_added") func done(): #Called by ViewportContainer diff --git a/Scenes/ClmControls.gd b/Scenes/ClmControls.gd index 61616ded..65c4c4da 100644 --- a/Scenes/ClmControls.gd +++ b/Scenes/ClmControls.gd @@ -3,43 +3,71 @@ onready var oEditor = Nodelist.list["oEditor"] onready var oColumnDetails = Nodelist.list["oColumnDetails"] onready var oMessage = Nodelist.list["oMessage"] onready var oDataClm = Nodelist.list["oDataClm"] +onready var oCustomTooltip = Nodelist.list["oCustomTooltip"] +onready var oReadCubes = Nodelist.list["oReadCubes"] export(NodePath) onready var nodeClm = get_node(nodeClm) as Node export(NodePath) onready var nodeVoxelView = get_node(nodeVoxelView) as Node -onready var oColumnGridContainer = $"VBoxContainer/ColumnGridContainer" +onready var oHeightSpinBox = $"VBoxContainer/GridAdvancedValues/HeightSpinBox" +onready var oSolidMaskSpinBox = $"VBoxContainer/GridAdvancedValues/SolidMaskSpinBox" +onready var oPermanentSpinBox = $"VBoxContainer/GridAdvancedValues/PermanentSpinBox" +onready var oOrientationSpinBox = $"VBoxContainer/GridAdvancedValues/OrientationSpinBox" +onready var oLintelSpinBox = $"VBoxContainer/GridAdvancedValues/LintelSpinBox" +onready var oGridAdvancedValues = $"VBoxContainer/GridAdvancedValues" +onready var oGridSimpleValues = $"VBoxContainer/GridSimpleValues" onready var oColumnIndexSpinBox = $"VBoxContainer/HBoxContainer/ColumnIndexSpinBox" onready var oColumnFirstUnusedButton = $"VBoxContainer/ColumnFirstUnusedButton" onready var oColumnViewDeleteButton = $"VBoxContainer/ColumnViewDeleteButton" -onready var oFloorTextureSpinBox = $"VBoxContainer/ColumnGridContainer/FloorTextureSpinBox" -onready var oHeightSpinBox = $"VBoxContainer/ColumnGridContainer/HeightSpinBox" -onready var oSolidMaskSpinBox = $"VBoxContainer/ColumnGridContainer/SolidMaskSpinBox" -onready var oPermanentSpinBox = $"VBoxContainer/ColumnGridContainer/PermanentSpinBox" -onready var oOrientationSpinBox = $"VBoxContainer/ColumnGridContainer/OrientationSpinBox" -onready var oLintelSpinBox = $"VBoxContainer/ColumnGridContainer/LintelSpinBox" -onready var oUtilizedSpinBox = $"VBoxContainer/HBoxContainer2/UtilizedSpinBox" +onready var oFloorTextureSpinBox = $"VBoxContainer/GridSimpleValues/FloorTextureSpinBox" -onready var oCube7SpinBox = $"VBoxContainer/ColumnGridContainer/Cube7SpinBox" -onready var oCube6SpinBox = $"VBoxContainer/ColumnGridContainer/Cube6SpinBox" -onready var oCube5SpinBox = $"VBoxContainer/ColumnGridContainer/Cube5SpinBox" -onready var oCube4SpinBox = $"VBoxContainer/ColumnGridContainer/Cube4SpinBox" -onready var oCube3SpinBox = $"VBoxContainer/ColumnGridContainer/Cube3SpinBox" -onready var oCube2SpinBox = $"VBoxContainer/ColumnGridContainer/Cube2SpinBox" -onready var oCube1SpinBox = $"VBoxContainer/ColumnGridContainer/Cube1SpinBox" -onready var oCube0SpinBox = $"VBoxContainer/ColumnGridContainer/Cube0SpinBox" +onready var oUtilizedSpinBox = $"VBoxContainer/HBoxContainer2/UtilizedSpinBox" +onready var oCube8SpinBox = $"VBoxContainer/GridSimpleValues/Cube8SpinBox" +onready var oCube7SpinBox = $"VBoxContainer/GridSimpleValues/Cube7SpinBox" +onready var oCube6SpinBox = $"VBoxContainer/GridSimpleValues/Cube6SpinBox" +onready var oCube5SpinBox = $"VBoxContainer/GridSimpleValues/Cube5SpinBox" +onready var oCube4SpinBox = $"VBoxContainer/GridSimpleValues/Cube4SpinBox" +onready var oCube3SpinBox = $"VBoxContainer/GridSimpleValues/Cube3SpinBox" +onready var oCube2SpinBox = $"VBoxContainer/GridSimpleValues/Cube2SpinBox" +onready var oCube1SpinBox = $"VBoxContainer/GridSimpleValues/Cube1SpinBox" +onready var cubeSpinBoxArray = [ + oCube1SpinBox, + oCube2SpinBox, + oCube3SpinBox, + oCube4SpinBox, + oCube5SpinBox, + oCube6SpinBox, + oCube7SpinBox, + oCube8SpinBox, +] func _ready(): oColumnIndexSpinBox.connect("value_changed", nodeVoxelView, "_on_ColumnIndexSpinBox_value_changed") - oCube7SpinBox.connect("value_changed", self, "_on_cube_value_changed", [7]) - oCube6SpinBox.connect("value_changed", self, "_on_cube_value_changed", [6]) - oCube5SpinBox.connect("value_changed", self, "_on_cube_value_changed", [5]) - oCube4SpinBox.connect("value_changed", self, "_on_cube_value_changed", [4]) - oCube3SpinBox.connect("value_changed", self, "_on_cube_value_changed", [3]) - oCube2SpinBox.connect("value_changed", self, "_on_cube_value_changed", [2]) - oCube1SpinBox.connect("value_changed", self, "_on_cube_value_changed", [1]) - oCube0SpinBox.connect("value_changed", self, "_on_cube_value_changed", [0]) + oFloorTextureSpinBox.connect("mouse_entered", self, "_on_floortexture_mouse_entered") + oFloorTextureSpinBox.connect("mouse_exited", self, "_on_floortexture_mouse_exited") + + for i in cubeSpinBoxArray.size(): + cubeSpinBoxArray[i].connect("value_changed", self, "_on_cube_value_changed", [i]) + cubeSpinBoxArray[i].connect("mouse_entered", self, "_on_cube_mouse_entered", [i]) + cubeSpinBoxArray[i].connect("mouse_exited", self, "_on_cube_mouse_exited", [i]) + + oGridAdvancedValues.visible = false + +func _on_floortexture_mouse_entered(): + oCustomTooltip.set_floortexture(oFloorTextureSpinBox.value) +func _on_floortexture_mouse_exited(): + oCustomTooltip.set_text("") + + +func _on_cube_mouse_entered(cubeNumber): + var cubeIndex = int(cubeSpinBoxArray[cubeNumber].value) + if cubeIndex < oReadCubes.names.size(): + oCustomTooltip.set_text(oReadCubes.names[cubeIndex]) + +func _on_cube_mouse_exited(cubeNumber): + oCustomTooltip.set_text("") func _on_ColumnDuplicateButton_pressed(): var clmIndex = int(oColumnIndexSpinBox.value) @@ -78,20 +106,21 @@ func _on_ColumnIndexSpinBox_value_changed(value): oUtilizedSpinBox.value = nodeClm.utilized[clmIndex] oHeightSpinBox.value = nodeClm.height[clmIndex] oSolidMaskSpinBox.value = nodeClm.solidMask[clmIndex] - oCube7SpinBox.value = nodeClm.cubes[clmIndex][7] - oCube6SpinBox.value = nodeClm.cubes[clmIndex][6] - oCube5SpinBox.value = nodeClm.cubes[clmIndex][5] - oCube4SpinBox.value = nodeClm.cubes[clmIndex][4] - oCube3SpinBox.value = nodeClm.cubes[clmIndex][3] - oCube2SpinBox.value = nodeClm.cubes[clmIndex][2] - oCube1SpinBox.value = nodeClm.cubes[clmIndex][1] - oCube0SpinBox.value = nodeClm.cubes[clmIndex][0] + oCube8SpinBox.value = nodeClm.cubes[clmIndex][7] + oCube7SpinBox.value = nodeClm.cubes[clmIndex][6] + oCube6SpinBox.value = nodeClm.cubes[clmIndex][5] + oCube5SpinBox.value = nodeClm.cubes[clmIndex][4] + oCube4SpinBox.value = nodeClm.cubes[clmIndex][3] + oCube3SpinBox.value = nodeClm.cubes[clmIndex][2] + oCube2SpinBox.value = nodeClm.cubes[clmIndex][1] + oCube1SpinBox.value = nodeClm.cubes[clmIndex][0] for i in get_incoming_connections(): var nodeID = i["source"] if nodeID is CustomSpinBox or nodeID is CheckBox: nodeID.set_block_signals(false) - + + oCustomTooltip.visible = false # Tooltip becomes incorrect when changing column index so just turn it off until you hover your mouse over it again func _on_cube_value_changed(value, cubeNumber): # signal connected by GDScript if nodeClm == oDataClm: @@ -102,7 +131,8 @@ func _on_cube_value_changed(value, cubeNumber): # signal connected by GDScript oHeightSpinBox.value = nodeClm.get_real_height(nodeClm.cubes[clmIndex]) oSolidMaskSpinBox.value = nodeClm.calculate_solid_mask(nodeClm.cubes[clmIndex]) - + + _on_cube_mouse_entered(cubeNumber) # Update tooltip func _on_FloorTextureSpinBox_value_changed(value): if nodeClm == oDataClm: @@ -110,6 +140,8 @@ func _on_FloorTextureSpinBox_value_changed(value): var clmIndex = int(oColumnIndexSpinBox.value) nodeClm.floorTexture[clmIndex] = int(value) nodeVoxelView.update_column_view() + + _on_floortexture_mouse_entered() # Update tooltip func _on_LintelSpinBox_value_changed(value): if nodeClm == oDataClm: @@ -179,29 +211,5 @@ func _on_ColumnViewDeleteButton_pressed(): nodeVoxelView.oAllVoxelObjects.visible = true nodeVoxelView.oSelectedVoxelObject.visible = false - - - -#func connect_all_signals(connectToNode, voxelViewNode): -# $"VBoxContainer/HBoxContainer/ColumnIndexSpinBox".connect("value_changed", voxelViewNode, "_on_ColumnIndexSpinBox_value_changed") -# -# $"VBoxContainer/HBoxContainer/ColumnIndexSpinBox".connect("value_changed", connectToNode, "_on_ColumnIndexSpinBox_value_changed") -# $"VBoxContainer/ColumnFirstUnusedButton".connect("pressed", connectToNode, "_on_ColumnFirstUnusedButton_pressed") -# $"VBoxContainer/ColumnViewDeleteButton".connect("pressed", connectToNode, "_on_ColumnViewDeleteButton_pressed") -# $"VBoxContainer/ColumnGridContainer/Cube7SpinBox".connect("value_changed", connectToNode, "_on_cube_value_changed", [7]) -# $"VBoxContainer/ColumnGridContainer/Cube6SpinBox".connect("value_changed", connectToNode, "_on_cube_value_changed", [6]) -# $"VBoxContainer/ColumnGridContainer/Cube5SpinBox".connect("value_changed", connectToNode, "_on_cube_value_changed", [5]) -# $"VBoxContainer/ColumnGridContainer/Cube4SpinBox".connect("value_changed", connectToNode, "_on_cube_value_changed", [4]) -# $"VBoxContainer/ColumnGridContainer/Cube3SpinBox".connect("value_changed", connectToNode, "_on_cube_value_changed", [3]) -# $"VBoxContainer/ColumnGridContainer/Cube2SpinBox".connect("value_changed", connectToNode, "_on_cube_value_changed", [2]) -# $"VBoxContainer/ColumnGridContainer/Cube1SpinBox".connect("value_changed", connectToNode, "_on_cube_value_changed", [1]) -# $"VBoxContainer/ColumnGridContainer/Cube0SpinBox".connect("value_changed", connectToNode, "_on_cube_value_changed", [0]) -# $"VBoxContainer/ColumnGridContainer/FloorTextureSpinBox".connect("value_changed", connectToNode, "_on_FloorTextureSpinBox_value_changed") -# $"VBoxContainer/ColumnGridContainer/HeightSpinBox".connect("value_changed", connectToNode, "_on_HeightSpinBox_value_changed") -# $"VBoxContainer/ColumnGridContainer/SolidMaskSpinBox".connect("value_changed", connectToNode, "_on_SolidMaskSpinBox_value_changed") -# $"VBoxContainer/ColumnGridContainer/PermanentSpinBox".connect("value_changed", connectToNode, "_on_PermanentSpinBox_value_changed") -# $"VBoxContainer/ColumnGridContainer/OrientationSpinBox".connect("value_changed", connectToNode, "_on_OrientationSpinBox_value_changed") -# $"VBoxContainer/ColumnGridContainer/LintelSpinBox".connect("value_changed", connectToNode, "_on_LintelSpinBox_value_changed") - - - +func _on_CheckboxShowAll_toggled(checkboxValue): + oGridAdvancedValues.visible = checkboxValue diff --git a/Scenes/ClmControls.tscn b/Scenes/ClmControls.tscn index 22af56c0..f2685440 100644 --- a/Scenes/ClmControls.tscn +++ b/Scenes/ClmControls.tscn @@ -1,7 +1,11 @@ -[gd_scene load_steps=3 format=2] +[gd_scene load_steps=5 format=2] [ext_resource path="res://Scenes/CustomSpinBox.gd" type="Script" id=1] [ext_resource path="res://Scenes/ClmControls.gd" type="Script" id=2] +[ext_resource path="res://Theme/RemoveSpinBoxArrows.png" type="Texture" id=3] + +[sub_resource type="Theme" id=1] +SpinBox/icons/updown = ExtResource( 3 ) [node name="ClmControls" type="ScrollContainer"] margin_right = 220.0 @@ -82,6 +86,7 @@ margin_left = 146.0 margin_right = 220.0 margin_bottom = 24.0 size_flags_horizontal = 10 +theme = SubResource( 1 ) max_value = 99999.0 editable = false script = ExtResource( 1 ) @@ -92,25 +97,25 @@ margin_right = 220.0 margin_bottom = 152.0 rect_min_size = Vector2( 24, 24 ) -[node name="ColumnGridContainer" type="GridContainer" parent="VBoxContainer"] +[node name="GridSimpleValues" type="GridContainer" parent="VBoxContainer"] margin_top = 156.0 margin_right = 220.0 -margin_bottom = 572.0 +margin_bottom = 404.0 columns = 2 __meta__ = { "_edit_use_anchors_": false } -[node name="Label8" type="Label" parent="VBoxContainer/ColumnGridContainer"] +[node name="Label8" type="Label" parent="VBoxContainer/GridSimpleValues"] margin_top = 5.0 margin_right = 82.0 margin_bottom = 19.0 -text = "Cube 7" +text = "Cube 8" __meta__ = { "_edit_use_anchors_": false } -[node name="Cube7SpinBox" type="SpinBox" parent="VBoxContainer/ColumnGridContainer"] +[node name="Cube8SpinBox" type="SpinBox" parent="VBoxContainer/GridSimpleValues"] margin_left = 146.0 margin_right = 220.0 margin_bottom = 24.0 @@ -118,16 +123,16 @@ size_flags_horizontal = 10 max_value = 510.0 script = ExtResource( 1 ) -[node name="Label9" type="Label" parent="VBoxContainer/ColumnGridContainer"] +[node name="Label9" type="Label" parent="VBoxContainer/GridSimpleValues"] margin_top = 33.0 margin_right = 82.0 margin_bottom = 47.0 -text = "Cube 6" +text = "Cube 7" __meta__ = { "_edit_use_anchors_": false } -[node name="Cube6SpinBox" type="SpinBox" parent="VBoxContainer/ColumnGridContainer"] +[node name="Cube7SpinBox" type="SpinBox" parent="VBoxContainer/GridSimpleValues"] margin_left = 146.0 margin_top = 28.0 margin_right = 220.0 @@ -136,16 +141,16 @@ size_flags_horizontal = 10 max_value = 510.0 script = ExtResource( 1 ) -[node name="Label10" type="Label" parent="VBoxContainer/ColumnGridContainer"] +[node name="Label10" type="Label" parent="VBoxContainer/GridSimpleValues"] margin_top = 61.0 margin_right = 82.0 margin_bottom = 75.0 -text = "Cube 5" +text = "Cube 6" __meta__ = { "_edit_use_anchors_": false } -[node name="Cube5SpinBox" type="SpinBox" parent="VBoxContainer/ColumnGridContainer"] +[node name="Cube6SpinBox" type="SpinBox" parent="VBoxContainer/GridSimpleValues"] margin_left = 146.0 margin_top = 56.0 margin_right = 220.0 @@ -154,16 +159,16 @@ size_flags_horizontal = 10 max_value = 510.0 script = ExtResource( 1 ) -[node name="Label11" type="Label" parent="VBoxContainer/ColumnGridContainer"] +[node name="Label11" type="Label" parent="VBoxContainer/GridSimpleValues"] margin_top = 89.0 margin_right = 82.0 margin_bottom = 103.0 -text = "Cube 4" +text = "Cube 5" __meta__ = { "_edit_use_anchors_": false } -[node name="Cube4SpinBox" type="SpinBox" parent="VBoxContainer/ColumnGridContainer"] +[node name="Cube5SpinBox" type="SpinBox" parent="VBoxContainer/GridSimpleValues"] margin_left = 146.0 margin_top = 84.0 margin_right = 220.0 @@ -172,16 +177,16 @@ size_flags_horizontal = 10 max_value = 510.0 script = ExtResource( 1 ) -[node name="Label12" type="Label" parent="VBoxContainer/ColumnGridContainer"] +[node name="Label12" type="Label" parent="VBoxContainer/GridSimpleValues"] margin_top = 117.0 margin_right = 82.0 margin_bottom = 131.0 -text = "Cube 3" +text = "Cube 4" __meta__ = { "_edit_use_anchors_": false } -[node name="Cube3SpinBox" type="SpinBox" parent="VBoxContainer/ColumnGridContainer"] +[node name="Cube4SpinBox" type="SpinBox" parent="VBoxContainer/GridSimpleValues"] margin_left = 146.0 margin_top = 112.0 margin_right = 220.0 @@ -190,16 +195,16 @@ size_flags_horizontal = 10 max_value = 510.0 script = ExtResource( 1 ) -[node name="Label13" type="Label" parent="VBoxContainer/ColumnGridContainer"] +[node name="Label13" type="Label" parent="VBoxContainer/GridSimpleValues"] margin_top = 145.0 margin_right = 82.0 margin_bottom = 159.0 -text = "Cube 2" +text = "Cube 3" __meta__ = { "_edit_use_anchors_": false } -[node name="Cube2SpinBox" type="SpinBox" parent="VBoxContainer/ColumnGridContainer"] +[node name="Cube3SpinBox" type="SpinBox" parent="VBoxContainer/GridSimpleValues"] margin_left = 146.0 margin_top = 140.0 margin_right = 220.0 @@ -208,16 +213,16 @@ size_flags_horizontal = 10 max_value = 510.0 script = ExtResource( 1 ) -[node name="Label14" type="Label" parent="VBoxContainer/ColumnGridContainer"] +[node name="Label14" type="Label" parent="VBoxContainer/GridSimpleValues"] margin_top = 173.0 margin_right = 82.0 margin_bottom = 187.0 -text = "Cube 1" +text = "Cube 2" __meta__ = { "_edit_use_anchors_": false } -[node name="Cube1SpinBox" type="SpinBox" parent="VBoxContainer/ColumnGridContainer"] +[node name="Cube2SpinBox" type="SpinBox" parent="VBoxContainer/GridSimpleValues"] margin_left = 146.0 margin_top = 168.0 margin_right = 220.0 @@ -226,16 +231,16 @@ size_flags_horizontal = 10 max_value = 510.0 script = ExtResource( 1 ) -[node name="Label15" type="Label" parent="VBoxContainer/ColumnGridContainer"] +[node name="Label15" type="Label" parent="VBoxContainer/GridSimpleValues"] margin_top = 201.0 margin_right = 82.0 margin_bottom = 215.0 -text = "Cube 0" +text = "Cube 1" __meta__ = { "_edit_use_anchors_": false } -[node name="Cube0SpinBox" type="SpinBox" parent="VBoxContainer/ColumnGridContainer"] +[node name="Cube1SpinBox" type="SpinBox" parent="VBoxContainer/GridSimpleValues"] margin_left = 146.0 margin_top = 196.0 margin_right = 220.0 @@ -244,7 +249,7 @@ size_flags_horizontal = 10 max_value = 510.0 script = ExtResource( 1 ) -[node name="Label6" type="Label" parent="VBoxContainer/ColumnGridContainer"] +[node name="Label6" type="Label" parent="VBoxContainer/GridSimpleValues"] margin_top = 229.0 margin_right = 82.0 margin_bottom = 243.0 @@ -253,7 +258,7 @@ __meta__ = { "_edit_use_anchors_": false } -[node name="FloorTextureSpinBox" type="SpinBox" parent="VBoxContainer/ColumnGridContainer"] +[node name="FloorTextureSpinBox" type="SpinBox" parent="VBoxContainer/GridSimpleValues"] margin_left = 146.0 margin_top = 224.0 margin_right = 220.0 @@ -262,111 +267,107 @@ size_flags_horizontal = 10 max_value = 999.0 script = ExtResource( 1 ) -[node name="Spacing" type="Control" parent="VBoxContainer/ColumnGridContainer"] -margin_top = 252.0 -margin_right = 82.0 -margin_bottom = 276.0 +[node name="CheckboxShowAll" type="CheckBox" parent="VBoxContainer"] +margin_top = 408.0 +margin_right = 220.0 +margin_bottom = 432.0 rect_min_size = Vector2( 24, 24 ) -__meta__ = { -"_edit_use_anchors_": false -} +text = "Show all" -[node name="Spacing2" type="Control" parent="VBoxContainer/ColumnGridContainer"] -margin_left = 86.0 -margin_top = 252.0 +[node name="GridAdvancedValues" type="GridContainer" parent="VBoxContainer"] +margin_top = 436.0 margin_right = 220.0 -margin_bottom = 276.0 -rect_min_size = Vector2( 24, 24 ) +margin_bottom = 572.0 +columns = 2 __meta__ = { "_edit_use_anchors_": false } -[node name="Label5" type="Label" parent="VBoxContainer/ColumnGridContainer"] -margin_top = 285.0 -margin_right = 82.0 -margin_bottom = 299.0 +[node name="Label5" type="Label" parent="VBoxContainer/GridAdvancedValues"] +margin_top = 5.0 +margin_right = 73.0 +margin_bottom = 19.0 text = "Height" __meta__ = { "_edit_use_anchors_": false } -[node name="HeightSpinBox" type="SpinBox" parent="VBoxContainer/ColumnGridContainer"] +[node name="HeightSpinBox" type="SpinBox" parent="VBoxContainer/GridAdvancedValues"] margin_left = 146.0 -margin_top = 280.0 margin_right = 220.0 -margin_bottom = 304.0 +margin_bottom = 24.0 size_flags_horizontal = 10 max_value = 99999.0 script = ExtResource( 1 ) -[node name="Label7" type="Label" parent="VBoxContainer/ColumnGridContainer"] -margin_top = 313.0 -margin_right = 82.0 -margin_bottom = 327.0 +[node name="Label7" type="Label" parent="VBoxContainer/GridAdvancedValues"] +margin_top = 33.0 +margin_right = 73.0 +margin_bottom = 47.0 text = "Solid mask" __meta__ = { "_edit_use_anchors_": false } -[node name="SolidMaskSpinBox" type="SpinBox" parent="VBoxContainer/ColumnGridContainer"] +[node name="SolidMaskSpinBox" type="SpinBox" parent="VBoxContainer/GridAdvancedValues"] margin_left = 146.0 -margin_top = 308.0 +margin_top = 28.0 margin_right = 220.0 -margin_bottom = 332.0 +margin_bottom = 52.0 size_flags_horizontal = 10 max_value = 99999.0 script = ExtResource( 1 ) -[node name="Label3" type="Label" parent="VBoxContainer/ColumnGridContainer"] -margin_top = 341.0 -margin_right = 82.0 -margin_bottom = 355.0 +[node name="Label3" type="Label" parent="VBoxContainer/GridAdvancedValues"] +margin_top = 61.0 +margin_right = 73.0 +margin_bottom = 75.0 text = "Permanent" __meta__ = { "_edit_use_anchors_": false } -[node name="PermanentSpinBox" type="SpinBox" parent="VBoxContainer/ColumnGridContainer"] +[node name="PermanentSpinBox" type="SpinBox" parent="VBoxContainer/GridAdvancedValues"] margin_left = 146.0 -margin_top = 336.0 +margin_top = 56.0 margin_right = 220.0 -margin_bottom = 360.0 +margin_bottom = 80.0 size_flags_horizontal = 10 max_value = 99999.0 script = ExtResource( 1 ) -[node name="Label2" type="Label" parent="VBoxContainer/ColumnGridContainer"] -margin_top = 369.0 -margin_right = 82.0 -margin_bottom = 383.0 +[node name="Label2" type="Label" parent="VBoxContainer/GridAdvancedValues"] +margin_top = 89.0 +margin_right = 73.0 +margin_bottom = 103.0 text = "Orientation" __meta__ = { "_edit_use_anchors_": false } -[node name="OrientationSpinBox" type="SpinBox" parent="VBoxContainer/ColumnGridContainer"] +[node name="OrientationSpinBox" type="SpinBox" parent="VBoxContainer/GridAdvancedValues"] margin_left = 146.0 -margin_top = 364.0 +margin_top = 84.0 margin_right = 220.0 -margin_bottom = 388.0 +margin_bottom = 108.0 size_flags_horizontal = 10 max_value = 99999.0 script = ExtResource( 1 ) -[node name="Label4" type="Label" parent="VBoxContainer/ColumnGridContainer"] -margin_top = 397.0 -margin_right = 82.0 -margin_bottom = 411.0 +[node name="Label4" type="Label" parent="VBoxContainer/GridAdvancedValues"] +margin_top = 117.0 +margin_right = 73.0 +margin_bottom = 131.0 text = "Lintel" __meta__ = { "_edit_use_anchors_": false } -[node name="LintelSpinBox" type="SpinBox" parent="VBoxContainer/ColumnGridContainer"] +[node name="LintelSpinBox" type="SpinBox" parent="VBoxContainer/GridAdvancedValues"] margin_left = 146.0 -margin_top = 392.0 +margin_top = 112.0 margin_right = 220.0 -margin_bottom = 416.0 +margin_bottom = 136.0 size_flags_horizontal = 10 max_value = 99999.0 script = ExtResource( 1 ) @@ -376,9 +377,10 @@ script = ExtResource( 1 ) [connection signal="pressed" from="VBoxContainer/ColumnViewDeleteButton" to="." method="_on_ColumnViewDeleteButton_pressed"] [connection signal="pressed" from="VBoxContainer/ColumnDuplicateButton" to="." method="_on_ColumnDuplicateButton_pressed"] [connection signal="value_changed" from="VBoxContainer/HBoxContainer2/UtilizedSpinBox" to="." method="_on_UtilizedSpinBox_value_changed"] -[connection signal="value_changed" from="VBoxContainer/ColumnGridContainer/FloorTextureSpinBox" to="." method="_on_FloorTextureSpinBox_value_changed"] -[connection signal="value_changed" from="VBoxContainer/ColumnGridContainer/HeightSpinBox" to="." method="_on_HeightSpinBox_value_changed"] -[connection signal="value_changed" from="VBoxContainer/ColumnGridContainer/SolidMaskSpinBox" to="." method="_on_SolidMaskSpinBox_value_changed"] -[connection signal="value_changed" from="VBoxContainer/ColumnGridContainer/PermanentSpinBox" to="." method="_on_PermanentSpinBox_value_changed"] -[connection signal="value_changed" from="VBoxContainer/ColumnGridContainer/OrientationSpinBox" to="." method="_on_OrientationSpinBox_value_changed"] -[connection signal="value_changed" from="VBoxContainer/ColumnGridContainer/LintelSpinBox" to="." method="_on_LintelSpinBox_value_changed"] +[connection signal="value_changed" from="VBoxContainer/GridSimpleValues/FloorTextureSpinBox" to="." method="_on_FloorTextureSpinBox_value_changed"] +[connection signal="toggled" from="VBoxContainer/CheckboxShowAll" to="." method="_on_CheckboxShowAll_toggled"] +[connection signal="value_changed" from="VBoxContainer/GridAdvancedValues/HeightSpinBox" to="." method="_on_HeightSpinBox_value_changed"] +[connection signal="value_changed" from="VBoxContainer/GridAdvancedValues/SolidMaskSpinBox" to="." method="_on_SolidMaskSpinBox_value_changed"] +[connection signal="value_changed" from="VBoxContainer/GridAdvancedValues/PermanentSpinBox" to="." method="_on_PermanentSpinBox_value_changed"] +[connection signal="value_changed" from="VBoxContainer/GridAdvancedValues/OrientationSpinBox" to="." method="_on_OrientationSpinBox_value_changed"] +[connection signal="value_changed" from="VBoxContainer/GridAdvancedValues/LintelSpinBox" to="." method="_on_LintelSpinBox_value_changed"] diff --git a/Scenes/CustomTooltip.gd b/Scenes/CustomTooltip.gd index 2fe37b68..5f99c36e 100644 --- a/Scenes/CustomTooltip.gd +++ b/Scenes/CustomTooltip.gd @@ -3,17 +3,49 @@ extends Control var offset = Vector2(0,-35) func _process(delta): - if get_text() != "": + if visible == true: rect_global_position = get_global_mouse_position() + offset - visible = true - else: - visible = false func set_text(txt): - $PanelContainer/Label.text = txt - yield(get_tree(),'idle_frame') - yield(get_tree(),'idle_frame') - rect_size = Vector2(0,0) - + $PanelContainer/HBoxContainer/TooltipPicture.visible = false + $PanelContainer/HBoxContainer/Label.text = txt + if txt == "": + visible = false + else: + visible = true + #$TooltipPicture.visible = false +# yield(get_tree(),'idle_frame') +# yield(get_tree(),'idle_frame') +# rect_size = Vector2(0,0) + func get_text(): - return $PanelContainer/Label.text + return $PanelContainer/HBoxContainer/Label.text + +func set_floortexture(floorTextureValue): + var oTooltipPic = $PanelContainer/HBoxContainer/TooltipPicture + oTooltipPic.visible = true + + visible = true + #$PanelContainer/Label.text = "" + + var dataImage = Image.new() + var dataTexture = ImageTexture.new() + dataImage.create(1, 1, false, Image.FORMAT_RGB8) + dataTexture.create_from_image(dataImage, 0) + + dataImage.lock() + var valueInput = floorTextureValue + var r = clamp(valueInput, 0, 255) + valueInput -= 255 + var g = clamp(valueInput, 0, 255) + valueInput -= 255 + var b = clamp(valueInput, 0, 255) + dataImage.set_pixel(0, 0, Color8(r,g,b)) + dataImage.unlock() + dataTexture.set_data(dataImage) + + oTooltipPic.material.set_shader_param("showOnlySpecificStyle", 0) + oTooltipPic.material.set_shader_param("slxData", preload("res://Shaders/Black3x3.png")) + oTooltipPic.material.set_shader_param("fieldSizeInSubtiles", Vector2(1, 1)) + oTooltipPic.material.set_shader_param("animationDatabase", preload("res://Shaders/textureanimationdatabase.png")) + oTooltipPic.material.set_shader_param("viewTextures", dataTexture) diff --git a/Scenes/Main.tscn b/Scenes/Main.tscn index 235df32b..b052c45c 100644 --- a/Scenes/Main.tscn +++ b/Scenes/Main.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=159 format=2] +[gd_scene load_steps=160 format=2] [ext_resource path="res://Scenes/SlabStyle.gd" type="Script" id=1] [ext_resource path="res://Scenes/SlabPlacement.gd" type="Script" id=2] @@ -139,6 +139,7 @@ [ext_resource path="res://Scenes/ClmControls.tscn" type="PackedScene" id=137] [ext_resource path="res://Theme/ButtonGroupNewMap.tres" type="ButtonGroup" id=138] [ext_resource path="res://Scenes/ReadCubes.gd" type="Script" id=139] +[ext_resource path="res://Shaders/IndividualFloorTexture.tres" type="Material" id=140] [sub_resource type="TileSet" id=1] 0/name = "Wibble_0.png 0" @@ -4525,40 +4526,6 @@ margin_bottom = 645.0 size_flags_horizontal = 9 text = "Export columns.cfg" -[node name="CustomTooltip" type="Control" parent="Ui/UiSystem"] -margin_top = -10.5 -margin_bottom = 10.5 -mouse_filter = 2 -script = ExtResource( 129 ) - -[node name="PanelContainer" type="PanelContainer" parent="Ui/UiSystem/CustomTooltip"] -self_modulate = Color( 1, 1, 1, 0.501961 ) -margin_left = -4.0 -margin_top = -4.0 -margin_right = 4.0 -margin_bottom = 25.0 -grow_horizontal = 2 -grow_vertical = 2 -mouse_filter = 2 -size_flags_horizontal = 6 -size_flags_vertical = 7 -custom_styles/panel = ExtResource( 130 ) -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="Label" type="Label" parent="Ui/UiSystem/CustomTooltip/PanelContainer"] -self_modulate = Color( 0.752941, 0.752941, 0.752941, 1 ) -margin_left = 4.0 -margin_top = 4.0 -margin_right = 4.0 -margin_bottom = 25.0 -size_flags_horizontal = 6 -size_flags_vertical = 6 -__meta__ = { -"_edit_use_anchors_": false -} - [node name="NewMapWindow" type="WindowDialog" parent="Ui/UiSystem"] visible = true margin_left = -1352.0 @@ -4715,6 +4682,57 @@ size_flags_horizontal = 3 size_flags_vertical = 3 theme = ExtResource( 17 ) +[node name="CustomTooltip" type="Control" parent="Ui/UiMessages"] +margin_top = -10.5 +margin_bottom = 10.5 +mouse_filter = 2 +script = ExtResource( 129 ) + +[node name="PanelContainer" type="PanelContainer" parent="Ui/UiMessages/CustomTooltip"] +self_modulate = Color( 1, 1, 1, 0.501961 ) +margin_left = -4.0 +margin_top = -4.0 +margin_right = 4.0 +margin_bottom = 25.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 2 +size_flags_horizontal = 6 +size_flags_vertical = 7 +custom_styles/panel = ExtResource( 130 ) + +[node name="HBoxContainer" type="HBoxContainer" parent="Ui/UiMessages/CustomTooltip/PanelContainer"] +margin_left = 4.0 +margin_top = 4.0 +margin_right = 36.0 +margin_bottom = 36.0 +mouse_filter = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +custom_constants/separation = 0 + +[node name="TooltipPicture" type="TextureRect" parent="Ui/UiMessages/CustomTooltip/PanelContainer/HBoxContainer"] +material = ExtResource( 140 ) +margin_right = 32.0 +margin_bottom = 32.0 +rect_min_size = Vector2( 32, 32 ) +mouse_filter = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +texture = ExtResource( 26 ) + +[node name="Label" type="Label" parent="Ui/UiMessages/CustomTooltip/PanelContainer/HBoxContainer"] +self_modulate = Color( 0.752941, 0.752941, 0.752941, 1 ) +margin_left = 32.0 +margin_top = 5.0 +margin_right = 32.0 +margin_bottom = 26.0 +size_flags_horizontal = 6 +size_flags_vertical = 6 +__meta__ = { +"_edit_use_anchors_": false +} + [node name="Message" type="Control" parent="Ui/UiMessages"] anchor_left = 0.5 anchor_top = 0.8 diff --git a/Scenes/ReadCubes.gd b/Scenes/ReadCubes.gd index 54aceb6a..1a1424b3 100644 --- a/Scenes/ReadCubes.gd +++ b/Scenes/ReadCubes.gd @@ -18,8 +18,8 @@ func _ready(): var CODETIME_START = OS.get_ticks_msec() while true: var a = file.get_csv_line(" ") - if a[0] == "Name": - names.append(a[2].capitalize())#.to_lower().replace("_"," ")) + if a.size() >= 3 and a[0] == "Name": + names.append(a[2].capitalize().replace(" ",""))#.to_lower().replace("_"," ")) if file.eof_reached() == true: break diff --git a/Scenes/SlabColumnEditor.gd b/Scenes/SlabColumnEditor.gd index ead5ed2f..c27b857c 100644 --- a/Scenes/SlabColumnEditor.gd +++ b/Scenes/SlabColumnEditor.gd @@ -17,6 +17,8 @@ func _ready(): # When re-opening window or opening for first time func _on_ColumnEditor_visibility_changed(): + if is_instance_valid(oDataClm) == false: return + if visible == true: oDataClm.update_all_utilized() # Run this before _on_ColumnEditorTabs_tab_changed() diff --git a/Scenes/SlabDisplay.gd b/Scenes/SlabDisplay.gd index 99316eda..867951fc 100644 --- a/Scenes/SlabDisplay.gd +++ b/Scenes/SlabDisplay.gd @@ -15,7 +15,6 @@ func _ready(): $AspectRatioContainer.anchor_right += iconSize func set_visual(columnArray): - var oDataClm = Nodelist.list["oDataClm"] var oDkClm = Nodelist.list["oDkClm"] var slabID = get_meta("ID_of_slab") diff --git a/Scenes/SlabDisplay.tscn b/Scenes/SlabDisplay.tscn index afa18a20..3ab73cb0 100644 --- a/Scenes/SlabDisplay.tscn +++ b/Scenes/SlabDisplay.tscn @@ -23,9 +23,6 @@ mouse_filter = 2 size_flags_horizontal = 7 size_flags_vertical = 7 stretch_mode = 3 -__meta__ = { -"_edit_use_anchors_": false -} [node name="Icon" type="TextureRect" parent="AspectRatioContainer"] grow_horizontal = 2 diff --git a/Scenes/SlabStyleButton.tscn b/Scenes/SlabStyleButton.tscn index 5e5d7c0a..2e5e40ab 100644 --- a/Scenes/SlabStyleButton.tscn +++ b/Scenes/SlabStyleButton.tscn @@ -14,6 +14,3 @@ custom_styles/pressed = SubResource( 1 ) toggle_mode = true enabled_focus_mode = 0 group = ExtResource( 1 ) -__meta__ = { -"_edit_use_anchors_": false -} diff --git a/Scenes/ViewColumn.gd b/Scenes/ViewColumn.gd index eedb9b53..0c7dc053 100644 --- a/Scenes/ViewColumn.gd +++ b/Scenes/ViewColumn.gd @@ -76,37 +76,53 @@ func update_details(): description = "Height" value = oDataClm.height[entryIndex] 7: - description = "Cube 7" + description = "Cube 8" var cubeNumber = oDataClm.cubes[entryIndex][7] - value = str(cubeNumber) +' : '+ oReadCubes.names[cubeNumber] + value = str(cubeNumber) + if cubeNumber < oReadCubes.names.size(): + value += ' : '+ oReadCubes.names[cubeNumber] 8: - description = "Cube 6" + description = "Cube 7" var cubeNumber = oDataClm.cubes[entryIndex][6] - value = str(cubeNumber) +' : '+ oReadCubes.names[cubeNumber] + value = str(cubeNumber) + if cubeNumber < oReadCubes.names.size(): + value += ' : '+ oReadCubes.names[cubeNumber] 9: - description = "Cube 5" + description = "Cube 6" var cubeNumber = oDataClm.cubes[entryIndex][5] - value = str(cubeNumber) +' : '+ oReadCubes.names[cubeNumber] + value = str(cubeNumber) + if cubeNumber < oReadCubes.names.size(): + value += ' : '+ oReadCubes.names[cubeNumber] 10: - description = "Cube 4" + description = "Cube 5" var cubeNumber = oDataClm.cubes[entryIndex][4] - value = str(cubeNumber) +' : '+ oReadCubes.names[cubeNumber] + value = str(cubeNumber) + if cubeNumber < oReadCubes.names.size(): + value += ' : '+ oReadCubes.names[cubeNumber] 11: - description = "Cube 3" + description = "Cube 4" var cubeNumber = oDataClm.cubes[entryIndex][3] - value = str(cubeNumber) +' : '+ oReadCubes.names[cubeNumber] + value = str(cubeNumber) + if cubeNumber < oReadCubes.names.size(): + value += ' : '+ oReadCubes.names[cubeNumber] 12: - description = "Cube 2" + description = "Cube 3" var cubeNumber = oDataClm.cubes[entryIndex][2] - value = str(cubeNumber) +' : '+ oReadCubes.names[cubeNumber] + value = str(cubeNumber) + if cubeNumber < oReadCubes.names.size(): + value += ' : '+ oReadCubes.names[cubeNumber] 13: - description = "Cube 1" + description = "Cube 2" var cubeNumber = oDataClm.cubes[entryIndex][1] - value = str(cubeNumber) +' : '+ oReadCubes.names[cubeNumber] + value = str(cubeNumber) + if cubeNumber < oReadCubes.names.size(): + value += ' : '+ oReadCubes.names[cubeNumber] 14: - description = "Cube 0" + description = "Cube 1" var cubeNumber = oDataClm.cubes[entryIndex][0] - value = str(cubeNumber) +' : '+ oReadCubes.names[cubeNumber] + value = str(cubeNumber) + if cubeNumber < oReadCubes.names.size(): + value += ' : '+ oReadCubes.names[cubeNumber] 15: description = "Floor texture" value = oDataClm.floorTexture[entryIndex] diff --git a/Shaders/IndividualFloorTexture.tres b/Shaders/IndividualFloorTexture.tres new file mode 100644 index 00000000..68b6db2b --- /dev/null +++ b/Shaders/IndividualFloorTexture.tres @@ -0,0 +1,11 @@ +[gd_resource type="ShaderMaterial" load_steps=3 format=2] + +[ext_resource path="res://Shaders/display_texture_2d.shader" type="Shader" id=1] +[ext_resource path="res://Shaders/textureanimationdatabase.png" type="Texture" id=2] + +[resource] +resource_local_to_scene = true +shader = ExtResource( 1 ) +shader_param/showOnlySpecificStyle = 77777 +shader_param/fieldSizeInSubtiles = Vector2( 255, 255 ) +shader_param/animationDatabase = ExtResource( 2 ) diff --git a/Theme/RemoveSpinBoxArrows.png b/Theme/RemoveSpinBoxArrows.png new file mode 100644 index 0000000000000000000000000000000000000000..5e4988e6b2bfa35a4512b02b86013e071bb13b02 GIT binary patch literal 88 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|ggjjwLo9le j6C_v{Cy4YgaWF8j2rw|#`&RS;Wf?qO{an^LB{Ts5=Rgvz literal 0 HcmV?d00001 diff --git a/Theme/RemoveSpinBoxArrows.png.import b/Theme/RemoveSpinBoxArrows.png.import new file mode 100644 index 00000000..d2db8793 --- /dev/null +++ b/Theme/RemoveSpinBoxArrows.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/RemoveSpinBoxArrows.png-fe4c0eb66f30a30bdcb181fd64193620.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Theme/RemoveSpinBoxArrows.png" +dest_files=[ "res://.import/RemoveSpinBoxArrows.png-fe4c0eb66f30a30bdcb181fd64193620.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=true +flags/anisotropic=true +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0