private void DoBulletDamage(PanelWidget widget) { var slider = (NumericHorizontalSlider) widget; var command = new EditorPlayerCommand("AddOrRemoveBulletDamage") { BulletDamage = slider.Value / 10f, Owner = CurrentOpenedPanelPlayer }; NotifyEditorCommandExecuted(command); }
private void DoLifePacks(PanelWidget widget) { var slider = (NumericHorizontalSlider) widget; var command = new EditorPlayerCommand("AddOrRemoveLifePacks") { LifePacks = slider.Value, Owner = CurrentOpenedPanelPlayer }; NotifyEditorCommandExecuted(command); }
private void DoEditorPlayerCommand(EditorPlayerCommand command) { if (command.Name == "AddOrRemoveLives") { CommonStash.Lives = command.LifePoints; if (CelestialBodyToProtect != null) CelestialBodyToProtect.LifePoints = command.LifePoints; } else if (command.Name == "AddOrRemoveCash") { CommonStash.Cash = command.Cash; } else if (command.Name == "AddOrRemoveMinerals") { Level.Minerals = command.Minerals; } else if (command.Name == "AddOrRemoveLifePacks") { Level.LifePacks = command.LifePacks; } else if (command.Name == "AddOrRemoveBulletDamage") { Level.SaveBulletDamage = true; Level.BulletDamage = command.BulletDamage; } }