accumulation test
This commit is contained in:
parent
69f6544545
commit
7e5603927e
7 changed files with 65 additions and 14 deletions
|
|
@ -125,9 +125,9 @@ anchors_preset = 15
|
|||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 241.0
|
||||
offset_top = 154.0
|
||||
offset_top = 111.0
|
||||
offset_right = -635.0
|
||||
offset_bottom = -136.0
|
||||
offset_bottom = -126.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("2_hk4hx")
|
||||
|
|
@ -249,6 +249,21 @@ layout_mode = 2
|
|||
[node name="ItemSlot30" parent="Inventory/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("3_8qgtd")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ItemSlot31" parent="Inventory/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("3_8qgtd")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ItemSlot32" parent="Inventory/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("3_8qgtd")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ItemSlot33" parent="Inventory/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("3_8qgtd")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ItemSlot34" parent="Inventory/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("3_8qgtd")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ItemSlot35" parent="Inventory/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("3_8qgtd")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="TabContainer" type="TabContainer" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 1.0
|
||||
|
|
|
|||
|
|
@ -29,16 +29,16 @@ func calculate_sell_value():
|
|||
else:
|
||||
sell_label.text = "Place an item"
|
||||
sell_button.disabled = true
|
||||
if not Clock.has_time(15):
|
||||
if not Clock.has_time(10):
|
||||
sell_button.disabled = true
|
||||
|
||||
|
||||
func _on_sell_button_pressed() -> void:
|
||||
if slots[0].item and Clock.has_time(15):
|
||||
if slots[0].item and Clock.has_time(10):
|
||||
var sell_value : int = floori(slots[0].item.buy_value / float(2))
|
||||
slots[0].item = null
|
||||
slots[0].update_ui()
|
||||
PlayerInventory.money += sell_value
|
||||
Clock.use_time(15)
|
||||
Clock.use_time(10)
|
||||
calculate_sell_value()
|
||||
|
||||
|
|
|
|||
|
|
@ -55,6 +55,6 @@ text = "1234"
|
|||
|
||||
[node name="SellButton" type="Button" parent="MarginContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Sell! (Uses 15 time)"
|
||||
text = "Sell! (Uses 10 time)"
|
||||
|
||||
[connection signal="pressed" from="MarginContainer/VBoxContainer/SellButton" to="." method="_on_sell_button_pressed"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue