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