6 protected ref array<ref SCR_ContentBrowserEditorCard> m_aCardPrefabs;
9 protected bool m_bShowBudgetCost;
17 protected ResourceName m_RepeatPrefab;
18 protected ResourceName m_DefaultLayout;
24 void OnCardHover(Widget itemWidget,
int prefabIndex,
bool enter)
38 void OnCardLMB(Widget itemWidget)
44 int prefabID = assetCard.GetPrefabIndex();
47 if (!
m_PlacingManager.SetSelectedPrefab(prefab, showBudgetMaxNotification:
true))
52 linkedComponent.m_RepeatPrefab = prefab;
63 protected Widget CreateItem(
int index)
72 m_ItemLayout = m_DefaultLayout;
77 if (itemLayoutCandidate.m_EntityType == info.GetEntityType())
79 m_ItemLayout = itemLayoutCandidate.m_sPrefab;
88 if (!CreateItem(itemWidget, item))
92 array<ref SCR_EntityBudgetValue> entityBudgetCosts = { };
96 assetCard.GetOnHover().Insert(OnCardHover);
97 assetCard.InitCard(prefabID, info,
m_ContentBrowserManager.GetResourceNamePrefabID(prefabID), blockingBudgetInfo);
100 if (m_bShowBudgetCost && !entityBudgetCosts.IsEmpty())
103 if (budgetValue.GetBudgetType() == m_eBudgetToShow)
104 assetCard.UpdateBudgetCost(budgetValue);
111 buttonComponent.SetMouseOverToFocus(
false);
117 override protected void OnPageChanged(
int page)
121 m_iFirstShownIndex = page * m_Pagination.GetColumns();
126 super.OnPageChanged(page);
130 override protected void ShowEntries(Widget contentWidget,
int indexStart,
int indexEnd)
132 for (
int i = indexStart; i < indexEnd; i++)
144 m_Pagination.RefreshPage();
148 protected void OnBrowserEntriesChanged()
160 protected void OnResourceTypeEnabledChanged(array<EResourceType> disabledResourceTypes)
166 override protected void Refresh()
172 int toolbarPageIndex = (contentBrowserPage * contentBrowserPageEntryCount) / m_Pagination.GetColumns();
174 m_Pagination.SetPage(toolbarPageIndex);
186 override void OnRepeat()
189 m_PlacingManager.SetSelectedPrefab(m_RepeatPrefab, showBudgetMaxNotification:
true);
193 override void HandlerAttachedScripted(Widget w)
197 gameMode.GetOnResourceTypeEnabledChanged().Insert(OnResourceTypeEnabledChanged);
212 m_BudgetManager.Event_OnBudgetMaxReached.Insert(OnBudgetMaxReached);
219 m_DefaultLayout = defaultLayoutCandidate.m_sPrefab;
224 super.HandlerAttachedScripted(w);
228 override void HandlerDeattached(Widget w)
230 super.HandlerDeattached(w);
234 gameMode.GetOnResourceTypeEnabledChanged().Remove(OnResourceTypeEnabledChanged);
243 m_BudgetManager.Event_OnBudgetMaxReached.Remove(OnBudgetMaxReached);