Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_CampaignBuildingRefreshUIComponent.c
Go to the documentation of this file.
1 class SCR_CampaignBuildingRefreshUIComponent : ScriptedWidgetComponent
2 {
3  //------------------------------------------------------------------------------------------------
4  override void HandlerAttached(Widget w)
5  {
7  if (!pagUIComp)
8  return;
9 
10  SCR_CampaignBuildingEditorComponent buildingEditorComponent = SCR_CampaignBuildingEditorComponent.Cast(SCR_CampaignBuildingEditorComponent.GetInstance(SCR_CampaignBuildingEditorComponent));
11  if (!buildingEditorComponent)
12  return;
13 
14  IEntity provider = buildingEditorComponent.GetProviderEntity();
15  if (!provider)
16  return;
17 
18  SCR_ResourceComponent resourceComponent = SCR_ResourceComponent.Cast(provider.FindComponent(SCR_ResourceComponent));
19  if (!resourceComponent)
20  return;
21 
22  resourceComponent.TEMP_GetOnInteractorReplicated().Insert(pagUIComp.RefreshPage);
23 
24  SCR_CampaignBuildingProviderComponent providerComponent = SCR_CampaignBuildingProviderComponent.Cast(provider.FindComponent(SCR_CampaignBuildingProviderComponent));
25  if (!providerComponent)
26  return;
27 
28  providerComponent.GetOnCooldownLockUpdated().Insert(pagUIComp.RefreshPage);
29 
30  SCR_MilitaryBaseComponent base = providerComponent.GetMilitaryBaseComponent();
31  if (!base)
32  return;
33 
34  base.GetOnServiceRegistered().Insert(pagUIComp.RefreshPage);
35  }
36 
37  //------------------------------------------------------------------------------------------------
38  override void HandlerDeattached(Widget w)
39  {
41  if (!pagUIComp)
42  return;
43 
44  SCR_CampaignBuildingEditorComponent buildingEditorComponent = SCR_CampaignBuildingEditorComponent.Cast(SCR_CampaignBuildingEditorComponent.GetInstance(SCR_CampaignBuildingEditorComponent));
45  if (!buildingEditorComponent)
46  return;
47 
48  IEntity provider = buildingEditorComponent.GetProviderEntity();
49  if (!provider)
50  return;
51 
52  SCR_ResourceComponent resourceComponent = SCR_ResourceComponent.Cast(provider.FindComponent(SCR_ResourceComponent));
53  if (!resourceComponent)
54  return;
55 
56  resourceComponent.TEMP_GetOnInteractorReplicated().Remove(pagUIComp.RefreshPage);
57 
58  SCR_CampaignBuildingProviderComponent providerComponent = SCR_CampaignBuildingProviderComponent.Cast(provider.FindComponent(SCR_CampaignBuildingProviderComponent));
59  if (!providerComponent)
60  return;
61 
62  providerComponent.GetOnCooldownLockUpdated().Remove(pagUIComp.RefreshPage);
63 
64  SCR_MilitaryBaseComponent base = providerComponent.GetMilitaryBaseComponent();
65  if (!base)
66  return;
67 
68  base.GetOnServiceRegistered().Remove(pagUIComp.RefreshPage);
69  }
70 }
SCR_ExternalPaginationUIComponent
Definition: SCR_ExternalPaginationUIComponent.c:1
SCR_CampaignBuildingRefreshUIComponent
Definition: SCR_CampaignBuildingRefreshUIComponent.c:1