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

Web Services #354

Open
wants to merge 138 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
138 commits
Select commit Hold shift + click to select a range
b46493c
Create the initial functionality for a Web Services module that will …
bmcclure Dec 12, 2022
506950e
Ignore task output on build-includes task in vscode
bmcclure Dec 12, 2022
50c6038
Add a ParameterState state class that loads and saves from temporary …
bmcclure Dec 12, 2022
ad7ff99
Save the container in StateBase
bmcclure Dec 12, 2022
1fd3968
Move entity icon retrieval to a separate method in ManageEntitiesWindow
bmcclure Dec 12, 2022
b8521c2
Make API integration optional in AppEntityBase
bmcclure Dec 12, 2022
73d168f
Fix icon references in web services manager window
bmcclure Dec 12, 2022
92ab4ad
Remove old API fields from web services entities
bmcclure Dec 12, 2022
b840870
Fix bugs with WebServiceEntity and make the fields not editable if th…
bmcclure Dec 12, 2022
ffd8b48
Fixes to WebServices module file
bmcclure Dec 12, 2022
7a11449
Fix logo icon reference for launchpad web service provider
bmcclure Dec 12, 2022
e2461aa
Make Provider field never editable after creating a Web Service entity
bmcclure Dec 12, 2022
286624c
Allow runtime config storage entities (entities that don't save data …
bmcclure Dec 12, 2022
d94ce49
Make web_service_provider entity type store its data in runtime confi…
bmcclure Dec 12, 2022
6977913
Add helper methods Login, Logout, and IsAuthenticated to WebServiceEn…
bmcclure Dec 12, 2022
6e296b9
Store the request object in WebServiceResponseEvent as well
bmcclure Dec 12, 2022
e5b16fd
Add Login or Logout context menu item to Web Services
bmcclure Dec 12, 2022
6481fd4
Add missing cache assignment
bmcclure Dec 12, 2022
35cdf82
Support passing UrlObj objects into the "path" parameter of WebServic…
bmcclure Dec 12, 2022
ceccd66
Add entityObj parameter to GetContextMenuItems method in ManageEntiti…
bmcclure Dec 12, 2022
4a50a00
Fix regex definition in UrlObj
bmcclure Dec 12, 2022
bbf5517
Fix reference to PlatformsWindow
bmcclure Dec 12, 2022
6352c4b
Hide Basic platform from Platforms window
bmcclure Dec 12, 2022
8a1279c
Standardize module versions for display
bmcclure Dec 12, 2022
9adba30
Pass isCore value in to each module constructor for safety
bmcclure Dec 12, 2022
ab8d1a5
Replace "Build-in" version string with "Core"
bmcclure Dec 12, 2022
591c10a
Add category, source, and better module version strings to module man…
bmcclure Dec 12, 2022
b72c3ba
Standardize all graphics resources to lower-case
bmcclure Dec 12, 2022
41faf6e
Fix spinner filename
bmcclure Dec 12, 2022
ec9ba3d
Fix reg lookup key for Epic Games platform
bmcclure Dec 12, 2022
8946e32
Filter keys in DetectedGame objects more thoroughly, allow detecting …
bmcclure Dec 12, 2022
b5b650d
Fix saving existing entities during game detection
bmcclure Dec 12, 2022
2dcb43d
Show username for each auth service if available
bmcclure Dec 12, 2022
0caa0c9
Standardize how window and control resizing cascades
bmcclure Dec 12, 2022
9680f3c
Fix missing refresh path for Launchpad API provider
bmcclure Dec 12, 2022
2c3496d
Simplify access to AuthData and resolve data-related login issues
bmcclure Dec 12, 2022
7c268aa
Add Auto Login option to web services and show it in the manager wind…
bmcclure Dec 12, 2022
176e2ca
Add missing file from last change
bmcclure Dec 12, 2022
971c3fc
Remove previous auto-login functionality
bmcclure Dec 12, 2022
0d8de85
Always pass container into event subscribers
bmcclure Dec 12, 2022
a59b4ed
Move APP_POST_STARTUP event to after the RunApp method has run
bmcclure Dec 12, 2022
2c82a37
Add Enabled field to WebService entities
bmcclure Dec 12, 2022
d8561c6
Query(Create a WebServicesEventSubscriber that handles auto-login ser…
bmcclure Dec 12, 2022
358ae49
Allow canceling authentication GUI without retrying
bmcclure Dec 12, 2022
dba5a62
Show a normal dialog message after exceeding the max login retries in…
bmcclure Dec 12, 2022
22386c0
Allow overriding which default context menu buttons show in entity ed…
bmcclure Dec 12, 2022
650f2cb
Update MainWindow to use new API web service
bmcclure Dec 12, 2022
0ec7b0c
Update LaunchpadBuilder to use new API web service
bmcclure Dec 12, 2022
c8e272a
Update LaunchpadApi module to depend on WebServices module, and remov…
bmcclure Dec 12, 2022
c39399d
Remove unused AuthInfo tests
bmcclure Dec 12, 2022
1567435
Standardize AlterRequest parameters
bmcclure Dec 12, 2022
5b2b4dc
Add GetStatusInfo to WebServiceEntity (but it isn't finished yet)
bmcclure Dec 12, 2022
c9b41a6
Update ApiDataSource to get data through the API web service
bmcclure Dec 12, 2022
343e133
Update account info window to use API web service
bmcclure Dec 12, 2022
23ec7a9
Remove unused Auth module
bmcclure Dec 12, 2022
981d402
Refactor status indicators to show one per account, work in progress
bmcclure Dec 12, 2022
9fd1e78
Remove player_name setting
bmcclure Dec 13, 2022
b87c2c9
Move callbacks for status indicators into the StatusIndicator control…
bmcclure Dec 13, 2022
dd9dba1
Change "email" to "account" in authentication data so it is more generic
bmcclure Dec 13, 2022
383d2e2
Committing WebServiceLayerSource for posterity because I'm about to r…
bmcclure Dec 13, 2022
f10500f
Rename "api" services to "launchpad_api"
bmcclure Dec 13, 2022
a882b8c
Add WebServiceAdapter entity types, the concept of web service data t…
bmcclure Dec 13, 2022
65af969
Fix extra function in TabsControl
bmcclure Dec 13, 2022
e33084f
Fix include
bmcclure Dec 13, 2022
44759b2
Replace WebServiceLayerSource with WebServiceAdapterLayerSource to si…
bmcclure Dec 13, 2022
4f1bf74
Missing change from last commit
bmcclure Dec 13, 2022
0cb1bed
Remove the concept of a "local" data source for now
bmcclure Dec 13, 2022
a6f746c
Remove old api_endpoint config value
bmcclure Dec 13, 2022
d4530c3
Allow generically making requests to web service adapters based on fi…
bmcclure Dec 13, 2022
744bd9b
Move main menu definitions to the main app class, and use a series of…
bmcclure Dec 13, 2022
7e45a12
Turn update checks into an event which is subscribed from the Launchp…
bmcclure Dec 13, 2022
b31c437
Only enable app.supports_update_check if the LaunchpadApi module is e…
bmcclure Dec 13, 2022
ecc6e2e
Rename and add to entity data events
bmcclure Dec 14, 2022
e4d0db8
wording change
bmcclure Dec 14, 2022
3eb32cc
Remove api_authentication and data_source_key config parameters
bmcclure Dec 14, 2022
db232b1
Remove unused dataSource assignments
bmcclure Dec 14, 2022
484b200
Add entity_lookup data type to WebServices module
bmcclure Dec 14, 2022
8cc332f
Lots of interconnected changes to replace DataSource and DSItem conce…
bmcclure Dec 14, 2022
ca26128
Rename DataLookupKey to LaunchpadApiRef
bmcclure Dec 14, 2022
e908cc9
Rename LauncherSpecificId to PlatformRef
bmcclure Dec 14, 2022
cbd8a79
Fix 0 array index in VersionChecker
bmcclure Dec 17, 2022
85ffdca
Throw an exception if unable to delete include file
bmcclure Dec 17, 2022
bd08d3d
Add NullEntityStorage class for use if you don't want any backend
bmcclure Dec 17, 2022
303f405
Update WebService module events
bmcclure Dec 17, 2022
e0c2b7e
Add an availability_check web service data type
bmcclure Dec 17, 2022
b7e6f7c
Return this from EntityStorageLayerSource DeleteData method
bmcclure Dec 17, 2022
a91c24c
Simple language update
bmcclure Dec 17, 2022
94d327e
Define a WebServiceAdapter service
bmcclure Dec 17, 2022
284c38f
Add an option to store child entity data inside the parent's entity s…
bmcclure Dec 17, 2022
17ce18a
Add an event that can be fired to determine an entity's parent entity
bmcclure Dec 17, 2022
78b14b4
Refactor EntityData so that passing in layer names and layer sources …
bmcclure Dec 17, 2022
b12a217
Fix entity constructors (Except Managed entities because they will be…
bmcclure Dec 17, 2022
760826d
Change ManagedEntityBase into LaunchProcessEntity, ManagedLauncherEnt…
bmcclure Dec 17, 2022
c92e332
Update field types to support cardinality options better
bmcclure Dec 17, 2022
fd110be
Return this from set functions
bmcclure Dec 17, 2022
25804aa
Fire the new EntityParentEvent from EntityBase to determine the parent
bmcclure Dec 17, 2022
ad8e56d
Only create EntityDat automatically if dataLoaded = false, and set it…
bmcclure Dec 17, 2022
7215fa3
Remove ConfigPrefix and update additionalManagedLauncherDefaults to a…
bmcclure Dec 17, 2022
bf7e213
Don't pass LauncherType or GameType in during detected game creation …
bmcclure Dec 17, 2022
d4aa481
Remove recursive options from AutoDetectValues and InitializeDefaults…
bmcclure Dec 17, 2022
1eae187
Rename recursive option to recurse in DiffChanges method
bmcclure Dec 17, 2022
a7f0d9d
Make layerNames and layerSources optional in LayeredDataBase
bmcclure Dec 17, 2022
0399fb1
Define parent entity storage on game_process and launcher_process ent…
bmcclure Dec 17, 2022
f2f7b05
Missing change from last commit
bmcclure Dec 17, 2022
90b452b
Temporarily add single cardinality options to some Launcher fields un…
bmcclure Dec 17, 2022
4ed87e1
Always set cache object in CachedWebServiceResponseBase
bmcclure Dec 17, 2022
3444470
Simplify event dispatch call
bmcclure Dec 17, 2022
ee45219
Change how CloneLayers works in LayeredDataBase so it only clones use…
bmcclure Dec 17, 2022
079fc79
Update GamePlatformBase to make a web service call to look up a game'…
bmcclure Dec 17, 2022
f0b0274
Update the error dialog and feedback window to send data via WebServi…
bmcclure Dec 17, 2022
35aefe2
Remove LauncherType and GameType handling from DetectedGameEditor
bmcclure Dec 17, 2022
75c3d7d
Subscribe to events to automatically make API requests on behalf of e…
bmcclure Dec 17, 2022
23c3865
Add a recurse option, defaulting to false, when calling DeleteEntity
bmcclure Dec 17, 2022
d63f348
Move SaveData and CreateSnapshot to below the recursive saving loop i…
bmcclure Dec 17, 2022
2399922
Remove duplicate event subscriber definitions from LaunchpadApiSubscr…
bmcclure Dec 17, 2022
af33820
Add an additional check to ensure that the referenced Platform exists…
bmcclure Dec 17, 2022
fd74dd6
Fix adapter definitions and organize parameters in LaunchpadApi.modul…
bmcclure Dec 17, 2022
8a0ff45
Add ReferencedEntities, ChildEntities, and ChildEntityData properties…
bmcclure Dec 17, 2022
2b74d94
Update handling of parent entity discover in EntityBase
bmcclure Dec 17, 2022
744038e
Add missing merger attribute
bmcclure Dec 17, 2022
4dd1034
Refactor entity loading slightly, and use a "loading" parameter to tr…
bmcclure Dec 17, 2022
04e7f67
Update recursive handling of snapshots in EntityBase
bmcclure Dec 17, 2022
b026b19
Update _getLayerSources in EntityBase to use parent entity storage wh…
bmcclure Dec 17, 2022
cb23292
Add UpdateDefaults method to EntityBase
bmcclure Dec 17, 2022
124c6cb
Fix event class name and event name references
bmcclure Dec 17, 2022
322f190
Add missing argument to event_subscriber.web_services
bmcclure Dec 17, 2022
a6bbd3e
Change dataType property to dataClass on adapters
bmcclure Dec 17, 2022
9e3a09e
Enhance WebServiceAdapterBase code
bmcclure Dec 17, 2022
e051208
Use web service calls in DetectedGameEditor and refactor a bit of the…
bmcclure Dec 17, 2022
6a27ffd
Add isWebServiceEntity to web service entities, and remove old adapte…
bmcclure Dec 17, 2022
1cef906
Add CacheResponses and DefaultResponseCacheExpiration fields to WebSe…
bmcclure Dec 17, 2022
bd64d5b
Rename new web service fields to ResponseCache and ResponseCacheDefau…
bmcclure Dec 17, 2022
9ca8909
Missing comma
bmcclure Dec 17, 2022
8b90b24
Fix parent entity assignment
bmcclure Dec 17, 2022
5f02482
Remove test code
bmcclure Dec 17, 2022
113b167
Change extra key in data storage from "extra" to "_extra"
bmcclure Dec 17, 2022
e8d9c08
Fix child entity data storage
bmcclure Dec 17, 2022
0e7c3d6
Fix web service ref discovery in the case of the wrong data type bein…
bmcclure Dec 17, 2022
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
3 changes: 2 additions & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
],
"options": {
"cwd": "${workspaceFolder}"
}
},
"problemMatcher": []
},
{
"label": "build-launchpad",
Expand Down
3 changes: 1 addition & 2 deletions Launchpad.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ appVersion := "{{VERSION}}"

Launchpad(Map(
"appName", "Launchpad",
"developer", "Volantis Development",
"version", appVersion,
"trayIcon", "Resources\Graphics\Launchpad.ico",
"trayIcon", "Resources\Graphics\launchpad.ico",
"console", true
))
41 changes: 19 additions & 22 deletions Launchpad.services.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
{
"parameters": {
"app.website_url": "https://launchpad.games",
"app.custom_tray_menu": true,
"app.developer": "Volantis Development",
"app.has_settings": true,
"app.settings_window": "SettingsWindow",
"app.show_about_menu_item": true,
"app.about_window": "AboutWindow",
"app.show_website_menu_item": true,
"backups_config": {},
"config.api_authentication": false,
"config.api_auto_login": false,
"config.api_endpoint": "",
"config.assets_dir": "@@{data_dir}\\Launcher Assets",
"config.auto_backup_config_files": true,
"config.backups_to_keep": 5,
Expand All @@ -12,7 +17,6 @@
"config.clean_launchers_on_build": false,
"config.clean_launchers_on_exit": true,
"config.create_desktop_shortcuts": true,
"config.data_source_key": "local",
"config.default_launcher_theme": "",
"config.destination_dir": "@@{data_dir}\\Launchers",
"config.launcher_double_click_action": "Edit",
Expand All @@ -22,7 +26,6 @@
"config.platforms_file": "@@{data_dir}\\Platforms.json",
"config.platforms_view_mode": "Report",
"config.tasks_view_mode": "Report",
"config.player_name": "",
"config.rebuild_existing_launchers": false,
"config.tasks_file": "@@{data_dir}\\Tasks.json",
"config.use_advanced_launcher_editor": false,
Expand All @@ -33,27 +36,29 @@
"storage_config_storage_parent_key": "Games",
"storage_config_path_parameter": "config.launcher_file",
"manager_view_mode_parameter": "config.launcher_view_mode",
"default_icon": "Game",
"default_icon": "game",
"allow_add": true,
"allow_edit": true,
"allow_delete": true,
"manager_gui": "MainWindow"
},
"entity_type.managed_game": {
"entity_type.game_process": {
"name_singular": "Managed Game",
"name_plural": "Managed Games",
"entity_class": "ManagedGameEntity",
"entity_class": "GameProcessEntity",
"storage_config_storage_parent_key": "Games",
"storage_config_path_parameter": "config.launcher_file",
"parent_entity_type": "launcher"
"parent_entity_type": "launcher",
"parent_entity_storage": true
},
"entity_type.managed_launcher": {
"entity_type.launcher_process": {
"name_singular": "Managed Launcher",
"name_plural": "Managed Launchers",
"entity_class": "ManagedLauncherEntity",
"entity_class": "LauncherProcessEntity",
"storage_config_storage_parent_key": "Games",
"storage_config_path_parameter": "config.launcher_file",
"parent_entity_type": "launcher"
"parent_entity_type": "launcher",
"parent_entity_storage": true
},
"entity_type.platform": {
"name_singular": "Platform",
Expand All @@ -65,8 +70,8 @@
"storage_config_storage_parent_key": "Platforms",
"storage_config_path_parameter": "config.platforms_file",
"manager_view_mode_parameter": "config.platforms_view_mode",
"default_icon": "Platform",
"manager_gui": "ManagePlatformsWindow",
"default_icon": "platform",
"manager_gui": "PlatformsWindow",
"manager_link_in_tools_menu": true
},
"entity_type.task": {
Expand Down Expand Up @@ -112,10 +117,6 @@
"class": "LaunchpadConfig",
"arguments": ["@config_storage.app_config", "@{}", "@@config_key"]
},
"data_source.local": {
"class": "LocalDataSource",
"arguments": ["@manager.cache", "local"]
},
"ini_migrator": {
"class": "LaunchpadIniMigrator",
"arguments": ["@{App}", "@manager.gui"]
Expand All @@ -132,10 +133,6 @@
"class": "BuilderManager",
"arguments": ["@entity_manager.launcher", "@{}", "@manager.event", "@notifier"]
},
"manager.data_source": {
"class": "DataSourceManager",
"arguments": ["@{}", "@manager.event", "@notifier", "@@config.data_source_key"]
},
"state.app": {
"class": "LaunchpadAppState",
"arguments": ["@{App}", "@@state_path"]
Expand Down
2 changes: 1 addition & 1 deletion LaunchpadOverlay/LaunchpadOverlay.rc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ END

// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_ICON1 ICON "E:\\Tools\\Launchpad\\Resources\\Graphics\\Launchpad.ico"
IDI_ICON1 ICON "E:\\Tools\\Launchpad\\Resources\\Graphics\\launchpad.ico"

#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion LaunchpadTest.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

appVersion := "1.0.0"

TraySetIcon("Resources\Graphics\Launchpad.ico")
TraySetIcon("Resources\Graphics\launchpad.ico")

HtmlResultViewer("Launchpad Test")
.ViewResults(SimpleTestRunner(FilesystemTestLoader().GetTests()).RunTests())
117 changes: 65 additions & 52 deletions Lib/Launchpad/App/Launchpad.ahk
Original file line number Diff line number Diff line change
@@ -1,38 +1,13 @@
class Launchpad extends AppBase {
customTrayMenu := true
detectGames := false
isSetup := false

CheckForUpdates(notify := true) {
updateAvailable := false

if (this.Version != "{{VERSION}}" && this.Service("manager.data_source").GetDefaultDataSource()) {
dataSource := this.Service("manager.data_source").GetDefaultDataSource()
releaseInfoStr := dataSource.ReadItem("release-info")

if (releaseInfoStr) {
data := JsonData()
releaseInfo := data.FromString(&releaseInfoStr)

if (releaseInfo && releaseInfo["data"].Has("version") && releaseInfo["data"]["version"] && this.Service("version_checker").VersionIsOutdated(releaseInfo["data"]["version"], this.Version)) {
updateAvailable := true
this.Service("manager.gui").Dialog(Map("type", "UpdateAvailableWindow"), releaseInfo)
}
}
}

if (!updateAvailable && notify) {
this.Service("notifier").Info("You're running the latest version of Launchpad. Shiny!")
}
}

UpdateIncludes() {
this.RunAhkScript(this.appDir . "\Scripts\UpdateIncludes.ahk")
this.RestartApp()
}

InitializeApp(config) {
eventMgr := this.Service("manager.event")
eventMgr := this["manager.event"]
eventMgr.Register(EntityEvents.ENTITY_CREATED, "LaunchpadEntityCreated", ObjBindMethod(this, "OnEntityCreated"))
eventMgr.Register(EntityEvents.ENTITY_UPDATED, "LaunchpadEntityUpdated", ObjBindMethod(this, "OnEntityUpdated"))
eventMgr.Register(EntityEvents.ENTITY_DELETED, "LaunchpadEntityDeleted", ObjBindMethod(this, "OnEntityDeleted"))
Expand Down Expand Up @@ -109,89 +84,127 @@

RunApp(config) {
this.MigrateConfiguration()

if (this.Config["api_auto_login"] && this.Services.Has("Auth")) {
this.Service("Auth").Login()
}

super.RunApp(config)

this.Service("entity_manager.platform").LoadComponents()
this.Service("entity_manager.launcher").LoadComponents()
this.Service("entity_manager.backup").LoadComponents()
this["entity_manager.platform"].LoadComponents()
this["entity_manager.launcher"].LoadComponents()
this["entity_manager.backup"].LoadComponents()

this.OpenApp()

if (this.detectGames) {
this.Service("entity_manager.platform").DetectGames()
this["entity_manager.platform"].DetectGames()
}
}

MigrateConfiguration() {
configFile := this.Parameter("previous_config_file")
configFile := this.Parameter["previous_config_file"]

if (configFile && FileExist(configFile)) {
response := this.Service("manager.gui").Dialog(Map(
response := this["manager.gui"].Dialog(Map(
"title", "Migrate settings?",
"text", this.appName . " uses a new configuration file format, and has detected that you have a previous configuration file.`n`nWould you like to automatically migrate your settings?`n`nChoose Yes to migrate your previous configuration. Choose no to simply delete it and start from scratch."
))

if (response == "Yes") {
this.Service("ini_migrator").Migrate(configFile, this.Config)
this["ini_migrator"].Migrate(configFile, this.Config)
} else {
FileDelete(configFile)
}
}
}

InitialSetup(config) {
result := this.Service("manager.gui").Dialog(Map("type", "SetupWindow"))
result := this["manager.gui"].Dialog(Map("type", "SetupWindow"))

if (result == "Exit") {
this.ExitApp()
} else if (result == "Detect") {
this.detectGames := true
}

this.isSetup := true
super.InitialSetup(config)
}

UpdateStatusIndicators() {
if (this.Service("manager.gui").Has("MainWindow")) {
this.Service("manager.gui")["MainWindow"].UpdateStatusIndicator()
if (this["manager.gui"].Has("MainWindow")) {
serviceMgr := this.container["entity_manager.web_service"]
webServices := serviceMgr.EntityQuery(EntityQuery.RESULT_TYPE_ENTITIES)
.Condition(IsTrueCondition(), "Enabled")
.Condition(IsTrueCondition(), "StatusIndicator")
.Execute()

windowObj := this["manager.gui"]["MainWindow"]

for serviceId, webService in webServices {
windowObj.UpdateStatusIndicator(webService)
}
}
}

ExitApp() {
if (this.isSetup && this.Config["clean_launchers_on_exit"]) {
this.Service("manager.builder").CleanLaunchers()
this["manager.builder"].CleanLaunchers()
}

if (this.isSetup && this.Config["flush_cache_on_exit"]) {
this.Service("manager.cache").FlushCaches(false, false)
this["manager.cache"].FlushCaches(false, false)
}

super.ExitApp()
}

OpenWebsite() {
Run("https://launchpad.games")
RestartApp() {
if (this.Services.Has("manager.gui")) {
guiMgr := this["manager.gui"]

if (guiMgr.Has("MainWindow")) {
guiMgr.StoreWindowState(this["manager.gui"]["MainWindow"])
}
}

super.RestartApp()
}

ProvideFeedback() {
this.Service("manager.gui").Dialog(Map("type", "FeedbackWindow"))
AddMainMenuEarlyItems(menuItems, showOpenItem := false) {
menuItems := super.AddMainMenuEarlyItems(menuItems, showOpenItem)

launchersItems := []
launchersItems.Push(Map("label", "&Clean Launchers", "name", "CleanLaunchers"))
launchersItems.Push(Map("label", "&Reload Launchers", "name", "ReloadLaunchers"))

menuItems.Push(Map("label", "&Launchers", "name", "LaunchersMenu", "childItems", launchersItems))

return menuItems
}

RestartApp() {
if (this.Services.Has("manager.gui")) {
guiMgr := this.Service("manager.gui")
HandleMainMenuClick(result) {
if (result == "CleanLaunchers") {
this["manager.builder"].CleanLaunchers()
} else if (result == "ReloadLaunchers") {
this["entity_manager.launcher"].LoadComponents(true)
guiMgr := this["manager.gui"]

if (guiMgr.Has("MainWindow")) {
guiMgr.StoreWindowState(this.Service("manager.gui")["MainWindow"])
guiMgr["MainWindow"].UpdateListView()
}
} else if (result == "ManageModules") {
this["manager.gui"].OpenWindow("ManageModulesWindow")
} else if (result == "FlushCache") {
this["manager.cache"].FlushCaches(true, true)
} else {
super.HandleMainMenuClick(result)
}

super.RestartApp()
return result
}

GetToolsMenuItems() {
toolsItems := super.GetToolsMenuItems()
toolsItems.Push(Map("label", "&Modules", "name", "ManageModules"))
toolsItems.Push(Map("label", "&Flush Cache", "name", "FlushCache"))

return toolsItems
}
}
2 changes: 1 addition & 1 deletion Lib/Launchpad/Builder/BuildFile/CopyableBuildFile.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class CopyableBuildFile extends BuildFileBase {
filePath := FileSelect(1,, this.launcherEntityObj.Id . ": " . this.RequestMessage, this.SelectFilter)

if (filePath == "") {
this.app.Service("notifier").Warning("No file selected. Skipping build file.")
this.app["notifier"].Warning("No file selected. Skipping build file.")
}

return filePath
Expand Down
6 changes: 3 additions & 3 deletions Lib/Launchpad/Builder/BuildFile/GameAhkFile.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ class GameAhkFile extends ComposableBuildFile {
"launcherName", this.launcherEntityObj.Id . " - Launchpad",
"appVersion", appVersion,
"appDir", this.appDir,
"gameConfig", this.launcherEntityObj["ManagedGame"].FieldData,
"gameConfig", this.launcherEntityObj["GameProcess"].FieldData,
"launchpadLauncherConfig", this.launcherEntityObj.FieldData,
"launcherConfig", this.launcherEntityObj["ManagedLauncher"].FieldData,
"launcherConfig", this.launcherEntityObj["LauncherProcess"].FieldData,
"launcherId", this.launcherEntityObj.Id,
"themesDir", this.launcherEntityObj["ThemesDir"],
"resourcesDir", this.launcherEntityObj["ResourcesDir"],
Expand All @@ -35,7 +35,7 @@ class GameAhkFile extends ComposableBuildFile {
GetPlatforms() {
platforms := Map()

for key, platform in this.app.Service("entity_manager.platform").GetActivePlatforms(EntityQuery.RESULT_TYPE_ENTITIES) {
for key, platform in this.app["entity_manager.platform"].GetActivePlatforms(EntityQuery.RESULT_TYPE_ENTITIES) {
platforms[key] := platform.FieldData
}

Expand Down
4 changes: 2 additions & 2 deletions Lib/Launchpad/Builder/BuildFile/IconFile.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ class IconFile extends CopyableBuildFile {
}

if (iconsCount == 0) {
this.app.Service("notifier").Warning("No icons could be extracted from %exeFile%. Please try another file.")
this.app["notifier"].Warning("No icons could be extracted from %exeFile%. Please try another file.")
iconFilePath := ""
this.Cleanup()
} else {
if (iconsCount > 1) {
iconFilePath := FileSelect(, iconsDir, "Select the correct icon from the extracted files", "Icons (*.ico)")

if (iconFilePath == "") {
this.app.Service("notifier").Warning("Canceled icon selection. Please try again.")
this.app["notifier"].Warning("Canceled icon selection. Please try again.")
this.Cleanup()
}
}
Expand Down
Loading