revamped key rebinding system
This commit is contained in:
@ -1,6 +1,5 @@
|
||||
class_name CardPrinter extends StaticBody3D
|
||||
|
||||
@export var item_card_scene: PackedScene
|
||||
@export var button_collider: CollisionShape3D
|
||||
@export var button_box: Node3D
|
||||
|
||||
@ -48,16 +47,16 @@ func randomize_cards(faction: Card.Faction) -> void:
|
||||
if card.rarity == decided_rarity:
|
||||
card_array.append(card)
|
||||
cards_chosen = true
|
||||
decided_rarity -= 1
|
||||
if decided_rarity < 0:
|
||||
card_array.append(Data.cards[0])
|
||||
cards_chosen = true
|
||||
decided_rarity -= 1
|
||||
var card: Card
|
||||
if card_array.size() > 0:
|
||||
card = card_array[Game.randi_in_range(132 * cards_generated, 0, card_array.size() - 1)]
|
||||
cards_generated += 1
|
||||
card_array.erase(card)
|
||||
var item: CardItem = item_card_scene.instantiate() as CardItem
|
||||
var item: CardItem = reply_player.hero_class.card_item.instantiate() as CardItem
|
||||
item.set_card(card)
|
||||
item.position = Vector3(x, 1, 2)
|
||||
item.pressed.connect(card_picked_up)
|
||||
|
@ -1,7 +1,6 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://1b2ikdanl66b"]
|
||||
[gd_scene load_steps=8 format=3 uid="uid://1b2ikdanl66b"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bivtfdl3p1brv" path="res://Scenes/CardPrinter/card_printer.gd" id="1_qft15"]
|
||||
[ext_resource type="PackedScene" uid="uid://dq8v5e11rvyi6" path="res://plan.tscn" id="2_8jpsw"]
|
||||
[ext_resource type="Script" uid="uid://dkfswql8ui0bt" path="res://Scripts/interact_button.gd" id="4_eavi1"]
|
||||
[ext_resource type="AudioStream" uid="uid://dknygn5eyuhxt" path="res://Audio/shot1.wav" id="5_m033a"]
|
||||
|
||||
@ -21,7 +20,6 @@ stream_0/stream = ExtResource("5_m033a")
|
||||
|
||||
[node name="CardPrinter" type="StaticBody3D" node_paths=PackedStringArray("button_collider", "button_box")]
|
||||
script = ExtResource("1_qft15")
|
||||
item_card_scene = ExtResource("2_8jpsw")
|
||||
button_collider = NodePath("StaticBody3D/CollisionShape3D2")
|
||||
button_box = NodePath("StaticBody3D/CollisionShape3D2/CSGBox3D")
|
||||
|
||||
|
@ -25,7 +25,7 @@ func _ready() -> void:
|
||||
bg_level.a_star_graph_3d.place_random_towers(20)
|
||||
bg_level.a_star_graph_3d.disable_all_tower_frames()
|
||||
Game.level = bg_level
|
||||
WaveManager.generate_wave(400, bg_level.enemy_pool, bg_level.enemy_spawns)
|
||||
WaveManager.generate_wave(1000, bg_level.enemy_pool, bg_level.enemy_spawns)
|
||||
for spawn: EnemySpawner in bg_level.enemy_spawns:
|
||||
spawn.enemy_died_callback = enemy_died
|
||||
spawn.enemy_reached_goal_callback = damage_goal
|
||||
@ -36,7 +36,7 @@ func _ready() -> void:
|
||||
#these exist purely to make the enemies that spawn on the main menu happy
|
||||
func enemy_died(_some_arg: Enemy) -> void:
|
||||
pass
|
||||
func damage_goal(_some_arg1: int, _some_arg2: int) -> void:
|
||||
func damage_goal(_some_arg1: Enemy, _some_arg2: int) -> void:
|
||||
pass
|
||||
func increase_enemy_count() -> void:
|
||||
pass
|
||||
@ -45,7 +45,7 @@ func increase_enemy_count() -> void:
|
||||
func _on_display_name_edit_pressed() -> void:
|
||||
$ProfileManager.visible = true
|
||||
$ProfileManager/VBoxContainer/DisplayName/LineEdit.placeholder_text = Data.player_profile.display_name
|
||||
temp_data = SaveData.load_profile_from_disk()
|
||||
temp_data = SaveData.load_from_disk(0)
|
||||
|
||||
|
||||
func change_profile_display_name(display_name: String) -> void:
|
||||
|
@ -14,6 +14,7 @@ script = ExtResource("1_oxg0p")
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ColumnLabels" type="HBoxContainer" parent="."]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Action" type="Label" parent="ColumnLabels"]
|
||||
|
@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://ckuu2y4kymshy"]
|
||||
[gd_scene load_steps=2 format=3 uid="uid://cb8irvp2y2p6g"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://y2pxkfjn0wa2" path="res://UI/KeybindEntry.gd" id="1_it8q2"]
|
||||
|
||||
@ -8,6 +8,8 @@ anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
script = ExtResource("1_it8q2")
|
||||
|
||||
[node name="ActionName" type="Label" parent="."]
|
||||
@ -17,21 +19,16 @@ text = "Action Name"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="Buttons" type="HBoxContainer" parent="."]
|
||||
[node name="Buttons" type="GridContainer" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
columns = 4
|
||||
|
||||
[node name="PrimaryBind" type="Button" parent="Buttons"]
|
||||
[node name="AddBindButton" type="Button" parent="Buttons"]
|
||||
custom_minimum_size = Vector2(80, 80)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "+"
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
|
||||
[node name="SecondaryBind" type="Button" parent="Buttons"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
|
||||
[connection signal="pressed" from="Buttons/PrimaryBind" to="." method="_on_primary_bind_pressed"]
|
||||
[connection signal="pressed" from="Buttons/SecondaryBind" to="." method="_on_secondary_bind_pressed"]
|
||||
[connection signal="pressed" from="Buttons/AddBindButton" to="." method="_on_add_bind_button_pressed"]
|
||||
|
@ -56,7 +56,7 @@ libraries = {
|
||||
}
|
||||
|
||||
[node name="Timer" type="Timer" parent="."]
|
||||
wait_time = 2.0
|
||||
wait_time = 4.0
|
||||
one_shot = true
|
||||
|
||||
[node name="AudioStreamPlayer3D" type="AudioStreamPlayer3D" parent="."]
|
||||
|
Reference in New Issue
Block a user