Skip to content

Commit

Permalink
bunch of stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
rainlizard committed Apr 30, 2024
1 parent a88d5ed commit 149a36e
Show file tree
Hide file tree
Showing 238 changed files with 2,510 additions and 151 deletions.
8 changes: 8 additions & 0 deletions Autoload/Things.gd
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,14 @@ var DATA_OBJECT = {
134 : ["Armageddon", null,null, preload("res://dk_images/keepower_64/armagedn_std.png"), null, TAB_SPELL],
135 : ["Possess", null,null, preload("res://dk_images/keepower_64/possess_std.png"), null, TAB_SPELL],
136 : ["Gold Bag (100)", null,null, preload("res://dk_images/valuables/gold_sack_tp/r1frame01.png"), null, TAB_GOLD],
161 : ["White Flag", null,null, preload("res://dk_images/furniture/flagpole_whiteflag_tp/AnimFlagpoleWhite.tres"), null, TAB_FURNITURE],
162 : ["White Heart Flame", null,null, preload("res://edited_images/heartflames/heartflame_white/AnimWhiteHeartFlame.tres"), null, TAB_FURNITURE],
164 : ["Purple Flag", null,null, preload("res://dk_images/furniture/flagpole_purpleflag_tp/AnimFlagpolePurple.tres"), null, TAB_FURNITURE],
165 : ["Purple Heart Flame", null,null, preload("res://edited_images/heartflames/heartflame_purple/AnimPurpleHeartFlame.tres"), null, TAB_FURNITURE],
166 : ["Black Flag", null,null, preload("res://dk_images/furniture/flagpole_blackflag_tp/AnimFlagpoleBlack.tres"), null, TAB_FURNITURE],
167 : ["Black Heart Flame", null,null, preload("res://edited_images/heartflames/heartflame_black/AnimBlackHeartFlame.tres"), null, TAB_FURNITURE],
168 : ["Orange Flag", null,null, preload("res://dk_images/furniture/flagpole_orangeflag_tp/AnimFlagpoleOrange.tres"), null, TAB_FURNITURE],
169 : ["Orange Heart Flame", null,null, preload("res://edited_images/heartflames/heartflame_orange/AnimOrangeHeartFlame.tres"), null, TAB_FURNITURE],
}

var LIST_OF_BOXES = {
Expand Down
45 changes: 45 additions & 0 deletions Scenes/GenericGridItem.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
extends PanelContainer

signal pressed

var img_normal setget set_image_normal
var img_pressed
var img_hover
var img_margin = 0
var orig_backcol

func _ready():
if img_normal:
$TextureRect.texture = img_normal
orig_backcol = get_stylebox("panel").bg_color


get_stylebox("panel").content_margin_left = img_margin
get_stylebox("panel").content_margin_right = img_margin
get_stylebox("panel").content_margin_top = img_margin
get_stylebox("panel").content_margin_bottom = img_margin

func _on_GenericGridItem_mouse_entered():
if img_hover:
$TextureRect.texture = img_hover

get_stylebox("panel").bg_color = orig_backcol * 1.25

func _on_GenericGridItem_mouse_exited():
if img_normal:
$TextureRect.texture = img_normal

get_stylebox("panel").bg_color = orig_backcol

func _on_GenericGridItem_gui_input(event):
if event is InputEventMouseButton:
if event.pressed and event.button_index == BUTTON_LEFT:
if img_pressed:
$TextureRect.texture = img_pressed
emit_signal("pressed")
else:
$TextureRect.texture = img_normal

func set_image_normal(setVal):
$TextureRect.texture = setVal
img_normal = setVal
41 changes: 35 additions & 6 deletions Scenes/GenericGridItem.tscn
Original file line number Diff line number Diff line change
@@ -1,8 +1,37 @@
[gd_scene format=2]
[gd_scene load_steps=3 format=2]

[node name="GenericGridItem" type="TextureButton"]
anchor_right = 1.0
anchor_bottom = 1.0
focus_mode = 0
[ext_resource path="res://Scenes/GenericGridItem.gd" type="Script" id=1]

[sub_resource type="StyleBoxFlat" id=1]
resource_local_to_scene = true
content_margin_left = 0.0
content_margin_right = 0.0
content_margin_top = 0.0
content_margin_bottom = 0.0
bg_color = Color( 0.20976, 0.1932, 0.23, 1 )
border_width_left = 1
border_width_top = 1
border_width_right = 1
border_width_bottom = 1
border_color = Color( 1, 1, 1, 0.25098 )
shadow_color = Color( 0.117647, 0.113725, 0.133333, 1 )
shadow_size = 1
shadow_offset = Vector2( 8, 8 )

[node name="GenericGridItem" type="PanelContainer"]
mouse_filter = 1
size_flags_horizontal = 3
size_flags_vertical = 3
custom_styles/panel = SubResource( 1 )
script = ExtResource( 1 )

[node name="TextureRect" type="TextureRect" parent="."]
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 3
expand = true
stretch_mode = 5
stretch_mode = 6

[connection signal="gui_input" from="." to="." method="_on_GenericGridItem_gui_input"]
[connection signal="mouse_entered" from="." to="." method="_on_GenericGridItem_mouse_entered"]
[connection signal="mouse_exited" from="." to="." method="_on_GenericGridItem_mouse_exited"]
7 changes: 6 additions & 1 deletion Scenes/Instances.gd
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ onready var oSelector = Nodelist.list["oSelector"]
onready var oPlaceThingsAnywhere = Nodelist.list["oPlaceThingsAnywhere"]
onready var oOnlyOwnership = Nodelist.list["oOnlyOwnership"]
onready var oDataOwnership = Nodelist.list["oDataOwnership"]
onready var oCurrentFormat = Nodelist.list["oCurrentFormat"]


var thingScn = preload("res://Scenes/ThingInstance.tscn")
Expand Down Expand Up @@ -409,7 +410,11 @@ func spawn_attached(xSlab, ySlab, slabID, ownership, subtile, tngObj): # Spawns
1: id.subtype = 120 # Blue
2: id.subtype = 121 # Green
3: id.subtype = 122 # Yellow
4: kill_instance(id) # White
4:
if oCurrentFormat.selected == 0: # Classic
kill_instance(id) # White
else:
id.subtype = 162 # White
5: kill_instance(id) # None
6: id.subtype = 165 # Purple
7: id.subtype = 167 # Black
Expand Down
40 changes: 36 additions & 4 deletions Scenes/Main.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,8 @@ margin_right = 151.0
margin_bottom = 302.0
size_flags_horizontal = 6
size_flags_vertical = 6
custom_constants/vseparation = 0
custom_constants/hseparation = 0
[node name="WallSlabs" type="PanelContainer" parent="Ui/UiTools/PickSlabWindow/VBoxContainer/SlabTabs/TabFolder"]
visible = false
Expand All @@ -723,6 +725,8 @@ margin_right = 464.0
margin_bottom = 85.0
size_flags_horizontal = 6
size_flags_vertical = 6
custom_constants/vseparation = 0
custom_constants/hseparation = 0
[node name="CustomSlabsTab" type="PanelContainer" parent="Ui/UiTools/PickSlabWindow/VBoxContainer/SlabTabs/TabFolder"]
visible = false
Expand All @@ -745,6 +749,8 @@ margin_right = 464.0
margin_bottom = 85.0
size_flags_horizontal = 6
size_flags_vertical = 6
custom_constants/vseparation = 0
custom_constants/hseparation = 0
[node name="SlabStyle" type="PanelContainer" parent="Ui/UiTools/PickSlabWindow/VBoxContainer/SlabTabs/TabFolder"]
visible = false
Expand All @@ -770,6 +776,8 @@ margin_right = 61.0
margin_bottom = 82.0
size_flags_horizontal = 6
size_flags_vertical = 6
custom_constants/vseparation = 0
custom_constants/hseparation = 0
[node name="OnlyOwnership" type="PanelContainer" parent="Ui/UiTools/PickSlabWindow/VBoxContainer/SlabTabs/TabFolder"]
visible = false
Expand All @@ -795,6 +803,8 @@ margin_right = 61.0
margin_bottom = 82.0
size_flags_horizontal = 6
size_flags_vertical = 6
custom_constants/vseparation = 0
custom_constants/hseparation = 0
[node name="Clippy" type="Control" parent="Ui/UiTools/PickSlabWindow"]
anchor_right = 1.0
Expand Down Expand Up @@ -888,6 +898,8 @@ margin_right = 316.0
margin_bottom = 82.0
size_flags_horizontal = 6
size_flags_vertical = 6
custom_constants/vseparation = 0
custom_constants/hseparation = 0
[node name="Spell" type="PanelContainer" parent="Ui/UiTools/PickThingWindow/VBoxContainer/ThingTabs/TabFolder"]
visible = false
Expand All @@ -909,6 +921,8 @@ margin_right = 626.0
margin_bottom = 90.0
size_flags_horizontal = 6
size_flags_vertical = 6
custom_constants/vseparation = 0
custom_constants/hseparation = 0
[node name="Trap" type="PanelContainer" parent="Ui/UiTools/PickThingWindow/VBoxContainer/ThingTabs/TabFolder"]
visible = false
Expand All @@ -930,6 +944,8 @@ margin_right = 626.0
margin_bottom = 90.0
size_flags_horizontal = 6
size_flags_vertical = 6
custom_constants/vseparation = 0
custom_constants/hseparation = 0
[node name="Box" type="PanelContainer" parent="Ui/UiTools/PickThingWindow/VBoxContainer/ThingTabs/TabFolder"]
visible = false
Expand All @@ -951,6 +967,8 @@ margin_right = 626.0
margin_bottom = 90.0
size_flags_horizontal = 6
size_flags_vertical = 6
custom_constants/vseparation = 0
custom_constants/hseparation = 0
[node name="Special" type="PanelContainer" parent="Ui/UiTools/PickThingWindow/VBoxContainer/ThingTabs/TabFolder"]
visible = false
Expand All @@ -972,6 +990,8 @@ margin_right = 626.0
margin_bottom = 90.0
size_flags_horizontal = 6
size_flags_vertical = 6
custom_constants/vseparation = 0
custom_constants/hseparation = 0
[node name="Gold" type="PanelContainer" parent="Ui/UiTools/PickThingWindow/VBoxContainer/ThingTabs/TabFolder"]
visible = false
Expand All @@ -993,6 +1013,8 @@ margin_right = 626.0
margin_bottom = 90.0
size_flags_horizontal = 6
size_flags_vertical = 6
custom_constants/vseparation = 0
custom_constants/hseparation = 0
[node name="Decoration" type="PanelContainer" parent="Ui/UiTools/PickThingWindow/VBoxContainer/ThingTabs/TabFolder"]
visible = false
Expand All @@ -1014,6 +1036,8 @@ margin_right = 626.0
margin_bottom = 90.0
size_flags_horizontal = 6
size_flags_vertical = 6
custom_constants/vseparation = 0
custom_constants/hseparation = 0
[node name="Action" type="PanelContainer" parent="Ui/UiTools/PickThingWindow/VBoxContainer/ThingTabs/TabFolder"]
visible = false
Expand All @@ -1035,6 +1059,8 @@ margin_right = 565.0
margin_bottom = 54.0
size_flags_horizontal = 6
size_flags_vertical = 6
custom_constants/vseparation = 0
custom_constants/hseparation = 0
[node name="Effect" type="PanelContainer" parent="Ui/UiTools/PickThingWindow/VBoxContainer/ThingTabs/TabFolder"]
visible = false
Expand All @@ -1056,6 +1082,8 @@ margin_right = 626.0
margin_bottom = 90.0
size_flags_horizontal = 6
size_flags_vertical = 6
custom_constants/vseparation = 0
custom_constants/hseparation = 0
[node name="Furniture" type="PanelContainer" parent="Ui/UiTools/PickThingWindow/VBoxContainer/ThingTabs/TabFolder"]
visible = false
Expand All @@ -1077,6 +1105,8 @@ margin_right = 626.0
margin_bottom = 90.0
size_flags_horizontal = 6
size_flags_vertical = 6
custom_constants/vseparation = 0
custom_constants/hseparation = 0
[node name="Lair" type="PanelContainer" parent="Ui/UiTools/PickThingWindow/VBoxContainer/ThingTabs/TabFolder"]
visible = false
Expand All @@ -1098,6 +1128,8 @@ margin_right = 626.0
margin_bottom = 90.0
size_flags_horizontal = 6
size_flags_vertical = 6
custom_constants/vseparation = 0
custom_constants/hseparation = 0
[node name="Misc" type="PanelContainer" parent="Ui/UiTools/PickThingWindow/VBoxContainer/ThingTabs/TabFolder"]
visible = false
Expand All @@ -1119,6 +1151,8 @@ margin_right = 626.0
margin_bottom = 90.0
size_flags_horizontal = 6
size_flags_vertical = 6
custom_constants/vseparation = 0
custom_constants/hseparation = 0
[node name="Clippy" type="Control" parent="Ui/UiTools/PickThingWindow"]
anchor_right = 1.0
Expand Down Expand Up @@ -1301,15 +1335,13 @@ margin_right = 276.0
margin_bottom = 46.0
script = ExtResource( 73 )
[node name="HSeparator2" type="HSeparator" parent="Ui/UiTools/PropertiesWindow/VBoxContainer/PropertiesTabs/PlacingSettings/OwnerSelection"]
margin_right = 276.0
margin_bottom = 1.0
[node name="OwnershipGridContainer" type="GridContainer" parent="Ui/UiTools/PropertiesWindow/VBoxContainer/PropertiesTabs/PlacingSettings/OwnerSelection"]
margin_top = 5.0
margin_right = 276.0
margin_bottom = 5.0
size_flags_horizontal = 3
custom_constants/vseparation = 0
custom_constants/hseparation = 0
columns = 6
[node name="UseSlabOwnerCheckBox" type="CheckBox" parent="Ui/UiTools/PropertiesWindow/VBoxContainer/PropertiesTabs/PlacingSettings/OwnerSelection"]
Expand Down
28 changes: 16 additions & 12 deletions Scenes/OwnerSelection.gd
Original file line number Diff line number Diff line change
Expand Up @@ -19,33 +19,37 @@ func update_ownership_head_icons():

var iconSize
var owner_order
var setMargin
if oCurrentFormat.selected == 0: # Classic format
owner_order = [0,1,2,3,4,5]
oOwnershipGridContainer.columns = 6
oOwnershipGridContainer.set("custom_constants/hseparation", 4)
#oOwnershipGridContainer.set("custom_constants/hseparation", 4)
iconSize = Vector2(42, 42)
setMargin = 1
else:
owner_order = [0,1,2,3,6,7,8,4,5]
oOwnershipGridContainer.columns = 5
oOwnershipGridContainer.set("custom_constants/hseparation", 10) #16
#oOwnershipGridContainer.set("custom_constants/hseparation", 10) #16
iconSize = Vector2(46, 46) #Vector2(51, 51)
setMargin = 1


for i in owner_order:
var id = gridItemScene.instance()

id.set_meta("grid_value", i)

id.img_margin = setMargin
var setText = ""
match i:
0: id.texture_normal = preload("res://edited_images/plyrsym_32/symbol_player_red_std.png")
1: id.texture_normal = preload("res://edited_images/plyrsym_32/symbol_player_blue_std.png")
2: id.texture_normal = preload("res://edited_images/plyrsym_32/symbol_player_green_std.png")
3: id.texture_normal = preload("res://edited_images/plyrsym_32/symbol_player_yellow_std.png")
4: id.texture_normal = preload("res://edited_images/plyrsym_32/symbol_player_white_std.png")
5: id.texture_normal = preload("res://edited_images/plyrsym_32/symbol_player_any_dis.png")
6: id.texture_normal = preload("res://edited_images/plyrsym_32/symbol_player_purple_std.png")
7: id.texture_normal = preload("res://edited_images/plyrsym_32/symbol_player_black_std.png")
8: id.texture_normal = preload("res://edited_images/plyrsym_32/symbol_player_orange_std.png")
0: id.img_normal = preload("res://edited_images/plyrsym_32/symbol_player_red_std.png")
1: id.img_normal = preload("res://edited_images/plyrsym_32/symbol_player_blue_std.png")
2: id.img_normal = preload("res://edited_images/plyrsym_32/symbol_player_green_std.png")
3: id.img_normal = preload("res://edited_images/plyrsym_32/symbol_player_yellow_std.png")
4: id.img_normal = preload("res://edited_images/plyrsym_32/symbol_player_white_std.png")
5: id.img_normal = preload("res://edited_images/plyrsym_32/symbol_player_any_dis.png")
6: id.img_normal = preload("res://edited_images/plyrsym_32/symbol_player_purple_std.png")
7: id.img_normal = preload("res://edited_images/plyrsym_32/symbol_player_black_std.png")
8: id.img_normal = preload("res://edited_images/plyrsym_32/symbol_player_orange_std.png")
setText = Constants.ownershipNames[i]

add_child_to_grid(id, setText, iconSize)
Expand Down
6 changes: 3 additions & 3 deletions Scenes/PickSlabWindow.gd
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ func custom_slab_add_new_button():
var scene = preload('res://Scenes/GenericGridItem.tscn')
var id = scene.instance()
#id.set_meta("ID_of_slab", 0)
id.texture_normal = preload('res://Art/AddCustomSlab.png')
id.texture_hover = preload('res://Art/AddCustomSlabHover.png')
id.texture_pressed = preload('res://Art/AddCustomSlabPressed.png')
id.img_normal = preload('res://Art/AddCustomSlab.png')
id.img_hover = preload('res://Art/AddCustomSlabHover.png')
id.img_pressed = preload('res://Art/AddCustomSlabPressed.png')

var set_text = "Add new"
set_text = set_text.replace(" ","\n") # Use "New lines" wherever there was a space.
Expand Down
Loading

0 comments on commit 149a36e

Please sign in to comment.