Drag[en]gine Script Module DragonScript
1.23
|
Interface for services supporting managing game modifications. More...
Classes | |
enum | ManagementEvent |
Public Member Functions | |
void | activateMods () |
Activate subscribed and installed modifications. More... | |
void | addModsListener (ServiceModsListener listener) |
Add modification listener. More... | |
Dictionary | getActiveMods () |
Active mods. More... | |
ServiceModProgress | getCurrentModUpdate () |
Current mod install or update progress information. More... | |
void | getModInfo (String id, ServiceModsListener listener) |
Retrieve information about game modification. More... | |
ServiceModsFeatures | getModsFeatures () |
Features supported by this service. More... | |
void | getModTags (ServiceModsListener listener) |
Tags that can be used for ServiceModFilter. More... | |
bool | getPauseModManagement () |
Mod management is paused. More... | |
void | getPurchasedMods (ServiceModsListener listener) |
Purchased mods. More... | |
Dictionary | getSubscribedMods () |
User subscribed mods. More... | |
Dictionary | getSystemMods () |
System mods. More... | |
bool | isModManagementBusy () |
Service is busy managing modifications. More... | |
void | listAllMods (ServiceModFilter filter, ServiceModsListener listener) |
Filtered list of available game modifications. More... | |
void | loadModResource (String url, ServiceModsListener listener) |
Load resource asynchronously. More... | |
bool | modHasMatchingFiles (String id, String directory, bool recursive, Set patterns) |
Modification has files matching one or more patterns. More... | |
void | purchaseMod (String id, String price, ServiceModsListener listener) |
Purchase mod. More... | |
void | removeModsListener (ServiceModsListener listener) |
Remove modification listener. More... | |
void | reportMod (String id, ServiceModReport report, ServiceModsListener listener) |
Report modification. More... | |
void | revokeModRating (String id, ServiceModsListener listener) |
Revoke rating for modification. More... | |
void | setModDisabled (String id, bool disabled, ServiceModsListener listener) |
Disable modification. More... | |
void | setPauseModManagement (bool pause) |
Pause mod management. More... | |
void | submitModRating (String id, int rating, ServiceModsListener listener) |
Submit rating for modification. More... | |
void | subscribeMod (String id, ServiceModsListener listener) |
Subscribe to modification. More... | |
void | unsubscribeMod (String id, ServiceModsListener listener) |
Unsubscribe from modification. More... | |
Interface for services supporting managing game modifications.
This interface is designed for services using a remote host to store modifications and user profiles with the installed and active mods. For this reason the majority of calls are asynchronous. This does not prevent local host only services to use this interface.
void Dragengine.Services.Mods.ServiceMods.activateMods | ( | ) |
Activate subscribed and installed modifications.
Installing modifications does not automatically activate them. This avoids interrupting a running game flow while modifications are beeing installed. A typical use case is calling activateMods() upon leaving the modification management dialog. This ensures modifications start affecting the game at a well known point in time.
Unsubscribing from a modification calls activateMods() to avoid the game potentially accessing to be deleted modification files.
Disabling and re-enabling modifications does not trigger activateMods().
Activating modifications runs immediately.
Starting a game automatically calls activateMods().
Implemented in Dragengine.Services.ServiceModio.
void Dragengine.Services.Mods.ServiceMods.addModsListener | ( | ServiceModsListener | listener | ) |
Add modification listener.
listener | Listener to add |
Implemented in Dragengine.Services.ServiceModio.
Dictionary Dragengine.Services.Mods.ServiceMods.getActiveMods | ( | ) |
Active mods.
Returns all active modifications (subscribed and enabled). Active modifications are changed when activateMods() is called. This call is useful to know if a game save state has been created with the same set of active modifications. Returns dictionary with String modification identifier and ServiceModStatus value.
Implemented in Dragengine.Services.ServiceModio.
ServiceModProgress Dragengine.Services.Mods.ServiceMods.getCurrentModUpdate | ( | ) |
Current mod install or update progress information.
If no suitable mod management action is in progress null is returned.
Implemented in Dragengine.Services.ServiceModio.
void Dragengine.Services.Mods.ServiceMods.getModInfo | ( | String | id, |
ServiceModsListener | listener | ||
) |
Retrieve information about game modification.
Once finished ServiceModsListener.onGetModInfo() is called.
id | Identifier of modification to retrieve. |
listener | If not null called once in addition to added listeners. |
Implemented in Dragengine.Services.ServiceModio.
ServiceModsFeatures Dragengine.Services.Mods.ServiceMods.getModsFeatures | ( | ) |
Features supported by this service.
Implemented in Dragengine.Services.ServiceModio.
void Dragengine.Services.Mods.ServiceMods.getModTags | ( | ServiceModsListener | listener | ) |
Tags that can be used for ServiceModFilter.
Once finished ServiceModsListener.onGetTags() is called with the list of ServiceModTagCategory. Each category contains a list of tags usable for this category.
listener | If not null called once in addition to added listeners. |
bool Dragengine.Services.Mods.ServiceMods.getPauseModManagement | ( | ) |
Mod management is paused.
Implemented in Dragengine.Services.ServiceModio.
void Dragengine.Services.Mods.ServiceMods.getPurchasedMods | ( | ServiceModsListener | listener | ) |
Purchased mods.
Once finished ServiceModsListener.onGetPurchasedMods() is called with array of ServiceModInfo value.
listener | If not null called once in addition to added listeners. |
Dictionary Dragengine.Services.Mods.ServiceMods.getSubscribedMods | ( | ) |
User subscribed mods.
Returns modifications are potentially not installed. Use ServiceModStatus.status to filter modifications of interest. Returns dictionary with String modification identifier and ServiceModStatus value.
Implemented in Dragengine.Services.ServiceModio.
Dictionary Dragengine.Services.Mods.ServiceMods.getSystemMods | ( | ) |
System mods.
Returns all modifications installed on the system by all users. Returns dictionary with String modification identifier and ServiceModStatus value.
Implemented in Dragengine.Services.ServiceModio.
bool Dragengine.Services.Mods.ServiceMods.isModManagementBusy | ( | ) |
Service is busy managing modifications.
Typical actions causing true to be returned are (non conclusive list):
While this method returns true certain functions will fail.
Implemented in Dragengine.Services.ServiceModio.
void Dragengine.Services.Mods.ServiceMods.listAllMods | ( | ServiceModFilter | filter, |
ServiceModsListener | listener | ||
) |
Filtered list of available game modifications.
Requests a list of game modifications using the provided filters. All filter parameters set to null cause default values to be used as defined by the service provider. Filters not supported by the service provider are ignored.
Once finished ServiceModsListener.onListMods() is called.
Receiving the results can take considerable amount of time depending on the load of the service provider.
filter | Filter to use. |
listener | If not null called once in addition to added listeners. |
Implemented in Dragengine.Services.ServiceModio.
void Dragengine.Services.Mods.ServiceMods.loadModResource | ( | String | url, |
ServiceModsListener | listener | ||
) |
Load resource asynchronously.
Loaded resources are cached for faster retrieval. Once the resource is cached locally ServiceModsListener.onLoadModResource() is called with the same URL as used in this function call.
url | URL of image to load. |
listener | If not null called once in addition to added listeners. |
Implemented in Dragengine.Services.ServiceModio.
bool Dragengine.Services.Mods.ServiceMods.modHasMatchingFiles | ( | String | id, |
String | directory, | ||
bool | recursive, | ||
Set | patterns | ||
) |
Modification has files matching one or more patterns.
Typically used to determine if an installed modification contains specific files. For example if a modification contains script code Engine.restart(String) has to be called to restart the game to re-parse the script. Another example is reloading cached game data if files are touched that have been cached before.
id | Identifier of installed and enabled modification to scan for files. |
directory | Root directory to start searching in. |
recursive | Recursively scan directories for matching files. |
patterns | Set of String file patterns without directories. |
EInvalidAction | Modification does not exist or is not installed. |
void Dragengine.Services.Mods.ServiceMods.purchaseMod | ( | String | id, |
String | price, | ||
ServiceModsListener | listener | ||
) |
Purchase mod.
Once finished ServiceModsListener.onPurchaseMod() is called.
id | Identifier of modification to purchase. |
price | Price shown to the user. Used to verify the price matches. |
listener | If not null called once in addition to added listeners. |
Implemented in Dragengine.Services.ServiceModio.
void Dragengine.Services.Mods.ServiceMods.removeModsListener | ( | ServiceModsListener | listener | ) |
Remove modification listener.
listener | Listener to remove. |
Implemented in Dragengine.Services.ServiceModio.
void Dragengine.Services.Mods.ServiceMods.reportMod | ( | String | id, |
ServiceModReport | report, | ||
ServiceModsListener | listener | ||
) |
Report modification.
Once finished ServiceModsListener.onReportMod() is called. Can be used if ServiceModsFeatures.canReportMods is true.
id | Identifier of modification to report. |
report | Report to submit. |
listener | If not null called once in addition to added listeners. |
Implemented in Dragengine.Services.ServiceModio.
void Dragengine.Services.Mods.ServiceMods.revokeModRating | ( | String | id, |
ServiceModsListener | listener | ||
) |
Revoke rating for modification.
Once finished ServiceModsListener.onRevokeModRating() is called. Can be used if ServiceModsFeatures.canRateMods is true.
id | Identifier of modification to revoke rating for. |
listener | If not null called once in addition to added listeners. |
Implemented in Dragengine.Services.ServiceModio.
void Dragengine.Services.Mods.ServiceMods.setModDisabled | ( | String | id, |
bool | disabled, | ||
ServiceModsListener | listener | ||
) |
Disable modification.
Modifications can be disabled by the user or the game if a modification is missbehaving or preventing the game from running. To get the disabled state of a modification use getSubscribedMods().
If modification is not found nothing is done.
id | Identifier of modification to revoke rating for. |
disabled | Disabled state. |
listener | If not null called once in addition to added listeners. |
Implemented in Dragengine.Services.ServiceModio.
void Dragengine.Services.Mods.ServiceMods.setPauseModManagement | ( | bool | pause | ) |
Pause mod management.
By default the service automatically downloads, installs and uninstalls mods. This process can be temporarily paused for example during game play.
Implemented in Dragengine.Services.ServiceModio.
void Dragengine.Services.Mods.ServiceMods.submitModRating | ( | String | id, |
int | rating, | ||
ServiceModsListener | listener | ||
) |
Submit rating for modification.
Once finished ServiceModsListener.onSubmitModRating() is called. Can be used if ServiceModsFeatures.canRateMods is true.
id | Identifier of modification to submit rating for. |
rating | Rating to submit. |
listener | If not null called once in addition to added listeners. |
Implemented in Dragengine.Services.ServiceModio.
void Dragengine.Services.Mods.ServiceMods.subscribeMod | ( | String | id, |
ServiceModsListener | listener | ||
) |
Subscribe to modification.
The user can also subscribe to a modification from outside the game using different means. In both situationsn modifications are installed automatically the next time possible if at least one user is subscribed to them. Hence subscribing and installing are different actions.
Once subscribing finished ServiceModsListener.onSubscribeMod() is called. At this point in time the modification is potentially not yet installed. Mod management installs mods as soon as possible if necessary. Listen to ServiceModsListener.onModManagement() events to know when the modification started and finished installing.
token | Authentication token. |
id | Identifier of modification to subscribe to. |
listener | If not null called once in addition to added listeners. |
Implemented in Dragengine.Services.ServiceModio.
void Dragengine.Services.Mods.ServiceMods.unsubscribeMod | ( | String | id, |
ServiceModsListener | listener | ||
) |
Unsubscribe from modification.
The user can also unsubscribe from a modification from outside the game using different means. In both situationsn modifications are uninstalled automatically the next time possible if no user is subscribed to them. Hence unsubscribing and uninstalling are different actions.
Once unsubscribing finished ServiceModsListener.onUnsubscribeMod() is called. At this point in time the modification is still installed. Mod management uninstalls mods as soon as possible if necessary. Listen to ServiceModsListener.onModManagement() events to know when the modification started and finished uninstalling.
token | Authentication token. |
id | Identifier of modification to unsubscribe from. |
listener | If not null called once in addition to added listeners. |
Implemented in Dragengine.Services.ServiceModio.