11 protected ref array<SCR_WorkshopItem> m_aItems = {};
12 protected ref array<SCR_WorkshopItem> m_aItemsFailed = {};
13 protected int m_iLoadedPatches;
15 protected ref ScriptInvokerBase<ScriptInvoker_AddonPatchSizeLoad> m_OnAllPatchSizeLoaded;
24 m_aItems.Insert(item);
30 m_aItems.RemoveItem(item);
39 protected ref array<ref SCR_BackendCallback> m_aCallbacks = {};
47 Revision revision = item.GetCurrentLocalRevision();
48 Revision target = item.GetItemTargetRevision();
51 if (Revision.AreEqual(revision, target))
59 callback.GetEventOnResponse().Insert(OnPatchSizeLoadResponse);
78 if (item.GetItemTargetRevision().GetPatchSize(size))
81 item.SetTargetRevisionPatchSize(size);
87 m_aItemsFailed.Insert(item);
93 m_aItemsFailed.Insert(item);
97 if (m_iLoadedPatches + m_aItemsFailed.Count() == m_aItems.Count())
99 bool allLoaded = m_aItemsFailed.IsEmpty();
101 if (m_OnAllPatchSizeLoaded)
102 m_OnAllPatchSizeLoaded.Invoke(
this, allLoaded);
105 callback.GetEventOnResponse().Remove(OnPatchSizeLoadResponse);
114 ScriptInvokerBase<ScriptInvoker_AddonPatchSizeLoad> GetOnAllPatchSizeLoaded()
116 if (!m_OnAllPatchSizeLoaded)
117 m_OnAllPatchSizeLoaded =
new ScriptInvokerBase<ScriptInvoker_AddonPatchSizeLoad>();
119 return m_OnAllPatchSizeLoaded;
130 m_aItemsFailed.Clear();
132 if (m_OnAllPatchSizeLoaded)
133 m_OnAllPatchSizeLoaded.Clear();