mirror of
https://github.com/tonytins/dressupzack
synced 2025-05-06 21:54:48 -04:00
License headers
- GameScn.cs now functions the same as GameScn.gd, even though the two use different techniques in changing the clothes, due to the nature of their respective languages. - Soundtrack works but not as intended. I think it's repeating the same song. - License headers have been brought back.
This commit is contained in:
parent
f64c5a3be8
commit
e9b2cb5eaf
8 changed files with 110 additions and 32 deletions
|
@ -1,5 +1,8 @@
|
|||
// Anthony Wilcox licenses this file to you under the GPL license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
// This code was generated by a tool. Any changes made manually will be lost
|
||||
// the next time this code is regenerated.
|
||||
using System.Reflection;
|
||||
[assembly: AssemblyVersion("0.0.1906.1102")]
|
||||
[assembly: AssemblyFileVersion("0.0.1906.1102")]
|
||||
[assembly: AssemblyVersion("0.0.1906.1104")]
|
||||
[assembly: AssemblyFileVersion("0.0.1906.1104")]
|
|
@ -4,6 +4,9 @@
|
|||
var now = DateTime.UtcNow;
|
||||
var version = $"0.0.{now.Year % 100:D2}{now.Month:D2}.{now.Day:D2}{now.Hour:D2}";
|
||||
#>
|
||||
// Anthony Wilcox licenses this file to you under the GPL license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
// This code was generated by a tool. Any changes made manually will be lost
|
||||
// the next time this code is regenerated.
|
||||
using System.Reflection;
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
// Anthony Wilcox licenses this file to you under the GPL license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
using System.Reflection;
|
||||
|
||||
// Information about this assembly is defined by the following attributes.
|
||||
|
|
4
project/project.licenseheader
Normal file
4
project/project.licenseheader
Normal file
|
@ -0,0 +1,4 @@
|
|||
extensions: designer.cs generated.cs
|
||||
extensions: .cs .cpp .h
|
||||
// Anthony Wilcox licenses this file to you under the GPL license.
|
||||
// See the LICENSE file in the project root for more information.
|
|
@ -39,6 +39,7 @@ 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"]
|
||||
editor/display_folded = true
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_top = 31.0
|
||||
|
@ -87,6 +88,7 @@ icon = ExtResource( 7 )
|
|||
flat = true
|
||||
|
||||
[node name="Shirts" type="Tabs" parent="Wordrobe"]
|
||||
editor/display_folded = true
|
||||
visible = false
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
// Anthony Wilcox licenses this file to you under the GPL license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
using Godot;
|
||||
|
||||
public enum ClothingType
|
||||
public enum ClothingLayer
|
||||
{
|
||||
Shirts,
|
||||
Pants,
|
||||
|
@ -10,43 +12,63 @@ public enum ClothingType
|
|||
|
||||
public class GameScn : Node
|
||||
{
|
||||
void ChangeClothes(string path, ClothingType clothingType)
|
||||
|
||||
void ChangeClothes(string path, ClothingLayer clothingLayer)
|
||||
{
|
||||
var texture = ResourceLoader.Load<Texture>($"res://sprites/{path}");
|
||||
|
||||
switch (clothingType)
|
||||
switch (clothingLayer)
|
||||
{
|
||||
case ClothingType.Shirts:
|
||||
case ClothingLayer.Shirts:
|
||||
var top = GetNode<Sprite>("Nathan/Top");
|
||||
top.Texture = texture;
|
||||
break;
|
||||
case ClothingType.Pants:
|
||||
case ClothingLayer.Pants:
|
||||
var bottom = GetNode<Sprite>("Nathan/Bottom");
|
||||
bottom.Texture = texture;
|
||||
break;
|
||||
case ClothingType.Undies:
|
||||
case ClothingLayer.Undies:
|
||||
var undies = GetNode<Sprite>("Nathan/Undies");
|
||||
undies.Texture = texture;
|
||||
break;
|
||||
case ClothingType.Accessory:
|
||||
case ClothingLayer.Accessory:
|
||||
var accessory = GetNode<Sprite>("Nathan/Accessory");
|
||||
accessory.Texture = texture;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
TextureButton ClothesButton(string path, ClothingType clothingType)
|
||||
void ChangeClothes(ClothingLayer clothingLayer)
|
||||
{
|
||||
var blankTopPath = "tops_placeholder.png";
|
||||
var blankBottomPath = "bottoms_placeholder.png";
|
||||
|
||||
switch (clothingLayer)
|
||||
{
|
||||
case ClothingLayer.Shirts:
|
||||
ChangeClothes(blankTopPath, ClothingLayer.Shirts);
|
||||
break;
|
||||
case ClothingLayer.Pants:
|
||||
ChangeClothes(blankBottomPath, ClothingLayer.Pants);
|
||||
break;
|
||||
case ClothingLayer.Accessory:
|
||||
ChangeClothes(blankTopPath, ClothingLayer.Accessory);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
TextureButton ClothesButton(string path, ClothingLayer clothingType)
|
||||
{
|
||||
switch (clothingType)
|
||||
{
|
||||
case ClothingType.Accessory:
|
||||
case ClothingLayer.Accessory:
|
||||
return GetNode<TextureButton>($"Clothes/Wordrobe/Accessoires/AccsGrid/{path}");
|
||||
case ClothingType.Undies:
|
||||
case ClothingLayer.Undies:
|
||||
return GetNode<TextureButton>($"Clothes/Wordrobe/Underwear/UndiesGrid/{path}");
|
||||
default:
|
||||
case ClothingType.Pants:
|
||||
case ClothingLayer.Pants:
|
||||
return GetNode<TextureButton>($"Clothes/Wordrobe/Pants/PantsGrid/{path}");
|
||||
case ClothingType.Shirts:
|
||||
case ClothingLayer.Shirts:
|
||||
return GetNode<TextureButton>($"Clothes/Wordrobe/Shirts/ShirtsGrid/{path}");
|
||||
}
|
||||
}
|
||||
|
@ -54,11 +76,54 @@ public class GameScn : Node
|
|||
public override void _Process(float delta)
|
||||
{
|
||||
// Accessories
|
||||
if (ClothesButton("CanonCam", ClothingType.Accessory).Pressed)
|
||||
ChangeClothes("camera.png", ClothingType.Accessory);
|
||||
// ====================================================
|
||||
|
||||
if (ClothesButton("CanonCam", ClothingLayer.Accessory).Pressed)
|
||||
ChangeClothes("camera.png", ClothingLayer.Accessory);
|
||||
|
||||
//if (ClothesButton("RemoveAccessory", ClothingLayer.Accessory).Pressed)
|
||||
// ChangeClothes(ClothingLayer.Accessory);
|
||||
|
||||
// Pants
|
||||
if (ClothesButton("Jeans", ClothingType.Pants).Pressed)
|
||||
ChangeClothes("jeans.svg", ClothingType.Pants);
|
||||
// ====================================================
|
||||
|
||||
if (ClothesButton("Jeans", ClothingLayer.Pants).Pressed)
|
||||
ChangeClothes("jeans.svg", ClothingLayer.Pants);
|
||||
|
||||
if (ClothesButton("Sweats", ClothingLayer.Pants).Pressed)
|
||||
ChangeClothes("sweat_pants.svg", ClothingLayer.Pants);
|
||||
|
||||
if (ClothesButton("BeatUpJeans", ClothingLayer.Pants).Pressed)
|
||||
ChangeClothes("beat_up_jeans.svg", ClothingLayer.Pants);
|
||||
|
||||
if (ClothesButton("BlueCamoJeans", ClothingLayer.Pants).Pressed)
|
||||
ChangeClothes("blue_camo_jeans.svg", ClothingLayer.Pants);
|
||||
|
||||
//if (ClothesButton("RemovePants", ClothingLayer.Pants).Pressed)
|
||||
// ChangeClothes(ClothingLayer.Pants);
|
||||
|
||||
// Underwear
|
||||
// ====================================================
|
||||
|
||||
if (ClothesButton("Briefs", ClothingLayer.Undies).Pressed)
|
||||
ChangeClothes("briefs.svg", ClothingLayer.Undies);
|
||||
|
||||
if (ClothesButton("ZBriefs", ClothingLayer.Undies).Pressed)
|
||||
ChangeClothes("z_briefs.svg", ClothingLayer.Undies);
|
||||
|
||||
if (ClothesButton("Fundosi", ClothingLayer.Undies).Pressed)
|
||||
ChangeClothes("fundosi.svg", ClothingLayer.Undies);
|
||||
|
||||
if (ClothesButton("OwOCensor", ClothingLayer.Undies).Pressed)
|
||||
ChangeClothes("owo_censor.svg", ClothingLayer.Undies);
|
||||
|
||||
// Shirts
|
||||
// ====================================================
|
||||
|
||||
if (ClothesButton("TrainHoodie", ClothingLayer.Shirts).Pressed)
|
||||
ChangeClothes("train_hoodie.svg", ClothingLayer.Shirts);
|
||||
|
||||
if (ClothesButton("Sweatshirt", ClothingLayer.Shirts).Pressed)
|
||||
ChangeClothes("old_sweatshirt.svg", ClothingLayer.Shirts);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,19 +1,16 @@
|
|||
using System;
|
||||
// Anthony Wilcox licenses this file to you under the GPL license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
using Godot;
|
||||
|
||||
public class Soundtrack : AudioStreamPlayer {
|
||||
// Declare member variables here. Examples:
|
||||
// private int a = 2;
|
||||
// private string b = "text";
|
||||
|
||||
// Called when the node enters the scene tree for the first time.
|
||||
public class Soundtrack : AudioStreamPlayer
|
||||
{
|
||||
public override void _Ready () {
|
||||
Connect ("finished", this, "PlayRandomSong");
|
||||
PlayRandomSong ();
|
||||
//Connect ("finished", this, "PlayRandomSong");
|
||||
//PlayRandomSong();
|
||||
}
|
||||
|
||||
void PlayRandomSong () {
|
||||
var rand = new RandomNumberGenerator ();
|
||||
var rand = new RandomNumberGenerator();
|
||||
rand.Randomize ();
|
||||
|
||||
var tracks = new string[] {
|
||||
|
@ -22,8 +19,9 @@ public class Soundtrack : AudioStreamPlayer {
|
|||
"at_the_lake",
|
||||
"mushrooms",
|
||||
};
|
||||
var randDb = rand.Randi () % tracks.Length;
|
||||
// var audiostream = this.
|
||||
Play ();
|
||||
var index = rand.RandiRange(0, tracks.Length);
|
||||
var audiostream = ResourceLoader.Load<AudioStream>($"res://music/{tracks[index]}.ogg");
|
||||
Stream = audiostream;
|
||||
Play();
|
||||
}
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
// Anthony Wilcox licenses this file to you under the GPL license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
using Godot;
|
||||
|
||||
public class TitleScn : Node {
|
||||
|
|
Loading…
Add table
Reference in a new issue