Example #1
0
        public new void OnFinalize()
        {
            _partyScreenLogic.AfterReset -= AfterReset;
            _partyScreenLogic.Update     -= UpdateLabel;
            PartyScreenConfig.ExtraSettings.PropertyChanged -= OnEnableChange;

            _unitTallyVm.OnFinalize();
            _recruitPrisonerVm.OnFinalize();
            _upgradeTroopsVM.OnFinalize();
            _sortTroopsVM.OnFinalize();

            _unitTallyVm       = null;
            _recruitPrisonerVm = null;
            _upgradeTroopsVM   = null;
            _sortTroopsVM      = null;
        }
Example #2
0
        public PartyEnhancementsVM(PartyVM partyVM, PartyScreenLogic partyScreenLogic, GauntletPartyScreen parentScreen)
        {
            _partyVM          = partyVM;
            _partyScreenLogic = partyScreenLogic;
            _parentScreen     = parentScreen;
            _settingsHint     = new HintViewModel(new TextObject("PSE Settings"));

            _sortTroopsVM      = new SortAllTroopsVM(_partyVM, _partyScreenLogic);
            _upgradeTroopsVM   = new UpgradeAllTroopsVM(this, _partyVM, _partyScreenLogic);
            _recruitPrisonerVm = new RecruitPrisonerVM(this, _partyVM, _partyScreenLogic);
            _unitTallyVm       = new UnitTallyVM(partyVM.MainPartyTroops, partyVM.OtherPartyTroops, partyScreenLogic, _partyScreenLogic?.LeftOwnerParty?.MobileParty?.IsGarrison ?? false);
            _transferWounded   = new TransferWoundedTroopsVM(this, partyVM, _partyScreenLogic?.LeftOwnerParty?.MobileParty?.IsGarrison ?? false);

            _partyScreenLogic.AfterReset += AfterReset;
            _partyScreenLogic.Update     += UpdateLabel;
            PartyScreenConfig.ExtraSettings.PropertyChanged += OnEnableChange;

            RefreshValues();
            UpdateLabel(null);
        }