[gd_scene load_steps=4 format=3 uid="uid://1k1h15e4tiei"]

[ext_resource type="Script" path="res://src/trade/trade.gd" id="1_x14ix"]
[ext_resource type="Theme" uid="uid://bdofl7w84udo" path="res://src/menus.tres" id="2_2cx3y"]
[ext_resource type="PackedScene" uid="uid://b6p1b5g3r77su" path="res://src/weird_background.tscn" id="2_fustq"]

[node name="Trade" type="Node2D" node_paths=PackedStringArray("_fade_rect", "_main_menu", "_offer_container", "_desired_container", "_player_inventory_container", "_dialogue_name_label", "_dialogue_label", "_offering_menu", "_offer_dialogue_name_label", "_offer_dialogue_label", "_offer_player_inventory_label", "_offer_player_inventory_container", "_offer_current_items", "_offer_selected_box", "_offer_selected_num_spin_box", "_offer_box", "_offer_box_slot", "_offer_num_spin_box")]
script = ExtResource("1_x14ix")
_fade_rect = NodePath("CanvasLayer/FadeRect")
_main_menu = NodePath("CanvasLayer/MainMenu")
_offer_container = NodePath("CanvasLayer/MainMenu/Offers/ScrollContainer/ContentMargin/OfferContainer")
_desired_container = NodePath("CanvasLayer/MainMenu/Desired/ScrollContainer/ContentMargin/DesiredContainer")
_player_inventory_container = NodePath("CanvasLayer/MainMenu/PlayerInventory/ScrollContainer/ContentMargin/ItemContainer")
_dialogue_name_label = NodePath("CanvasLayer/MainMenu/DialogueNameLabel")
_dialogue_label = NodePath("CanvasLayer/MainMenu/DialogueBox/DialogueLabel")
_offering_menu = NodePath("CanvasLayer/OfferingMenu")
_offer_dialogue_name_label = NodePath("CanvasLayer/OfferingMenu/DialogueNameLabel")
_offer_dialogue_label = NodePath("CanvasLayer/OfferingMenu/DialogueBox/DialogueLabel")
_offer_player_inventory_label = NodePath("CanvasLayer/OfferingMenu/PlayerInventoryLabel")
_offer_player_inventory_container = NodePath("CanvasLayer/OfferingMenu/PlayerInventory/ScrollContainer/ContentMargin/ItemContainer")
_offer_current_items = NodePath("CanvasLayer/OfferingMenu/CurrentOffers/ScrollContainer/ContentMargin/ItemContainer")
_offer_selected_box = NodePath("CanvasLayer/OfferingMenu/SelectedBox")
_offer_selected_num_spin_box = NodePath("CanvasLayer/OfferingMenu/SelectedNumSpinBox")
_offer_box = NodePath("CanvasLayer/OfferingMenu/OfferBox")
_offer_box_slot = NodePath("CanvasLayer/OfferingMenu/OfferBox/OfferBoxSlot")
_offer_num_spin_box = NodePath("CanvasLayer/OfferingMenu/OfferBox/NumSpinBox")

[node name="CanvasLayer" type="CanvasLayer" parent="."]

[node name="WeirdBackground" parent="CanvasLayer" instance=ExtResource("2_fustq")]
offset_top = -76.0
offset_bottom = 76.0

[node name="MainMenu" type="Control" parent="CanvasLayer"]
visible = false
layout_mode = 3
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -20.0
offset_top = -20.0
offset_right = 20.0
offset_bottom = 20.0
grow_horizontal = 2
grow_vertical = 2
theme = ExtResource("2_2cx3y")

[node name="OffersLabel" type="RichTextLabel" parent="CanvasLayer/MainMenu"]
clip_contents = false
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -312.0
offset_top = -172.0
offset_right = -144.0
offset_bottom = -148.0
grow_horizontal = 2
grow_vertical = 2
bbcode_enabled = true
text = "Offers"
autowrap_mode = 0

[node name="Offers" type="Panel" parent="CanvasLayer/MainMenu"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -312.0
offset_top = -140.0
offset_right = -136.0
offset_bottom = -4.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
metadata/_edit_group_ = true

[node name="ScrollContainer" type="ScrollContainer" parent="CanvasLayer/MainMenu/Offers"]
layout_mode = 1
anchors_preset = -1
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 8.0
offset_top = 8.0
offset_right = -8.0
offset_bottom = -8.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
horizontal_scroll_mode = 0
metadata/_edit_use_anchors_ = true

[node name="ContentMargin" type="MarginContainer" parent="CanvasLayer/MainMenu/Offers/ScrollContainer"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme_override_constants/margin_left = 8
theme_override_constants/margin_top = 8
theme_override_constants/margin_right = 8
theme_override_constants/margin_bottom = 8

[node name="OfferContainer" type="HFlowContainer" parent="CanvasLayer/MainMenu/Offers/ScrollContainer/ContentMargin"]
layout_mode = 2
size_flags_horizontal = 3

[node name="DesiredLabel" type="RichTextLabel" parent="CanvasLayer/MainMenu"]
clip_contents = false
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -120.0
offset_top = -172.0
offset_right = 48.0
offset_bottom = -148.0
grow_horizontal = 2
grow_vertical = 2
bbcode_enabled = true
text = "Wants"
autowrap_mode = 0

[node name="Desired" type="Panel" parent="CanvasLayer/MainMenu"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -120.0
offset_top = -140.0
offset_right = 64.0
offset_bottom = -4.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
metadata/_edit_group_ = true

[node name="ScrollContainer" type="ScrollContainer" parent="CanvasLayer/MainMenu/Desired"]
layout_mode = 1
anchors_preset = -1
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 8.0
offset_top = 8.0
offset_right = -8.0
offset_bottom = -8.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
horizontal_scroll_mode = 0
metadata/_edit_use_anchors_ = true

[node name="ContentMargin" type="MarginContainer" parent="CanvasLayer/MainMenu/Desired/ScrollContainer"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme_override_constants/margin_left = 8
theme_override_constants/margin_top = 8
theme_override_constants/margin_right = 8
theme_override_constants/margin_bottom = 8

[node name="DesiredContainer" type="HFlowContainer" parent="CanvasLayer/MainMenu/Desired/ScrollContainer/ContentMargin"]
layout_mode = 2
size_flags_horizontal = 3

[node name="PlayerInventoryLabel" type="RichTextLabel" parent="CanvasLayer/MainMenu"]
clip_contents = false
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -312.0
offset_top = 12.0
offset_right = -144.0
offset_bottom = 36.0
grow_horizontal = 2
grow_vertical = 2
bbcode_enabled = true
text = "Your Stuff"
autowrap_mode = 0

[node name="PlayerInventory" type="Panel" parent="CanvasLayer/MainMenu"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -312.0
offset_top = 44.0
offset_right = 64.0
offset_bottom = 172.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
metadata/_edit_group_ = true

[node name="ScrollContainer" type="ScrollContainer" parent="CanvasLayer/MainMenu/PlayerInventory"]
layout_mode = 1
anchors_preset = -1
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 8.0
offset_top = 8.0
offset_right = -8.0
offset_bottom = -8.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
horizontal_scroll_mode = 0
metadata/_edit_use_anchors_ = true

[node name="ContentMargin" type="MarginContainer" parent="CanvasLayer/MainMenu/PlayerInventory/ScrollContainer"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme_override_constants/margin_left = 8
theme_override_constants/margin_top = 8
theme_override_constants/margin_right = 8
theme_override_constants/margin_bottom = 8

[node name="ItemContainer" type="HFlowContainer" parent="CanvasLayer/MainMenu/PlayerInventory/ScrollContainer/ContentMargin"]
layout_mode = 2
size_flags_horizontal = 3

[node name="DialogueNameLabel" type="RichTextLabel" parent="CanvasLayer/MainMenu"]
clip_contents = false
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = 72.0
offset_top = 28.0
offset_right = 240.0
offset_bottom = 44.0
grow_horizontal = 2
grow_vertical = 2
theme_override_font_sizes/normal_font_size = 12
bbcode_enabled = true
text = "???"
autowrap_mode = 0

[node name="DialogueBox" type="Panel" parent="CanvasLayer/MainMenu"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = 72.0
offset_top = 44.0
offset_right = 312.0
offset_bottom = 132.0
grow_horizontal = 2
grow_vertical = 2
metadata/_edit_group_ = true

[node name="DialogueLabel" type="RichTextLabel" parent="CanvasLayer/MainMenu/DialogueBox"]
layout_mode = 1
anchors_preset = -1
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 12.0
offset_top = 12.0
offset_right = -12.0
offset_bottom = -12.0
grow_horizontal = 2
grow_vertical = 2
theme_override_font_sizes/normal_font_size = 12
bbcode_enabled = true
visible_characters_behavior = 1

[node name="Cancel" type="Button" parent="CanvasLayer/MainMenu"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = 72.0
offset_top = 140.0
offset_right = 312.0
offset_bottom = 172.0
grow_horizontal = 2
grow_vertical = 2
text = "get out of here"

[node name="OfferingMenu" type="Control" parent="CanvasLayer"]
layout_mode = 3
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -20.0
offset_top = -20.0
offset_right = 20.0
offset_bottom = 20.0
grow_horizontal = 2
grow_vertical = 2
theme = ExtResource("2_2cx3y")

[node name="PlayerInventoryLabel" type="RichTextLabel" parent="CanvasLayer/OfferingMenu"]
clip_contents = false
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = 64.0
offset_top = -172.0
offset_right = 312.0
offset_bottom = -148.0
grow_horizontal = 2
grow_vertical = 2
bbcode_enabled = true
text = "Your Stuff"
autowrap_mode = 0

[node name="PlayerInventory" type="Panel" parent="CanvasLayer/OfferingMenu"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = 56.0
offset_top = -140.0
offset_right = 312.0
offset_bottom = 44.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
metadata/_edit_group_ = true

[node name="ScrollContainer" type="ScrollContainer" parent="CanvasLayer/OfferingMenu/PlayerInventory"]
layout_mode = 1
anchors_preset = -1
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 8.0
offset_top = 8.0
offset_right = -8.0
offset_bottom = -8.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
horizontal_scroll_mode = 0
metadata/_edit_use_anchors_ = true

[node name="ContentMargin" type="MarginContainer" parent="CanvasLayer/OfferingMenu/PlayerInventory/ScrollContainer"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
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="ItemContainer" type="HFlowContainer" parent="CanvasLayer/OfferingMenu/PlayerInventory/ScrollContainer/ContentMargin"]
layout_mode = 2
size_flags_horizontal = 3

[node name="DialogueNameLabel" type="RichTextLabel" parent="CanvasLayer/OfferingMenu"]
clip_contents = false
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -312.0
offset_top = 60.0
offset_right = -56.0
offset_bottom = 76.0
grow_horizontal = 2
grow_vertical = 2
theme_override_font_sizes/normal_font_size = 12
bbcode_enabled = true
text = "???"
autowrap_mode = 0

[node name="DialogueBox" type="Panel" parent="CanvasLayer/OfferingMenu"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -312.0
offset_top = 76.0
offset_right = -88.0
offset_bottom = 172.0
grow_horizontal = 2
grow_vertical = 2
metadata/_edit_group_ = true

[node name="DialogueLabel" type="RichTextLabel" parent="CanvasLayer/OfferingMenu/DialogueBox"]
layout_mode = 1
anchors_preset = -1
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 12.0
offset_top = 12.0
offset_right = -12.0
offset_bottom = -12.0
grow_horizontal = 2
grow_vertical = 2
theme_override_font_sizes/normal_font_size = 12
bbcode_enabled = true
visible_characters_behavior = 1

[node name="Accept" type="Button" parent="CanvasLayer/OfferingMenu"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -80.0
offset_top = 76.0
offset_right = 48.0
offset_bottom = 116.0
grow_horizontal = 2
grow_vertical = 2
text = "accept"

[node name="Back" type="Button" parent="CanvasLayer/OfferingMenu"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -80.0
offset_top = 132.0
offset_right = 48.0
offset_bottom = 172.0
grow_horizontal = 2
grow_vertical = 2
text = "back"

[node name="CurrentOffersLabel" type="RichTextLabel" parent="CanvasLayer/OfferingMenu"]
clip_contents = false
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -312.0
offset_top = -172.0
offset_right = -136.0
offset_bottom = -148.0
grow_horizontal = 2
grow_vertical = 2
bbcode_enabled = true
text = "Offering"
autowrap_mode = 0

[node name="CurrentOffers" type="Panel" parent="CanvasLayer/OfferingMenu"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -312.0
offset_top = -140.0
offset_right = -120.0
offset_bottom = 44.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
metadata/_edit_group_ = true

[node name="ScrollContainer" type="ScrollContainer" parent="CanvasLayer/OfferingMenu/CurrentOffers"]
layout_mode = 1
anchors_preset = -1
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 8.0
offset_top = 8.0
offset_right = -8.0
offset_bottom = -8.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
horizontal_scroll_mode = 0
metadata/_edit_use_anchors_ = true

[node name="ContentMargin" type="MarginContainer" parent="CanvasLayer/OfferingMenu/CurrentOffers/ScrollContainer"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
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="ItemContainer" type="HFlowContainer" parent="CanvasLayer/OfferingMenu/CurrentOffers/ScrollContainer/ContentMargin"]
layout_mode = 2
size_flags_horizontal = 3

[node name="SelectedLabel" type="RichTextLabel" parent="CanvasLayer/OfferingMenu"]
clip_contents = false
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -96.0
offset_top = -116.0
offset_right = 32.0
offset_bottom = -92.0
grow_horizontal = 2
grow_vertical = 2
bbcode_enabled = true
text = "[center]Selected[/center]"
autowrap_mode = 0

[node name="SelectedBox" type="Control" parent="CanvasLayer/OfferingMenu"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -64.0
offset_top = -84.0
offset_bottom = -20.0
grow_horizontal = 2
grow_vertical = 2

[node name="SelectedNumSpinBox" type="SpinBox" parent="CanvasLayer/OfferingMenu"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -80.0
offset_top = -12.0
offset_right = 8.0
offset_bottom = 19.0
grow_horizontal = 2
grow_vertical = 2
min_value = 1.0
max_value = 1.0
value = 1.0
alignment = 1
editable = false
update_on_text_changed = true
prefix = "x"

[node name="OfferBox" type="Panel" parent="CanvasLayer/OfferingMenu"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = 96.0
offset_top = 60.0
offset_right = 208.0
offset_bottom = 172.0
grow_horizontal = 2
grow_vertical = 2
metadata/_edit_group_ = true

[node name="OfferBoxSlot" type="Control" parent="CanvasLayer/OfferingMenu/OfferBox"]
layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_top = 38.0
grow_horizontal = 2

[node name="NumSpinBox" type="SpinBox" parent="CanvasLayer/OfferingMenu/OfferBox"]
texture_filter = 1
layout_mode = 1
anchors_preset = -1
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_bottom = -8.0
grow_horizontal = 2
grow_vertical = 0
focus_mode = 2
min_value = 1.0
value = 1.0
rounded = true
alignment = 1
editable = false
update_on_text_changed = true
prefix = "x"

[node name="AddOffer" type="Button" parent="CanvasLayer/OfferingMenu"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = 216.0
offset_top = 84.0
offset_right = 280.0
offset_bottom = 148.0
grow_horizontal = 2
grow_vertical = 2
text = "add"

[node name="FadeRect" type="ColorRect" parent="CanvasLayer"]
visible = false
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
color = Color(0, 0, 0, 1)

[connection signal="pressed" from="CanvasLayer/MainMenu/Cancel" to="." method="end_trade"]
[connection signal="pressed" from="CanvasLayer/OfferingMenu/Accept" to="." method="_on_offer_accept_pressed"]
[connection signal="pressed" from="CanvasLayer/OfferingMenu/Back" to="." method="_on_offer_back_pressed"]
[connection signal="pressed" from="CanvasLayer/OfferingMenu/AddOffer" to="." method="_on_offer_add_pressed"]
