Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_BuildingCostMultiplierEditorAttribute.c
Go to the documentation of this file.
1 /*
2 The multiplier of building cost
3 */
4 /*[BaseContainerProps(), SCR_BaseEditorAttributeCustomTitle()]
5 class SCR_BuildingCostMultiplierEditorAttribute : SCR_BaseValueListEditorAttribute
6 {
7  override SCR_BaseEditorAttributeVar ReadVariable(Managed item, SCR_AttributesManagerEditorComponent manager)
8  {
9  //If opened in global attributes
10  if (!IsGameMode(item))
11  return null;
12 
13  SCR_CampaignBuildingManagerEntity buildingManagerEnt = SCR_CampaignBuildingManagerEntity.GetInstance();
14  if (!buildingManagerEnt) return null;
15 
16  float value = buildingManagerEnt.GetCostMultiplier();
17 
18  return SCR_BaseEditorAttributeVar.CreateFloat(value);
19  }
20  override void WriteVariable(Managed item, SCR_BaseEditorAttributeVar var, SCR_AttributesManagerEditorComponent manager, int playerID)
21  {
22  if (!var) return;
23 
24  SCR_CampaignBuildingManagerEntity buildingManagerEnt = SCR_CampaignBuildingManagerEntity.GetInstance();
25  if (!buildingManagerEnt) return;
26 
27  float value = var.GetFloat();
28  buildingManagerEnt.SetCostMultiplier(value);
29  }
30 };*/