Exemplo n.º 1
0
        public MainPage()
        {
            InitializeComponent();
            var v_layout = this.FindByName <ContentPage>("B_Image");

            v_layout.SizeChanged += V_layout_SizeChanged;

            if (!Menu_Items.is_sound)
            {
                Menu_Items.Turn_Sound(true);
            }
        }
Exemplo n.º 2
0
        private void ListView_ItemSelected(object sender, SelectedItemChangedEventArgs e)
        {
            var index = menu_Items.IndexOf(e.SelectedItem as Menu_Items);

            if (e.SelectedItem != null)
            {
                Play_Sound();
                if (special_list.Contains(menu_Items[index].text_det))
                {
                    if (menu_Items[index].text_det == "Settings")
                    {
                        Main_Label.Text = menu_Items[index].text_det.ToUpper();
                        menu            = menu_Items[index];

                        if (game == "single")
                        {
                            menu_Items = new List <Menu_Items>();
                            menu_Items.Add(new Menu_Items {
                                image_det = "sound_" + sound + ".png", text_det = "Sound: " + sound
                            });
                            menu_Items.Add(new Menu_Items {
                                image_det = "up_down.png", text_det = "Swap Colours"
                            });
                            menu_Items.Add(new Menu_Items {
                                image_det = "difficulty.png", text_det = "Set Difficulty"
                            });
                            menu_Items.Add(new Menu_Items {
                                image_det = "migrate_score.png", text_det = "Migrate old score"
                            });
                            menu_Items.Add(new Menu_Items {
                                image_det = "theme.png", text_det = "Change Theme", image_next = "more.png"
                            });
                        }
                        else
                        {
                            menu_Items = new List <Menu_Items>();
                            menu_Items.Add(new Menu_Items {
                                image_det = "sound_" + sound + ".png", text_det = "Sound: " + sound
                            });
                            menu_Items.Add(new Menu_Items {
                                image_det = "up_down.png", text_det = "Swap Colours"
                            });
                            menu_Items.Add(new Menu_Items {
                                image_det = "migrate_score.png", text_det = "Migrate old score"
                            });
                            menu_Items.Add(new Menu_Items {
                                image_det = "theme.png", text_det = "Change Theme"
                            });
                        }
                        //listView.SelectedItem = menu;
                    }
                    else if (menu_Items[index].text_det == "Change Theme")
                    {
                        Main_Label.Text = "THEMES";
                        menu            = menu_Items[index];
                        menu_Items      = new List <Menu_Items>();
                        menu_Items.Add(new Menu_Items {
                            image_det = "Chewing_Gum.png", text_det = "Chewing Gum"
                        });
                        menu_Items.Add(new Menu_Items {
                            image_det = "Sun_Flower.png", text_det = "Sunflower"
                        });
                        menu_Items.Add(new Menu_Items {
                            image_det = "Monacco.png", text_det = "Monaco"
                        });
                        menu_Items.Add(new Menu_Items {
                            image_det = "Pacifico.png", text_det = "Pacifico"
                        });
                        menu_Items.Add(new Menu_Items {
                            image_det = "Tsunammi.png", text_det = "Tsunami"
                        });
                    }

                    else if (menu_Items[index].text_det == "Set Difficulty")
                    {
                        menu_Items = new List <Menu_Items>();
                        menu_Items.Add(new Menu_Items {
                            image_det = "easy.png", text_det = "Easy"
                        });
                        menu_Items.Add(new Menu_Items {
                            image_det = "medium.png", text_det = "Medium"
                        });
                        menu_Items.Add(new Menu_Items {
                            image_det = "hard.png", text_det = "Hard"
                        });
                        Main_Label.Text = "Difficulty Level";
                    }
                    else
                    {
                        AddItemCallback(menu_Items[index].text_det);
                        ((ListView)sender).SelectedItem = null;
                    }
                    listView.ItemsSource = menu_Items;
                }
                else
                {
                    if (menu_Items[index].text_det.Contains("Sound"))
                    {
                        if (Menu_Items.is_sound)
                        {
                            Menu_Items.Turn_Sound(false);
                            sound = "no";
                        }
                        else
                        {
                            Play_Sound();
                            Menu_Items.Turn_Sound(true);
                            sound = "yes";
                        }
                        //menu_Items[index].text_det = "Sound: " + sound;
                        //menu_Items[index].image_det = "sound_" + sound + ".png";
                    }
                    AddItemCallback(menu_Items[index].text_det);
                    Navigation.PopPopupAsync();
                }
            }
        }