public override void UpdateGeneralFromEntityBase() { ClassType = ClassType.Character; string dead = Character.MovementState == MyCharacterMovementEnum.Died ? $" | {Res.ClsCharacterDead}" : ""; if (string.IsNullOrEmpty(Character.DisplayName)) { Description = Res.ClsCharacterNPC; DisplayName = Character.CharacterModel + dead; Mass = SpaceEngineersConsts.PlayerMass; // no idea what an npc body weighs. } else { Description = Res.ClsCharacterPlayer; DisplayName = Character.DisplayName + dead; Mass = SpaceEngineersConsts.PlayerMass; } if (Inventory == null) { var inventories = Character.ComponentContainer.GetInventory(); if (inventories.Count > 0) { Inventory = inventories[0]; Mass += Inventory.TotalMass; } else { Inventory = null; } } }
public override void UpdateGeneralFromEntityBase() { ClassType = ClassType.Character; // TODO #21 string dead = Character.MovementState == MyCharacterMovementEnum.Died ? " | dead" : ""; if (string.IsNullOrEmpty(Character.DisplayName)) { // TODO: #21 localize Description = "NPC"; DisplayName = Character.CharacterModel + dead; Mass = SpaceEngineersConsts.PlayerMass; // no idea what a body weighs. } else { // TODO: #21 localize Description = "Player"; DisplayName = Character.DisplayName + dead; Mass = SpaceEngineersConsts.PlayerMass; } if (Inventory == null) { var inventories = Character.ComponentContainer.GetInventory(); if (inventories.Count > 0) { Inventory = inventories[0]; Mass += Inventory.TotalMass; } else { Inventory = null; } } }
public InventoryEditorViewModel(BaseViewModel parentViewModel, InventoryEditorModel dataModel, IDialogService dialogService) : base(parentViewModel) { Contract.Requires(dialogService != null); _dialogService = dialogService; _dataModel = dataModel; Selections = new ObservableCollection<InventoryModel>(); // Will bubble property change events from the Model to the ViewModel. _dataModel.PropertyChanged += (sender, e) => OnPropertyChanged(e.PropertyName); }
public override void UpdateGeneralFromEntityBase() { ClassType = ClassType.Character; Description = "Player"; DisplayName = Character.DisplayName; Mass = SpaceEngineersConsts.PlayerMass; if (Inventory == null) { var inventories = Character.ComponentContainer.GetInventory(); if (inventories.Count > 0) { Inventory = inventories[0]; Mass += Inventory.TotalMass; } else { Inventory = null; } } }
public InventoryEditorViewModel(BaseViewModel parentViewModel, InventoryEditorModel dataModel) : this(parentViewModel, dataModel, ServiceLocator.Resolve<IDialogService>()) { }
public override void UpdateGeneralFromEntityBase() { ClassType = ClassType.Character; Description = "Player"; DisplayName = Character.DisplayName; Mass = SpaceEngineersConsts.PlayerMass; if (Inventory == null) { var inventories = Character.ComponentContainer.GetInventory(); if (inventories.Count > 0) { Inventory = inventories[0]; Mass += Inventory.TotalMass; } else Inventory = null; } }
public override void UpdateGeneralFromEntityBase() { ClassType = ClassType.Character; string dead = Character.MovementState == MyCharacterMovementEnum.Died ? " | dead" : ""; if (string.IsNullOrEmpty(Character.DisplayName)) { Description = "NPC"; DisplayName = Character.CharacterModel + dead; Mass = SpaceEngineersConsts.PlayerMass; // no idea what a body weighs. } else { Description = "Player"; DisplayName = Character.DisplayName + dead; Mass = SpaceEngineersConsts.PlayerMass; } if (Inventory == null) { var inventories = Character.ComponentContainer.GetInventory(); if (inventories.Count > 0) { Inventory = inventories[0]; Mass += Inventory.TotalMass; } else Inventory = null; } }