meowbay created and other things
This commit is contained in:
parent
09625d8285
commit
93cc1a8c59
35 changed files with 318 additions and 41 deletions
|
|
@ -18,5 +18,9 @@ func scavs_ready():
|
||||||
var new_slot = load("res://inv_system/item_slot.tscn").instantiate() as ItemSlot
|
var new_slot = load("res://inv_system/item_slot.tscn").instantiate() as ItemSlot
|
||||||
new_slot.item = scav.input
|
new_slot.item = scav.input
|
||||||
new_slot.block_taking = true
|
new_slot.block_taking = true
|
||||||
|
var scav_preview : String = str(scav.rolls) + " Rolls"
|
||||||
|
for loot in scav.loot_pool:
|
||||||
|
scav_preview += "\n" + loot.item.item_name + " : " + str(loot.chance) + " Chance"
|
||||||
|
new_slot.extra_data = scav_preview
|
||||||
grid.add_child(new_slot)
|
grid.add_child(new_slot)
|
||||||
pass
|
pass
|
||||||
|
|
|
||||||
|
|
@ -6,3 +6,5 @@ class_name ItemData
|
||||||
@export var value : String
|
@export var value : String
|
||||||
@export var custom_panel_style : StyleBox
|
@export var custom_panel_style : StyleBox
|
||||||
@export var bin_chance : int = 5
|
@export var bin_chance : int = 5
|
||||||
|
@export var buy_value : int = 10
|
||||||
|
@export var can_buy : bool = false
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ class_name ItemSlot
|
||||||
var type : String
|
var type : String
|
||||||
var block_taking : bool = false
|
var block_taking : bool = false
|
||||||
const DEFAULT = preload("uid://hgjmkwj0dbqr")
|
const DEFAULT = preload("uid://hgjmkwj0dbqr")
|
||||||
|
var extra_data : String = ""
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
|
|
@ -61,7 +62,7 @@ func _drop_data(at_position: Vector2, data: Variant) -> void:
|
||||||
func _on_mouse_entered() -> void:
|
func _on_mouse_entered() -> void:
|
||||||
#print("im real?")
|
#print("im real?")
|
||||||
if item:
|
if item:
|
||||||
Tooltip.show_tip(item.item_name)
|
Tooltip.show_tip(item.item_name, extra_data)
|
||||||
MouseTweaks.hovered_slot = self
|
MouseTweaks.hovered_slot = self
|
||||||
pass # Replace with function body.
|
pass # Replace with function body.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@ extends Node
|
||||||
|
|
||||||
@export var inventory_panel : Inventory
|
@export var inventory_panel : Inventory
|
||||||
@export var button : Button
|
@export var button : Button
|
||||||
|
@export var money : int = 0
|
||||||
|
@export var money_label : Label
|
||||||
|
|
||||||
# Called when the node enters the scene tree for the first time.
|
# Called when the node enters the scene tree for the first time.
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
|
|
@ -11,7 +13,7 @@ func _ready() -> void:
|
||||||
|
|
||||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
func _process(delta: float) -> void:
|
func _process(delta: float) -> void:
|
||||||
pass
|
money_label.text = "Money: $" + str(money)
|
||||||
|
|
||||||
|
|
||||||
func _on_button_pressed() -> void:
|
func _on_button_pressed() -> void:
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ corner_radius_bottom_right = 3
|
||||||
corner_radius_bottom_left = 3
|
corner_radius_bottom_left = 3
|
||||||
corner_detail = 5
|
corner_detail = 5
|
||||||
|
|
||||||
[node name="PlayerInventory" type="Control" node_paths=PackedStringArray("inventory_panel", "button")]
|
[node name="PlayerInventory" type="Control" node_paths=PackedStringArray("inventory_panel", "button", "money_label")]
|
||||||
z_index = 2
|
z_index = 2
|
||||||
layout_mode = 3
|
layout_mode = 3
|
||||||
anchors_preset = 15
|
anchors_preset = 15
|
||||||
|
|
@ -54,8 +54,10 @@ mouse_filter = 2
|
||||||
script = ExtResource("1_vk2kx")
|
script = ExtResource("1_vk2kx")
|
||||||
inventory_panel = NodePath("TabContainer/Inventory")
|
inventory_panel = NodePath("TabContainer/Inventory")
|
||||||
button = NodePath("Button")
|
button = NodePath("Button")
|
||||||
|
money_label = NodePath("PanelContainer/Label")
|
||||||
|
|
||||||
[node name="Button" type="Button" parent="."]
|
[node name="Button" type="Button" parent="."]
|
||||||
|
visible = false
|
||||||
layout_mode = 1
|
layout_mode = 1
|
||||||
anchors_preset = 2
|
anchors_preset = 2
|
||||||
anchor_top = 1.0
|
anchor_top = 1.0
|
||||||
|
|
@ -249,4 +251,16 @@ autowrap_mode = 2
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
columns = 5
|
columns = 5
|
||||||
|
|
||||||
|
[node name="PanelContainer" type="PanelContainer" parent="."]
|
||||||
|
layout_mode = 0
|
||||||
|
offset_left = 132.0
|
||||||
|
offset_top = 566.0
|
||||||
|
offset_right = 389.0
|
||||||
|
offset_bottom = 608.0
|
||||||
|
|
||||||
|
[node name="Label" type="Label" parent="PanelContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
text = "Money: $0"
|
||||||
|
horizontal_alignment = 1
|
||||||
|
|
||||||
[connection signal="pressed" from="Button" to="." method="_on_button_pressed"]
|
[connection signal="pressed" from="Button" to="." method="_on_button_pressed"]
|
||||||
|
|
|
||||||
40
inv_system/sell_panel.gd
Normal file
40
inv_system/sell_panel.gd
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
extends Inventory
|
||||||
|
|
||||||
|
@export var sell_label : Label
|
||||||
|
@export var sell_button : Button
|
||||||
|
|
||||||
|
# Called when the node enters the scene tree for the first time.
|
||||||
|
func _ready() -> void:
|
||||||
|
super()
|
||||||
|
calculate_sell_value()
|
||||||
|
pass # Replace with function body.
|
||||||
|
|
||||||
|
|
||||||
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
|
func _process(delta: float) -> void:
|
||||||
|
super(delta)
|
||||||
|
pass
|
||||||
|
|
||||||
|
func _notification(what: int) -> void:
|
||||||
|
super(what)
|
||||||
|
if what == Node.NOTIFICATION_DRAG_END:
|
||||||
|
calculate_sell_value()
|
||||||
|
pass
|
||||||
|
|
||||||
|
func calculate_sell_value():
|
||||||
|
if slots[0].item:
|
||||||
|
sell_label.text = str(floori(slots[0].item.buy_value / float(2)))
|
||||||
|
sell_button.disabled = false
|
||||||
|
else:
|
||||||
|
sell_label.text = "Place an item"
|
||||||
|
sell_button.disabled = true
|
||||||
|
|
||||||
|
|
||||||
|
func _on_sell_button_pressed() -> void:
|
||||||
|
if slots[0].item:
|
||||||
|
var sell_value : int = floori(slots[0].item.buy_value / float(2))
|
||||||
|
slots[0].item = null
|
||||||
|
slots[0].update_ui()
|
||||||
|
PlayerInventory.money += sell_value
|
||||||
|
calculate_sell_value()
|
||||||
|
|
||||||
1
inv_system/sell_panel.gd.uid
Normal file
1
inv_system/sell_panel.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://5uka1h3vmcg4
|
||||||
60
inv_system/sell_panel.tscn
Normal file
60
inv_system/sell_panel.tscn
Normal file
|
|
@ -0,0 +1,60 @@
|
||||||
|
[gd_scene load_steps=3 format=3 uid="uid://cqqpf7fca5nk1"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://5uka1h3vmcg4" path="res://inv_system/sell_panel.gd" id="1_ut1o0"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://dgqs20xf7l8c" path="res://inv_system/item_slot.tscn" id="2_p0fcq"]
|
||||||
|
|
||||||
|
[node name="SellPanel" type="PanelContainer" node_paths=PackedStringArray("sell_label", "sell_button", "slots", "grid", "inv_label")]
|
||||||
|
offset_left = 51.0
|
||||||
|
offset_top = 67.0
|
||||||
|
offset_right = 403.0
|
||||||
|
offset_bottom = 205.0
|
||||||
|
script = ExtResource("1_ut1o0")
|
||||||
|
sell_label = NodePath("MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/Label2")
|
||||||
|
sell_button = NodePath("MarginContainer/VBoxContainer/SellButton")
|
||||||
|
inventory_name = "Sell Items"
|
||||||
|
slots = [NodePath("MarginContainer/VBoxContainer/HBoxContainer/GridContainer/ItemSlot")]
|
||||||
|
type = "Sell"
|
||||||
|
grid = NodePath("MarginContainer/VBoxContainer/HBoxContainer/GridContainer")
|
||||||
|
inv_label = NodePath("MarginContainer/VBoxContainer/Label")
|
||||||
|
|
||||||
|
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||||
|
layout_mode = 2
|
||||||
|
theme_override_constants/margin_left = 5
|
||||||
|
theme_override_constants/margin_top = 5
|
||||||
|
theme_override_constants/margin_right = 5
|
||||||
|
theme_override_constants/margin_bottom = 5
|
||||||
|
|
||||||
|
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
text = "Inventory 1"
|
||||||
|
|
||||||
|
[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="GridContainer" type="GridContainer" parent="MarginContainer/VBoxContainer/HBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="ItemSlot" parent="MarginContainer/VBoxContainer/HBoxContainer/GridContainer" instance=ExtResource("2_p0fcq")]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/VBoxContainer/HBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
alignment = 1
|
||||||
|
|
||||||
|
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
text = "Sell value:"
|
||||||
|
|
||||||
|
[node name="Label2" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
text = "1234"
|
||||||
|
|
||||||
|
[node name="SellButton" type="Button" parent="MarginContainer/VBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
text = "Sell!"
|
||||||
|
|
||||||
|
[connection signal="pressed" from="MarginContainer/VBoxContainer/SellButton" to="." method="_on_sell_button_pressed"]
|
||||||
|
|
@ -8,4 +8,6 @@ script = ExtResource("2_6iu4j")
|
||||||
item_name = "Battery"
|
item_name = "Battery"
|
||||||
icon = ExtResource("1_i7fpe")
|
icon = ExtResource("1_i7fpe")
|
||||||
bin_chance = 2
|
bin_chance = 2
|
||||||
|
buy_value = 25
|
||||||
|
can_buy = true
|
||||||
metadata/_custom_type_script = "uid://dccraom7a7e8d"
|
metadata/_custom_type_script = "uid://dccraom7a7e8d"
|
||||||
|
|
|
||||||
|
|
@ -10,4 +10,5 @@ item_name = "Broken Laptop"
|
||||||
icon = ExtResource("1_k071h")
|
icon = ExtResource("1_k071h")
|
||||||
custom_panel_style = ExtResource("1_8brb6")
|
custom_panel_style = ExtResource("1_8brb6")
|
||||||
bin_chance = 7
|
bin_chance = 7
|
||||||
|
buy_value = 2
|
||||||
metadata/_custom_type_script = "uid://dccraom7a7e8d"
|
metadata/_custom_type_script = "uid://dccraom7a7e8d"
|
||||||
|
|
|
||||||
|
|
@ -10,4 +10,5 @@ item_name = "Computer"
|
||||||
icon = ExtResource("1_e0dbh")
|
icon = ExtResource("1_e0dbh")
|
||||||
custom_panel_style = ExtResource("1_x7wm3")
|
custom_panel_style = ExtResource("1_x7wm3")
|
||||||
bin_chance = 0
|
bin_chance = 0
|
||||||
|
buy_value = 500
|
||||||
metadata/_custom_type_script = "uid://dccraom7a7e8d"
|
metadata/_custom_type_script = "uid://dccraom7a7e8d"
|
||||||
|
|
|
||||||
|
|
@ -7,4 +7,6 @@
|
||||||
script = ExtResource("2_pbx7r")
|
script = ExtResource("2_pbx7r")
|
||||||
item_name = "CPU"
|
item_name = "CPU"
|
||||||
icon = ExtResource("1_mh86d")
|
icon = ExtResource("1_mh86d")
|
||||||
|
buy_value = 80
|
||||||
|
can_buy = true
|
||||||
metadata/_custom_type_script = "uid://dccraom7a7e8d"
|
metadata/_custom_type_script = "uid://dccraom7a7e8d"
|
||||||
|
|
|
||||||
|
|
@ -7,4 +7,6 @@
|
||||||
script = ExtResource("2_rrbl5")
|
script = ExtResource("2_rrbl5")
|
||||||
item_name = "Optical Drive"
|
item_name = "Optical Drive"
|
||||||
icon = ExtResource("1_kdwp1")
|
icon = ExtResource("1_kdwp1")
|
||||||
|
buy_value = 35
|
||||||
|
can_buy = true
|
||||||
metadata/_custom_type_script = "uid://dccraom7a7e8d"
|
metadata/_custom_type_script = "uid://dccraom7a7e8d"
|
||||||
|
|
|
||||||
|
|
@ -10,4 +10,5 @@ item_name = "Gaming Computer"
|
||||||
icon = ExtResource("2_a2am6")
|
icon = ExtResource("2_a2am6")
|
||||||
custom_panel_style = ExtResource("1_j1gmi")
|
custom_panel_style = ExtResource("1_j1gmi")
|
||||||
bin_chance = 0
|
bin_chance = 0
|
||||||
|
buy_value = 1500
|
||||||
metadata/_custom_type_script = "uid://dccraom7a7e8d"
|
metadata/_custom_type_script = "uid://dccraom7a7e8d"
|
||||||
|
|
|
||||||
|
|
@ -10,4 +10,6 @@ item_name = "GPU"
|
||||||
icon = ExtResource("1_p14l2")
|
icon = ExtResource("1_p14l2")
|
||||||
custom_panel_style = ExtResource("1_jiyv5")
|
custom_panel_style = ExtResource("1_jiyv5")
|
||||||
bin_chance = 3
|
bin_chance = 3
|
||||||
|
buy_value = 500
|
||||||
|
can_buy = true
|
||||||
metadata/_custom_type_script = "uid://dccraom7a7e8d"
|
metadata/_custom_type_script = "uid://dccraom7a7e8d"
|
||||||
|
|
|
||||||
|
|
@ -7,4 +7,6 @@
|
||||||
script = ExtResource("1_r24a6")
|
script = ExtResource("1_r24a6")
|
||||||
item_name = "Hard Disk Drive"
|
item_name = "Hard Disk Drive"
|
||||||
icon = ExtResource("1_8xwf0")
|
icon = ExtResource("1_8xwf0")
|
||||||
|
buy_value = 60
|
||||||
|
can_buy = true
|
||||||
metadata/_custom_type_script = "uid://dccraom7a7e8d"
|
metadata/_custom_type_script = "uid://dccraom7a7e8d"
|
||||||
|
|
|
||||||
|
|
@ -10,4 +10,5 @@ item_name = "Laptop"
|
||||||
icon = ExtResource("2_xyf87")
|
icon = ExtResource("2_xyf87")
|
||||||
custom_panel_style = ExtResource("1_xyf87")
|
custom_panel_style = ExtResource("1_xyf87")
|
||||||
bin_chance = 0
|
bin_chance = 0
|
||||||
|
buy_value = 850
|
||||||
metadata/_custom_type_script = "uid://dccraom7a7e8d"
|
metadata/_custom_type_script = "uid://dccraom7a7e8d"
|
||||||
|
|
|
||||||
|
|
@ -7,4 +7,6 @@
|
||||||
script = ExtResource("2_i66kx")
|
script = ExtResource("2_i66kx")
|
||||||
item_name = "Large Power Supply Unit"
|
item_name = "Large Power Supply Unit"
|
||||||
icon = ExtResource("1_rjw1c")
|
icon = ExtResource("1_rjw1c")
|
||||||
|
buy_value = 80
|
||||||
|
can_buy = true
|
||||||
metadata/_custom_type_script = "uid://dccraom7a7e8d"
|
metadata/_custom_type_script = "uid://dccraom7a7e8d"
|
||||||
|
|
|
||||||
|
|
@ -7,4 +7,5 @@
|
||||||
script = ExtResource("2_31pxd")
|
script = ExtResource("2_31pxd")
|
||||||
item_name = "Plastic Scrap"
|
item_name = "Plastic Scrap"
|
||||||
icon = ExtResource("1_2haha")
|
icon = ExtResource("1_2haha")
|
||||||
|
can_buy = true
|
||||||
metadata/_custom_type_script = "uid://dccraom7a7e8d"
|
metadata/_custom_type_script = "uid://dccraom7a7e8d"
|
||||||
|
|
|
||||||
|
|
@ -7,4 +7,6 @@
|
||||||
script = ExtResource("1_0t7ph")
|
script = ExtResource("1_0t7ph")
|
||||||
item_name = "Ram Stick"
|
item_name = "Ram Stick"
|
||||||
icon = ExtResource("1_bfuag")
|
icon = ExtResource("1_bfuag")
|
||||||
|
buy_value = 80
|
||||||
|
can_buy = true
|
||||||
metadata/_custom_type_script = "uid://dccraom7a7e8d"
|
metadata/_custom_type_script = "uid://dccraom7a7e8d"
|
||||||
|
|
|
||||||
|
|
@ -10,4 +10,5 @@ item_name = "Server"
|
||||||
icon = ExtResource("2_5q0ct")
|
icon = ExtResource("2_5q0ct")
|
||||||
custom_panel_style = ExtResource("1_70din")
|
custom_panel_style = ExtResource("1_70din")
|
||||||
bin_chance = 0
|
bin_chance = 0
|
||||||
|
buy_value = 2000
|
||||||
metadata/_custom_type_script = "uid://dccraom7a7e8d"
|
metadata/_custom_type_script = "uid://dccraom7a7e8d"
|
||||||
|
|
|
||||||
|
|
@ -7,4 +7,6 @@
|
||||||
script = ExtResource("2_x1n7s")
|
script = ExtResource("2_x1n7s")
|
||||||
item_name = "Small Power Supply Unit"
|
item_name = "Small Power Supply Unit"
|
||||||
icon = ExtResource("1_62foo")
|
icon = ExtResource("1_62foo")
|
||||||
|
buy_value = 20
|
||||||
|
can_buy = true
|
||||||
metadata/_custom_type_script = "uid://dccraom7a7e8d"
|
metadata/_custom_type_script = "uid://dccraom7a7e8d"
|
||||||
|
|
|
||||||
|
|
@ -10,4 +10,6 @@ item_name = "Solid State Drive"
|
||||||
icon = ExtResource("2_amedr")
|
icon = ExtResource("2_amedr")
|
||||||
custom_panel_style = ExtResource("1_kwg8r")
|
custom_panel_style = ExtResource("1_kwg8r")
|
||||||
bin_chance = 3
|
bin_chance = 3
|
||||||
|
buy_value = 140
|
||||||
|
can_buy = true
|
||||||
metadata/_custom_type_script = "uid://dccraom7a7e8d"
|
metadata/_custom_type_script = "uid://dccraom7a7e8d"
|
||||||
|
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
||||||
[gd_scene load_steps=3 format=3 uid="uid://cu2yyw3f2avub"]
|
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://cq6xhdlib6c50" path="res://scenes/computer.gd" id="1_8pqrt"]
|
|
||||||
[ext_resource type="Texture2D" uid="uid://crdbk8wkw63k0" path="res://assets/computer.png" id="1_om4aa"]
|
|
||||||
|
|
||||||
[node name="Computer" type="Control"]
|
|
||||||
layout_mode = 3
|
|
||||||
anchors_preset = 15
|
|
||||||
anchor_right = 1.0
|
|
||||||
anchor_bottom = 1.0
|
|
||||||
grow_horizontal = 2
|
|
||||||
grow_vertical = 2
|
|
||||||
mouse_filter = 2
|
|
||||||
script = ExtResource("1_8pqrt")
|
|
||||||
|
|
||||||
[node name="TextureRect" type="TextureRect" parent="."]
|
|
||||||
layout_mode = 1
|
|
||||||
anchors_preset = 15
|
|
||||||
anchor_right = 1.0
|
|
||||||
anchor_bottom = 1.0
|
|
||||||
grow_horizontal = 2
|
|
||||||
grow_vertical = 2
|
|
||||||
mouse_filter = 2
|
|
||||||
texture = ExtResource("1_om4aa")
|
|
||||||
expand_mode = 3
|
|
||||||
|
|
||||||
[node name="GotoWorkshop" type="Button" parent="."]
|
|
||||||
layout_mode = 0
|
|
||||||
offset_left = 508.0
|
|
||||||
offset_top = 591.0
|
|
||||||
offset_right = 635.0
|
|
||||||
offset_bottom = 622.0
|
|
||||||
text = "Goto workshop"
|
|
||||||
|
|
||||||
[connection signal="pressed" from="GotoWorkshop" to="." method="_on_goto_workshop_pressed"]
|
|
||||||
71
scenes/room.tscn
Normal file
71
scenes/room.tscn
Normal file
|
|
@ -0,0 +1,71 @@
|
||||||
|
[gd_scene load_steps=5 format=3 uid="uid://cu2yyw3f2avub"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://cq6xhdlib6c50" path="res://scenes/room.gd" id="1_8pqrt"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://crdbk8wkw63k0" path="res://assets/computer.png" id="1_om4aa"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://cqqpf7fca5nk1" path="res://inv_system/sell_panel.tscn" id="3_85yof"]
|
||||||
|
[ext_resource type="Script" uid="uid://bxdc7rrd22mlr" path="res://shop/meowbay.gd" id="4_jxe34"]
|
||||||
|
|
||||||
|
[node name="room" type="Control"]
|
||||||
|
layout_mode = 3
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
mouse_filter = 2
|
||||||
|
script = ExtResource("1_8pqrt")
|
||||||
|
|
||||||
|
[node name="TextureRect" type="TextureRect" parent="."]
|
||||||
|
layout_mode = 1
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
mouse_filter = 2
|
||||||
|
texture = ExtResource("1_om4aa")
|
||||||
|
expand_mode = 3
|
||||||
|
|
||||||
|
[node name="GotoWorkshop" type="Button" parent="."]
|
||||||
|
layout_mode = 0
|
||||||
|
offset_left = 508.0
|
||||||
|
offset_top = 591.0
|
||||||
|
offset_right = 635.0
|
||||||
|
offset_bottom = 622.0
|
||||||
|
text = "Goto workshop"
|
||||||
|
|
||||||
|
[node name="SellPanel" parent="." instance=ExtResource("3_85yof")]
|
||||||
|
layout_mode = 0
|
||||||
|
offset_left = 713.0
|
||||||
|
offset_top = 85.0
|
||||||
|
offset_right = 1065.0
|
||||||
|
offset_bottom = 223.0
|
||||||
|
|
||||||
|
[node name="meowbay" type="PanelContainer" parent="." node_paths=PackedStringArray("listing_grid")]
|
||||||
|
layout_mode = 0
|
||||||
|
offset_left = 711.0
|
||||||
|
offset_top = 253.0
|
||||||
|
offset_right = 1064.0
|
||||||
|
offset_bottom = 552.0
|
||||||
|
script = ExtResource("4_jxe34")
|
||||||
|
listing_grid = NodePath("ScrollContainer/VBoxContainer/listings")
|
||||||
|
|
||||||
|
[node name="ScrollContainer" type="ScrollContainer" parent="meowbay"]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="VBoxContainer" type="VBoxContainer" parent="meowbay/ScrollContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
|
||||||
|
[node name="RichTextLabel" type="RichTextLabel" parent="meowbay/ScrollContainer/VBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
bbcode_enabled = true
|
||||||
|
text = "[font_size=28][center][wave][color=red]meow[color=blue]b[color=yellow]a[color=green]y"
|
||||||
|
fit_content = true
|
||||||
|
|
||||||
|
[node name="listings" type="GridContainer" parent="meowbay/ScrollContainer/VBoxContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
columns = 2
|
||||||
|
|
||||||
|
[connection signal="pressed" from="GotoWorkshop" to="." method="_on_goto_workshop_pressed"]
|
||||||
|
|
@ -24,4 +24,4 @@ func _on_goto_ewaste_pressed() -> void:
|
||||||
|
|
||||||
|
|
||||||
func _on_goto_computer_pressed() -> void:
|
func _on_goto_computer_pressed() -> void:
|
||||||
get_tree().change_scene_to_file("res://scenes/computer.tscn")
|
get_tree().change_scene_to_file("res://scenes/room.tscn")
|
||||||
|
|
|
||||||
27
shop/listing.gd
Normal file
27
shop/listing.gd
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
extends HBoxContainer
|
||||||
|
|
||||||
|
@export var item_slot : ItemSlot
|
||||||
|
@export var button : Button
|
||||||
|
var item_cost : int
|
||||||
|
|
||||||
|
# Called when the node enters the scene tree for the first time.
|
||||||
|
func _ready() -> void:
|
||||||
|
item_slot.block_taking = true
|
||||||
|
pass # Replace with function body.
|
||||||
|
|
||||||
|
|
||||||
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
|
func _process(delta: float) -> void:
|
||||||
|
if item_slot.item:
|
||||||
|
button.disabled = PlayerInventory.money <= item_cost
|
||||||
|
|
||||||
|
func prepare(item : ItemData):
|
||||||
|
item_slot.item = item
|
||||||
|
button.text = "Buy $" + str(item.buy_value)
|
||||||
|
item_cost = item.buy_value
|
||||||
|
|
||||||
|
|
||||||
|
func _on_button_pressed() -> void:
|
||||||
|
if PlayerInventory.money >= item_cost:
|
||||||
|
PlayerInventory.money -= item_cost
|
||||||
|
PlayerInventory.inventory_panel.add_item(item_slot.item)
|
||||||
1
shop/listing.gd.uid
Normal file
1
shop/listing.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://cplyptfsma786
|
||||||
22
shop/listing.tscn
Normal file
22
shop/listing.tscn
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
[gd_scene load_steps=3 format=3 uid="uid://cluhvm32w5321"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://cplyptfsma786" path="res://shop/listing.gd" id="1_ir6io"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://dgqs20xf7l8c" path="res://inv_system/item_slot.tscn" id="1_uc81x"]
|
||||||
|
|
||||||
|
[node name="listing" type="HBoxContainer" node_paths=PackedStringArray("item_slot", "button")]
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
alignment = 1
|
||||||
|
script = ExtResource("1_ir6io")
|
||||||
|
item_slot = NodePath("ItemSlot2")
|
||||||
|
button = NodePath("Button")
|
||||||
|
|
||||||
|
[node name="ItemSlot2" parent="." instance=ExtResource("1_uc81x")]
|
||||||
|
custom_minimum_size = Vector2(32, 32)
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="Button" type="Button" parent="."]
|
||||||
|
custom_minimum_size = Vector2(100, 0)
|
||||||
|
layout_mode = 2
|
||||||
|
text = "Buy $99999"
|
||||||
|
|
||||||
|
[connection signal="pressed" from="Button" to="." method="_on_button_pressed"]
|
||||||
22
shop/meowbay.gd
Normal file
22
shop/meowbay.gd
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
extends PanelContainer
|
||||||
|
|
||||||
|
@export var listing_grid : GridContainer
|
||||||
|
|
||||||
|
# Called when the node enters the scene tree for the first time.
|
||||||
|
func _ready() -> void:
|
||||||
|
#RecipeManager.recipes_loaded.connect(make_listings)
|
||||||
|
make_listings()
|
||||||
|
pass # Replace with function body.
|
||||||
|
|
||||||
|
|
||||||
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
|
func _process(delta: float) -> void:
|
||||||
|
pass
|
||||||
|
|
||||||
|
func make_listings():
|
||||||
|
print("building meowbay")
|
||||||
|
for item in RecipeManager.items:
|
||||||
|
if item.can_buy:
|
||||||
|
var new_listing = load("res://shop/listing.tscn").instantiate()
|
||||||
|
new_listing.prepare(item)
|
||||||
|
listing_grid.add_child(new_listing)
|
||||||
1
shop/meowbay.gd.uid
Normal file
1
shop/meowbay.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://bxdc7rrd22mlr
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
extends PanelContainer
|
extends PanelContainer
|
||||||
|
|
||||||
@export var tooltip_label : Label
|
@export var tooltip_label : Label
|
||||||
|
@export var exdata_box : VBoxContainer
|
||||||
|
@export var exdata_label : Label
|
||||||
|
|
||||||
# Called when the node enters the scene tree for the first time.
|
# Called when the node enters the scene tree for the first time.
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
|
|
@ -12,8 +14,13 @@ func _ready() -> void:
|
||||||
func _process(delta: float) -> void:
|
func _process(delta: float) -> void:
|
||||||
global_position = get_global_mouse_position() + Vector2(12,-6)
|
global_position = get_global_mouse_position() + Vector2(12,-6)
|
||||||
|
|
||||||
func show_tip(text : String):
|
func show_tip(text : String, extra : String = ""):
|
||||||
tooltip_label.text = text
|
tooltip_label.text = text
|
||||||
|
if extra != "":
|
||||||
|
exdata_box.show()
|
||||||
|
exdata_label.text = extra
|
||||||
|
else:
|
||||||
|
exdata_box.hide()
|
||||||
reset_size()
|
reset_size()
|
||||||
show()
|
show()
|
||||||
|
|
||||||
|
|
|
||||||
15
tooltip.tscn
15
tooltip.tscn
|
|
@ -19,7 +19,7 @@ corner_radius_bottom_left = 3
|
||||||
|
|
||||||
[sub_resource type="LabelSettings" id="LabelSettings_oxk8h"]
|
[sub_resource type="LabelSettings" id="LabelSettings_oxk8h"]
|
||||||
|
|
||||||
[node name="Tooltip" type="PanelContainer" node_paths=PackedStringArray("tooltip_label")]
|
[node name="Tooltip" type="PanelContainer" node_paths=PackedStringArray("tooltip_label", "exdata_box", "exdata_label")]
|
||||||
z_index = 3
|
z_index = 3
|
||||||
offset_right = 95.0
|
offset_right = 95.0
|
||||||
offset_bottom = 31.0
|
offset_bottom = 31.0
|
||||||
|
|
@ -29,6 +29,8 @@ mouse_filter = 2
|
||||||
theme_override_styles/panel = SubResource("StyleBoxFlat_gwequ")
|
theme_override_styles/panel = SubResource("StyleBoxFlat_gwequ")
|
||||||
script = ExtResource("1_gwequ")
|
script = ExtResource("1_gwequ")
|
||||||
tooltip_label = NodePath("VBoxContainer/Label")
|
tooltip_label = NodePath("VBoxContainer/Label")
|
||||||
|
exdata_box = NodePath("VBoxContainer/Extradata")
|
||||||
|
exdata_label = NodePath("VBoxContainer/Extradata/Label")
|
||||||
|
|
||||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
|
|
@ -40,3 +42,14 @@ layout_mode = 2
|
||||||
size_flags_vertical = 6
|
size_flags_vertical = 6
|
||||||
text = "Item Name"
|
text = "Item Name"
|
||||||
label_settings = SubResource("LabelSettings_oxk8h")
|
label_settings = SubResource("LabelSettings_oxk8h")
|
||||||
|
|
||||||
|
[node name="Extradata" type="VBoxContainer" parent="VBoxContainer"]
|
||||||
|
visible = false
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="HSeparator" type="HSeparator" parent="VBoxContainer/Extradata"]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="Label" type="Label" parent="VBoxContainer/Extradata"]
|
||||||
|
layout_mode = 2
|
||||||
|
text = "Extra data does here"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue