13 const BaseContainer source = settings.GetComponentSource(owner);
15 const bool vehicleSalvageEnabled = settings.IsVehicleSalvageEnabled();
16 bool vehicleSalvageEnabledDefault =
true;
18 source.Get(
"m_bEnableVehicleSalvage", vehicleSalvageEnabledDefault);
20 const bool entityRefundingActionAllowed = settings.IsEntityRefundingActionAllowed();
21 bool entityRefundingActionAllowedDefault =
true;
23 source.Get(
"m_bAllowEntityRefundingAction", entityRefundingActionAllowedDefault);
25 const bool teamKillingPunished = settings.IsTeamKillingPunished();
26 bool teamKillingPunishedDefault =
true;
28 source.Get(
"m_bEnableTeamKillPunishment", teamKillingPunishedDefault);
30 const bool projectileBallisticInfoVisibility = settings.GetProjectileBallisticInfoVisibility();
31 bool projectileBallisticInfoVisibilityDefault =
true;
33 source.Get(
"m_bProjectileBallisticInfoVisibility", projectileBallisticInfoVisibilityDefault);
35 const SCR_ENametagControllerFilter nametagControllerFilters = settings.GetNametagControllerFilters();
36 SCR_ENametagControllerFilter nametagControllerFiltersDefault = SCR_ENametagControllerFilter.SHOW_AI | SCR_ENametagControllerFilter.SHOW_PLAYERS;
38 source.Get(
"m_eNametagControllerFilters", nametagControllerFiltersDefault);
40 const SCR_ENametagRelationFilter nametagRelationFilters = settings.GetNametagRelationFilters();
41 SCR_ENametagRelationFilter nametagRelationFiltersDefault = SCR_ENametagRelationFilter.SHOW_SAME_FACTION | SCR_ENametagRelationFilter.SHOW_GROUP_MEMBERS | SCR_ENametagRelationFilter.SHOW_MILITARY_ALLIES;
43 source.Get(
"m_eNametagRelationFilters", nametagRelationFiltersDefault);
46 const float fuelConsumptionScale = SCR_FuelConsumptionComponent.GetGlobalFuelConsumptionScale();
47 const float fuelConsumptionScaleDefault = 8.0;
49 if (vehicleSalvageEnabled == vehicleSalvageEnabledDefault &&
50 entityRefundingActionAllowed == entityRefundingActionAllowedDefault &&
51 teamKillingPunished == teamKillingPunishedDefault &&
52 projectileBallisticInfoVisibility == projectileBallisticInfoVisibilityDefault &&
53 nametagControllerFilters == nametagControllerFiltersDefault &&
54 fuelConsumptionScale == fuelConsumptionScaleDefault)
57 context.WriteValue(
"version", 1);
58 context.WriteDefault(vehicleSalvageEnabled, vehicleSalvageEnabledDefault);
59 context.WriteDefault(entityRefundingActionAllowed, entityRefundingActionAllowedDefault);
60 context.WriteDefault(teamKillingPunished, teamKillingPunishedDefault);
61 context.WriteDefault(projectileBallisticInfoVisibility, projectileBallisticInfoVisibilityDefault);
62 context.WriteDefault(nametagControllerFilters, nametagControllerFiltersDefault);
63 context.WriteDefault(nametagRelationFilters, nametagRelationFiltersDefault);
64 context.WriteDefault(fuelConsumptionScale, fuelConsumptionScaleDefault);
74 context.Read(version);
76 bool vehicleSalvageEnabled;
77 if (context.Read(vehicleSalvageEnabled))
78 settings.SetEnableVehicleSalvage_S(vehicleSalvageEnabled);
80 bool entityRefundingActionAllowed;
81 if (context.Read(entityRefundingActionAllowed))
82 settings.SetAllowEntityRefundingAction_S(entityRefundingActionAllowed);
84 bool teamKillingPunished;
85 if (context.Read(teamKillingPunished))
86 settings.SetEnableTeamKillPunishment_S(teamKillingPunished);
88 bool projectileBallisticInfoVisibility;
89 if (context.Read(projectileBallisticInfoVisibility))
90 settings.SetProjectileBallisticInfoVisibility_S(projectileBallisticInfoVisibility);
92 SCR_ENametagControllerFilter nametagControllerFilters;
93 if (context.Read(nametagControllerFilters))
94 settings.SetNametagControllerFilters(nametagControllerFilters);
96 SCR_ENametagControllerFilter nametagRelationFilters;
97 if (context.Read(nametagRelationFilters))
98 settings.SetNametagRelationFilters(nametagRelationFilters);
100 float fuelConsumptionScale;
101 if (context.Read(fuelConsumptionScale))
102 SCR_FuelConsumptionComponent.SetGlobalFuelConsumptionScale(fuelConsumptionScale);