-
Notifications
You must be signed in to change notification settings - Fork 12
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
JonaLam
wants to merge
12
commits into
Saplings-Projects:main
Choose a base branch
from
JonaLam:Shop
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Shop #137
Changes from 3 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
44ed5b2
Shop Scene
JonaLam 35a64ba
Shop items
JonaLam c0b9253
fixed nameing
JonaLam 595c1f4
Moved the autoload to a scene
JonaLam be35286
Added checks if things can be done
JonaLam 7a66957
Moved script
JonaLam 80b5b80
fixed rng
JonaLam b3b6044
added debug var
JonaLam 15f1022
Renamed typo
JonaLam 6bf3190
Commented code
JonaLam 0f2360a
Delete 0.t1104.tmp
JonaLam 54a8f62
Fixed Card removal UI
JonaLam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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)