private static void Postfix(GauntletClanScreen __instance) { try { Log("GauntletClanScreenCtorPatch"); gauntletClanScreen = __instance; } catch (Exception ex) { Log(ex); } }
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); } } }
public static void Postfix(ref ScreenBase __instance) { GauntletClanScreen gauntletClanScreen = __instance as GauntletClanScreen; bool flag = gauntletClanScreen != null && ClanScreenLayerPatch.screenLayer == null; if (flag) { ClanScreenLayerPatch.screenLayer = new GauntletLayer(100, "GauntletLayer"); //Traverse traverse = Traverse.Create(gauntletClanScreen); //ClanVM value = traverse.Field<ClanVM>("_dataSource").Value; ClanScreenLayerPatch.spouseClanView = new SpouseClanVM(gauntletClanScreen); ClanScreenLayerPatch.screenLayer.LoadMovie("SpouseScreen", ClanScreenLayerPatch.spouseClanView); ClanScreenLayerPatch.screenLayer.InputRestrictions.SetInputRestrictions(true, InputUsageMask.All); gauntletClanScreen.AddLayer(ClanScreenLayerPatch.screenLayer); } }
public SpouseServiceVM(SpouseClanVM parent, GauntletClanScreen parentScreen) { this._parentView = parent; this._parentScreen = parentScreen; this._settingGroups = new MBBindingList <SpouseSettingsGroupVM>(); _spouseSettingGroups = MoreSpouseSetting.Instance.GenerateSettingsProperties(); _spouseSettingGroups.ForEach((obj) => { this._settingGroups.Add(new SpouseSettingsGroupVM(obj)); }); this._spousesBattleStats = new SpousesBattleStatisticVM(this._parentView); RefreshSpouse(); this.RefreshValues(); }
public SpouseClanVM(GauntletClanScreen gauntletClanScreen) { this._parentScreen = gauntletClanScreen; }
public static ClanManagementVM GetClanScreenClanVM() { GauntletClanScreen clanScreenInstance = Utillty.GetClanScreenInstance(); return(clanScreenInstance == null || UIHelper.m_clanScreenGauntletLayerField == (FieldInfo)null ? (ClanManagementVM)null : UIHelper.m_clanScreenClanVMField.GetValue((object)clanScreenInstance) as ClanManagementVM); }
public static GauntletLayer GetClanScreenGauntletLayer() { GauntletClanScreen clanScreenInstance = Utillty.GetClanScreenInstance(); return(clanScreenInstance == null || UIHelper.m_clanScreenGauntletLayerField == (FieldInfo)null ? (GauntletLayer)null : UIHelper.m_clanScreenGauntletLayerField.GetValue((object)clanScreenInstance) as GauntletLayer); }