Arma Reforger Script API
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
SCR_AddonManager Interface Reference
Inheritance diagram for SCR_AddonManager:
[legend]

Public Member Functions

array< ref SCR_WorkshopItemGetAllAddons ()
 Returns array with all addons currently in the system - online and offline.
 
array< ref SCR_WorkshopItemGetOfflineAddons ()
 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_WorkshopItemGetItemsMap ()
 
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_WorkshopItemSelectItemsBasic (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_WorkshopItemSelectItemsAnd (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_WorkshopItemSelectItemsOr (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_WorkshopItemm_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_WorkshopAddonPresetAddonMetam_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
 

Member Function Documentation

◆ _print()

void SCR_AddonManager._print ( string  str,
LogLevel  logLevel = LogLevel::DEBUG 
)

◆ AddonCheckResponse()

void SCR_AddonManager.AddonCheckResponse ( SCR_BackendCallback  callback)
protected

◆ Callback_CheckAddons_OnSuccess()

void SCR_AddonManager.Callback_CheckAddons_OnSuccess ( )
protected

◆ Callback_GetPrivilege_OnPrivilegeResult()

void SCR_AddonManager.Callback_GetPrivilege_OnPrivilegeResult ( UserPrivilege  privilege,
UserPrivilegeResult  result 
)
protected

◆ Callback_OnAddonOfflineStateChanged()

void SCR_AddonManager.Callback_OnAddonOfflineStateChanged ( SCR_WorkshopItem  item,
bool  newState 
)
protected

Called from the specific SCR_WorkshopItem.

◆ Callback_OnAddonReportStateChanged()

void SCR_AddonManager.Callback_OnAddonReportStateChanged ( SCR_WorkshopItem  item,
bool  newReport 
)
protected

Called from the specific SCR_WorkshopItem.

◆ CheckQueryFlag()

static bool SCR_AddonManager.CheckQueryFlag ( SCR_WorkshopItem  item,
EWorkshopItemQuery  flag 
)
staticprotected

◆ CheckQueryFlagsAnd()

static bool SCR_AddonManager.CheckQueryFlagsAnd ( SCR_WorkshopItem  item,
EWorkshopItemQuery  flags 
)
staticprotected

Checks if all flags are satisfied.

◆ CheckQueryFlagsOr()

static bool SCR_AddonManager.CheckQueryFlagsOr ( SCR_WorkshopItem  item,
EWorkshopItemQuery  flags 
)
staticprotected

Checks if any flag is satisfied.

◆ CountItemsAnd()

static int SCR_AddonManager.CountItemsAnd ( array< ref SCR_WorkshopItem items,
EWorkshopItemQuery  query,
bool  returnOnFirstMatch = false 
)
static

Counts items which match query. All flags must match.

◆ CountItemsBasic()

static int SCR_AddonManager.CountItemsBasic ( array< ref SCR_WorkshopItem items,
EWorkshopItemQuery  query,
bool  returnOnFirstMatch = false 
)
static

Counts items which match query.

Only one flag is tested! EWorkshopItemQuery.OFFLINE - will count items which are offline AND enabled.

◆ CountItemsOr()

static int SCR_AddonManager.CountItemsOr ( array< ref SCR_WorkshopItem items,
EWorkshopItemQuery  query,
bool  returnOnFirstMatch = false 
)
static

Counts items which match query.Any flag must match.

◆ CountOfEnabledAddons()

int SCR_AddonManager.CountOfEnabledAddons ( )

Return int count of all enabled mods.

◆ CountOutdatedAddons()

void SCR_AddonManager.CountOutdatedAddons ( )
protected

Go throught all offline addons and count size.

◆ CreatePresetFromEnabledAddons()

SCR_WorkshopAddonPreset SCR_AddonManager.CreatePresetFromEnabledAddons ( string  presetName)

◆ DifferenceBetweenVersions()

static SCR_ComparerOperator SCR_AddonManager.DifferenceBetweenVersions ( string  vFrom,
string  vTo 
)
static

Return difference type between current version from current to target.

◆ EnableAddonsRecursively()

void SCR_AddonManager.EnableAddonsRecursively ( array< ref SCR_WorkshopItem addons,
out int  remaining,
bool  enable 
)
protected

◆ EnableMultipleAddons()

void SCR_AddonManager.EnableMultipleAddons ( array< ref SCR_WorkshopItem items,
bool  enable 
)

Enable/disable multiple mods recursively to save performance.

◆ EOnFrame()

override void SCR_AddonManager.EOnFrame ( IEntity  owner,
float  timeSlice 
)

◆ EOnInit()

override void SCR_AddonManager.EOnInit ( IEntity  owner)

◆ FinalizeInitAfterAsyncChecks()

void SCR_AddonManager.FinalizeInitAfterAsyncChecks ( )
protected

Finishes init after all async checks are done.

◆ GetAddonEnabledExternally()

static bool SCR_AddonManager.GetAddonEnabledExternally ( SCR_WorkshopItem  item)
static

Returns true if addon was enabled through external configuration (CLI or other).

◆ GetAddonsChecked()

bool SCR_AddonManager.GetAddonsChecked ( )

True when all async checks are done. Doesn't indicate that all checks were successful!

◆ GetAddonsEnabledExternally()

static bool SCR_AddonManager.GetAddonsEnabledExternally ( )
staticprotected

Returns true when external addon configuration is used (through CLI or other means)

◆ GetAllAddons()

array< ref SCR_WorkshopItem > SCR_AddonManager.GetAllAddons ( )

Returns array with all addons currently in the system - online and offline.

◆ GetCountAddonsOutdated()

int SCR_AddonManager.GetCountAddonsOutdated ( )

Returns count of outdated addons.

◆ GetEventOnAddonEnabled()

ScriptInvoker SCR_AddonManager.GetEventOnAddonEnabled ( )

◆ GetEventOnAllAddonsEnabled()

ScriptInvoker SCR_AddonManager.GetEventOnAllAddonsEnabled ( )

◆ GetInstance()

static SCR_AddonManager SCR_AddonManager.GetInstance ( )
static

◆ GetItem()

SCR_WorkshopItem SCR_AddonManager.GetItem ( string  id)

◆ GetItemId() [1/2]

string SCR_AddonManager.GetItemId ( Dependency  item)
protected

◆ GetItemId() [2/2]

string SCR_AddonManager.GetItemId ( WorkshopItem  item)
protected

◆ GetItemsMap()

map< string, ref SCR_WorkshopItem > SCR_AddonManager.GetItemsMap ( )

◆ GetOfflineAddons()

array< ref SCR_WorkshopItem > SCR_AddonManager.GetOfflineAddons ( )

Returns array with all offline addons.

◆ GetPresetStorage()

SCR_WorkshopAddonManagerPresetStorage SCR_AddonManager.GetPresetStorage ( )

◆ GetReady()

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.

◆ GetUgcPrivilege()

bool SCR_AddonManager.GetUgcPrivilege ( )

Returns immediate value of UserPrivilege.USER_GEN_CONTENT.

◆ Internal_CheckAddons()

void SCR_AddonManager.Internal_CheckAddons ( )
protected

When internet is disabled, might take a lot of time to complete the request.

◆ Internal_OnNewDownload()

void SCR_AddonManager.Internal_OnNewDownload ( SCR_WorkshopItem  item,
SCR_WorkshopItemActionDownload  action 
)

Called by SCR_WorkshopItem when it starts a new download.

◆ InvokeEventOnAddonEnabled()

void SCR_AddonManager.InvokeEventOnAddonEnabled ( SCR_WorkshopItem  arg0,
int  arg1 
)
protected

◆ InvokeEventOnAllAddonsEnabled()

void SCR_AddonManager.InvokeEventOnAllAddonsEnabled ( )
protected

◆ ItemAvailability()

static SCR_ERevisionAvailability SCR_AddonManager.ItemAvailability ( notnull WorkshopItem  item)
static

Compare availability state for item current revision Returns state base on if current and latest revision is avaiable in workshop.

◆ NegotiateUgcPrivilegeAsync()

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.

◆ OnAllAddonsEnabledCorrupted()

void SCR_AddonManager.OnAllAddonsEnabledCorrupted ( )
protected

Call this when all dialog are enabled, but some are missing to show which one.

◆ OnOfflineAddonsDisabled()

void SCR_AddonManager.OnOfflineAddonsDisabled ( )
protected

◆ Register() [1/2]

SCR_WorkshopItem SCR_AddonManager.Register ( Dependency  item)

Returns a SCR_WorkshopItem. If it's not registered, creates a new one and registers it.

◆ Register() [2/2]

SCR_WorkshopItem SCR_AddonManager.Register ( WorkshopItem  item)

Returns a SCR_WorkshopItem. If it's not registered, creates a new one and registers it.

◆ RegisterNewItem()

void SCR_AddonManager.RegisterNewItem ( string  id,
SCR_WorkshopItem  itemWrapper 
)
protected

◆ SelectItemsAnd()

static array< ref SCR_WorkshopItem > SCR_AddonManager.SelectItemsAnd ( array< ref SCR_WorkshopItem items,
EWorkshopItemQuery  query 
)
static

Selects items which match query.

All flags must match. EWorkshopItemQuery.OFFLINE | EWorkshopItemQuery.ENABLED - will return items which are offline AND enabled.

◆ SelectItemsBasic()

static array< ref SCR_WorkshopItem > SCR_AddonManager.SelectItemsBasic ( array< ref SCR_WorkshopItem items,
EWorkshopItemQuery  query 
)
static

Selects items which match query.

Only one flag is tested! EWorkshopItemQuery.OFFLINE - will return items which are offline AND enabled.

◆ SelectItemsOr()

static array< ref SCR_WorkshopItem > SCR_AddonManager.SelectItemsOr ( array< ref SCR_WorkshopItem items,
EWorkshopItemQuery  query 
)
static

Selects items which match query.

Any flag must match. EWorkshopItemQuery.OFFLINE | EWorkshopItemQuery.ENABLED - will return items which are offline OR enabled.

◆ SelectPreset()

void SCR_AddonManager.SelectPreset ( SCR_WorkshopAddonPreset  preset,
notnull array< ref SCR_WorkshopAddonPresetAddonMeta addonsNotFound 
)

Member Data Documentation

◆ ADDONS_CLI

const string SCR_AddonManager.ADDONS_CLI = "addons"
static

◆ ADDONS_ENABLED_UPDATE_INTERVAL_S

const static float SCR_AddonManager.ADDONS_ENABLED_UPDATE_INTERVAL_S = 1/30
staticprotected

◆ ADDONS_OUTDATED_UPDATE_INTERVAL_S

const static float SCR_AddonManager.ADDONS_OUTDATED_UPDATE_INTERVAL_S = 1.0
staticprotected

◆ Event_OnAddonEnabled

ref ScriptInvoker<SCR_WorkshopItem, int> SCR_AddonManager.Event_OnAddonEnabled
protected

◆ Event_OnAllAddonsEnabled

ref ScriptInvoker SCR_AddonManager.Event_OnAllAddonsEnabled
protected

◆ m_aAddonsNotFound

ref array<ref SCR_WorkshopAddonPresetAddonMeta> SCR_AddonManager.m_aAddonsNotFound = {}
protected

◆ m_aAddonsToRegister

ref array<WorkshopItem> SCR_AddonManager.m_aAddonsToRegister = {}
protected

◆ m_AddonCheckCallback

ref SCR_BackendCallback SCR_AddonManager.m_AddonCheckCallback = new SCR_BackendCallback()
protected

◆ m_bAddonsChecked

bool SCR_AddonManager.m_bAddonsChecked = false
protected

◆ m_bInitFinished

bool SCR_AddonManager.m_bInitFinished = false
protected

◆ m_CallbackCheckAddons

ref SCR_WorkshopCallbackBase SCR_AddonManager.m_CallbackCheckAddons
protected

◆ m_CallbackGetPrivilege

ref SCR_ScriptPlatformRequestCallback SCR_AddonManager.m_CallbackGetPrivilege
protected

◆ m_fAddonsEnabledTimer

float SCR_AddonManager.m_fAddonsEnabledTimer = 0
protected

◆ m_fAddonsOutdatedTimer

float SCR_AddonManager.m_fAddonsOutdatedTimer = 0
protected

◆ m_iAddonsOutdated

int SCR_AddonManager.m_iAddonsOutdated
protected

◆ m_LoadingOverlay

SCR_LoadingOverlay SCR_AddonManager.m_LoadingOverlay
protected

◆ m_mItems

ref map<string, ref SCR_WorkshopItem> SCR_AddonManager.m_mItems = new map<string, ref SCR_WorkshopItem>()
protected

◆ m_OnAddonOfflineStateChanged

ref ScriptInvoker SCR_AddonManager.m_OnAddonOfflineStateChanged = new ScriptInvoker

◆ m_OnAddonReportedStateChanged

ref ScriptInvoker SCR_AddonManager.m_OnAddonReportedStateChanged = new ScriptInvoker

◆ m_OnAddonsChecked

ref ScriptInvoker SCR_AddonManager.m_OnAddonsChecked = new ScriptInvoker

◆ m_OnAddonsEnabledChanged

ref ScriptInvoker SCR_AddonManager.m_OnAddonsEnabledChanged = new ScriptInvoker

◆ m_OnNewDownload

ref ScriptInvoker SCR_AddonManager.m_OnNewDownload = new ScriptInvoker

◆ m_OnUgcPrivilegeResult

ref ScriptInvoker SCR_AddonManager.m_OnUgcPrivilegeResult = new ScriptInvoker

◆ m_sAddonsEnabledPrev

string SCR_AddonManager.m_sAddonsEnabledPrev
protected

◆ m_SelectedPreset

SCR_WorkshopAddonPreset SCR_AddonManager.m_SelectedPreset
protected

◆ m_Storage

ref SCR_WorkshopAddonManagerPresetStorage SCR_AddonManager.m_Storage
protected

◆ s_Instance

SCR_AddonManager SCR_AddonManager.s_Instance
staticprotected

◆ VERSION_DOT

const string SCR_AddonManager.VERSION_DOT = "."
static

The documentation for this interface was generated from the following file: