diff --git a/Locales/en.mo b/Locales/en.mo index 07c9b9e..6de698d 100644 Binary files a/Locales/en.mo and b/Locales/en.mo differ diff --git a/Locales/en.po b/Locales/en.po index bd9d583..6d50ac4 100644 --- a/Locales/en.po +++ b/Locales/en.po @@ -15,7 +15,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 3.6\n" +"X-Generator: Poedit 3.5\n" #: Scenes/Menus/MainMenu/main_menu.tscn msgid "TITLE_GAME_NAME" @@ -618,6 +618,12 @@ msgstr "REMIX" msgid "PROMPT_REMIX_INTERACT" msgstr "%Interact% Remix Cassette" +msgid "LABEL_REMIX_PRICE" +msgstr "Cost: $" + +msgid "LABEL_REMIX_CURRENCY" +msgstr "Coins: $" + #, fuzzy #~| msgid "LABEL_DISPLAY_NAME" #~ msgid "LABEL_CARD_NAME" diff --git a/Locales/translation_template.pot b/Locales/translation_template.pot index 87306bc..5f7e8c9 100644 --- a/Locales/translation_template.pot +++ b/Locales/translation_template.pot @@ -581,3 +581,9 @@ msgstr "" msgid "PROMPT_REMIX_INTERACT" msgstr "" + +msgid "LABEL_REMIX_PRICE" +msgstr "" + +msgid "LABEL_REMIX_CURRENCY" +msgstr "" diff --git a/PCs/FSM/fighting_state.gd b/PCs/FSM/fighting_state.gd index ae942d6..153516b 100644 --- a/PCs/FSM/fighting_state.gd +++ b/PCs/FSM/fighting_state.gd @@ -3,6 +3,7 @@ extends HeroState func enter_state() -> void: + hero.hud.set_currencies_visible(false) if hero.weapons[hero.equipped_weapon]: hero.hud.set_energy_visible(true) var offhand_weapon: Weapon = hero.weapons[0] if hero.equipped_weapon == 1 else hero.weapons[1] @@ -21,6 +22,7 @@ func enter_state() -> void: func exit_state() -> void: + hero.hud.set_currencies_visible(true) if hero.weapons[hero.equipped_weapon]: hero.weapons[hero.equipped_weapon].release_trigger() hero.weapons[hero.equipped_weapon].release_second_trigger() diff --git a/PCs/hero.gd b/PCs/hero.gd index 34308db..cd33614 100644 --- a/PCs/hero.gd +++ b/PCs/hero.gd @@ -325,46 +325,23 @@ func equip_weapon(slot: int = 0) -> void: weapons[slot].visible = false right_hand.add_child(weapons[slot]) if slot == 0: - weapons[slot].energy_spent.connect(hud.new_energy_bar.use_energy) - weapons[slot].energy_recharged.connect(hud.new_energy_bar.gain_energy) - hud.new_energy_bar.max_energy = weapons[slot].max_energy - if weapons[slot].stats.energy_type == Data.EnergyType.CONTINUOUS: - hud.new_energy_bar.enable_progress_bar() - if weapons[slot].stats.energy_type == Data.EnergyType.DISCRETE: - hud.new_energy_bar.create_discrete_icons(int(weapons[slot].max_energy)) - else: - weapons[slot].energy_recharged.connect(hud.new_energy_bar.gain_secondary_energy) - hud.new_energy_bar.secondary_max_energy = weapons[slot].max_energy - hud.new_energy_bar.secondary_energy = weapons[slot].current_energy + weapons[slot].energy_changed.connect(hud.set_energy_pips) + hud.energy_pips.max_energy = weapons[slot].max_energy func stow_weapon(slot: int = 0) -> void: weapons[slot].release_trigger() weapons[slot].release_second_trigger() weapons[slot].visible = false - weapons[slot].energy_spent.disconnect(hud.new_energy_bar.use_energy) - weapons[slot].energy_recharged.disconnect(hud.new_energy_bar.gain_energy) - weapons[slot].energy_recharged.connect(hud.new_energy_bar.gain_secondary_energy) - hud.new_energy_bar.secondary_max_energy = weapons[slot].max_energy - hud.new_energy_bar.secondary_energy = weapons[slot].current_energy + weapons[slot].energy_changed.disconnect(hud.set_energy_pips) func show_weapon(slot: int = 0) -> void: weapons[slot].release_trigger() weapons[slot].release_second_trigger() - weapons[slot].energy_recharged.disconnect(hud.new_energy_bar.gain_secondary_energy) - weapons[slot].energy_spent.connect(hud.new_energy_bar.use_energy) - weapons[slot].energy_recharged.connect(hud.new_energy_bar.gain_energy) + weapons[slot].energy_changed.connect(hud.set_energy_pips) hud.set_weapon_energy(int(weapons[slot].current_energy), weapons[slot].stats.energy_type) - hud.new_energy_bar.max_energy = weapons[slot].max_energy - if weapons[slot].stats.energy_type == Data.EnergyType.CONTINUOUS: - hud.new_energy_bar.enable_progress_bar() - if weapons[slot].stats.energy_type == Data.EnergyType.DISCRETE: - hud.new_energy_bar.create_discrete_icons(int(weapons[slot].max_energy)) - hud.new_energy_bar.use_energy(weapons[slot].max_energy - weapons[slot].current_energy, weapons[slot].stats.energy_type) - var offhand: int = 0 if equipped_weapon == 1 else 1 - if !weapons[offhand]: - hud.new_energy_bar.disable_secondary_energy() + hud.energy_pips.max_energy = weapons[slot].max_energy func swap_weapons() -> void: @@ -390,10 +367,8 @@ func unequip_weapon(slot: int = 0) -> void: gauntlet_cards[slot].visible = false if slot == 0: hud.place_icon.visible = true - hud.new_energy_bar.blank() else: hud.swap_icon.visible = true - hud.new_energy_bar.disable_secondary_energy() weapons[slot].queue_free() weapons[slot] = null if !game_manager.card_gameplay: diff --git a/PCs/hero.tscn b/PCs/hero.tscn index 26ffbf8..0d6941d 100644 --- a/PCs/hero.tscn +++ b/PCs/hero.tscn @@ -17,7 +17,6 @@ [ext_resource type="Script" uid="uid://hy51bq7x0fy8" path="res://Scripts/on_top_camera.gd" id="11_4sdwe"] [ext_resource type="PackedScene" uid="uid://ckl5tw5rmewhp" path="res://left_hand/card_hand_model.glb" id="11_h82f6"] [ext_resource type="Script" uid="uid://ckkioruqgbs8p" path="res://Scripts/minimap_cam.gd" id="12_3hpi3"] -[ext_resource type="PackedScene" uid="uid://24x18qxqhy0i" path="res://Scenes/UI/lives_bar.tscn" id="15_cqpib"] [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"] @@ -31,7 +30,6 @@ [ext_resource type="Texture2D" uid="uid://biwol65o5rwc7" path="res://Assets/Textures/enemy_frame.png" id="25_rim6q"] [ext_resource type="AudioStream" uid="uid://bxripx3suub1v" path="res://Audio/cardPlace3.ogg" id="26_7tm07"] [ext_resource type="Texture2D" uid="uid://0x80ptif1diq" path="res://Assets/Textures/hand_small_point.png" id="26_dfkac"] -[ext_resource type="PackedScene" uid="uid://c2id8hjico4w8" path="res://UI/EnergyBar/energy_bar.tscn" id="27_14ugt"] [ext_resource type="AudioStream" uid="uid://k1lsqkvohjpa" path="res://Audio/cardPlace4.ogg" id="27_xvxs8"] [ext_resource type="AudioStream" uid="uid://bn8lkvy5wibvo" path="res://Audio/cardSlide1.ogg" id="28_1thk8"] [ext_resource type="AudioStream" uid="uid://d32gpcu8w1yvn" path="res://Audio/cardSlide2.ogg" id="29_s0a0l"] @@ -39,6 +37,8 @@ [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="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"] @@ -321,11 +321,10 @@ 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", "lives_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", "new_energy_bar", "energy_label", "blank_cassette_label", "feature_preview", "hot_wheel")] +[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")] script = ExtResource("8_yl6ka") player = NodePath("..") wave_count = NodePath("EnemyTracker/WaveCount") -lives_count = NodePath("LivesBar/LivesCount") currency_count = NodePath("Currencies/CoinCounter/CurrencyCount") minimap_outline = NodePath("Minimap/MinimapBorder") minimap = NodePath("Minimap") @@ -342,11 +341,13 @@ swap_icon = NodePath("SwapIcon") place_text = NodePath("PlaceIcon/RichTextLabel") swap_text = NodePath("SwapIcon/RichTextLabel") enemy_card_scene = ExtResource("18_dfkac") -new_energy_bar = NodePath("EnergyBar") energy_label = NodePath("Currencies/HBoxContainer/EnergyLabel") blank_cassette_label = NodePath("Currencies/BlankCassetteLabel") feature_preview = NodePath("FeaturePreview") hot_wheel = NodePath("HotWheel") +shield_ui = NodePath("ShieldUI") +currencies = NodePath("Currencies") +energy_pips = NodePath("EnergyPips") [node name="FirstPersonCam" type="TextureRect" parent="HUD"] anchors_preset = 15 @@ -450,30 +451,6 @@ text = "FPS: " horizontal_alignment = 2 vertical_alignment = 1 -[node name="LivesBar" parent="HUD" instance=ExtResource("15_cqpib")] -anchors_preset = 0 -anchor_right = 0.0 -anchor_bottom = 0.0 -offset_left = 10.0 -offset_top = 10.0 -offset_right = 214.0 -offset_bottom = 32.0 -grow_horizontal = 1 -grow_vertical = 1 -scale = Vector2(0.32, 0.32) -mouse_filter = 2 - -[node name="LivesCount" type="Label" parent="HUD/LivesBar"] -layout_mode = 0 -offset_right = 79.0 -offset_bottom = 70.0 -scale = Vector2(0.33, 0.33) -theme_override_colors/font_color = Color(0.65098, 0.227451, 0.243137, 1) -theme_override_font_sizes/font_size = 37 -text = "120" -horizontal_alignment = 1 -vertical_alignment = 1 - [node name="EnemyTracker" type="TextureRect" parent="HUD"] texture_filter = 1 anchors_preset = -1 @@ -489,115 +466,101 @@ stretch_mode = 4 [node name="TextureRect" type="TextureRect" parent="HUD/EnemyTracker"] visible = false layout_mode = 0 -offset_right = 64.0 +offset_left = 0.5 +offset_right = 64.5 offset_bottom = 64.0 scale = Vector2(0.5, 0.5) texture = ExtResource("15_q3yot") [node name="Label" type="Label" parent="HUD/EnemyTracker/TextureRect"] layout_mode = 0 -offset_left = 28.01 -offset_top = 41.81 -offset_right = 68.01 -offset_bottom = 66.8101 -theme_override_colors/font_color = Color(1, 1, 1, 1) -theme_override_colors/font_outline_color = Color(0, 0, 0, 1) -theme_override_constants/outline_size = 5 -theme_override_font_sizes/font_size = 15 +offset_left = 28.000006 +offset_top = 46.000004 +offset_right = 43.000008 +offset_bottom = 54.000004 +scale = Vector2(2, 2) text = "999" -horizontal_alignment = 1 +horizontal_alignment = 2 vertical_alignment = 1 [node name="TextureRect2" type="TextureRect" parent="HUD/EnemyTracker"] visible = false layout_mode = 0 -offset_left = 32.0 -offset_right = 96.0 +offset_left = 32.5 +offset_right = 96.5 offset_bottom = 64.0 scale = Vector2(0.5, 0.5) texture = ExtResource("15_q3yot") [node name="Label2" type="Label" parent="HUD/EnemyTracker/TextureRect2"] layout_mode = 0 -offset_left = 28.745 -offset_top = 41.81 -offset_right = 68.7451 -offset_bottom = 66.8101 -theme_override_colors/font_color = Color(1, 1, 1, 1) -theme_override_colors/font_outline_color = Color(0, 0, 0, 1) -theme_override_constants/outline_size = 5 -theme_override_font_sizes/font_size = 15 +offset_left = 28.000006 +offset_top = 46.000004 +offset_right = 43.000008 +offset_bottom = 54.000004 +scale = Vector2(2, 2) text = "999" -horizontal_alignment = 1 +horizontal_alignment = 2 vertical_alignment = 1 [node name="TextureRect3" type="TextureRect" parent="HUD/EnemyTracker"] visible = false layout_mode = 0 -offset_left = 64.0 -offset_right = 128.0 +offset_left = 62.5 +offset_right = 126.5 offset_bottom = 64.0 scale = Vector2(0.5, 0.5) texture = ExtResource("15_q3yot") [node name="Label3" type="Label" parent="HUD/EnemyTracker/TextureRect3"] layout_mode = 0 -offset_left = 29.29 -offset_top = 41.81 -offset_right = 69.2901 -offset_bottom = 66.8101 -theme_override_colors/font_color = Color(1, 1, 1, 1) -theme_override_colors/font_outline_color = Color(0, 0, 0, 1) -theme_override_constants/outline_size = 5 -theme_override_font_sizes/font_size = 15 +offset_left = 29.999992 +offset_top = 46.000004 +offset_right = 44.999992 +offset_bottom = 54.000004 +scale = Vector2(2, 2) text = "999" -horizontal_alignment = 1 +horizontal_alignment = 2 vertical_alignment = 1 [node name="TextureRect4" type="TextureRect" parent="HUD/EnemyTracker"] visible = false layout_mode = 0 -offset_left = 96.0 -offset_right = 160.0 +offset_left = 94.5 +offset_right = 158.5 offset_bottom = 64.0 scale = Vector2(0.5, 0.5) texture = ExtResource("15_q3yot") [node name="Label4" type="Label" parent="HUD/EnemyTracker/TextureRect4"] layout_mode = 0 -offset_left = 29.0 -offset_top = 41.81 -offset_right = 69.0 -offset_bottom = 66.8101 -theme_override_colors/font_color = Color(1, 1, 1, 1) -theme_override_colors/font_outline_color = Color(0, 0, 0, 1) -theme_override_constants/outline_size = 5 -theme_override_font_sizes/font_size = 15 +offset_left = 30.0 +offset_top = 46.000004 +offset_right = 45.0 +offset_bottom = 54.000004 +scale = Vector2(2, 2) text = "999" -horizontal_alignment = 1 +horizontal_alignment = 2 vertical_alignment = 1 [node name="TextureRect5" type="TextureRect" parent="HUD/EnemyTracker"] visible = false layout_mode = 0 -offset_left = 128.0 -offset_right = 192.0 +offset_left = 127.5 +offset_right = 191.5 offset_bottom = 64.0 scale = Vector2(0.5, 0.5) texture = ExtResource("15_q3yot") [node name="Label5" type="Label" parent="HUD/EnemyTracker/TextureRect5"] layout_mode = 0 -offset_left = 29.0 -offset_top = 41.81 -offset_right = 69.0 -offset_bottom = 66.8101 -theme_override_colors/font_color = Color(1, 1, 1, 1) -theme_override_colors/font_outline_color = Color(0, 0, 0, 1) -theme_override_constants/outline_size = 5 -theme_override_font_sizes/font_size = 15 +offset_left = 26.0 +offset_top = 46.000004 +offset_right = 41.0 +offset_bottom = 54.000004 +scale = Vector2(2, 2) text = "999" -horizontal_alignment = 1 +horizontal_alignment = 2 vertical_alignment = 1 [node name="WaveCount" type="Label" parent="HUD/EnemyTracker"] @@ -607,6 +570,10 @@ anchor_left = 0.5 anchor_top = 1.0 anchor_right = 0.5 anchor_bottom = 1.0 +offset_left = -2.0 +offset_top = -12.0 +offset_right = 1.0 +offset_bottom = -4.0 grow_horizontal = 2 grow_vertical = 0 text = "1" @@ -677,11 +644,6 @@ grow_horizontal = 2 grow_vertical = 2 mouse_filter = 2 -[node name="EnergyBar" parent="HUD" instance=ExtResource("27_14ugt")] -visible = false -scale = Vector2(0.235, 0.235) -mouse_filter = 2 - [node name="TextureRect" type="TextureRect" parent="HUD"] modulate = Color(0.54324, 0.193653, 0.15885, 0.9) anchors_preset = 8 @@ -783,6 +745,23 @@ grow_vertical = 2 mouse_filter = 2 alignment = 1 +[node name="ShieldUI" parent="HUD" instance=ExtResource("31_o55s8")] +anchors_preset = -1 +anchor_left = 0.025 +anchor_top = 0.025 +anchor_right = 0.035 +anchor_bottom = 0.035 + +[node name="EnergyPips" parent="HUD" instance=ExtResource("32_o55s8")] +visible = false +anchors_preset = -1 +anchor_left = 0.97 +anchor_top = 0.97 +anchor_right = 0.97 +anchor_bottom = 0.97 +grow_horizontal = 0 +grow_vertical = 0 + [node name="WeaponSwapTimer" type="Timer" parent="."] wait_time = 0.4 one_shot = true diff --git a/PCs/hud.gd b/PCs/hud.gd index 22f30d0..e570b93 100644 --- a/PCs/hud.gd +++ b/PCs/hud.gd @@ -3,7 +3,6 @@ extends CanvasLayer @export var player: Hero @export var wave_count: Label -@export var lives_count: Label @export var currency_count: Label @export var minimap_outline: TextureRect @export var crosshair: Control @@ -21,15 +20,17 @@ extends CanvasLayer @export var place_text: RichTextLabel @export var swap_text: RichTextLabel @export var enemy_card_scene: PackedScene -@export var new_energy_bar: EnergyBar @export var energy_label: Label @export var primary_duration: Label @export var secondary_duration: Label @export var blank_cassette_label: Label @export var feature_preview: HBoxContainer @export var hot_wheel: HotWheel +@export var shield_ui: ShieldUI +@export var currencies: VBoxContainer +@export var energy_pips: EnergyPips -var last_lives_count: int = 120 +var last_lives_count: int = Data.starting_lives var enemy_names: Array[String] var map_anchor: Node3D var cards: Array[EnemyCardUI] = [] @@ -88,7 +89,7 @@ func show_wave_generation_anim(wave: Wave) -> void: func set_energy_visible(value: bool) -> void: - new_energy_bar.visible = value + energy_pips.visible = value func _process(_delta: float) -> void: @@ -163,12 +164,19 @@ func set_wave_count(value: int) -> void: func set_lives_count(value: int) -> void: - lives_count.text = str(value) - for x: int in last_lives_count - value: - $LivesBar.take_life() + var damage: int = last_lives_count - value + shield_ui.take_damage(damage) last_lives_count = value +func set_currencies_visible(value: bool) -> void: + currencies.visible = value + + +func set_energy_pips(value: int) -> void: + energy_pips.energy = value + + func enemy_count_down(enemy: Enemy) -> void: var index: int = enemy_names.find(enemy.title) var num: int = enemy_counts[index].text.to_int() - 1 diff --git a/Scenes/Menus/MainMenu/main_menu.tscn b/Scenes/Menus/MainMenu/main_menu.tscn index 516e6c3..1593a60 100644 --- a/Scenes/Menus/MainMenu/main_menu.tscn +++ b/Scenes/Menus/MainMenu/main_menu.tscn @@ -1,42 +1,13 @@ -[gd_scene load_steps=25 format=3 uid="uid://8yv7excojcg0"] +[gd_scene load_steps=12 format=3 uid="uid://8yv7excojcg0"] [ext_resource type="Script" uid="uid://ci8vq73u23viy" path="res://Scenes/Menus/MainMenu/main_menu.gd" id="2_ivytu"] -[ext_resource type="PackedScene" uid="uid://y1qa1g3ic8sp" path="res://Worlds/GreenPlanet/Levels/Bridge/bridge.tscn" id="3_l8r4a"] [ext_resource type="AudioStream" uid="uid://cp6ph4ra7u5rk" path="res://Scenes/UI/drop_003.ogg" id="5_cwn2i"] -[ext_resource type="Script" uid="uid://cbwxa2a4hfcy4" path="res://Scripts/Resources/enemy.gd" id="5_u514r"] -[ext_resource type="Texture2D" uid="uid://cdnhe2mi5c5ln" path="res://Assets/Textures/dead_eye_dog.png" id="6_rsxwm"] -[ext_resource type="Texture2D" uid="uid://g00wwrlxxdc5" path="res://Assets/Textures/icon_eye_dog.png" id="7_2sylv"] -[ext_resource type="Texture2D" uid="uid://dj13g1w14mekw" path="res://Assets/Textures/eye_dog.png" id="8_1vnym"] -[ext_resource type="Resource" uid="uid://cvehqh4tt28g7" path="res://Enemies/BabyEyeDog/baby_eye_dog.tres" id="9_hdp0s"] -[ext_resource type="Resource" uid="uid://dxi17xvdlhkvc" path="res://Enemies/ElderEyeDog/elder_eye_dog.tres" id="10_day26"] -[ext_resource type="Resource" uid="uid://boik1gnpl4v0a" path="res://Resources/Enemies/dog_boss.tres" id="11_1mes0"] -[ext_resource type="Resource" uid="uid://dsgkwh3opyqtx" path="res://Resources/Enemies/airenemy.tres" id="12_5vny5"] -[ext_resource type="Resource" uid="uid://bffhb5krs5elm" path="res://Enemies/Crystalisk/crystalisk.tres" id="13_xb7gj"] [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://Scenes/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="ViewportTexture" id="ViewportTexture_5u75i"] -viewport_path = NodePath("SubViewport") - -[sub_resource type="AtlasTexture" id="AtlasTexture_74epv"] -resource_local_to_scene = true -atlas = ExtResource("8_1vnym") -region = Rect2(0, 0, 32, 32) - -[sub_resource type="Resource" id="Resource_sv1gy"] -resource_local_to_scene = true -script = ExtResource("5_u514r") -target_type = 1 -icon = ExtResource("7_2sylv") -death_sprite = ExtResource("6_rsxwm") -sprite = SubResource("AtlasTexture_74epv") -health = 180 -movement_speed = 1.2 -spawn_cooldown = 1.2 - [sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_2jyua"] random_pitch = 1.1 streams_count = 1 @@ -62,22 +33,21 @@ anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 script = ExtResource("2_ivytu") -bg_level = NodePath("SubViewport/GridMap") +bg_level = NodePath("") 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="TextureRect" type="TextureRect" parent="."] -visible = false +[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 -texture = SubResource("ViewportTexture_5u75i") +color = Color(0.5176471, 0.60784316, 0.89411765, 1) [node name="TitleLabel" type="Label" parent="."] layout_mode = 1 @@ -90,12 +60,15 @@ 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.1 -anchor_top = 0.4 -anchor_right = 0.9 -anchor_bottom = 0.9 +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"] @@ -119,20 +92,10 @@ text = "BUTTON_OPTIONS layout_mode = 2 text = "BUTTON_QUIT" -[node name="SubViewport" type="SubViewport" parent="."] -size = Vector2i(1920, 1080) - -[node name="GridMap" parent="SubViewport" instance=ExtResource("3_l8r4a")] -enemy_pool = Array[ExtResource("5_u514r")]([SubResource("Resource_sv1gy"), ExtResource("9_hdp0s"), ExtResource("10_day26"), ExtResource("11_1mes0"), ExtResource("12_5vny5"), ExtResource("13_xb7gj")]) - [node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."] stream = SubResource("AudioStreamRandomizer_2jyua") bus = &"SFX" -[node name="AudioListener3D" type="AudioListener3D" parent="."] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 100, 0) -current = true - [node name="GameSelectMenu" type="PanelContainer" parent="."] visible = false layout_mode = 1 diff --git a/Scenes/Menus/PauseMenu/pause_menu.tscn b/Scenes/Menus/PauseMenu/pause_menu.tscn index 7e1bf7b..d700b5d 100644 --- a/Scenes/Menus/PauseMenu/pause_menu.tscn +++ b/Scenes/Menus/PauseMenu/pause_menu.tscn @@ -1,6 +1,5 @@ -[gd_scene load_steps=5 format=3 uid="uid://buvgdem68wtev"] +[gd_scene load_steps=4 format=3 uid="uid://buvgdem68wtev"] -[ext_resource type="Theme" uid="uid://b6a0ip4p72tgx" path="res://UI/new_theme.tres" id="1_gaupv"] [ext_resource type="Script" uid="uid://cjyyepxaf4xl8" path="res://Scenes/Menus/PauseMenu/pause_menu.gd" id="2_4pn2l"] [ext_resource type="AudioStream" uid="uid://cp6ph4ra7u5rk" path="res://Scenes/UI/drop_003.ogg" id="3_0bid7"] @@ -16,7 +15,6 @@ anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -theme = ExtResource("1_gaupv") script = ExtResource("2_4pn2l") [node name="ColorRect" type="ColorRect" parent="."] diff --git a/Scripts/Weapons/weapon.gd b/Scripts/Weapons/weapon.gd index c025b9b..1090105 100644 --- a/Scripts/Weapons/weapon.gd +++ b/Scripts/Weapons/weapon.gd @@ -3,6 +3,7 @@ extends Node3D signal energy_spent(energy: int, type: Data.EnergyType) signal energy_recharged(energy: int, type: Data.EnergyType) +signal energy_changed(energy: float) @export var stats: CardText @export var animator: AnimationPlayer @@ -50,11 +51,13 @@ func _process(delta: float) -> void: current_energy = max_energy recharging = false energy_recharged.emit(recharge_speed * delta, stats.energy_type) + energy_changed.emit(current_energy) if time_since_firing < time_between_shots: time_since_firing += delta if trigger_held and stats.energy_type == Data.EnergyType.CONTINUOUS: current_energy -= delta energy_spent.emit(delta, stats.energy_type) + energy_changed.emit(current_energy) @warning_ignore("unused_parameter") @@ -64,6 +67,7 @@ func _physics_process(delta: float) -> void: current_energy -= 1 current_energy = floorf(current_energy) energy_spent.emit(1, stats.energy_type) + energy_changed.emit(current_energy) time_since_firing -= time_between_shots shoot() networked_shoot.rpc() diff --git a/Scripts/data.gd b/Scripts/data.gd index 3a9abcd..3e53428 100644 --- a/Scripts/data.gd +++ b/Scripts/data.gd @@ -26,6 +26,7 @@ static var target_type_names: Dictionary[TargetType, String] = { static var weapon_recharge_delay: float = 0.5 static var starting_cash: int = 10 +static var starting_lives: int = 144 static var player_energy: int = 6 static var wall_cost: int = 1 static var rarity_weights: Dictionary = { diff --git a/Scripts/game.gd b/Scripts/game.gd index 8e465db..2d716dd 100644 --- a/Scripts/game.gd +++ b/Scripts/game.gd @@ -22,7 +22,7 @@ var game_active: bool = false var gamemode: GameMode = null var level: Level var enemies: int = 0 -var objective_health: int = 120 +var objective_health: int = Data.starting_lives var wave: int var pot: float var UILayer: CanvasLayer @@ -38,24 +38,6 @@ var starting_blanks: int = 0 var connected_player_profiles: Dictionary = {} -func _ready() -> void: - UILayer = CanvasLayer.new() - UILayer.layer = 2 - root_scene.add_child.call_deferred(UILayer) - var version_label: Label = Label.new() - var version: String = ProjectSettings.get_setting("application/config/version") - version_label.text = "WORK IN PROGRESS | ALPHA - VERSION " + version + " | PLAYTEST" - version_label.vertical_alignment = VERTICAL_ALIGNMENT_CENTER - version_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER - version_label.theme_type_variation = "VersionLabel" - #version_label.add_theme_font_size_override("font_size", 18) - #version_label.add_theme_color_override("font_color", Color(0.85, 0.85, 0.85, 0.7)) - version_label.set_anchors_preset(Control.PRESET_TOP_WIDE) - UILayer.add_child(version_label) - Input.set_custom_mouse_cursor(load("res://Assets/Textures/cursor_none.png"), Input.CURSOR_ARROW, Vector2(9, 6)) - Input.set_custom_mouse_cursor(load("res://Assets/Textures/bracket_b_vertical.png"), Input.CURSOR_IBEAM, Vector2(16, 16)) - - func parse_command(text: String, peer_id: int) -> void: if text.substr(1, 4) == "give": var gift_name: String = text.substr(6) as String @@ -295,7 +277,7 @@ func setup() -> void: #Set starting parameters game_active = false enemies = 0 - objective_health = 120 + objective_health = Data.starting_lives wave = 1 stats = RoundStats.new() game_setup.emit() diff --git a/ShieldUI.gd b/ShieldUI.gd new file mode 100644 index 0000000..5d88bf5 --- /dev/null +++ b/ShieldUI.gd @@ -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) diff --git a/ShieldUI.gd.uid b/ShieldUI.gd.uid new file mode 100644 index 0000000..debc1b0 --- /dev/null +++ b/ShieldUI.gd.uid @@ -0,0 +1 @@ +uid://kiivev1q63p0 diff --git a/UI/psx_ui.tres b/UI/psx_ui.tres index 2508377..7feebad 100644 --- a/UI/psx_ui.tres +++ b/UI/psx_ui.tres @@ -1,17 +1,49 @@ -[gd_resource type="Theme" load_steps=2 format=3 uid="uid://jn4qqx5hxc5i"] +[gd_resource type="Theme" load_steps=9 format=3 uid="uid://jn4qqx5hxc5i"] +[ext_resource type="StyleBox" uid="uid://bgxt37xw4tma6" path="res://button_style_box_normal.tres" id="1_b02pe"] [ext_resource type="FontFile" uid="uid://bqy8dm2o3piqm" path="res://Assets/Fonts/Quaver v1.0/quaver.ttf" id="1_u5gny"] +[ext_resource type="StyleBox" uid="uid://bfuea1sjymo8g" path="res://pane_style_box.tres" id="3_inyly"] +[ext_resource type="StyleBox" uid="uid://cm3wsvk3woory" path="res://switch_side_a_style_box.tres" id="4_u1sfq"] +[ext_resource type="StyleBox" uid="uid://jnnnhb3i2265" path="res://switch_side_b_style_box.tres" id="5_78ak8"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_u1sfq"] + +[sub_resource type="FontVariation" id="FontVariation_b02pe"] +base_font = ExtResource("1_u5gny") +baseline_offset = 0.15 + +[sub_resource type="FontVariation" id="FontVariation_inyly"] +base_font = ExtResource("1_u5gny") [resource] -Button/font_sizes/font_size = 8 -Button/fonts/font = ExtResource("1_u5gny") +Button/colors/font_color = Color(0.8388973, 0.838897, 0.838897, 1) +Button/colors/font_hover_color = Color(0.95, 0.95, 0.95, 1) +Button/styles/focus = SubResource("StyleBoxEmpty_u1sfq") +Button/styles/hover = ExtResource("1_b02pe") +Button/styles/normal = ExtResource("1_b02pe") +Control/constants/outline_size = 4 +Control/font_sizes/font_size = 8 +Control/fonts/font = SubResource("FontVariation_b02pe") InteractLabel/base_type = &"Label" Label/font_sizes/font_size = 8 Label/fonts/font = ExtResource("1_u5gny") LineEdit/font_sizes/font_size = 8 LineEdit/fonts/font = ExtResource("1_u5gny") +PanelContainer/styles/panel = ExtResource("3_inyly") +PopupMenu/constants/outline_size = 4 +PopupMenu/font_sizes/font_size = 8 +PopupMenu/fonts/font = SubResource("FontVariation_inyly") RichTextLabel/font_sizes/normal_font_size = 8 RichTextLabel/fonts/normal_font = ExtResource("1_u5gny") +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("5_78ak8") +SideCheckButton/styles/hover_pressed = ExtResource("4_u1sfq") +SideCheckButton/styles/normal = ExtResource("5_78ak8") +SideCheckButton/styles/pressed = ExtResource("4_u1sfq") StartWaveLabel/base_type = &"Label" VersionLabel/base_type = &"Label" VersionLabel/colors/font_color = Color(0.85, 0.85, 0.85, 0.7) diff --git a/button_patch.png b/button_patch.png new file mode 100644 index 0000000..b9124df Binary files /dev/null and b/button_patch.png differ diff --git a/button_patch.png.import b/button_patch.png.import new file mode 100644 index 0000000..f0c7941 --- /dev/null +++ b/button_patch.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://broabvnrwp73t" +path="res://.godot/imported/button_patch.png-22aba966b297663456907901b6cbce38.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://button_patch.png" +dest_files=["res://.godot/imported/button_patch.png-22aba966b297663456907901b6cbce38.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 diff --git a/button_style_box_normal.tres b/button_style_box_normal.tres new file mode 100644 index 0000000..90fae39 --- /dev/null +++ b/button_style_box_normal.tres @@ -0,0 +1,10 @@ +[gd_resource type="StyleBoxTexture" load_steps=2 format=3 uid="uid://bgxt37xw4tma6"] + +[ext_resource type="Texture2D" uid="uid://broabvnrwp73t" path="res://button_patch.png" id="1_iolpp"] + +[resource] +texture = ExtResource("1_iolpp") +texture_margin_left = 4.0 +texture_margin_top = 4.0 +texture_margin_right = 4.0 +texture_margin_bottom = 4.0 diff --git a/card_description_ui.tscn b/card_description_ui.tscn index 16b7df1..9bb7ac7 100644 --- a/card_description_ui.tscn +++ b/card_description_ui.tscn @@ -24,6 +24,7 @@ text = "LABEL_CARD_DESCRIPTION" [node name="DescriptionText" type="RichTextLabel" parent="."] auto_translate_mode = 2 +clip_contents = false layout_mode = 2 size_flags_vertical = 3 bbcode_enabled = true diff --git a/energy_pips.gd b/energy_pips.gd new file mode 100644 index 0000000..5515903 --- /dev/null +++ b/energy_pips.gd @@ -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 diff --git a/energy_pips.gd.uid b/energy_pips.gd.uid new file mode 100644 index 0000000..1a4687a --- /dev/null +++ b/energy_pips.gd.uid @@ -0,0 +1 @@ +uid://cvdb5y5wmkvmm diff --git a/energy_pips.tscn b/energy_pips.tscn new file mode 100644 index 0000000..986f736 --- /dev/null +++ b/energy_pips.tscn @@ -0,0 +1,24 @@ +[gd_scene load_steps=4 format=3 uid="uid://q73cllewm7pj"] + +[ext_resource type="Script" uid="uid://cvdb5y5wmkvmm" path="res://energy_pips.gd" id="1_6l017"] +[ext_resource type="Texture2D" uid="uid://h1m3ss2ln5hq" path="res://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 diff --git a/energy_sheet.png b/energy_sheet.png new file mode 100644 index 0000000..9594762 Binary files /dev/null and b/energy_sheet.png differ diff --git a/energy_sheet.png.import b/energy_sheet.png.import new file mode 100644 index 0000000..512a03a --- /dev/null +++ b/energy_sheet.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://h1m3ss2ln5hq" +path="res://.godot/imported/energy_sheet.png-cce4e01dae5f3c3cc83f0e4b096ce208.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://energy_sheet.png" +dest_files=["res://.godot/imported/energy_sheet.png-cce4e01dae5f3c3cc83f0e4b096ce208.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 diff --git a/health-Sheet.png b/health-Sheet.png new file mode 100644 index 0000000..0222e34 Binary files /dev/null and b/health-Sheet.png differ diff --git a/health-Sheet.png.import b/health-Sheet.png.import new file mode 100644 index 0000000..5f41c57 --- /dev/null +++ b/health-Sheet.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://d0yfidlyfyxff" +path="res://.godot/imported/health-Sheet.png-3a0a09780bb7aea652e77e269f0d8b32.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://health-Sheet.png" +dest_files=["res://.godot/imported/health-Sheet.png-3a0a09780bb7aea652e77e269f0d8b32.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 diff --git a/health_border.png b/health_border.png new file mode 100644 index 0000000..e010d04 Binary files /dev/null and b/health_border.png differ diff --git a/health_border.png.import b/health_border.png.import new file mode 100644 index 0000000..f9a7ef1 --- /dev/null +++ b/health_border.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bv3alwpq8esky" +path="res://.godot/imported/health_border.png-138c86d63678f02e052053b45bae13ec.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://health_border.png" +dest_files=["res://.godot/imported/health_border.png-138c86d63678f02e052053b45bae13ec.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 diff --git a/health_hit-Sheet.png b/health_hit-Sheet.png new file mode 100644 index 0000000..0ffbd8a Binary files /dev/null and b/health_hit-Sheet.png differ diff --git a/health_hit-Sheet.png.import b/health_hit-Sheet.png.import new file mode 100644 index 0000000..17ac0bc --- /dev/null +++ b/health_hit-Sheet.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bifqfvhsu4c2f" +path="res://.godot/imported/health_hit-Sheet.png-cf8e317c6327f19733eb29b3a217e682.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://health_hit-Sheet.png" +dest_files=["res://.godot/imported/health_hit-Sheet.png-cf8e317c6327f19733eb29b3a217e682.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 diff --git a/main.gd b/main.gd index 198c255..2df0b1a 100644 --- a/main.gd +++ b/main.gd @@ -4,10 +4,12 @@ extends Node signal loaded_scene @export var scene: Node +@export var ui_viewport: SubViewport @export var movies: Node var game_manager: GameManager var loaded: bool = false +var UILayer: CanvasLayer var main_menu_scene_path: String = "res://Scenes/Menus/MainMenu/main_menu.tscn" var multiplayer_lobby_scene_path: String = "res://Scenes/Menus/multiplayer_lobby.tscn" var singleplayer_lobby_scene_path: String = "res://Scenes/Menus/singleplayer_lobby.tscn" @@ -15,6 +17,21 @@ var singleplayer_lobby_scene_path: String = "res://Scenes/Menus/singleplayer_lob func _ready() -> void: Engine.max_fps = 60 + UILayer = CanvasLayer.new() + UILayer.layer = 2 + ui_viewport.add_child.call_deferred(UILayer) + var version_label: Label = Label.new() + var version: String = ProjectSettings.get_setting("application/config/version") + version_label.text = "WORK IN PROGRESS | ALPHA - VERSION " + version + " | PLAYTEST" + version_label.vertical_alignment = VERTICAL_ALIGNMENT_CENTER + version_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER + version_label.theme_type_variation = "VersionLabel" + #version_label.add_theme_font_size_override("font_size", 18) + #version_label.add_theme_color_override("font_color", Color(0.85, 0.85, 0.85, 0.7)) + version_label.set_anchors_preset(Control.PRESET_TOP_WIDE) + UILayer.add_child(version_label) + Input.set_custom_mouse_cursor(load("res://Assets/Textures/cursor_none.png"), Input.CURSOR_ARROW, Vector2(9, 6)) + Input.set_custom_mouse_cursor(load("res://Assets/Textures/bracket_b_vertical.png"), Input.CURSOR_IBEAM, Vector2(16, 16)) func load_main_menu() -> void: @@ -25,6 +42,7 @@ func load_main_menu() -> void: game_manager = GameManager.new() game_manager.name = "GameManager" game_manager.root_scene = scene + game_manager.UILayer = UILayer add_child(game_manager) game_manager.switch_to_main_menu.connect(load_main_menu) game_manager.switch_to_single_player.connect(load_singleplayer) diff --git a/main.tscn b/main.tscn index cd78db3..d4fa243 100644 --- a/main.tscn +++ b/main.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=7 format=3 uid="uid://d2k8y13qfvch0"] +[gd_scene load_steps=8 format=3 uid="uid://d2k8y13qfvch0"] [ext_resource type="Script" uid="uid://cx1xj7esl03ui" path="res://main.gd" id="2_h2yge"] [ext_resource type="Texture2D" uid="uid://6frn8lcwwehv" path="res://Assets/TextureAtlases/puppyfruit.png" id="2_lquwl"] @@ -9,15 +9,19 @@ atlas = ExtResource("2_lquwl") region = Rect2(0, 0, 256, 256) +[sub_resource type="ViewportTexture" id="ViewportTexture_1bvp3"] +viewport_path = NodePath("UI") + [sub_resource type="ShaderMaterial" id="ShaderMaterial_272bh"] shader = ExtResource("6_7mycd") shader_parameter/color_depth = 5 shader_parameter/dithering = true shader_parameter/resolution_scale = 1 -[node name="Main" type="Node" node_paths=PackedStringArray("scene", "movies")] +[node name="Main" type="Node" node_paths=PackedStringArray("scene", "ui_viewport", "movies")] script = ExtResource("2_h2yge") scene = NodePath("Scene") +ui_viewport = NodePath("UI") movies = NodePath("Movies") metadata/_custom_type_script = "uid://cx1xj7esl03ui" @@ -76,8 +80,23 @@ color = Color(0.192157, 0.415686, 0.223529, 1) [node name="Scene" type="Node" parent="."] +[node name="UI" type="SubViewport" parent="."] +transparent_bg = true +size = Vector2i(320, 240) + [node name="CanvasLayer" type="CanvasLayer" parent="."] -layer = 2 +layer = 3 + +[node name="TextureRect" type="TextureRect" parent="CanvasLayer"] +texture_filter = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 2 +texture = SubResource("ViewportTexture_1bvp3") +expand_mode = 1 [node name="ColorRect2" type="ColorRect" parent="CanvasLayer"] material = SubResource("ShaderMaterial_272bh") diff --git a/pane_style_box.tres b/pane_style_box.tres new file mode 100644 index 0000000..ecaa7d3 --- /dev/null +++ b/pane_style_box.tres @@ -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://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 diff --git a/panel_patch.png b/panel_patch.png new file mode 100644 index 0000000..e7a4314 Binary files /dev/null and b/panel_patch.png differ diff --git a/panel_patch.png.import b/panel_patch.png.import new file mode 100644 index 0000000..c770cbb --- /dev/null +++ b/panel_patch.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b0d2fesjkbawy" +path="res://.godot/imported/panel_patch.png-0f7e0ebf0ef3857853777c0ea247f46f.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://panel_patch.png" +dest_files=["res://.godot/imported/panel_patch.png-0f7e0ebf0ef3857853777c0ea247f46f.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 diff --git a/panel_tex.png b/panel_tex.png new file mode 100644 index 0000000..c7a9bb8 Binary files /dev/null and b/panel_tex.png differ diff --git a/panel_tex.png.import b/panel_tex.png.import new file mode 100644 index 0000000..5987267 --- /dev/null +++ b/panel_tex.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c5626mx5het1y" +path="res://.godot/imported/panel_tex.png-00e53fe522b0b0e4a7be462402eb65cf.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://panel_tex.png" +dest_files=["res://.godot/imported/panel_tex.png-00e53fe522b0b0e4a7be462402eb65cf.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 diff --git a/remix_table.gd b/remix_table.gd index 628bf3e..7591324 100644 --- a/remix_table.gd +++ b/remix_table.gd @@ -18,6 +18,7 @@ func _on_static_body_3d_button_interacted(_value: int, callback: Hero) -> void: for card: Card in callback.hand.contents: card_array.append(card) menu.hero = reply_player + menu.set_money(reply_player.currency) menu.populate_feature_slots() menu.add_option(card_array) menu.cards_remixed.connect(output) diff --git a/shield_ui.tscn b/shield_ui.tscn new file mode 100644 index 0000000..ff1f676 --- /dev/null +++ b/shield_ui.tscn @@ -0,0 +1,201 @@ +[gd_scene load_steps=22 format=3 uid="uid://cqslp83lf0ku0"] + +[ext_resource type="Script" uid="uid://kiivev1q63p0" path="res://ShieldUI.gd" id="1_aa64g"] +[ext_resource type="Texture2D" uid="uid://bv3alwpq8esky" path="res://health_border.png" id="2_lvnxo"] +[ext_resource type="Texture2D" uid="uid://d0yfidlyfyxff" path="res://health-Sheet.png" id="3_uoync"] +[ext_resource type="Texture2D" uid="uid://bifqfvhsu4c2f" path="res://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"] diff --git a/shield_ui_test.gd b/shield_ui_test.gd new file mode 100644 index 0000000..628850f --- /dev/null +++ b/shield_ui_test.gd @@ -0,0 +1,24 @@ +extends Control + +@export var shield: ShieldUI +@export var lives_bar: LivesBar +@export var damage_label: Label + +var damage: int = 1 + +func increase_damage() -> void: + damage += 1 + damage_label.text = str(damage) + + +func decrease_damage() -> void: + damage -= 1 + if damage < 1: + damage = 1 + damage_label.text = str(damage) + + +func hit() -> void: + shield.take_damage(damage) + for x: int in damage: + lives_bar.take_life() diff --git a/shield_ui_test.gd.uid b/shield_ui_test.gd.uid new file mode 100644 index 0000000..38fcbe3 --- /dev/null +++ b/shield_ui_test.gd.uid @@ -0,0 +1 @@ +uid://biuqlk7ulx83 diff --git a/shield_ui_test.tscn b/shield_ui_test.tscn new file mode 100644 index 0000000..a4e7392 --- /dev/null +++ b/shield_ui_test.tscn @@ -0,0 +1,61 @@ +[gd_scene load_steps=4 format=3 uid="uid://3t3kdhagmayy"] + +[ext_resource type="Script" uid="uid://biuqlk7ulx83" path="res://shield_ui_test.gd" id="1_uywwg"] +[ext_resource type="PackedScene" uid="uid://cqslp83lf0ku0" path="res://shield_ui.tscn" id="2_iketu"] +[ext_resource type="PackedScene" uid="uid://24x18qxqhy0i" path="res://Scenes/UI/lives_bar.tscn" id="3_eamca"] + +[node name="Control" type="Control" node_paths=PackedStringArray("shield", "lives_bar", "damage_label")] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_uywwg") +shield = NodePath("ShieldUI") +lives_bar = NodePath("LivesBar") +damage_label = NodePath("Controls/Label") + +[node name="Controls" type="HBoxContainer" parent="."] +layout_mode = 0 +offset_left = 251.0 +offset_top = 13.0 +offset_right = 311.00003 +offset_bottom = 29.0 + +[node name="Label" type="Label" parent="Controls"] +layout_mode = 2 +text = "1" + +[node name="VBoxContainer" type="HBoxContainer" parent="Controls"] +layout_mode = 2 + +[node name="Button" type="Button" parent="Controls/VBoxContainer"] +layout_mode = 2 +text = "<" + +[node name="Button2" type="Button" parent="Controls/VBoxContainer"] +layout_mode = 2 +text = ">" + +[node name="Button" type="Button" parent="Controls"] +layout_mode = 2 +text = "hit" + +[node name="ShieldUI" parent="." instance=ExtResource("2_iketu")] +layout_mode = 0 +offset_left = 130.0 +offset_top = 31.0 +offset_right = 130.0 +offset_bottom = 31.0 + +[node name="LivesBar" parent="." instance=ExtResource("3_eamca")] +layout_mode = 1 +offset_left = 69.0 +offset_top = 115.0 +offset_right = 69.0 +offset_bottom = 115.0 + +[connection signal="pressed" from="Controls/VBoxContainer/Button" to="." method="decrease_damage"] +[connection signal="pressed" from="Controls/VBoxContainer/Button2" to="." method="increase_damage"] +[connection signal="pressed" from="Controls/Button" to="." method="hit"] diff --git a/sidea_patch.png b/sidea_patch.png new file mode 100644 index 0000000..571de49 Binary files /dev/null and b/sidea_patch.png differ diff --git a/sidea_patch.png.import b/sidea_patch.png.import new file mode 100644 index 0000000..0bbfde4 --- /dev/null +++ b/sidea_patch.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cp3yr2676jkjx" +path="res://.godot/imported/sidea_patch.png-6cae89542c56b09a27871bf910466490.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://sidea_patch.png" +dest_files=["res://.godot/imported/sidea_patch.png-6cae89542c56b09a27871bf910466490.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 diff --git a/sideb_patch.png b/sideb_patch.png new file mode 100644 index 0000000..25d6f29 Binary files /dev/null and b/sideb_patch.png differ diff --git a/sideb_patch.png.import b/sideb_patch.png.import new file mode 100644 index 0000000..42116dc --- /dev/null +++ b/sideb_patch.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bm3a5gkj0spil" +path="res://.godot/imported/sideb_patch.png-c386755922b23d48adc52790a1e6ca6d.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://sideb_patch.png" +dest_files=["res://.godot/imported/sideb_patch.png-c386755922b23d48adc52790a1e6ca6d.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 diff --git a/switch_side_a_style_box.tres b/switch_side_a_style_box.tres new file mode 100644 index 0000000..aaf05cd --- /dev/null +++ b/switch_side_a_style_box.tres @@ -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://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 diff --git a/switch_side_b_style_box.tres b/switch_side_b_style_box.tres new file mode 100644 index 0000000..68953c6 --- /dev/null +++ b/switch_side_b_style_box.tres @@ -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://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 diff --git a/track_editor.gd b/track_editor.gd index b5b5d52..589d12a 100644 --- a/track_editor.gd +++ b/track_editor.gd @@ -10,11 +10,17 @@ signal cards_remixed(cards_consumed: Array[Card], cards_created: Array[Card], am @export var weapon_parts: HBoxContainer @export var drop_down: OptionButton @export var card_desc: CardDescriptionUI -@export var check_button: CheckButton @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 @@ -32,6 +38,7 @@ 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: @@ -42,7 +49,20 @@ func _ready() -> void: 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 = "$" + str(cost) + 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: @@ -71,7 +91,7 @@ func select_card(option: int) -> void: 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.button_pressed) + 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: @@ -158,10 +178,10 @@ func add_feature(feature: Feature, track: int, modify_resource: bool = true) -> 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 = "$" + str(cost) - card_desc.set_card(temp_card, check_button.button_pressed) + price_label.text = tr(PRICE_STR) + str(cost) + card_desc.set_card(temp_card, check_button_pressed) if cost > hero.currency: - $PanelContainer/VBoxContainer/InfoPanel/VBoxContainer2/Controls/ConfirmButton.disabled = true + 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) @@ -174,10 +194,10 @@ func add_feature(feature: Feature, track: int, modify_resource: bool = true) -> 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 = "$" + str(cost) - card_desc.set_card(temp_card, check_button.button_pressed) + price_label.text = tr(PRICE_STR) + str(cost) + card_desc.set_card(temp_card, check_button_pressed) if cost > hero.currency: - $PanelContainer/VBoxContainer/InfoPanel/VBoxContainer2/Controls/ConfirmButton.disabled = true + confirm_button.disabled = true func change_feature(existing_feature: FeatureUI, new_feature: Feature, track: int) -> void: @@ -188,7 +208,7 @@ func change_feature(existing_feature: FeatureUI, new_feature: Feature, track: in 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.button_pressed) + card_desc.set_card(temp_card, check_button_pressed) func attach_feat_to_mouse(feature: Feature) -> void: @@ -236,7 +256,3 @@ func _on_confirm_button_pressed() -> void: cards_to_add.append(temp_card) cards_remixed.emit(cards_to_remove, cards_to_add, cost) queue_free() - - -func _on_check_button_toggled(toggled_on: bool) -> void: - card_desc.set_card(temp_card, toggled_on) diff --git a/track_editor.tscn b/track_editor.tscn index 14ef9a3..8960094 100644 --- a/track_editor.tscn +++ b/track_editor.tscn @@ -1,11 +1,13 @@ -[gd_scene load_steps=5 format=3 uid="uid://bajli4d3nqwll"] +[gd_scene load_steps=7 format=3 uid="uid://bajli4d3nqwll"] [ext_resource type="PackedScene" uid="uid://c8xdsg6gtwvh3" path="res://feature_ui.tscn" id="1_y6tpq"] [ext_resource type="Script" uid="uid://mrv5vrlxfc13" path="res://track_editor.gd" id="1_yrnbk"] [ext_resource type="PackedScene" uid="uid://dekexkjl37dvh" path="res://price_panel.tscn" id="3_48m6c"] [ext_resource type="PackedScene" uid="uid://cmlpmr78tmo6p" path="res://card_description_ui.tscn" id="3_q6wwl"] +[ext_resource type="Texture2D" uid="uid://cll2vlvf1h454" path="res://track_one_patch.png" id="4_dya4i"] +[ext_resource type="Texture2D" uid="uid://cvhkk22pxxuqj" path="res://track_two_patch.png" id="5_4gmyw"] -[node name="Control" type="Control" node_paths=PackedStringArray("drag_feature", "sample_library", "tower_parts", "weapon_parts", "drop_down", "card_desc", "check_button", "price_label")] +[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 @@ -16,21 +18,23 @@ 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/VBoxContainer/TowerTrack/TowerParts") -weapon_parts = NodePath("PanelContainer/VBoxContainer/VBoxContainer/WeaponTrack/WeaponParts") -drop_down = NodePath("PanelContainer/VBoxContainer/VBoxContainer/SourceCartridge/CassetteSelector/OptionButton") +tower_parts = NodePath("PanelContainer/VBoxContainer/Tracks/TowerTrack/MarginContainer/MarginContainer/TowerParts") +weapon_parts = NodePath("PanelContainer/VBoxContainer/Tracks/WeaponTrack/MarginContainer/MarginContainer/WeaponParts") +drop_down = NodePath("PanelContainer/VBoxContainer/Tracks/SourceCartridge/CassetteSelector/OptionButton") card_desc = NodePath("PanelContainer/VBoxContainer/InfoPanel/VBoxContainer/DescriptionVBox") -check_button = NodePath("PanelContainer/VBoxContainer/InfoPanel/VBoxContainer/CheckButton") price_panel_scene = ExtResource("3_48m6c") -price_label = NodePath("PanelContainer/VBoxContainer/VBoxContainer/SourceCartridge/MarginContainer/Label") +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.04 -anchor_top = 0.04 -anchor_right = 0.96 -anchor_bottom = 0.96 +anchor_left = 0.02 +anchor_top = 0.02 +anchor_right = 0.98 +anchor_bottom = 0.98 grow_horizontal = 2 grow_vertical = 2 @@ -43,81 +47,124 @@ text = "TITLE_REMIX" horizontal_alignment = 1 vertical_alignment = 1 -[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/VBoxContainer"] +[node name="Tracks" type="VBoxContainer" parent="PanelContainer/VBoxContainer"] layout_mode = 2 size_flags_vertical = 3 -[node name="SourceCartridge" type="HBoxContainer" parent="PanelContainer/VBoxContainer/VBoxContainer"] +[node name="SourceCartridge" type="HBoxContainer" parent="PanelContainer/VBoxContainer/Tracks"] layout_mode = 2 size_flags_vertical = 3 -[node name="MarginContainer2" type="MarginContainer" parent="PanelContainer/VBoxContainer/VBoxContainer/SourceCartridge"] +[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/VBoxContainer/SourceCartridge"] +[node name="CassetteSelector" type="VBoxContainer" parent="PanelContainer/VBoxContainer/Tracks/SourceCartridge"] layout_mode = 2 size_flags_horizontal = 3 -[node name="Label" type="Label" parent="PanelContainer/VBoxContainer/VBoxContainer/SourceCartridge/CassetteSelector"] -layout_mode = 2 -text = "LABEL_CASSETTE_SELECTOR" -horizontal_alignment = 1 -vertical_alignment = 1 - -[node name="OptionButton" type="OptionButton" parent="PanelContainer/VBoxContainer/VBoxContainer/SourceCartridge/CassetteSelector"] +[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/VBoxContainer/SourceCartridge"] +[node name="MarginContainer" type="MarginContainer" parent="PanelContainer/VBoxContainer/Tracks/SourceCartridge"] layout_mode = 2 size_flags_horizontal = 3 -[node name="Label" type="Label" parent="PanelContainer/VBoxContainer/VBoxContainer/SourceCartridge/MarginContainer"] +[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="TowerTrack" type="HBoxContainer" parent="PanelContainer/VBoxContainer/VBoxContainer"] +[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="TowerTrack" type="HBoxContainer" parent="PanelContainer/VBoxContainer/Tracks"] layout_mode = 2 size_flags_vertical = 3 -[node name="Label" type="Label" parent="PanelContainer/VBoxContainer/VBoxContainer/TowerTrack"] +[node name="Label" type="Label" parent="PanelContainer/VBoxContainer/Tracks/TowerTrack"] layout_mode = 2 size_flags_horizontal = 3 text = "LABEL_TOWER_TRACK" horizontal_alignment = 1 vertical_alignment = 1 -[node name="TowerParts" type="HBoxContainer" parent="PanelContainer/VBoxContainer/VBoxContainer/TowerTrack"] +[node name="MarginContainer" type="MarginContainer" parent="PanelContainer/VBoxContainer/Tracks/TowerTrack"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 4.0 + +[node name="NinePatchRect" type="NinePatchRect" parent="PanelContainer/VBoxContainer/Tracks/TowerTrack/MarginContainer"] +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/TowerTrack/MarginContainer"] +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/TowerTrack/MarginContainer/MarginContainer"] layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 -size_flags_stretch_ratio = 4.0 -[node name="MarginContainer" type="MarginContainer" parent="PanelContainer/VBoxContainer/VBoxContainer"] +[node name="MarginContainer" type="MarginContainer" parent="PanelContainer/VBoxContainer/Tracks"] layout_mode = 2 theme_override_constants/margin_top = 10 -[node name="WeaponTrack" type="HBoxContainer" parent="PanelContainer/VBoxContainer/VBoxContainer"] +[node name="WeaponTrack" type="HBoxContainer" parent="PanelContainer/VBoxContainer/Tracks"] layout_mode = 2 size_flags_vertical = 3 -[node name="Label2" type="Label" parent="PanelContainer/VBoxContainer/VBoxContainer/WeaponTrack"] +[node name="Label2" type="Label" parent="PanelContainer/VBoxContainer/Tracks/WeaponTrack"] layout_mode = 2 size_flags_horizontal = 3 text = "LABEL_WEAPON_TRACK" horizontal_alignment = 1 vertical_alignment = 1 -[node name="WeaponParts" type="HBoxContainer" parent="PanelContainer/VBoxContainer/VBoxContainer/WeaponTrack"] +[node name="MarginContainer" type="MarginContainer" parent="PanelContainer/VBoxContainer/Tracks/WeaponTrack"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_stretch_ratio = 4.0 + +[node name="NinePatchRect" type="NinePatchRect" parent="PanelContainer/VBoxContainer/Tracks/WeaponTrack/MarginContainer"] +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/WeaponTrack/MarginContainer"] +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/WeaponTrack/MarginContainer/MarginContainer"] layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 -size_flags_stretch_ratio = 4.0 [node name="MarginContainer" type="MarginContainer" parent="PanelContainer/VBoxContainer"] layout_mode = 2 @@ -133,10 +180,12 @@ size_flags_stretch_ratio = 2.0 layout_mode = 2 size_flags_horizontal = 3 -[node name="CheckButton" type="CheckButton" parent="PanelContainer/VBoxContainer/InfoPanel/VBoxContainer"] +[node name="Button" type="Button" parent="PanelContainer/VBoxContainer/InfoPanel/VBoxContainer"] layout_mode = 2 size_flags_horizontal = 4 -button_pressed = true +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 @@ -192,7 +241,7 @@ grow_horizontal = 1 grow_vertical = 1 mouse_filter = 2 -[connection signal="item_selected" from="PanelContainer/VBoxContainer/VBoxContainer/SourceCartridge/CassetteSelector/OptionButton" to="." method="select_card"] -[connection signal="toggled" from="PanelContainer/VBoxContainer/InfoPanel/VBoxContainer/CheckButton" to="." method="_on_check_button_toggled"] +[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"] diff --git a/track_one_patch.png b/track_one_patch.png new file mode 100644 index 0000000..6fc3dc3 Binary files /dev/null and b/track_one_patch.png differ diff --git a/track_one_patch.png.import b/track_one_patch.png.import new file mode 100644 index 0000000..831a2ce --- /dev/null +++ b/track_one_patch.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cll2vlvf1h454" +path="res://.godot/imported/track_one_patch.png-5a380010e299cd637294c2754d938c6c.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://track_one_patch.png" +dest_files=["res://.godot/imported/track_one_patch.png-5a380010e299cd637294c2754d938c6c.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 diff --git a/track_two_patch.png b/track_two_patch.png new file mode 100644 index 0000000..06a7879 Binary files /dev/null and b/track_two_patch.png differ diff --git a/track_two_patch.png.import b/track_two_patch.png.import new file mode 100644 index 0000000..41bf975 --- /dev/null +++ b/track_two_patch.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cvhkk22pxxuqj" +path="res://.godot/imported/track_two_patch.png-c2aa8b915c0063c9cb99d93fc0c36ee4.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://track_two_patch.png" +dest_files=["res://.godot/imported/track_two_patch.png-c2aa8b915c0063c9cb99d93fc0c36ee4.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