Exemple #1
0
        public static void ServerSetOrigin(ICharacter character, ProtoCharacterOrigin origin)
        {
            var privateState = PlayerCharacter.GetPrivateState(character);

            privateState.Origin = origin;
            privateState.SetFinalStatsCacheIsDirty();
        }
        public string Execute(ProtoCharacterOrigin origin, [CurrentCharacterIfNull] ICharacter player = null)
        {
            var privateState = PlayerCharacter.GetPrivateState(player);

            privateState.Origin = origin;
            privateState.SetFinalStatsCacheIsDirty();
            return(player + " origin changed to " + origin.ShortId);
        }
Exemple #3
0
        private void ServerRemote_SelectOrigin(ProtoCharacterOrigin origin)
        {
            Api.Assert(origin is not null, "No origin provided");

            var character    = ServerRemoteContext.Character;
            var privateState = PlayerCharacter.GetPrivateState(character);

            Api.Assert(privateState.Origin is null, "Origin already selected, cannot change it");

            ServerSetOrigin(character, origin);
            ServerSpawnIfReady(character);
        }
Exemple #4
0
        public ViewModelWindowInventory(FrameworkElement controlSkeletonView = null)
        {
            if (IsDesignTime)
            {
                return;
            }

            this.character          = ClientCurrentCharacterHelper.Character;
            this.ContainerInventory = (IClientItemsContainer)this.character.SharedGetPlayerContainerInventory();
            this.ContainerEquipment = (IClientItemsContainer)this.character.SharedGetPlayerContainerEquipment();
            this.containerHand      = (IClientItemsContainer)this.character.SharedGetPlayerContainerHand();

            this.InventorySkeleton.CurrentCharacter = this.character;
            this.InventorySkeleton.Control          = controlSkeletonView;

            this.DefenseStats.CurrentCharacter = this.character;

            var publicState = ClientCurrentCharacterHelper.PublicState;

            this.isHeadEquipmentDisplayed = publicState.IsHeadEquipmentHiddenForSelfAndPartyMembers;

            var privateState = ClientCurrentCharacterHelper.PrivateState;

            this.protoOrigin = privateState.Origin;

            privateState.ClientSubscribe(
                _ => _.Origin,
                _ =>
            {
                this.protoOrigin = privateState.Origin;
                this.NotifyPropertyChanged(nameof(this.OriginTitle));
                this.NotifyPropertyChanged(nameof(this.OriginDescription));
                this.NotifyPropertyChanged(nameof(this.OriginIcon));
                this.NotifyPropertyChanged(nameof(this.OriginStatsDictionary));
            },
                this);
        }
Exemple #5
0
 public static void ClientSelectOrigin(ProtoCharacterOrigin origin)
 {
     Instance.CallServer(_ => _.ServerRemote_SelectOrigin(origin));
 }
Exemple #6
0
 public DataEntryCharacterOrigin(ProtoCharacterOrigin protoCharacterOrigin)
 {
     this.ProtoCharacterOrigin = protoCharacterOrigin;
 }