Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shop #137

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Shop #137

Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions #Scenes/Events/shop/0.t1104.tmp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[gd_scene load_steps=8 format=3 uid="uid://b8hbst1klk5ng"]

[ext_resource type="PackedScene" uid="uid://bam77cwf4emyr" path="res://#Scenes/TopBarOverlay.tscn" id="1_7gwvp"]
[ext_resource type="Script" path="res://#Scenes/SceneScripts/ShopScene.gd" id="1_u1m6k"]
[ext_resource type="Resource" uid="uid://uv2rili0xf3x" path="res://Cards/Resource/Card_Damage_EVERYTHING.tres" id="2_u60ec"]
[ext_resource type="Texture2D" uid="uid://bo0j1ve4n2ni7" path="res://Art/Background/Shop_Background.png" id="3_6osfu"]
[ext_resource type="Resource" uid="uid://d4lugn62mmlep" path="res://Cards/Resource/Card_DrawCards.tres" id="3_trwis"]
[ext_resource type="PackedScene" uid="uid://cdt4k2reymt2i" path="res://Shop/shop_item.tscn" id="4_bbct0"]
[ext_resource type="Resource" uid="uid://0x385c3nuq8f" path="res://Cards/Resource/Card_DamageAllEnemies.tres" id="4_e4vp7"]

[node name="Control" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_u1m6k")
cardPool = Array[Object]([ExtResource("2_u60ec"), ExtResource("3_trwis"), ExtResource("4_e4vp7")])

[node name="TopBarOverlay" parent="." instance=ExtResource("1_7gwvp")]
layout_mode = 1

[node name="TextureRect" type="TextureRect" parent="."]
layout_mode = 0
offset_left = 20.0
offset_top = 16.0
offset_right = 1068.0
offset_bottom = 1064.0
texture = ExtResource("3_6osfu")
expand_mode = 1

[node name="ShopItem" parent="." instance=ExtResource("4_bbct0")]
offset_left = 216.0
offset_top = 252.0
offset_right = 216.0
offset_bottom = 252.0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure that a .tmp file needs to be pushed

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a good way to revert this?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's a Stackoverflow on how to revert the file: https://stackoverflow.com/questions/18357511/git-remove-committed-file-after-push

But honestly... it's a .tmp file so I feel you could just delete this and push up that change. But I would sanity check that the shop scene is still working first after you delete and before you push up that change!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just delete the file and push the change, no one else uses the tmp file (as ty said, just check that it still works correctly before pushing, but I removed tmp file in another PR and it worked fine)

184 changes: 157 additions & 27 deletions #Scenes/Events/shop/0.tscn
Original file line number Diff line number Diff line change
@@ -1,44 +1,174 @@
[gd_scene load_steps=4 format=3 uid="uid://b8hbst1klk5ng"]
[gd_scene load_steps=10 format=3 uid="uid://b8hbst1klk5ng"]

[ext_resource type="PackedScene" uid="uid://bam77cwf4emyr" path="res://#Scenes/TopBarOverlay.tscn" id="1_7gwvp"]
[ext_resource type="Script" path="res://#Scenes/SceneScripts/ShopScene.gd" id="1_u1m6k"]
[ext_resource type="Script" path="res://#Scenes/Events/skipEventButton.gd" id="2_owx5q"]
[ext_resource type="PackedScene" uid="uid://cdt4k2reymt2i" path="res://Shop/shop_item_card.tscn" id="4_bbct0"]
[ext_resource type="Texture2D" uid="uid://c6fmkrnbs4mf6" path="res://Art/Background/0-0.test.CatTree.png" id="6_ppjdl"]
[ext_resource type="PackedScene" uid="uid://bmklwr3ycyicn" path="res://Shop/shop_item_relic.tscn" id="8_i0gsy"]
[ext_resource type="PackedScene" uid="uid://c4bsmddaua2ye" path="res://Shop/shop_item_consumable.tscn" id="10_jre48"]
[ext_resource type="PackedScene" uid="uid://tfeo4epmhse0" path="res://Shop/shop_item_torch.tscn" id="11_3t8vb"]
[ext_resource type="Script" path="res://#Scenes/Events/shop/CardRemoval.gd" id="12_1uxnd"]
[ext_resource type="Texture2D" uid="uid://dd06ocktximw7" path="res://Art/Menus/Trash-1.png" id="12_yofyg"]

[node name="Control" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 41.0
offset_top = -11.0
offset_right = 41.0
offset_bottom = -11.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_u1m6k")

[node name="TextEdit" type="TextEdit" parent="."]
layout_mode = 0
offset_right = 1276.0
offset_bottom = 715.0
theme_override_font_sizes/font_size = 100
placeholder_text = "This is a placeholder
shop event"

[node name="TopBarOverlay" parent="." instance=ExtResource("1_7gwvp")]
layout_mode = 1

[node name="SkipEventButton" type="Button" parent="."]
[node name="ShopItems" type="Control" parent="."]
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0

[node name="ShopItemTorch" parent="ShopItems" instance=ExtResource("11_3t8vb")]
offset_left = 835.0
offset_top = 116.0
offset_right = 835.0
offset_bottom = 116.0
amount = 5

[node name="Card" type="Control" parent="ShopItems"]
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0

[node name="ShopItemCard" parent="ShopItems/Card" instance=ExtResource("4_bbct0")]
offset_left = 1111.0
offset_top = 424.0
offset_right = 1111.0
offset_bottom = 424.0

[node name="ShopItem" parent="ShopItems/Card" instance=ExtResource("4_bbct0")]
offset_left = 648.0
offset_top = 404.0
offset_right = 648.0
offset_bottom = 404.0

[node name="ShopItem2" parent="ShopItems/Card" instance=ExtResource("4_bbct0")]
offset_left = 891.0
offset_top = 414.0
offset_right = 891.0
offset_bottom = 414.0

[node name="Item" type="Control" parent="ShopItems"]
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0

[node name="ShopItemItem" parent="ShopItems/Item" instance=ExtResource("8_i0gsy")]
offset_left = 183.0
offset_top = 904.0
offset_right = 183.0
offset_bottom = 904.0

[node name="ShopItemItem2" parent="ShopItems/Item" instance=ExtResource("8_i0gsy")]
offset_left = 363.0
offset_top = 901.0
offset_right = 363.0
offset_bottom = 901.0

[node name="ShopItem" parent="ShopItems/Item" instance=ExtResource("8_i0gsy")]
offset_left = 552.0
offset_top = 906.0
offset_right = 552.0
offset_bottom = 906.0

[node name="Consumables" type="Control" parent="ShopItems"]
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0

[node name="ShopItemConsumable" parent="ShopItems/Consumables" instance=ExtResource("10_jre48")]
offset_left = 257.0
offset_top = 113.0
offset_right = 257.0
offset_bottom = 113.0

[node name="ShopItemConsumable2" parent="ShopItems/Consumables" instance=ExtResource("10_jre48")]
offset_left = 472.0
offset_top = 117.0
offset_right = 472.0
offset_bottom = 117.0

[node name="ShopItemConsumable3" parent="ShopItems/Consumables" instance=ExtResource("10_jre48")]
offset_left = 650.0
offset_top = 107.0
offset_right = 650.0
offset_bottom = 107.0

[node name="CardRemoval" type="TextureButton" parent="ShopItems"]
layout_mode = 1
anchors_preset = 3
anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -280.0
offset_top = -220.0
offset_right = -80.0
offset_bottom = -140.0
grow_horizontal = 0
grow_vertical = 0
theme_override_font_sizes/font_size = 26
text = "Skip this event"
script = ExtResource("2_owx5q")

[connection signal="pressed" from="SkipEventButton" to="SkipEventButton" method="_on_pressed"]
anchors_preset = -1
anchor_left = 1.00078
anchor_right = 1.00078
offset_left = 731.966
offset_top = 769.0
offset_right = 791.966
offset_bottom = 829.0
scale = Vector2(2.92, 2.92)
texture_normal = ExtResource("12_yofyg")
texture_pressed = ExtResource("12_yofyg")
texture_hover = ExtResource("12_yofyg")
texture_disabled = ExtResource("12_yofyg")
texture_focused = ExtResource("12_yofyg")
stretch_mode = 0
script = ExtResource("12_1uxnd")

[node name="CardRemoval" type="Control" parent="ShopItems/CardRemoval"]
anchors_preset = 0
offset_left = -27.0
offset_top = -11.0
offset_right = -27.0
offset_bottom = -11.0

[node name="ColorRect" type="ColorRect" parent="ShopItems/CardRemoval/CardRemoval"]
layout_mode = 0
offset_left = 23.5753
offset_top = 76.7534
offset_right = 86.5753
offset_bottom = 100.753

[node name="Label" type="Label" parent="ShopItems/CardRemoval/CardRemoval/ColorRect"]
layout_mode = 0
offset_left = -0.109672
offset_top = 0.602746
offset_right = 61.8903
offset_bottom = 23.6027
scale = Vector2(0.998719, 1.01696)
theme_override_colors/font_color = Color(0, 0, 0, 1)
text = "100"
horizontal_alignment = 1
vertical_alignment = 1

[node name="BackGround" type="TextureRect" parent="."]
z_index = -1
layout_mode = 0
offset_left = -53.0
offset_top = 10.0
offset_right = 1960.0
offset_bottom = 1111.0
mouse_filter = 2
texture = ExtResource("6_ppjdl")
expand_mode = 1

[node name="Button" type="Button" parent="."]
layout_mode = 0
offset_left = 1352.0
offset_top = 226.0
offset_right = 1815.0
offset_bottom = 392.0
theme_override_font_sizes/font_size = 116
text = "Proceed"

[connection signal="pressed" from="Button" to="." method="_on_button_pressed"]
22 changes: 22 additions & 0 deletions #Scenes/Events/shop/CardRemoval.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
extends CardPileUISetter
Turtyo marked this conversation as resolved.
Show resolved Hide resolved

@onready var priceText : Label = $CardRemoval/ColorRect/Label

func _ready() -> void:
priceText.text = str(ShopManager.card_removal_price)
super()

func _pressed() -> void:
if(!InventoryManager.gold_component.can_afford(ShopManager.card_removal_price)):
return


var uiPile: Control = cardUI.instantiate()

uiPile.populate(get_name())
parent.add_child(uiPile)
queue_free()

func _on_button_pressed() -> void:

pass
9 changes: 9 additions & 0 deletions #Scenes/SceneScripts/ShopScene.gd
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
extends Control
class_name ShopScene

func _ready() -> void:
SaveManager.execute_save()

func _stock_shop() -> void:
pass


func _on_button_pressed() -> void:
PlayerManager.player_room.room_event.on_event_ended()
pass # Replace with function body.
4 changes: 2 additions & 2 deletions #Scenes/TestingScene.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
[ext_resource type="Texture2D" uid="uid://caemucaya30wh" path="res://Art/Card_layout/draw_pile.png" id="11_pw70x"]
[ext_resource type="Texture2D" uid="uid://d4muqvs3etnr8" path="res://Art/Card_layout/discard_pile.png" id="12_kxw48"]
[ext_resource type="Script" path="res://UI/EndTurnButton.gd" id="14_dpe64"]
[ext_resource type="PackedScene" path="res://#Scenes/TopBarOverlay.tscn" id="14_e54tj"]
[ext_resource type="PackedScene" uid="uid://bam77cwf4emyr" path="res://#Scenes/TopBarOverlay.tscn" id="14_e54tj"]
[ext_resource type="Script" path="res://UI/EnergyLabel.gd" id="14_nckre"]
[ext_resource type="Resource" path="res://Items/test_relic.tres" id="19_prw12"]
[ext_resource type="Resource" uid="uid://c5fh7bnfh3l4u" path="res://Items/test_relic.tres" id="19_prw12"]
[ext_resource type="Texture2D" uid="uid://bl5v3bgnntoc5" path="res://Art/Card_layout/energy_count.png" id="19_spyxg"]

[sub_resource type="GDScript" id="GDScript_g5yv1"]
Expand Down
Binary file added Art/Background/0-0.test.CatTree.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions Art/Background/0-0.test.CatTree.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://c6fmkrnbs4mf6"
path="res://.godot/imported/0-0.test.CatTree.png-85c2a2ddf3b5a611c2c6d4f74b8e8a51.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://Art/Background/0-0.test.CatTree.png"
dest_files=["res://.godot/imported/0-0.test.CatTree.png-85c2a2ddf3b5a611c2c6d4f74b8e8a51.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
Binary file added Art/Menus/Tourch-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions Art/Menus/Tourch-1.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://q8og304npj17"
path="res://.godot/imported/Tourch-1.png-725c85a730fc6605077802284887b207.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://Art/Menus/Tourch-1.png"
dest_files=["res://.godot/imported/Tourch-1.png-725c85a730fc6605077802284887b207.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
Binary file added Art/Menus/Trash-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions Art/Menus/Trash-1.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://dd06ocktximw7"
path="res://.godot/imported/Trash-1.png-ce07c71134e16d0aecc8b7d0db00fb11.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://Art/Menus/Trash-1.png"
dest_files=["res://.godot/imported/Trash-1.png-ce07c71134e16d0aecc8b7d0db00fb11.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
Loading