Esempio n. 1
0
        public static void GatherMenus(MenuManager instance)
        {
            Debug.Log("Adding RA3-Tweaks Menu...");
            MenuMain mainMenu = instance.menus.Where(m => m.name == "MenuMain").Select(m => m.GetComponentInChildren <MenuMain>()).First();

            if (mainMenu != null)
            {
                // Create the new tweaks menu from the asset bundle
                var tweakMenu = AssetsHandler.CreateAsset <GameObject>("MenuTweaks");
                tweakMenu.name = "MenuTweaks";
                tweakMenu.transform.GetChild(0).gameObject.AddComponent <MenuTweaks>();
                instance.AddNewMenu(tweakMenu);

                Debug.Log(mainMenu.mHeaderText.font);

                // Add a button on the main menu to open the tweak options
                var button = AssetsHandler.CreateAsset <Button>("MenuButton");
                button.onClick.AddListener(() =>
                {
                    Debug.Log("Opening Tweaks Menu...");
                    var menuBase       = tweakMenu.GetComponentInChildren <MenuBase>();
                    var gameLogic      = UnityEngine.Object.FindObjectOfType(typeof(GameLogic)) as GameLogic;
                    gameLogic.MainMode = global::GameLogic.MAINMODE.SETTINGS;
                    instance.Pop();
                    bool result = instance.Push("MenuTweaks");
                    Debug.Log(result);
                });

                button.transform.SetParent(mainMenu.transform, false);
            }
        }
Esempio n. 2
0
 void Start()
 {
     Instance = this;
     menuLogin.gameObject.SetActive(true);
     menuPets.gameObject.SetActive(false);
     menuFight.gameObject.SetActive(false);
 }
Esempio n. 3
0
        static void Main()
        {
            do
            {
                MenuMain.PrintMenu();

                switch (Lootbox.GetPressedKey())
                {
                case ConsoleKey.NumPad1 or ConsoleKey.D1:
                    //user space
                    MenuUser.Work();
                    break;

                case ConsoleKey.NumPad2 or ConsoleKey.D2:
                    //admin space
                    MenuAdmin.Work();
                    break;

                case ConsoleKey.Escape:
                    Lootbox.SaveData();
                    return;

                default:
                    break;
                }
            } while (true);
        }
 public ActionResult EditMenuMain()
 {
     try
     {
         Init("cabinet_menu");
         if (id == "")
         {
             return(RedirectToAction("MenuMain", "Cabinet"));
         }
         MenuMain menumain = new MenuMain(this.shared);
         if (id == "Add")
         {
             menumain.SetDefaults();
         }
         else
         {
             menumain.Select(id);
         }
         return(View("MenuMainEdit", menumain));
     }
     catch (Exception ex)
     {
         return(ShowError(ex));
     }
 }
Esempio n. 5
0
        public void callMenuMain()
        {
            MenuMain menuMain = new MenuMain();

            this.Hide();
            menuMain.Show();
        }
 public ActionResult EditMenuMain(MenuMain post)
 {
     try
     {
         Init("cabinet_menu");
         if (id == "")
         {
             return(RedirectToAction("MenuMain", "Cabinet"));
         }
         MenuMain menumain = new MenuMain(this.shared);
         if (id == "Add")
         {
             menumain.SetDefaults();
             menumain.Copy(post);
             menumain.Insert();
         }
         else
         {
             menumain.Select(id);
             if (shared.error.AnyError())
             {
                 return(RedirectToAction("MenuMain", "Cabinet"));
             }
             menumain.Copy(post);
             menumain.Update();
         }
         return(RedirectToAction("MenuMain", "Cabinet"));
     }
     catch (Exception ex)
     {
         return(ShowError(ex));
     }
 }
Esempio n. 7
0
        private void btnBack_Click(object sender, EventArgs e)
        {
            comPort.Close();
            MenuMain menuMain = new MenuMain();

            this.Hide();
            menuMain.Show();
        }
Esempio n. 8
0
        public void callMenuMain()
        {
            Cursor.Current = Cursors.WaitCursor;
            MenuMain menuMain = new MenuMain();

            this.Hide();
            menuMain.Show();
        }
Esempio n. 9
0
 public DataMenus(string folder)
 {
     MenuMain   = MenuMain.GetMenu(folder + "/Menu.txt");
     MenuInput  = MenuInput.GetMenu(folder + "/MenuInput.txt");
     MenuShow   = MenuShow.GetMenu(folder + "/MenuShow.txt");
     MenuSearch = MenuSearch.GetMenu(folder + "/MenuSearch.txt");
     MenuReport = MenuReport.GetMenu(folder + "/MenuReport.txt");
 }
Esempio n. 10
0
        public ActionResult AgileMainTop()
        {
            var model = new MenuMain();

            model.menu         = new MenuModel().GetMenus();
            model.categoryView = new CategoryModel().GetAll();
            return(PartialView(model));
        }
Esempio n. 11
0
 protected override void Initialize()
 {
     _menu           = new MenuMain(this, graphics, "menu/background");
     _menu.RunGame  += this.GameLaunchReady;
     _menu.QuitGame += this.GameQuitRequest;
     _menu.Initialize();
     _level = new Level(this, graphics);
     _level.levelIsFinish += this.LevelFinish;
     base.Initialize();
 }
Esempio n. 12
0
        public DataMenus()
        {
            folder = "../../Data";

            MenuMain   = MenuMain.GetMenu(folder + "/Menu.txt");
            MenuInput  = MenuInput.GetMenu(folder + "/MenuInput.txt");
            MenuShow   = MenuShow.GetMenu(folder + "/MenuShow.txt");
            MenuSearch = MenuSearch.GetMenu(folder + "/MenuSearch.txt");
            MenuReport = MenuReport.GetMenu(folder + "/MenuReport.txt");
        }
Esempio n. 13
0
        public void MainMenu(User user)
        {
            MenuMain userChoice   = 0;
            bool     mainMenuLoop = true;

            while (mainMenuLoop)
            {
                Console.Clear();//RENSAR FÖREGÅENDE MENY FÖR LÄTTARE LÄSNING.

                PointsInformationForUser(user);

                Console.WriteLine($"{Convert.ToInt32(MenuMain.AddWorkout)}. Registrera träning");
                Console.WriteLine($"{Convert.ToInt32(MenuMain.Statistic)}. Statistik");
                Console.WriteLine($"{Convert.ToInt32(MenuMain.Group)}. Grupp");
                Console.WriteLine($"{Convert.ToInt32(MenuMain.User)}. Profil");
                Console.WriteLine($"{Convert.ToInt32(MenuMain.Quit)}. Logga ut");
                Console.Write("Ditt val: ");
                int input = error.TryInt();
                userChoice = (MenuMain)input;



                switch (userChoice)
                {
                case MenuMain.AddWorkout:
                    AddWorkoutInputMenu(user);
                    break;

                case MenuMain.Statistic:
                    StatisticMenu(user);
                    Console.Write("\nTryck valfri tangent för att fortsätta.");
                    Console.ReadKey();
                    break;

                case MenuMain.Group:
                    GroupMenu();
                    break;

                case MenuMain.User:
                    break;

                case MenuMain.Quit:
                    mainMenuLoop = false;
                    break;

                default:
                    Console.Clear();
                    error.ErrorMessage();
                    Console.Write("\nTryck valfri tangent för att fortsätta.");
                    Console.ReadKey();
                    break;
                }
            }
        }
Esempio n. 14
0
        private void ButtonExpand_MouseDown(object sender, MouseButtonEventArgs e)
        {
            //RowStatusStrip.Height = RowStatusStrip.ActualHeight >= 151 ? new GridLength(22) : new GridLength(151);
            //var listBox = ExtendedStatusStripMain.ListBoxStatus;
            //listBox.ScrollIntoView(listBox.Items[listBox.Items.Count-1]);

            FlyoutStatus.IsOpen           = !FlyoutStatus.IsOpen;
            FlyoutStatus.IsHitTestVisible = FlyoutStatus.IsOpen;
            var theme = ThemeManager.DetectAppStyle(Application.Current);

            ListBoxStatus.BorderBrush = (Brush)theme.Item2.Resources["AccentColorBrush"];
            MenuMain.Focus();
        }
 public ActionResult MenuMain()
 {
     try
     {
         Init("cabinet_menu");
         MenuMain menumain = new MenuMain(this.shared);
         menumain.SelectMenuMain();
         return(View(menumain));
     }
     catch (Exception ex)
     {
         return(ShowError(ex));
     }
 }
Esempio n. 16
0
 // UPDATE & DRAW
 public void Update(GameTime gameTime)
 {
     if (reset)
     {
         mainMenu = new MenuMain();
         gameMenu = new MenuGame();
         reset    = false;
     }
     if (activeMenu == "main")
     {
         mainMenu.Update(gameTime);
     }
     else if (activeMenu == "game")
     {
         gameMenu.Update(gameTime);
     }
 }
        internal static void Select()
        {
            int    option;
            string mainNav = NavigationBar.mainNavBar;

            do
            {
                Console.Clear();
                Console.WriteLine($">>{ mainNav }");
                MenuMain.ShowMenu();
                switch (option = ReadOption())
                {
                case 49:
                    PrintKeys();
                    break;

                case 50:
                    PrintDetail.Details();
                    break;

                case 51:
                    OptionSelectionSettings.Select();
                    break;

                case 52:
                    MenuTestKey.ShowMenu();
                    break;

                case 17:
                    Console.WriteLine("Exit to keyboard game.");
                    System.Threading.Thread.Sleep(500);
                    break;

                default:
                    Console.WriteLine("Invalid option.");
                    System.Threading.Thread.Sleep(500);
                    break;
                }
            } while (option != 17);
        }
Esempio n. 18
0
        private void AddControls()
        {
            // taskbar
            taskbar = new Taskbar();
            ctrlMgr.Add(taskbar);

            // menu button
            menuBtn        = new Button(taskbar.x + 2, taskbar.y + 2, "");
            menuBtn.width  = 18;
            menuBtn.height = 18;
            ctrlMgr.Add(menuBtn);

            // menu
            menu = new MenuMain();
            ctrlMgr.Add(menu);

            // time label
            int w = Fonts.FONT_MONO.StringWidth("12:00 AM");

            timeLabel           = new Label(taskbar.width - w - 8, 7, Clock.FormattedTime);
            timeLabel.textColor = Color.white;
            ctrlMgr.Add(timeLabel);
        }
 // Use this for initialization
 void Start()
 {
     this.menuMain = new MenuMain(this, menuMainCamera, menuMainButtonRace, menuMainButtonPractice, menuMainButtonGarage, menuMainButtonTuningShop, menuMainButtonCarDealership, menuMainButtonAbout, menuMainButtonExit);
 }
Esempio n. 20
0
 /// <summary>
 /// При вводе кода регистра в textbox   дабавляем артикул в  DataGrid
 /// </summary>
 private void Grid_KeyUp(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         if (txtRegistrInput.Text != string.Empty)    // валидация textboxa
         {
             if (IsNum(txtRegistrInput.Text))         // валидация textboxa
             {
                 if ((bool)chcFromDocument.IsChecked) // если  check загрузка из документа
                 {
                     // AddNewRowDataGrid(sender, e);
                 }
                 else
                 {
                     if ((bool)chcAutoPrint.IsChecked) // если check автопечать
                     {
                         AddNewRowsInDB();
                         SelectAllPriceList();
                         UpdateCountInDB();
                         PrintAllPriceList();
                     }
                     else
                     {
                         AddNewRowsInDB();
                         SelectAllPriceList();
                     }
                 }
             }
             else
             {
                 MessageBoxResult result = MessageBox.Show(" Не правильно введен код регистра или штрихкод !!! ", "Ошибка ", MessageBoxButton.OK, MessageBoxImage.Warning);
             }
         }
         else
         {
             MessageBoxResult result = MessageBox.Show(" Введите код регистра или штрихкод !!! ", "Ошибка ", MessageBoxButton.OK, MessageBoxImage.Warning);
         }
         txtRegistrInput.Clear();
     }
     if (e.Key == Key.Delete)
     {
         Item item = dgMain.SelectedItem as Item;
         if (item != null)
         {
             DeleteRowFromDB(item.GuiId.ToString());
         }
     }
     if (e.Key == Key.F1) // инструкция
     {
         Instructions instr = new Instructions();
         instr.ShowDialog();
     }
     if (e.Key == Key.F2 && e.KeyboardDevice.Modifiers == ModifierKeys.Control) // Ctr + F2  фокус на textbox
     {
         txtRegistrInput.Focus();
     }
     if (e.Key == Key.F4) // фокус на редактирование в  datagrid
     {
         if (Items.Count > 0)
         {
             dgMain.CurrentCell = new DataGridCellInfo(dgMain.Items[0], dgMain.Columns[2]);
             dgMain.BeginEdit();
         }
     }
     if (e.Key == Key.P && e.KeyboardDevice.Modifiers == ModifierKeys.Control) // Ctr + P печатаем
     {
         txtRegistrInput.Focus();
         btnPrint_Click(sender, e);
     }
     if (e.Key == Key.A && e.KeyboardDevice.Modifiers == ModifierKeys.Control) // Ctr + A снять/ поставить флажек  автопечать
     {
         if ((bool)chcAutoPrint.IsChecked)
         {
             chcAutoPrint.IsChecked = false;
         }
         else
         {
             chcAutoPrint.IsChecked = true;
         }
     }
     if (e.Key == Key.F6) // снять/ поставить флажек загрузить из документа
     {
         if ((bool)chcFromDocument.IsChecked)
         {
             chcFromDocument.IsChecked = false;
         }
         else
         {
             chcFromDocument.IsChecked = true;
         }
     }
     if (e.Key == Key.F7) // фокус на  главное меню
     {
         MenuMain.Focus();
     }
 }
Esempio n. 21
0
 private void ButtonError_MouseDown(object sender, MouseButtonEventArgs e)
 {
     MenuMain.Focus();
 }