more work on the ui theme and changing the hud
This commit is contained in:
@@ -63,3 +63,4 @@ func swap_to_slot(num: int) -> void:
|
||||
if hero.hand.size >= num:
|
||||
hero.hand_selected_index = num - 1
|
||||
hero.swap_card_audio.play()
|
||||
hero.hud.hot_wheel.update_cassettes(hero.get_wheel_cards())
|
||||
|
||||
@@ -15,8 +15,9 @@ func enter_state() -> void:
|
||||
hero.weapons[hero.equipped_weapon].current_energy = hero.weapons[hero.equipped_weapon].max_energy
|
||||
#this had to be commented out coz the new energy bar thinks "energy changed" is "energy used"
|
||||
#weapons[equipped_weapon].energy_changed.emit(weapons[equipped_weapon].current_energy)
|
||||
for x: int in hero.hand.contents.size():
|
||||
hero.discard_pile.add(hero.hand.remove_at(hero.hand.contents.size() - 1))
|
||||
if hero.game_manager.card_gameplay:
|
||||
for x: int in hero.hand.contents.size():
|
||||
hero.discard_pile.add(hero.hand.remove_at(hero.hand.contents.size() - 1))
|
||||
hero.weapon_swap_timer.start()
|
||||
hero.hud.energy_label.visible = false
|
||||
|
||||
|
||||
57
PCs/hero.gd
57
PCs/hero.gd
@@ -15,7 +15,6 @@ signal ready_state_changed(state: bool)
|
||||
@export var draw_pile: Inventory
|
||||
@export var hand: Inventory
|
||||
@export var discard_pile: Inventory
|
||||
@export var gauntlet_cards: Array[CardInHand]
|
||||
@export var pause_menu_scene: PackedScene
|
||||
@export var hud: HUD
|
||||
@export var movement: PlayerMovement
|
||||
@@ -41,7 +40,7 @@ signal ready_state_changed(state: bool)
|
||||
|
||||
var current_state: HeroState
|
||||
var pre_fighting_state: HeroState
|
||||
var hand_card_scene: PackedScene = preload("res://Scenes/UI/card_hand.tscn")
|
||||
var hand_card_scene: PackedScene = preload("res://UI/card_hand.tscn")
|
||||
var card_sprites: Array[CardInHand]
|
||||
var game_manager: GameManager
|
||||
var hovering_item: InteractButton = null
|
||||
@@ -184,6 +183,7 @@ func increment_selected() -> void:
|
||||
hand_selected_index += 1
|
||||
if hand_selected_index >= hand.size:
|
||||
hand_selected_index = 0
|
||||
hud.hot_wheel.update_cassettes(get_wheel_cards())
|
||||
|
||||
|
||||
func decrement_selected() -> void:
|
||||
@@ -193,20 +193,43 @@ func decrement_selected() -> void:
|
||||
hand_selected_index -= 1
|
||||
if hand_selected_index < 0:
|
||||
hand_selected_index = hand.size - 1
|
||||
hud.hot_wheel.update_cassettes(get_wheel_cards())
|
||||
|
||||
|
||||
func get_wheel_cards() -> Array[Card]:
|
||||
var wheel_cards: Array[Card] = []
|
||||
if hand.size > 0:
|
||||
wheel_cards.append(hand.contents[hand_selected_index])
|
||||
var left_searches: int = floori((min(5, hand.size) - 1) / 2.0)
|
||||
var right_searches: int = ceili((min(5, hand.size) - 1) / 2.0)
|
||||
while left_searches > 0 or right_searches > 0:
|
||||
for x: int in left_searches:
|
||||
if hand_selected_index - (x + 1) >= 0:
|
||||
wheel_cards.append(hand.contents[hand_selected_index - (x + 1)])
|
||||
left_searches -= 1
|
||||
else:
|
||||
right_searches += left_searches
|
||||
left_searches = 0
|
||||
for x: int in right_searches:
|
||||
if hand_selected_index + (x + 1) < hand.size:
|
||||
wheel_cards.append(hand.contents[hand_selected_index + (x + 1)])
|
||||
right_searches -= 1
|
||||
else:
|
||||
left_searches += right_searches
|
||||
right_searches = 0
|
||||
return wheel_cards
|
||||
|
||||
|
||||
|
||||
func set_card_elements_visibility(value: bool) -> void:
|
||||
if value:
|
||||
hud.show_hot_wheel()
|
||||
hud.hot_wheel.update_cassettes(get_wheel_cards())
|
||||
hud.show_slots()
|
||||
else:
|
||||
hud.hide_hot_wheel()
|
||||
hud.hide_slots()
|
||||
$FirstPersonViewport/Head2/LeftHand.visible = value
|
||||
$HUD/PlaceIcon.visible = value
|
||||
$HUD/SwapIcon.visible = value
|
||||
if cards[0]:
|
||||
$HUD/PlaceIcon.visible = false
|
||||
if cards[1]:
|
||||
$HUD/SwapIcon.visible = false
|
||||
|
||||
|
||||
func _unhandled_input(event: InputEvent) -> void:
|
||||
@@ -226,8 +249,6 @@ func ready_self() -> void:
|
||||
edit_tool.interact_key_held = false
|
||||
if !ready_state:
|
||||
ready_state = true
|
||||
hud.place_icon.set_visible(false)
|
||||
hud.swap_icon.set_visible(false)
|
||||
hud.shrink_wave_start_label()
|
||||
ready_audio.play()
|
||||
|
||||
@@ -243,6 +264,7 @@ func add_card(new_card: Card) -> void:
|
||||
hand.add(new_card)
|
||||
hud.pickup(new_card)
|
||||
place_card_audio.play()
|
||||
hud.hot_wheel.update_cassettes(get_wheel_cards())
|
||||
|
||||
|
||||
func unpause() -> void:
|
||||
@@ -301,6 +323,8 @@ func equip_weapon(slot: int = 0) -> void:
|
||||
energy -= energy_cost
|
||||
place_card_audio.play()
|
||||
cards[slot] = hand.remove_at(hand.contents.find(selected_card))
|
||||
decrement_selected()
|
||||
hud.hot_wheel.update_cassettes(get_wheel_cards())
|
||||
#card_sprites[hand_selected_index].queue_free()
|
||||
#card_sprites.remove_at(hand_selected_index)
|
||||
if game_manager.card_gameplay:
|
||||
@@ -314,13 +338,10 @@ func equip_weapon(slot: int = 0) -> void:
|
||||
weapons[slot].duration = 1
|
||||
weapons_spawn_count += 1
|
||||
weapons[slot].set_multiplayer_authority(multiplayer.get_unique_id())
|
||||
gauntlet_cards[slot].set_card(cards[slot])
|
||||
if slot == 0:
|
||||
hud.place_icon.visible = false
|
||||
hud.set_primary_button(cards[slot])
|
||||
else:
|
||||
hud.swap_icon.visible = false
|
||||
gauntlet_cards[slot].view_weapon()
|
||||
gauntlet_cards[slot].visible = true
|
||||
hud.set_secondary_button(cards[slot])
|
||||
weapons[slot].set_hero(self)
|
||||
weapons[slot].visible = false
|
||||
right_hand.add_child(weapons[slot])
|
||||
@@ -364,14 +385,14 @@ func _on_timer_timeout() -> void:
|
||||
|
||||
|
||||
func unequip_weapon(slot: int = 0) -> void:
|
||||
gauntlet_cards[slot].visible = false
|
||||
if slot == 0:
|
||||
hud.place_icon.visible = true
|
||||
hud.set_primary_button(null)
|
||||
else:
|
||||
hud.swap_icon.visible = true
|
||||
hud.set_secondary_button(null)
|
||||
weapons[slot].queue_free()
|
||||
weapons[slot] = null
|
||||
if !game_manager.card_gameplay:
|
||||
add_card(cards[slot])
|
||||
cards[slot] = null
|
||||
place_card_audio.play()
|
||||
hud.hot_wheel.update_cassettes(get_wheel_cards())
|
||||
|
||||
210
PCs/hero.tscn
210
PCs/hero.tscn
@@ -1,12 +1,11 @@
|
||||
[gd_scene load_steps=69 format=3 uid="uid://dxgxbtf68lcv5"]
|
||||
[gd_scene load_steps=67 format=3 uid="uid://dxgxbtf68lcv5"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://1fqpoegbdm6n" path="res://PCs/hero.gd" id="1_pihpe"]
|
||||
[ext_resource type="Resource" uid="uid://b5pc3frhx467q" path="res://Classes/Engineer/class.tres" id="2_dbyo0"]
|
||||
[ext_resource type="PackedScene" uid="uid://ri8r03wqy80t" path="res://Scenes/8_direction_sprite.tscn" id="2_ib0t5"]
|
||||
[ext_resource type="PackedScene" uid="uid://buvgdem68wtev" path="res://Scenes/Menus/PauseMenu/pause_menu.tscn" id="3_avnsx"]
|
||||
[ext_resource type="PackedScene" uid="uid://buvgdem68wtev" path="res://UI/Menus/PauseMenu/pause_menu.tscn" id="3_avnsx"]
|
||||
[ext_resource type="PackedScene" uid="uid://n8ab1cy7ordc" path="res://card_model/3d_card.tscn" id="4_2mqvj"]
|
||||
[ext_resource type="Script" uid="uid://cij76at0nbs1v" path="res://PCs/view_movement.gd" id="4_mhexa"]
|
||||
[ext_resource type="PackedScene" uid="uid://dixtx38u4jhd7" path="res://Scenes/UI/card_hand.tscn" id="4_mwtvp"]
|
||||
[ext_resource type="PackedScene" uid="uid://gdd1xupf4oxx" path="res://UI/CardSelectionBox/card_selection_box.tscn" id="5_h82f6"]
|
||||
[ext_resource type="PackedScene" uid="uid://dqt1ggtkpkuhs" path="res://PCs/PathEditTool/path_edit_tool.tscn" id="5_jlxb3"]
|
||||
[ext_resource type="Script" uid="uid://do24iuot0j7d7" path="res://Scripts/inventory.gd" id="6_cf5ap"]
|
||||
@@ -20,10 +19,10 @@
|
||||
[ext_resource type="Texture2D" uid="uid://c60fh34ttgcvh" path="res://Assets/Textures/minimap_player.png" id="15_nhlam"]
|
||||
[ext_resource type="Texture2D" uid="uid://chhmkmlfrobhu" path="res://Assets/Textures/bubble.png" id="15_q3yot"]
|
||||
[ext_resource type="Texture2D" uid="uid://cqnapc8cscl7i" path="res://Assets/Textures/border.png" id="16_x1xjr"]
|
||||
[ext_resource type="PackedScene" uid="uid://chnj376d3lcjd" path="res://Scenes/UI/pickup_notification.tscn" id="17_oyeww"]
|
||||
[ext_resource type="PackedScene" uid="uid://chnj376d3lcjd" path="res://UI/pickup_notification.tscn" id="17_oyeww"]
|
||||
[ext_resource type="PackedScene" uid="uid://d17c77pqsi8oy" path="res://UI/EnemyCard/enemy_card_ui.tscn" id="18_dfkac"]
|
||||
[ext_resource type="Texture2D" uid="uid://cvjcu3hofahr6" path="res://Assets/Textures/place_slot.png" id="18_okmpi"]
|
||||
[ext_resource type="Script" uid="uid://b5wle8f6rv3e7" path="res://PCs/player_movement.gd" id="20_cfhw8"]
|
||||
[ext_resource type="Texture2D" uid="uid://deelc254ct7ae" path="res://Assets/Textures/place_icon.png" id="22_o55s8"]
|
||||
[ext_resource type="AudioStream" uid="uid://csu2hce4bfoki" path="res://Audio/cardPlace1.ogg" id="24_8ch4w"]
|
||||
[ext_resource type="AudioStream" uid="uid://dxq8b77wa41os" path="res://Audio/cardPlace2.ogg" id="25_awl6m"]
|
||||
[ext_resource type="Texture2D" uid="uid://bs2mskoyvyehv" path="res://Assets/Textures/crosshair159.png" id="25_l7gpx"]
|
||||
@@ -36,9 +35,10 @@
|
||||
[ext_resource type="AudioStream" uid="uid://val5n418yebw" path="res://Audio/cardSlide3.ogg" id="30_djhlg"]
|
||||
[ext_resource type="Texture2D" uid="uid://up7omskwg0yx" path="res://Assets/Textures/battery.png" id="30_rim6q"]
|
||||
[ext_resource type="AudioStream" uid="uid://ck6g061w7i6ro" path="res://Audio/cardSlide4.ogg" id="31_546e6"]
|
||||
[ext_resource type="PackedScene" uid="uid://ga21hoa8fxmm" path="res://hot_wheel.tscn" id="31_h1yfy"]
|
||||
[ext_resource type="PackedScene" uid="uid://cqslp83lf0ku0" path="res://shield_ui.tscn" id="31_o55s8"]
|
||||
[ext_resource type="PackedScene" uid="uid://q73cllewm7pj" path="res://energy_pips.tscn" id="32_o55s8"]
|
||||
[ext_resource type="PackedScene" uid="uid://ga21hoa8fxmm" path="res://UI/HotWheelUI/hot_wheel.tscn" id="31_h1yfy"]
|
||||
[ext_resource type="PackedScene" uid="uid://cqslp83lf0ku0" path="res://UI/ShieldUI/shield_ui.tscn" id="31_o55s8"]
|
||||
[ext_resource type="PackedScene" uid="uid://q73cllewm7pj" path="res://UI/EnergyPipUI/energy_pips.tscn" id="32_o55s8"]
|
||||
[ext_resource type="Texture2D" uid="uid://doqfkinrjw4mt" path="res://UI/Enemy_icon.png" id="32_r2yb6"]
|
||||
[ext_resource type="AudioStream" uid="uid://bj8eitlsjdotb" path="res://Audio/cardSlide5.ogg" id="32_tg7y0"]
|
||||
[ext_resource type="AudioStream" uid="uid://d0620p56ad34a" path="res://Audio/cardSlide6.ogg" id="33_2v5co"]
|
||||
[ext_resource type="AudioStream" uid="uid://uvoxbl1fbtu0" path="res://Audio/cardSlide7.ogg" id="34_6acmc"]
|
||||
@@ -59,12 +59,6 @@
|
||||
radius = 0.3
|
||||
height = 1.8
|
||||
|
||||
[sub_resource type="ViewportTexture" id="ViewportTexture_v8f6r"]
|
||||
viewport_path = NodePath("FirstPersonViewport/Head2/LeftHand/SubViewport2")
|
||||
|
||||
[sub_resource type="ViewportTexture" id="ViewportTexture_xme80"]
|
||||
viewport_path = NodePath("FirstPersonViewport/Head2/LeftHand/SubViewport3")
|
||||
|
||||
[sub_resource type="Environment" id="Environment_cilxe"]
|
||||
background_mode = 1
|
||||
background_color = Color(0.282353, 0.615686, 0.278431, 1)
|
||||
@@ -120,7 +114,7 @@ stream_0/stream = ExtResource("36_lsvj8")
|
||||
streams_count = 1
|
||||
stream_0/stream = ExtResource("37_kv1mg")
|
||||
|
||||
[node name="Hero" type="CharacterBody3D" node_paths=PackedStringArray("camera", "gun_camera", "left_hand", "right_hand", "edit_tool", "carding_tool", "sprite", "interaction_raycast", "draw_pile", "hand", "discard_pile", "gauntlet_cards", "hud", "movement", "player_name_tag", "weapon_swap_timer", "editing_states", "fighting_state", "default_state", "ears", "place_card_audio", "swap_card_audio", "ready_audio", "unready_audio", "fullpower_audio", "zeropower_audio", "swap_off_audio", "swap_on_audio")]
|
||||
[node name="Hero" type="CharacterBody3D" node_paths=PackedStringArray("camera", "gun_camera", "left_hand", "right_hand", "edit_tool", "carding_tool", "sprite", "interaction_raycast", "draw_pile", "hand", "discard_pile", "hud", "movement", "player_name_tag", "weapon_swap_timer", "editing_states", "fighting_state", "default_state", "ears", "place_card_audio", "swap_card_audio", "ready_audio", "unready_audio", "fullpower_audio", "zeropower_audio", "swap_off_audio", "swap_on_audio")]
|
||||
collision_layer = 2
|
||||
collision_mask = 37
|
||||
script = ExtResource("1_pihpe")
|
||||
@@ -136,7 +130,6 @@ interaction_raycast = NodePath("ViewMovement/Head/RayCast3D")
|
||||
draw_pile = NodePath("DrawPile")
|
||||
hand = NodePath("Hand")
|
||||
discard_pile = NodePath("DiscardPile")
|
||||
gauntlet_cards = [NodePath("FirstPersonViewport/Head2/LeftHand/SubViewport2/Node2D"), NodePath("FirstPersonViewport/Head2/LeftHand/SubViewport3/Node2D")]
|
||||
pause_menu_scene = ExtResource("3_avnsx")
|
||||
hud = NodePath("HUD")
|
||||
movement = NodePath("PlayerMovement")
|
||||
@@ -214,35 +207,6 @@ weapon_rotation_amount = 0.001
|
||||
|
||||
[node name="LeftHand" type="Node3D" parent="FirstPersonViewport/Head2"]
|
||||
transform = Transform3D(0.235, 0, 0, 0, 0.235, 0, 0, 0, 0.235, -0.645, -0.26, -1.04)
|
||||
visible = false
|
||||
|
||||
[node name="SubViewport2" type="SubViewport" parent="FirstPersonViewport/Head2/LeftHand"]
|
||||
transparent_bg = true
|
||||
render_target_update_mode = 4
|
||||
|
||||
[node name="Node2D" parent="FirstPersonViewport/Head2/LeftHand/SubViewport2" instance=ExtResource("4_mwtvp")]
|
||||
visible = false
|
||||
|
||||
[node name="SubViewport3" type="SubViewport" parent="FirstPersonViewport/Head2/LeftHand"]
|
||||
transparent_bg = true
|
||||
render_target_update_mode = 4
|
||||
|
||||
[node name="Node2D" parent="FirstPersonViewport/Head2/LeftHand/SubViewport3" instance=ExtResource("4_mwtvp")]
|
||||
visible = false
|
||||
|
||||
[node name="Sprite3D2" type="Sprite3D" parent="FirstPersonViewport/Head2/LeftHand"]
|
||||
transform = Transform3D(0.35, 0, 0, 0, 0.35, 0, 0, 0, 0.35, 4.72, -0.145, 1.581)
|
||||
layers = 2
|
||||
sorting_offset = 1.0
|
||||
texture_filter = 0
|
||||
texture = SubResource("ViewportTexture_v8f6r")
|
||||
|
||||
[node name="Sprite3D3" type="Sprite3D" parent="FirstPersonViewport/Head2/LeftHand"]
|
||||
transform = Transform3D(0.35, 0, 0, 0, 0.35, 0, 0, 0, 0.35, 6.01, -0.145, 1.581)
|
||||
layers = 2
|
||||
sorting_offset = 1.0
|
||||
texture_filter = 0
|
||||
texture = SubResource("ViewportTexture_xme80")
|
||||
|
||||
[node name="card_hand_model" parent="FirstPersonViewport/Head2/LeftHand" instance=ExtResource("11_h82f6")]
|
||||
transform = Transform3D(-4.16989, -0.848374, -3.61733e-07, -0.824933, 4.05468, -0.993384, 0.198049, -0.973442, -4.13774, 1.56596, 0.519149, 3.37051)
|
||||
@@ -321,7 +285,7 @@ max_look_up_angle = 80.0
|
||||
enable_jumping = true
|
||||
weapon_holder = NodePath("../FirstPersonViewport/Head2/RightHand")
|
||||
|
||||
[node name="HUD" type="CanvasLayer" parent="." node_paths=PackedStringArray("player", "wave_count", "currency_count", "minimap_outline", "minimap", "minimap_cam", "minimap_viewport", "fps_label", "hover_text", "enemy_sprites", "enemy_counts", "wave_start_label", "place_icon", "swap_icon", "place_text", "swap_text", "energy_label", "blank_cassette_label", "feature_preview", "hot_wheel", "shield_ui", "currencies", "energy_pips")]
|
||||
[node name="HUD" type="CanvasLayer" parent="." node_paths=PackedStringArray("player", "wave_count", "currency_count", "minimap_outline", "minimap", "minimap_cam", "minimap_viewport", "fps_label", "hover_text", "enemy_sprites", "enemy_counts", "wave_start_label", "place_text", "swap_text", "energy_label", "blank_cassette_label", "feature_preview", "hot_wheel", "shield_ui", "currencies", "energy_pips", "enemy_count_label", "primary_button", "secondary_button", "slots")]
|
||||
script = ExtResource("8_yl6ka")
|
||||
player = NodePath("..")
|
||||
wave_count = NodePath("EnemyTracker/WaveCount")
|
||||
@@ -336,10 +300,8 @@ enemy_sprites = [NodePath("EnemyTracker/TextureRect"), NodePath("EnemyTracker/Te
|
||||
enemy_counts = [NodePath("EnemyTracker/TextureRect/Label"), NodePath("EnemyTracker/TextureRect2/Label2"), NodePath("EnemyTracker/TextureRect3/Label3"), NodePath("EnemyTracker/TextureRect4/Label4"), NodePath("EnemyTracker/TextureRect5/Label5")]
|
||||
pickup_notif_scene = ExtResource("17_oyeww")
|
||||
wave_start_label = NodePath("StartWaveLabel")
|
||||
place_icon = NodePath("PlaceIcon")
|
||||
swap_icon = NodePath("SwapIcon")
|
||||
place_text = NodePath("PlaceIcon/RichTextLabel")
|
||||
swap_text = NodePath("SwapIcon/RichTextLabel")
|
||||
place_text = NodePath("VBoxContainer2/HBoxContainer/RichTextLabel")
|
||||
swap_text = NodePath("VBoxContainer2/HBoxContainer2/RichTextLabel")
|
||||
enemy_card_scene = ExtResource("18_dfkac")
|
||||
energy_label = NodePath("Currencies/HBoxContainer/EnergyLabel")
|
||||
blank_cassette_label = NodePath("Currencies/BlankCassetteLabel")
|
||||
@@ -348,6 +310,11 @@ hot_wheel = NodePath("HotWheel")
|
||||
shield_ui = NodePath("ShieldUI")
|
||||
currencies = NodePath("Currencies")
|
||||
energy_pips = NodePath("EnergyPips")
|
||||
enemy_count_label = NodePath("HBoxContainer/Label")
|
||||
primary_button = NodePath("VBoxContainer2/HBoxContainer/Button")
|
||||
secondary_button = NodePath("VBoxContainer2/HBoxContainer2/Button2")
|
||||
null_icon = ExtResource("22_o55s8")
|
||||
slots = NodePath("VBoxContainer2")
|
||||
|
||||
[node name="FirstPersonCam" type="TextureRect" parent="HUD"]
|
||||
anchors_preset = 15
|
||||
@@ -358,60 +325,6 @@ grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
texture = SubResource("ViewportTexture_mk87g")
|
||||
|
||||
[node name="PlaceIcon" type="TextureRect" parent="HUD"]
|
||||
visible = false
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.75
|
||||
anchor_top = 0.95
|
||||
anchor_right = 0.8
|
||||
anchor_bottom = 0.95
|
||||
grow_horizontal = 0
|
||||
grow_vertical = 0
|
||||
mouse_filter = 2
|
||||
texture = ExtResource("18_okmpi")
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="RichTextLabel" type="RichTextLabel" parent="HUD/PlaceIcon"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
bbcode_enabled = true
|
||||
text = "%Primary Fire%"
|
||||
scroll_active = false
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="SwapIcon" type="TextureRect" parent="HUD"]
|
||||
visible = false
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.95
|
||||
anchor_top = 0.95
|
||||
anchor_right = 0.95
|
||||
anchor_bottom = 0.95
|
||||
grow_horizontal = 0
|
||||
grow_vertical = 0
|
||||
mouse_filter = 2
|
||||
texture = ExtResource("18_okmpi")
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="RichTextLabel" type="RichTextLabel" parent="HUD/SwapIcon"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
bbcode_enabled = true
|
||||
text = "%Secondary Fire%"
|
||||
scroll_active = false
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Minimap" type="TextureRect" parent="HUD"]
|
||||
visible = false
|
||||
anchors_preset = 1
|
||||
@@ -452,6 +365,7 @@ horizontal_alignment = 2
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="EnemyTracker" type="TextureRect" parent="HUD"]
|
||||
visible = false
|
||||
texture_filter = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.5
|
||||
@@ -601,19 +515,18 @@ vertical_alignment = 1
|
||||
anchors_preset = 4
|
||||
anchor_top = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = 15.0
|
||||
offset_top = -295.0
|
||||
offset_right = 445.0
|
||||
offset_bottom = -40.0
|
||||
grow_vertical = 0
|
||||
offset_top = -10.0
|
||||
offset_right = 104.0
|
||||
offset_bottom = 10.0
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
alignment = 2
|
||||
|
||||
[node name="StartWaveLabel" type="RichTextLabel" parent="HUD"]
|
||||
anchors_preset = -1
|
||||
anchor_top = 0.261
|
||||
anchor_top = 0.136
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 0.395
|
||||
anchor_bottom = 0.252
|
||||
grow_horizontal = 2
|
||||
mouse_filter = 2
|
||||
bbcode_enabled = true
|
||||
@@ -729,9 +642,9 @@ vertical_alignment = 1
|
||||
visible = false
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.893
|
||||
anchor_top = 0.973
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.893
|
||||
anchor_bottom = 0.973
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
|
||||
@@ -762,6 +675,77 @@ anchor_bottom = 0.97
|
||||
grow_horizontal = 0
|
||||
grow_vertical = 0
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="HUD"]
|
||||
anchors_preset = 5
|
||||
anchor_left = 0.5
|
||||
anchor_right = 0.5
|
||||
offset_left = -20.0
|
||||
offset_right = 20.0
|
||||
offset_bottom = 40.0
|
||||
grow_horizontal = 2
|
||||
rotation = 0.008726646
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="HUD/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
texture = ExtResource("32_r2yb6")
|
||||
stretch_mode = 3
|
||||
|
||||
[node name="Label" type="Label" parent="HUD/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "15"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="VBoxContainer2" type="VBoxContainer" parent="HUD"]
|
||||
visible = false
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.98
|
||||
anchor_top = 0.768
|
||||
anchor_right = 0.98
|
||||
anchor_bottom = 0.768
|
||||
grow_horizontal = 0
|
||||
grow_vertical = 0
|
||||
alignment = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="HUD/VBoxContainer2"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="RichTextLabel" type="RichTextLabel" parent="HUD/VBoxContainer2/HBoxContainer"]
|
||||
custom_minimum_size = Vector2(32, 32)
|
||||
layout_mode = 2
|
||||
mouse_filter = 2
|
||||
bbcode_enabled = true
|
||||
text = "%Primary Fire%"
|
||||
scroll_active = false
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Button" type="Button" parent="HUD/VBoxContainer2/HBoxContainer"]
|
||||
custom_minimum_size = Vector2(32, 32)
|
||||
layout_mode = 2
|
||||
icon = ExtResource("22_o55s8")
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
|
||||
[node name="HBoxContainer2" type="HBoxContainer" parent="HUD/VBoxContainer2"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="RichTextLabel" type="RichTextLabel" parent="HUD/VBoxContainer2/HBoxContainer2"]
|
||||
custom_minimum_size = Vector2(32, 32)
|
||||
layout_mode = 2
|
||||
mouse_filter = 2
|
||||
bbcode_enabled = true
|
||||
text = "%Secondary Fire%"
|
||||
scroll_active = false
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Button2" type="Button" parent="HUD/VBoxContainer2/HBoxContainer2"]
|
||||
custom_minimum_size = Vector2(32, 32)
|
||||
layout_mode = 2
|
||||
icon = ExtResource("22_o55s8")
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
|
||||
[node name="WeaponSwapTimer" type="Timer" parent="."]
|
||||
wait_time = 0.4
|
||||
one_shot = true
|
||||
|
||||
37
PCs/hud.gd
37
PCs/hud.gd
@@ -15,8 +15,6 @@ extends CanvasLayer
|
||||
@export var enemy_counts: Array[Label]
|
||||
@export var pickup_notif_scene: PackedScene
|
||||
@export var wave_start_label: RichTextLabel
|
||||
@export var place_icon: TextureRect
|
||||
@export var swap_icon: TextureRect
|
||||
@export var place_text: RichTextLabel
|
||||
@export var swap_text: RichTextLabel
|
||||
@export var enemy_card_scene: PackedScene
|
||||
@@ -29,12 +27,18 @@ extends CanvasLayer
|
||||
@export var shield_ui: ShieldUI
|
||||
@export var currencies: VBoxContainer
|
||||
@export var energy_pips: EnergyPips
|
||||
@export var enemy_count_label: Label
|
||||
@export var primary_button: Button
|
||||
@export var secondary_button: Button
|
||||
@export var null_icon: Texture
|
||||
@export var slots: VBoxContainer
|
||||
|
||||
var last_lives_count: int = Data.starting_lives
|
||||
var enemy_names: Array[String]
|
||||
var map_anchor: Node3D
|
||||
var cards: Array[EnemyCardUI] = []
|
||||
var feature_preview_tween: Tween
|
||||
var enemy_count: int = 0
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
@@ -52,6 +56,28 @@ func hide_hot_wheel() -> void:
|
||||
hot_wheel.visible = false
|
||||
|
||||
|
||||
func show_slots() -> void:
|
||||
slots.visible = true
|
||||
|
||||
|
||||
func hide_slots() -> void:
|
||||
slots.visible = false
|
||||
|
||||
|
||||
func set_primary_button(card: Card) -> void:
|
||||
if card:
|
||||
primary_button.icon = card.icon
|
||||
else:
|
||||
primary_button.icon = null_icon
|
||||
|
||||
|
||||
func set_secondary_button(card: Card) -> void:
|
||||
if card:
|
||||
secondary_button.icon = card.icon
|
||||
else:
|
||||
secondary_button.icon = null_icon
|
||||
|
||||
|
||||
func set_blank_cassette_count(value: int) -> void:
|
||||
blank_cassette_label.text = str(value)
|
||||
|
||||
@@ -100,6 +126,7 @@ func _process(_delta: float) -> void:
|
||||
|
||||
|
||||
func show_features(cassette: Card) -> void:
|
||||
print("shown features")
|
||||
for child: Node in feature_preview.get_children():
|
||||
child.queue_free()
|
||||
var cols: int = max(cassette.tower_stats.features.size(), cassette.weapon_stats.features.size())
|
||||
@@ -184,9 +211,12 @@ func enemy_count_down(enemy: Enemy) -> void:
|
||||
if num == 0:
|
||||
enemy_counts[index].set_visible(false)
|
||||
enemy_sprites[index].set_visible(false)
|
||||
enemy_count -= 1
|
||||
enemy_count_label.text = str(enemy_count)
|
||||
|
||||
|
||||
func set_upcoming_wave(value: Dictionary) -> void:
|
||||
enemy_count = 0
|
||||
var frame_count: int = 0
|
||||
enemy_names = []
|
||||
var wave: Dictionary = {}
|
||||
@@ -196,6 +226,7 @@ func set_upcoming_wave(value: Dictionary) -> void:
|
||||
if enemy.title == key:
|
||||
new_enemy = enemy
|
||||
wave[new_enemy] = value[key]
|
||||
enemy_count += value[key]
|
||||
for x: int in enemy_sprites.size():
|
||||
enemy_sprites[x].set_visible(false)
|
||||
enemy_counts[x].set_visible(false)
|
||||
@@ -206,6 +237,7 @@ func set_upcoming_wave(value: Dictionary) -> void:
|
||||
enemy_sprites[frame_count].set_visible(true)
|
||||
enemy_counts[frame_count].set_visible(true)
|
||||
frame_count += 1
|
||||
enemy_count_label.text = str(enemy_count)
|
||||
|
||||
|
||||
func set_currency_count(value: int) -> void:
|
||||
@@ -255,7 +287,6 @@ func minimize_minimap() -> void:
|
||||
|
||||
|
||||
func pickup(card: Card) -> void:
|
||||
hot_wheel.add_cassette(card)
|
||||
var notif: PickupNotification = pickup_notif_scene.instantiate()
|
||||
notif.set_card(card)
|
||||
$VBoxContainer.add_child(notif)
|
||||
|
||||
Reference in New Issue
Block a user