140 {
141 PluginDeveloperSync developerSync = PluginDeveloperSync.Cast(
GetPlugin(PluginDeveloperSync));
142 int valuesCount = developerSync.m_PlayerStatsSynced.Count();
143 if (valuesCount > 0)
144 {
145 foreach (int i, SyncedValue syncedValue : developerSync.m_PlayerStatsSynced)
146 {
147 string statName = syncedValue.
GetName();
149 float value = syncedValue.
GetValue();
150
151 if ( statName == "BloodType" )
152 {
154 bool positive;
155
157 name +=
"("+BloodTypes.GetBloodTypeName(Math.Round(value), type, positive)+
")";
159 }
160 else
161 {
162 if (statName == "HeatBuffer")
163 {
164 float heatBufferNormalized = Math.Round(Math.Lerp(-1, 1, valueNormalized) * 1000) * 0.001;
166 }
167 else
169
170 }
171
173 m_SliderWidgets.GetKeyByValue(statName).SetCurrent(valueNormalized * 100);
174 }
175 }
176 }
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PluginBase GetPlugin(typename plugin_type)
ref array< TextWidget > m_StatValues
ref map< SliderWidget, string > m_SliderWidgets
proto string ToString(bool simple=true)