more work on the ui theme and changing the hud
This commit is contained in:
36
Scenes/MixingTable/remix_table.gd
Normal file
36
Scenes/MixingTable/remix_table.gd
Normal file
@@ -0,0 +1,36 @@
|
||||
class_name RemixTable
|
||||
extends StaticBody3D
|
||||
|
||||
@export var remix_menu_scene: PackedScene
|
||||
@export var button: InteractButton
|
||||
|
||||
var reply_player: Hero
|
||||
|
||||
func _ready() -> void:
|
||||
button.hover_text = tr("PROMPT_REMIX_INTERACT")
|
||||
|
||||
|
||||
func _on_static_body_3d_button_interacted(_value: int, callback: Hero) -> void:
|
||||
if callback.hand.size >= 1:
|
||||
reply_player = callback
|
||||
var menu: TrackEditor = remix_menu_scene.instantiate() as TrackEditor
|
||||
var card_array: Array[Card] = []
|
||||
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)
|
||||
reply_player.pause()
|
||||
reply_player.hud.add_child(menu)
|
||||
|
||||
|
||||
func output(cards_to_remove: Array[Card], cards_to_add: Array[Card], amount_spent: int) -> void:
|
||||
for card: Card in cards_to_remove:
|
||||
reply_player.hand.contents.erase(card)
|
||||
reply_player.check_removal()
|
||||
for card: Card in cards_to_add:
|
||||
reply_player.add_card(card)
|
||||
reply_player.currency -= amount_spent
|
||||
reply_player.unpause()
|
||||
1
Scenes/MixingTable/remix_table.gd.uid
Normal file
1
Scenes/MixingTable/remix_table.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bpvmvx10q4ayd
|
||||
34
Scenes/MixingTable/remix_table.tscn
Normal file
34
Scenes/MixingTable/remix_table.tscn
Normal file
@@ -0,0 +1,34 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://c6isprnkaliqr"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bpvmvx10q4ayd" path="res://Scenes/MixingTable/remix_table.gd" id="1_q8doq"]
|
||||
[ext_resource type="PackedScene" uid="uid://bajli4d3nqwll" path="res://UI/Menus/MixingMenu/track_editor.tscn" id="2_ibyhf"]
|
||||
[ext_resource type="Script" uid="uid://dkfswql8ui0bt" path="res://Scripts/interact_button.gd" id="2_mjah6"]
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_ibyhf"]
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_78x4u"]
|
||||
size = Vector3(0.5, 0.5, 0.5)
|
||||
|
||||
[node name="RemixTable" type="StaticBody3D" node_paths=PackedStringArray("button")]
|
||||
script = ExtResource("1_q8doq")
|
||||
remix_menu_scene = ExtResource("2_ibyhf")
|
||||
button = NodePath("StaticBody3D")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
shape = SubResource("BoxShape3D_ibyhf")
|
||||
|
||||
[node name="CSGBox3D" type="CSGBox3D" parent="."]
|
||||
|
||||
[node name="StaticBody3D" type="StaticBody3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.524303, 0)
|
||||
collision_layer = 16
|
||||
collision_mask = 0
|
||||
script = ExtResource("2_mjah6")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="StaticBody3D"]
|
||||
shape = SubResource("BoxShape3D_78x4u")
|
||||
|
||||
[node name="CSGBox3D" type="CSGBox3D" parent="StaticBody3D"]
|
||||
size = Vector3(0.5, 0.5, 0.5)
|
||||
|
||||
[connection signal="button_interacted" from="StaticBody3D" to="." method="_on_static_body_3d_button_interacted"]
|
||||
Reference in New Issue
Block a user