Arma Reforger Script API
|
Public Member Functions | |
array< ref SCR_WorkshopItem > | GetAllAddons () |
Returns array with all addons currently in the system - online and offline. | |
array< ref SCR_WorkshopItem > | GetOfflineAddons () |
Returns array with all offline addons. | |
SCR_WorkshopItem | Register (WorkshopItem item) |
Returns a SCR_WorkshopItem. If it's not registered, creates a new one and registers it. | |
SCR_WorkshopItem | Register (Dependency item) |
Returns a SCR_WorkshopItem. If it's not registered, creates a new one and registers it. | |
bool | GetReady () |
When true, we can fully use Workshop. | |
bool | GetAddonsChecked () |
True when all async checks are done. Doesn't indicate that all checks were successful! | |
bool | GetUgcPrivilege () |
Returns immediate value of UserPrivilege.USER_GEN_CONTENT. | |
int | GetCountAddonsOutdated () |
Returns count of outdated addons. | |
void | NegotiateUgcPrivilegeAsync () |
Check user's workshop privilege (related to xbox profile) As a result on X-Box a system dialog will open and ask for confirmation. | |
ScriptInvoker | GetEventOnAddonEnabled () |
ScriptInvoker | GetEventOnAllAddonsEnabled () |
void | EnableMultipleAddons (array< ref SCR_WorkshopItem > items, bool enable) |
Enable/disable multiple mods recursively to save performance. | |
override void | EOnInit (IEntity owner) |
override void | EOnFrame (IEntity owner, float timeSlice) |
void | Internal_OnNewDownload (SCR_WorkshopItem item, SCR_WorkshopItemActionDownload action) |
Called by SCR_WorkshopItem when it starts a new download. | |
SCR_WorkshopAddonManagerPresetStorage | GetPresetStorage () |
SCR_WorkshopItem | GetItem (string id) |
void | SelectPreset (SCR_WorkshopAddonPreset preset, notnull array< ref SCR_WorkshopAddonPresetAddonMeta > addonsNotFound) |
SCR_WorkshopAddonPreset | CreatePresetFromEnabledAddons (string presetName) |
int | CountOfEnabledAddons () |
Return int count of all enabled mods. | |
map< string, ref SCR_WorkshopItem > | GetItemsMap () |
void | _print (string str, LogLevel logLevel=LogLevel.DEBUG) |
Static Public Member Functions | |
static SCR_AddonManager | GetInstance () |
static bool | GetAddonEnabledExternally (SCR_WorkshopItem item) |
Returns true if addon was enabled through external configuration (CLI or other). | |
static array< ref SCR_WorkshopItem > | SelectItemsBasic (array< ref SCR_WorkshopItem > items, EWorkshopItemQuery query) |
Selects items which match query. | |
static int | CountItemsBasic (array< ref SCR_WorkshopItem > items, EWorkshopItemQuery query, bool returnOnFirstMatch=false) |
Counts items which match query. | |
static array< ref SCR_WorkshopItem > | SelectItemsAnd (array< ref SCR_WorkshopItem > items, EWorkshopItemQuery query) |
Selects items which match query. | |
static int | CountItemsAnd (array< ref SCR_WorkshopItem > items, EWorkshopItemQuery query, bool returnOnFirstMatch=false) |
Counts items which match query. All flags must match. | |
static array< ref SCR_WorkshopItem > | SelectItemsOr (array< ref SCR_WorkshopItem > items, EWorkshopItemQuery query) |
Selects items which match query. | |
static int | CountItemsOr (array< ref SCR_WorkshopItem > items, EWorkshopItemQuery query, bool returnOnFirstMatch=false) |
Counts items which match query.Any flag must match. | |
static SCR_ComparerOperator | DifferenceBetweenVersions (string vFrom, string vTo) |
Return difference type between current version from current to target. | |
static SCR_ERevisionAvailability | ItemAvailability (notnull WorkshopItem item) |
Compare availability state for item current revision Returns state base on if current and latest revision is avaiable in workshop. | |
Public Attributes | |
ref ScriptInvoker | m_OnAddonsChecked = new ScriptInvoker |
ref ScriptInvoker | m_OnAddonOfflineStateChanged = new ScriptInvoker |
ref ScriptInvoker | m_OnAddonReportedStateChanged = new ScriptInvoker |
ref ScriptInvoker | m_OnUgcPrivilegeResult = new ScriptInvoker |
ref ScriptInvoker | m_OnAddonsEnabledChanged = new ScriptInvoker |
ref ScriptInvoker | m_OnNewDownload = new ScriptInvoker |
Static Public Attributes | |
static const string | ADDONS_CLI = "addons" |
static const string | VERSION_DOT = "." |
Protected Member Functions | |
void | InvokeEventOnAddonEnabled (SCR_WorkshopItem arg0, int arg1) |
void | InvokeEventOnAllAddonsEnabled () |
void | EnableAddonsRecursively (array< ref SCR_WorkshopItem > addons, out int remaining, bool enable) |
void | Internal_CheckAddons () |
When internet is disabled, might take a lot of time to complete the request. | |
void | RegisterNewItem (string id, SCR_WorkshopItem itemWrapper) |
string | GetItemId (WorkshopItem item) |
string | GetItemId (Dependency item) |
void | FinalizeInitAfterAsyncChecks () |
Finishes init after all async checks are done. | |
void | AddonCheckResponse (SCR_BackendCallback callback) |
void | Callback_CheckAddons_OnSuccess () |
void | Callback_GetPrivilege_OnPrivilegeResult (UserPrivilege privilege, UserPrivilegeResult result) |
void | Callback_OnAddonOfflineStateChanged (SCR_WorkshopItem item, bool newState) |
Called from the specific SCR_WorkshopItem. | |
void | Callback_OnAddonReportStateChanged (SCR_WorkshopItem item, bool newReport) |
Called from the specific SCR_WorkshopItem. | |
void | CountOutdatedAddons () |
Go throught all offline addons and count size. | |
void | OnOfflineAddonsDisabled () |
void | OnAllAddonsEnabledCorrupted () |
Call this when all dialog are enabled, but some are missing to show which one. | |
Static Protected Member Functions | |
static bool | GetAddonsEnabledExternally () |
Returns true when external addon configuration is used (through CLI or other means) | |
static bool | CheckQueryFlag (SCR_WorkshopItem item, EWorkshopItemQuery flag) |
static bool | CheckQueryFlagsAnd (SCR_WorkshopItem item, EWorkshopItemQuery flags) |
Checks if all flags are satisfied. | |
static bool | CheckQueryFlagsOr (SCR_WorkshopItem item, EWorkshopItemQuery flags) |
Checks if any flag is satisfied. | |
Protected Attributes | |
ref array< WorkshopItem > | m_aAddonsToRegister = {} |
ref map< string, ref SCR_WorkshopItem > | m_mItems = new map<string, ref SCR_WorkshopItem>() |
ref SCR_WorkshopAddonManagerPresetStorage | m_Storage |
int | m_iAddonsOutdated |
float | m_fAddonsOutdatedTimer = 0 |
float | m_fAddonsEnabledTimer = 0 |
string | m_sAddonsEnabledPrev |
bool | m_bAddonsChecked = false |
ref SCR_WorkshopCallbackBase | m_CallbackCheckAddons |
ref SCR_ScriptPlatformRequestCallback | m_CallbackGetPrivilege |
bool | m_bInitFinished = false |
ref SCR_BackendCallback | m_AddonCheckCallback = new SCR_BackendCallback() |
SCR_LoadingOverlay | m_LoadingOverlay |
ref ScriptInvoker< SCR_WorkshopItem, int > | Event_OnAddonEnabled |
ref ScriptInvoker | Event_OnAllAddonsEnabled |
SCR_WorkshopAddonPreset | m_SelectedPreset |
ref array< ref SCR_WorkshopAddonPresetAddonMeta > | m_aAddonsNotFound = {} |
Static Protected Attributes | |
const static float | ADDONS_ENABLED_UPDATE_INTERVAL_S = 1/30 |
const static float | ADDONS_OUTDATED_UPDATE_INTERVAL_S = 1.0 |
static SCR_AddonManager | s_Instance |
void SCR_AddonManager._print | ( | string | str, |
LogLevel | logLevel = LogLevel::DEBUG |
||
) |
|
protected |
|
protected |
|
protected |
|
protected |
Called from the specific SCR_WorkshopItem.
|
protected |
Called from the specific SCR_WorkshopItem.
|
staticprotected |
|
staticprotected |
Checks if all flags are satisfied.
|
staticprotected |
Checks if any flag is satisfied.
|
static |
Counts items which match query. All flags must match.
|
static |
Counts items which match query.
Only one flag is tested! EWorkshopItemQuery.OFFLINE - will count items which are offline AND enabled.
|
static |
Counts items which match query.Any flag must match.
int SCR_AddonManager.CountOfEnabledAddons | ( | ) |
Return int count of all enabled mods.
|
protected |
Go throught all offline addons and count size.
SCR_WorkshopAddonPreset SCR_AddonManager.CreatePresetFromEnabledAddons | ( | string | presetName | ) |
|
static |
Return difference type between current version from current to target.
|
protected |
void SCR_AddonManager.EnableMultipleAddons | ( | array< ref SCR_WorkshopItem > | items, |
bool | enable | ||
) |
Enable/disable multiple mods recursively to save performance.
override void SCR_AddonManager.EOnFrame | ( | IEntity | owner, |
float | timeSlice | ||
) |
override void SCR_AddonManager.EOnInit | ( | IEntity | owner | ) |
|
protected |
Finishes init after all async checks are done.
|
static |
Returns true if addon was enabled through external configuration (CLI or other).
bool SCR_AddonManager.GetAddonsChecked | ( | ) |
True when all async checks are done. Doesn't indicate that all checks were successful!
|
staticprotected |
Returns true when external addon configuration is used (through CLI or other means)
array< ref SCR_WorkshopItem > SCR_AddonManager.GetAllAddons | ( | ) |
Returns array with all addons currently in the system - online and offline.
int SCR_AddonManager.GetCountAddonsOutdated | ( | ) |
Returns count of outdated addons.
ScriptInvoker SCR_AddonManager.GetEventOnAddonEnabled | ( | ) |
ScriptInvoker SCR_AddonManager.GetEventOnAllAddonsEnabled | ( | ) |
|
static |
SCR_WorkshopItem SCR_AddonManager.GetItem | ( | string | id | ) |
|
protected |
|
protected |
map< string, ref SCR_WorkshopItem > SCR_AddonManager.GetItemsMap | ( | ) |
array< ref SCR_WorkshopItem > SCR_AddonManager.GetOfflineAddons | ( | ) |
Returns array with all offline addons.
SCR_WorkshopAddonManagerPresetStorage SCR_AddonManager.GetPresetStorage | ( | ) |
bool SCR_AddonManager.GetReady | ( | ) |
When true, we can fully use Workshop.
All async checks are finished successfully. CheckAddons is not reliable and might never finish, so be careful with this.
bool SCR_AddonManager.GetUgcPrivilege | ( | ) |
Returns immediate value of UserPrivilege.USER_GEN_CONTENT.
|
protected |
When internet is disabled, might take a lot of time to complete the request.
void SCR_AddonManager.Internal_OnNewDownload | ( | SCR_WorkshopItem | item, |
SCR_WorkshopItemActionDownload | action | ||
) |
Called by SCR_WorkshopItem when it starts a new download.
|
protected |
|
protected |
|
static |
Compare availability state for item current revision Returns state base on if current and latest revision is avaiable in workshop.
void SCR_AddonManager.NegotiateUgcPrivilegeAsync | ( | ) |
Check user's workshop privilege (related to xbox profile) As a result on X-Box a system dialog will open and ask for confirmation.
Subscribe to m_OnUgcPrivilegeResult to get the result.
|
protected |
Call this when all dialog are enabled, but some are missing to show which one.
|
protected |
SCR_WorkshopItem SCR_AddonManager.Register | ( | Dependency | item | ) |
Returns a SCR_WorkshopItem. If it's not registered, creates a new one and registers it.
SCR_WorkshopItem SCR_AddonManager.Register | ( | WorkshopItem | item | ) |
Returns a SCR_WorkshopItem. If it's not registered, creates a new one and registers it.
|
protected |
|
static |
Selects items which match query.
All flags must match. EWorkshopItemQuery.OFFLINE | EWorkshopItemQuery.ENABLED - will return items which are offline AND enabled.
|
static |
Selects items which match query.
Only one flag is tested! EWorkshopItemQuery.OFFLINE - will return items which are offline AND enabled.
|
static |
Selects items which match query.
Any flag must match. EWorkshopItemQuery.OFFLINE | EWorkshopItemQuery.ENABLED - will return items which are offline OR enabled.
void SCR_AddonManager.SelectPreset | ( | SCR_WorkshopAddonPreset | preset, |
notnull array< ref SCR_WorkshopAddonPresetAddonMeta > | addonsNotFound | ||
) |
|
static |
|
staticprotected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
ref ScriptInvoker SCR_AddonManager.m_OnAddonOfflineStateChanged = new ScriptInvoker |
ref ScriptInvoker SCR_AddonManager.m_OnAddonReportedStateChanged = new ScriptInvoker |
ref ScriptInvoker SCR_AddonManager.m_OnAddonsChecked = new ScriptInvoker |
ref ScriptInvoker SCR_AddonManager.m_OnAddonsEnabledChanged = new ScriptInvoker |
ref ScriptInvoker SCR_AddonManager.m_OnNewDownload = new ScriptInvoker |
ref ScriptInvoker SCR_AddonManager.m_OnUgcPrivilegeResult = new ScriptInvoker |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
static |