4 override void HandlerAttached(Widget w)
10 SCR_CampaignBuildingEditorComponent buildingEditorComponent = SCR_CampaignBuildingEditorComponent.Cast(SCR_CampaignBuildingEditorComponent.GetInstance(SCR_CampaignBuildingEditorComponent));
11 if (!buildingEditorComponent)
14 IEntity provider = buildingEditorComponent.GetProviderEntity();
18 SCR_ResourceComponent resourceComponent = SCR_ResourceComponent.Cast(provider.FindComponent(SCR_ResourceComponent));
19 if (!resourceComponent)
22 resourceComponent.TEMP_GetOnInteractorReplicated().Insert(pagUIComp.RefreshPage);
24 SCR_CampaignBuildingProviderComponent providerComponent = SCR_CampaignBuildingProviderComponent.Cast(provider.FindComponent(SCR_CampaignBuildingProviderComponent));
25 if (!providerComponent)
28 providerComponent.GetOnCooldownLockUpdated().Insert(pagUIComp.RefreshPage);
30 SCR_MilitaryBaseComponent base = providerComponent.GetMilitaryBaseComponent();
34 base.GetOnServiceRegistered().Insert(pagUIComp.RefreshPage);
38 override void HandlerDeattached(Widget w)
44 SCR_CampaignBuildingEditorComponent buildingEditorComponent = SCR_CampaignBuildingEditorComponent.Cast(SCR_CampaignBuildingEditorComponent.GetInstance(SCR_CampaignBuildingEditorComponent));
45 if (!buildingEditorComponent)
48 IEntity provider = buildingEditorComponent.GetProviderEntity();
52 SCR_ResourceComponent resourceComponent = SCR_ResourceComponent.Cast(provider.FindComponent(SCR_ResourceComponent));
53 if (!resourceComponent)
56 resourceComponent.TEMP_GetOnInteractorReplicated().Remove(pagUIComp.RefreshPage);
58 SCR_CampaignBuildingProviderComponent providerComponent = SCR_CampaignBuildingProviderComponent.Cast(provider.FindComponent(SCR_CampaignBuildingProviderComponent));
59 if (!providerComponent)
62 providerComponent.GetOnCooldownLockUpdated().Remove(pagUIComp.RefreshPage);
64 SCR_MilitaryBaseComponent base = providerComponent.GetMilitaryBaseComponent();
68 base.GetOnServiceRegistered().Remove(pagUIComp.RefreshPage);