1
0
Fork 0
mirror of https://github.com/tonytins/dressupzack synced 2025-05-07 14:04:48 -04:00

Tweaked button and changing functions

This commit is contained in:
Anthony Wilcox 2019-06-10 21:59:30 -04:00
parent 20da3fde06
commit d3210f352e
4 changed files with 18 additions and 15 deletions

View file

@ -57,7 +57,7 @@ animations = [ {
[node name="Tail" type="AnimatedSprite" parent="Base"]
position = Vector2( 54.4027, 184.439 )
frames = SubResource( 1 )
frame = 5
frame = 8
playing = true
[node name="Nathan" type="Sprite" parent="Base"]
@ -67,13 +67,13 @@ texture = ExtResource( 4 )
[node name="Eyes" type="AnimatedSprite" parent="Base"]
position = Vector2( 114.227, 63.9224 )
frames = SubResource( 2 )
frame = 1
frame = 13
playing = true
[node name="Mouth" type="AnimatedSprite" parent="Base"]
position = Vector2( 131.024, 67.4964 )
frames = SubResource( 3 )
frame = 23
frame = 2
playing = true
[node name="Undies" type="Sprite" parent="."]

View file

@ -39,7 +39,6 @@ custom_colors/font_color_bg = Color( 0.921569, 0.921569, 0.921569, 1 )
custom_colors/font_color_fg = Color( 1, 1, 1, 1 )
[node name="Pants" type="Tabs" parent="Wordrobe"]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_top = 31.0
@ -76,9 +75,9 @@ margin_bottom = 112.0
texture_normal = ExtResource( 6 )
[node name="RemovePants" type="Button" parent="Wordrobe/Pants/PantsGrid"]
margin_top = 116.0
margin_right = 106.0
margin_bottom = 228.0
margin_left = 440.0
margin_right = 546.0
margin_bottom = 112.0
rect_min_size = Vector2( 0, 112 )
custom_colors/font_color_disabled = Color( 0, 0, 0, 1 )
custom_colors/font_color = Color( 0, 0, 0, 1 )
@ -88,6 +87,7 @@ icon = ExtResource( 7 )
flat = true
[node name="Shirts" type="Tabs" parent="Wordrobe"]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_top = 31.0
@ -204,7 +204,6 @@ margin_bottom = 112.0
texture_normal = ExtResource( 20 )
[node name="Accessoires" type="Tabs" parent="Wordrobe"]
editor/display_folded = true
visible = false
anchor_right = 1.0
anchor_bottom = 1.0

View file

@ -12,7 +12,7 @@ public class GameScn : Node
{
void ChangeClothes(string path, ClothingType clothingType)
{
var texture = ResourceLoader.Load<Texture>($"res://{path}");
var texture = ResourceLoader.Load<Texture>($"res://sprites/{path}");
switch (clothingType)
{
@ -35,7 +35,7 @@ public class GameScn : Node
}
}
TextureButton ClothingButton(string path, ClothingType clothingType)
TextureButton ClothesButton(string path, ClothingType clothingType)
{
switch (clothingType)
{
@ -53,8 +53,12 @@ public class GameScn : Node
public override void _Process(float delta)
{
// Change clothes
if (ClothingButton("CanonCam", ClothingType.Accessory).IsPressed())
ChangeClothes("sprites/camera.png", ClothingType.Accessory);
// Accessories
if (ClothesButton("CanonCam", ClothingType.Accessory).Pressed)
ChangeClothes("camera.png", ClothingType.Accessory);
// Pants
if (ClothesButton("Jeans", ClothingType.Pants).Pressed)
ChangeClothes("jeans.svg", ClothingType.Pants);
}
}