public RecruiterHook(UIContext context) : base(context)
        {
            if (ScreenManager.TopScreen is GauntletClanScreen)
            {
                GauntletClanScreen screen = (GauntletClanScreen)ScreenManager.TopScreen;
                ClanVM             clanVM = (ClanVM)screen.GetField("_dataSource");

                foreach (PartyBase recruiter in Hero.MainHero.OwnedParties.Where(party => party.Name.ToString().EndsWith("Recruiter")))
                {
                    ClanPartyItemVM partyItem = new ClanPartyItemVM(recruiter, null, null);
                    partyItem.PartyLocationText = "Travelling to " + recruiter.MobileParty.TargetSettlement;
                    partyItem.PartyMoraleText   = recruiter.MobileParty.PartyTradeGold + "G";
                    clanVM.ClanParties.Garrisons.Add(partyItem);
                }
            }
        }
Example #2
0
 private static bool canManageTroops(ClanPartyItemVM p)
 {
     if (p != null && p.Party != null && p.Party.MobileParty != null && Settings.Instance.ManageTroops)
     {
         if (p.Party.MobileParty.IsGarrison)
         {
             return(Settings.Instance.ManageGarrisons);
         }
         else if (p.Party.MobileParty.IsCaravan)
         {
             return(Settings.Instance.ManageCaravans);
         }
         else if (p.Party.MobileParty.LeaderHero != Hero.MainHero)
         {
             return(Settings.Instance.ManageParties);
         }
     }
     return(false);
 }