Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_BaseResourceTooltipDetail.c
Go to the documentation of this file.
3 {
4  [Attribute()]
5  protected LocalizedString m_sResourceFormatting;
6 
7  [Attribute(EResourceType.SUPPLIES.ToString(), uiwidget: UIWidgets.SearchComboBox, enums: ParamEnumArray.FromEnum(EResourceType))]
8  protected EResourceType m_eResourceType;
9 
10  protected TextWidget m_wText;
11 
12  protected SCR_ResourceConsumer m_ResourceConsumer;
13  protected SCR_ResourceComponent m_ResourceComponent;
14  protected SCR_ResourceSystemSubscriptionHandleBase m_ResourceSubscriptionHandleConsumer;
15 
16  //------------------------------------------------------------------------------------------------
17  override bool NeedUpdate()
18  {
19  return true;
20  }
21 
22  //------------------------------------------------------------------------------------------------
23  //~ Temp solution until replication fixed
24  protected void TEMP_OnInteractorReplicated()
25  {
26  m_ResourceConsumer = GetConsumer();
27  }
28 
29  //------------------------------------------------------------------------------------------------
30  protected SCR_ResourceConsumer GetConsumer()
31  {
32  return null;
33  }
34 
35  //------------------------------------------------------------------------------------------------
36  override void UpdateDetail(SCR_EditableEntityComponent entity)
37  {
38  super.UpdateDetail(entity);
39 
40  if (!m_ResourceConsumer)
41  return;
42 
45  else
46  m_ResourceSubscriptionHandleConsumer = GetGame().GetResourceSystemSubscriptionManager().RequestSubscriptionListenerHandleGraceful(m_ResourceConsumer, Replication.FindId(SCR_ResourcePlayerControllerInventoryComponent.Cast(GetGame().GetPlayerController().FindComponent(SCR_ResourcePlayerControllerInventoryComponent))));
47  }
48 
49  //------------------------------------------------------------------------------------------------
50  override bool InitDetail(SCR_EditableEntityComponent entity, Widget widget)
51  {
52  m_wText = TextWidget.Cast(widget);
53  if (!m_wText)
54  return false;
55 
56  m_ResourceComponent = SCR_ResourceComponent.FindResourceComponent(entity.GetOwner());
58  return false;
59 
60  if (!IsValid())
61  {
62  m_ResourceComponent = null;
63  return false;
64  }
65 
66  m_ResourceConsumer = GetConsumer();
67  if (!m_ResourceConsumer)
68  {
69  m_ResourceComponent = null;
70  return false;
71  }
72 
73  m_ResourceComponent.TEMP_GetOnInteractorReplicated().Insert(TEMP_OnInteractorReplicated);
74 
75  UpdateDetail(entity);
76 
77  return true;
78  }
79 
80  //------------------------------------------------------------------------------------------------
81  protected bool IsValid()
82  {
83  return false;
84  }
85 
86  //------------------------------------------------------------------------------------------------
87  // destructor
89  {
91  return;
92 
93  m_ResourceComponent.TEMP_GetOnInteractorReplicated().Remove(TEMP_OnInteractorReplicated);
94  m_ResourceComponent = null;
95  }
96 }
m_ResourceConsumer
protected SCR_ResourceConsumer m_ResourceConsumer
Definition: SCR_BaseSupportStationComponent.c:114
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
BaseContainerCustomStringTitleField
class SCR_HitZoneGroupNameHolder BaseContainerCustomStringTitleField("USE INHERENT VERSION ONLY!")
Definition: SCR_HitZoneGroupNameHolder.c:27
GetPlayerController
proto external PlayerController GetPlayerController()
Definition: SCR_PlayerDeployMenuHandlerComponent.c:307
SCR_BaseResourceTooltipDetail
Definition: SCR_BaseResourceTooltipDetail.c:2
m_ResourceSubscriptionHandleConsumer
protected SCR_ResourceSystemSubscriptionHandleBase m_ResourceSubscriptionHandleConsumer
Definition: SCR_BaseSupportStationComponent.c:125
Attribute
typedef Attribute
Post-process effect of scripted camera.
EResourceType
EResourceType
Definition: SCR_ResourceContainer.c:1
m_ResourceComponent
protected SCR_ResourceComponent m_ResourceComponent
Definition: SCR_CampaignBuildingProviderComponent.c:51
SCR_EntityTooltipDetail
Definition: SCR_EntityTooltipDetail.c:2
SCR_EditableEntityComponent
Definition: SCR_EditableEntityComponent.c:13
SCR_ResourcePlayerControllerInventoryComponent
Definition: SCR_ResourcePlayerControllerInventoryComponent.c:20
SCR_ResourceSystemSubscriptionHandleBase
Definition: SCR_ResourceSystemSubscriptionHandleBase.c:1
LocalizedString
Definition: LocalizedString.c:21
BaseContainerProps
SCR_AIGoalReaction_Follow BaseContainerProps
Handles insects that are supposed to be spawned around selected prefabs defined in prefab names array...
Definition: SCR_AIGoalReaction.c:468