1
Fork 0
mirror of https://github.com/Steffo99/swear-jar.git synced 2024-11-21 23:34:18 +00:00

Shop improv

This commit is contained in:
Steffo 2023-10-02 20:31:50 +02:00
parent 48dd08642e
commit 2aabadc815
Signed by: steffo
GPG key ID: 2A24051445686895
5 changed files with 12 additions and 4 deletions

View file

@ -71,6 +71,7 @@ func update_counter_text():
@export var upgrade_copper_texture: Texture2D @export var upgrade_copper_texture: Texture2D
@export var upgrade_silver_texture: Texture2D @export var upgrade_silver_texture: Texture2D
@export var upgrade_gold_texture: Texture2D @export var upgrade_gold_texture: Texture2D
@export var upgrade_gem_texture: Texture2D
func update_counter_icon(): func update_counter_icon():
if len(store_collector.collecting_types) == 0: if len(store_collector.collecting_types) == 0:
@ -81,6 +82,8 @@ func update_counter_icon():
store_collector_texturerect.texture = upgrade_silver_texture store_collector_texturerect.texture = upgrade_silver_texture
elif store_collector.collecting_types[0] == &"Gold": elif store_collector.collecting_types[0] == &"Gold":
store_collector_texturerect.texture = upgrade_gold_texture store_collector_texturerect.texture = upgrade_gold_texture
elif store_collector.collecting_types[0] == &"Gem":
store_collector_texturerect.texture = upgrade_gem_texture
else: else:
store_collector_texturerect.texture = null store_collector_texturerect.texture = null

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=23 format=3 uid="uid://c3rxmcwa5nqng"] [gd_scene load_steps=24 format=3 uid="uid://c3rxmcwa5nqng"]
[ext_resource type="Script" path="res://game/game.gd" id="1_i3ly0"] [ext_resource type="Script" path="res://game/game.gd" id="1_i3ly0"]
[ext_resource type="PackedScene" uid="uid://bllsprv8orpn4" path="res://bottle/bottle.tscn" id="1_y7o2l"] [ext_resource type="PackedScene" uid="uid://bllsprv8orpn4" path="res://bottle/bottle.tscn" id="1_y7o2l"]
@ -6,6 +6,7 @@
[ext_resource type="Texture2D" uid="uid://7b12rwclhrq0" path="res://interface/upgrade_silver.png" id="3_8wvr1"] [ext_resource type="Texture2D" uid="uid://7b12rwclhrq0" path="res://interface/upgrade_silver.png" id="3_8wvr1"]
[ext_resource type="PackedScene" uid="uid://c67lfbk4gf1ga" path="res://spawner/spawner.tscn" id="3_qwsty"] [ext_resource type="PackedScene" uid="uid://c67lfbk4gf1ga" path="res://spawner/spawner.tscn" id="3_qwsty"]
[ext_resource type="Texture2D" uid="uid://taojrwr7xrp4" path="res://interface/upgrade_gold.png" id="4_i557v"] [ext_resource type="Texture2D" uid="uid://taojrwr7xrp4" path="res://interface/upgrade_gold.png" id="4_i557v"]
[ext_resource type="Texture2D" uid="uid://yx3gme4q4ote" path="res://interface/upgrade_gem.png" id="5_wbw72"]
[ext_resource type="Texture2D" uid="uid://pj3ip6vlatms" path="res://converters/copper_to_silver/copper_converter.png" id="6_0jj8g"] [ext_resource type="Texture2D" uid="uid://pj3ip6vlatms" path="res://converters/copper_to_silver/copper_converter.png" id="6_0jj8g"]
[ext_resource type="PackedScene" uid="uid://beg758fa6o0cs" path="res://value/evaluator.tscn" id="6_my6nv"] [ext_resource type="PackedScene" uid="uid://beg758fa6o0cs" path="res://value/evaluator.tscn" id="6_my6nv"]
[ext_resource type="PackedScene" uid="uid://ratkps4plkhl" path="res://converters/copper_to_silver/copper_converter.tscn" id="7_ipeok"] [ext_resource type="PackedScene" uid="uid://ratkps4plkhl" path="res://converters/copper_to_silver/copper_converter.tscn" id="7_ipeok"]
@ -39,6 +40,7 @@ script = ExtResource("1_i3ly0")
upgrade_copper_texture = ExtResource("11_lt33g") upgrade_copper_texture = ExtResource("11_lt33g")
upgrade_silver_texture = ExtResource("3_8wvr1") upgrade_silver_texture = ExtResource("3_8wvr1")
upgrade_gold_texture = ExtResource("4_i557v") upgrade_gold_texture = ExtResource("4_i557v")
upgrade_gem_texture = ExtResource("5_wbw72")
[node name="GravityFromGyro" parent="." instance=ExtResource("2_h2pfr")] [node name="GravityFromGyro" parent="." instance=ExtResource("2_h2pfr")]

View file

@ -3,15 +3,15 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://yx3gme4q4ote" uid="uid://yx3gme4q4ote"
path="res://.godot/imported/gem_stack.png-48697e8b235aeec145f6f7d9b3d945cf.ctex" path="res://.godot/imported/upgrade_gem.png-5e957de962fd10a13373014fc76b9725.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false
} }
[deps] [deps]
source_file="res://entity/gem_stack.png" source_file="res://interface/upgrade_gem.png"
dest_files=["res://.godot/imported/gem_stack.png-48697e8b235aeec145f6f7d9b3d945cf.ctex"] dest_files=["res://.godot/imported/upgrade_gem.png-5e957de962fd10a13373014fc76b9725.ctex"]
[params] [params]

View file

@ -54,3 +54,6 @@ func _on_shop_ui_delete_begin():
func _on_shop_ui_delete_cancel(): func _on_shop_ui_delete_cancel():
ui_state = UIState.GAME ui_state = UIState.GAME
func _on_shop_ui_purchase_cancel(_what):
ui_state = UIState.GAME