@@ -159,7 +159,9 @@ func _load_library(
159
159
var items := [] as Array [LibraryLaunchItem ]
160
160
for i in json_items :
161
161
var item : Dictionary = i
162
+ var launch_item := LibraryLaunchItem .from_dict (item )
162
163
items .append (LibraryLaunchItem .from_dict (item ))
164
+ launch_item_added .emit (launch_item )
163
165
return items
164
166
165
167
# Wait for the steam client if it's not ready
@@ -175,21 +177,29 @@ func _load_library(
175
177
176
178
# Get all available apps
177
179
var app_ids : PackedInt64Array = await get_available_apps ()
178
- var app_info : Dictionary = await get_apps_info (app_ids )
180
+
181
+ # Get installed apps
179
182
var apps_installed : Array = await steam .get_installed_apps ()
180
183
var app_ids_installed := PackedStringArray ()
181
184
for app in apps_installed :
182
185
app_ids_installed .append (app ["id" ])
183
186
184
- # Generate launch items for each game
187
+ # Get the app info for each discovered game and create a launch item for
188
+ # it.
185
189
var items := [] as Array [LibraryLaunchItem ]
186
- for app_id in app_info .keys ():
187
- var info := app_info [app_id ] as Dictionary
188
- var item := _app_info_to_launch_item (info , app_id in app_ids_installed )
190
+ for app_id in app_ids :
191
+ var id := str (app_id )
192
+ var info := await get_app_info (id , caching_flags )
193
+
194
+ if not id in info :
195
+ continue
196
+
197
+ var item := _app_info_to_launch_item (info , str (app_id ) in app_ids_installed )
189
198
if not item :
190
- logger .debug ("Unable to create launch item for: " + app_id )
199
+ logger .debug ("Unable to create launch item for: " + str ( app_id ) )
191
200
continue
192
201
items .append (item )
202
+ launch_item_added .emit (item )
193
203
194
204
# Cache the discovered apps
195
205
if caching_flags & Cache .FLAGS .SAVE :
0 commit comments