more work on the ui theme and changing the hud
30
UI/DamageParticle/damage_particle.gd
Normal file
@@ -0,0 +1,30 @@
|
||||
class_name DamageParticle
|
||||
extends Sprite3D
|
||||
|
||||
@onready var label: Label = $SubViewport/Label
|
||||
var time_alive: float = 0.0
|
||||
var movement_speed: float = 1.0
|
||||
var movement_vector: Vector3
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
var theta: float = deg_to_rad(40)
|
||||
var z: float = randf_range(cos(theta), 1)
|
||||
var phi: float = randf_range(0, 2 * PI)
|
||||
var vector: Vector3 = Vector3(sqrt(1 - pow(z, 2)) * cos(phi), z, sqrt(1 - pow(z, 2)) * sin(phi))
|
||||
movement_vector = vector.normalized()
|
||||
|
||||
|
||||
func set_number(num: int) -> void:
|
||||
label.text = str(num)
|
||||
|
||||
|
||||
func set_color(color: Color) -> void:
|
||||
label.modulate = color
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
time_alive += delta
|
||||
position += movement_vector * movement_speed * delta
|
||||
if time_alive >= 1.0:
|
||||
queue_free()
|
||||
1
UI/DamageParticle/damage_particle.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://blt7umrgo3tfh
|
||||
32
UI/DamageParticle/damage_particle.tscn
Normal file
@@ -0,0 +1,32 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://cqtew0t8sttpm"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://blt7umrgo3tfh" path="res://UI/DamageParticle/damage_particle.gd" id="1_lgvaq"]
|
||||
|
||||
[sub_resource type="ViewportTexture" id="ViewportTexture_ppqlh"]
|
||||
viewport_path = NodePath("SubViewport")
|
||||
|
||||
[node name="Node3D" type="Sprite3D"]
|
||||
pixel_size = 0.005
|
||||
billboard = 1
|
||||
no_depth_test = true
|
||||
fixed_size = true
|
||||
texture_filter = 2
|
||||
render_priority = 1
|
||||
texture = SubResource("ViewportTexture_ppqlh")
|
||||
script = ExtResource("1_lgvaq")
|
||||
|
||||
[node name="SubViewport" type="SubViewport" parent="."]
|
||||
transparent_bg = true
|
||||
size = Vector2i(172, 57)
|
||||
render_target_update_mode = 4
|
||||
|
||||
[node name="Label" type="Label" parent="SubViewport"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_type_variation = &"DamageNumLabel"
|
||||
text = "12345"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
28
UI/EnemyHealthBar/health_bar.gd
Normal file
@@ -0,0 +1,28 @@
|
||||
class_name HealthBar
|
||||
extends TextureProgressBar
|
||||
|
||||
@export var health_bar_gradient: Gradient
|
||||
|
||||
@onready var prev_bar: TextureProgressBar = $PreviousHealthBar
|
||||
|
||||
|
||||
func setup(health: float) -> void:
|
||||
max_value = health
|
||||
value = health
|
||||
prev_bar.max_value = health
|
||||
prev_bar.value = health
|
||||
|
||||
|
||||
func on_health_changed(health: float) -> void:
|
||||
set_visible(true)
|
||||
var health_went_down: bool = true if health < value else false
|
||||
value = health
|
||||
tint_progress = health_bar_gradient.sample(value / max_value)
|
||||
if health_went_down:
|
||||
var tween: Tween = create_tween()
|
||||
tween.set_ease(Tween.EASE_OUT)
|
||||
tween.set_trans(Tween.TRANS_QUINT)
|
||||
tween.tween_interval(0.3)
|
||||
tween.tween_property(prev_bar, "value", value, 0.7)
|
||||
else:
|
||||
prev_bar.value = value
|
||||
1
UI/EnemyHealthBar/health_bar.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bf06es50d0flv
|
||||
30
UI/EnemyHealthBar/health_bar.tscn
Normal file
@@ -0,0 +1,30 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://hjq3nrnumklp"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://r202vo47jw1q" path="res://Assets/Textures/enemyhealth.png" id="1_x8m88"]
|
||||
[ext_resource type="Script" uid="uid://bf06es50d0flv" path="res://UI/EnemyHealthBar/health_bar.gd" id="2_m8c1f"]
|
||||
[ext_resource type="Gradient" uid="uid://dx7auy3oqw82t" path="res://UI/EnemyHealthBar/health_bar_gradient.tres" id="3_dpmma"]
|
||||
|
||||
[node name="HealthBar" type="TextureProgressBar"]
|
||||
offset_right = 200.0
|
||||
offset_bottom = 200.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
step = 0.0
|
||||
value = 100.0
|
||||
fill_mode = 6
|
||||
texture_progress = ExtResource("1_x8m88")
|
||||
tint_progress = Color(0, 1, 0, 1)
|
||||
script = ExtResource("2_m8c1f")
|
||||
health_bar_gradient = ExtResource("3_dpmma")
|
||||
|
||||
[node name="PreviousHealthBar" type="TextureProgressBar" parent="."]
|
||||
z_index = -1
|
||||
layout_mode = 0
|
||||
offset_right = 200.0
|
||||
offset_bottom = 200.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
step = 0.0
|
||||
value = 100.0
|
||||
fill_mode = 6
|
||||
texture_progress = ExtResource("1_x8m88")
|
||||
BIN
UI/Enemy_icon.png
Normal file
|
After Width: | Height: | Size: 395 B |
40
UI/Enemy_icon.png.import
Normal file
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://doqfkinrjw4mt"
|
||||
path="res://.godot/imported/Enemy_icon.png-e3ec1e1b7e954feb5c5ab49627db4832.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://UI/Enemy_icon.png"
|
||||
dest_files=["res://.godot/imported/Enemy_icon.png-e3ec1e1b7e954feb5c5ab49627db4832.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
24
UI/EnergyPipUI/energy_pips.gd
Normal file
@@ -0,0 +1,24 @@
|
||||
class_name EnergyPips
|
||||
extends Control
|
||||
|
||||
@export var tex: TextureRect
|
||||
|
||||
var energy: int :
|
||||
get():
|
||||
return energy
|
||||
set(value):
|
||||
energy = value
|
||||
if energy == max_energy:
|
||||
tex.texture.region.position.x = 0.0
|
||||
elif energy > 0:
|
||||
tex.texture.region.position.x = 21.0 * floori(lerp(11, 1, float(energy) / max_energy))
|
||||
else:
|
||||
tex.texture.region.position.x = 21.0 * 12
|
||||
|
||||
|
||||
var max_energy: int :
|
||||
get():
|
||||
return max_energy
|
||||
set(value):
|
||||
max_energy = value
|
||||
energy = max_energy
|
||||
1
UI/EnergyPipUI/energy_pips.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cvdb5y5wmkvmm
|
||||
24
UI/EnergyPipUI/energy_pips.tscn
Normal file
@@ -0,0 +1,24 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://q73cllewm7pj"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cvdb5y5wmkvmm" path="res://UI/EnergyPipUI/energy_pips.gd" id="1_6l017"]
|
||||
[ext_resource type="Texture2D" uid="uid://h1m3ss2ln5hq" path="res://UI/EnergyPipUI/energy_sheet.png" id="2_q2m70"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_46jyx"]
|
||||
atlas = ExtResource("2_q2m70")
|
||||
region = Rect2(0, 0, 21, 149)
|
||||
|
||||
[node name="EnergyBar" type="Control" node_paths=PackedStringArray("tex")]
|
||||
custom_minimum_size = Vector2(149, 21)
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
script = ExtResource("1_6l017")
|
||||
tex = NodePath("TextureRect")
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="."]
|
||||
layout_mode = 0
|
||||
offset_top = 21.0
|
||||
offset_right = 21.0
|
||||
offset_bottom = 170.0
|
||||
rotation = -1.5707964
|
||||
texture = SubResource("AtlasTexture_46jyx")
|
||||
stretch_mode = 5
|
||||
BIN
UI/EnergyPipUI/energy_sheet.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
40
UI/EnergyPipUI/energy_sheet.png.import
Normal file
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://h1m3ss2ln5hq"
|
||||
path="res://.godot/imported/energy_sheet.png-3d8e008c2b32340e3af87512f5cd5773.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://UI/EnergyPipUI/energy_sheet.png"
|
||||
dest_files=["res://.godot/imported/energy_sheet.png-3d8e008c2b32340e3af87512f5cd5773.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
21
UI/FeatureUI/feature_ui.gd
Normal file
@@ -0,0 +1,21 @@
|
||||
class_name FeatureUI
|
||||
extends VBoxContainer
|
||||
|
||||
@export var icon: TextureRect
|
||||
@export var name_label: Label
|
||||
|
||||
var feature: Feature
|
||||
|
||||
|
||||
func set_feature(new_feature: Feature) -> void:
|
||||
feature = new_feature
|
||||
icon.texture = feature.icon
|
||||
name_label.text = tr(feature.display_name)
|
||||
|
||||
|
||||
func show_title() -> void:
|
||||
name_label.visible = true
|
||||
|
||||
|
||||
func hide_title() -> void:
|
||||
name_label.visible = false
|
||||
1
UI/FeatureUI/feature_ui.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://o668c5lfhgm5
|
||||
28
UI/FeatureUI/feature_ui.tscn
Normal file
@@ -0,0 +1,28 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://c8xdsg6gtwvh3"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://o668c5lfhgm5" path="res://UI/FeatureUI/feature_ui.gd" id="1_tms0v"]
|
||||
[ext_resource type="Texture2D" uid="uid://cps7onfe2s1gi" path="res://Scripts/Features/Radar/radar_icon.png" id="2_w6jf0"]
|
||||
|
||||
[node name="FeatureUI" type="VBoxContainer" node_paths=PackedStringArray("icon", "name_label")]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
alignment = 1
|
||||
script = ExtResource("1_tms0v")
|
||||
icon = NodePath("TextureRect")
|
||||
name_label = NodePath("Label")
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="."]
|
||||
layout_mode = 2
|
||||
mouse_filter = 2
|
||||
texture = ExtResource("2_w6jf0")
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
text = "Radar"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
39
UI/HotWheelUI/hot_wheel.gd
Normal file
@@ -0,0 +1,39 @@
|
||||
class_name HotWheel
|
||||
extends HBoxContainer
|
||||
|
||||
@export var buttons: Array[Button]
|
||||
|
||||
|
||||
func update_cassettes(cassettes: Array[Card]) -> void:
|
||||
var entry_count: int = cassettes.size()
|
||||
buttons[0].visible = true
|
||||
buttons[1].visible = true
|
||||
buttons[2].visible = true
|
||||
buttons[3].visible = true
|
||||
buttons[4].visible = true
|
||||
if entry_count < 1:
|
||||
buttons[0].visible = false
|
||||
buttons[1].visible = false
|
||||
buttons[2].visible = false
|
||||
buttons[3].visible = false
|
||||
buttons[4].visible = false
|
||||
elif entry_count < 2:
|
||||
buttons[0].visible = false
|
||||
buttons[1].visible = false
|
||||
buttons[3].visible = false
|
||||
buttons[4].visible = false
|
||||
elif entry_count < 4:
|
||||
buttons[0].visible = false
|
||||
buttons[4].visible = false
|
||||
if entry_count >= 1:
|
||||
buttons[2].icon = cassettes[0].icon
|
||||
if entry_count >= 2:
|
||||
buttons[1].icon = cassettes[1].icon
|
||||
buttons[3].icon = cassettes[1].icon
|
||||
if entry_count >= 3:
|
||||
buttons[3].icon = cassettes[2].icon
|
||||
if entry_count >= 4:
|
||||
buttons[0].icon = cassettes[3].icon
|
||||
buttons[4].icon = cassettes[3].icon
|
||||
if entry_count >= 5:
|
||||
buttons[4].icon = cassettes[4].icon
|
||||
1
UI/HotWheelUI/hot_wheel.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://laoxiep4e5x0
|
||||
54
UI/HotWheelUI/hot_wheel.tscn
Normal file
@@ -0,0 +1,54 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://ga21hoa8fxmm"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://laoxiep4e5x0" path="res://UI/HotWheelUI/hot_wheel.gd" id="1_2sjpl"]
|
||||
[ext_resource type="Texture2D" uid="uid://bpcyxdpog3w85" path="res://Assets/Textures/assault_icon.png" id="2_7sdlw"]
|
||||
|
||||
[node name="HotWheel" type="HBoxContainer" node_paths=PackedStringArray("buttons")]
|
||||
alignment = 1
|
||||
script = ExtResource("1_2sjpl")
|
||||
buttons = [NodePath("Button4"), NodePath("Button5"), NodePath("Button"), NodePath("Button2"), NodePath("Button3")]
|
||||
|
||||
[node name="Button4" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(32, 32)
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 8
|
||||
toggle_mode = true
|
||||
icon = ExtResource("2_7sdlw")
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
|
||||
[node name="Button5" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(32, 32)
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 8
|
||||
toggle_mode = true
|
||||
icon = ExtResource("2_7sdlw")
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
|
||||
[node name="Button" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(48, 48)
|
||||
layout_mode = 2
|
||||
toggle_mode = true
|
||||
button_pressed = true
|
||||
icon = ExtResource("2_7sdlw")
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
|
||||
[node name="Button2" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(32, 32)
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 8
|
||||
toggle_mode = true
|
||||
icon = ExtResource("2_7sdlw")
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
|
||||
[node name="Button3" type="Button" parent="."]
|
||||
custom_minimum_size = Vector2(32, 32)
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 8
|
||||
toggle_mode = true
|
||||
icon = ExtResource("2_7sdlw")
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
7
UI/Menus/CharacterSelect/character_podium.gd
Normal file
@@ -0,0 +1,7 @@
|
||||
class_name CharacterPodium extends Node3D
|
||||
|
||||
@export var text: String = ""
|
||||
|
||||
|
||||
func show_content() -> void:
|
||||
$Base/Content.visible = true
|
||||
1
UI/Menus/CharacterSelect/character_podium.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bc0xyfr5nj1ul
|
||||
40
UI/Menus/CharacterSelect/character_preview.gd
Normal file
@@ -0,0 +1,40 @@
|
||||
class_name CharacterPreview extends PanelContainer
|
||||
|
||||
@export var tower_label_scene: PackedScene
|
||||
@export var tower_label_container: VBoxContainer
|
||||
@export var hero_name_label: Label
|
||||
|
||||
var added_tags: Array[TowerLabel] = []
|
||||
var regular_label: Label = null
|
||||
|
||||
|
||||
func set_preview(hero: HeroClass) -> void:
|
||||
hero_name_label.text = tr(hero.hero_name)
|
||||
if regular_label:
|
||||
regular_label.queue_free()
|
||||
regular_label = null
|
||||
for tag: TowerLabel in added_tags:
|
||||
tag.queue_free()
|
||||
added_tags = []
|
||||
var added_labels: Array[Card] = []
|
||||
for card: Card in hero.deck:
|
||||
if !added_labels.has(card):
|
||||
var new_label: TowerLabel = tower_label_scene.instantiate() as TowerLabel
|
||||
new_label.change_label(tr(card.display_name), str(hero.deck.count(card)))
|
||||
added_labels.append(card)
|
||||
tower_label_container.add_child(new_label)
|
||||
added_tags.append(new_label)
|
||||
|
||||
|
||||
func setup_with_basic_text(hero: HeroClass, text: String) -> void:
|
||||
hero_name_label.text = tr(hero.hero_name)
|
||||
if regular_label:
|
||||
regular_label.queue_free()
|
||||
regular_label = null
|
||||
for tag: TowerLabel in added_tags:
|
||||
tag.queue_free()
|
||||
added_tags = []
|
||||
var new_label: Label = Label.new()
|
||||
new_label.text = text
|
||||
tower_label_container.add_child(new_label)
|
||||
regular_label = new_label
|
||||
1
UI/Menus/CharacterSelect/character_preview.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://b1ucgfqilvr67
|
||||
79
UI/Menus/CharacterSelect/character_select.gd
Normal file
@@ -0,0 +1,79 @@
|
||||
class_name CharacterSelect extends Node3D
|
||||
|
||||
signal hero_selected(hero_class: int)
|
||||
signal hero_confirmed()
|
||||
|
||||
@export var hero_preview_panel: CharacterPreview
|
||||
|
||||
var podiums: Array[CharacterPodium]
|
||||
|
||||
var character_selected: int = 0
|
||||
var can_hit_button: bool = true
|
||||
|
||||
func _ready() -> void:
|
||||
hero_preview_panel.set_preview(Data.characters[0])
|
||||
var heroes: int = Data.characters.size()
|
||||
var x: int = 0
|
||||
for hero: HeroClass in Data.characters:
|
||||
var pivot: Node3D = Node3D.new()
|
||||
$Podiums.add_child(pivot)
|
||||
var podium: CharacterPodium = hero.podium.instantiate() as CharacterPodium
|
||||
podium.position = Vector3(0.0, -0.5, 5.0)
|
||||
podiums.append(podium)
|
||||
pivot.add_child(podium)
|
||||
pivot.rotate_y((TAU / heroes) * x)
|
||||
x += 1
|
||||
podiums[0].show_content()
|
||||
if Data.save_data.mage_unlocked:
|
||||
podiums[1].show_content()
|
||||
|
||||
|
||||
func reset_button() -> void:
|
||||
can_hit_button = true
|
||||
|
||||
|
||||
func setup_ui() -> void:
|
||||
#TODO: This should all tie into a proper achievements system
|
||||
if character_selected == 0 or (character_selected == 1 and Data.save_data.mage_unlocked):
|
||||
$Controls/ConfirmButton.disabled = false
|
||||
hero_preview_panel.set_preview(Data.characters[character_selected])
|
||||
hero_selected.emit(character_selected)
|
||||
elif character_selected == 1 and !Data.save_data.mage_unlocked and Data.save_data.mage_card_seen_in_shop:
|
||||
hero_preview_panel.setup_with_basic_text(Data.characters[character_selected], "Buy " + str(Data.save_data.mage_cards_bought) + "/10 scrolls in the shop to unlock")
|
||||
else:
|
||||
$Controls/ConfirmButton.disabled = true
|
||||
hero_preview_panel.setup_with_basic_text(Data.characters[character_selected], podiums[character_selected].text)
|
||||
|
||||
|
||||
func retreat_selector() -> void:
|
||||
if !can_hit_button:
|
||||
return
|
||||
can_hit_button = false
|
||||
var tween: Tween = create_tween()
|
||||
tween.set_ease(Tween.EASE_OUT)
|
||||
tween.set_trans(Tween.TRANS_CUBIC)
|
||||
tween.tween_property($Node3D, "rotation_degrees", Vector3(0.0, $Node3D.rotation_degrees.y - 90.0, 0.0), 1.0)
|
||||
tween.tween_callback(reset_button)
|
||||
character_selected -= 1
|
||||
if character_selected < 0:
|
||||
character_selected = Data.characters.size() - 1
|
||||
setup_ui()
|
||||
|
||||
|
||||
func advance_selector() -> void:
|
||||
if !can_hit_button:
|
||||
return
|
||||
can_hit_button = false
|
||||
var tween: Tween = create_tween()
|
||||
tween.set_ease(Tween.EASE_OUT)
|
||||
tween.set_trans(Tween.TRANS_CUBIC)
|
||||
tween.tween_property($Node3D, "rotation_degrees", Vector3(0.0, $Node3D.rotation_degrees.y + 90.0, 0.0), 1.0)
|
||||
tween.tween_callback(reset_button)
|
||||
character_selected += 1
|
||||
if character_selected >= Data.characters.size():
|
||||
character_selected = 0
|
||||
setup_ui()
|
||||
|
||||
|
||||
func _on_confirm_button_pressed() -> void:
|
||||
hero_confirmed.emit()
|
||||
1
UI/Menus/CharacterSelect/character_select.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://plrd0ckxrabh
|
||||
96
UI/Menus/CharacterSelect/character_select.tscn
Normal file
@@ -0,0 +1,96 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://bc6m3cluulpis"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://plrd0ckxrabh" path="res://UI/Menus/CharacterSelect/character_select.gd" id="1_lqqhx"]
|
||||
[ext_resource type="Script" uid="uid://b1ucgfqilvr67" path="res://UI/Menus/CharacterSelect/character_preview.gd" id="9_8d0rx"]
|
||||
[ext_resource type="PackedScene" uid="uid://clabkhnbn75rf" path="res://UI/tower_label.tscn" id="10_jdigy"]
|
||||
|
||||
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_tlgw2"]
|
||||
sky_horizon_color = Color(0.662243, 0.671743, 0.686743, 1)
|
||||
ground_horizon_color = Color(0.662243, 0.671743, 0.686743, 1)
|
||||
energy_multiplier = 0.0
|
||||
|
||||
[sub_resource type="Sky" id="Sky_atdxu"]
|
||||
sky_material = SubResource("ProceduralSkyMaterial_tlgw2")
|
||||
|
||||
[sub_resource type="Environment" id="Environment_pq6wd"]
|
||||
background_mode = 2
|
||||
sky = SubResource("Sky_atdxu")
|
||||
tonemap_mode = 2
|
||||
glow_enabled = true
|
||||
|
||||
[node name="CharacterSelect" type="Node3D" node_paths=PackedStringArray("hero_preview_panel")]
|
||||
script = ExtResource("1_lqqhx")
|
||||
hero_preview_panel = NodePath("PanelContainer")
|
||||
|
||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
||||
environment = SubResource("Environment_pq6wd")
|
||||
|
||||
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
|
||||
transform = Transform3D(-0.866023, -0.433016, 0.250001, 0, 0.499998, 0.866027, -0.500003, 0.749999, -0.43301, 0, 0, 0)
|
||||
light_energy = 0.0
|
||||
shadow_enabled = true
|
||||
|
||||
[node name="Node3D" type="Node3D" parent="."]
|
||||
|
||||
[node name="Camera3D" type="Camera3D" parent="Node3D"]
|
||||
transform = Transform3D(1, 0, 0, 0, 0.976893, 0.21373, 0, -0.21373, 0.976893, 0, 2.25535, 10.9009)
|
||||
cull_mask = 1047553
|
||||
fov = 39.4
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="." node_paths=PackedStringArray("tower_label_container", "hero_name_label")]
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.05
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.05
|
||||
anchor_bottom = 0.5
|
||||
grow_vertical = 2
|
||||
script = ExtResource("9_8d0rx")
|
||||
tower_label_scene = ExtResource("10_jdigy")
|
||||
tower_label_container = NodePath("HBoxContainer2/HBoxContainer")
|
||||
hero_name_label = NodePath("HBoxContainer2/Label")
|
||||
|
||||
[node name="HBoxContainer2" type="VBoxContainer" parent="PanelContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="PanelContainer/HBoxContainer2"]
|
||||
auto_translate_mode = 2
|
||||
layout_mode = 2
|
||||
text = "character name"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="HSeparator" type="HSeparator" parent="PanelContainer/HBoxContainer2"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HBoxContainer" type="VBoxContainer" parent="PanelContainer/HBoxContainer2"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Controls" type="VBoxContainer" parent="."]
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.95
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.95
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="Controls"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="PrevButton" type="Button" parent="Controls/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "BUTTON_PREVIOUS"
|
||||
|
||||
[node name="NextButton" type="Button" parent="Controls/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "BUTTON_NEXT"
|
||||
|
||||
[node name="ConfirmButton" type="Button" parent="Controls"]
|
||||
layout_mode = 2
|
||||
text = "BUTTON_CONFIRM"
|
||||
|
||||
[node name="Podiums" type="Node3D" parent="."]
|
||||
|
||||
[connection signal="pressed" from="Controls/HBoxContainer/PrevButton" to="." method="retreat_selector"]
|
||||
[connection signal="pressed" from="Controls/HBoxContainer/NextButton" to="." method="advance_selector"]
|
||||
[connection signal="pressed" from="Controls/ConfirmButton" to="." method="_on_confirm_button_pressed"]
|
||||
@@ -1,9 +1,9 @@
|
||||
[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"]
|
||||
[ext_resource type="Script" uid="uid://b0h5oewxd48lv" path="res://UI/Menus/GameEndScreen/enemy_row.gd" id="1_th4b3"]
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer"]
|
||||
script = ExtResource("1_lcu0c")
|
||||
[node name="EnemyRow" type="HBoxContainer"]
|
||||
script = ExtResource("1_th4b3")
|
||||
|
||||
[node name="WaveLabel" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
51
UI/Menus/GameEndScreen/game_end_screen.gd
Normal file
@@ -0,0 +1,51 @@
|
||||
class_name GameEndScreen extends PanelContainer
|
||||
|
||||
@export var box: PackedScene
|
||||
|
||||
@export var outcome_label: Label
|
||||
@export var winrate_label: Label
|
||||
@export var total_games_label: Label
|
||||
@export var total_wins_label: Label
|
||||
@export var total_losses_label: Label
|
||||
@export var undefeated_enemies: VBoxContainer
|
||||
|
||||
var game_manager: GameManager
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
winrate_label.text = str(Data.save_data.winrate) + "%"
|
||||
total_games_label.text = str(Data.save_data.wins + Data.save_data.losses)
|
||||
total_wins_label.text = str(Data.save_data.wins)
|
||||
total_losses_label.text = str(Data.save_data.losses)
|
||||
if game_manager:
|
||||
set_wave()
|
||||
|
||||
|
||||
func set_wave() -> void:
|
||||
for wave_key: int in game_manager.stats.enemies_undefeated:
|
||||
var spawned_box: EnemyBox = box.instantiate() as EnemyBox
|
||||
undefeated_enemies.add_child(spawned_box)
|
||||
spawned_box.set_wave(wave_key)
|
||||
for enemy_key: Enemy in game_manager.stats.enemies_undefeated[wave_key]:
|
||||
spawned_box.add_enemy_tag(enemy_key, game_manager.stats.enemies_undefeated[wave_key][enemy_key])
|
||||
|
||||
|
||||
func set_outcome_message(message: String) -> void:
|
||||
outcome_label.text = message
|
||||
|
||||
|
||||
func _on_quit_button_pressed() -> void:
|
||||
game_manager.scene_switch_main_menu()
|
||||
queue_free()
|
||||
|
||||
|
||||
func _on_play_button_pressed() -> void:
|
||||
if game_manager.gamemode.daily == false and !game_manager.gamemode.seeded:
|
||||
game_manager.gamemode.rng_seed = randi()
|
||||
game_manager.setup()
|
||||
game_manager.start()
|
||||
queue_free()
|
||||
|
||||
|
||||
func _on_button_mouse_entered() -> void:
|
||||
$AudioStreamPlayer.play()
|
||||
1
UI/Menus/GameEndScreen/game_end_screen.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bdknvktw033g3
|
||||
140
UI/Menus/GameEndScreen/game_end_screen.tscn
Normal file
@@ -0,0 +1,140 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://ce0m8vbjbng6o"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bdknvktw033g3" path="res://UI/Menus/GameEndScreen/game_end_screen.gd" id="1_oa7nq"]
|
||||
[ext_resource type="PackedScene" uid="uid://b5hp43bm07b8a" path="res://UI/Menus/GameEndScreen/enemy_row.tscn" id="2_xm8em"]
|
||||
[ext_resource type="AudioStream" uid="uid://cp6ph4ra7u5rk" path="res://UI/drop_003.ogg" id="3_ro1yg"]
|
||||
|
||||
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_dram5"]
|
||||
random_pitch = 1.1
|
||||
streams_count = 1
|
||||
stream_0/stream = ExtResource("3_ro1yg")
|
||||
|
||||
[node name="GameEndScreen" type="PanelContainer" node_paths=PackedStringArray("outcome_label", "winrate_label", "total_games_label", "total_wins_label", "total_losses_label", "undefeated_enemies")]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 150.0
|
||||
offset_top = 100.0
|
||||
offset_right = -150.0
|
||||
offset_bottom = -100.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_oa7nq")
|
||||
box = ExtResource("2_xm8em")
|
||||
outcome_label = NodePath("VBoxContainer/Labels/OutcomeLabel")
|
||||
winrate_label = NodePath("VBoxContainer/Labels/VBoxContainer/HBoxContainer/WinRateLabel2")
|
||||
total_games_label = NodePath("VBoxContainer/Labels/VBoxContainer/HBoxContainer2/WinRateLabel3")
|
||||
total_wins_label = NodePath("VBoxContainer/Labels/VBoxContainer/HBoxContainer3/WinRateLabel4")
|
||||
total_losses_label = NodePath("VBoxContainer/Labels/VBoxContainer/HBoxContainer4/WinRateLabel5")
|
||||
undefeated_enemies = NodePath("VBoxContainer/UndefeatedEnemies")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Labels" type="VBoxContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
alignment = 1
|
||||
|
||||
[node name="OutcomeLabel" type="Label" parent="VBoxContainer/Labels"]
|
||||
layout_mode = 2
|
||||
text = "LABEL_WIN_MESSAGE"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/Labels"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/Labels/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="WinRateLabel" type="Label" parent="VBoxContainer/Labels/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "LABEL_WINRATE"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="WinRateLabel2" type="Label" parent="VBoxContainer/Labels/VBoxContainer/HBoxContainer"]
|
||||
auto_translate_mode = 2
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "0"
|
||||
horizontal_alignment = 2
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer/Labels/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="TotalGamesLabel" type="Label" parent="VBoxContainer/Labels/VBoxContainer/HBoxContainer2"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "LABEL_GAMES"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="WinRateLabel3" type="Label" parent="VBoxContainer/Labels/VBoxContainer/HBoxContainer2"]
|
||||
auto_translate_mode = 2
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "0"
|
||||
horizontal_alignment = 2
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="HBoxContainer3" type="HBoxContainer" parent="VBoxContainer/Labels/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="TotalWinsLabel" type="Label" parent="VBoxContainer/Labels/VBoxContainer/HBoxContainer3"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "LABEL_WINS"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="WinRateLabel4" type="Label" parent="VBoxContainer/Labels/VBoxContainer/HBoxContainer3"]
|
||||
auto_translate_mode = 2
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "0"
|
||||
horizontal_alignment = 2
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="HBoxContainer4" type="HBoxContainer" parent="VBoxContainer/Labels/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="TotalLossesLabel" type="Label" parent="VBoxContainer/Labels/VBoxContainer/HBoxContainer4"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "LABEL_LOSSES"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="WinRateLabel5" type="Label" parent="VBoxContainer/Labels/VBoxContainer/HBoxContainer4"]
|
||||
auto_translate_mode = 2
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "0"
|
||||
horizontal_alignment = 2
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="UndefeatedEnemies" type="VBoxContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="Buttons" type="HBoxContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
alignment = 2
|
||||
|
||||
[node name="PlayButton" type="Button" parent="VBoxContainer/Buttons"]
|
||||
layout_mode = 2
|
||||
text = "BUTTON_RESTART"
|
||||
|
||||
[node name="QuitButton" type="Button" parent="VBoxContainer/Buttons"]
|
||||
layout_mode = 2
|
||||
text = "BUTTON_MAIN_MENU"
|
||||
|
||||
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
|
||||
stream = SubResource("AudioStreamRandomizer_dram5")
|
||||
bus = &"SFX"
|
||||
|
||||
[connection signal="mouse_entered" from="VBoxContainer/Buttons/PlayButton" to="." method="_on_button_mouse_entered"]
|
||||
[connection signal="pressed" from="VBoxContainer/Buttons/PlayButton" to="." method="_on_play_button_pressed"]
|
||||
[connection signal="mouse_entered" from="VBoxContainer/Buttons/QuitButton" to="." method="_on_button_mouse_entered"]
|
||||
[connection signal="pressed" from="VBoxContainer/Buttons/QuitButton" to="." method="_on_quit_button_pressed"]
|
||||
9
UI/Menus/MainMenu/achievements_menu.gd
Normal file
@@ -0,0 +1,9 @@
|
||||
extends PanelContainer
|
||||
|
||||
func _ready() -> void:
|
||||
if Data.save_data.wins > 0:
|
||||
$VBoxContainer/GridContainer/FirstWin.icon.region = Rect2(36, 0, 36, 36)
|
||||
if Data.save_data.mage_card_seen_in_shop:
|
||||
$VBoxContainer/GridContainer/SeenMageCard.icon.region = Rect2(36, 0, 36, 36)
|
||||
if Data.save_data.mage_unlocked:
|
||||
$VBoxContainer/GridContainer/UnlockedMage.icon.region = Rect2(36, 0, 36, 36)
|
||||
1
UI/Menus/MainMenu/achievements_menu.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cjr0pbqisd51v
|
||||
206
UI/Menus/MainMenu/main_menu.gd
Normal file
@@ -0,0 +1,206 @@
|
||||
class_name MainMenu extends Control
|
||||
|
||||
signal singleplayer_game_requested
|
||||
signal multiplayer_game_requested
|
||||
|
||||
@export var bg_level: Level
|
||||
@export var game_select_menu: Control
|
||||
@export var main_controls: Control
|
||||
@export var seed_entry: LineEdit
|
||||
@export var profile_controls: Control
|
||||
@export var mods_controls: ModMenu
|
||||
|
||||
var game: GameManager
|
||||
var gamemode: GameMode = GameMode.new()
|
||||
|
||||
var confirmation_popup_scene: PackedScene = preload("res://Scenes/Menus/confirmation_popup.tscn")
|
||||
var text_input_popup_scene: PackedScene = preload("res://Scenes/Menus/text_input_popup.tscn")
|
||||
var multiplayer_lobby_scene_path: String = "res://Scenes/multiplayer_lobby.tscn"
|
||||
var options_menu_scene: PackedScene = preload("res://UI/Menus/OptionsMenu/options_menu.tscn")
|
||||
var temp_data: SaveData
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
load_stats(Data.save_data)
|
||||
#bg_level.a_star_graph_3d.make_grid()
|
||||
#bg_level.a_star_graph_3d.find_path()
|
||||
#bg_level.a_star_graph_3d.build_random_maze(70)
|
||||
#bg_level.a_star_graph_3d.place_random_towers(30)
|
||||
#bg_level.a_star_graph_3d.disable_all_tower_frames()
|
||||
#Game.level = bg_level
|
||||
#WaveManager.generate_wave(WaveManager.calculate_spawn_power(50, 4), bg_level.enemy_pool, bg_level.enemy_spawns)
|
||||
#for spawn: EnemySpawner in bg_level.enemy_spawns:
|
||||
# spawn.enemy_died_callback = enemy_died
|
||||
# spawn.enemy_reached_goal_callback = damage_goal
|
||||
# spawn.enemy_spawned.connect(increase_enemy_count)
|
||||
# spawn.spawn_wave()
|
||||
|
||||
|
||||
#these exist purely to make the enemies that spawn on the main menu happy
|
||||
func enemy_died(_some_arg: Enemy) -> void:
|
||||
pass
|
||||
func damage_goal(_some_arg1: Enemy, _some_arg2: int) -> void:
|
||||
pass
|
||||
func increase_enemy_count() -> void:
|
||||
pass
|
||||
|
||||
|
||||
func _on_display_name_edit_pressed() -> void:
|
||||
$ProfileManager.visible = true
|
||||
$ProfileManager/VBoxContainer/DisplayName/LineEdit.placeholder_text = Data.player_profile.display_name
|
||||
temp_data = SaveData.load_from_disk(0)
|
||||
|
||||
|
||||
func change_profile_display_name(display_name: String) -> void:
|
||||
$ProfileEditor/VBoxContainer/HBoxContainer/DisplayName.text = display_name
|
||||
Data.player_profile.set_display_name(display_name)
|
||||
|
||||
|
||||
func _on_quit_button_pressed() -> void:
|
||||
var popup: ConfirmationPopup = confirmation_popup_scene.instantiate() as ConfirmationPopup
|
||||
popup.set_popup("PROMPT_QUIT", "BUTTON_CONFIRM", "BUTTON_CANCEL")
|
||||
popup.completed.connect(quit_game)
|
||||
add_child(popup)
|
||||
|
||||
|
||||
func quit_game(confirmation: bool) -> void:
|
||||
if confirmation:
|
||||
get_tree().quit()
|
||||
|
||||
|
||||
func _on_options_button_pressed() -> void:
|
||||
var menu: OptionsMenu = options_menu_scene.instantiate()
|
||||
menu.game_manager = game
|
||||
add_child(menu)
|
||||
|
||||
|
||||
func _on_button_mouse_entered() -> void:
|
||||
$AudioStreamPlayer.play()
|
||||
|
||||
|
||||
func start_game() -> void:
|
||||
game.gamemode = gamemode
|
||||
if !gamemode.multiplayer:
|
||||
singleplayer_game_requested.emit()
|
||||
else:
|
||||
multiplayer_game_requested.emit()
|
||||
|
||||
|
||||
func _on_play_button_pressed() -> void:
|
||||
gamemode.multiplayer = false
|
||||
open_game_menu()
|
||||
|
||||
|
||||
func _on_multiplayer_button_pressed() -> void:
|
||||
gamemode.multiplayer = true
|
||||
open_game_menu()
|
||||
|
||||
|
||||
func open_game_menu() -> void:
|
||||
main_controls.visible = false
|
||||
game_select_menu.visible = true
|
||||
|
||||
|
||||
func _on_back_button_pressed() -> void:
|
||||
main_controls.visible = true
|
||||
game_select_menu.visible = false
|
||||
|
||||
|
||||
func generate_seed() -> void:
|
||||
if seed_entry.text != "":
|
||||
if seed_entry.text.is_valid_int():
|
||||
gamemode.rng_seed = int(seed_entry.text)
|
||||
else:
|
||||
gamemode.rng_seed = hash(seed_entry.text)
|
||||
gamemode.seeded = true
|
||||
else:
|
||||
gamemode.rng_seed = randi()
|
||||
|
||||
|
||||
func _on_standard_button_pressed() -> void:
|
||||
generate_seed()
|
||||
gamemode.endless = false
|
||||
gamemode.daily = false
|
||||
start_game()
|
||||
|
||||
|
||||
func _on_daily_button_pressed() -> void:
|
||||
gamemode.rng_seed = hash(Time.get_date_string_from_system(true))
|
||||
gamemode.endless = false
|
||||
gamemode.daily = true
|
||||
start_game()
|
||||
|
||||
|
||||
func _on_endless_button_pressed() -> void:
|
||||
generate_seed()
|
||||
gamemode.endless = true
|
||||
gamemode.daily = false
|
||||
start_game()
|
||||
|
||||
|
||||
func _on_changelog_button_pressed() -> void:
|
||||
main_controls.visible = true
|
||||
profile_controls.visible = true
|
||||
$Changelog.queue_free()
|
||||
|
||||
|
||||
func load_stats(stats: SaveData) -> void:
|
||||
$ProfileManager/VBoxContainer/Stats/Games/Label2.text = str(Data.save_data.wins + Data.save_data.losses)
|
||||
$ProfileManager/VBoxContainer/Stats/Wins/Label2.text = str(Data.save_data.wins)
|
||||
$ProfileManager/VBoxContainer/Stats/Losses/Label2.text = str(Data.save_data.losses)
|
||||
$ProfileManager/VBoxContainer/Stats/Winrate/Label2.text = str(Data.save_data.winrate) + "%"
|
||||
$ProfileManager/VBoxContainer/Stats/EngineerCardsBought/Label2.text = str(stats.engineer_cards_bought)
|
||||
$ProfileManager/VBoxContainer/Stats/MageCardsBought/Label2.text = str(stats.mage_cards_bought)
|
||||
|
||||
|
||||
func _on_achievements_back_button_pressed() -> void:
|
||||
$AchievementsMenu.visible = false
|
||||
|
||||
|
||||
func _on_achievements_button_pressed() -> void:
|
||||
$AchievementsMenu.visible = true
|
||||
|
||||
|
||||
func _on_profile_manager_cancel_pressed() -> void:
|
||||
profile_controls.visible = false
|
||||
main_controls.visible = true
|
||||
|
||||
|
||||
func _on_profile_manager_confirm_pressed() -> void:
|
||||
profile_controls.visible = false
|
||||
main_controls.visible = true
|
||||
if $ProfileManager/VBoxContainer/DisplayName/LineEdit.text != "":
|
||||
change_profile_display_name($ProfileManager/VBoxContainer/DisplayName/LineEdit.text)
|
||||
$ProfileManager/VBoxContainer/DisplayName/LineEdit.text = ""
|
||||
Data.save_data = temp_data
|
||||
Data.save_data.save_to_disc()
|
||||
|
||||
|
||||
func _on_unlock_all_pressed() -> void:
|
||||
temp_data.unlock_all_content()
|
||||
|
||||
|
||||
func _on_lock_all_pressed() -> void:
|
||||
temp_data.lock_all_content()
|
||||
|
||||
|
||||
func _on_mods_button_pressed() -> void:
|
||||
profile_controls.visible = false
|
||||
main_controls.visible = false
|
||||
mods_controls.visible = true
|
||||
|
||||
|
||||
func _on_cancel_mods_pressed() -> void:
|
||||
main_controls.visible = true
|
||||
mods_controls.visible = false
|
||||
|
||||
|
||||
func _on_confirm_mods_pressed() -> void:
|
||||
mods_controls.load_mod_list()
|
||||
main_controls.visible = true
|
||||
mods_controls.visible = false
|
||||
|
||||
|
||||
func _on_stats_button_pressed() -> void:
|
||||
main_controls.visible = false
|
||||
profile_controls.visible = true
|
||||
1
UI/Menus/MainMenu/main_menu.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://ci8vq73u23viy
|
||||
446
UI/Menus/MainMenu/main_menu.tscn
Normal file
@@ -0,0 +1,446 @@
|
||||
[gd_scene load_steps=12 format=3 uid="uid://8yv7excojcg0"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://ci8vq73u23viy" path="res://UI/Menus/MainMenu/main_menu.gd" id="2_ivytu"]
|
||||
[ext_resource type="AudioStream" uid="uid://cp6ph4ra7u5rk" path="res://UI/drop_003.ogg" id="5_cwn2i"]
|
||||
[ext_resource type="Texture2D" uid="uid://cr1ucbuw3iotp" path="res://Assets/Textures/first_win_achievements.png" id="15_74epv"]
|
||||
[ext_resource type="Script" uid="uid://cjr0pbqisd51v" path="res://UI/Menus/MainMenu/achievements_menu.gd" id="15_sv1gy"]
|
||||
[ext_resource type="Texture2D" uid="uid://cpa1hl36xfplg" path="res://Assets/Textures/first_scroll_seen.png" id="16_sv1gy"]
|
||||
[ext_resource type="Texture2D" uid="uid://ctbi3gm1me1t5" path="res://Assets/Textures/unlock_mage_achievement.png" id="17_6t4jd"]
|
||||
[ext_resource type="Script" uid="uid://cxrm2naq75jo1" path="res://Scripts/mod_menu.gd" id="19_6t4jd"]
|
||||
|
||||
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_2jyua"]
|
||||
random_pitch = 1.1
|
||||
streams_count = 1
|
||||
stream_0/stream = ExtResource("5_cwn2i")
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_y5bw6"]
|
||||
atlas = ExtResource("15_74epv")
|
||||
region = Rect2(0, 0, 36, 36)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_q26na"]
|
||||
atlas = ExtResource("16_sv1gy")
|
||||
region = Rect2(0, 0, 36, 36)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_3aj5m"]
|
||||
atlas = ExtResource("17_6t4jd")
|
||||
region = Rect2(0, 0, 36, 36)
|
||||
|
||||
[node name="MainMenu" type="Control" node_paths=PackedStringArray("game_select_menu", "main_controls", "seed_entry", "profile_controls", "mods_controls")]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("2_ivytu")
|
||||
game_select_menu = NodePath("GameSelectMenu")
|
||||
main_controls = NodePath("MainControls")
|
||||
seed_entry = NodePath("GameSelectMenu/VBoxContainer/HBoxContainer2/LineEdit")
|
||||
profile_controls = NodePath("ProfileManager")
|
||||
mods_controls = NodePath("ModsMenu")
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
color = Color(0.5176471, 0.60784316, 0.89411765, 1)
|
||||
|
||||
[node name="TitleLabel" type="Label" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 0.5
|
||||
grow_horizontal = 2
|
||||
text = "TITLE_GAME_NAME"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="MainControls" type="VBoxContainer" parent="."]
|
||||
custom_minimum_size = Vector2(80, 0)
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.938
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.95
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
alignment = 2
|
||||
|
||||
[node name="PlayButton" type="Button" parent="MainControls"]
|
||||
layout_mode = 2
|
||||
text = "BUTTON_PLAY"
|
||||
|
||||
[node name="ModsButton" type="Button" parent="MainControls"]
|
||||
layout_mode = 2
|
||||
text = "BUTTON_MODS"
|
||||
|
||||
[node name="StatsButton" type="Button" parent="MainControls"]
|
||||
layout_mode = 2
|
||||
text = "BUTTON_PLAYER_STATS"
|
||||
|
||||
[node name="OptionsButton" type="Button" parent="MainControls"]
|
||||
layout_mode = 2
|
||||
text = "BUTTON_OPTIONS
|
||||
"
|
||||
|
||||
[node name="QuitButton" type="Button" parent="MainControls"]
|
||||
layout_mode = 2
|
||||
text = "BUTTON_QUIT"
|
||||
|
||||
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
|
||||
stream = SubResource("AudioStreamRandomizer_2jyua")
|
||||
bus = &"SFX"
|
||||
|
||||
[node name="GameSelectMenu" type="PanelContainer" parent="."]
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -20.0
|
||||
offset_top = -20.0
|
||||
offset_right = 20.0
|
||||
offset_bottom = 20.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="GameSelectMenu"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="GameSelectMenu/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="BackButton" type="Button" parent="GameSelectMenu/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "BUTTON_BACK"
|
||||
|
||||
[node name="Title" type="Label" parent="GameSelectMenu/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "LABEL_GAME_MODE_SELECT"
|
||||
|
||||
[node name="StandardButton" type="Button" parent="GameSelectMenu/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "BUTTON_STANDARD_GAME"
|
||||
|
||||
[node name="DailyButton" type="Button" parent="GameSelectMenu/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "BUTTON_DAILY_CHALLENGE"
|
||||
|
||||
[node name="EndlessButton" type="Button" parent="GameSelectMenu/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "BUTTON_ENDLESS_GAME"
|
||||
|
||||
[node name="HBoxContainer2" type="HBoxContainer" parent="GameSelectMenu/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="GameSelectMenu/VBoxContainer/HBoxContainer2"]
|
||||
layout_mode = 2
|
||||
text = "LABEL_SEED"
|
||||
|
||||
[node name="LineEdit" type="LineEdit" parent="GameSelectMenu/VBoxContainer/HBoxContainer2"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
placeholder_text = "LABEL_SEED_PLACEHOLDER"
|
||||
expand_to_text_length = true
|
||||
|
||||
[node name="ProfileManager" type="PanelContainer" parent="."]
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -20.0
|
||||
offset_top = -20.0
|
||||
offset_right = 20.0
|
||||
offset_bottom = 20.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="ProfileManager"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="TitleBar" type="Label" parent="ProfileManager/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "TITLE_STATS_MENU"
|
||||
|
||||
[node name="DisplayName" type="HBoxContainer" parent="ProfileManager/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="ProfileManager/VBoxContainer/DisplayName"]
|
||||
layout_mode = 2
|
||||
text = "LABEL_DISPLAY_NAME"
|
||||
|
||||
[node name="LineEdit" type="LineEdit" parent="ProfileManager/VBoxContainer/DisplayName"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
placeholder_text = "LABEL_DISPLAY_NAME_PLACEHOLDER"
|
||||
alignment = 1
|
||||
expand_to_text_length = true
|
||||
|
||||
[node name="Stats" type="VBoxContainer" parent="ProfileManager/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="ProfileManager/VBoxContainer/Stats"]
|
||||
layout_mode = 2
|
||||
text = "LABEL_STATS"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Games" type="HBoxContainer" parent="ProfileManager/VBoxContainer/Stats"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="ProfileManager/VBoxContainer/Stats/Games"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "LABEL_GAMES"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Label2" type="Label" parent="ProfileManager/VBoxContainer/Stats/Games"]
|
||||
auto_translate_mode = 2
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "0"
|
||||
horizontal_alignment = 2
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Wins" type="HBoxContainer" parent="ProfileManager/VBoxContainer/Stats"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="ProfileManager/VBoxContainer/Stats/Wins"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "LABEL_WINS"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Label2" type="Label" parent="ProfileManager/VBoxContainer/Stats/Wins"]
|
||||
auto_translate_mode = 2
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "0"
|
||||
horizontal_alignment = 2
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Losses" type="HBoxContainer" parent="ProfileManager/VBoxContainer/Stats"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="ProfileManager/VBoxContainer/Stats/Losses"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "LABEL_LOSSES"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Label2" type="Label" parent="ProfileManager/VBoxContainer/Stats/Losses"]
|
||||
auto_translate_mode = 2
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "0"
|
||||
horizontal_alignment = 2
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Winrate" type="HBoxContainer" parent="ProfileManager/VBoxContainer/Stats"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="ProfileManager/VBoxContainer/Stats/Winrate"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "LABEL_WINRATE"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Label2" type="Label" parent="ProfileManager/VBoxContainer/Stats/Winrate"]
|
||||
auto_translate_mode = 2
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "0"
|
||||
horizontal_alignment = 2
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="EngineerCardsBought" type="HBoxContainer" parent="ProfileManager/VBoxContainer/Stats"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="ProfileManager/VBoxContainer/Stats/EngineerCardsBought"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "LABEL_ENGINEER_CARDS_BOUGHT"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Label2" type="Label" parent="ProfileManager/VBoxContainer/Stats/EngineerCardsBought"]
|
||||
auto_translate_mode = 2
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "0"
|
||||
horizontal_alignment = 2
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="MageCardsBought" type="HBoxContainer" parent="ProfileManager/VBoxContainer/Stats"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="ProfileManager/VBoxContainer/Stats/MageCardsBought"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "LABEL_MAGE_CARDS_BOUGHT"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Label2" type="Label" parent="ProfileManager/VBoxContainer/Stats/MageCardsBought"]
|
||||
auto_translate_mode = 2
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "0"
|
||||
horizontal_alignment = 2
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="UnlockAll" type="Button" parent="ProfileManager/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "BUTTON_UNLOCK_CONTENT"
|
||||
|
||||
[node name="LockAll" type="Button" parent="ProfileManager/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "BUTTON_LOCK_CONTENT"
|
||||
|
||||
[node name="AchievementsButton" type="Button" parent="ProfileManager/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "BUTTON_ACHIEVEMENTS"
|
||||
|
||||
[node name="Controls" type="HBoxContainer" parent="ProfileManager/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Cancel" type="Button" parent="ProfileManager/VBoxContainer/Controls"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "BUTTON_CANCEL"
|
||||
|
||||
[node name="Confirm" type="Button" parent="ProfileManager/VBoxContainer/Controls"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "BUTTON_CONFIRM"
|
||||
|
||||
[node name="AchievementsMenu" type="PanelContainer" parent="."]
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -20.0
|
||||
offset_top = -20.0
|
||||
offset_right = 20.0
|
||||
offset_bottom = 20.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("15_sv1gy")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="AchievementsMenu"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="AchievementsMenu/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="AchievementsMenu/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "TITLE_ACHIEVEMENTS"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Button" type="Button" parent="AchievementsMenu/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "BUTTON_BACK"
|
||||
|
||||
[node name="GridContainer" type="GridContainer" parent="AchievementsMenu/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
columns = 9
|
||||
|
||||
[node name="FirstWin" type="Button" parent="AchievementsMenu/VBoxContainer/GridContainer"]
|
||||
custom_minimum_size = Vector2(140, 140)
|
||||
layout_mode = 2
|
||||
tooltip_text = "ACHIEVEMENT_TOOLTIP_WIN_GAME"
|
||||
icon = SubResource("AtlasTexture_y5bw6")
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
|
||||
[node name="SeenMageCard" type="Button" parent="AchievementsMenu/VBoxContainer/GridContainer"]
|
||||
custom_minimum_size = Vector2(140, 140)
|
||||
layout_mode = 2
|
||||
tooltip_text = "ACHIEVEMENT_TOOLTIP_BUY_MAGE_CARD"
|
||||
icon = SubResource("AtlasTexture_q26na")
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
|
||||
[node name="UnlockedMage" type="Button" parent="AchievementsMenu/VBoxContainer/GridContainer"]
|
||||
custom_minimum_size = Vector2(140, 140)
|
||||
layout_mode = 2
|
||||
tooltip_text = "ACHIEVEMENT_TOOLTIP_UNLOCK_MAGE"
|
||||
icon = SubResource("AtlasTexture_3aj5m")
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
|
||||
[node name="ModsMenu" type="PanelContainer" parent="."]
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.05
|
||||
anchor_top = 0.05
|
||||
anchor_right = 0.95
|
||||
anchor_bottom = 0.95
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("19_6t4jd")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="ModsMenu"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="ModsMenu/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "TITLE_MODS"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="ModsMenu/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="ModsMenu/VBoxContainer/ScrollContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="ModsMenu/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
alignment = 2
|
||||
|
||||
[node name="CancelMods" type="Button" parent="ModsMenu/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "BUTTON_CANCEL"
|
||||
|
||||
[node name="ConfirmMods" type="Button" parent="ModsMenu/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "BUTTON_CONFIRM"
|
||||
|
||||
[connection signal="mouse_entered" from="MainControls/PlayButton" to="." method="_on_button_mouse_entered"]
|
||||
[connection signal="pressed" from="MainControls/PlayButton" to="." method="_on_play_button_pressed"]
|
||||
[connection signal="mouse_entered" from="MainControls/ModsButton" to="." method="_on_button_mouse_entered"]
|
||||
[connection signal="pressed" from="MainControls/ModsButton" to="." method="_on_mods_button_pressed"]
|
||||
[connection signal="pressed" from="MainControls/StatsButton" to="." method="_on_stats_button_pressed"]
|
||||
[connection signal="mouse_entered" from="MainControls/OptionsButton" to="." method="_on_button_mouse_entered"]
|
||||
[connection signal="pressed" from="MainControls/OptionsButton" to="." method="_on_options_button_pressed"]
|
||||
[connection signal="mouse_entered" from="MainControls/QuitButton" to="." method="_on_button_mouse_entered"]
|
||||
[connection signal="pressed" from="MainControls/QuitButton" to="." method="_on_quit_button_pressed"]
|
||||
[connection signal="pressed" from="GameSelectMenu/VBoxContainer/HBoxContainer/BackButton" to="." method="_on_back_button_pressed"]
|
||||
[connection signal="pressed" from="GameSelectMenu/VBoxContainer/StandardButton" to="." method="_on_standard_button_pressed"]
|
||||
[connection signal="pressed" from="GameSelectMenu/VBoxContainer/DailyButton" to="." method="_on_daily_button_pressed"]
|
||||
[connection signal="pressed" from="GameSelectMenu/VBoxContainer/EndlessButton" to="." method="_on_endless_button_pressed"]
|
||||
[connection signal="pressed" from="ProfileManager/VBoxContainer/UnlockAll" to="." method="_on_unlock_all_pressed"]
|
||||
[connection signal="pressed" from="ProfileManager/VBoxContainer/LockAll" to="." method="_on_lock_all_pressed"]
|
||||
[connection signal="pressed" from="ProfileManager/VBoxContainer/AchievementsButton" to="." method="_on_achievements_button_pressed"]
|
||||
[connection signal="pressed" from="ProfileManager/VBoxContainer/Controls/Cancel" to="." method="_on_profile_manager_cancel_pressed"]
|
||||
[connection signal="pressed" from="ProfileManager/VBoxContainer/Controls/Confirm" to="." method="_on_profile_manager_confirm_pressed"]
|
||||
[connection signal="pressed" from="AchievementsMenu/VBoxContainer/HBoxContainer/Button" to="." method="_on_achievements_back_button_pressed"]
|
||||
[connection signal="pressed" from="ModsMenu/VBoxContainer/HBoxContainer/CancelMods" to="." method="_on_cancel_mods_pressed"]
|
||||
[connection signal="pressed" from="ModsMenu/VBoxContainer/HBoxContainer/ConfirmMods" to="." method="_on_confirm_mods_pressed"]
|
||||
8
UI/Menus/MixingMenu/price_panel.gd
Normal file
@@ -0,0 +1,8 @@
|
||||
class_name PricePanel
|
||||
extends PanelContainer
|
||||
|
||||
@export var label: Label
|
||||
|
||||
|
||||
func set_price(price: int) -> void:
|
||||
label.text = "$" + str(price)
|
||||
1
UI/Menus/MixingMenu/price_panel.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bs73eocafngiu
|
||||
24
UI/Menus/MixingMenu/price_panel.tscn
Normal file
@@ -0,0 +1,24 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://dekexkjl37dvh"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bs73eocafngiu" path="res://UI/Menus/MixingMenu/price_panel.gd" id="1_sn84y"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_517dt"]
|
||||
bg_color = Color(0.2702219, 0.27022195, 0.27022177, 0.09019608)
|
||||
corner_detail = 1
|
||||
|
||||
[node name="Control" type="PanelContainer" node_paths=PackedStringArray("label")]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_517dt")
|
||||
script = ExtResource("1_sn84y")
|
||||
label = NodePath("Label")
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
text = "$15"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
258
UI/Menus/MixingMenu/track_editor.gd
Normal file
@@ -0,0 +1,258 @@
|
||||
class_name TrackEditor
|
||||
extends Control
|
||||
|
||||
signal cards_remixed(cards_consumed: Array[Card], cards_created: Array[Card], amount_spent: int)
|
||||
|
||||
@export var drag_feature: FeatureUI
|
||||
@export var sample_library: VBoxContainer
|
||||
@export var feature_scene: PackedScene
|
||||
@export var tower_parts: HBoxContainer
|
||||
@export var weapon_parts: HBoxContainer
|
||||
@export var drop_down: OptionButton
|
||||
@export var card_desc: CardDescriptionUI
|
||||
@export var price_panel_scene: PackedScene
|
||||
@export var price_label: Label
|
||||
@export var money_label: Label
|
||||
@export var confirm_button: Button
|
||||
@export var switch_button: Button
|
||||
|
||||
const FEATURE_SLOTS: int = 6
|
||||
const PRICE_STR: String = "LABEL_REMIX_PRICE"
|
||||
const MONEY_STR: String = "LABEL_REMIX_CURRENCY"
|
||||
const SIDE_A_STR: String = "BUTTON_VIEW_TOWER"
|
||||
const SIDE_B_STR: String = "BUTTON_VIEW_WEAPON"
|
||||
|
||||
var hero: Hero
|
||||
var dragging: bool = false
|
||||
var hovered_feature: Feature
|
||||
var hovered_drop_slot: int = -2
|
||||
var hovered_drop_track: int = 0
|
||||
var tower_feature_uis: Array[FeatureUI]
|
||||
var weapon_feature_uis: Array[FeatureUI]
|
||||
var features_list: Array[Feature]
|
||||
var tower_slots: Array[MarginContainer]
|
||||
var weapon_slots: Array[MarginContainer]
|
||||
var tower_prices: Array[PricePanel]
|
||||
var weapon_prices: Array[PricePanel]
|
||||
var cards: Array[Card]
|
||||
var card_selected: Card
|
||||
var temp_card: Card
|
||||
var cost: int = 0
|
||||
var check_button_pressed: bool = false
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
#populate_sample_library()
|
||||
#populate_feature_slots()
|
||||
card_desc.hide_features()
|
||||
tower_parts.mouse_entered.connect(set_hovered_drop_slot.bind(-1, 0))
|
||||
weapon_parts.mouse_entered.connect(set_hovered_drop_slot.bind(-1, 1))
|
||||
tower_parts.mouse_exited.connect(unset_hovered_drop_slot)
|
||||
weapon_parts.mouse_exited.connect(unset_hovered_drop_slot)
|
||||
price_label.text = tr(PRICE_STR) + str(cost)
|
||||
|
||||
|
||||
func set_money(money: int) -> void:
|
||||
money_label.text = tr(MONEY_STR) + str(money)
|
||||
|
||||
|
||||
func press_check_button(value: bool) -> void:
|
||||
check_button_pressed = value
|
||||
if check_button_pressed:
|
||||
switch_button.text = tr(SIDE_B_STR)
|
||||
else:
|
||||
switch_button.text = tr(SIDE_A_STR)
|
||||
card_desc.set_card(temp_card, check_button_pressed)
|
||||
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
drag_feature.position = get_viewport().get_mouse_position()
|
||||
if Input.is_action_just_pressed("Pause"):
|
||||
_on_cancel_button_pressed()
|
||||
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if event is InputEventMouseButton:
|
||||
if event.pressed == true and event.button_index == 1:
|
||||
if hovered_feature != null:
|
||||
attach_feat_to_mouse(hovered_feature)
|
||||
if event.pressed == false and event.button_index == 1:
|
||||
detach_feat_from_mouse()
|
||||
|
||||
|
||||
func select_card(option: int) -> void:
|
||||
for feature_ui: FeatureUI in tower_feature_uis:
|
||||
feature_ui.queue_free()
|
||||
tower_feature_uis = []
|
||||
for feature_ui: FeatureUI in weapon_feature_uis:
|
||||
feature_ui.queue_free()
|
||||
weapon_feature_uis = []
|
||||
card_selected = cards[option]
|
||||
temp_card = card_selected.duplicate()
|
||||
temp_card.tower_stats = temp_card.tower_stats.get_duplicate()
|
||||
temp_card.weapon_stats = temp_card.weapon_stats.get_duplicate()
|
||||
card_desc.set_card(temp_card, check_button_pressed)
|
||||
for feature: Feature in temp_card.tower_stats.features:
|
||||
add_feature(feature, 0, false)
|
||||
for feature: Feature in temp_card.weapon_stats.features:
|
||||
add_feature(feature, 1, false)
|
||||
|
||||
|
||||
func add_option(card_options: Array[Card]) -> void:
|
||||
cards = card_options
|
||||
for card: Card in cards:
|
||||
drop_down.add_item(tr(card.display_name))
|
||||
drop_down.select(0)
|
||||
select_card(0)
|
||||
populate_sample_library()
|
||||
|
||||
|
||||
func populate_sample_library() -> void:
|
||||
for card: Card in cards:
|
||||
for feature: Feature in card.tower_stats.features:
|
||||
if !features_list.has(feature):
|
||||
features_list.append(feature)
|
||||
for feature: Feature in card.weapon_stats.features:
|
||||
if !features_list.has(feature):
|
||||
features_list.append(feature)
|
||||
var i: int = 0
|
||||
var hbox: HBoxContainer
|
||||
for feature: Feature in features_list:
|
||||
if i == 0:
|
||||
hbox = HBoxContainer.new()
|
||||
sample_library.add_child(hbox)
|
||||
var feat: FeatureUI = feature_scene.instantiate() as FeatureUI
|
||||
feat.set_feature(feature)
|
||||
feat.show_title()
|
||||
feat.mouse_filter = Control.MOUSE_FILTER_PASS
|
||||
feat.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
feat.mouse_entered.connect(set_hovered_feature.bind(feat.feature))
|
||||
hbox.add_child(feat)
|
||||
i += 1
|
||||
if i == 3:
|
||||
i = 0
|
||||
sample_library.mouse_exited.connect(unset_hovered_feature)
|
||||
|
||||
|
||||
func populate_feature_slots() -> void:
|
||||
for x: int in FEATURE_SLOTS:
|
||||
var vbox: MarginContainer = MarginContainer.new()
|
||||
vbox.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
vbox.mouse_filter = Control.MOUSE_FILTER_STOP
|
||||
vbox.mouse_entered.connect(set_hovered_drop_slot.bind(tower_slots.size(), 0))
|
||||
vbox.mouse_exited.connect(unset_hovered_drop_slot)
|
||||
tower_parts.add_child(vbox)
|
||||
tower_slots.append(vbox)
|
||||
if x != 0:
|
||||
var panel: PricePanel = price_panel_scene.instantiate() as PricePanel
|
||||
panel.set_price(Data.slot_prices[x - 1])
|
||||
vbox.add_child(panel)
|
||||
tower_prices.append(panel)
|
||||
for x: int in FEATURE_SLOTS:
|
||||
var vbox: MarginContainer = MarginContainer.new()
|
||||
vbox.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
vbox.mouse_filter = Control.MOUSE_FILTER_STOP
|
||||
vbox.mouse_entered.connect(set_hovered_drop_slot.bind(weapon_slots.size(), 1))
|
||||
vbox.mouse_exited.connect(unset_hovered_drop_slot)
|
||||
weapon_parts.add_child(vbox)
|
||||
weapon_slots.append(vbox)
|
||||
if x != 0:
|
||||
var panel: PricePanel = price_panel_scene.instantiate() as PricePanel
|
||||
panel.set_price(Data.slot_prices[x - 1])
|
||||
vbox.add_child(panel)
|
||||
weapon_prices.append(panel)
|
||||
|
||||
|
||||
func add_feature(feature: Feature, track: int, modify_resource: bool = true) -> void:
|
||||
if hovered_drop_slot == 0:
|
||||
return
|
||||
if track == 0:
|
||||
if hovered_drop_slot > 0 and hovered_drop_slot < tower_feature_uis.size():
|
||||
change_feature(tower_feature_uis[hovered_drop_slot], feature, 0)
|
||||
elif tower_feature_uis.size() < FEATURE_SLOTS:
|
||||
var feature_visual: FeatureUI = feature_scene.instantiate()
|
||||
feature_visual.set_feature(feature)
|
||||
tower_slots[tower_feature_uis.size()].add_child(feature_visual)
|
||||
tower_feature_uis.append(feature_visual)
|
||||
if modify_resource:
|
||||
temp_card.tower_stats.features.append(feature)
|
||||
tower_prices[tower_feature_uis.size() - 2].visible = false
|
||||
cost += Data.slot_prices[tower_feature_uis.size() - 2]
|
||||
price_label.text = tr(PRICE_STR) + str(cost)
|
||||
card_desc.set_card(temp_card, check_button_pressed)
|
||||
if cost > hero.currency:
|
||||
confirm_button.disabled = true
|
||||
elif track == 1:
|
||||
if hovered_drop_slot > 0 and hovered_drop_slot < weapon_feature_uis.size():
|
||||
change_feature(weapon_feature_uis[hovered_drop_slot], feature, 1)
|
||||
elif weapon_feature_uis.size() < FEATURE_SLOTS:
|
||||
var feature_visual: FeatureUI = feature_scene.instantiate()
|
||||
feature_visual.set_feature(feature)
|
||||
weapon_slots[weapon_feature_uis.size()].add_child(feature_visual)
|
||||
weapon_feature_uis.append(feature_visual)
|
||||
if modify_resource:
|
||||
temp_card.weapon_stats.features.append(feature)
|
||||
weapon_prices[weapon_feature_uis.size() - 2].visible = false
|
||||
cost += Data.slot_prices[weapon_feature_uis.size() - 2]
|
||||
price_label.text = tr(PRICE_STR) + str(cost)
|
||||
card_desc.set_card(temp_card, check_button_pressed)
|
||||
if cost > hero.currency:
|
||||
confirm_button.disabled = true
|
||||
|
||||
|
||||
func change_feature(existing_feature: FeatureUI, new_feature: Feature, track: int) -> void:
|
||||
existing_feature.set_feature(new_feature)
|
||||
if track == 0:
|
||||
var i: int = tower_feature_uis.find(existing_feature)
|
||||
temp_card.tower_stats.features[i] = new_feature
|
||||
elif track == 1:
|
||||
var i: int = weapon_feature_uis.find(existing_feature)
|
||||
temp_card.weapon_stats.features[i] = new_feature
|
||||
card_desc.set_card(temp_card, check_button_pressed)
|
||||
|
||||
|
||||
func attach_feat_to_mouse(feature: Feature) -> void:
|
||||
drag_feature.set_feature(feature)
|
||||
drag_feature.visible = true
|
||||
dragging = true
|
||||
|
||||
|
||||
func detach_feat_from_mouse() -> void:
|
||||
drag_feature.visible = false
|
||||
if hovered_drop_slot >= -1 and dragging == true:
|
||||
add_feature(drag_feature.feature, hovered_drop_track)
|
||||
dragging = false
|
||||
|
||||
|
||||
func set_hovered_feature(feature: Feature) -> void:
|
||||
hovered_feature = feature
|
||||
|
||||
|
||||
func unset_hovered_feature() -> void:
|
||||
hovered_feature = null
|
||||
|
||||
|
||||
func set_hovered_drop_slot(slot: int = -2, track: int = 0) -> void:
|
||||
hovered_drop_slot = slot
|
||||
hovered_drop_track = track
|
||||
|
||||
|
||||
func unset_hovered_drop_slot() -> void:
|
||||
hovered_drop_slot = -2
|
||||
hovered_drop_track = -1
|
||||
|
||||
|
||||
func _on_cancel_button_pressed() -> void:
|
||||
var cards_to_remove: Array[Card] = []
|
||||
var cards_to_add: Array[Card] = []
|
||||
cards_remixed.emit(cards_to_remove, cards_to_add, 0)
|
||||
queue_free()
|
||||
|
||||
|
||||
func _on_confirm_button_pressed() -> void:
|
||||
var cards_to_remove: Array[Card] = []
|
||||
var cards_to_add: Array[Card] = []
|
||||
cards_to_remove.append(card_selected)
|
||||
cards_to_add.append(temp_card)
|
||||
cards_remixed.emit(cards_to_remove, cards_to_add, cost)
|
||||
queue_free()
|
||||
1
UI/Menus/MixingMenu/track_editor.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://mrv5vrlxfc13
|
||||
241
UI/Menus/MixingMenu/track_editor.tscn
Normal file
@@ -0,0 +1,241 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://bajli4d3nqwll"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://c8xdsg6gtwvh3" path="res://UI/FeatureUI/feature_ui.tscn" id="1_y6tpq"]
|
||||
[ext_resource type="Script" uid="uid://mrv5vrlxfc13" path="res://UI/Menus/MixingMenu/track_editor.gd" id="1_yrnbk"]
|
||||
[ext_resource type="PackedScene" uid="uid://dekexkjl37dvh" path="res://UI/Menus/MixingMenu/price_panel.tscn" id="3_48m6c"]
|
||||
[ext_resource type="PackedScene" uid="uid://cmlpmr78tmo6p" path="res://UI/card_description_ui.tscn" id="3_q6wwl"]
|
||||
[ext_resource type="Texture2D" uid="uid://cll2vlvf1h454" path="res://UI/Themes/Scale1/track_one_patch.png" id="4_dya4i"]
|
||||
[ext_resource type="Texture2D" uid="uid://cvhkk22pxxuqj" path="res://UI/Themes/Scale1/track_two_patch.png" id="5_4gmyw"]
|
||||
|
||||
[node name="TrackEditor" type="Control" node_paths=PackedStringArray("drag_feature", "sample_library", "tower_parts", "weapon_parts", "drop_down", "card_desc", "price_label", "money_label", "confirm_button", "switch_button")]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_yrnbk")
|
||||
drag_feature = NodePath("FeatureUI")
|
||||
sample_library = NodePath("PanelContainer/VBoxContainer/InfoPanel/VBoxContainer2/SamplePanel/ScrollContainer/SampleLibrary")
|
||||
feature_scene = ExtResource("1_y6tpq")
|
||||
tower_parts = NodePath("PanelContainer/VBoxContainer/Tracks/HBoxContainer/TrackUIs/Tower/MarginContainer/TowerParts")
|
||||
weapon_parts = NodePath("PanelContainer/VBoxContainer/Tracks/HBoxContainer/TrackUIs/Weapon/MarginContainer/WeaponParts")
|
||||
drop_down = NodePath("PanelContainer/VBoxContainer/Tracks/SourceCartridge/CassetteSelector/OptionButton")
|
||||
card_desc = NodePath("PanelContainer/VBoxContainer/InfoPanel/VBoxContainer/DescriptionVBox")
|
||||
price_panel_scene = ExtResource("3_48m6c")
|
||||
price_label = NodePath("PanelContainer/VBoxContainer/Tracks/SourceCartridge/MarginContainer/VBoxContainer/PriceLabel")
|
||||
money_label = NodePath("PanelContainer/VBoxContainer/Tracks/SourceCartridge/MarginContainer/VBoxContainer/MoneyLabel")
|
||||
confirm_button = NodePath("PanelContainer/VBoxContainer/InfoPanel/VBoxContainer2/Controls/ConfirmButton")
|
||||
switch_button = NodePath("PanelContainer/VBoxContainer/InfoPanel/VBoxContainer/Button")
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.02
|
||||
anchor_top = 0.02
|
||||
anchor_right = 0.98
|
||||
anchor_bottom = 0.98
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="PanelContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "TITLE_REMIX"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Tracks" type="VBoxContainer" parent="PanelContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="SourceCartridge" type="HBoxContainer" parent="PanelContainer/VBoxContainer/Tracks"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="MarginContainer2" type="MarginContainer" parent="PanelContainer/VBoxContainer/Tracks/SourceCartridge"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="CassetteSelector" type="VBoxContainer" parent="PanelContainer/VBoxContainer/Tracks/SourceCartridge"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="OptionButton" type="OptionButton" parent="PanelContainer/VBoxContainer/Tracks/SourceCartridge/CassetteSelector"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
alignment = 1
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="PanelContainer/VBoxContainer/Tracks/SourceCartridge"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/VBoxContainer/Tracks/SourceCartridge/MarginContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="MoneyLabel" type="Label" parent="PanelContainer/VBoxContainer/Tracks/SourceCartridge/MarginContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 1
|
||||
text = "Coins: $0"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="PriceLabel" type="Label" parent="PanelContainer/VBoxContainer/Tracks/SourceCartridge/MarginContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 1
|
||||
text = "Price: $0"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/VBoxContainer/Tracks"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Labels" type="VBoxContainer" parent="PanelContainer/VBoxContainer/Tracks/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Tower" type="Label" parent="PanelContainer/VBoxContainer/Tracks/HBoxContainer/Labels"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 7
|
||||
text = "LABEL_TOWER_TRACK"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Weapon" type="Label" parent="PanelContainer/VBoxContainer/Tracks/HBoxContainer/Labels"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 7
|
||||
text = "LABEL_WEAPON_TRACK"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="TrackUIs" type="VBoxContainer" parent="PanelContainer/VBoxContainer/Tracks/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Tower" type="MarginContainer" parent="PanelContainer/VBoxContainer/Tracks/HBoxContainer/TrackUIs"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 4.0
|
||||
|
||||
[node name="NinePatchRect" type="NinePatchRect" parent="PanelContainer/VBoxContainer/Tracks/HBoxContainer/TrackUIs/Tower"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("5_4gmyw")
|
||||
patch_margin_left = 1
|
||||
patch_margin_top = 1
|
||||
patch_margin_right = 1
|
||||
patch_margin_bottom = 1
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="PanelContainer/VBoxContainer/Tracks/HBoxContainer/TrackUIs/Tower"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 4
|
||||
theme_override_constants/margin_top = 4
|
||||
theme_override_constants/margin_right = 4
|
||||
theme_override_constants/margin_bottom = 4
|
||||
|
||||
[node name="TowerParts" type="HBoxContainer" parent="PanelContainer/VBoxContainer/Tracks/HBoxContainer/TrackUIs/Tower/MarginContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="Weapon" type="MarginContainer" parent="PanelContainer/VBoxContainer/Tracks/HBoxContainer/TrackUIs"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 4.0
|
||||
|
||||
[node name="NinePatchRect" type="NinePatchRect" parent="PanelContainer/VBoxContainer/Tracks/HBoxContainer/TrackUIs/Weapon"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("4_dya4i")
|
||||
patch_margin_left = 1
|
||||
patch_margin_top = 1
|
||||
patch_margin_right = 1
|
||||
patch_margin_bottom = 1
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="PanelContainer/VBoxContainer/Tracks/HBoxContainer/TrackUIs/Weapon"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 4
|
||||
theme_override_constants/margin_top = 4
|
||||
theme_override_constants/margin_right = 4
|
||||
theme_override_constants/margin_bottom = 4
|
||||
|
||||
[node name="WeaponParts" type="HBoxContainer" parent="PanelContainer/VBoxContainer/Tracks/HBoxContainer/TrackUIs/Weapon/MarginContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="InfoPanel" type="HBoxContainer" parent="PanelContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
size_flags_stretch_ratio = 2.0
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/VBoxContainer/InfoPanel"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Button" type="Button" parent="PanelContainer/VBoxContainer/InfoPanel/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
theme_type_variation = &"SideCheckButton"
|
||||
toggle_mode = true
|
||||
text = "Side A"
|
||||
|
||||
[node name="DescriptionVBox" parent="PanelContainer/VBoxContainer/InfoPanel/VBoxContainer" instance=ExtResource("3_q6wwl")]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="PanelContainer/VBoxContainer/InfoPanel"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 0.1
|
||||
|
||||
[node name="VBoxContainer2" type="VBoxContainer" parent="PanelContainer/VBoxContainer/InfoPanel"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="SamplePanel" type="VBoxContainer" parent="PanelContainer/VBoxContainer/InfoPanel/VBoxContainer2"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="Label" type="Label" parent="PanelContainer/VBoxContainer/InfoPanel/VBoxContainer2/SamplePanel"]
|
||||
layout_mode = 2
|
||||
text = "TITLE_SAMPLES"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="PanelContainer/VBoxContainer/InfoPanel/VBoxContainer2/SamplePanel"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="SampleLibrary" type="VBoxContainer" parent="PanelContainer/VBoxContainer/InfoPanel/VBoxContainer2/SamplePanel/ScrollContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="Controls" type="HBoxContainer" parent="PanelContainer/VBoxContainer/InfoPanel/VBoxContainer2"]
|
||||
layout_mode = 2
|
||||
alignment = 2
|
||||
|
||||
[node name="CancelButton" type="Button" parent="PanelContainer/VBoxContainer/InfoPanel/VBoxContainer2/Controls"]
|
||||
layout_mode = 2
|
||||
text = "BUTTON_CANCEL"
|
||||
|
||||
[node name="ConfirmButton" type="Button" parent="PanelContainer/VBoxContainer/InfoPanel/VBoxContainer2/Controls"]
|
||||
layout_mode = 2
|
||||
text = "BUTTON_CONFIRM_REMIX"
|
||||
|
||||
[node name="FeatureUI" parent="." instance=ExtResource("1_y6tpq")]
|
||||
visible = false
|
||||
layout_mode = 0
|
||||
anchors_preset = 0
|
||||
anchor_right = 0.0
|
||||
anchor_bottom = 0.0
|
||||
grow_horizontal = 1
|
||||
grow_vertical = 1
|
||||
mouse_filter = 2
|
||||
|
||||
[connection signal="item_selected" from="PanelContainer/VBoxContainer/Tracks/SourceCartridge/CassetteSelector/OptionButton" to="." method="select_card"]
|
||||
[connection signal="toggled" from="PanelContainer/VBoxContainer/InfoPanel/VBoxContainer/Button" to="." method="press_check_button"]
|
||||
[connection signal="pressed" from="PanelContainer/VBoxContainer/InfoPanel/VBoxContainer2/Controls/CancelButton" to="." method="_on_cancel_button_pressed"]
|
||||
[connection signal="pressed" from="PanelContainer/VBoxContainer/InfoPanel/VBoxContainer2/Controls/ConfirmButton" to="." method="_on_confirm_button_pressed"]
|
||||
54
UI/Menus/OptionsMenu/audio_options.gd
Normal file
@@ -0,0 +1,54 @@
|
||||
class_name AudioOptionsMenu
|
||||
extends VBoxContainer
|
||||
|
||||
@export var master_input: SpinBox
|
||||
@export var master_slider: HSlider
|
||||
@export var music_input: SpinBox
|
||||
@export var music_slider: HSlider
|
||||
@export var sfx_input: SpinBox
|
||||
@export var sfx_slider: HSlider
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
master_input.value = Data.audio.master
|
||||
master_slider.value = Data.audio.master
|
||||
music_input.value = Data.audio.music
|
||||
music_slider.value = Data.audio.music
|
||||
sfx_input.value = Data.audio.sfx
|
||||
sfx_slider.value = Data.audio.sfx
|
||||
|
||||
|
||||
func _on_master_spin_box_value_changed(value: float) -> void:
|
||||
master_slider.value = value
|
||||
Data.audio.master = value
|
||||
AudioServer.set_bus_volume_db(AudioServer.get_bus_index("Master"), linear_to_db(value / 100.0))
|
||||
|
||||
|
||||
func _on_master_h_slider_value_changed(value: float) -> void:
|
||||
master_input.value = value
|
||||
Data.audio.master = value
|
||||
AudioServer.set_bus_volume_db(AudioServer.get_bus_index("Master"), linear_to_db(value / 100.0))
|
||||
|
||||
|
||||
func _on_music_spin_box_value_changed(value: float) -> void:
|
||||
music_slider.value = value
|
||||
Data.audio.music = value
|
||||
AudioServer.set_bus_volume_db(AudioServer.get_bus_index("Music"), linear_to_db(value / 100.0))
|
||||
|
||||
|
||||
func _on_music_h_slider_value_changed(value: float) -> void:
|
||||
music_input.value = value
|
||||
Data.audio.music = value
|
||||
AudioServer.set_bus_volume_db(AudioServer.get_bus_index("Music"), linear_to_db(value / 100.0))
|
||||
|
||||
|
||||
func _on_sfx_spin_box_value_changed(value: float) -> void:
|
||||
sfx_slider.value = value
|
||||
Data.audio.sfx = value
|
||||
AudioServer.set_bus_volume_db(AudioServer.get_bus_index("SFX"), linear_to_db(value / 100.0))
|
||||
|
||||
|
||||
func _on_sfx_h_slider_value_changed(value: float) -> void:
|
||||
sfx_input.value = value
|
||||
Data.audio.sfx = value
|
||||
AudioServer.set_bus_volume_db(AudioServer.get_bus_index("SFX"), linear_to_db(value / 100.0))
|
||||
1
UI/Menus/OptionsMenu/audio_options.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://c4ljvgrb81du6
|
||||
110
UI/Menus/OptionsMenu/audio_options.tscn
Normal file
@@ -0,0 +1,110 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://bwc45ogto8thn"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c4ljvgrb81du6" path="res://UI/Menus/OptionsMenu/audio_options.gd" id="1_avc0j"]
|
||||
|
||||
[sub_resource type="ImageTexture" id="ImageTexture_hvvdd"]
|
||||
|
||||
[node name="Audio" type="VBoxContainer" node_paths=PackedStringArray("master_input", "master_slider", "music_input", "music_slider", "sfx_input", "sfx_slider")]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_avc0j")
|
||||
master_input = NodePath("Master/HBoxContainer/SpinBox")
|
||||
master_slider = NodePath("Master/HBoxContainer/HSlider")
|
||||
music_input = NodePath("Music/HBoxContainer/SpinBox")
|
||||
music_slider = NodePath("Music/HBoxContainer/HSlider")
|
||||
sfx_input = NodePath("SFX/HBoxContainer/SpinBox")
|
||||
sfx_slider = NodePath("SFX/HBoxContainer/HSlider")
|
||||
|
||||
[node name="Master" type="HBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="Master"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "OPTION_MASTER_AUDIO"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="Master"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="SpinBox" type="SpinBox" parent="Master/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_icons/updown = SubResource("ImageTexture_hvvdd")
|
||||
value = 100.0
|
||||
rounded = true
|
||||
alignment = 1
|
||||
update_on_text_changed = true
|
||||
|
||||
[node name="HSlider" type="HSlider" parent="Master/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
value = 100.0
|
||||
|
||||
[node name="Music" type="HBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="Music"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "OPTION_MUSIC_AUDIO"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="Music"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="SpinBox" type="SpinBox" parent="Music/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_icons/updown = SubResource("ImageTexture_hvvdd")
|
||||
value = 100.0
|
||||
rounded = true
|
||||
alignment = 1
|
||||
update_on_text_changed = true
|
||||
|
||||
[node name="HSlider" type="HSlider" parent="Music/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
value = 100.0
|
||||
|
||||
[node name="SFX" type="HBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="SFX"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "OPTION_SFX_AUDIO"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="SFX"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="SpinBox" type="SpinBox" parent="SFX/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_icons/updown = SubResource("ImageTexture_hvvdd")
|
||||
value = 100.0
|
||||
rounded = true
|
||||
alignment = 1
|
||||
update_on_text_changed = true
|
||||
|
||||
[node name="HSlider" type="HSlider" parent="SFX/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
value = 100.0
|
||||
|
||||
[connection signal="value_changed" from="Master/HBoxContainer/SpinBox" to="." method="_on_master_spin_box_value_changed"]
|
||||
[connection signal="value_changed" from="Master/HBoxContainer/HSlider" to="." method="_on_master_h_slider_value_changed"]
|
||||
[connection signal="value_changed" from="Music/HBoxContainer/SpinBox" to="." method="_on_music_spin_box_value_changed"]
|
||||
[connection signal="value_changed" from="Music/HBoxContainer/HSlider" to="." method="_on_music_h_slider_value_changed"]
|
||||
[connection signal="value_changed" from="SFX/HBoxContainer/SpinBox" to="." method="_on_sfx_spin_box_value_changed"]
|
||||
[connection signal="value_changed" from="SFX/HBoxContainer/HSlider" to="." method="_on_sfx_h_slider_value_changed"]
|
||||
46
UI/Menus/OptionsMenu/gameplay_options.gd
Normal file
@@ -0,0 +1,46 @@
|
||||
class_name GameplayOptionsMenu
|
||||
extends VBoxContainer
|
||||
|
||||
@export var look_sens_slider: HSlider
|
||||
@export var look_sens_input: SpinBox
|
||||
@export var toggle_sprint_checkbox: CheckButton
|
||||
@export var invert_lookY: CheckButton
|
||||
@export var invert_lookX: CheckButton
|
||||
@export var fixed_minimap: CheckButton
|
||||
@export var tower_damage: Button
|
||||
@export var self_damage: Button
|
||||
@export var party_damage: Button
|
||||
@export var status_damage: Button
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
look_sens_slider.value = Data.preferences.mouse_sens
|
||||
look_sens_input.value = Data.preferences.mouse_sens
|
||||
toggle_sprint_checkbox.button_pressed = Data.preferences.toggle_sprint
|
||||
invert_lookY.button_pressed = Data.preferences.invert_lookY
|
||||
invert_lookX.button_pressed = Data.preferences.invert_lookX
|
||||
fixed_minimap.button_pressed = Data.preferences.fixed_minimap
|
||||
tower_damage.button_pressed = Data.preferences.display_tower_damage_indicators
|
||||
self_damage.button_pressed = Data.preferences.display_self_damage_indicators
|
||||
party_damage.button_pressed = Data.preferences.display_party_damage_indicators
|
||||
status_damage.button_pressed = Data.preferences.display_status_effect_damage_indicators
|
||||
|
||||
|
||||
func save() -> void:
|
||||
Data.preferences.mouse_sens = look_sens_slider.value
|
||||
Data.preferences.toggle_sprint = toggle_sprint_checkbox.button_pressed
|
||||
Data.preferences.invert_lookY = invert_lookY.button_pressed
|
||||
Data.preferences.invert_lookX = invert_lookX.button_pressed
|
||||
Data.preferences.fixed_minimap = fixed_minimap.button_pressed
|
||||
Data.preferences.display_tower_damage_indicators = tower_damage.button_pressed
|
||||
Data.preferences.display_self_damage_indicators = self_damage.button_pressed
|
||||
Data.preferences.display_party_damage_indicators = party_damage.button_pressed
|
||||
Data.preferences.display_status_effect_damage_indicators = status_damage.button_pressed
|
||||
|
||||
|
||||
func _on_mouse_sens_spin_box_value_changed(value: float) -> void:
|
||||
look_sens_slider.value = value
|
||||
|
||||
|
||||
func _on_mouse_sens_h_slider_value_changed(value: float) -> void:
|
||||
look_sens_input.value = value
|
||||
1
UI/Menus/OptionsMenu/gameplay_options.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dtrjph756oq1f
|
||||
171
UI/Menus/OptionsMenu/gameplay_options.tscn
Normal file
@@ -0,0 +1,171 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://bjk7jf0bau5lv"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dtrjph756oq1f" path="res://UI/Menus/OptionsMenu/gameplay_options.gd" id="1_sy26f"]
|
||||
|
||||
[sub_resource type="ImageTexture" id="ImageTexture_03x6q"]
|
||||
|
||||
[node name="Gameplay" type="VBoxContainer" node_paths=PackedStringArray("look_sens_slider", "look_sens_input", "toggle_sprint_checkbox", "invert_lookY", "invert_lookX", "fixed_minimap", "tower_damage", "self_damage", "party_damage", "status_damage")]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_sy26f")
|
||||
look_sens_slider = NodePath("MouseSens/HBoxContainer/HSlider")
|
||||
look_sens_input = NodePath("MouseSens/HBoxContainer/SpinBox")
|
||||
toggle_sprint_checkbox = NodePath("ToggleSprint/CenterContainer/CheckButton")
|
||||
invert_lookY = NodePath("InvertMouseY/CenterContainer/CheckButton")
|
||||
invert_lookX = NodePath("InvertMouseX/CenterContainer/CheckButton")
|
||||
fixed_minimap = NodePath("FixedMinimap/CenterContainer/CheckButton")
|
||||
tower_damage = NodePath("FloatingDamageIndicators/CenterContainer/HBoxContainer/TowerDamage")
|
||||
self_damage = NodePath("FloatingDamageIndicators/CenterContainer/HBoxContainer/SelfDamage")
|
||||
party_damage = NodePath("FloatingDamageIndicators/CenterContainer/HBoxContainer/PartyDamage")
|
||||
status_damage = NodePath("FloatingDamageIndicators/CenterContainer/HBoxContainer/StatusDamage")
|
||||
|
||||
[node name="MouseSens" type="HBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="Label" type="Label" parent="MouseSens"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "OPTION_MOUSE_SENSITIVITY"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="MouseSens"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="SpinBox" type="SpinBox" parent="MouseSens/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_icons/updown = SubResource("ImageTexture_03x6q")
|
||||
step = 0.01
|
||||
alignment = 1
|
||||
update_on_text_changed = true
|
||||
|
||||
[node name="HSlider" type="HSlider" parent="MouseSens/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
step = 0.01
|
||||
scrollable = false
|
||||
|
||||
[node name="ToggleSprint" type="HBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="ToggleSprint"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "OPTION_TOGGLE_SPRINT"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="CenterContainer" type="CenterContainer" parent="ToggleSprint"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="CheckButton" type="CheckButton" parent="ToggleSprint/CenterContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
flat = true
|
||||
|
||||
[node name="InvertMouseY" type="HBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="InvertMouseY"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "OPTION_INVERT_MOUSE_Y"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="CenterContainer" type="CenterContainer" parent="InvertMouseY"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="CheckButton" type="CheckButton" parent="InvertMouseY/CenterContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
flat = true
|
||||
|
||||
[node name="InvertMouseX" type="HBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="InvertMouseX"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "OPTION_INVERT_MOUSE_X"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="CenterContainer" type="CenterContainer" parent="InvertMouseX"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="CheckButton" type="CheckButton" parent="InvertMouseX/CenterContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
flat = true
|
||||
|
||||
[node name="FixedMinimap" type="HBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="FixedMinimap"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "OPTION_FIXED_MINIMAP"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="CenterContainer" type="CenterContainer" parent="FixedMinimap"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="CheckButton" type="CheckButton" parent="FixedMinimap/CenterContainer"]
|
||||
layout_mode = 2
|
||||
flat = true
|
||||
|
||||
[node name="FloatingDamageIndicators" type="HBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="FloatingDamageIndicators"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "OPTION_DISPLAY_DAMAGE_INDICATORS"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="CenterContainer" type="CenterContainer" parent="FloatingDamageIndicators"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="FloatingDamageIndicators/CenterContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="TowerDamage" type="Button" parent="FloatingDamageIndicators/CenterContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
toggle_mode = true
|
||||
button_pressed = true
|
||||
text = "OPTION_TOWER_DAMAGE"
|
||||
|
||||
[node name="SelfDamage" type="Button" parent="FloatingDamageIndicators/CenterContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
toggle_mode = true
|
||||
button_pressed = true
|
||||
text = "OPTION_SELF_DAMAGE"
|
||||
|
||||
[node name="PartyDamage" type="Button" parent="FloatingDamageIndicators/CenterContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
toggle_mode = true
|
||||
button_pressed = true
|
||||
text = "OPTION_PARTY_DAMAGE"
|
||||
|
||||
[node name="StatusDamage" type="Button" parent="FloatingDamageIndicators/CenterContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
toggle_mode = true
|
||||
button_pressed = true
|
||||
text = "OPTION_STATUS_DAMAGE"
|
||||
|
||||
[connection signal="value_changed" from="MouseSens/HBoxContainer/SpinBox" to="." method="_on_mouse_sens_spin_box_value_changed"]
|
||||
[connection signal="value_changed" from="MouseSens/HBoxContainer/HSlider" to="." method="_on_mouse_sens_h_slider_value_changed"]
|
||||
36
UI/Menus/OptionsMenu/graphics_options.gd
Normal file
@@ -0,0 +1,36 @@
|
||||
class_name GraphicsOptionsMenu
|
||||
extends VBoxContainer
|
||||
|
||||
@export var fov_input: SpinBox
|
||||
@export var fov_slider: HSlider
|
||||
@export var vsync_dropdown: OptionButton
|
||||
@export var aa_dropdown: OptionButton
|
||||
@export var window_dropdown: OptionButton
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
fov_input.value = Data.graphics.hfov
|
||||
fov_slider.value = Data.graphics.hfov
|
||||
vsync_dropdown.selected = Data.graphics.vsync_mode
|
||||
aa_dropdown.selected = Data.graphics.aa_mode
|
||||
|
||||
|
||||
func save() -> void:
|
||||
Data.graphics.hfov = fov_slider.value
|
||||
Data.graphics.vsync_mode = vsync_dropdown.selected
|
||||
Data.graphics.aa_mode = aa_dropdown.selected
|
||||
Data.graphics.windowed_mode = window_dropdown.selected
|
||||
|
||||
|
||||
func _on_fov_spin_box_value_changed(value: float) -> void:
|
||||
if value < 40.0:
|
||||
value = 40.0
|
||||
if value > 160.0:
|
||||
value = 160.0
|
||||
fov_slider.value = value
|
||||
Data.graphics.hfov = value
|
||||
|
||||
|
||||
func _on_fov_h_slider_value_changed(value: float) -> void:
|
||||
fov_input.value = value
|
||||
Data.graphics.hfov = value
|
||||
1
UI/Menus/OptionsMenu/graphics_options.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bpb5c5r1yi8um
|
||||
124
UI/Menus/OptionsMenu/graphics_options.tscn
Normal file
@@ -0,0 +1,124 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://bmd4mawasoc11"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bpb5c5r1yi8um" path="res://UI/Menus/OptionsMenu/graphics_options.gd" id="1_85rh6"]
|
||||
|
||||
[sub_resource type="ImageTexture" id="ImageTexture_03x6q"]
|
||||
|
||||
[node name="Graphics" type="VBoxContainer" node_paths=PackedStringArray("fov_input", "fov_slider", "vsync_dropdown", "aa_dropdown", "window_dropdown")]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_85rh6")
|
||||
fov_input = NodePath("FOV/HBoxContainer/SpinBox")
|
||||
fov_slider = NodePath("FOV/HBoxContainer/HSlider")
|
||||
vsync_dropdown = NodePath("VSync/OptionButton")
|
||||
aa_dropdown = NodePath("AntiAliasing/OptionButton")
|
||||
window_dropdown = NodePath("Windowed/OptionButton")
|
||||
|
||||
[node name="FOV" type="HBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="Label" type="Label" parent="FOV"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "OPTION_FOV"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="FOV"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="SpinBox" type="SpinBox" parent="FOV/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_icons/updown = SubResource("ImageTexture_03x6q")
|
||||
min_value = 40.0
|
||||
max_value = 160.0
|
||||
value = 100.0
|
||||
allow_greater = true
|
||||
allow_lesser = true
|
||||
alignment = 1
|
||||
update_on_text_changed = true
|
||||
|
||||
[node name="HSlider" type="HSlider" parent="FOV/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 1
|
||||
min_value = 40.0
|
||||
max_value = 160.0
|
||||
value = 100.0
|
||||
scrollable = false
|
||||
|
||||
[node name="VSync" type="HBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="VSync"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "OPTION_VSYNC"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="OptionButton" type="OptionButton" parent="VSync"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
selected = 1
|
||||
item_count = 4
|
||||
popup/item_0/text = "OPTION_OFF"
|
||||
popup/item_0/id = 0
|
||||
popup/item_1/text = "OPTION_ON"
|
||||
popup/item_1/id = 1
|
||||
popup/item_2/text = "OPTION_ADAPTIVE"
|
||||
popup/item_2/id = 2
|
||||
popup/item_3/text = "OPTION_TRIPLE_BUFFERED"
|
||||
popup/item_3/id = 3
|
||||
|
||||
[node name="AntiAliasing" type="HBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="AntiAliasing"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "OPTION_AA"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="OptionButton" type="OptionButton" parent="AntiAliasing"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
selected = 0
|
||||
item_count = 3
|
||||
popup/item_0/text = "OPTION_OFF"
|
||||
popup/item_0/id = 0
|
||||
popup/item_1/text = "OPTION_FXAA"
|
||||
popup/item_1/id = 1
|
||||
popup/item_2/text = "OPTION_TAA"
|
||||
popup/item_2/id = 2
|
||||
|
||||
[node name="Windowed" type="HBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="Windowed"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "OPTION_WINDOW_TYPE"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="OptionButton" type="OptionButton" parent="Windowed"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
selected = 0
|
||||
item_count = 3
|
||||
popup/item_0/text = "OPTION_WINDOWED"
|
||||
popup/item_0/id = 0
|
||||
popup/item_1/text = "OPTION_BORDERLESS"
|
||||
popup/item_1/id = 1
|
||||
popup/item_2/text = "OPTION_FULLSCREEN"
|
||||
popup/item_2/id = 2
|
||||
|
||||
[connection signal="value_changed" from="FOV/HBoxContainer/SpinBox" to="." method="_on_fov_spin_box_value_changed"]
|
||||
[connection signal="value_changed" from="FOV/HBoxContainer/HSlider" to="." method="_on_fov_h_slider_value_changed"]
|
||||
34
UI/Menus/OptionsMenu/keybind_entry.tscn
Normal file
@@ -0,0 +1,34 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://cb8irvp2y2p6g"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://y2pxkfjn0wa2" path="res://UI/Menus/OptionsMenu/keybind_entry.gd" id="1_it8q2"]
|
||||
|
||||
[node name="KeybindEntry" type="HBoxContainer"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
script = ExtResource("1_it8q2")
|
||||
|
||||
[node name="ActionName" type="Label" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Action Name"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Buttons" type="GridContainer" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
columns = 4
|
||||
|
||||
[node name="AddBindButton" type="Button" parent="Buttons"]
|
||||
custom_minimum_size = Vector2(80, 80)
|
||||
layout_mode = 2
|
||||
text = "+"
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
|
||||
[connection signal="pressed" from="Buttons/AddBindButton" to="." method="_on_add_bind_button_pressed"]
|
||||
53
UI/Menus/OptionsMenu/keybind_options.gd
Normal file
@@ -0,0 +1,53 @@
|
||||
extends VBoxContainer
|
||||
class_name KeybindsOptionsMenu
|
||||
|
||||
@export var keybind_entry_scene: PackedScene
|
||||
@export var keybind_popup: PackedScene
|
||||
var keybind_boxes: Array[KeybindEntry] = []
|
||||
var key_event: InputEvent
|
||||
var selected_entry: KeybindEntry
|
||||
var listening_for_key: bool = false
|
||||
var ui_layer: CanvasLayer
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
#for index: int in Data.keymaps.size():
|
||||
# var map: PlayerKeymap = Data.keymaps[index]
|
||||
# var button: Button = Button.new()
|
||||
# button.text = map.title
|
||||
# button.pressed.connect(set_keymap.bind(index))
|
||||
# $HBoxContainer.add_child(button)
|
||||
load_keybind_labels()
|
||||
|
||||
|
||||
func set_keymap(keymap_index: int) -> void:
|
||||
Data.player_keymap = Data.keymaps[keymap_index]
|
||||
Data.player_keymap.apply()
|
||||
load_keybind_labels()
|
||||
|
||||
|
||||
func load_keybind_labels() -> void:
|
||||
for box: KeybindEntry in keybind_boxes:
|
||||
box.queue_free()
|
||||
keybind_boxes.clear()
|
||||
for action: StringName in InputMap.get_actions():
|
||||
if !action.begins_with("ui_"):
|
||||
var entry: KeybindEntry = keybind_entry_scene.instantiate() as KeybindEntry
|
||||
entry.set_action_name(action)
|
||||
if InputMap.action_get_events(action).size() > 0:
|
||||
for event: InputEvent in InputMap.action_get_events(action):
|
||||
entry.add_bind_button(event)
|
||||
keybind_boxes.append(entry)
|
||||
entry.bind_button_pressed.connect(_on_keybind_button_pressed.bind(entry))
|
||||
$ScrollContainer/VBoxContainer.add_child(entry)
|
||||
|
||||
|
||||
func _on_keybind_button_pressed(button: Button, keybind_entry: KeybindEntry) -> void:
|
||||
var popup: KeybindPopup = keybind_popup.instantiate()
|
||||
popup.event_detected.connect(keybind_entry.set_button_bind.bind(button))
|
||||
ui_layer.add_child(popup)
|
||||
|
||||
|
||||
func save() -> void:
|
||||
for entry: KeybindEntry in keybind_boxes:
|
||||
Data.keymap_data.add_binding(entry.to_array())
|
||||
1
UI/Menus/OptionsMenu/keybind_options.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cxm67e833baex
|
||||
26
UI/Menus/OptionsMenu/keybind_options.tscn
Normal file
@@ -0,0 +1,26 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://bf2nosqt5f82e"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cxm67e833baex" path="res://UI/Menus/OptionsMenu/keybind_options.gd" id="1_oxg0p"]
|
||||
[ext_resource type="PackedScene" uid="uid://cb8irvp2y2p6g" path="res://UI/Menus/OptionsMenu/keybind_entry.tscn" id="2_ayiik"]
|
||||
[ext_resource type="PackedScene" uid="uid://clsdko6ttudu8" path="res://UI/Menus/OptionsMenu/keybind_popup.tscn" id="3_h1scm"]
|
||||
|
||||
[node name="Keybinds" type="VBoxContainer"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_oxg0p")
|
||||
keybind_entry_scene = ExtResource("2_ayiik")
|
||||
keybind_popup = ExtResource("3_h1scm")
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="ScrollContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
38
UI/Menus/OptionsMenu/keybind_popup.tscn
Normal file
@@ -0,0 +1,38 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://clsdko6ttudu8"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://d25hjwjdwv35i" path="res://UI/Menus/OptionsMenu/keybind_popup.gd" id="1_m5i0b"]
|
||||
|
||||
[node name="KeybindPopup" 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_m5i0b")
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
color = Color(0, 0, 0, 0.54902)
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -99.0
|
||||
offset_top = -13.0
|
||||
offset_right = 99.0
|
||||
offset_bottom = 13.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
text = "LABEL_BIND_KEY"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
69
UI/Menus/OptionsMenu/keymap_data.gd
Normal file
@@ -0,0 +1,69 @@
|
||||
class_name KeymapData
|
||||
extends RefCounted
|
||||
|
||||
var title: String = "default"
|
||||
var map: Dictionary[String, Array]
|
||||
|
||||
|
||||
func add_binding(bind_array: Array) -> void:
|
||||
var x: int = bind_array.size() - 1
|
||||
var arr: Array
|
||||
for i: int in x:
|
||||
arr.append(bind_array[i + 1])
|
||||
map[bind_array[0][0]] = arr
|
||||
|
||||
|
||||
static func event_from_array(array: Array) -> InputEvent:
|
||||
if array.size() < 2:
|
||||
return null
|
||||
if array[0] == "InputEventKey":
|
||||
var event: InputEventKey = InputEventKey.new()
|
||||
event.physical_keycode = array[1]
|
||||
return event
|
||||
if array[0] == "InputEventMouseButton":
|
||||
var event: InputEventMouseButton = InputEventMouseButton.new()
|
||||
event.button_index = array[1]
|
||||
return event
|
||||
if array[0] == "InputEventJoypadButton":
|
||||
var event: InputEventJoypadButton = InputEventJoypadButton.new()
|
||||
event.button_index = array[1]
|
||||
return event
|
||||
return null
|
||||
|
||||
|
||||
func apply() -> void:
|
||||
for action_string: String in map.keys():
|
||||
InputMap.action_erase_events(action_string)
|
||||
for binding: Array in map[action_string]:
|
||||
var event: InputEvent = event_from_array(binding)
|
||||
if event:
|
||||
InputMap.action_add_event(action_string, event)
|
||||
|
||||
|
||||
func save_to_disc() -> void:
|
||||
var dir: DirAccess = DirAccess.open("user://")
|
||||
if !dir.dir_exists("keymaps"):
|
||||
dir.make_dir("keymaps")
|
||||
var save_file: FileAccess = FileAccess.open("user://keymaps/default", FileAccess.WRITE)
|
||||
var dict: Dictionary = {
|
||||
"title" = title,
|
||||
"map" = map,
|
||||
}
|
||||
var json_string: String = JSON.stringify(dict)
|
||||
save_file.store_line(json_string)
|
||||
|
||||
|
||||
static func load_from_disk() -> KeymapData:
|
||||
if FileAccess.file_exists("user://keymaps/default"):
|
||||
var save_file: FileAccess = FileAccess.open("user://keymaps/default", FileAccess.READ)
|
||||
var json_string: String = save_file.get_line()
|
||||
var json: JSON = JSON.new()
|
||||
var parse_result: Error = json.parse(json_string)
|
||||
if parse_result == OK:
|
||||
var dict: Dictionary = json.data
|
||||
var keymap: KeymapData = KeymapData.new()
|
||||
keymap.title = dict["title"]
|
||||
for key: String in dict["map"].keys():
|
||||
keymap.map[key] = dict["map"][key]
|
||||
return keymap
|
||||
return KeymapData.new()
|
||||
1
UI/Menus/OptionsMenu/keymap_data.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dui1k2e4q6cl
|
||||
44
UI/Menus/OptionsMenu/options_menu.gd
Normal file
@@ -0,0 +1,44 @@
|
||||
class_name OptionsMenu
|
||||
extends Control
|
||||
|
||||
@export var gameplay: GameplayOptionsMenu
|
||||
@export var graphics: GraphicsOptionsMenu
|
||||
@export var keybinds: KeybindsOptionsMenu
|
||||
@export var audio: AudioOptionsMenu
|
||||
var game_manager: GameManager
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
set_tab_locale()
|
||||
keybinds.ui_layer = game_manager.UILayer
|
||||
|
||||
|
||||
func set_tab_locale() -> void:
|
||||
gameplay.name = tr("OPTIONS_TAB_GAMEPLAY")
|
||||
graphics.name = tr("OPTIONS_TAB_GRAPHICS")
|
||||
keybinds.name = tr("OPTIONS_TAB_KEYBINDS")
|
||||
audio.name = tr("OPTIONS_TAB_AUDIO")
|
||||
|
||||
|
||||
func _on_cancel_pressed() -> void:
|
||||
queue_free()
|
||||
|
||||
|
||||
func _on_confirm_pressed() -> void:
|
||||
gameplay.save()
|
||||
graphics.save()
|
||||
keybinds.save()
|
||||
Data.graphics.apply_graphical_settings(get_viewport())
|
||||
Data.graphics.save_profile_to_disk()
|
||||
Data.audio.apply_audio_settings()
|
||||
Data.audio.save_profile_to_disk()
|
||||
Data.preferences.save_profile_to_disk()
|
||||
Data.keymap_data.apply()
|
||||
Data.keymap_data.save_to_disc()
|
||||
#Data.player_keymap.save_profile_to_disk()
|
||||
#Data.player_controller_keymap.append_input_map()
|
||||
queue_free()
|
||||
|
||||
|
||||
func _on_button_hovered() -> void:
|
||||
$AudioStreamPlayer.play()
|
||||
1
UI/Menus/OptionsMenu/options_menu.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://48rvmybi18wj
|
||||
76
UI/Menus/OptionsMenu/options_menu.tscn
Normal file
@@ -0,0 +1,76 @@
|
||||
[gd_scene load_steps=8 format=3 uid="uid://clulh7v8c7h85"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://48rvmybi18wj" path="res://UI/Menus/OptionsMenu/options_menu.gd" id="1_bievw"]
|
||||
[ext_resource type="PackedScene" uid="uid://bjk7jf0bau5lv" path="res://UI/Menus/OptionsMenu/gameplay_options.tscn" id="3_25wuw"]
|
||||
[ext_resource type="PackedScene" uid="uid://bmd4mawasoc11" path="res://UI/Menus/OptionsMenu/graphics_options.tscn" id="4_ckcvq"]
|
||||
[ext_resource type="PackedScene" uid="uid://bf2nosqt5f82e" path="res://UI/Menus/OptionsMenu/keybind_options.tscn" id="5_4k33c"]
|
||||
[ext_resource type="PackedScene" uid="uid://bwc45ogto8thn" path="res://UI/Menus/OptionsMenu/audio_options.tscn" id="6_4vs8p"]
|
||||
[ext_resource type="AudioStream" uid="uid://cp6ph4ra7u5rk" path="res://UI/drop_003.ogg" id="6_hhyef"]
|
||||
|
||||
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_5otwj"]
|
||||
random_pitch = 1.1
|
||||
streams_count = 1
|
||||
stream_0/stream = ExtResource("6_hhyef")
|
||||
|
||||
[node name="OptionsMenu" type="PanelContainer" node_paths=PackedStringArray("gameplay", "graphics", "keybinds", "audio")]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 30.0
|
||||
offset_top = 30.0
|
||||
offset_right = -30.0
|
||||
offset_bottom = -30.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_bievw")
|
||||
gameplay = NodePath("VBoxContainer/TabContainer/Gameplay")
|
||||
graphics = NodePath("VBoxContainer/TabContainer/Graphics")
|
||||
keybinds = NodePath("VBoxContainer/TabContainer/Keybinds")
|
||||
audio = NodePath("VBoxContainer/TabContainer/Audio")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="TabContainer" type="TabContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
current_tab = 0
|
||||
|
||||
[node name="Gameplay" parent="VBoxContainer/TabContainer" instance=ExtResource("3_25wuw")]
|
||||
layout_mode = 2
|
||||
metadata/_tab_index = 0
|
||||
|
||||
[node name="Graphics" parent="VBoxContainer/TabContainer" instance=ExtResource("4_ckcvq")]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
metadata/_tab_index = 1
|
||||
|
||||
[node name="Keybinds" parent="VBoxContainer/TabContainer" instance=ExtResource("5_4k33c")]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
metadata/_tab_index = 2
|
||||
|
||||
[node name="Audio" parent="VBoxContainer/TabContainer" instance=ExtResource("6_4vs8p")]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
metadata/_tab_index = 3
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
alignment = 2
|
||||
|
||||
[node name="Cancel" type="Button" parent="VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "BUTTON_CANCEL"
|
||||
|
||||
[node name="Confirm" type="Button" parent="VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "BUTTON_CONFIRM"
|
||||
|
||||
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
|
||||
stream = SubResource("AudioStreamRandomizer_5otwj")
|
||||
|
||||
[connection signal="mouse_entered" from="VBoxContainer/HBoxContainer/Cancel" to="." method="_on_button_hovered"]
|
||||
[connection signal="pressed" from="VBoxContainer/HBoxContainer/Cancel" to="." method="_on_cancel_pressed"]
|
||||
[connection signal="mouse_entered" from="VBoxContainer/HBoxContainer/Confirm" to="." method="_on_button_hovered"]
|
||||
[connection signal="pressed" from="VBoxContainer/HBoxContainer/Confirm" to="." method="_on_confirm_pressed"]
|
||||
54
UI/Menus/PauseMenu/pause_menu.gd
Normal file
@@ -0,0 +1,54 @@
|
||||
class_name PauseMenu extends Control
|
||||
|
||||
signal closed
|
||||
signal quit_to_main_menu_pressed
|
||||
signal quit_to_desktop_pressed
|
||||
|
||||
var options_menu_scene: PackedScene = preload("res://UI/Menus/OptionsMenu/options_menu.tscn")
|
||||
var confirmation_popup_scene: PackedScene = preload("res://Scenes/Menus/confirmation_popup.tscn")
|
||||
var game_manager: GameManager
|
||||
|
||||
|
||||
func _unhandled_input(event: InputEvent) -> void:
|
||||
if event.is_action_pressed("Pause"):
|
||||
accept_event()
|
||||
_on_resume_pressed()
|
||||
|
||||
|
||||
func _on_resume_pressed() -> void:
|
||||
closed.emit()
|
||||
queue_free()
|
||||
|
||||
|
||||
func _on_options_pressed() -> void:
|
||||
var menu: OptionsMenu = options_menu_scene.instantiate()
|
||||
menu.game_manager = game_manager
|
||||
add_child(menu)
|
||||
|
||||
|
||||
func _on_quit_to_main_menu_pressed() -> void:
|
||||
var popup: ConfirmationPopup = confirmation_popup_scene.instantiate() as ConfirmationPopup
|
||||
popup.set_popup("Are you sure you want to quit and return to main menu?", "Yes", "No")
|
||||
popup.completed.connect(return_to_menu)
|
||||
add_child(popup)
|
||||
|
||||
|
||||
func return_to_menu(confirmation: bool) -> void:
|
||||
if confirmation:
|
||||
quit_to_main_menu_pressed.emit()
|
||||
|
||||
|
||||
func _on_quit_to_desktop_pressed() -> void:
|
||||
var popup: ConfirmationPopup = confirmation_popup_scene.instantiate() as ConfirmationPopup
|
||||
popup.set_popup("Are you sure you want to quit?", "Yes", "No")
|
||||
popup.completed.connect(quit_game)
|
||||
add_child(popup)
|
||||
|
||||
|
||||
func quit_game(confirmation: bool) -> void:
|
||||
if confirmation:
|
||||
quit_to_desktop_pressed.emit()
|
||||
|
||||
|
||||
func _on_button_mouse_entered() -> void:
|
||||
$AudioStreamPlayer.play()
|
||||
1
UI/Menus/PauseMenu/pause_menu.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cjyyepxaf4xl8
|
||||
73
UI/Menus/PauseMenu/pause_menu.tscn
Normal file
@@ -0,0 +1,73 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://buvgdem68wtev"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cjyyepxaf4xl8" path="res://UI/Menus/PauseMenu/pause_menu.gd" id="2_4pn2l"]
|
||||
[ext_resource type="AudioStream" uid="uid://cp6ph4ra7u5rk" path="res://UI/drop_003.ogg" id="3_0bid7"]
|
||||
|
||||
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_n6ixr"]
|
||||
random_pitch = 1.1
|
||||
streams_count = 1
|
||||
stream_0/stream = ExtResource("3_0bid7")
|
||||
|
||||
[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("2_4pn2l")
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
color = Color(0.278431, 0.278431, 0.278431, 0.545098)
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -20.0
|
||||
offset_top = -20.0
|
||||
offset_right = 20.0
|
||||
offset_bottom = 20.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Resume" type="Button" parent="PanelContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "BUTTON_RESUME"
|
||||
|
||||
[node name="Options" type="Button" parent="PanelContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "BUTTON_OPTIONS"
|
||||
|
||||
[node name="QuitToMainMenu" type="Button" parent="PanelContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "BUTTON_MAIN_MENU"
|
||||
|
||||
[node name="QuitToDesktop" type="Button" parent="PanelContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "BUTTON_QUIT"
|
||||
|
||||
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
|
||||
stream = SubResource("AudioStreamRandomizer_n6ixr")
|
||||
bus = &"SFX"
|
||||
|
||||
[connection signal="mouse_entered" from="PanelContainer/VBoxContainer/Resume" to="." method="_on_button_mouse_entered"]
|
||||
[connection signal="pressed" from="PanelContainer/VBoxContainer/Resume" to="." method="_on_resume_pressed"]
|
||||
[connection signal="mouse_entered" from="PanelContainer/VBoxContainer/Options" to="." method="_on_button_mouse_entered"]
|
||||
[connection signal="pressed" from="PanelContainer/VBoxContainer/Options" to="." method="_on_options_pressed"]
|
||||
[connection signal="mouse_entered" from="PanelContainer/VBoxContainer/QuitToMainMenu" to="." method="_on_button_mouse_entered"]
|
||||
[connection signal="pressed" from="PanelContainer/VBoxContainer/QuitToMainMenu" to="." method="_on_quit_to_main_menu_pressed"]
|
||||
[connection signal="mouse_entered" from="PanelContainer/VBoxContainer/QuitToDesktop" to="." method="_on_button_mouse_entered"]
|
||||
[connection signal="pressed" from="PanelContainer/VBoxContainer/QuitToDesktop" to="." method="_on_quit_to_desktop_pressed"]
|
||||
39
UI/Menus/RadioMenu/choose_card_screen.gd
Normal file
@@ -0,0 +1,39 @@
|
||||
class_name ChooseCardScreen extends Control
|
||||
|
||||
signal card_chosen(card: Card)
|
||||
|
||||
@export var choice_buttons: VBoxContainer
|
||||
@export var card_desc: CardDescriptionUI
|
||||
@export var card_name_label: Label
|
||||
|
||||
var choices: Array[Card] = []
|
||||
var chosen_card: Card = null
|
||||
var side_a: bool = true
|
||||
|
||||
|
||||
func add_cards(cards: Array[Card]) -> void:
|
||||
var x: int = 0
|
||||
for card: Card in cards:
|
||||
var button: Button = Button.new()
|
||||
button.text = tr(card.display_name)
|
||||
button.pressed.connect(choose_card.bind(x))
|
||||
choices.append(card)
|
||||
choice_buttons.add_child(button)
|
||||
x += 1
|
||||
choose_card(0)
|
||||
|
||||
|
||||
func choose_card(choice: int) -> void:
|
||||
chosen_card = choices[choice]
|
||||
card_name_label.text = tr(chosen_card.display_name)
|
||||
choose_side(side_a)
|
||||
|
||||
|
||||
func choose_side(side_a_chosen: bool) -> void:
|
||||
side_a = side_a_chosen
|
||||
card_desc.set_card(chosen_card, side_a)
|
||||
|
||||
|
||||
func _on_confirm_button_pressed() -> void:
|
||||
card_chosen.emit(chosen_card)
|
||||
queue_free()
|
||||
1
UI/Menus/RadioMenu/choose_card_screen.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://nc0df5y8tll7
|
||||
83
UI/Menus/RadioMenu/choose_card_screen.tscn
Normal file
@@ -0,0 +1,83 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://bcvjgl0s1wp8y"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://nc0df5y8tll7" path="res://UI/Menus/RadioMenu/choose_card_screen.gd" id="1_y4oar"]
|
||||
[ext_resource type="PackedScene" uid="uid://cmlpmr78tmo6p" path="res://UI/card_description_ui.tscn" id="2_3npvv"]
|
||||
|
||||
[node name="ChooseCardScreen" type="Control" node_paths=PackedStringArray("choice_buttons", "card_desc", "card_name_label")]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_y4oar")
|
||||
choice_buttons = NodePath("PanelContainer/Content/HBoxContainer/ChoicesVBox")
|
||||
card_desc = NodePath("PanelContainer/Content/HBoxContainer/DescriptionVBox")
|
||||
card_name_label = NodePath("PanelContainer/Content/HBoxContainer/VBoxContainer/NameLabel")
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.03
|
||||
anchor_top = 0.03
|
||||
anchor_right = 0.97
|
||||
anchor_bottom = 0.97
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="Content" type="VBoxContainer" parent="PanelContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ScreenTitleLabel" type="Label" parent="PanelContainer/Content"]
|
||||
layout_mode = 2
|
||||
text = "LABEL_CHOOSE_CARD"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/Content"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="ChoicesVBox" type="VBoxContainer" parent="PanelContainer/Content/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/Content/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_stretch_ratio = 2.0
|
||||
|
||||
[node name="NameLabel" type="Label" parent="PanelContainer/Content/HBoxContainer/VBoxContainer"]
|
||||
auto_translate_mode = 2
|
||||
layout_mode = 2
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/Content/HBoxContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="TowerButton" type="Button" parent="PanelContainer/Content/HBoxContainer/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "BUTTON_VIEW_TOWER"
|
||||
|
||||
[node name="WeaponButton" type="Button" parent="PanelContainer/Content/HBoxContainer/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "BUTTON_VIEW_WEAPON"
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="PanelContainer/Content/HBoxContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="ConfirmButton" type="Button" parent="PanelContainer/Content/HBoxContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
text = "BUTTON_FINALIZE_CARD_CHOICE"
|
||||
|
||||
[node name="DescriptionVBox" parent="PanelContainer/Content/HBoxContainer" instance=ExtResource("2_3npvv")]
|
||||
layout_mode = 2
|
||||
|
||||
[connection signal="pressed" from="PanelContainer/Content/HBoxContainer/VBoxContainer/HBoxContainer/TowerButton" to="." method="choose_side" binds= [true]]
|
||||
[connection signal="pressed" from="PanelContainer/Content/HBoxContainer/VBoxContainer/HBoxContainer/WeaponButton" to="." method="choose_side" binds= [false]]
|
||||
[connection signal="pressed" from="PanelContainer/Content/HBoxContainer/VBoxContainer/ConfirmButton" to="." method="_on_confirm_button_pressed"]
|
||||
BIN
UI/ShieldUI/health-Sheet.png
Normal file
|
After Width: | Height: | Size: 8.5 KiB |
40
UI/ShieldUI/health-Sheet.png.import
Normal file
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://d0yfidlyfyxff"
|
||||
path="res://.godot/imported/health-Sheet.png-0fdb3ca3bd7269341e0271c38f6c9352.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://UI/ShieldUI/health-Sheet.png"
|
||||
dest_files=["res://.godot/imported/health-Sheet.png-0fdb3ca3bd7269341e0271c38f6c9352.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
BIN
UI/ShieldUI/health_border.png
Normal file
|
After Width: | Height: | Size: 779 B |
40
UI/ShieldUI/health_border.png.import
Normal file
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bv3alwpq8esky"
|
||||
path="res://.godot/imported/health_border.png-99006dff11f73b4b2477bea9384c83e2.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://UI/ShieldUI/health_border.png"
|
||||
dest_files=["res://.godot/imported/health_border.png-99006dff11f73b4b2477bea9384c83e2.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
BIN
UI/ShieldUI/health_hit-Sheet.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
40
UI/ShieldUI/health_hit-Sheet.png.import
Normal file
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bifqfvhsu4c2f"
|
||||
path="res://.godot/imported/health_hit-Sheet.png-dc664b62759c22b42d5c36a63bd92934.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://UI/ShieldUI/health_hit-Sheet.png"
|
||||
dest_files=["res://.godot/imported/health_hit-Sheet.png-dc664b62759c22b42d5c36a63bd92934.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
62
UI/ShieldUI/shield_ui.gd
Normal file
@@ -0,0 +1,62 @@
|
||||
class_name ShieldUI
|
||||
extends Control
|
||||
|
||||
@export var cells: Array[TextureRect] = []
|
||||
@export var hit_glow: TextureRect
|
||||
@export var fade_timer: Timer
|
||||
|
||||
const CELL_HEALTH: int = 9
|
||||
|
||||
var health: int = 144
|
||||
var current_cell_health: int = CELL_HEALTH
|
||||
var fade_tween: Tween
|
||||
|
||||
|
||||
func take_damage(damage: int) -> void:
|
||||
if fade_tween:
|
||||
fade_tween.kill()
|
||||
fade_tween = null
|
||||
modulate = Color.WHITE
|
||||
var damage_to_deal_with: int = min(damage, current_cell_health)
|
||||
var remaining_damage: int = damage - damage_to_deal_with
|
||||
var current_cell: int = ceili(float(health) / CELL_HEALTH)
|
||||
health -= damage_to_deal_with
|
||||
current_cell_health -= damage_to_deal_with
|
||||
var cell_level: int = health % 9
|
||||
if remaining_damage > 0: ## This cell should be empty because the damage overran the cell
|
||||
cell_level = 3
|
||||
current_cell_health = CELL_HEALTH
|
||||
change_cell_color(current_cell - 1, cell_level)
|
||||
take_damage(remaining_damage)
|
||||
return
|
||||
elif current_cell_health == 0:
|
||||
cell_level = 3
|
||||
current_cell_health = CELL_HEALTH
|
||||
elif cell_level > 0 and cell_level <= 3: ## This cell should be low health
|
||||
cell_level = 2
|
||||
elif cell_level > 3 and cell_level <= 6: ## This cell should be half health
|
||||
cell_level = 1
|
||||
else: ## This cell should be full health
|
||||
cell_level = 0
|
||||
hit_glow.texture.region.position.x = 66.0 * (16 - current_cell)
|
||||
var tween: Tween = create_tween()
|
||||
tween.tween_callback(func() -> void: hit_glow.visible = true)
|
||||
tween.tween_interval(0.07)
|
||||
tween.tween_callback(func() -> void: hit_glow.visible = false)
|
||||
tween.tween_interval(0.07)
|
||||
tween.tween_callback(func() -> void: hit_glow.visible = true)
|
||||
tween.tween_callback(change_cell_color.bind(current_cell - 1, cell_level))
|
||||
tween.tween_interval(0.07)
|
||||
tween.tween_callback(func() -> void: hit_glow.visible = false)
|
||||
fade_timer.start()
|
||||
|
||||
|
||||
func change_cell_color(cell: int, color: int) -> void:
|
||||
cells[15 - cell].texture.region.position.x = 66.0 * color
|
||||
|
||||
|
||||
func fade_out() -> void:
|
||||
if fade_tween:
|
||||
fade_tween.kill()
|
||||
fade_tween = create_tween()
|
||||
fade_tween.tween_property(self, "modulate", Color8(255, 255, 255, 0), 1.0)
|
||||
1
UI/ShieldUI/shield_ui.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://kiivev1q63p0
|
||||
201
UI/ShieldUI/shield_ui.tscn
Normal file
@@ -0,0 +1,201 @@
|
||||
[gd_scene load_steps=22 format=3 uid="uid://cqslp83lf0ku0"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://kiivev1q63p0" path="res://UI/ShieldUI/shield_ui.gd" id="1_aa64g"]
|
||||
[ext_resource type="Texture2D" uid="uid://bv3alwpq8esky" path="res://UI/ShieldUI/health_border.png" id="2_lvnxo"]
|
||||
[ext_resource type="Texture2D" uid="uid://d0yfidlyfyxff" path="res://UI/ShieldUI/health-Sheet.png" id="3_uoync"]
|
||||
[ext_resource type="Texture2D" uid="uid://bifqfvhsu4c2f" path="res://UI/ShieldUI/health_hit-Sheet.png" id="4_yanml"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_5gv4u"]
|
||||
atlas = ExtResource("3_uoync")
|
||||
region = Rect2(0, 0, 66, 66)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ye2cs"]
|
||||
atlas = ExtResource("3_uoync")
|
||||
region = Rect2(0, 66, 66, 66)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_gmtb0"]
|
||||
atlas = ExtResource("3_uoync")
|
||||
region = Rect2(0, 132, 66, 66)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ylmjw"]
|
||||
atlas = ExtResource("3_uoync")
|
||||
region = Rect2(0, 198, 66, 66)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ulao6"]
|
||||
atlas = ExtResource("3_uoync")
|
||||
region = Rect2(0, 264, 66, 66)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_usluy"]
|
||||
atlas = ExtResource("3_uoync")
|
||||
region = Rect2(0, 330, 66, 66)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_kgv6k"]
|
||||
atlas = ExtResource("3_uoync")
|
||||
region = Rect2(0, 396, 66, 66)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ymret"]
|
||||
atlas = ExtResource("3_uoync")
|
||||
region = Rect2(0, 462, 66, 66)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_d35xv"]
|
||||
atlas = ExtResource("3_uoync")
|
||||
region = Rect2(0, 528, 66, 66)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_yyjyl"]
|
||||
atlas = ExtResource("3_uoync")
|
||||
region = Rect2(0, 594, 66, 66)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_p3fdm"]
|
||||
atlas = ExtResource("3_uoync")
|
||||
region = Rect2(0, 660, 66, 66)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_2xxhe"]
|
||||
atlas = ExtResource("3_uoync")
|
||||
region = Rect2(0, 726, 66, 66)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_8cwn3"]
|
||||
atlas = ExtResource("3_uoync")
|
||||
region = Rect2(0, 792, 66, 66)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_q14re"]
|
||||
atlas = ExtResource("3_uoync")
|
||||
region = Rect2(0, 858, 66, 66)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_nmmm8"]
|
||||
atlas = ExtResource("3_uoync")
|
||||
region = Rect2(0, 924, 66, 66)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_vp71v"]
|
||||
atlas = ExtResource("3_uoync")
|
||||
region = Rect2(0, 990, 66, 66)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_slxus"]
|
||||
atlas = ExtResource("4_yanml")
|
||||
region = Rect2(0, 0, 66, 66)
|
||||
|
||||
[node name="ShieldUI" type="Control" node_paths=PackedStringArray("cells", "hit_glow", "fade_timer")]
|
||||
modulate = Color(1, 1, 1, 0)
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
script = ExtResource("1_aa64g")
|
||||
cells = [NodePath("Border/Cell1"), NodePath("Border/Cell2"), NodePath("Border/Cell3"), NodePath("Border/Cell4"), NodePath("Border/Cell5"), NodePath("Border/Cell6"), NodePath("Border/Cell7"), NodePath("Border/Cell8"), NodePath("Border/Cell9"), NodePath("Border/Cell10"), NodePath("Border/Cell11"), NodePath("Border/Cell12"), NodePath("Border/Cell13"), NodePath("Border/Cell14"), NodePath("Border/Cell15"), NodePath("Border/Cell16")]
|
||||
hit_glow = NodePath("HitGlow")
|
||||
fade_timer = NodePath("Timer")
|
||||
|
||||
[node name="Border" type="TextureRect" parent="."]
|
||||
layout_mode = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
texture = ExtResource("2_lvnxo")
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Cell1" type="TextureRect" parent="Border"]
|
||||
layout_mode = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
texture = SubResource("AtlasTexture_5gv4u")
|
||||
|
||||
[node name="Cell2" type="TextureRect" parent="Border"]
|
||||
layout_mode = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
texture = SubResource("AtlasTexture_ye2cs")
|
||||
|
||||
[node name="Cell3" type="TextureRect" parent="Border"]
|
||||
layout_mode = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
texture = SubResource("AtlasTexture_gmtb0")
|
||||
|
||||
[node name="Cell4" type="TextureRect" parent="Border"]
|
||||
layout_mode = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
texture = SubResource("AtlasTexture_ylmjw")
|
||||
|
||||
[node name="Cell5" type="TextureRect" parent="Border"]
|
||||
layout_mode = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
texture = SubResource("AtlasTexture_ulao6")
|
||||
|
||||
[node name="Cell6" type="TextureRect" parent="Border"]
|
||||
layout_mode = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
texture = SubResource("AtlasTexture_usluy")
|
||||
|
||||
[node name="Cell7" type="TextureRect" parent="Border"]
|
||||
layout_mode = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
texture = SubResource("AtlasTexture_kgv6k")
|
||||
|
||||
[node name="Cell8" type="TextureRect" parent="Border"]
|
||||
layout_mode = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
texture = SubResource("AtlasTexture_ymret")
|
||||
|
||||
[node name="Cell9" type="TextureRect" parent="Border"]
|
||||
layout_mode = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
texture = SubResource("AtlasTexture_d35xv")
|
||||
|
||||
[node name="Cell10" type="TextureRect" parent="Border"]
|
||||
layout_mode = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
texture = SubResource("AtlasTexture_yyjyl")
|
||||
|
||||
[node name="Cell11" type="TextureRect" parent="Border"]
|
||||
layout_mode = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
texture = SubResource("AtlasTexture_p3fdm")
|
||||
|
||||
[node name="Cell12" type="TextureRect" parent="Border"]
|
||||
layout_mode = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
texture = SubResource("AtlasTexture_2xxhe")
|
||||
|
||||
[node name="Cell13" type="TextureRect" parent="Border"]
|
||||
layout_mode = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
texture = SubResource("AtlasTexture_8cwn3")
|
||||
|
||||
[node name="Cell14" type="TextureRect" parent="Border"]
|
||||
layout_mode = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
texture = SubResource("AtlasTexture_q14re")
|
||||
|
||||
[node name="Cell15" type="TextureRect" parent="Border"]
|
||||
layout_mode = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
texture = SubResource("AtlasTexture_nmmm8")
|
||||
|
||||
[node name="Cell16" type="TextureRect" parent="Border"]
|
||||
layout_mode = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
texture = SubResource("AtlasTexture_vp71v")
|
||||
|
||||
[node name="HitGlow" type="TextureRect" parent="."]
|
||||
visible = false
|
||||
modulate = Color(1, 1, 1, 0.8)
|
||||
layout_mode = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
texture = SubResource("AtlasTexture_slxus")
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Timer" type="Timer" parent="."]
|
||||
wait_time = 2.0
|
||||
one_shot = true
|
||||
|
||||
[connection signal="timeout" from="Timer" to="." method="fade_out"]
|
||||
18
UI/Themes/Scale1/button_disabled.tres
Normal file
@@ -0,0 +1,18 @@
|
||||
[gd_resource type="StyleBoxTexture" load_steps=3 format=3 uid="uid://doxcjij1w2ot7"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://b5h32okh8yu6f" path="res://ui_atlas.png" id="1_ychim"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_amp6b"]
|
||||
atlas = ExtResource("1_ychim")
|
||||
region = Rect2(0, 10, 9, 9)
|
||||
|
||||
[resource]
|
||||
texture = SubResource("AtlasTexture_amp6b")
|
||||
texture_margin_left = 3.0
|
||||
texture_margin_top = 3.0
|
||||
texture_margin_right = 3.0
|
||||
texture_margin_bottom = 3.0
|
||||
expand_margin_left = 2.0
|
||||
expand_margin_top = 1.0
|
||||
expand_margin_right = 1.0
|
||||
expand_margin_bottom = 1.0
|
||||
18
UI/Themes/Scale1/button_focus.tres
Normal file
@@ -0,0 +1,18 @@
|
||||
[gd_resource type="StyleBoxTexture" load_steps=3 format=3 uid="uid://buu2yn08s4wc7"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://b5h32okh8yu6f" path="res://ui_atlas.png" id="1_axkac"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_xobyj"]
|
||||
atlas = ExtResource("1_axkac")
|
||||
region = Rect2(10, 10, 9, 9)
|
||||
|
||||
[resource]
|
||||
texture = SubResource("AtlasTexture_xobyj")
|
||||
texture_margin_left = 3.0
|
||||
texture_margin_top = 3.0
|
||||
texture_margin_right = 3.0
|
||||
texture_margin_bottom = 3.0
|
||||
expand_margin_left = 2.0
|
||||
expand_margin_top = 1.0
|
||||
expand_margin_right = 1.0
|
||||
expand_margin_bottom = 1.0
|
||||
18
UI/Themes/Scale1/button_hover.tres
Normal file
@@ -0,0 +1,18 @@
|
||||
[gd_resource type="StyleBoxTexture" load_steps=3 format=3 uid="uid://srk2hghxkb70"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://b5h32okh8yu6f" path="res://ui_atlas.png" id="1_x020y"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_kt4jn"]
|
||||
atlas = ExtResource("1_x020y")
|
||||
region = Rect2(10, 0, 9, 9)
|
||||
|
||||
[resource]
|
||||
texture = SubResource("AtlasTexture_kt4jn")
|
||||
texture_margin_left = 3.0
|
||||
texture_margin_top = 3.0
|
||||
texture_margin_right = 3.0
|
||||
texture_margin_bottom = 3.0
|
||||
expand_margin_left = 2.0
|
||||
expand_margin_top = 1.0
|
||||
expand_margin_right = 1.0
|
||||
expand_margin_bottom = 1.0
|
||||
18
UI/Themes/Scale1/button_normal.tres
Normal file
@@ -0,0 +1,18 @@
|
||||
[gd_resource type="StyleBoxTexture" load_steps=3 format=3 uid="uid://esvjdvqih123"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://b5h32okh8yu6f" path="res://ui_atlas.png" id="1_rwyhh"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_s7nl3"]
|
||||
atlas = ExtResource("1_rwyhh")
|
||||
region = Rect2(0, 0, 9, 9)
|
||||
|
||||
[resource]
|
||||
texture = SubResource("AtlasTexture_s7nl3")
|
||||
texture_margin_left = 3.0
|
||||
texture_margin_top = 3.0
|
||||
texture_margin_right = 3.0
|
||||
texture_margin_bottom = 3.0
|
||||
expand_margin_left = 2.0
|
||||
expand_margin_top = 1.0
|
||||
expand_margin_right = 1.0
|
||||
expand_margin_bottom = 1.0
|
||||
18
UI/Themes/Scale1/button_pressed.tres
Normal file
@@ -0,0 +1,18 @@
|
||||
[gd_resource type="StyleBoxTexture" load_steps=3 format=3 uid="uid://bfqarik7bi544"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://b5h32okh8yu6f" path="res://ui_atlas.png" id="1_u0q6f"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_a57sn"]
|
||||
atlas = ExtResource("1_u0q6f")
|
||||
region = Rect2(20, 0, 9, 9)
|
||||
|
||||
[resource]
|
||||
texture = SubResource("AtlasTexture_a57sn")
|
||||
texture_margin_left = 3.0
|
||||
texture_margin_top = 3.0
|
||||
texture_margin_right = 3.0
|
||||
texture_margin_bottom = 3.0
|
||||
expand_margin_left = 2.0
|
||||
expand_margin_top = 1.0
|
||||
expand_margin_right = 1.0
|
||||
expand_margin_bottom = 1.0
|
||||
12
UI/Themes/Scale1/grabber_area.tres
Normal file
@@ -0,0 +1,12 @@
|
||||
[gd_resource type="StyleBoxTexture" load_steps=3 format=3 uid="uid://bss3dp7k18rx0"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://b5h32okh8yu6f" path="res://ui_atlas.png" id="1_ug2go"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_h3qir"]
|
||||
atlas = ExtResource("1_ug2go")
|
||||
region = Rect2(72, 4, 2, 2)
|
||||
|
||||
[resource]
|
||||
texture = SubResource("AtlasTexture_h3qir")
|
||||
axis_stretch_horizontal = 1
|
||||
axis_stretch_vertical = 1
|
||||
10
UI/Themes/Scale1/pane_style_box.tres
Normal file
@@ -0,0 +1,10 @@
|
||||
[gd_resource type="StyleBoxTexture" load_steps=2 format=3 uid="uid://bfuea1sjymo8g"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://b0d2fesjkbawy" path="res://UI/Themes/Scale1/panel_patch.png" id="1_o1mxl"]
|
||||
|
||||
[resource]
|
||||
texture = ExtResource("1_o1mxl")
|
||||
texture_margin_left = 6.0
|
||||
texture_margin_top = 6.0
|
||||
texture_margin_right = 6.0
|
||||
texture_margin_bottom = 6.0
|
||||
BIN
UI/Themes/Scale1/panel_patch.png
Normal file
|
After Width: | Height: | Size: 136 B |
40
UI/Themes/Scale1/panel_patch.png.import
Normal file
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://b0d2fesjkbawy"
|
||||
path="res://.godot/imported/panel_patch.png-3e1921fc1569bba0ed194febf3436a04.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://UI/Themes/Scale1/panel_patch.png"
|
||||
dest_files=["res://.godot/imported/panel_patch.png-3e1921fc1569bba0ed194febf3436a04.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
164
UI/Themes/Scale1/psx_ui.tres
Normal file
@@ -0,0 +1,164 @@
|
||||
[gd_resource type="Theme" load_steps=36 format=3 uid="uid://jn4qqx5hxc5i"]
|
||||
|
||||
[ext_resource type="StyleBox" uid="uid://doxcjij1w2ot7" path="res://UI/Themes/Scale1/button_disabled.tres" id="1_ts3pc"]
|
||||
[ext_resource type="StyleBox" uid="uid://buu2yn08s4wc7" path="res://UI/Themes/Scale1/button_focus.tres" id="1_vnhdr"]
|
||||
[ext_resource type="StyleBox" uid="uid://srk2hghxkb70" path="res://UI/Themes/Scale1/button_hover.tres" id="2_ts3pc"]
|
||||
[ext_resource type="StyleBox" uid="uid://esvjdvqih123" path="res://UI/Themes/Scale1/button_normal.tres" id="3_43i8g"]
|
||||
[ext_resource type="StyleBox" uid="uid://bfqarik7bi544" path="res://UI/Themes/Scale1/button_pressed.tres" id="4_845oj"]
|
||||
[ext_resource type="FontFile" uid="uid://bqy8dm2o3piqm" path="res://Assets/Fonts/Quaver v1.0/quaver.ttf" id="5_o6p3e"]
|
||||
[ext_resource type="Texture2D" uid="uid://b5h32okh8yu6f" path="res://ui_atlas.png" id="6_43i8g"]
|
||||
[ext_resource type="StyleBox" uid="uid://bfuea1sjymo8g" path="res://UI/Themes/Scale1/pane_style_box.tres" id="6_w151p"]
|
||||
[ext_resource type="StyleBox" uid="uid://jnnnhb3i2265" path="res://UI/Themes/Scale1/switch_side_b_style_box.tres" id="7_w8nmj"]
|
||||
[ext_resource type="StyleBox" uid="uid://cm3wsvk3woory" path="res://UI/Themes/Scale1/switch_side_a_style_box.tres" id="8_8j1wx"]
|
||||
[ext_resource type="StyleBox" uid="uid://bss3dp7k18rx0" path="res://UI/Themes/Scale1/grabber_area.tres" id="8_o6p3e"]
|
||||
[ext_resource type="StyleBox" uid="uid://bpowvv8e13flg" path="res://UI/Themes/Scale1/slider.tres" id="9_w151p"]
|
||||
[ext_resource type="StyleBox" uid="uid://8s0fgx46n145" path="res://UI/Themes/Scale1/scroll_grabber.tres" id="13_w151p"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_845oj"]
|
||||
atlas = ExtResource("6_43i8g")
|
||||
region = Rect2(30, 1, 15, 8)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_o6p3e"]
|
||||
atlas = ExtResource("6_43i8g")
|
||||
region = Rect2(46, 1, 15, 8)
|
||||
|
||||
[sub_resource type="FontVariation" id="FontVariation_b02pe"]
|
||||
base_font = ExtResource("5_o6p3e")
|
||||
baseline_offset = 0.15
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_w8nmj"]
|
||||
atlas = ExtResource("6_43i8g")
|
||||
region = Rect2(62, 1, 8, 8)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_t2hcr"]
|
||||
atlas = ExtResource("6_43i8g")
|
||||
region = Rect2(79, 1, 8, 8)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_8j1wx"]
|
||||
atlas = ExtResource("6_43i8g")
|
||||
region = Rect2(62, 1, 8, 8)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_w151p"]
|
||||
atlas = ExtResource("6_43i8g")
|
||||
region = Rect2(75, 4, 2, 2)
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_t2hcr"]
|
||||
|
||||
[sub_resource type="FontVariation" id="FontVariation_inyly"]
|
||||
base_font = ExtResource("5_o6p3e")
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_n5i54"]
|
||||
atlas = ExtResource("6_43i8g")
|
||||
region = Rect2(98, 4, 8, 5)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_08ul3"]
|
||||
atlas = ExtResource("6_43i8g")
|
||||
region = Rect2(98, 16, 8, 5)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_b5n6m"]
|
||||
atlas = ExtResource("6_43i8g")
|
||||
region = Rect2(98, 10, 8, 5)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_xqncf"]
|
||||
atlas = ExtResource("6_43i8g")
|
||||
region = Rect2(89, 1, 8, 5)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_nis8m"]
|
||||
atlas = ExtResource("6_43i8g")
|
||||
region = Rect2(89, 13, 8, 5)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_aggbr"]
|
||||
atlas = ExtResource("6_43i8g")
|
||||
region = Rect2(89, 7, 8, 5)
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_o6p3e"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_w151p"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_w8nmj"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_8j1wx"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_ts3pc"]
|
||||
content_margin_top = 2.0
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_okcqu"]
|
||||
atlas = ExtResource("6_43i8g")
|
||||
region = Rect2(62, 10, 8, 8)
|
||||
|
||||
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_qa24s"]
|
||||
texture = SubResource("AtlasTexture_okcqu")
|
||||
texture_margin_left = 4.0
|
||||
texture_margin_top = 2.0
|
||||
texture_margin_right = 4.0
|
||||
texture_margin_bottom = 2.0
|
||||
region_rect = Rect2(0, 0, 8, 8)
|
||||
|
||||
[resource]
|
||||
Button/colors/font_color = Color(0.85490197, 0.8784314, 0.91764706, 1)
|
||||
Button/colors/font_disabled_color = Color(0.85882354, 0.6431373, 0.3882353, 1)
|
||||
Button/colors/font_hover_color = Color(1, 1, 1, 1)
|
||||
Button/colors/font_outline_color = Color(0.023529412, 0.023529412, 0.03137255, 1)
|
||||
Button/styles/disabled = ExtResource("1_ts3pc")
|
||||
Button/styles/focus = ExtResource("1_vnhdr")
|
||||
Button/styles/hover = ExtResource("2_ts3pc")
|
||||
Button/styles/normal = ExtResource("3_43i8g")
|
||||
Button/styles/pressed = ExtResource("4_845oj")
|
||||
CheckButton/icons/checked = SubResource("AtlasTexture_845oj")
|
||||
CheckButton/icons/unchecked = SubResource("AtlasTexture_o6p3e")
|
||||
Control/constants/outline_size = 4
|
||||
Control/font_sizes/font_size = 8
|
||||
Control/fonts/font = SubResource("FontVariation_b02pe")
|
||||
HSlider/icons/grabber = SubResource("AtlasTexture_w8nmj")
|
||||
HSlider/icons/grabber_disabled = SubResource("AtlasTexture_t2hcr")
|
||||
HSlider/icons/grabber_highlight = SubResource("AtlasTexture_8j1wx")
|
||||
HSlider/icons/tick = SubResource("AtlasTexture_w151p")
|
||||
HSlider/styles/grabber_area = ExtResource("8_o6p3e")
|
||||
HSlider/styles/grabber_area_highlight = ExtResource("8_o6p3e")
|
||||
HSlider/styles/slider = ExtResource("9_w151p")
|
||||
InteractLabel/base_type = &"Label"
|
||||
Label/font_sizes/font_size = 8
|
||||
Label/fonts/font = ExtResource("5_o6p3e")
|
||||
LineEdit/styles/focus = ExtResource("1_vnhdr")
|
||||
LineEdit/styles/normal = SubResource("StyleBoxEmpty_t2hcr")
|
||||
PanelContainer/styles/panel = ExtResource("6_w151p")
|
||||
PopupMenu/constants/outline_size = 4
|
||||
PopupMenu/font_sizes/font_size = 8
|
||||
PopupMenu/fonts/font = SubResource("FontVariation_inyly")
|
||||
PopupMenu/styles/panel = ExtResource("6_w151p")
|
||||
RichTextLabel/font_sizes/normal_font_size = 8
|
||||
RichTextLabel/fonts/normal_font = ExtResource("5_o6p3e")
|
||||
SideCheckButton/base_type = &"Button"
|
||||
SideCheckButton/colors/font_color = Color(0.8392157, 0.8392157, 0.8392157, 1)
|
||||
SideCheckButton/colors/font_hover_color = Color(1, 1, 1, 1)
|
||||
SideCheckButton/colors/font_hover_pressed_color = Color(1, 1, 1, 1)
|
||||
SideCheckButton/colors/font_pressed_color = Color(0.8392157, 0.8392157, 0.8392157, 1)
|
||||
SideCheckButton/styles/hover = ExtResource("7_w8nmj")
|
||||
SideCheckButton/styles/hover_pressed = ExtResource("8_8j1wx")
|
||||
SideCheckButton/styles/normal = ExtResource("7_w8nmj")
|
||||
SideCheckButton/styles/pressed = ExtResource("8_8j1wx")
|
||||
SpinBox/icons/down = SubResource("AtlasTexture_n5i54")
|
||||
SpinBox/icons/down_disabled = SubResource("AtlasTexture_08ul3")
|
||||
SpinBox/icons/down_hover = SubResource("AtlasTexture_b5n6m")
|
||||
SpinBox/icons/up = SubResource("AtlasTexture_xqncf")
|
||||
SpinBox/icons/up_disabled = SubResource("AtlasTexture_nis8m")
|
||||
SpinBox/icons/up_hover = SubResource("AtlasTexture_aggbr")
|
||||
SpinBox/styles/down_background_hovered = SubResource("StyleBoxEmpty_o6p3e")
|
||||
SpinBox/styles/down_background_pressed = SubResource("StyleBoxEmpty_w151p")
|
||||
SpinBox/styles/up_background_hovered = SubResource("StyleBoxEmpty_w8nmj")
|
||||
SpinBox/styles/up_background_pressed = SubResource("StyleBoxEmpty_8j1wx")
|
||||
StartWaveLabel/base_type = &"Label"
|
||||
TabContainer/constants/tab_separation = 6
|
||||
TabContainer/styles/panel = SubResource("StyleBoxEmpty_ts3pc")
|
||||
TabContainer/styles/tab_disabled = ExtResource("1_ts3pc")
|
||||
TabContainer/styles/tab_focus = ExtResource("1_vnhdr")
|
||||
TabContainer/styles/tab_hovered = ExtResource("2_ts3pc")
|
||||
TabContainer/styles/tab_selected = ExtResource("4_845oj")
|
||||
TabContainer/styles/tab_unselected = ExtResource("3_43i8g")
|
||||
VScrollBar/styles/grabber = ExtResource("13_w151p")
|
||||
VScrollBar/styles/grabber_highlight = ExtResource("13_w151p")
|
||||
VScrollBar/styles/grabber_pressed = ExtResource("13_w151p")
|
||||
VScrollBar/styles/scroll = SubResource("StyleBoxTexture_qa24s")
|
||||
VersionLabel/base_type = &"Label"
|
||||
VersionLabel/colors/font_color = Color(0.85, 0.85, 0.85, 0.7)
|
||||
VersionLabel/font_sizes/font_size = 8
|
||||
15
UI/Themes/Scale1/scroll_grabber.tres
Normal file
@@ -0,0 +1,15 @@
|
||||
[gd_resource type="StyleBoxTexture" load_steps=3 format=3 uid="uid://8s0fgx46n145"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://b5h32okh8yu6f" path="res://ui_atlas.png" id="1_pfcbc"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_noue1"]
|
||||
atlas = ExtResource("1_pfcbc")
|
||||
region = Rect2(62, 1, 8, 8)
|
||||
|
||||
[resource]
|
||||
texture = SubResource("AtlasTexture_noue1")
|
||||
texture_margin_top = 2.0
|
||||
texture_margin_bottom = 2.0
|
||||
expand_margin_top = 2.0
|
||||
expand_margin_bottom = 2.0
|
||||
region_rect = Rect2(0, 0, 8, 8)
|
||||
BIN
UI/Themes/Scale1/sidea_patch.png
Normal file
|
After Width: | Height: | Size: 215 B |
40
UI/Themes/Scale1/sidea_patch.png.import
Normal file
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cp3yr2676jkjx"
|
||||
path="res://.godot/imported/sidea_patch.png-e6077b21c815d458b1ba03ab43740b9a.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://UI/Themes/Scale1/sidea_patch.png"
|
||||
dest_files=["res://.godot/imported/sidea_patch.png-e6077b21c815d458b1ba03ab43740b9a.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
BIN
UI/Themes/Scale1/sideb_patch.png
Normal file
|
After Width: | Height: | Size: 212 B |
40
UI/Themes/Scale1/sideb_patch.png.import
Normal file
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bm3a5gkj0spil"
|
||||
path="res://.godot/imported/sideb_patch.png-b275a8e31a250f45a054c6126dd65805.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://UI/Themes/Scale1/sideb_patch.png"
|
||||
dest_files=["res://.godot/imported/sideb_patch.png-b275a8e31a250f45a054c6126dd65805.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
13
UI/Themes/Scale1/slider.tres
Normal file
@@ -0,0 +1,13 @@
|
||||
[gd_resource type="StyleBoxTexture" load_steps=3 format=3 uid="uid://bpowvv8e13flg"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://b5h32okh8yu6f" path="res://ui_atlas.png" id="1_85syk"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_uj2su"]
|
||||
atlas = ExtResource("1_85syk")
|
||||
region = Rect2(75, 4, 2, 2)
|
||||
|
||||
[resource]
|
||||
content_margin_top = 2.0
|
||||
texture = SubResource("AtlasTexture_uj2su")
|
||||
axis_stretch_horizontal = 1
|
||||
axis_stretch_vertical = 1
|
||||
10
UI/Themes/Scale1/switch_side_a_style_box.tres
Normal file
@@ -0,0 +1,10 @@
|
||||
[gd_resource type="StyleBoxTexture" load_steps=2 format=3 uid="uid://cm3wsvk3woory"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://cp3yr2676jkjx" path="res://UI/Themes/Scale1/sidea_patch.png" id="1_bunl1"]
|
||||
|
||||
[resource]
|
||||
texture = ExtResource("1_bunl1")
|
||||
texture_margin_left = 5.0
|
||||
texture_margin_top = 5.0
|
||||
texture_margin_right = 10.0
|
||||
texture_margin_bottom = 5.0
|
||||
10
UI/Themes/Scale1/switch_side_b_style_box.tres
Normal file
@@ -0,0 +1,10 @@
|
||||
[gd_resource type="StyleBoxTexture" load_steps=2 format=3 uid="uid://jnnnhb3i2265"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://bm3a5gkj0spil" path="res://UI/Themes/Scale1/sideb_patch.png" id="1_f68ef"]
|
||||
|
||||
[resource]
|
||||
texture = ExtResource("1_f68ef")
|
||||
texture_margin_left = 10.0
|
||||
texture_margin_top = 5.0
|
||||
texture_margin_right = 5.0
|
||||
texture_margin_bottom = 5.0
|
||||