Arma Reforger Script API
Loading...
Searching...
No Matches
SCR_SaveWorkshopManager Interface Reference

Scripted api for handling workshop and backend interactions. More...

Public Member Functions

void Init ()
 Setup workshop data to get offline items and scenarios.
 
void UploadSave (notnull WorldSaveItem save, notnull WorldSaveManifest manifest, bool public)
 Upload save to workshop.
 
bool DeleteOfflineSaveByName (string fileName)
 Find local World save item by save file name.
 
void DeletePublishedSave (notnull WorldSaveItem save)
 Delete published save from workshop.
 
ResourceName CurrentScenarioImage ()
 Get thumbnail of current scenario or use fallback back image.
 
void GetOfflineSaves (out array< WorldSaveItem > saves)
 Get offline workshop items and filter out only WorldSaveItem type.
 
WorldSaveItem FindSaveItemBySaveFileName (string fileName)
 Return world save item that cotains save file with provided name.
 
SCR_BackendCallback GetUploadCallback ()
 
SCR_BackendCallback GetLoadSavesPageCallback ()
 
SCR_BackendCallback GetDeletePublishedCallback ()
 
void SetCurrentSave (string fileName, WorldSaveItem saveItem)
 
string GetCurrentSave (out WorldSaveItem saveItem)
 
ScriptInvokerString GetOnCurrentSaveChanged ()
 
void SetEditedSaveManifest (WorldSaveManifest manifest, string editingValue="", string value="")
 
void ClearEditedSaveManifest ()
 
void SetEditedSaveManifestEditingValue (string editingValue)
 
SCR_EditedSaveManifest GetEditedSaveManifest ()
 
void ~SCR_SaveWorkshopManager ()
 

Static Public Member Functions

static SCR_SaveWorkshopManager GetInstance ()
 
static MissionWorkshopItem GetCurrentScenario ()
 Get mission workshop item of current scenario.
 
static ResourceName GetCurrentScenarioId ()
 Get resource path of current scenario or fallback to path of testing world.
 
static MissionWorkshopItem GetScenarioMissionWorkshopItem (MissionHeader missionHeader)
 
static string GetScenarioNameFile (MissionWorkshopItem missionItem)
 
static string GetCurrentScenarioNameFile ()
 Get name of current scenario or fallback to testing world name for save file name.
 
static string GetCurrentScenarioNameTranslated ()
 Get translated name of current scenario or fallback to testing world name.
 
static string GetSaveFileID (string fileName)
 Find ID in save file name for format 'scenario_name.type_id'.
 
static string ScenarioGUIDToID (string guid)
 Convert GUID format '{id}Missions/Scenario.cof' to 'id'.
 
static bool CanOverrideSave (notnull WorldSaveItem save)
 Check if player can save dirrectly into the save.
 
static bool IsSaveLocalOnly (notnull WorldSaveItem save)
 
static string StripSaveIdFromSaveFileName (string fileName)
 Remove '_id' from provided save file name.
 

Protected Member Functions

void SCR_SaveWorkshopManager ()
 

Protected Attributes

string m_sCurrentSave
 
WorldSaveItem m_CurrentSaveItem
 
ref SCR_EditedSaveManifest m_EditedManifest
 
ref array< MissionWorkshopItem > m_aMissions = {}
 
ref array< string > m_aScenarioSources = {}
 
ref ScriptInvokerString m_OnCurrentSaveChanged
 
ref SCR_BackendCallback m_UploadCallback = new SCR_BackendCallback()
 
ref SCR_BackendCallback m_LoadSavesPageCallback = new SCR_BackendCallback()
 
ref SCR_BackendCallback m_ChangeCallback
 
ref SCR_BackendCallback m_DeletePublishedCallback = new SCR_BackendCallback()
 

Static Protected Attributes

const string FALLBACK_SCENARIO_NAME = "GM_TestWorld"
 
const string FALLBACK_SCENARIO_ID = "{D46718CC67B45055}Missions/GM_TestWorld.conf"
 
const int ID_LENGTH = 16
 
const int THUMBNAIL_WIDTH = 800
 
const string SAVE_EXTENSION = ".save"
 
const string SAVE_EXTENSION_MODDED = ".save_"
 
const string SAVE_FILE_EXTENSION = ".json"
 
const string SESSION_SAVE_NAME = "TestSaveName"
 
const string SAVE_FORMAT = "%1-%2-%3"
 
static ref SCR_SaveWorkshopManager s_Instance
 

Detailed Description

Scripted api for handling workshop and backend interactions.

Constructor & Destructor Documentation

◆ SCR_SaveWorkshopManager()

void SCR_SaveWorkshopManager.SCR_SaveWorkshopManager ( )
protected

◆ ~SCR_SaveWorkshopManager()

void SCR_SaveWorkshopManager.~SCR_SaveWorkshopManager ( )

Member Function Documentation

◆ CanOverrideSave()

static bool SCR_SaveWorkshopManager.CanOverrideSave ( notnull WorldSaveItem save)
static

Check if player can save dirrectly into the save.

Player shouldn't be able to override save downloaded from workshop which are not owned by player.

Parameters
[in]saveSave item to override - is local save item

◆ ClearEditedSaveManifest()

void SCR_SaveWorkshopManager.ClearEditedSaveManifest ( )

◆ CurrentScenarioImage()

ResourceName SCR_SaveWorkshopManager.CurrentScenarioImage ( )

Get thumbnail of current scenario or use fallback back image.

◆ DeleteOfflineSaveByName()

bool SCR_SaveWorkshopManager.DeleteOfflineSaveByName ( string fileName)

Find local World save item by save file name.

Parameters
[in]stringSave file name to find
Returns
Return true if save was found and deleted successfully

◆ DeletePublishedSave()

void SCR_SaveWorkshopManager.DeletePublishedSave ( notnull WorldSaveItem save)

Delete published save from workshop.

Use GetDeletePublishedCallback() to listen to delete response.

Parameters
[in]saveWhich save should be deleted - save must be online on workshop.

◆ FindSaveItemBySaveFileName()

WorldSaveItem SCR_SaveWorkshopManager.FindSaveItemBySaveFileName ( string fileName)

Return world save item that cotains save file with provided name.

Warning
With standard use by player there should be always unique name. But in case of repeating names wrong item could be found.
Parameters
[in]fileNameFull save file name.
Returns
WorldSaveItem which contains save with this name

◆ GetCurrentSave()

string SCR_SaveWorkshopManager.GetCurrentSave ( out WorldSaveItem saveItem)

◆ GetCurrentScenario()

static MissionWorkshopItem SCR_SaveWorkshopManager.GetCurrentScenario ( )
static

Get mission workshop item of current scenario.

Warning
Scenario must be loaded from main menu. GetCurrentScenarioId() and GetCurrentScenarioName() can be used while loading scenario directly in wb.
Returns
Return MissionWorkshopItem of current loaded scenario header.

◆ GetCurrentScenarioId()

static ResourceName SCR_SaveWorkshopManager.GetCurrentScenarioId ( )
static

Get resource path of current scenario or fallback to path of testing world.

◆ GetCurrentScenarioNameFile()

static string SCR_SaveWorkshopManager.GetCurrentScenarioNameFile ( )
static

Get name of current scenario or fallback to testing world name for save file name.

◆ GetCurrentScenarioNameTranslated()

static string SCR_SaveWorkshopManager.GetCurrentScenarioNameTranslated ( )
static

Get translated name of current scenario or fallback to testing world name.

◆ GetDeletePublishedCallback()

SCR_BackendCallback SCR_SaveWorkshopManager.GetDeletePublishedCallback ( )

◆ GetEditedSaveManifest()

SCR_EditedSaveManifest SCR_SaveWorkshopManager.GetEditedSaveManifest ( )

◆ GetInstance()

static SCR_SaveWorkshopManager SCR_SaveWorkshopManager.GetInstance ( )
static

◆ GetLoadSavesPageCallback()

SCR_BackendCallback SCR_SaveWorkshopManager.GetLoadSavesPageCallback ( )

◆ GetOfflineSaves()

void SCR_SaveWorkshopManager.GetOfflineSaves ( out array< WorldSaveItem > saves)

Get offline workshop items and filter out only WorldSaveItem type.

Parameters
[out]savesWorldSaveItem array which should be filled by result saves.

◆ GetOnCurrentSaveChanged()

ScriptInvokerString SCR_SaveWorkshopManager.GetOnCurrentSaveChanged ( )

◆ GetSaveFileID()

static string SCR_SaveWorkshopManager.GetSaveFileID ( string fileName)
static

Find ID in save file name for format 'scenario_name.type_id'.

Parameters
[in]fileNameFull save file name in
Returns
of save workshop item, unpublished saves should return empty string

◆ GetScenarioMissionWorkshopItem()

static MissionWorkshopItem SCR_SaveWorkshopManager.GetScenarioMissionWorkshopItem ( MissionHeader missionHeader)
static

◆ GetScenarioNameFile()

static string SCR_SaveWorkshopManager.GetScenarioNameFile ( MissionWorkshopItem missionItem)
static

◆ GetUploadCallback()

SCR_BackendCallback SCR_SaveWorkshopManager.GetUploadCallback ( )

◆ Init()

void SCR_SaveWorkshopManager.Init ( )

Setup workshop data to get offline items and scenarios.

◆ IsSaveLocalOnly()

static bool SCR_SaveWorkshopManager.IsSaveLocalOnly ( notnull WorldSaveItem save)
static

◆ ScenarioGUIDToID()

static string SCR_SaveWorkshopManager.ScenarioGUIDToID ( string guid)
static

Convert GUID format '{id}Missions/Scenario.cof' to 'id'.

Parameters
[in]guidGUID in form of resource path - {id}Missions/Scenario.cof
Returns
GUID in hexadecimal form stripped of resource path - id

◆ SetCurrentSave()

void SCR_SaveWorkshopManager.SetCurrentSave ( string fileName,
WorldSaveItem saveItem )

◆ SetEditedSaveManifest()

void SCR_SaveWorkshopManager.SetEditedSaveManifest ( WorldSaveManifest manifest,
string editingValue = "",
string value = "" )

◆ SetEditedSaveManifestEditingValue()

void SCR_SaveWorkshopManager.SetEditedSaveManifestEditingValue ( string editingValue)

◆ StripSaveIdFromSaveFileName()

static string SCR_SaveWorkshopManager.StripSaveIdFromSaveFileName ( string fileName)
static

Remove '_id' from provided save file name.

_id is present in name of save file downloaded from workshop \parma fileName Save file name

Returns
Save file name without additional '_id' if it's present. E.g. GM-Arland-Save1.save_613AA7D56D5C87D5.json returns GM-Arland-Save1.save.json Return save name without _id at end of the name This is present only id save downloaded from workshop

◆ UploadSave()

void SCR_SaveWorkshopManager.UploadSave ( notnull WorldSaveItem save,
notnull WorldSaveManifest manifest,
bool public )

Upload save to workshop.

Use GetUploadCallback() to listen to upload response.

Parameters
[in]saveSave item that will be uploaded.
[in]manifestSave meta data that will be used in save description.
[in]publicWill set if save will be visible and downloadable by non owners/contributors.

Member Data Documentation

◆ FALLBACK_SCENARIO_ID

const string SCR_SaveWorkshopManager.FALLBACK_SCENARIO_ID = "{D46718CC67B45055}Missions/GM_TestWorld.conf"
staticprotected

◆ FALLBACK_SCENARIO_NAME

const string SCR_SaveWorkshopManager.FALLBACK_SCENARIO_NAME = "GM_TestWorld"
staticprotected

◆ ID_LENGTH

const int SCR_SaveWorkshopManager.ID_LENGTH = 16
staticprotected

◆ m_aMissions

ref array<MissionWorkshopItem> SCR_SaveWorkshopManager.m_aMissions = {}
protected

◆ m_aScenarioSources

ref array<string> SCR_SaveWorkshopManager.m_aScenarioSources = {}
protected

◆ m_ChangeCallback

ref SCR_BackendCallback SCR_SaveWorkshopManager.m_ChangeCallback
protected

◆ m_CurrentSaveItem

WorldSaveItem SCR_SaveWorkshopManager.m_CurrentSaveItem
protected

◆ m_DeletePublishedCallback

ref SCR_BackendCallback SCR_SaveWorkshopManager.m_DeletePublishedCallback = new SCR_BackendCallback()
protected

◆ m_EditedManifest

ref SCR_EditedSaveManifest SCR_SaveWorkshopManager.m_EditedManifest
protected

◆ m_LoadSavesPageCallback

ref SCR_BackendCallback SCR_SaveWorkshopManager.m_LoadSavesPageCallback = new SCR_BackendCallback()
protected

◆ m_OnCurrentSaveChanged

ref ScriptInvokerString SCR_SaveWorkshopManager.m_OnCurrentSaveChanged
protected

◆ m_sCurrentSave

string SCR_SaveWorkshopManager.m_sCurrentSave
protected

◆ m_UploadCallback

ref SCR_BackendCallback SCR_SaveWorkshopManager.m_UploadCallback = new SCR_BackendCallback()
protected

◆ s_Instance

ref SCR_SaveWorkshopManager SCR_SaveWorkshopManager.s_Instance
staticprotected

◆ SAVE_EXTENSION

const string SCR_SaveWorkshopManager.SAVE_EXTENSION = ".save"
staticprotected

◆ SAVE_EXTENSION_MODDED

const string SCR_SaveWorkshopManager.SAVE_EXTENSION_MODDED = ".save_"
staticprotected

◆ SAVE_FILE_EXTENSION

const string SCR_SaveWorkshopManager.SAVE_FILE_EXTENSION = ".json"
staticprotected

◆ SAVE_FORMAT

const string SCR_SaveWorkshopManager.SAVE_FORMAT = "%1-%2-%3"
staticprotected

◆ SESSION_SAVE_NAME

const string SCR_SaveWorkshopManager.SESSION_SAVE_NAME = "TestSaveName"
staticprotected

◆ THUMBNAIL_WIDTH

const int SCR_SaveWorkshopManager.THUMBNAIL_WIDTH = 800
staticprotected

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