Exemplo n.º 1
0
        public ViewModelWindowSkills()
        {
            if (IsDesignTime)
            {
                this.SkillCategories = this.GenerateDesignTimeCategories();
                this.selectedSkill   = this.SkillCategories[0].Skills[0];
                return;
            }

            this.skillsDictionary = Client.Characters.CurrentPlayerCharacter.SharedGetSkills().Skills;
            this.skillsDictionary.ClientPairSet         += this.SkillsDictionaryPairSetHandler;
            this.skillsDictionary.ClientPairRemoved     += this.SkillsDictionaryPairRemovedHandler;
            this.skillsDictionary.ClientDictionaryClear += this.SkillsDictionaryDictionaryClearHandler;
            var skillCategories = Api.FindProtoEntities <ProtoSkillCategory>()
                                  .OrderBy(c => c.Order)
                                  .Select(
                c => new ViewModelSkillCategory(c)
            {
                OnVisibilityChanged = this.SkillCategoryVisibilityChangedHandler
            });

            //// uncomment to test scrollbar
            //skillCategories = skillCategories.Concat(skillCategories);

            this.SkillCategories  = skillCategories.ToList();
            this.SkillsCountTotal = Api.FindProtoEntities <IProtoSkill>().Count;
            this.RefreshSkillsList();
        }
Exemplo n.º 2
0
 private void SkillsDictionaryClientPairRemoved(
     NetworkSyncDictionary <IProtoSkill, SkillLevelData> source,
     IProtoSkill key)
 {
     // this method might be called only in the editor mode or when the character is wiped
     // during normal play it's not possible as skill entries only added (and their exp gained)
     this.OnSkillsChanged();
 }
Exemplo n.º 3
0
 private void SkillsDictionaryPairSetHandler(
     NetworkSyncDictionary <IProtoSkill, SkillLevelData> source,
     IProtoSkill key,
     SkillLevelData value)
 {
     // new skill added
     this.RegisterSkill(key, value, isInitial: false);
     this.OnSkillsChanged();
 }
Exemplo n.º 4
0
        public void Setup(PlayerCharacterPrivateState privateState)
        {
            this.privateState     = privateState;
            this.skillsDictionary = privateState.Skills.Skills;
            this.skillsDictionary.ClientPairSet     += this.SkillsDictionaryPairSetHandler;
            this.skillsDictionary.ClientPairRemoved += this.SkillsDictionaryClientPairRemoved;

            foreach (var pair in this.skillsDictionary)
            {
                this.RegisterSkill(pair.Key, pair.Value, isInitial: true);
            }
        }
Exemplo n.º 5
0
        public ViewModelFactionDiplomacyListControl(FactionDiplomacyStatus diplomacyStatusFilter)
        {
            this.diplomacyStatusFilter = diplomacyStatusFilter;

            this.source = Faction.GetPrivateState(FactionSystem.ClientCurrentFaction)
                          .FactionDiplomacyStatuses;

            this.source.ClientPairSet         += this.SourcePairSetHandler;
            this.source.ClientPairRemoved     += this.SourcePairRemovedHandler;
            this.source.ClientDictionaryClear += this.SourceDictionaryClearHandler;

            this.RebuildList();
        }
Exemplo n.º 6
0
        public ViewModelFactionAllianceRequestsListControl(bool isIncomingRequests)
        {
            var factionPrivateState = Faction.GetPrivateState(FactionSystem.ClientCurrentFaction);

            this.source = isIncomingRequests
                              ? factionPrivateState.IncomingFactionAllianceRequests
                              : factionPrivateState.OutgoingFactionAllianceRequests;

            this.source.ClientPairSet         += this.SourcePairSetHandler;
            this.source.ClientPairRemoved     += this.SourcePairRemovedHandler;
            this.source.ClientDictionaryClear += this.SourceDictionaryClearHandler;

            this.RebuildList();
        }
Exemplo n.º 7
0
 private void AccessRightsAnyModificationHandler(
     NetworkSyncDictionary <FactionMemberRole, FactionMemberAccessRights> source)
 {
     this.Refresh();
 }