way too many changes to list, oops. big rewrite.

This commit is contained in:
2025-05-27 03:38:03 +10:00
parent 16951a9beb
commit 4a21701a35
663 changed files with 7389 additions and 3283 deletions

62
UI/KeybindEntry.gd Normal file
View File

@ -0,0 +1,62 @@
extends HBoxContainer
class_name KeybindEntry
signal primary_bind_pressed()
signal secondary_bind_pressed()
var action_string: String
func set_action_name(action_name: String) -> void:
action_string = action_name
$ActionName.text = action_name
func set_primary_bind(event: InputEvent) -> void:
if event is InputEventKey:
if KeyIconMap.keys.has(str(event.keycode)):
$Buttons/PrimaryBind.icon = load(KeyIconMap.keys[str(event.keycode)])
elif event is InputEventMouseButton:
if event.button_index == 4:
$Buttons/PrimaryBind.text = "Mouse Wheel Up"
elif event.button_index == 5:
$Buttons/PrimaryBind.text = "Mouse Wheel Down"
elif event.button_index == 6:
$Buttons/PrimaryBind.text = "Mouse Wheel Left"
elif event.button_index == 7:
$Buttons/PrimaryBind.text = "Mouse Wheel Right"
elif event.button_index == 8:
$Buttons/PrimaryBind.text = "Mouse Button 4"
elif event.button_index == 9:
$Buttons/PrimaryBind.text = "Mouse Button 5"
elif KeyIconMap.mouse_buttons.has(str(event.button_index)):
$Buttons/PrimaryBind.icon = load(KeyIconMap.mouse_buttons[str(event.button_index)])
func set_secondary_bind(event: InputEvent) -> void:
if event is InputEventKey:
if KeyIconMap.keys.has(str(event.keycode)):
$Buttons/SecondaryBind.icon = load(KeyIconMap.keys[str(event.keycode)])
elif event is InputEventMouseButton:
if event.button_index == 4:
$Buttons/PrimaryBind.text = "Mouse Wheel Up"
elif event.button_index == 5:
$Buttons/PrimaryBind.text = "Mouse Wheel Down"
elif event.button_index == 6:
$Buttons/PrimaryBind.text = "Mouse Wheel Left"
elif event.button_index == 7:
$Buttons/PrimaryBind.text = "Mouse Wheel Right"
elif event.button_index == 8:
$Buttons/PrimaryBind.text = "Mouse Button 4"
elif event.button_index == 9:
$Buttons/PrimaryBind.text = "Mouse Button 5"
elif KeyIconMap.mouse_buttons.has(str(event.button_index)):
$Buttons/PrimaryBind.icon = load(KeyIconMap.mouse_buttons[str(event.button_index)])
func _on_primary_bind_pressed() -> void:
primary_bind_pressed.emit()
func _on_secondary_bind_pressed() -> void:
secondary_bind_pressed.emit()

1
UI/KeybindEntry.gd.uid Normal file
View File

@ -0,0 +1 @@
uid://y2pxkfjn0wa2

14
UI/button_stylebox.tres Normal file
View File

@ -0,0 +1,14 @@
[gd_resource type="StyleBoxFlat" format=3 uid="uid://de3eok2g4r2k"]
[resource]
content_margin_left = 50.0
content_margin_top = 3.0
content_margin_right = 50.0
content_margin_bottom = 3.0
bg_color = Color(0, 0, 0, 0.572549)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0.862745, 0.862745, 0.862745, 0.780392)
border_blend = true

43
UI/crosshair.gdshader Normal file
View File

@ -0,0 +1,43 @@
shader_type canvas_item;
uniform bool center_enabled = true;
uniform bool legs_enabled = true;
uniform bool inverted = false;
uniform int color_id = 0;
uniform vec4 color_0 = vec4(0., 1, 0., 1.);
uniform vec4 color_1 = vec4(1., 0., 0., 1.);
uniform vec4 color_2 = vec4(0., 0., 1., 1.);
uniform float center_radius = .002;
uniform float width = .003;
uniform float len = .03;
uniform float spacing = .008;
uniform float spread = 1.;
uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_linear_mipmap_anisotropic;
void fragment(){
float a = SCREEN_PIXEL_SIZE.x / SCREEN_PIXEL_SIZE.y;
vec2 UVa = vec2(UV.x / a, UV.y);
vec2 center = vec2(.5 / a, .5);
float point = step(distance(UVa, center), center_radius);
float h = step(center.x - len - spacing*spread, UVa.x) - step(center.x - spacing*spread, UVa.x);
h += step(center.x + spacing*spread, UVa.x) - step(center.x + len + spacing*spread, UVa.x);
h *= step(center.y - width, UVa.y) - step(center.y + width, UVa.y);
float v = step(center.y - len - spacing*spread, UVa.y) - step(center.y - spacing*spread, UVa.y);
v += step(center.y + spacing*spread, UVa.y) - step(center.y + len + spacing*spread, UVa.y);
v *= step(center.x - width, UVa.x) - step(center.x + width, UVa.x);
float crosshair;
crosshair = (h+v) * float(legs_enabled) + point * float(center_enabled);
if(!inverted){
COLOR = (color_0 * float(color_id == 0) + color_1 * float(color_id == 1) + color_2 * float(color_id == 2)) * crosshair;
}else{
COLOR = vec4((cos(textureLod(SCREEN_TEXTURE, SCREEN_UV, 0.0).rgb * 3.1415926534) + 1.)/2., 1.) * crosshair;
}
}

View File

@ -0,0 +1 @@
uid://dhtylicctk3g4

19
UI/enemybox.gd Normal file
View File

@ -0,0 +1,19 @@
class_name EnemyBox extends HBoxContainer
func set_wave(wave: int) -> void:
$WaveLabel.text = "Wave " + str(wave) + ": "
func add_enemy_tag(enemy: Enemy, num: int) -> void:
for x: int in num:
var enemy_tex: TextureRect = TextureRect.new()
enemy_tex.texture = enemy.sprite
enemy_tex.custom_minimum_size = Vector2(80, 80)
add_child(enemy_tex)
#var name_label: Label = Label.new()
#name_label.text = enemy.title
#var num_label: Label = Label.new()
#num_label.text = str(num)
#add_child(name_label)
#add_child(num_label)

1
UI/enemybox.gd.uid Normal file
View File

@ -0,0 +1 @@
uid://b0h5oewxd48lv

10
UI/h_box_container.tscn Normal file
View File

@ -0,0 +1,10 @@
[gd_scene load_steps=2 format=3 uid="uid://b5hp43bm07b8a"]
[ext_resource type="Script" uid="uid://b0h5oewxd48lv" path="res://UI/enemybox.gd" id="1_lcu0c"]
[node name="HBoxContainer" type="HBoxContainer"]
script = ExtResource("1_lcu0c")
[node name="WaveLabel" type="Label" parent="."]
layout_mode = 2
text = "wave 1: "

View File

@ -0,0 +1,6 @@
[gd_resource type="Gradient" format=3 uid="uid://dx7auy3oqw82t"]
[resource]
interpolation_color_space = 2
offsets = PackedFloat32Array(0, 0.131148, 0.357143, 0.758242, 1)
colors = PackedColorArray(0.788235, 0, 0, 1, 0.818896, 0.282651, 0.000353087, 1, 0.945098, 1, 0, 1, 0.259747, 0.912524, 6.85382e-05, 1, 0, 0.917647, 0, 1)

20
UI/hero_select_card.gd Normal file
View File

@ -0,0 +1,20 @@
extends PanelContainer
signal pressed(hero_class: int)
signal button_mouse_entered()
var hero_class: HeroClass
func set_hero(hero: HeroClass) -> void:
hero_class = hero
$VBoxContainer/Label.text = hero.hero_name
$VBoxContainer/TextureRect.texture = hero.texture
func _on_button_pressed() -> void:
pressed.emit(Data.characters.find(hero_class))
func _on_button_mouse_entered() -> void:
button_mouse_entered.emit()

View File

@ -0,0 +1 @@
uid://v5y44744p7ie

View File

@ -0,0 +1,14 @@
[gd_resource type="StyleBoxFlat" format=3 uid="uid://d34i78f4dnq2k"]
[resource]
content_margin_left = 50.0
content_margin_top = 3.0
content_margin_right = 50.0
content_margin_bottom = 3.0
bg_color = Color(0.615686, 0.615686, 0.615686, 0.572549)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0.168627, 0.168627, 0.168627, 0.780392)
border_blend = true

15
UI/keybind_screen.gd Normal file
View File

@ -0,0 +1,15 @@
extends Control
signal event_detected(event: InputEvent)
var found_event: bool = false
func _input(event: InputEvent) -> void:
if found_event:
return
if event is InputEventKey or event is InputEventMouseButton or event is InputEventJoypadButton:
get_viewport().set_input_as_handled()
found_event = true
event_detected.emit(event)
queue_free()

1
UI/keybind_screen.gd.uid Normal file
View File

@ -0,0 +1 @@
uid://d25hjwjdwv35i

108
UI/new_theme.tres Normal file
View File

@ -0,0 +1,108 @@
[gd_resource type="Theme" load_steps=15 format=3 uid="uid://b6a0ip4p72tgx"]
[ext_resource type="StyleBox" uid="uid://lpof3jdy7hr7" path="res://new_style_box_flat.tres" id="4_o03gw"]
[ext_resource type="FontFile" uid="uid://c17ml15e2qan0" path="res://Assets/Fonts/TrueType (.ttf)/Sagewold-Regular.ttf" id="4_v3wda"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_pyjol"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_i4k6b"]
content_margin_left = 12.0
content_margin_right = 12.0
bg_color = Color(0.470588, 0.462745, 0.411765, 1)
border_width_top = 2
border_width_bottom = 2
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_o03gw"]
bg_color = Color(0.364084, 0.357361, 0.313855, 1)
border_width_top = 2
border_width_bottom = 2
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_v3wda"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_v4c6d"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_pdxi3"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_8epi8"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_o02xp"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_s5vy1"]
bg_color = Color(0.579938, 0.571628, 0.517202, 1)
border_width_top = 2
border_width_bottom = 2
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ic3v0"]
content_margin_left = 20.0
content_margin_top = 20.0
content_margin_right = 20.0
content_margin_bottom = 20.0
bg_color = Color(0.47, 0.46154, 0.4136, 1)
border_width_top = 6
border_width_bottom = 6
border_color = Color(0.35, 0.2926, 0.2065, 1)
shadow_color = Color(0, 0, 0, 0)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ehga6"]
content_margin_left = 16.0
content_margin_top = 8.0
content_margin_right = 16.0
content_margin_bottom = 0.0
bg_color = Color(0.470588, 0.462745, 0.411765, 1)
border_width_left = 6
border_width_top = 6
border_width_right = 6
border_color = Color(0.34902, 0.294118, 0.207843, 1)
expand_margin_bottom = 6.0
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_tuxkj"]
content_margin_left = 16.0
content_margin_top = 8.0
content_margin_right = 16.0
content_margin_bottom = 0.0
bg_color = Color(0.292324, 0.286585, 0.24951, 1)
border_width_left = 4
border_width_top = 4
border_width_right = 4
border_color = Color(0.212821, 0.203554, 0.148015, 1)
shadow_color = Color(0, 0, 0, 0)
[resource]
Button/colors/font_color = Color(1, 1, 1, 1)
Button/colors/font_hover_color = Color(0.105882, 0.105882, 0.105882, 1)
Button/font_sizes/font_size = 48
Button/fonts/font = ExtResource("4_v3wda")
Button/styles/disabled = SubResource("StyleBoxEmpty_pyjol")
Button/styles/focus = SubResource("StyleBoxFlat_i4k6b")
Button/styles/hover = SubResource("StyleBoxFlat_o03gw")
Button/styles/hover_pressed = SubResource("StyleBoxFlat_o03gw")
Button/styles/normal = SubResource("StyleBoxFlat_i4k6b")
Button/styles/pressed = SubResource("StyleBoxFlat_o03gw")
CheckButton/styles/disabled = SubResource("StyleBoxEmpty_v3wda")
CheckButton/styles/hover = SubResource("StyleBoxEmpty_v4c6d")
CheckButton/styles/hover_pressed = SubResource("StyleBoxEmpty_pdxi3")
CheckButton/styles/normal = SubResource("StyleBoxEmpty_8epi8")
CheckButton/styles/pressed = SubResource("StyleBoxEmpty_o02xp")
HBoxContainer/constants/separation = 10
Label/colors/font_color = Color(0.941129, 0.938917, 0.927802, 1)
Label/font_sizes/font_size = 34
Label/fonts/font = ExtResource("4_v3wda")
LineEdit/colors/font_color = Color(0.113725, 0.113725, 0.113725, 1)
LineEdit/colors/font_placeholder_color = Color(0.243137, 0.243137, 0.243137, 0.6)
LineEdit/font_sizes/font_size = 28
LineEdit/fonts/font = ExtResource("4_v3wda")
LineEdit/styles/focus = SubResource("StyleBoxFlat_s5vy1")
LineEdit/styles/normal = SubResource("StyleBoxFlat_s5vy1")
PanelContainer/styles/panel = ExtResource("4_o03gw")
TabBar/fonts/font = ExtResource("4_v3wda")
TabContainer/colors/font_hovered_color = Color(0.894118, 0.890196, 0.870588, 1)
TabContainer/colors/font_selected_color = Color(0.895148, 0.891833, 0.869117, 1)
TabContainer/colors/font_unselected_color = Color(0.636428, 0.628262, 0.574486, 1)
TabContainer/constants/side_margin = 32
TabContainer/font_sizes/font_size = 36
TabContainer/fonts/font = ExtResource("4_v3wda")
TabContainer/styles/panel = SubResource("StyleBoxFlat_ic3v0")
TabContainer/styles/tab_focus = SubResource("StyleBoxFlat_ehga6")
TabContainer/styles/tab_hovered = SubResource("StyleBoxFlat_tuxkj")
TabContainer/styles/tab_selected = SubResource("StyleBoxFlat_ehga6")
TabContainer/styles/tab_unselected = SubResource("StyleBoxFlat_tuxkj")

9
UI/tower_label.gd Normal file
View File

@ -0,0 +1,9 @@
class_name TowerLabel extends HBoxContainer
@export var tower_name: Label
@export var tower_amount: Label
func change_label(new_name: String, new_amount: String) -> void:
tower_name.text = new_name
tower_amount.text = new_amount

1
UI/tower_label.gd.uid Normal file
View File

@ -0,0 +1 @@
uid://b5iw4ig76ws7l

26
UI/tower_label.tscn Normal file
View File

@ -0,0 +1,26 @@
[gd_scene load_steps=2 format=3 uid="uid://clabkhnbn75rf"]
[ext_resource type="Script" uid="uid://b5iw4ig76ws7l" path="res://UI/tower_label.gd" id="1_kjcmy"]
[node name="HBoxContainer" type="HBoxContainer" node_paths=PackedStringArray("tower_name", "tower_amount")]
script = ExtResource("1_kjcmy")
tower_name = NodePath("Label")
tower_amount = NodePath("Label3")
[node name="Label" type="Label" parent="."]
layout_mode = 2
text = "tower name"
horizontal_alignment = 1
vertical_alignment = 1
[node name="Label2" type="Label" parent="."]
layout_mode = 2
text = " | "
horizontal_alignment = 1
vertical_alignment = 1
[node name="Label3" type="Label" parent="."]
layout_mode = 2
text = "2"
horizontal_alignment = 1
vertical_alignment = 1