Example #1
0
 private void OnClanSelection(KingdomClanItemVM clan)
 {
     if (this._currentSelectedClan != clan)
     {
         this.SetCurrentSelectedClan(clan);
     }
 }
 public override int Compare(KingdomClanItemVM x, KingdomClanItemVM y)
 {
     if (this._isAcending)
     {
         return(y.Fiefs.Count.CompareTo(x.Fiefs.Count) * -1);
     }
     return(y.Fiefs.Count.CompareTo(x.Fiefs.Count));
 }
 public override int Compare(KingdomClanItemVM x, KingdomClanItemVM y)
 {
     if (this._isAcending)
     {
         return(y.Influence.CompareTo(x.Influence) * -1);
     }
     return(y.Influence.CompareTo(x.Influence));
 }
 public override int Compare(KingdomClanItemVM x, KingdomClanItemVM y)
 {
     if (this._isAcending)
     {
         return(y.Clan.Name.ToString().CompareTo(x.Clan.Name.ToString()) * -1);
     }
     return(y.Clan.Name.ToString().CompareTo(x.Clan.Name.ToString()));
 }
 public override int Compare(KingdomClanItemVM x, KingdomClanItemVM y)
 {
     if (this._isAcending)
     {
         return(y.Clan.Kingdom.StringId.CompareTo(x.Clan.Kingdom.StringId) * -1);
     }
     return(y.Clan.Kingdom.StringId.CompareTo(x.Clan.Kingdom.StringId));
 }
Example #6
0
        private void SetCurrentSelectedClan(KingdomClanItemVM clan)
        {
            if (clan != this.CurrentSelectedClan)
            {
                if (this.CurrentSelectedClan != null)
                {
                    this.CurrentSelectedClan.IsSelected = false;
                }
                this.CurrentSelectedClan            = clan;
                this.CurrentSelectedClan.IsSelected = true;

                base.IsAcceptableItemSelected = (this.CurrentSelectedClan != null);

                RefreshCompanionSelector();
            }
        }
 public static void SetCurrentSelectedClanPatch(KingdomClanItemVM clan, KingdomClanVM __instance)
 {
     try
     {
         if (SettingsHelper.SubSystemEnabled(SubSystemType.ElectionCooldownsForPlayer))
         {
             bool HasCooldown = AOCooldownManager.HasDecisionCooldown(new ExpelClanFromKingdomDecision(Clan.PlayerClan, clan.Clan), out float elapsedDaysUntilNow);
             __instance.CanExpelCurrentClan         = __instance.CanExpelCurrentClan && !HasCooldown;
             __instance.ExpelActionExplanationText += HasCooldown ? "\n" + StringHelper.GetCooldownText(typeof(ExpelClanFromKingdomDecision), elapsedDaysUntilNow).ToString() : string.Empty;
         }
     }
     catch (Exception ex)
     {
         MethodInfo?methodInfo = MethodBase.GetCurrentMethod() as MethodInfo;
         DebugHelper.HandleException(ex, methodInfo, "Harmony patch for KingdomClanVM. SetCurrentSelectedClan");
     }
 }