It's Cow Game! Version 2.04!
This commit is contained in:
commit
a9e1ed9ddd
3148 changed files with 95332 additions and 0 deletions
88
UI/Drying/DryingMenu.gd
Normal file
88
UI/Drying/DryingMenu.gd
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
extends Window
|
||||
|
||||
@onready var inventoryItemDisplayer = %Inventory
|
||||
|
||||
var itemTransitionScene = preload("res://UI/Sugaring/ItemFadeTransition.tscn")
|
||||
|
||||
var dryingAnimPositions = []
|
||||
var dryingAnimPosIndex = 0
|
||||
var playerInventory:Inventory
|
||||
|
||||
func _ready():
|
||||
dryingAnimPositions.append(Vector2(380, 325))
|
||||
dryingAnimPositions.append(Vector2(515, 335))
|
||||
dryingAnimPositions.append(Vector2(450, 345))
|
||||
|
||||
inventoryItemDisplayer.fiveButtons = true
|
||||
inventoryItemDisplayer.allButtons = true
|
||||
|
||||
inventoryItemDisplayer.buttonPressed.connect(dry_item)
|
||||
inventoryItemDisplayer.fiveButtonPressed.connect(dry_item.bind(5))
|
||||
inventoryItemDisplayer.allButtonPressed.connect(dry_item.bind(999999))
|
||||
inventoryItemDisplayer.set_title("Wet Items")
|
||||
|
||||
func opened():
|
||||
get_tree().paused = true
|
||||
playerInventory = InventoryManager.get_inventory()
|
||||
inventoryItemDisplayer.inventory = filter_inventory(playerInventory)
|
||||
inventoryItemDisplayer.update_display()
|
||||
|
||||
func dry_item(item, quantity:int = 1):
|
||||
var itemsInInv = InventoryManager.get_item_count(item)
|
||||
if itemsInInv < quantity:
|
||||
quantity = itemsInInv
|
||||
|
||||
InventoryManager.remove_item_from_inventory(item, quantity)
|
||||
|
||||
var dryItem = ItemDrying.sun_dry_item(item)
|
||||
InventoryManager.add_item_to_inventory(dryItem, quantity)
|
||||
|
||||
spawn_item_transition(item, dryItem)
|
||||
|
||||
inventoryItemDisplayer.inventory = filter_inventory(playerInventory)
|
||||
inventoryItemDisplayer.update_display()
|
||||
|
||||
func spawn_item_transition(startItem, driedItem):
|
||||
var itemTransition = itemTransitionScene.instantiate()
|
||||
itemTransition.start_transition(startItem.get_sprite(), driedItem.get_sprite())
|
||||
|
||||
if Item.modifications.Concentrated in driedItem.itemModifications:
|
||||
itemTransition.transDuration = 0.2
|
||||
itemTransition.finalMomentsDuration = 2
|
||||
else:
|
||||
itemTransition.finalMomentsDuration = 1
|
||||
|
||||
add_child(itemTransition)
|
||||
itemTransition.scale = Vector2(2, 2)
|
||||
itemTransition.position = dryingAnimPositions[dryingAnimPosIndex]
|
||||
|
||||
dryingAnimPosIndex += 1
|
||||
if dryingAnimPosIndex >= dryingAnimPositions.size():
|
||||
dryingAnimPosIndex = 0
|
||||
|
||||
func filter_inventory(inventory):
|
||||
var filteredInv:Inventory = inventory.duplicate()
|
||||
|
||||
var i = filteredInv.items.size() - 1
|
||||
while i >= 0:
|
||||
var currentItem = filteredInv.items[i]
|
||||
var keepItem = false
|
||||
|
||||
if Item.modifications.Wet in currentItem.itemModifications:
|
||||
keepItem = true
|
||||
elif Item.types.Juice in currentItem.itemTypes:
|
||||
if not Item.modifications.Concentrated in currentItem.itemModifications:
|
||||
keepItem = true
|
||||
elif currentItem.get_name(false) == "Grape":
|
||||
keepItem = true
|
||||
|
||||
if !keepItem:
|
||||
filteredInv.remove_item(currentItem, filteredInv.quantities[i])
|
||||
|
||||
i -= 1
|
||||
|
||||
return filteredInv
|
||||
|
||||
func _on_leave_button_pressed():
|
||||
get_tree().paused = false
|
||||
hide()
|
||||
101
UI/Drying/DryingMenu.tscn
Normal file
101
UI/Drying/DryingMenu.tscn
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
[gd_scene load_steps=10 format=3 uid="uid://bmse1b3qcae7m"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://dkofjwlcf80gp" path="res://UI/Themes/InteractionPopupTheme.tres" id="1_up8s2"]
|
||||
[ext_resource type="Script" path="res://UI/Drying/DryingMenu.gd" id="2_bvakk"]
|
||||
[ext_resource type="PackedScene" uid="uid://c3ku75p4ep3c7" path="res://UI/Inventory/InventoryDisplayer.tscn" id="3_kla7o"]
|
||||
[ext_resource type="Texture2D" uid="uid://cn2qexqrtgngh" path="res://Objects/Beach/SunningRock/SunningRock.png" id="4_xhpsp"]
|
||||
[ext_resource type="Texture2D" uid="uid://bxc6pq2t60a6g" path="res://UI/Drying/Sun/Sun1.png" id="5_c43w7"]
|
||||
[ext_resource type="Texture2D" uid="uid://bqltoj0trnw3d" path="res://UI/Drying/Sun/Sun2.png" id="6_7ixof"]
|
||||
[ext_resource type="Script" path="res://Utils/PlayOnReady.gd" id="7_dh0s4"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_p28hs"]
|
||||
bg_color = Color(0.815686, 0.886275, 0.976471, 1)
|
||||
border_width_left = 4
|
||||
border_width_top = 4
|
||||
border_width_right = 19
|
||||
border_width_bottom = 4
|
||||
border_color = Color(0, 0, 0, 1)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_xej4q"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("5_c43w7")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": ExtResource("6_7ixof")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"default",
|
||||
"speed": 2.0
|
||||
}]
|
||||
|
||||
[node name="DryingMenu" type="Window"]
|
||||
process_mode = 3
|
||||
size = Vector2i(600, 500)
|
||||
unresizable = true
|
||||
borderless = true
|
||||
theme = ExtResource("1_up8s2")
|
||||
script = ExtResource("2_bvakk")
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="."]
|
||||
offset_right = 590.0
|
||||
offset_bottom = 8.0
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_p28hs")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
|
||||
custom_minimum_size = Vector2(590, 490)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_constants/separation = 11
|
||||
|
||||
[node name="DryerName" type="Label" parent="PanelContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 0
|
||||
theme_override_colors/font_color = Color(1, 0.819608, 0.690196, 1)
|
||||
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/outline_size = 9
|
||||
theme_override_font_sizes/font_size = 32
|
||||
text = "Sunning Rock"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 2
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="PanelContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_override_constants/margin_left = 8
|
||||
theme_override_constants/margin_right = 8
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/VBoxContainer/MarginContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="Inventory" parent="PanelContainer/VBoxContainer/MarginContainer/HBoxContainer" instance=ExtResource("3_kla7o")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="PanelContainer/VBoxContainer/MarginContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="MarginContainer2" type="MarginContainer" parent="PanelContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_bottom = 5
|
||||
|
||||
[node name="LeaveButton" type="Button" parent="PanelContainer/VBoxContainer/MarginContainer2"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
text = "Leave"
|
||||
|
||||
[node name="SunningRock" type="Sprite2D" parent="."]
|
||||
position = Vector2(443, 380)
|
||||
texture = ExtResource("4_xhpsp")
|
||||
|
||||
[node name="Sun" type="AnimatedSprite2D" parent="."]
|
||||
position = Vector2(440, 135)
|
||||
sprite_frames = SubResource("SpriteFrames_xej4q")
|
||||
frame_progress = 0.501922
|
||||
script = ExtResource("7_dh0s4")
|
||||
|
||||
[connection signal="pressed" from="PanelContainer/VBoxContainer/MarginContainer2/LeaveButton" to="." method="_on_leave_button_pressed"]
|
||||
BIN
UI/Drying/Sun/Sun1.png
Normal file
BIN
UI/Drying/Sun/Sun1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
34
UI/Drying/Sun/Sun1.png.import
Normal file
34
UI/Drying/Sun/Sun1.png.import
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bxc6pq2t60a6g"
|
||||
path="res://.godot/imported/Sun1.png-537e54b583353488d771be9fcdb1eb3d.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://UI/Drying/Sun/Sun1.png"
|
||||
dest_files=["res://.godot/imported/Sun1.png-537e54b583353488d771be9fcdb1eb3d.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
BIN
UI/Drying/Sun/Sun2.png
Normal file
BIN
UI/Drying/Sun/Sun2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
34
UI/Drying/Sun/Sun2.png.import
Normal file
34
UI/Drying/Sun/Sun2.png.import
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bqltoj0trnw3d"
|
||||
path="res://.godot/imported/Sun2.png-a4d7900f71f53e9be2ac4c32250e8c24.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://UI/Drying/Sun/Sun2.png"
|
||||
dest_files=["res://.godot/imported/Sun2.png-a4d7900f71f53e9be2ac4c32250e8c24.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
Loading…
Add table
Add a link
Reference in a new issue