예제 #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();
        }
예제 #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();
 }
예제 #3
0
 private void SkillsDictionaryPairSetHandler(
     NetworkSyncDictionary <IProtoSkill, SkillLevelData> source,
     IProtoSkill key,
     SkillLevelData value)
 {
     // new skill added
     this.RegisterSkill(key, value, isInitial: false);
     this.OnSkillsChanged();
 }
예제 #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);
            }
        }
예제 #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();
        }
예제 #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();
        }
예제 #7
0
 private void AccessRightsAnyModificationHandler(
     NetworkSyncDictionary <FactionMemberRole, FactionMemberAccessRights> source)
 {
     this.Refresh();
 }