internal CustomPack(IPluginPack pluginPack) { this.OriginalPlugInPack = pluginPack; _customBattery = new CustomBattery(pluginPack.BatteryID) { PluginPackName = pluginPack.PluginPackName, FriendlyName = pluginPack.BatteryName, Description = pluginPack.BatteryFlavorText, PowerCapacity = pluginPack.BatteryCapacity, RequiredForUnlock = pluginPack.UnlocksWith, Parts = pluginPack.BatteryParts }; _customPowerCell = new CustomPowerCell(pluginPack.PowerCellID, _customBattery) { PluginPackName = pluginPack.PluginPackName, FriendlyName = pluginPack.PowerCellName, Description = pluginPack.PowerCellFlavorText, PowerCapacity = pluginPack.BatteryCapacity * 2f, // Power Cell capacity is always 2x the battery capacity RequiredForUnlock = pluginPack.UnlocksWith, Parts = pluginPack.PowerCellAdditionalParts }; }
internal CustomPack(IPluginPack pluginPack, bool ionCellSkins, bool customSkin) { this.OriginalPlugInPack = pluginPack; this.UsingIonCellSkins = ionCellSkins; this.UsingCustomTextures = customSkin; _customBattery = new CustomBattery(pluginPack.BatteryID, ionCellSkins) { PluginPackName = pluginPack.PluginPackName, FriendlyName = pluginPack.BatteryName, Description = pluginPack.BatteryFlavorText, PowerCapacity = pluginPack.BatteryCapacity, RequiredForUnlock = pluginPack.UnlocksWith, Parts = pluginPack.BatteryParts }; _customPowerCell = new CustomPowerCell(pluginPack.PowerCellID, ionCellSkins, _customBattery) { PluginPackName = pluginPack.PluginPackName, FriendlyName = pluginPack.PowerCellName, Description = pluginPack.PowerCellFlavorText, PowerCapacity = pluginPack.BatteryCapacity * 2f, // Power Cell capacity is always 2x the battery capacity RequiredForUnlock = pluginPack.UnlocksWith, Parts = pluginPack.PowerCellAdditionalParts }; }
private void InstallPreset(CustomBattery customBattery) { m_isInstallingPreset = true; for (var i = 0; i < customBattery.Data.Length; i++) { var data = customBattery.Data[i]; var group = m_curveControls[i]; var percents = Math.Max(MinPrc, Math.Min(data.Percents, MaxPrc)); var voltage = Math.Max(MinVolts, Math.Min(data.Voltage / 100m, MaxVolts)); group.PercentsUpDown.Minimum = MinPrc; group.PercentsUpDown.Maximum = MaxPrc; group.PercentsUpDown.Value = percents; group.VoltsUpDown.Minimum = MinVolts; group.VoltsUpDown.Maximum = MaxVolts; group.VoltsUpDown.Value = voltage; } m_isInstallingPreset = false; UpdatePointsMinMax(); }