From f58fd81ec5c1a32b66c9bdd871c0dfce47322cee Mon Sep 17 00:00:00 2001 From: Tabby <41929769+tabby-cat-nya@users.noreply.github.com> Date: Sun, 11 Jan 2026 16:05:12 +1100 Subject: [PATCH] started on crafting and clock panels --- assets/ready_time.png | Bin 0 -> 441 bytes assets/ready_time.png.import | 40 ++++++++ assets/timer_over.pdn | Bin 0 -> 6407 bytes assets/timer_over.png | Bin 0 -> 1684 bytes assets/timer_over.png.import | 40 ++++++++ assets/used_time.png | Bin 0 -> 441 bytes assets/used_time.png.import | 40 ++++++++ inv_system/crafting_panel.gd | 45 +++++++++ inv_system/crafting_panel.gd.uid | 1 + inv_system/crafting_panel.tscn | 149 +++++++++++++++++++++++++++++ inv_system/inventory_panel.tscn | 67 +++++++++++++ inv_system/item_slot.gd | 7 +- inv_system/player_inventory.gd | 19 ++++ inv_system/player_inventory.gd.uid | 1 + inv_system/player_inventory.tscn | 36 +++++++ project.godot | 2 + test.tscn | 69 +------------ time_system/clock.tscn | 55 +++++++++++ tooltip.gd | 2 + tooltip.tscn | 1 + 20 files changed, 506 insertions(+), 68 deletions(-) create mode 100644 assets/ready_time.png create mode 100644 assets/ready_time.png.import create mode 100644 assets/timer_over.pdn create mode 100644 assets/timer_over.png create mode 100644 assets/timer_over.png.import create mode 100644 assets/used_time.png create mode 100644 assets/used_time.png.import create mode 100644 inv_system/crafting_panel.gd create mode 100644 inv_system/crafting_panel.gd.uid create mode 100644 inv_system/crafting_panel.tscn create mode 100644 inv_system/inventory_panel.tscn create mode 100644 inv_system/player_inventory.gd create mode 100644 inv_system/player_inventory.gd.uid create mode 100644 inv_system/player_inventory.tscn create mode 100644 time_system/clock.tscn diff --git a/assets/ready_time.png b/assets/ready_time.png new file mode 100644 index 0000000000000000000000000000000000000000..15b2fdca2756e71b2c3773555f06a4b7285bff2f GIT binary patch literal 441 zcmeAS@N?(olHy`uVBq!ia0vp^(}38Mg&9cdx*yU8QjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`IRkt`Tnh^elai8RVq!8*NhW{<3p^r=85sBugD~Uq{1qucLCF%=h?3y^ zw370~qEv=}#LT=BJwMkF1yemkJwwAT4zY7UMLSX>JkvZqwHP>n999M?Mpgz!Aj=Dg zrJ-z)8#Nf2!QxCnwjm=EgCLNO0^-be7O;2@kPQL}Kn&6kqtR_;U;z4a0y_f>P>q3+ zu>s=(h`As=tP3D!fx-g>n1CiRfmH@sS^!y4U4{k*AXzrkE5)1oi>!gn08bakkch)? zFKy&yFyLX@@T7T#yvcw0o8ndmRSB+4JFCi_R$6X%UKtVWe^kuRefK2k$@kTLKO7a0 eula~c$lt7$dNRxLc=VxgkUgHRelF{r5}E*trD8t- literal 0 HcmV?d00001 diff --git a/assets/ready_time.png.import b/assets/ready_time.png.import new file mode 100644 index 0000000..fc26ea2 --- /dev/null +++ b/assets/ready_time.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cvsibrbtuqfww" +path="res://.godot/imported/ready_time.png-1a19dfe424a34c3af9e1f97b1269d8ed.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ready_time.png" +dest_files=["res://.godot/imported/ready_time.png-1a19dfe424a34c3af9e1f97b1269d8ed.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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 diff --git a/assets/timer_over.pdn b/assets/timer_over.pdn new file mode 100644 index 0000000000000000000000000000000000000000..09d7540813fa2b97261323e45e4f6bc09661d72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VKYjbAu zmN{=)gciep`_HQ@t>~G8GSRXz1lhaQ{i^+k&{PRD$f9X2%Xut5YorRB=pvBML-Mw>< zb{YEiAK%PIC8*XzOC3MGK-$=U$MS{Pr`J3(_py&*FEhsbNYZocCiXY9T4j?dQw7T>n;0p{f+13Mm+)lJ(T4xjypt=mT* z@Vv12&%ZzCy(LJd`{~%H!PJ%4Z=`?!%{_av(>JZ%ee2EpHe97F`i~2@DBnM6SXo@M zu3!1s&h{z0M)qBP`NK!8`Cy59=~0dtoksIm%{=`1&rr*7O*UN0;o?i`JdBaCrOObWb%97Jk zccq^B%;9|dEZ@6Fy}S3k-&`L#N!n<+YTK>1-Z~!p&wsgY=Y^-NIeq=<-}`CuTfdX| zy?5?6!Z)0`V$Ygu@atDDfAQSN`n5Y3-TT~vedVW)fARfi_J8Lo;oRtk^X}1(dthu* zHOWica&Lco)6*vT_{rePIggG_em?o9voHUS9A6I-Y zox5V>lUMs+^A2A8*=?U+yL9=H?lZ5r{dH;O!n?Q5dvy4jm(!bkp^G+b4rcb8cg~Ju zZnSRNzCa6Xy6Tv>RzFtQz99R94V#b92iID>|GxL+mpkWkGoA}l;!N8#%Pn6BjQwDI z{#p3$HILW0yXRc}^m8|?|7i22m%RCw^XAQSChu9XcW^~CQ*=3{3)U>E2FZUGxre0G zvuFNmcwW@9=mJt9^>rSI@oH%FOh0lEV%_rA?{6r*ri`|6I(x*M>yki4; z&DrROOJCjf>O;;uzjw=Gw060%a{rspCabSsoqZ#7%eAj}?tlAiWB0Z#-}vrtKi|T> yGfHim#vl9SqHq6cEd@RL)|T4U_mMB2v3o7`;V(Z2iREv!Cp$aQ=R70e{Qm>E(=9&$ literal 0 HcmV?d00001 diff --git a/assets/timer_over.png b/assets/timer_over.png new file mode 100644 index 0000000000000000000000000000000000000000..9884febce07a041611457dcf28dd5b35c908aca5 GIT binary patch literal 1684 zcmZ8heK_0a8vcdE5!5A##K*Maqgbd3jiJ;;LV^a7kkd{_gbqEll1`Iq9VJD&q^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lE6-J(!)+NMQ}LVcS-gsH zke;ZBdGW>S>Tt`8-7cK*OgubGu&a_IbG6O!+5PV1H-ww(E*i76OCSj~e^ch)r}{BYlDy$|&YgD`QXka^R@*~Z(QzB2I#7mJR8 z$BlpVlYIVa$Ac;=^X>K0E|-iNiMVt4Kg~SmGq^Md;=ig^RB_3DdlXkIgrxIyf)n~i zLd#$vj#&X~`6fvLb&%=vklBfkMcXhs#^>)8R)ijG0okpYb#B?R1sPJ|5XFa}B3*H`mOVP{k7=e#jGW@~Gq6FR83ndID__A=`G*lvkh zxK_vAvgn4%_udlL@Lo5_^f5#Rw3$R(IdFfW(~3uzaLJuD;n{Ysb~s?FviBsb3-e4t z#Gdc(?wxnV+zGH8b&#GpXBvVCm20u;;=5@qr> zrUyos{B^RDl%6V!^9g-iVuKRq*;WdRwdluz%<-_vxVj_gW{OV?c~~vpO=cf-bQe-4 ziAsNuSA6zw{A0bdqUp2->(@%{W-BFT&dq08sohR#RiCro#ZD)vv#YueJQ=e0Xb;+i zOc{+U_h_emJ5Q_FnvC#XGcBfEPgISU#1?n6yaHZou&>gw*abE|+w-P@F=Hztv+<84 zz8F-YR@jsvOmcbcjr^%4+?0(!=viW~VxKK3E6`Q#L?e-~C?DkM36--Orlssy`!U%z vmz(yd3){@8Ht(1)ny?A!g=v9`$T%!@1JcvVjOFTXeE3(XWE!cBn0EZXtsuc4 literal 0 HcmV?d00001 diff --git a/assets/timer_over.png.import b/assets/timer_over.png.import new file mode 100644 index 0000000..f7edd9d --- /dev/null +++ b/assets/timer_over.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bemb2moou1hkj" +path="res://.godot/imported/timer_over.png-736fa363f8ade887f72ebe2da09aa5f4.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/timer_over.png" +dest_files=["res://.godot/imported/timer_over.png-736fa363f8ade887f72ebe2da09aa5f4.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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 diff --git a/assets/used_time.png b/assets/used_time.png new file mode 100644 index 0000000000000000000000000000000000000000..5ef54451eec70ac2c3a4239ea5e41c210bd62284 GIT binary patch literal 441 zcmeAS@N?(olHy`uVBq!ia0vp^(}38Mg&9cdx*yU8QjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`IRkt`Tpuy`9ARkL$uLVze(q|JV1Y+uF#`kNVGw3Kp1&dmC@5Lt8c`CQ zpH@{&803^$1dZl<%e~~qi8Q|&S7!q;# z?WK*p3}+e^cDbpen(YX=hcr(@M+j&MPB={f~ void: + super() + style_scavenge() + 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: + # check against recipies! + pass + +func style_assemble(): + action_button.add_theme_stylebox_override("normal",assemble_style) + action_button.add_theme_stylebox_override("hover",assemble_style_hover) + action_button.add_theme_stylebox_override("pressed",assemble_style_pressed) + +func style_scavenge(): + action_button.add_theme_stylebox_override("normal",scavenge_style) + action_button.add_theme_stylebox_override("hover",scavenge_style_hover) + action_button.add_theme_stylebox_override("pressed",scavenge_style_pressed) + +func style_none(): + action_button.remove_theme_stylebox_override("normal") + action_button.remove_theme_stylebox_override("hover") + action_button.remove_theme_stylebox_override("pressed") diff --git a/inv_system/crafting_panel.gd.uid b/inv_system/crafting_panel.gd.uid new file mode 100644 index 0000000..21e5bda --- /dev/null +++ b/inv_system/crafting_panel.gd.uid @@ -0,0 +1 @@ +uid://br4fgimf7nygr diff --git a/inv_system/crafting_panel.tscn b/inv_system/crafting_panel.tscn new file mode 100644 index 0000000..f9d4a93 --- /dev/null +++ b/inv_system/crafting_panel.tscn @@ -0,0 +1,149 @@ +[gd_scene load_steps=7 format=3 uid="uid://f06ym5ujhdsc"] + +[ext_resource type="Script" uid="uid://br4fgimf7nygr" path="res://inv_system/crafting_panel.gd" id="1_441s3"] +[ext_resource type="PackedScene" uid="uid://dgqs20xf7l8c" path="res://inv_system/item_slot.tscn" id="2_h0v0h"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_h0v0h"] +content_margin_left = 0.0 +content_margin_top = 0.0 +content_margin_right = 0.0 +content_margin_bottom = 0.0 +bg_color = Color(0.0033790555, 0.44219574, 1.14551185e-05, 1) +border_width_left = 5 +border_width_top = 5 +border_width_right = 5 +border_width_bottom = 5 +border_color = Color(0, 0.9671584, 0.10068952, 1) +border_blend = true +corner_radius_top_left = 3 +corner_radius_top_right = 3 +corner_radius_bottom_right = 3 +corner_radius_bottom_left = 3 +corner_detail = 5 + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_441s3"] +content_margin_left = 0.0 +content_margin_top = 0.0 +content_margin_right = 0.0 +content_margin_bottom = 0.0 +bg_color = Color(0.0033790555, 0.44219574, 1.14551185e-05, 1) +border_width_left = 5 +border_width_top = 5 +border_width_right = 5 +border_width_bottom = 5 +border_color = Color(0.6496614, 1, 0.6276887, 1) +border_blend = true +corner_radius_top_left = 3 +corner_radius_top_right = 3 +corner_radius_bottom_right = 3 +corner_radius_bottom_left = 3 +corner_detail = 5 + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ytbts"] +content_margin_left = 0.0 +content_margin_top = 0.0 +content_margin_right = 0.0 +content_margin_bottom = 0.0 +bg_color = Color(0.6228256, 0, 0.13260579, 1) +border_width_left = 5 +border_width_top = 5 +border_width_right = 5 +border_width_bottom = 5 +border_color = Color(1, 0.34455475, 0.4602759, 1) +border_blend = true +corner_radius_top_left = 3 +corner_radius_top_right = 3 +corner_radius_bottom_right = 3 +corner_radius_bottom_left = 3 +corner_detail = 5 + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_4h4i0"] +content_margin_left = 0.0 +content_margin_top = 0.0 +content_margin_right = 0.0 +content_margin_bottom = 0.0 +bg_color = Color(0.6228256, 0, 0.13260579, 1) +border_width_left = 5 +border_width_top = 5 +border_width_right = 5 +border_width_bottom = 5 +border_color = Color(1, 0.77051497, 0.78614175, 1) +border_blend = true +corner_radius_top_left = 3 +corner_radius_top_right = 3 +corner_radius_bottom_right = 3 +corner_radius_bottom_left = 3 +corner_detail = 5 + +[node name="CraftingPanel" type="PanelContainer" node_paths=PackedStringArray("action_button", "grid", "inv_label")] +offset_left = 749.0 +offset_top = 89.0 +offset_right = 962.0 +offset_bottom = 382.0 +script = ExtResource("1_441s3") +action_button = NodePath("MarginContainer/VBoxContainer/ActionButton") +assemble_style = SubResource("StyleBoxFlat_h0v0h") +assemble_style_hover = SubResource("StyleBoxFlat_441s3") +assemble_style_pressed = SubResource("StyleBoxFlat_h0v0h") +scavenge_style = SubResource("StyleBoxFlat_ytbts") +scavenge_style_hover = SubResource("StyleBoxFlat_4h4i0") +scavenge_style_pressed = SubResource("StyleBoxFlat_ytbts") +inventory_name = "Workbench" +grid = NodePath("MarginContainer/VBoxContainer/ScrollContainer/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" +horizontal_alignment = 1 + +[node name="ScrollContainer" type="ScrollContainer" parent="MarginContainer/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 + +[node name="GridContainer" type="GridContainer" parent="MarginContainer/VBoxContainer/ScrollContainer"] +layout_mode = 2 +size_flags_vertical = 3 +columns = 3 + +[node name="ItemSlot" parent="MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("2_h0v0h")] +layout_mode = 2 + +[node name="ItemSlot2" parent="MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("2_h0v0h")] +layout_mode = 2 + +[node name="ItemSlot3" parent="MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("2_h0v0h")] +layout_mode = 2 + +[node name="ItemSlot4" parent="MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("2_h0v0h")] +layout_mode = 2 + +[node name="ItemSlot5" parent="MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("2_h0v0h")] +layout_mode = 2 + +[node name="ItemSlot6" parent="MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("2_h0v0h")] +layout_mode = 2 + +[node name="ItemSlot7" parent="MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("2_h0v0h")] +layout_mode = 2 + +[node name="ItemSlot8" parent="MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("2_h0v0h")] +layout_mode = 2 + +[node name="ItemSlot9" parent="MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("2_h0v0h")] +layout_mode = 2 + +[node name="ActionButton" type="Button" parent="MarginContainer/VBoxContainer"] +custom_minimum_size = Vector2(0, 52.585) +layout_mode = 2 +text = "No matching recipie" diff --git a/inv_system/inventory_panel.tscn b/inv_system/inventory_panel.tscn new file mode 100644 index 0000000..3a14704 --- /dev/null +++ b/inv_system/inventory_panel.tscn @@ -0,0 +1,67 @@ +[gd_scene load_steps=3 format=3 uid="uid://bar46c75dbi2t"] + +[ext_resource type="Script" uid="uid://c6oycdae5wvjf" path="res://inv_system/inventory.gd" id="1_x51u7"] +[ext_resource type="PackedScene" uid="uid://dgqs20xf7l8c" path="res://inv_system/item_slot.tscn" id="2_aasfe"] + +[node name="InventoryPanel" type="PanelContainer" node_paths=PackedStringArray("grid", "inv_label")] +offset_left = 51.0 +offset_top = 67.0 +offset_right = 403.0 +offset_bottom = 549.0 +script = ExtResource("1_x51u7") +inventory_name = "Your Inventory" +grid = NodePath("MarginContainer/VBoxContainer/ScrollContainer/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="ScrollContainer" type="ScrollContainer" parent="MarginContainer/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 + +[node name="GridContainer" type="GridContainer" parent="MarginContainer/VBoxContainer/ScrollContainer"] +layout_mode = 2 +size_flags_vertical = 3 +columns = 5 + +[node name="ItemSlot" parent="MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("2_aasfe")] +layout_mode = 2 + +[node name="ItemSlot2" parent="MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("2_aasfe")] +layout_mode = 2 + +[node name="ItemSlot3" parent="MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("2_aasfe")] +layout_mode = 2 + +[node name="ItemSlot4" parent="MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("2_aasfe")] +layout_mode = 2 + +[node name="ItemSlot5" parent="MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("2_aasfe")] +layout_mode = 2 + +[node name="ItemSlot6" parent="MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("2_aasfe")] +layout_mode = 2 + +[node name="ItemSlot7" parent="MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("2_aasfe")] +layout_mode = 2 + +[node name="ItemSlot8" parent="MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("2_aasfe")] +layout_mode = 2 + +[node name="ItemSlot9" parent="MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("2_aasfe")] +layout_mode = 2 + +[node name="ItemSlot10" parent="MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("2_aasfe")] +layout_mode = 2 diff --git a/inv_system/item_slot.gd b/inv_system/item_slot.gd index 5df56c0..60d17df 100644 --- a/inv_system/item_slot.gd +++ b/inv_system/item_slot.gd @@ -15,7 +15,7 @@ func update_ui(): return icon.texture = item.icon - tooltip_text = item.item_name + #tooltip_text = item.item_name label.text = item.value @@ -28,7 +28,8 @@ func _get_drag_data(at_position: Vector2) -> Variant: c.add_child(preview) preview.position -= Vector2(32,32) preview.self_modulate = Color.TRANSPARENT - c.modulate = Color(c.modulate,0.5) + c.z_index = 3 + c.modulate = Color(c.modulate,0.6) set_drag_preview(c) icon.hide() return self @@ -47,7 +48,7 @@ func _drop_data(at_position: Vector2, data: Variant) -> void: func _on_mouse_entered() -> void: - print("im real?") + #print("im real?") if item: Tooltip.show_tip(item.item_name) pass # Replace with function body. diff --git a/inv_system/player_inventory.gd b/inv_system/player_inventory.gd new file mode 100644 index 0000000..4568973 --- /dev/null +++ b/inv_system/player_inventory.gd @@ -0,0 +1,19 @@ +extends Node + +@export var inventory_panel : Inventory +@export var button : Button + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + button.text = "Show Inventory" if !inventory_panel.visible else "Hide Inventory" + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta: float) -> void: + pass + + +func _on_button_pressed() -> void: + inventory_panel.visible = !inventory_panel.visible + button.text = "Show Inventory" if !inventory_panel.visible else "Hide Inventory" diff --git a/inv_system/player_inventory.gd.uid b/inv_system/player_inventory.gd.uid new file mode 100644 index 0000000..8a7687e --- /dev/null +++ b/inv_system/player_inventory.gd.uid @@ -0,0 +1 @@ +uid://jxkjnscuxcyi diff --git a/inv_system/player_inventory.tscn b/inv_system/player_inventory.tscn new file mode 100644 index 0000000..1e63258 --- /dev/null +++ b/inv_system/player_inventory.tscn @@ -0,0 +1,36 @@ +[gd_scene load_steps=3 format=3 uid="uid://bkhg56q71vsjv"] + +[ext_resource type="Script" uid="uid://jxkjnscuxcyi" path="res://inv_system/player_inventory.gd" id="1_vk2kx"] +[ext_resource type="PackedScene" uid="uid://bar46c75dbi2t" path="res://inv_system/inventory_panel.tscn" id="2_hk4hx"] + +[node name="PlayerInventory" type="Control" node_paths=PackedStringArray("inventory_panel", "button")] +z_index = 2 +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_vk2kx") +inventory_panel = NodePath("InventoryPanel") +button = NodePath("Button") + +[node name="Button" type="Button" parent="."] +layout_mode = 1 +anchors_preset = 2 +anchor_top = 1.0 +anchor_bottom = 1.0 +offset_top = -31.0 +offset_right = 129.0 +grow_vertical = 0 +text = "Show Inventory" + +[node name="InventoryPanel" parent="." instance=ExtResource("2_hk4hx")] +layout_mode = 0 +offset_left = 67.0 +offset_top = 79.0 +offset_right = 419.0 +offset_bottom = 561.0 + +[connection signal="pressed" from="Button" to="." method="_on_button_pressed"] diff --git a/project.godot b/project.godot index 13296cb..82378ef 100644 --- a/project.godot +++ b/project.godot @@ -18,6 +18,8 @@ config/icon="res://icon.svg" [autoload] Tooltip="*res://tooltip.tscn" +PlayerInventory="*res://inv_system/player_inventory.tscn" +Clock="*res://time_system/clock.tscn" [rendering] diff --git a/test.tscn b/test.tscn index 083a901..e864bd7 100644 --- a/test.tscn +++ b/test.tscn @@ -12,94 +12,33 @@ [ext_resource type="PackedScene" uid="uid://dgqs20xf7l8c" path="res://inv_system/item_slot.tscn" id="7_xersf"] [node name="Control" type="Control" node_paths=PackedStringArray("bin_inventory", "loot_button")] -z_index = -1 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_vbegm") bin_inventory = NodePath("BinPanel") loot_button = NodePath("LootButton") loot_pool = Array[ExtResource("2_ehkex")]([ExtResource("3_ykrsh"), ExtResource("5_g14j6"), ExtResource("5_00tp4"), ExtResource("6_77dp3"), ExtResource("7_5tkv4")]) [node name="TextureRect" type="TextureRect" parent="."] +z_index = -3 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_g14j6") expand_mode = 3 -[node name="InventoryPanel" type="PanelContainer" parent="." node_paths=PackedStringArray("grid", "inv_label")] -layout_mode = 0 -offset_left = 51.0 -offset_top = 67.0 -offset_right = 403.0 -offset_bottom = 549.0 -script = ExtResource("1_6uqi0") -inventory_name = "Your Items" -grid = NodePath("MarginContainer/VBoxContainer/ScrollContainer/GridContainer") -inv_label = NodePath("MarginContainer/VBoxContainer/Label") - -[node name="MarginContainer" type="MarginContainer" parent="InventoryPanel"] -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="InventoryPanel/MarginContainer"] -layout_mode = 2 - -[node name="Label" type="Label" parent="InventoryPanel/MarginContainer/VBoxContainer"] -layout_mode = 2 -text = "Inventory 1" - -[node name="ScrollContainer" type="ScrollContainer" parent="InventoryPanel/MarginContainer/VBoxContainer"] -layout_mode = 2 -size_flags_vertical = 3 - -[node name="GridContainer" type="GridContainer" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer"] -layout_mode = 2 -size_flags_vertical = 3 -columns = 5 - -[node name="ItemSlot" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("7_xersf")] -layout_mode = 2 - -[node name="ItemSlot2" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("7_xersf")] -layout_mode = 2 - -[node name="ItemSlot3" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("7_xersf")] -layout_mode = 2 - -[node name="ItemSlot4" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("7_xersf")] -layout_mode = 2 - -[node name="ItemSlot5" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("7_xersf")] -layout_mode = 2 - -[node name="ItemSlot6" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("7_xersf")] -layout_mode = 2 - -[node name="ItemSlot7" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("7_xersf")] -layout_mode = 2 - -[node name="ItemSlot8" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("7_xersf")] -layout_mode = 2 - -[node name="ItemSlot9" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("7_xersf")] -layout_mode = 2 - -[node name="ItemSlot10" parent="InventoryPanel/MarginContainer/VBoxContainer/ScrollContainer/GridContainer" instance=ExtResource("7_xersf")] -layout_mode = 2 - [node name="BinPanel" type="PanelContainer" parent="." node_paths=PackedStringArray("grid", "inv_label")] visible = false +z_index = 2 layout_mode = 0 offset_left = 714.0 offset_top = 386.0 diff --git a/time_system/clock.tscn b/time_system/clock.tscn new file mode 100644 index 0000000..69d5595 --- /dev/null +++ b/time_system/clock.tscn @@ -0,0 +1,55 @@ +[gd_scene load_steps=5 format=3 uid="uid://dpa3yvdrddtsh"] + +[ext_resource type="Texture2D" uid="uid://cvsibrbtuqfww" path="res://assets/ready_time.png" id="1_chnjs"] +[ext_resource type="Texture2D" uid="uid://bemb2moou1hkj" path="res://assets/timer_over.png" id="2_m6rn1"] +[ext_resource type="Texture2D" uid="uid://dvxtm2ahjd55h" path="res://assets/used_time.png" id="3_uyb5s"] + +[sub_resource type="LabelSettings" id="LabelSettings_r3ygl"] +font_size = 32 + +[node name="Clock" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="PanelContainer" type="PanelContainer" parent="."] +layout_mode = 1 +anchors_preset = 5 +anchor_left = 0.5 +anchor_right = 0.5 +offset_left = -20.0 +offset_right = 20.0 +offset_bottom = 40.0 +grow_horizontal = 2 + +[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer"] +layout_mode = 2 + +[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/HBoxContainer"] +layout_mode = 2 +alignment = 1 + +[node name="Label" type="Label" parent="PanelContainer/HBoxContainer/VBoxContainer"] +layout_mode = 2 +text = "7" +label_settings = SubResource("LabelSettings_r3ygl") +horizontal_alignment = 1 + +[node name="Label2" type="Label" parent="PanelContainer/HBoxContainer/VBoxContainer"] +layout_mode = 2 +text = "Days Left" + +[node name="TextureProgressBar" type="TextureProgressBar" parent="PanelContainer/HBoxContainer"] +custom_minimum_size = Vector2(150, 73) +layout_mode = 2 +fill_mode = 4 +radial_initial_angle = 270.0 +radial_fill_degrees = 180.0 +radial_center_offset = Vector2(0, 41.055) +nine_patch_stretch = true +texture_under = ExtResource("1_chnjs") +texture_over = ExtResource("2_m6rn1") +texture_progress = ExtResource("3_uyb5s") diff --git a/tooltip.gd b/tooltip.gd index 645805c..858ae9a 100644 --- a/tooltip.gd +++ b/tooltip.gd @@ -4,6 +4,7 @@ extends PanelContainer # Called when the node enters the scene tree for the first time. func _ready() -> void: + hide() pass # Replace with function body. @@ -13,6 +14,7 @@ func _process(delta: float) -> void: func show_tip(text : String): tooltip_label.text = text + reset_size() show() func hide_tip(): diff --git a/tooltip.tscn b/tooltip.tscn index f2bf746..a2d4fd2 100644 --- a/tooltip.tscn +++ b/tooltip.tscn @@ -20,6 +20,7 @@ corner_radius_bottom_left = 3 [sub_resource type="LabelSettings" id="LabelSettings_oxk8h"] [node name="Tooltip" type="PanelContainer" node_paths=PackedStringArray("tooltip_label")] +z_index = 3 offset_right = 95.0 offset_bottom = 31.0 size_flags_horizontal = 0