mirror of
https://github.com/tonytins/dressupzack
synced 2025-06-25 16:14:43 -04:00
WIP decoupling clothing buttons
Couldn't think of a better title. Anyway, the current system is repeitive and redundent. While it works, it's not by means ideal. Because you have to manually write in a new condiation for every new clothing added. What makes it redundant is the fact that every clothing functions exactly the same. The only difference is in the layers it uses.
This commit is contained in:
parent
bfd678a1de
commit
721e2ab858
24 changed files with 132 additions and 84 deletions
|
@ -1,5 +1,6 @@
|
|||
[gd_scene load_steps=23 format=2]
|
||||
|
||||
[ext_resource path="res://scenes/clothing/camera.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://sprites/clothes/jeans.svg" type="Texture" id=3]
|
||||
[ext_resource path="res://sprites/clothes/blue_skirt.svg" type="Texture" id=4]
|
||||
[ext_resource path="res://sprites/clothes/sweat_pants.svg" type="Texture" id=5]
|
||||
|
@ -21,7 +22,6 @@
|
|||
[ext_resource path="res://sprites/clothes/briefs.svg" type="Texture" id=21]
|
||||
[ext_resource path="res://sprites/clothes/z_briefs.svg" type="Texture" id=22]
|
||||
[ext_resource path="res://sprites/clothes/fundosi.svg" type="Texture" id=23]
|
||||
[ext_resource path="res://sprites/clothes/camera.png" type="Texture" id=24]
|
||||
|
||||
[node name="Wordrobe" type="TabContainer"]
|
||||
anchor_right = 1.0
|
||||
|
@ -36,10 +36,10 @@ __meta__ = {
|
|||
[node name="Pants" type="Tabs" parent="."]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = 5.0
|
||||
margin_top = 41.0
|
||||
margin_right = -5.0
|
||||
margin_bottom = -10.0
|
||||
margin_left = 4.0
|
||||
margin_top = 39.0
|
||||
margin_right = -4.0
|
||||
margin_bottom = -4.0
|
||||
custom_constants/hseparation = 0
|
||||
|
||||
[node name="PantsScroll" type="ScrollContainer" parent="Pants"]
|
||||
|
@ -50,7 +50,7 @@ __meta__ = {
|
|||
}
|
||||
|
||||
[node name="PantsGrid" type="GridContainer" parent="Pants/PantsScroll"]
|
||||
margin_right = 790.0
|
||||
margin_right = 792.0
|
||||
margin_bottom = 228.0
|
||||
size_flags_horizontal = 3
|
||||
columns = 4
|
||||
|
@ -103,10 +103,10 @@ texture_normal = ExtResource( 9 )
|
|||
visible = false
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = 5.0
|
||||
margin_top = 41.0
|
||||
margin_right = -5.0
|
||||
margin_bottom = -10.0
|
||||
margin_left = 4.0
|
||||
margin_top = 39.0
|
||||
margin_right = -4.0
|
||||
margin_bottom = -4.0
|
||||
|
||||
[node name="ShirtsScroll" type="ScrollContainer" parent="Shirts"]
|
||||
anchor_right = 1.0
|
||||
|
@ -115,8 +115,8 @@ margin_left = 10.0
|
|||
margin_top = 10.0
|
||||
|
||||
[node name="ShirtsGrid" type="GridContainer" parent="Shirts/ShirtsScroll"]
|
||||
margin_right = 780.0
|
||||
margin_bottom = 365.0
|
||||
margin_right = 782.0
|
||||
margin_bottom = 356.0
|
||||
size_flags_horizontal = 3
|
||||
columns = 4
|
||||
|
||||
|
@ -200,17 +200,17 @@ flat = true
|
|||
visible = false
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = 5.0
|
||||
margin_top = 41.0
|
||||
margin_right = -5.0
|
||||
margin_bottom = -10.0
|
||||
margin_left = 4.0
|
||||
margin_top = 39.0
|
||||
margin_right = -4.0
|
||||
margin_bottom = -4.0
|
||||
|
||||
[node name="UndiesScroll" type="ScrollContainer" parent="Underwear"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
|
||||
[node name="UndiesGrid" type="GridContainer" parent="Underwear/UndiesScroll"]
|
||||
margin_right = 790.0
|
||||
margin_right = 792.0
|
||||
margin_bottom = 228.0
|
||||
size_flags_horizontal = 3
|
||||
columns = 3
|
||||
|
@ -242,10 +242,10 @@ texture_normal = ExtResource( 23 )
|
|||
visible = false
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = 5.0
|
||||
margin_top = 41.0
|
||||
margin_right = -5.0
|
||||
margin_bottom = -10.0
|
||||
margin_left = 4.0
|
||||
margin_top = 39.0
|
||||
margin_right = -4.0
|
||||
margin_bottom = -4.0
|
||||
|
||||
[node name="AccsScroll" type="ScrollContainer" parent="Accessoires"]
|
||||
margin_left = 19.0
|
||||
|
@ -255,23 +255,7 @@ margin_bottom = 494.0
|
|||
|
||||
[node name="AccsGrid" type="GridContainer" parent="Accessoires/AccsScroll"]
|
||||
margin_right = 350.0
|
||||
margin_bottom = 127.0
|
||||
size_flags_horizontal = 3
|
||||
columns = 3
|
||||
|
||||
[node name="CanonCam" type="TextureButton" parent="Accessoires/AccsScroll/AccsGrid"]
|
||||
margin_right = 85.0
|
||||
margin_bottom = 112.0
|
||||
texture_normal = ExtResource( 24 )
|
||||
|
||||
[node name="RemoveAccessory" type="Button" parent="Accessoires/AccsScroll/AccsGrid"]
|
||||
margin_left = 89.0
|
||||
margin_right = 195.0
|
||||
margin_bottom = 112.0
|
||||
rect_min_size = Vector2( 85, 105 )
|
||||
custom_colors/font_color_disabled = Color( 0, 0, 0, 1 )
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
custom_colors/font_color_hover = Color( 0, 0, 0, 1 )
|
||||
custom_colors/font_color_pressed = Color( 0, 0, 0, 1 )
|
||||
icon = ExtResource( 9 )
|
||||
flat = true
|
||||
[node name="accessoryBase" parent="Accessoires/AccsScroll/AccsGrid" instance=ExtResource( 1 )]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[gd_scene load_steps=30 format=2]
|
||||
|
||||
[ext_resource path="res://scripts/Character.gd" type="Script" id=1]
|
||||
[ext_resource path="res://scripts/characterBase.gd" type="Script" id=1]
|
||||
[ext_resource path="res://sprites/character/tail/tail0.svg" type="Texture" id=2]
|
||||
[ext_resource path="res://sprites/character/tail/tail1.svg" type="Texture" id=3]
|
||||
[ext_resource path="res://sprites/character/tail/tail2.svg" type="Texture" id=4]
|
||||
|
@ -27,9 +27,6 @@
|
|||
[ext_resource path="res://sprites/clothes/bottoms_placeholder.png" type="Texture" id=25]
|
||||
[ext_resource path="res://sprites/clothes/tops_placeholder.png" type="Texture" id=26]
|
||||
|
||||
|
||||
|
||||
|
||||
[sub_resource type="SpriteFrames" id=1]
|
||||
animations = [ {
|
||||
"frames": [ ExtResource( 2 ), ExtResource( 2 ), ExtResource( 2 ), ExtResource( 3 ), ExtResource( 3 ), ExtResource( 3 ), ExtResource( 4 ), ExtResource( 4 ), ExtResource( 4 ) ],
|
||||
|
@ -54,7 +51,7 @@ animations = [ {
|
|||
"speed": 10.0
|
||||
} ]
|
||||
|
||||
[node name="Character" type="Node2D"]
|
||||
[node name="characterBase" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="Base" type="Node2D" parent="."]
|
||||
|
@ -62,7 +59,7 @@ script = ExtResource( 1 )
|
|||
[node name="Tail" type="AnimatedSprite" parent="Base"]
|
||||
position = Vector2( 54.4027, 184.439 )
|
||||
frames = SubResource( 1 )
|
||||
frame = 7
|
||||
frame = 3
|
||||
playing = true
|
||||
|
||||
[node name="Tony" type="Sprite" parent="Base"]
|
||||
|
@ -72,13 +69,13 @@ texture = ExtResource( 5 )
|
|||
[node name="Eyes" type="AnimatedSprite" parent="Base"]
|
||||
position = Vector2( 114.227, 63.9224 )
|
||||
frames = SubResource( 2 )
|
||||
frame = 1
|
||||
frame = 18
|
||||
playing = true
|
||||
|
||||
[node name="Mouth" type="AnimatedSprite" parent="Base"]
|
||||
position = Vector2( 131.024, 67.4964 )
|
||||
frames = SubResource( 3 )
|
||||
frame = 11
|
||||
frame = 7
|
||||
playing = true
|
||||
|
||||
[node name="Undies" type="Sprite" parent="."]
|
8
scenes/clothing/accessoryBase.tscn
Normal file
8
scenes/clothing/accessoryBase.tscn
Normal file
|
@ -0,0 +1,8 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://scenes/clothing/baseClothing.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://scripts/accessoryBase.gd" type="Script" id=2]
|
||||
|
||||
[node name="accessoryBase" instance=ExtResource( 1 )]
|
||||
script = ExtResource( 2 )
|
||||
[connection signal="pressed" from="clothing" to="." method="_on_accessory_pressed"]
|
15
scenes/clothing/baseClothing.tscn
Normal file
15
scenes/clothing/baseClothing.tscn
Normal file
|
@ -0,0 +1,15 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://scripts/baseClothing.gd" type="Script" id=1]
|
||||
|
||||
[node name="baseClothing" type="Control"]
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="clothing" type="TextureButton" parent="."]
|
||||
rect_min_size = Vector2( 106, 112 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
10
scenes/clothing/camera.tscn
Normal file
10
scenes/clothing/camera.tscn
Normal file
|
@ -0,0 +1,10 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://scenes/clothing/accessoryBase.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://sprites/clothes/camera.png" type="Texture" id=2]
|
||||
|
||||
[node name="accessoryBase" instance=ExtResource( 1 )]
|
||||
|
||||
[node name="clothing" parent="." index="0"]
|
||||
rect_min_size = Vector2( 106, 112 )
|
||||
texture_normal = ExtResource( 2 )
|
8
scenes/clothing/undiesBase.tscn
Normal file
8
scenes/clothing/undiesBase.tscn
Normal file
|
@ -0,0 +1,8 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://scenes/clothing/baseClothing.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://scripts/undiesBase.gd" type="Script" id=2]
|
||||
|
||||
[node name="baseClothing" instance=ExtResource( 1 )]
|
||||
script = ExtResource( 2 )
|
||||
[connection signal="pressed" from="clothing" to="." method="_on_undies_pressed"]
|
|
@ -1,14 +1,12 @@
|
|||
[gd_scene load_steps=7 format=2]
|
||||
[gd_scene load_steps=6 format=2]
|
||||
|
||||
[ext_resource path="res://scripts/GameScn.gd" type="Script" id=1]
|
||||
[ext_resource path="res://scenes/characterBase.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://scenes/pause.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://scenes/character.tscn" type="PackedScene" id=3]
|
||||
[ext_resource path="res://scenes/clothes.tscn" type="PackedScene" id=4]
|
||||
[ext_resource path="res://sprites/clothes/icrazy_frame.svg" type="Texture" id=5]
|
||||
[ext_resource path="res://sprites/clothes/lights.png" type="Texture" id=6]
|
||||
|
||||
[node name="GameScreen" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="PicFrame" type="Sprite" parent="."]
|
||||
position = Vector2( 163.773, 119.752 )
|
||||
|
@ -21,8 +19,8 @@ __meta__ = {
|
|||
position = Vector2( 35.118, -14.56 )
|
||||
texture = ExtResource( 6 )
|
||||
|
||||
[node name="Character" parent="." instance=ExtResource( 3 )]
|
||||
position = Vector2( 61.8154, 246.831 )
|
||||
[node name="characterBase" parent="." instance=ExtResource( 1 )]
|
||||
position = Vector2( 43, 250 )
|
||||
|
||||
[node name="UI" type="CanvasLayer" parent="."]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue