[gd_scene load_steps=13 format=3 uid="uid://ck4x56txf676a"]

[ext_resource type="Script" uid="uid://grs3nyom325o" path="res://scripts/character_select.gd" id="1_bow2h"]
[ext_resource type="PackedScene" uid="uid://46rpw0rrd51m" path="res://templates/pawn_display.tscn" id="2_5wdeo"]
[ext_resource type="Texture2D" uid="uid://dri0a20l6kpbj" path="res://visuals/images/icon.svg" id="2_uxcyu"]
[ext_resource type="AudioStream" uid="uid://vcatohtmt8bk" path="res://audio/music/16 - Character Select.mp3" id="3_bow2h"]
[ext_resource type="AudioStream" uid="uid://cwmfd8ov3lj1h" path="res://audio/sounds/menu select.wav" id="7_bqp8h"]
[ext_resource type="AudioStream" uid="uid://doelc8yt5snc2" path="res://audio/sounds/Keypad A.wav" id="8_5cdo8"]

[sub_resource type="Shader" id="Shader_fa52j"]
code = "shader_type canvas_item;

uniform sampler2D main_texture;
uniform float granularity : hint_range(5, 30)  = 15.0;
uniform float opacity_limit;

float random (vec2 uv) {
    return fract(sin(dot(uv.xy,
        vec2(12.9898,78.233))) * 43758.5453123);
}

void vertex() {
	// Called for every vertex the material is visible on.
	
}

void fragment() {
	// Called for every pixel the material is visible on.
	vec2 uv = UV;
	float g = ( pow(granularity, 2));
	uv = round((uv * g)) / g;
	uv.y = TIME * uv.y + TIME * .05;
	uv.x = 10.0 * TIME * uv.x + TIME * 1.0;
	float val = random(uv);
	float op = random(-uv) / val;
	float alpha = 1.0;
	if(op < opacity_limit){
		alpha = 0.0;
	}
	vec4 color = vec4(val, val, val, alpha * COLOR.a);
	COLOR = color;
}

//void light() {
//	// Called for every pixel for every light affecting the CanvasItem.
//	// Uncomment to replace the default light processing function with this one.
//}
"

[sub_resource type="ShaderMaterial" id="ShaderMaterial_5wdeo"]
shader = SubResource("Shader_fa52j")
shader_parameter/granularity = 10.0000002375
shader_parameter/opacity_limit = 0.86

[sub_resource type="Gradient" id="Gradient_ak2if"]
offsets = PackedFloat32Array(0)
colors = PackedColorArray(0, 0, 0, 1)

[sub_resource type="GradientTexture1D" id="GradientTexture1D_fa52j"]
gradient = SubResource("Gradient_ak2if")
width = 1

[sub_resource type="Gradient" id="Gradient_w1hxv"]
offsets = PackedFloat32Array(1)
colors = PackedColorArray(1, 1, 1, 1)

[sub_resource type="GradientTexture1D" id="GradientTexture1D_bqp8h"]
gradient = SubResource("Gradient_w1hxv")
width = 1

[node name="Control" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_bow2h")

[node name="SelectorSpawner" type="MultiplayerSpawner" parent="."]
unique_name_in_owner = true
_spawnable_scenes = PackedStringArray("uid://bvypswoe6diaq")
spawn_path = NodePath("../Panel2/SelectorStart")

[node name="Panel" type="Panel" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

[node name="Control" type="Control" parent="Panel"]
anchors_preset = 0
offset_left = 94.0
offset_top = 98.0
offset_right = 134.0
offset_bottom = 138.0

[node name="P1PawnDisplay" parent="Panel/Control" instance=ExtResource("2_5wdeo")]
unique_name_in_owner = true
layout_mode = 0
offset_left = 0.0
offset_top = 0.0
offset_right = 700.0
offset_bottom = 700.0

[node name="P2PawnDisplay" parent="Panel/Control" instance=ExtResource("2_5wdeo")]
unique_name_in_owner = true
layout_mode = 0
offset_left = 1032.0
offset_top = 0.0
offset_right = 1732.0
offset_bottom = 700.0

[node name="PawnName" parent="Panel/Control/P2PawnDisplay/Control" index="0"]
modulate = Color(0.78848296, 0, 0.22455063, 1)

[node name="Panel2" type="Panel" parent="."]
custom_minimum_size = Vector2(0, 250)
layout_mode = 1
anchors_preset = 12
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 0

[node name="HBoxContainer" type="HBoxContainer" parent="Panel2"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -512.5
offset_top = -75.0
offset_right = 512.5
offset_bottom = 75.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/separation = 25
alignment = 1

[node name="Panel" type="Panel" parent="Panel2/HBoxContainer"]
custom_minimum_size = Vector2(150, 150)
layout_mode = 2

[node name="Portrait" type="TextureRect" parent="Panel2/HBoxContainer/Panel"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("2_uxcyu")
expand_mode = 1

[node name="Control" type="Control" parent="Panel2/HBoxContainer/Panel"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

[node name="Static" type="TextureRect" parent="Panel2/HBoxContainer/Panel/Control"]
material = SubResource("ShaderMaterial_5wdeo")
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = SubResource("GradientTexture1D_fa52j")
expand_mode = 1

[node name="Green Tint" type="TextureRect" parent="Panel2/HBoxContainer/Panel/Control"]
modulate = Color(0, 0.6039216, 0, 0.42745098)
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = SubResource("GradientTexture1D_bqp8h")
expand_mode = 1

[node name="NinePatchRect" type="NinePatchRect" parent="Panel2/HBoxContainer/Panel"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

[node name="Panel2" type="Panel" parent="Panel2/HBoxContainer"]
custom_minimum_size = Vector2(150, 150)
layout_mode = 2

[node name="Portrait" type="TextureRect" parent="Panel2/HBoxContainer/Panel2"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("2_uxcyu")
expand_mode = 1

[node name="Control" type="Control" parent="Panel2/HBoxContainer/Panel2"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

[node name="Static" type="TextureRect" parent="Panel2/HBoxContainer/Panel2/Control"]
material = SubResource("ShaderMaterial_5wdeo")
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = SubResource("GradientTexture1D_fa52j")
expand_mode = 1

[node name="Green Tint" type="TextureRect" parent="Panel2/HBoxContainer/Panel2/Control"]
modulate = Color(0, 0.6039216, 0, 0.42745098)
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = SubResource("GradientTexture1D_bqp8h")
expand_mode = 1

[node name="NinePatchRect" type="NinePatchRect" parent="Panel2/HBoxContainer/Panel2"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

[node name="Panel3" type="Panel" parent="Panel2/HBoxContainer"]
custom_minimum_size = Vector2(150, 150)
layout_mode = 2

[node name="Portrait" type="TextureRect" parent="Panel2/HBoxContainer/Panel3"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("2_uxcyu")
expand_mode = 1

[node name="Control" type="Control" parent="Panel2/HBoxContainer/Panel3"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

[node name="Static" type="TextureRect" parent="Panel2/HBoxContainer/Panel3/Control"]
material = SubResource("ShaderMaterial_5wdeo")
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = SubResource("GradientTexture1D_fa52j")
expand_mode = 1

[node name="Green Tint" type="TextureRect" parent="Panel2/HBoxContainer/Panel3/Control"]
modulate = Color(0, 0.6039216, 0, 0.42745098)
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = SubResource("GradientTexture1D_bqp8h")
expand_mode = 1

[node name="NinePatchRect" type="NinePatchRect" parent="Panel2/HBoxContainer/Panel3"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

[node name="Panel4" type="Panel" parent="Panel2/HBoxContainer"]
custom_minimum_size = Vector2(150, 150)
layout_mode = 2

[node name="Portrait" type="TextureRect" parent="Panel2/HBoxContainer/Panel4"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("2_uxcyu")
expand_mode = 1

[node name="Control" type="Control" parent="Panel2/HBoxContainer/Panel4"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

[node name="Static" type="TextureRect" parent="Panel2/HBoxContainer/Panel4/Control"]
material = SubResource("ShaderMaterial_5wdeo")
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = SubResource("GradientTexture1D_fa52j")
expand_mode = 1

[node name="Green Tint" type="TextureRect" parent="Panel2/HBoxContainer/Panel4/Control"]
modulate = Color(0, 0.6039216, 0, 0.42745098)
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = SubResource("GradientTexture1D_bqp8h")
expand_mode = 1

[node name="NinePatchRect" type="NinePatchRect" parent="Panel2/HBoxContainer/Panel4"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

[node name="Panel5" type="Panel" parent="Panel2/HBoxContainer"]
custom_minimum_size = Vector2(150, 150)
layout_mode = 2

[node name="Portrait" type="TextureRect" parent="Panel2/HBoxContainer/Panel5"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("2_uxcyu")
expand_mode = 1

[node name="Control" type="Control" parent="Panel2/HBoxContainer/Panel5"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

[node name="Static" type="TextureRect" parent="Panel2/HBoxContainer/Panel5/Control"]
material = SubResource("ShaderMaterial_5wdeo")
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = SubResource("GradientTexture1D_fa52j")
expand_mode = 1

[node name="Green Tint" type="TextureRect" parent="Panel2/HBoxContainer/Panel5/Control"]
modulate = Color(0, 0.6039216, 0, 0.42745098)
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = SubResource("GradientTexture1D_bqp8h")
expand_mode = 1

[node name="NinePatchRect" type="NinePatchRect" parent="Panel2/HBoxContainer/Panel5"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

[node name="Panel6" type="Panel" parent="Panel2/HBoxContainer"]
custom_minimum_size = Vector2(150, 150)
layout_mode = 2

[node name="Portrait" type="TextureRect" parent="Panel2/HBoxContainer/Panel6"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("2_uxcyu")
expand_mode = 1

[node name="Control" type="Control" parent="Panel2/HBoxContainer/Panel6"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

[node name="Static" type="TextureRect" parent="Panel2/HBoxContainer/Panel6/Control"]
material = SubResource("ShaderMaterial_5wdeo")
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = SubResource("GradientTexture1D_fa52j")
expand_mode = 1

[node name="Green Tint" type="TextureRect" parent="Panel2/HBoxContainer/Panel6/Control"]
modulate = Color(0, 0.6039216, 0, 0.42745098)
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = SubResource("GradientTexture1D_bqp8h")
expand_mode = 1

[node name="NinePatchRect" type="NinePatchRect" parent="Panel2/HBoxContainer/Panel6"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

[node name="SelectorStart" type="Control" parent="Panel2"]
unique_name_in_owner = true
anchors_preset = 0
offset_left = 438.0
offset_top = 40.0
offset_right = 478.0
offset_bottom = 80.0

[node name="Panel3" type="Panel" parent="."]
layout_mode = 1
anchors_preset = 10
anchor_right = 1.0
offset_bottom = 75.0
grow_horizontal = 2

[node name="Label" type="Label" parent="Panel3"]
layout_mode = 1
anchors_preset = 7
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -75.5
offset_top = -23.0
offset_right = 75.5
grow_horizontal = 2
grow_vertical = 0
theme_override_font_sizes/font_size = 40
text = "CHARACTER SELECT"
horizontal_alignment = 1

[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
stream = ExtResource("3_bow2h")
volume_db = -5.0
autoplay = true

[node name="SelectSound" type="AudioStreamPlayer" parent="."]
unique_name_in_owner = true
stream = ExtResource("7_bqp8h")

[node name="SwitchSound" type="AudioStreamPlayer" parent="."]
unique_name_in_owner = true
stream = ExtResource("8_5cdo8")

[connection signal="spawned" from="SelectorSpawner" to="." method="_on_selector_spawner_spawned"]
[connection signal="child_entered_tree" from="Panel2/SelectorStart" to="." method="_on_selector_start_child_entered_tree"]

[editable path="Panel/Control/P1PawnDisplay"]
[editable path="Panel/Control/P2PawnDisplay"]
