Arma Reforger Script API
|
Public Member Functions | |
ScriptInvokerBase< ScriptInvoker_ActionDownloadProgress > | GetOnDownloadProgress () |
ScriptInvokerBase< ScriptInvoker_ActionDownloadFullStorage > | GetOnFullStorageError () |
void | SCR_WorkshopItemActionDownload (SCR_WorkshopItem wrapper, bool latestVersion, Revision revision=null) |
Revision | GetTargetRevision () |
Returns the target version. | |
Revision | GetStartRevision () |
Returns the version which was at the moment when the download was started. | |
bool | GetTargetedAtLatestVersion () |
bool | GetUpdate () |
Returns true when this is an update, false when regular download. | |
float | GetProgress () |
Returns current download progress if active or paused, 1 if complete, otherwise 0. | |
float | GetProcessingProgress () |
float | GetSizeBytes () |
Returns download size. Might return 0 until the actiion is activated. | |
bool | GetRunningAsync () |
bool | IsRunningAsyncSolved () |
bool | IsPauseAsyncSolved () |
override void | Internal_Update (float timeSlice) |
Called on each frame by the SCR_WorkshopItem which owns it. | |
void | FullStorageFail () |
SCR_WorkshopItemActionDownload | RetryDownload () |
Try redownload failed addon. | |
void | ForceFail () |
float | GetDownloadSize () |
bool | IsProcessing () |
Public Member Functions inherited from SCR_WorkshopItemAction | |
void | SCR_WorkshopItemAction (SCR_WorkshopItem wrapper) |
void | ~SCR_WorkshopItemAction () |
bool | IsInactive () |
bool | IsActive () |
bool | IsCompleted () |
bool | IsCanceled () |
bool | IsPaused () |
bool | IsFailed () |
bool | IsAttached () |
When action is attached, it means that it wasn't completed or wasn't replaced by another action. | |
SCR_WorkshopItem | GetWorkshopItem () |
void | SetUserData (Managed data) |
Managed | GetUserData (Managed data) |
string | GetAddonName () |
Returns the cached addon name, even if WorkshopItem object is already deleted. | |
string | GetAddonId () |
Returns the cached addon ID, even if WorkshopItem object is already deleted. | |
bool | Activate () |
Public methods to interact with the action They return true if the operation was successful. | |
bool | Cancel () |
Cancels an action. Valid in active, inactive, paused states. | |
bool | Pause () |
Pauses an active action. | |
bool | Resume () |
Resumes a paused action. | |
bool | Reactivate () |
Starts action again Only valid in failed state. | |
void | Internal_Update (float timeSlice) |
Called on each frame by the SCR_WorkshopItem which owns it. | |
void | Internal_Detach () |
void | _print (string str, LogLevel logLevel=LogLevel.DEBUG) |
Protected Member Functions | |
override bool | OnActivate () |
These methods must be overridden in derived classes to implement the functionality. | |
override bool | OnReactivate () |
override bool | OnCancel () |
override bool | OnPause () |
void | OnPauseResponse (SCR_BackendCallback callback) |
override bool | OnResume () |
void | OnResumeResponse (SCR_BackendCallback callback) |
override void | OnComplete () |
bool | StartDownloadOrLoadDetails () |
We can't start download before details are loaded, because details have the revisions. | |
void | Callback_OnError (SCR_WorkshopCallbackBase callback, int code, int restCode, int apiCode) |
void | Callback_OnTimeout (SCR_WorkshopCallbackBase callback) |
Protected Member Functions inherited from SCR_WorkshopItemAction | |
void | Fail (int reason=-1) |
Action must call this when it has failed. | |
void | Complete () |
Action must call this when it is completed. | |
void | InvokeOnChanged () |
Call this in inherited classes to invoke the OnChanged event handler. | |
bool | OnActivate () |
These methods must be overridden in derived classes to implement the functionality. | |
bool | OnCancel () |
bool | OnPause () |
bool | OnResume () |
bool | OnReactivate () |
void | OnFail (int reason=-1) |
void | OnComplete () |
Protected Attributes | |
ref Revision | m_StartVersion |
ref Revision | m_TargetRevision |
bool | m_bTargetVersionLatest |
ref SCR_WorkshopCallbackBase | m_Callback |
float | m_fSizeBytes |
bool | m_bWaitingForRevisions |
bool | m_bDownloadStarted |
float | m_fProgress |
float | m_fProcessingProgress |
float | m_fDownloadedSize |
bool | m_bAddonEnabledAtStart |
ref SCR_BackendCallback | m_PauseDownloadCallback = new SCR_BackendCallback() |
bool | m_bRunningImmediate |
bool | m_bRunningAsync |
ref ScriptInvokerBase< ScriptInvoker_ActionDownloadProgress > | m_OnDownloadProgress |
ref ScriptInvokerBase< ScriptInvoker_ActionDownloadFullStorage > | m_OnFullStorageError |
Protected Attributes inherited from SCR_WorkshopItemAction | |
int | m_State |
bool | m_bAttached |
ref Managed | m_UserData |
string | m_sAddonName |
string | m_sAddonId |
Additional Inherited Members | |
Public Attributes inherited from SCR_WorkshopItemAction | |
ref ScriptInvoker | m_OnActivated = new ScriptInvoker |
ref ScriptInvoker | m_OnCompleted = new ScriptInvoker |
ref ScriptInvoker | m_OnCanceled = new ScriptInvoker |
ref ScriptInvoker | m_OnResumed = new ScriptInvoker |
ref ScriptInvoker | m_OnPaused = new ScriptInvoker |
ref ScriptInvoker | m_OnFailed = new ScriptInvoker |
ref ScriptInvoker | m_OnChanged = new ScriptInvoker |
SCR_WorkshopItem | m_Wrapper |
Static Protected Attributes inherited from SCR_WorkshopItemAction | |
const int | STATE_INACTIVE = 0 |
const int | STATE_ACTIVE = 1 |
const int | STATE_COMPLETED = 2 |
const int | STATE_FAILED = 3 |
const int | STATE_CANCELED = 4 |
const int | STATE_PAUSED = 5 |
void SCR_WorkshopItemActionDownload.SCR_WorkshopItemActionDownload | ( | SCR_WorkshopItem | wrapper, |
bool | latestVersion, | ||
Revision | revision = null |
||
) |
|
protected |
|
protected |
void SCR_WorkshopItemActionDownload.ForceFail | ( | ) |
void SCR_WorkshopItemActionDownload.FullStorageFail | ( | ) |
float SCR_WorkshopItemActionDownload.GetDownloadSize | ( | ) |
ScriptInvokerBase< ScriptInvoker_ActionDownloadProgress > SCR_WorkshopItemActionDownload.GetOnDownloadProgress | ( | ) |
ScriptInvokerBase< ScriptInvoker_ActionDownloadFullStorage > SCR_WorkshopItemActionDownload.GetOnFullStorageError | ( | ) |
float SCR_WorkshopItemActionDownload.GetProcessingProgress | ( | ) |
float SCR_WorkshopItemActionDownload.GetProgress | ( | ) |
Returns current download progress if active or paused, 1 if complete, otherwise 0.
bool SCR_WorkshopItemActionDownload.GetRunningAsync | ( | ) |
float SCR_WorkshopItemActionDownload.GetSizeBytes | ( | ) |
Returns download size. Might return 0 until the actiion is activated.
Revision SCR_WorkshopItemActionDownload.GetStartRevision | ( | ) |
Returns the version which was at the moment when the download was started.
bool SCR_WorkshopItemActionDownload.GetTargetedAtLatestVersion | ( | ) |
Revision SCR_WorkshopItemActionDownload.GetTargetRevision | ( | ) |
Returns the target version.
!! If you were targeting latest version, but the actual download has not started because it is waiting for more data from backend, then this will return an empty string until the data is fetched from backend.
bool SCR_WorkshopItemActionDownload.GetUpdate | ( | ) |
Returns true when this is an update, false when regular download.
override void SCR_WorkshopItemActionDownload.Internal_Update | ( | float | timeSlice | ) |
Called on each frame by the SCR_WorkshopItem which owns it.
Here we can perform polling to detect state transitions
Implements SCR_WorkshopItemAction.
bool SCR_WorkshopItemActionDownload.IsPauseAsyncSolved | ( | ) |
bool SCR_WorkshopItemActionDownload.IsProcessing | ( | ) |
bool SCR_WorkshopItemActionDownload.IsRunningAsyncSolved | ( | ) |
|
protected |
These methods must be overridden in derived classes to implement the functionality.
If the specific action can't be paused, canceled, or resumed, the methods must return false.
Implements SCR_WorkshopItemAction.
|
protected |
Implements SCR_WorkshopItemAction.
|
protected |
Implements SCR_WorkshopItemAction.
|
protected |
Implements SCR_WorkshopItemAction.
|
protected |
|
protected |
Implements SCR_WorkshopItemAction.
|
protected |
Implements SCR_WorkshopItemAction.
|
protected |
SCR_WorkshopItemActionDownload SCR_WorkshopItemActionDownload.RetryDownload | ( | ) |
Try redownload failed addon.
|
protected |
We can't start download before details are loaded, because details have the revisions.
Starts download immediately or loads details of workshop item.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |