// Show the modal for monsters private async void ShowModalPageMonsterList() { // When you want to show the modal page, just call this method // add the event handler for to listen for the modal popping event: WDown.App.Current.ModalPopping += HandleModalPopping; _myModalBattleMonsterListPage = new BattleMonsterListPage(); await Navigation.PushModalAsync(_myModalBattleMonsterListPage); }
private void HandleModalPopping(object sender, ModalPoppingEventArgs e) { if (e.Modal == _myModalBattleMonsterListPage) { DrawGameBoardAttackerDefender(); StartGameSetting(); RefreshMonsters(); RefreshCharacters(); _myModalBattleMonsterListPage = null; // remember to remove the event handler WDown.App.Current.ModalPopping -= HandleModalPopping; } if (e.Modal == _myModalCharacterSelectPage) { _myModalCharacterSelectPage = null; // remember to remove the event handler WDown.App.Current.ModalPopping -= HandleModalPopping; } if (e.Modal == _myModalUseItemPage) { _myModalUseItemPage = null; WDown.App.Current.ModalPopping -= HandleModalPopping; localMessages = "Character Healed!!"; //refresh curr player stats //cannot attack or rest AttackButton.IsEnabled = false; RestButton.IsEnabled = false; GameNextButton.IsEnabled = true; DrawGameBoardAttackerDefender(); ItemPool.IsEnabled = false; } if (e.Modal == _myModalItemPoolPage) { _myModalUseItemPage = null; WDown.App.Current.ModalPopping -= HandleModalPopping; localMessages = "Items Equipped! "; //refresh currPlayer stats DrawGameBoardAttackerDefender(); //cannot attack or rest AttackButton.IsEnabled = false; RestButton.IsEnabled = false; GameNextButton.IsEnabled = true; //refresh DrawGameBoardAttackerDefender(); } }