Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
2d96b4a
Update GDUnit
Structed Sep 20, 2025
a14ac7c
Update gdUnit to a pre-release compatible with Godot 4.5
Structed Oct 3, 2025
68df358
Upgrade GDUnit
Structed Sep 20, 2025
674553f
Update GDUnit
Structed Sep 20, 2025
9dee1f5
Add new Models
Structed Sep 20, 2025
f576ab4
Started implementation of Catalog (Economy V2) API
Structed Sep 20, 2025
ba427ad
Fixed naming of GetItemsRequest
Structed Sep 20, 2025
24066c6
Made some improvements to the docs->model parser
Structed Sep 20, 2025
6b2d315
Fix model generation from docs
Structed Sep 21, 2025
aa320b8
cleanup model generation
Structed Sep 21, 2025
9424c14
Clean up PlayFabCatalog.gd
Structed Sep 21, 2025
847b362
Added searchItems request to catalog
Structed Sep 21, 2025
7c5faab
do not in clude fields with empty strings in the PlayFab request
Structed Sep 27, 2025
28a677e
introduced a global `api_error` handler
Structed Sep 27, 2025
ca39f72
cleanup
Structed Sep 27, 2025
b42c583
cleanup
Structed Sep 27, 2025
a36a8b9
WIP: Rework JsonSerializable.gd to support typed arrays.
Structed Sep 27, 2025
cafe237
Added type hints to CatalogItem.gd
Structed Sep 27, 2025
c9661cf
cleanup
Structed Sep 27, 2025
a27634f
Implemented Typed Array deserialization in JsonSerializable.gd
Structed Sep 27, 2025
427db86
added todo for typed dictionaries
Structed Sep 27, 2025
c487019
Fixed model to not use typed dictionaries
Structed Sep 27, 2025
c54890c
removed typings for dictionaries in models, cleaned up
Structed Sep 27, 2025
3cd1477
cleanup
Structed Sep 27, 2025
ab598c6
Add type hints
Structed Sep 27, 2025
f4f8fc8
Add search_items capability to PlayFabCatalog.gd
Structed Sep 27, 2025
9f8c849
remove loggie statement
Structed Sep 27, 2025
f69be71
refine search_results type to use CatalogItem for improved clarity
Structed Sep 27, 2025
f2af1e2
cleanup
Structed Sep 27, 2025
8bdcd03
Introducing PlayFab.LANG_NEUTRAL constant
Structed Sep 27, 2025
d4931a9
On search complete, emit signal
Structed Sep 28, 2025
61367ca
Add Catalog screen and ItemCard widget
Structed Sep 28, 2025
e628a25
Add GodotFest assets
Structed Sep 28, 2025
ca37503
Add the "soft_retro" theme
Structed Sep 28, 2025
02ddc80
Made the catalog scene tabbed
Structed Oct 3, 2025
c2b157a
Added currency tab in Economy
Structed Oct 3, 2025
ecea2ff
Add new theme
Structed Oct 4, 2025
1787d9d
updated theme
Structed Oct 4, 2025
fe5fb94
Add missing signal `search_currency_complete`
Structed Oct 4, 2025
696e3fa
Add http request pooling
Structed Oct 4, 2025
a0641d5
Add filter to not query for currencies
Structed Oct 4, 2025
13d67bd
fix alignment of Tab bar content
Structed Oct 4, 2025
bdf2af2
Add PlayFabInventory.gd
Structed Oct 5, 2025
c9356b0
Add inventory models
Structed Oct 5, 2025
80b76ea
Add inventory to PlayFabManager.gd
Structed Oct 5, 2025
5996553
Refactored economy scenes
Structed Oct 5, 2025
9af3805
Separate individual HTTP requests for future flexibility
Structed Oct 5, 2025
025a85b
wip inventory implementation
Structed Oct 7, 2025
6310317
renamed _search_all_tems to _fetch_catalog
Structed Oct 7, 2025
f14c914
cleanup
Structed Oct 7, 2025
a884741
Hydrate the full catalog and cache it in memory
Structed Oct 7, 2025
e19aeaa
Use cached catalog
Structed Oct 7, 2025
9556be5
Make loading of catalog items less complex and more robust
Structed Oct 7, 2025
2737191
Turboloading and showing inventory items
Structed Oct 7, 2025
6204369
Load catalog & inventory on playfab init
Structed Oct 7, 2025
a8fcb1e
always turboload inventory if called (unless it's already doing that)
Structed Oct 7, 2025
7b1117a
Removed support for Godot versions < 4.5
Structed Oct 7, 2025
30fbd87
Load inventory if enventory timeout
Structed Oct 8, 2025
6b8dc77
cleanup
Structed Oct 8, 2025
4c1135f
Fixced title and layout of Inventory scene
Structed Oct 8, 2025
5697816
Currencies in inventories now go into the currencies tab
Structed Oct 8, 2025
d7317ca
rename item to inventory_item for clarity
Structed Oct 8, 2025
7118772
Implemented force refresh of Inventory
Structed Oct 8, 2025
c2fbac9
Added CatalogItem type constants
Structed Oct 8, 2025
abd28fb
renamed button for EconomyV2
Structed Oct 8, 2025
1f177c3
Added amount to Inventory
Structed Oct 8, 2025
9a5e43e
Add PlayFab models for PurchaseItems implementation
Structed Oct 10, 2025
d4685fe
Implemented Purchase Inventory Items
Structed Oct 10, 2025
68a6e77
Fixed types for amounts
Structed Oct 11, 2025
be0f9b2
cleanup
Structed Oct 11, 2025
0a57c0b
Inmproved (de)serialisation
Structed Oct 11, 2025
03f1d7b
using new style of emitting signals
Structed Oct 11, 2025
69a5cd2
Implemented Purchasing fo items with virtual currency
Structed Oct 11, 2025
0ff0ada
connect api and server errors on PlayFabHttp
Structed Oct 11, 2025
0f3d98b
Display all prices for an item
Structed Oct 11, 2025
00cb844
Added ToastParty plugin
Structed Oct 11, 2025
f15e8ff
cleanup
Structed Oct 11, 2025
350d934
Added Toast for purchase confirmation
Structed Oct 11, 2025
2cd9efc
Increased default toast timeout from 2 to 5 seconds
Structed Oct 11, 2025
359e0db
Fixed: non UUID reference in ToastLabel scene
Structed Oct 11, 2025
9b05ff2
cleanup
Structed Oct 11, 2025
2b64cb7
Fix root node name of inventory
Structed Oct 11, 2025
1b2b978
fix size flags for Catalog & Inventory
Structed Oct 11, 2025
004af07
Add Steam ItemDem.json
Structed Oct 11, 2025
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
8 changes: 0 additions & 8 deletions .github/workflows/main-godot4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,6 @@ jobs:
max-parallel: 10
matrix:
include:
- os: ubuntu-latest
godot-version: '4.3'
godot-status: 'stable'
gdunit-version: 'v5.1'
- os: ubuntu-latest
godot-version: '4.4'
godot-status: 'stable'
gdunit-version: 'v5.1'
- os: ubuntu-latest
godot-version: '4.5'
godot-status: 'stable'
Expand Down
Binary file added Assets/godotfest_swag_shirt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions Assets/godotfest_swag_shirt.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://bpbaxw0vyursa"
path="res://.godot/imported/godotfest_swag_shirt.png-8414ca085264c6db3e10a2f7cd68b762.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://Assets/godotfest_swag_shirt.png"
dest_files=["res://.godot/imported/godotfest_swag_shirt.png-8414ca085264c6db3e10a2f7cd68b762.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
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@


[![Discord](https://img.shields.io/discord/1020665079668166677?color=rgb%2888%2C%20101%2C%20242%29&label=Discord&logo=discord)](https://discord.gg/7K7q2YuNXe)
![Godot Version - 4.3](https://img.shields.io/badge/Godot_Version-4.3-2ea44f?logo=godotengine)
![Godot Version - 4.4](https://img.shields.io/badge/Godot_Version-4.4-2ea44f?logo=godotengine)
![Godot Version - 4.5](https://img.shields.io/badge/Godot_Version-4.5-2ea44f?logo=godotengine)


Expand Down
13 changes: 13 additions & 0 deletions Scenes/Economy.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
extends Control


func _on_catalog_button_pressed() -> void:
SceneManager.goto_scene("res://Scenes/Economy/Catalog.tscn")


func _on_inventory_button_pressed() -> void:
SceneManager.goto_scene("res://Scenes/Economy/Inventory.tscn")


func _on_back_button_pressed() -> void:
SceneManager.goto_scene("res://Scenes/LoggedIn.tscn")
1 change: 1 addition & 0 deletions Scenes/Economy.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://vn8hsu4l0ml8
40 changes: 40 additions & 0 deletions Scenes/Economy.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[gd_scene load_steps=2 format=3 uid="uid://csavdi738j7na"]

[ext_resource type="Script" uid="uid://vn8hsu4l0ml8" path="res://Scenes/Economy.gd" id="1_ngxwe"]

[node name="Economy" 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_ngxwe")

[node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

[node name="Label" type="Label" parent="VBoxContainer"]
layout_mode = 2
text = "Economy V2"

[node name="CatalogButton" type="Button" parent="VBoxContainer"]
layout_mode = 2
text = "Catalog"

[node name="InventoryButton" type="Button" parent="VBoxContainer"]
layout_mode = 2
text = "Inventory"

[node name="BackButton" type="Button" parent="VBoxContainer"]
layout_mode = 2
text = "Back to Main Menu"

[connection signal="pressed" from="VBoxContainer/CatalogButton" to="." method="_on_catalog_button_pressed"]
[connection signal="pressed" from="VBoxContainer/InventoryButton" to="." method="_on_inventory_button_pressed"]
[connection signal="pressed" from="VBoxContainer/BackButton" to="." method="_on_back_button_pressed"]
30 changes: 30 additions & 0 deletions Scenes/Economy/Catalog.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
extends Control

@onready var card_scene: PackedScene = preload("res://Scenes/Widgets/ItemCard.tscn")

func _ready() -> void:
%LoadingIndicator.show()
PlayFabManager.catalog.search_complete.connect(_on_search_complete)
if PlayFabManager.catalog._has_full_catalog:
_on_search_complete()
else:
PlayFabManager.catalog.fetch_catalog()


func _on_search_complete() -> void:
var catalog := PlayFabManager.catalog.get_catalog()
for key in catalog:
var catalog_item: CatalogItem = catalog[key]
var card: ItemCard = card_scene.instantiate()
card.reset(catalog_item)
if catalog_item.Type == CatalogItem.TYPE_CURRENCY:
%LoadingIndicator.hide()
%CurrencyCardGridContainer.add_child(card)
else:
%LoadingIndicator.hide()
%ItemCardGridContainer.add_child(card)



func _on_back_button_pressed() -> void:
SceneManager.goto_scene("res://Scenes/Economy.tscn")
1 change: 1 addition & 0 deletions Scenes/Economy/Catalog.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://cvn4peu38pqpe
99 changes: 99 additions & 0 deletions Scenes/Economy/Catalog.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
[gd_scene load_steps=3 format=3 uid="uid://cq24viuorfsjc"]

[ext_resource type="Script" uid="uid://cvn4peu38pqpe" path="res://Scenes/Economy/Catalog.gd" id="1_lnqhp"]
[ext_resource type="PackedScene" uid="uid://wwvhjjuojn77" path="res://Scenes/Widgets/LoadingIndicator.tscn" id="2_8nk0b"]

[node name="Catalog" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 6
size_flags_vertical = 6
script = ExtResource("1_lnqhp")

[node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_bottom = -46.0
grow_horizontal = 2
grow_vertical = 2

[node name="Header" type="Label" parent="VBoxContainer"]
layout_mode = 2
text = "Catalog"

[node name="HSeparator" type="HSeparator" parent="VBoxContainer"]
custom_minimum_size = Vector2(0, 20)
layout_mode = 2

[node name="TabContainer" type="TabContainer" parent="VBoxContainer"]
layout_mode = 2
size_flags_vertical = 3
current_tab = 0

[node name="Items" type="TabBar" parent="VBoxContainer/TabContainer"]
layout_mode = 2
metadata/_tab_index = 0

[node name="ItemCardGridContainer" type="GridContainer" parent="VBoxContainer/TabContainer/Items"]
unique_name_in_owner = true
custom_minimum_size = Vector2(100, 100)
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_vertical = 3
columns = 4

[node name="Currencies" type="TabBar" parent="VBoxContainer/TabContainer"]
visible = false
layout_mode = 2
metadata/_tab_index = 1

[node name="CurrencyCardGridContainer" type="GridContainer" parent="VBoxContainer/TabContainer/Currencies"]
unique_name_in_owner = true
custom_minimum_size = Vector2(100, 100)
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_vertical = 3
columns = 4

[node name="BackButton" type="Button" parent="."]
layout_mode = 1
anchors_preset = 12
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_top = -29.0
grow_horizontal = 2
grow_vertical = 0
text = "Back to Economy"

[node name="ProgressCenter" type="CenterContainer" parent="."]
custom_minimum_size = Vector2(100, 100)
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2

[node name="LoadingIndicator" parent="ProgressCenter" instance=ExtResource("2_8nk0b")]
unique_name_in_owner = true
visible = false
custom_minimum_size = Vector2(100, 100)
layout_mode = 2

[connection signal="pressed" from="BackButton" to="." method="_on_back_button_pressed"]
51 changes: 51 additions & 0 deletions Scenes/Economy/Inventory.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
extends Control

@onready var card_scene: PackedScene = preload("res://Scenes/Widgets/ItemCard.tscn")

var inventory_items: Array = []

func _ready() -> void:
_update_inventory()

func _update_inventory() -> void:
%LoadingIndicator.show()

var catalog: Dictionary[String, CatalogItem] = PlayFabManager.catalog.get_catalog()
var inventory: Dictionary[String, InventoryItem] = PlayFabManager.inventory.get_inventory()
for id in inventory:
var inventory_item: InventoryItem = inventory[id]
var catalog_item: CatalogItem = resolve_catalog_item(inventory_item.Id, catalog)
var card: ItemCard = card_scene.instantiate()
card.reset_inventory(catalog_item, inventory_item)

if inventory_item.Type == CatalogItem.TYPE_CURRENCY:
%CurrencyCardGridContainer.add_child(card)
else:
%ItemCardGridContainer.add_child(card)


%LoadingIndicator.hide()

func _clear_inventory() -> void:
for child in %CurrencyCardGridContainer.get_children():
%CurrencyCardGridContainer.remove_child(child)
child.queue_free()

for child in %ItemCardGridContainer.get_children():
%ItemCardGridContainer.remove_child(child)
child.queue_free()

func resolve_catalog_item(item_id: String, catalog: Dictionary[String, CatalogItem]) -> CatalogItem:
var item = catalog.get(item_id, CatalogItem.new())
return item

func _on_back_button_pressed() -> void:
SceneManager.goto_scene("res://Scenes/Economy.tscn")


func _on_referesh_button_pressed() -> void:
%LoadingIndicator.show()
_clear_inventory()
PlayFabManager.inventory.turboload_inventory(func():
_update_inventory()
)
1 change: 1 addition & 0 deletions Scenes/Economy/Inventory.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://bdlfoyj3jgt24
Loading