Esempio n. 1
0
        protected override void OnUpdate(float dt)
        {
            base.OnUpdate(dt);
            if (this.IsEnabled != EquipBestItemViewModel.IsEquipAllButtonEnabled)
            {
                this.IsEnabled = EquipBestItemViewModel.IsEquipAllButtonEnabled;
            }

            if (this.Children[0].IsDisabled != this.IsDisabled)
            {
                this.Children[0].IsDisabled = this.IsDisabled;
            }

            if (EquipBestItemViewModel.IsEquipAllActivated)
            {
                EquipBestItemViewModel.EquipAll();
            }

            if (EquipBestItemViewModel.IsAllBestItemsNull())
            {
                if (EquipBestItemViewModel.IsEquipAllActivated)
                {
                    EquipBestItemViewModel.IsEquipAllActivated = false;
                    EquipBestItemViewModel.UpdateValues();
                }
            }
        }
        protected override void OnClick()
        {
            if (this.Id == "EquipBestItemHelmButton" && this.IsEnabled)
            {
                EquipBestItemViewModel.EquipBestHelm();
            }
            if (this.Id == "EquipBestItemCloakButton" && this.IsEnabled)
            {
                EquipBestItemViewModel.EquipBestCloak();
            }
            if (this.Id == "EquipBestItemArmorButton" && this.IsEnabled)
            {
                EquipBestItemViewModel.EquipBestArmor();
            }
            if (this.Id == "EquipBestItemGloveButton" && this.IsEnabled)
            {
                EquipBestItemViewModel.EquipBestGlove();
            }
            if (this.Id == "EquipBestItemBootButton" && this.IsEnabled)
            {
                EquipBestItemViewModel.EquipBestBoot();
            }
            if (this.Id == "EquipBestItemMountButton" && this.IsEnabled)
            {
                EquipBestItemViewModel.EquipBestMount();
            }
            if (this.Id == "EquipBestItemHarnessButton" && this.IsEnabled)
            {
                EquipBestItemViewModel.EquipBestHarness();
            }
            if (this.Id == "EquipBestItemWeapon1Button" && this.IsEnabled)
            {
                EquipBestItemViewModel.EquipBestWeapon1();
            }
            if (this.Id == "EquipBestItemWeapon2Button" && this.IsEnabled)
            {
                EquipBestItemViewModel.EquipBestWeapon2();
            }
            if (this.Id == "EquipBestItemWeapon3Button" && this.IsEnabled)
            {
                EquipBestItemViewModel.EquipBestWeapon3();
            }
            if (this.Id == "EquipBestItemWeapon4Button" && this.IsEnabled)
            {
                EquipBestItemViewModel.EquipBestWeapon4();
            }

            //EquipBestItemViewModel.UpdateValues();



            //InformationManager.DisplayMessage(new InformationMessage(this.Id + " OnClick() " + Game.Current.ApplicationTime.ToString()));
        }
Esempio n. 3
0
        protected override void OnLateUpdate(float dt)
        {
            base.OnLateUpdate(dt);

            _leftMouseButtonStatus = Input.IsKeyReleased(InputKey.LeftMouseButton);

            _firstUpdateState = StateChanged();

            if (_delay == 1)
            {
                EquipBestItemViewModel.UpdateCurrentCharacterName();
                EquipBestItemViewModel.UpdateValues();
            }
        }
Esempio n. 4
0
        private void AddNewInventoryLayer(TutorialContextChangedEvent tutorialContextChangedEvent)
        {
            try
            {
                if (tutorialContextChangedEvent.NewContext == TutorialContexts.InventoryScreen)
                {
                    if (ScreenManager.TopScreen is InventoryGauntletScreen)
                    {
                        EquipBestItemViewModel.InventoryScreen = ScreenManager.TopScreen as InventoryGauntletScreen;
                        _viewModel          = new EquipBestItemViewModel();
                        this._gauntletLayer = new GauntletLayer(1000, "GauntletLayer");
                        this._gauntletLayer.LoadMovie("EBIInventory", _viewModel);
                        EquipBestItemViewModel.InventoryScreen.AddLayer(this._gauntletLayer);
                        this._gauntletLayer.InputRestrictions.SetInputRestrictions(true, InputUsageMask.All);

                        _filterLayer               = new FilterLayer(1001, "GauntletLayer");
                        _filterViewModel           = new FilterViewModel();
                        this._gauntletFiltersLayer = new GauntletLayer(1001, "GauntletLayer");
                        this._gauntletFiltersLayer.LoadMovie("FiltersLayer", _filterViewModel);
                        EquipBestItemViewModel.InventoryScreen.AddLayer(this._filterLayer);
                        this._filterLayer.InputRestrictions.SetInputRestrictions(true, InputUsageMask.All);
                    }

                    //Temporarily disabled clearing settings file for characters
                    //foreach (CharacterSettings charSettings in SettingsLoader.Instance.CharacterSettings.ToList())
                    //{
                    //    bool flag = false;
                    //    foreach (TroopRosterElement element in EquipBestItemViewModel._inventory.TroopRoster)
                    //    {
                    //        if (charSettings.Name == element.Character.Name.ToString())
                    //        {
                    //            flag = true;
                    //            break;
                    //        }
                    //    }
                    //    if (!flag)
                    //    {
                    //        SettingsLoader.Instance.CharacterSettings.Remove(charSettings);
                    //    }
                    //}
                }
                else
                {
                    if (tutorialContextChangedEvent.NewContext == TutorialContexts.None)
                    {
                        if (EquipBestItemViewModel.InventoryScreen != null && this._gauntletLayer != null)
                        {
                            EquipBestItemViewModel.InventoryScreen.RemoveLayer(this._gauntletLayer);
                            this._gauntletLayer = null;
                            SettingsLoader.Instance.SaveSettings();
                            SettingsLoader.Instance.SaveCharacterSettings();
                        }

                        if (EquipBestItemViewModel.InventoryScreen != null && this._filterLayer != null)
                        {
                            EquipBestItemViewModel.InventoryScreen.RemoveLayer(this._filterLayer);
                            this._filterLayer = null;
                        }
                    }
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }
        }