Example #1
0
    void Controls()
    {
        GUI.Label(new Rect(Screen.width / 6, Screen.height / 15, Screen.width / 1.5f, Screen.height / 1.5f), logo);

        startMultiFocusArea(controlMenuSelections, controlMenuTexts);
        SetMenuSelectionTrue(controlMenuSelections);

        if (controlMenuSelections[0])
        {
            selection();
            resetSelected();
            mainMenuSelections[0] = false;
            GUIMenu = Menus.CONTROLSXBOX;
        }

        if (controlMenuSelections[1])
        {
            selection();
            resetSelected();
            mainMenuSelections[1] = false;
            GUIMenu = Menus.CONTROLSKEYBOARD;
        }

        if (controlMenuSelections[2])
        {
            goBackSound();
            resetSelected();
            resetBackButton();
            returnToMainMenu();
        }

        endMultiFocusArea(controlMenuTexts);
    }
    void MenusGame()
    {
        switch(currentMenu)
        {
        case Menus.MainMenu:
            {
            GUILayout.BeginArea(new Rect(Screen.width/2-60, 150, 120, Screen.height));
            if(GUILayout.Button("Play")) Application.LoadLevel("cena");
            if(GUILayout.Button("Credits")) currentMenu=Menus.Credits;
            if(GUILayout.Button("Exit")) Application.Quit();

            GUILayout.EndArea();
            }
            break;

        case Menus.Credits:
            {
            GUILayout.BeginArea(new Rect(Screen.width/2-150, 150, 300, Screen.height));
            GUILayout.TextArea(textCredits);
            if(GUILayout.Button("Back")) currentMenu=Menus.MainMenu;

            GUILayout.EndArea();
            }
            break;

        }
    }
Example #3
0
 // --- Local methods ---
 internal void SwitchToMenu(Menus menu)
 {
     if (_game.Components.Contains(menuMap[CurrentMenu]))
         _game.Components.Remove(menuMap[CurrentMenu]);
     CurrentMenu = menu;
     SetCurrentMenu();
 }
Example #4
0
        public ActionResult Create(Menus menu)
        {
            if (ModelState.IsValid)
            {
                var c = Request.Files[0];
                if (c != null && c.ContentLength > 0)
                {
                    int lastSlashIndex = c.FileName.LastIndexOf("\\");
                    string fileName = c.FileName.Substring(lastSlashIndex + 1, c.FileName.Length - lastSlashIndex - 1);
                    int lastDotIndex = fileName.LastIndexOf(".");
                    string fileType = fileName.Substring(lastDotIndex + 1);
                    string guid = Guid.NewGuid().ToString();
                    string realName = guid + "." + fileType;
                    string savePath = Path.Combine(Server.MapPath("/Images/Products/"), realName);
                    c.SaveAs(savePath);

                    menu.Src= realName;
                }
                menu.Url = "Content";
                menu.CreaterId = (int)Session["CurrentEmp"];
                menu.CreateTime = DateTime.Now;
                db.Menus.Add(menu);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            IEnumerable<Menus> models = db.Database.SqlQuery<Menus>(_queryStr);
            ViewBag.Pid = new SelectList(models, "Id", "Title", menu.Id);
            //ModelState.AddModelError("FullName", "error-message goes here FullName");
            //ModelState.AddModelError("", "error-message goes here");
            return View(menu);
        }
Example #5
0
        public Recorder(Menus.CombatScreen screen)
        {
            if (screen == null) throw new ArgumentNullException("screen");

            m_screen = screen;
            m_data = new LinkedList<RecordingData>();
            m_input = new Int32[5];
            m_isrecording = false;
        }
Example #6
0
        /// <summary>
        /// Allows the game component to perform any initialization it needs to before starting
        /// to run.  This is where it can query for any required services and load content.
        /// </summary>
        public override void Initialize()
        {
            menuMap.Add(Menus.Main,new MainMenu(_game,this));
            menuMap.Add(Menus.Help,new HelpMenu(_game,this));

            CurrentMenu = Menus.Main;
            SetCurrentMenu();

            base.Initialize();
        }
        static void Main(string[] args)
        {
            //Declara a classe Menus
            Menus menus = new Menus();

            //Renomeia o titulo
            Console.Title = "Conversor de temperatura 1.0";

            for (;;)
            {
                //Aguarda o metodo principal() retornar um valor de 1..4
                int i1 = menus.principal();

                //de 1..3 são as escalas termometricas
                if (i1 >= 1 && i1 <= 3)
                {
                    switch (i1)
                    {
                        case 1:
                            menus.celsius();
                            break;
                        case 2:
                            menus.fahrenheits();
                            break;
                        default:
                            menus.kelvins();
                            break;
                    }

                    /* Assim /\ ou assim \/
                    if (i1 == 1)
                        menus.celsius();
                    else if(i1 == 2)
                        menus.fahrenheits();
                    else
                        menus.kelvins();*/

                    Console.WriteLine("----------------------------------------------\n");
                }
                //Se i1 == 4 sai do loop
                else if (i1 == 4)
                {
                    Console.WriteLine("\nSaindo... :(");
                    break;
                }
                //Se caso o valor recebido seja diferente de 1..4, volta para o msm menu
                else
                {
                    Console.WriteLine("\nTemperatura invalida! Tente novamente:\n");
                }
            }
        }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="menu"></param>
 public void AddMenu(Menus menu)
 {
     switch (menu)
     {
         case Menus.MainMenu:
             GameMenu tempMenu = new GameMenu(masterGame, content.Load<Texture2D>("Menus//menuMain"));
             tempMenu.AddButton(new SinglePlayerButton(tempMenu, content.Load<Texture2D>("Menus//Buttons/buttonSinglePlayer"), 350, 200, 100, 50));
             gameMenus.Add(tempMenu);
             break;
         case Menus.MultiPlayerCreationMenu:
             break;
         case Menus.MultiPlayerLobbyMenu:
             break;
         case Menus.MultiPlayerSelectionMenu:
             break;
         case Menus.SinglePlayerMenu:
             break;
     }
 }
	public void MoveToMain()
	{
		if(menuTween.isActiveAndEnabled) return;

		SoundController.Instance.PlaySoundFX(SoundController.SoundFX.Click);
		SoundController.Instance.PlaySoundFX(SoundController.SoundFX.MenuIn);

		ActiveScreen = mainScreen.gameObject;

		lastMenu = activeMenu;
		activeMenu = Menus.Main;
		
		MoveScreen ();
	}
Example #10
0
 private void Awake()
 {
     QuitMenu.SetActive(false);
     _current = this;
 }
Example #11
0
        private void GetCredit(int v)
        {
            int inputCreditSize;

            if (aAmountOfMoneyRequestPanel.Enabled)
            {
                try
                {
                    inputCreditSize = int.Parse(aAmountOfMoneyRequestTextBox.Text);
                }
                catch (FormatException)
                {
                    return;
                }

                if (inputCreditSize < 1000)
                {
                    aInfoLabel.Text = "Minimum money amount - 1000";
                    aAmountOfMoneyRequestTextBox.Text = "";
                    return;
                }
                else if (inputCreditSize > CurrentUser.CreditLimit())
                {
                    aInfoLabel.Text  = "Typed amount is higher than your credit limit. \n";
                    aInfoLabel.Text += "(Your credit limit: " + CurrentUser.CreditLimit() + ")";
                    aAmountOfMoneyRequestTextBox.Text = "";
                    return;
                }
                else
                {
                    aAmountOfMoneyRequestTextBox.Text = "";
                    TransactionResultData result = null;
                    ClearSidepanelsButtons();
                    DisablePanel(aAmountOfMoneyRequestPanel);
                    string key = _transactionController.CreateNewTransaction(CurrentUser.GetCardNumber(), new UserProxy.CreditInfo
                    {
                        Amount = inputCreditSize, Percent = creditTariffs[v], Time = v * 6
                    });
                    while (result == null)
                    {
                        try
                        {
                            result = CurrentUser.GetTransactionHistory()[key];
                        }
                        catch (KeyNotFoundException)
                        {
                            continue;
                        }
                    }
                    if (result.Done)
                    {
                        aInfoLabel.Text = "You successfully took a credit. Money added to your account";
                    }
                    else
                    {
                        aInfoLabel.Text =
                            "Transaction unsuccessful. Reason: " + result.Reason;
                    }
                    return;
                }
            }
            else
            {
                currentMenu = Menus.MainMenu;
                RedrawWindow();
                return;
            }
        }
Example #12
0
 private void setCurrentMenu(Menus currentMenu)
 {
     this.currentMenu = currentMenu;
     if (currentMenu == Menus.main)
         currentSubtitle = "";
     if (currentMenu == Menus.loadGame)
         currentSubtitle = "Load Game";
     if (currentMenu == Menus.newGame)
         currentSubtitle = "New Game";
 }
Example #13
0
 public void Options()
 {
     //Go to Options Menu
     currentMenu = Menus.Options;
 }
    void OnGUI()
    {
        if (!isPaused)
            return;

        if (currentMenu == Menus.Main) {
            GUI.BeginGroup (new Rect (Screen.width / 2 - 125, Screen.height / 2 - 125, 250, 370));
            GUI.Box (new Rect (0, 0, 250, 570), "Menu");
            if (GUI.Button (new Rect (25, 20, 200, 50), "Resume")) {
                unpause ();
            }
            if (GUI.Button (new Rect (25, 90, 200, 50), "Levels")) {
                currentMenu = Menus.Levels;
            }
            if (GUI.Button (new Rect (25, 160, 200, 50), "Options")) {
                if (playerObject) {
                    currentMenu = Menus.Options;
                }
            }
            if (GUI.Button (new Rect (25, 230, 200, 50), "Restart")) {
                unpause ();
                Application.LoadLevel(Application.loadedLevel);
            }
            if (GUI.Button (new Rect (25, 290, 200, 50), "Exit")) {
                Application.Quit();
            }
            GUI.EndGroup();

        } else if (currentMenu == Menus.Levels) {
            GUI.BeginGroup (new Rect (Screen.width / 2 - 125, Screen.height / 2 - 125, 500, 370));
            GUI.Box (new Rect (0, 0, 250, 570), "Levels");
            for (int i = 0; i < availableLevels.Length; i++) {
                if (GUI.Button (new Rect (25, i*70+20 , 200, 50), availableLevels[i] )) {
                    Application.LoadLevel(i);
                    unpause();
                }
            }

            if (GUI.Button (new Rect (25, 290, 200, 50), "Back")) {
                currentMenu = Menus.Main;
            }
            GUI.EndGroup();

        } else if (isPaused && currentMenu == Menus.Options && playerObject) {
            GUI.BeginGroup (new Rect (Screen.width / 2 - 250, Screen.height / 2 - 125, 500, 300));
            GUI.Box (new Rect (0, 0, 500, 300), "Menu");
            if (GUI.Button (new Rect (150, 240, 200, 50), "Done")) {
                currentMenu = Menus.Main;
            }
            ff.Inverted = GUI.Toggle (new Rect (25, 20, 200, 20), ff.Inverted, "Inverted Controls");
            StatsView sv = gameObject.GetComponent<StatsView>();
            if (sv) {
                sv.enabled = GUI.Toggle (new Rect (25, 40, 200, 20), sv.enabled, "Show Physics Statistics");
                sv.showAbbreviations = GUI.Toggle(new Rect (25, 60, 200, 20), sv.showAbbreviations, "Show Unit Abbreviations");
                if (ff.flightPhysics != null) {
                    //Admittedly, this is a bit hacky. We convert the Unit enum to an integer,
                    //asign the selection to a string array that *matches* the enums by index,
                    //then convert the integer back to a Unit enum. Hacky, but works. Maybe it
                    //would be better to add string-settable unit types to the unit converter.
                    int unitSelection = (int) ff.flightPhysics.Unit;
                    string[] choices = new string[] {"Metric", "Imperial"};
                    unitSelection = GUI.SelectionGrid(new Rect(25, 80, 150, 30), unitSelection, choices, 2);
                    ff.flightPhysics.Unit = (UnitConverter.Units) unitSelection;

                }
            }
            GUI.EndGroup();

        }
    }
Example #15
0
        private void aInputButtonEnter_Click(object sender, EventArgs e)
        {
            aInfoLabel.Text = "";
            if (currentMenu == Menus.LoginMenu)
            {
                string inputCardNumber   = null;
                string inputCardPassword = null;

                if (aCardNumberPanel.Enabled == true)
                {
                    inputCardNumber = aCardNumberTextBox.Text;
                    if (!ValidateInputCardNumber(inputCardNumber))
                    {
                        aInfoLabel.Text         = "Wrong card number";
                        aCardNumberTextBox.Text = "";
                        inputCardNumber         = null;
                        return;
                    }
                    else
                    {
                        if (DataBase.Users.ContainsKey(inputCardNumber))
                        {
                            CurrentUser       = DataBase.Users[inputCardNumber];
                            _passwordAttempts = CurrentUser.GetPasswordAttempts();
                            if (CurrentUser.GetBlockedStatus())
                            {
                                aInfoLabel.Text         = "This card is blocked.";
                                inputCardNumber         = null;
                                aCardNumberTextBox.Text = "";
                                return;
                            }
                            DisablePanel(aCardNumberPanel);
                            EnablePanel(aPasswordPanel);
                            return;
                        }
                        else
                        {
                            aInfoLabel.Text         = "Card number doesn't exist or wrong input. Try again.";
                            inputCardNumber         = null;
                            aCardNumberTextBox.Text = "";
                            return;
                        }
                    }
                }
                else if (aPasswordPanel.Enabled == true)
                {
                    inputCardPassword = aPasswordTextBox.Text;
                    if (!ValidateInputCardPassword(inputCardPassword))
                    {
                        aInfoLabel.Text       = "Wrong password format. Try again.";
                        aPasswordTextBox.Text = "";
                        inputCardPassword     = null;
                        return;
                    }
                    else
                    {
                        inputCardPassword = aPasswordTextBox.Text;
                        if (!DataBase.ValidateUser(CurrentUser, inputCardPassword))
                        {
                            if (--_passwordAttempts == 0)
                            {
                                CurrentUser.SetPasswordAttempts(_passwordAttempts);
                                DataBase.BlockUser(CurrentUser);
                                aInfoLabel.Text = "Wrong password. Your card is blocked.";
                                DisablePanel(aPasswordPanel);
                                EnablePanel(aCardNumberPanel);
                                inputCardPassword = null;
                                CurrentUser       = null;
                                return;
                            }
                            else
                            {
                                CurrentUser.SetPasswordAttempts(_passwordAttempts);
                                aInfoLabel.Text       = "Wrong password. " + _passwordAttempts + " attempts left.";
                                inputCardPassword     = null;
                                aPasswordTextBox.Text = "";
                                return;
                            }
                        }
                        else
                        {
                            DisablePanel(aCardNumberPanel);
                            DisablePanel(aPasswordPanel);
                            CurrentUser.SetPasswordAttempts(3);
                            atm._loggedIn   = true;
                            aInfoLabel.Text = "You have logged in. Welcome.";
                            MainMenu();
                            return;
                        }
                    }
                }
            }
            else if (currentMenu == Menus.SendMoney)
            {
                string inputCardNumber;
                double inputMoneyAmount;

                if (aReceiverCardRequestPanel.Enabled)
                {
                    inputCardNumber = aReceiverCardNumberTextBox.Text;
                    if (!ValidateInputCardNumber(inputCardNumber))
                    {
                        aInfoLabel.Text = "Wrong card number";
                        aReceiverCardNumberTextBox.Text = "";
                        inputCardNumber = null;
                        return;
                    }
                    else
                    {
                        if (DataBase.Users.ContainsKey(inputCardNumber))
                        {
                            UserProxy receiver = DataBase.Users[inputCardNumber];
                            if (receiver.GetBlockedStatus())
                            {
                                aInfoLabel.Text = "Receiver's card is blocked.";
                                inputCardNumber = null;
                                aReceiverCardNumberTextBox.Text = "";
                                return;
                            }
                            DisablePanel(aReceiverCardRequestPanel);
                            EnablePanel(aAmountOfMoneyRequestPanel);
                            return;
                        }
                        else
                        {
                            aInfoLabel.Text         = "Card number doesn't exist or wrong input. Try again.";
                            inputCardNumber         = null;
                            aCardNumberTextBox.Text = "";
                            return;
                        }
                    }
                }
                else if (aAmountOfMoneyRequestPanel.Enabled)
                {
                    inputCardNumber  = aReceiverCardNumberTextBox.Text;
                    inputMoneyAmount = double.Parse(aAmountOfMoneyRequestTextBox.Text);
                    string key = _transactionController.CreateNewTransaction(CurrentUser.GetCardNumber(), inputMoneyAmount, inputCardNumber);
                    aAmountOfMoneyRequestTextBox.Text = "";
                    aReceiverCardNumberTextBox.Text   = "";
                    DisablePanel(aAmountOfMoneyRequestPanel);
                    aInfoLabel.Text = "Your transaction request is processing...";
                    TransactionResultData result = null;
                    while (result == null)
                    {
                        try
                        {
                            result = CurrentUser.GetTransactionHistory()[key];
                        }
                        catch (KeyNotFoundException)
                        {
                            continue;
                        }
                    }
                    if (result.Done)
                    {
                        aInfoLabel.Text = "Transaction successful.";
                    }
                    else
                    {
                        aInfoLabel.Text =
                            "Transaction unsuccessful. Reason: " + ((result.Reason == TransactionDeniedReason.NotEnoughMoney)
                ? "Not enough money" : "You can't send money to yourself");
                    }
                    return;
                }
                else
                {
                    currentMenu = Menus.MainMenu;
                    RedrawWindow();
                    return;
                }
            }
            else if (currentMenu == Menus.RecheckPass)
            {
                string inputCardPassword;

                if (aPasswordPanel.Enabled == true)
                {
                    inputCardPassword = aPasswordTextBox.Text;
                    if (!ValidateInputCardPassword(inputCardPassword))
                    {
                        aInfoLabel.Text       = "Wrong password format. Try again.";
                        aPasswordTextBox.Text = "";
                        inputCardPassword     = null;
                        return;
                    }
                    else
                    {
                        inputCardPassword = aPasswordTextBox.Text;
                        if (!DataBase.ValidateUser(CurrentUser, inputCardPassword))
                        {
                            if (--_passwordAttempts == 0)
                            {
                                CurrentUser.SetPasswordAttempts(_passwordAttempts);
                                DataBase.BlockUser(CurrentUser);
                                aInfoLabel.Text = "Wrong password. Your card is blocked.";
                                DisablePanel(aPasswordPanel);
                                EnablePanel(aCardNumberPanel);
                                inputCardPassword = null;
                                CurrentUser       = null;
                                return;
                            }
                            else
                            {
                                CurrentUser.SetPasswordAttempts(_passwordAttempts);
                                aInfoLabel.Text       = "Wrong password. " + _passwordAttempts + " attempts left.";
                                inputCardPassword     = null;
                                aPasswordTextBox.Text = "";
                                return;
                            }
                        }
                        else
                        {
                            DisablePanel(aCardNumberPanel);
                            DisablePanel(aPasswordPanel);
                            CurrentUser.SetPasswordAttempts(3);
                            atm._loggedIn = true;
                            MainMenu();
                            return;
                        }
                    }
                }
            }
            else if (currentMenu == Menus.WithdrawMoney)
            {
                int inputMoneyAmount;
                if (aAmountOfMoneyRequestPanel.Enabled)
                {
                    try
                    {
                        inputMoneyAmount = int.Parse(aAmountOfMoneyRequestTextBox.Text);
                    }
                    catch (FormatException)
                    {
                        return;
                    }
                    string key = _transactionController.CreateNewTransaction(CurrentUser.GetCardNumber(), inputMoneyAmount);
                    aAmountOfMoneyRequestTextBox.Text = "";
                    aReceiverCardNumberTextBox.Text   = "";
                    TransactionResultData result = null;
                    while (result == null)
                    {
                        try
                        {
                            result = CurrentUser.GetTransactionHistory()[key];
                        }
                        catch (KeyNotFoundException)
                        {
                            continue;
                        }
                    }
                    DisablePanel(aAmountOfMoneyRequestPanel);
                    if (result.Done)
                    {
                        aInfoLabel.Text = "Take your money";
                        GiveBanknotes(inputMoneyAmount);
                    }
                    else
                    {
                        aInfoLabel.Text =
                            "Transaction unsuccessful. Reason: " + ((result.Reason == TransactionDeniedReason.NotEnoughMoney)
                ? "Not enough money" : "Unknown");
                    }
                    return;
                }
                else
                {
                    currentMenu = Menus.MainMenu;
                    RedrawWindow();
                    return;
                }
            }
            else if (currentMenu == Menus.GetCredit)
            {
                if (aAmountOfMoneyRequestPanel.Enabled == false)
                {
                    currentMenu = Menus.MainMenu;
                    RedrawWindow();
                    return;
                }
            }
        }
 public IActionResult Put([FromBody] Menus model)
 {
     _MenuService.Update(model);
     return(Ok());
 }
 public IActionResult Post([FromBody] Menus model)
 {
     _MenuService.Insert(model);
     return(Ok());
 }
Example #18
0
        public ActionResult Update(SegmentacionClienteForm seg_vh, int?menu)
        {
            if (Session["user_usuarioid"] != null)
            {
                if (ModelState.IsValid)
                {
                    //consulta si el registro esta en BD para ese concesionario con otro nombre
                    int nom = (from a in context.segmentacion
                               where a.descripcion == seg_vh.descripcion && a.concesionario == seg_vh.concesionario &&
                               a.id != seg_vh.id
                               select a.descripcion).Count();

                    if (nom == 0)
                    {
                        //actualizo para este
                        segmentacion segmentacion = context.segmentacion.Where(d => d.id == seg_vh.id).FirstOrDefault();

                        segmentacion.cantidad_vehiculos   = seg_vh.cantidad_vehiculos;
                        segmentacion.concesionario        = seg_vh.concesionario.Value;
                        segmentacion.descripcion          = seg_vh.descripcion;
                        segmentacion.estado               = seg_vh.estado;
                        segmentacion.evalua_cantidad      = seg_vh.evalua_cantidad;
                        segmentacion.evalua_polizas       = seg_vh.evalua_polizas;
                        segmentacion.evalua_revisiones    = seg_vh.evalua_revisiones;
                        segmentacion.evalua_soat          = seg_vh.evalua_soat;
                        segmentacion.poliza_dia           = seg_vh.poliza_dia;
                        segmentacion.razon_inactivo       = seg_vh.razon_inactivo;
                        segmentacion.revisiones_dia       = seg_vh.revisiones_dia;
                        segmentacion.soat_dia             = seg_vh.soat_dia;
                        segmentacion.fec_actualizacion    = DateTime.Now;
                        segmentacion.user_idactualizacion = Convert.ToInt32(Session["user_usuarioid"]);
                        segmentacion.fec_creacion         = DateTime.Now;
                        segmentacion.userid_creacion      = Convert.ToInt32(Session["user_usuarioid"]);
                        context.Entry(segmentacion).State = EntityState.Modified;
                        context.SaveChanges();
                        TempData["mensaje"] = "La actualización del segmento de Clientes fue exitosa!";
                        // return RedirectToAction("Create", new { menu = menu });
                    }
                    else
                    {
                        TempData["mensaje_error"] =
                            "El nombre ingresado ya se encuentra asignado a otro segmento, por favor valide!";
                    }
                }

                TempData["mensaje_vacio"] = "Campos vacios, por favor valide!";

                IQueryable <icb_modulo_enlaces> enlacesBuscar = context.icb_modulo_enlaces.Where(x => x.enl_modulo == 28);
                string enlaces = "";
                foreach (icb_modulo_enlaces item in enlacesBuscar)
                {
                    Menus buscarEnlace = context.Menus.FirstOrDefault(x => x.idMenu == item.id_modulo_destino);
                    enlaces += "<li><a href='" + buscarEnlace.url + "'>" + buscarEnlace.nombreMenu + "</a></li>";
                }

                ViewBag.nombreEnlaces = enlaces;
                listas(seg_vh);
                BuscarFavoritos(menu);
                return(View(seg_vh));
            }

            return(RedirectToAction("Login", "Login"));
        }
        public async Task <IActionResult> LanguageCreate(int Id)
        {
            var CurrentUser = await _userManager.GetUserAsync(User);

            var DefaultLanguageID = CurrentUser.DefaultLanguageId;

            var UICustomizationArray = new UICustomization(_context);

            ViewBag.Terms = await UICustomizationArray.UIArray(this.ControllerContext.RouteData.Values["controller"].ToString(), this.ControllerContext.RouteData.Values["action"].ToString(), DefaultLanguageID);

            Menus a = new Menus(_context);

            ViewBag.menuItems = await a.TopMenu(DefaultLanguageID);

            var parameter    = new SqlParameter("@Id", Id);
            var LanguageList = _context.ZdbLanguageCreateGetLanguageList.FromSql("PageLanguageCreateGetLanguageList @Id", parameter).ToList();

            List <SelectListItem> LList = new List <SelectListItem>();

            foreach (var Language in LanguageList)
            {
                LList.Add(new SelectListItem {
                    Value = Language.Value, Text = Language.Text
                });
            }

            if (LList.Count() == 0)
            {
                return(RedirectToAction("LanguageIndex", new { Id }));
            }
            SuObjectLanguageEditGetModel Page = new SuObjectLanguageEditGetModel
            {
                OId = Id
            };

            ViewBag.Id = Id.ToString();
            var PageAndStatus = new SuObjectLanguageEditGetWitLanguageListModel
            {
                SuObject = Page
                ,
                LanguageList = LList
            };

            return(View(PageAndStatus));

            //List<int> LanguagesAlready = new List<int>();
            //LanguagesAlready = (from c in _PageLanguage.GetAllPageLanguages()
            //                    where c.PageId == Id
            //                    select c.LanguageId).ToList();


            //var SuLanguage = (from l in _language.GetAllLanguages()
            //                  where !LanguagesAlready.Contains(l.Id)
            //                  && l.Active
            //                  select new SelectListItem
            //                  {
            //                      Value = l.Id.ToString()
            //                  ,
            //                      Text = l.LanguageName
            //                  }).ToList();

            //if (SuLanguage.Count() == 0)
            //{
            //    return RedirectToAction("LanguageIndex", new { Id });
            //}
            //SuObjectVM SuObject = new SuObjectVM
            //{
            //    ObjectId = Id
            //};
            //ViewBag.Id = Id.ToString();
            //var PageAndStatus = new SuObjectAndStatusViewModel
            //{
            //    SuObject = SuObject
            //    ,
            //    SomeKindINumSelectListItem = SuLanguage
            //};
            //return View(PageAndStatus);
        }
        public async Task <IActionResult> Edit(int Id)
        {
            var CurrentUser = await _userManager.GetUserAsync(User);

            var DefaultLanguageID = CurrentUser.DefaultLanguageId;

            var UICustomizationArray = new UICustomization(_context);

            ViewBag.Terms = await UICustomizationArray.UIArray(this.ControllerContext.RouteData.Values["controller"].ToString(), this.ControllerContext.RouteData.Values["action"].ToString(), DefaultLanguageID);

            Menus a = new Menus(_context);


            var PageDetails = (from s in _Page.GetAllPages()
                               join t in _PageLanguage.GetAllPageLanguages()
                               on s.Id equals t.PageId
                               where t.LanguageId == CurrentUser.DefaultLanguageId && s.Id == Id
                               select new SuObjectVM
            {
                Id = s.Id
                ,
                Name = t.Name
                ,
                Status = s.PageStatusId
                ,
                ObjectLanguageId = t.Id
                ,
                Description = t.Description
                ,
                MouseOver = t.MouseOver
                ,
                PageDescription = t.TitleDescription
//                                   ,
//                                   MouseOver = t.Title
            }).First();

            var PageList = new List <SelectListItem>();

            foreach (var PageFromDb in _PageStatus.GetAllPageStatus())
            {
                PageList.Add(new SelectListItem
                {
                    Text  = PageFromDb.Name,
                    Value = PageFromDb.Id.ToString()
                });
            }

            //wwwwwwwwwwwwwwwwwwwwwwwwww
            var TypeList = (from o in _PageType.GetAllPageTypes()
                            join l in _PageTypeLanguage.GetAllPageTypeLanguages()
                            on o.Id equals l.PageTypeId
                            where l.LanguageId == CurrentUser.DefaultLanguageId
                            select new SuObjectVM
            {
                Id = o.Id
                ,
                Name = l.Name
            }).ToList();

            var TypeListItem = new List <SelectListItem>();

            foreach (var TypeFromDb in TypeList)
            {
                TypeListItem.Add(new SelectListItem
                {
                    Text  = TypeFromDb.Name,
                    Value = TypeFromDb.Id.ToString()
                });
            }
            //wwwwwwwwwwwwwwwwwwwwwwww

            var PageAndStatus = new SuObjectAndStatusViewModel {
                SuObject = PageDetails, SomeKindINumSelectListItem = PageList, ProbablyTypeListItem = TypeListItem
            };

            return(View(PageAndStatus));
        }
        public async Task <IActionResult> Create()
        {
            var CurrentUser = await _userManager.GetUserAsync(User);

            var DefaultLanguageID = CurrentUser.DefaultLanguageId;

            var UICustomizationArray = new UICustomization(_context);

            ViewBag.Terms = await UICustomizationArray.UIArray(this.ControllerContext.RouteData.Values["controller"].ToString(), this.ControllerContext.RouteData.Values["action"].ToString(), DefaultLanguageID);

            Menus a = new Menus(_context);


            //var ParentPage = _Page.GetPage(Id);

            var StatusList = new List <SelectListItem>();

            foreach (var StatusFromDb in _PageStatus.GetAllPageStatus())
            {
                StatusList.Add(new SelectListItem
                {
                    Text  = StatusFromDb.Name,
                    Value = StatusFromDb.Id.ToString()
                });
            }

            //wwwwwwwwwwwwwwwwwwwwwwwwww
            var ToForm = (from o in _PageType.GetAllPageTypes()
                          join l in _PageTypeLanguage.GetAllPageTypeLanguages()
                          on o.Id equals l.PageTypeId
                          where l.LanguageId == CurrentUser.DefaultLanguageId
                          select new SuObjectVM
            {
                Id = o.Id
                ,
                Name = l.Name
            }).ToList();

            var TypeList = new List <SelectListItem>();

            foreach (var TypeFromDb in ToForm)
            {
                TypeList.Add(new SelectListItem
                {
                    Text  = TypeFromDb.Name,
                    Value = TypeFromDb.Id.ToString()
                });
            }
            //wwwwwwwwwwwwwwwwwwwwwwww

            //SuObjectVM Parent = new SuObjectVM()
            //{
            //    NullId = ParentPage == null ? 0 : ParentPage.Id,
            //    LanguageId = DefaultLanguageID

            //};
            var Page         = new SuPageEditGetModel();
            var PageAndLists = new SuPageEditGetWithListModel {
                Page = Page, StatusList = StatusList, TypeList = TypeList
            };

            return(View(PageAndLists));
        }
Example #22
0
            static void OnMainMenuActivatorSelected(Transform rayOrigin)
            {
                var targetToolRayOrigin = evr.m_DeviceData.FirstOrDefault(data => data.rayOrigin != rayOrigin).rayOrigin;

                Menus.OnMainMenuActivatorSelected(rayOrigin, targetToolRayOrigin);
            }
	public void MoveToHUBConnection()
	{
		if(menuTween.isActiveAndEnabled || DailyRewardController.IsActive || Popup.IsActive || Plasmette.IsSpinning) return;

		SoundController.Instance.PlaySoundFX(SoundController.SoundFX.Click);
		SoundController.Instance.PlaySoundFX(SoundController.SoundFX.MenuIn);

		ActiveScreen = hubConnectionScreen.gameObject;

		hubConnectionScreen.gameObject.SetActive(false);
		hubConnectionScreen.gameObject.SetActive(true);

		lastMenu = activeMenu;
		activeMenu = Menus.HUBConnection;
		
		MoveScreen ();
	}
	public void MoveInstantToMainMenu()
	{
		ActiveScreen = mainScreen.gameObject;

		SoundController.Instance.PlaySoundFX(SoundController.SoundFX.Click);

		lastMenu = activeMenu;
		activeMenu = Menus.Main;
		
		MoveScreen (true);
	}
 public IActionResult Delete([FromBody] Menus model)
 {
     _MenuService.Delete(model);
     return(Ok());
 }
 public ToolStrip(AutomationElement automationElement, ActionListener actionListener) : base(automationElement, actionListener)
 {
     topLevelMenu = new Menus(automationElement, actionListener);
 }
 public static IO <IAddOrUpdateResult> CreateMenuAndPersist(Menus menu, int?restaurantId)
 => from menuCreated in CreateMenu(menu, restaurantId)
 let menuResult = (menuCreated as MenuCreated)?.Menu
                  from db in Database.AddOrUpdate(menuResult)
                  select db;
Example #28
0
        public void CreateSettingsMenu()
        {
            // TODO: Update readme instructions
            MenuTree settingsMenu = new MenuTree("menu.mod.decorativelamp", "Decorative Lamp Settings")
            {
                new CheckBox(MenuDisplayMode.Both, "setting:enable_lamp", "LAMP ENABLED")
                .WithGetter(() => Config.Enabled)
                .WithSetter((x) => Config.Enabled = x)
                .WithDescription(string.Format("{0}: Enlighten your way through the Array.", "Visual".Colorize(Colors.yellowGreen))),

                new ListBox <LampModel>(MenuDisplayMode.Both, "setting:lamp_model", "3D MODEL")
                .WithEntries(MapEnumToListBox <LampModel>())
                .WithGetter(() => Config.MeshModel)
                .WithSetter(x => {
                    Config.MeshModel = x;
                    ChangeLampModel.Broadcast(new ChangeLampModel.Data(x));
                })
                .WithDescription(string.Format("{0}: Select the lamp 3D mesh.", "Visual".Colorize(Colors.yellowGreen))),

                new CheckBox(MenuDisplayMode.Both, "setting:enable_spin", "SPINNING LAMP")
                .WithGetter(() => Config.Spin)
                .WithSetter((x) => Config.Spin = x)
                .WithDescription(string.Format("{0}: Make the lamp spin.", "Visual".Colorize(Colors.yellowGreen))),

                new IntegerSlider(MenuDisplayMode.Both, "setting:spin_speed", "LAMP SPIN SPEED")
                .WithGetter(() => Config.SpinSpeed)
                .WithSetter((x) => Config.SpinSpeed = x)
                .LimitedByRange(-1000, 1000)
                .WithDefaultValue(50)
                .WithDescription(string.Format("{0}: Set the lamp spin speed.", "Visual".Colorize(Colors.yellowGreen))),

                new IntegerSlider(MenuDisplayMode.Both, "setting:lamp_scale", "LAMP SCALE")
                .WithGetter(() => Mathf.RoundToInt(Config.LampScale * 100.0f))
                .WithSetter((x) => Config.LampScale = x / 100.0f)
                .LimitedByRange(0, 500)
                .WithDefaultValue(100)
                .WithDescription(string.Format("{0}: Set the lamp model size.", "Visual".Colorize(Colors.yellowGreen))),

                new IntegerSlider(MenuDisplayMode.Both, "setting:light_intensity", "LIGHT INTENSITY")
                .WithGetter(() => Mathf.RoundToInt(Config.LightIntensity * 100.0f))
                .WithSetter((x) => Config.LightIntensity = x / 100.0f)
                .LimitedByRange(0, 1000)
                .WithDefaultValue(75)
                .WithDescription(string.Format("{0}: Set the lamp brightness.", "Visual".Colorize(Colors.yellowGreen))),

                new IntegerSlider(MenuDisplayMode.Both, "setting:light_range", "LIGHT RANGE")
                .WithGetter(() => Config.LightRange)
                .WithSetter((x) => Config.LightRange = x)
                .LimitedByRange(0, 100)
                .WithDefaultValue(20)
                .WithDescription(string.Format("{0}: Set the lamp light distance.", "Visual".Colorize(Colors.yellowGreen))),

                new IntegerSlider(MenuDisplayMode.Both, "setting:flare_brightness", "FLARE BRIGHTNESS")
                .WithGetter(() => Mathf.RoundToInt(Config.LightRange * 10.0f))
                .WithSetter((x) => Config.FlareBrightness = x / 10.0f)
                .LimitedByRange(0, 20)
                .WithDefaultValue(10)
                .WithDescription(string.Format("{0}: Set the lens flare brightness.", "Visual".Colorize(Colors.yellowGreen)))
            };

            Menus.AddNew(MenuDisplayMode.Both, settingsMenu, "DECORATIVE LAMP", "Settings for the Decorative Lamp mod.");
        }
Example #29
0
    private void SwitchMenu(Menus menu)
    {
      _menuStack.Add(menu);

      listViewMenu.SelectedItems.Clear();
      listViewMenu.Items.Clear();

      switch (menu)
      {
        case Menus.Tasks:
          LoadMenuTasks();
          break;
        case Menus.Launch:
          LoadMenuLaunch();
          break;
        case Menus.Macros:
          LoadMenuMacros();
          break;
        case Menus.System:
          LoadMenuSystem();
          break;

        case Menus.Windows:
          LoadMenuWindows();
          break;
        case Menus.Power:
          LoadMenuPower();
          break;
        case Menus.Audio:
          LoadMenuAudio();
          break;
        case Menus.Eject:
          LoadMenuEject();
          break;

        case Menus.WindowActivate:
          LoadMenuWindowActivate();
          break;
        case Menus.WindowClose:
          LoadMenuWindowClose();
          break;
        case Menus.WindowMaximize:
          LoadMenuWindowMaximize();
          break;
        case Menus.WindowMinimize:
          LoadMenuWindowMinimize();
          break;

        default:
          LoadMenuMain();
          break;
      }

      ResizeWindow();

      if (listViewMenu.Items.Count > 0)
      {
        listViewMenu.Items[0].Selected = true;
        listViewMenu.Items[0].Focused = true;
      }
    }
        public MenuResult CreateMenu(AuthIdentity identity, Menu menu, params Guid[] recipeIds)
        {
            using (var session = this.GetSession())
            {
                menu.Title = menu.Title.Trim();
                var ret = new MenuResult();

                using (var transaction = session.BeginTransaction())
                {
                    Menus menus;
                    var dupes = session
                        .QueryOver<Menus>()
                        .Where(p => p.UserId == identity.UserId)
                        .Where(p => p.Title == menu.Title)
                        .ToRowCountQuery()
                        .RowCount();

                    if (dupes > 0)
                    {
                        throw new MenuAlreadyExistsException();
                    }

                    session.Save(menus = new Menus
                    {
                        UserId = identity.UserId,
                        Title = menu.Title,
                        CreatedDate = DateTime.Now,
                    });

                    foreach (var rid in recipeIds.NeverNull())
                    {
                        var fav = new Favorites
                        {
                            UserId = identity.UserId,
                            Recipe = new Models.Recipes() { RecipeId = rid },
                            Menu = menus
                        };

                        session.Save(fav);
                    }

                    transaction.Commit();

                    ret.MenuCreated = true;
                    ret.NewMenuId = menus.MenuId;
                }

                return ret;
            }
        }
Example #31
0
 public PopUpMenu(AutomationElement automationElement, ActionListener actionListener)
     : base(automationElement, actionListener)
 {
     this.actionListener = actionListener;
     topLevelMenus = new Menus(automationElement, actionListener);
 }
 public static IO <CreateMenuResult.ICreateMenuResult> CreateMenu(Menus menu, int?restaurantId)
 => NewIO <CreateMenuCmd, CreateMenuResult.ICreateMenuResult>(new CreateMenuCmd(menu, restaurantId));
Example #33
0
        private void aInputButtonCancel_Click(object sender, EventArgs e)
        {
            switch (currentMenu)
            {
            case Menus.LoginMenu:
            {
                aCardNumberTextBox.Text = "";
                aPasswordTextBox.Text   = "";
                DisablePanel(aPasswordPanel);
                DisablePanel(aCardNumberPanel);
                LoginMenu();
                break;
            }

            case Menus.MainMenu:
            {
                aCardNumberTextBox.Text = "";
                aPasswordTextBox.Text   = "";
                LoginMenu();
                break;
            }

            case Menus.RecheckPass:
            {
                _loggedIn = false;
                aCardNumberTextBox.Text = "";
                aPasswordTextBox.Text   = "";
                LoginMenu();
                break;
            }

            case Menus.SendMoney:
            {
                aReceiverCardNumberTextBox.Text   = "";
                aAmountOfMoneyRequestTextBox.Text = "";
                DisablePanel(aReceiverCardRequestPanel);
                DisablePanel(aAmountOfMoneyRequestPanel);
                currentMenu = Menus.MainMenu;
                RedrawWindow();
                break;
            }

            case Menus.WithdrawMoney:
            {
                aAmountOfMoneyRequestTextBox.Text = "";
                DisablePanel(aAmountOfMoneyRequestPanel);
                currentMenu = Menus.MainMenu;
                RedrawWindow();
                break;
            }

            case Menus.GetCredit:
            {
                aAmountOfMoneyRequestTextBox.Text = "";
                DisablePanel(aAmountOfMoneyRequestPanel);
                currentMenu = Menus.MainMenu;
                RedrawWindow();
                break;
            }
            }
        }
Example #34
0
        /// <summary>
        /// Loads the file from the specified stream.
        /// </summary>
        /// <param name="stream">The stream to read from.</param>
        public override void Load(Stream stream)
        {
            Encoding     encoding = Encoding.GetEncoding("EUC-KR");
            BinaryReader reader   = new BinaryReader(stream, encoding);

            stream.Seek(0, SeekOrigin.End);
            long fileSize = stream.Position;

            stream.Seek(0, SeekOrigin.Begin);

            short functionMask = reader.ReadInt16();

            for (int i = 0; i < Functions.Length; i++)
            {
                ConversationFunction function = Functions[i];
                function.Name      = reader.ReadString(32).TrimEnd('\0');
                function.IsEnabled = (functionMask & (1 << i)) != 0;
            }

            stream.Seek(2, SeekOrigin.Current);

            int conversationOffset = reader.ReadInt32();
            int scriptOffset       = reader.ReadInt32();

            int messageCount  = reader.ReadInt32();
            int messageOffset = conversationOffset + reader.ReadInt32();

            int menuCount  = reader.ReadInt32();
            int menuOffset = conversationOffset + reader.ReadInt32();

            for (int i = 0; i < messageCount; i++)
            {
                stream.Seek(messageOffset + sizeof(int) * i, SeekOrigin.Begin);
                int offset = reader.ReadInt32();

                stream.Seek(messageOffset + offset, SeekOrigin.Begin);

                ConversationMessage message = new ConversationMessage();
                message.ID           = reader.ReadInt32();
                message.Type         = (ConversationMessageType)reader.ReadInt32();
                message.TargetWindow = reader.ReadInt32();
                message.Condition    = reader.ReadString(32).TrimEnd('\0');
                message.Action       = reader.ReadString(32).TrimEnd('\0');
                message.StringID     = reader.ReadInt32();

                Messages.Add(message);
            }

            for (int i = 0; i < menuCount; i++)
            {
                ConversationMenu menu = new ConversationMenu();

                stream.Seek(menuOffset + sizeof(int) * i, SeekOrigin.Begin);
                int menuDataOffset = menuOffset + reader.ReadInt32();

                stream.Seek(menuDataOffset, SeekOrigin.Begin);
                int menuSize         = reader.ReadInt32();
                int menuMessageCount = reader.ReadInt32();

                for (int j = 0; j < menuMessageCount; j++)
                {
                    stream.Seek(menuDataOffset + sizeof(int) * 2 + sizeof(int) * j, SeekOrigin.Begin);
                    int menuItemOffset = Obfuscate(reader.ReadInt32(), menuMessageCount, menuSize);

                    stream.Seek(menuDataOffset + menuItemOffset, SeekOrigin.Begin);

                    ConversationMessage message = new ConversationMessage();
                    message.ID           = Obfuscate(reader.ReadInt32(), menuMessageCount, menuSize);
                    message.Type         = (ConversationMessageType)Obfuscate(reader.ReadInt32(), menuMessageCount, menuSize);
                    message.TargetWindow = Obfuscate(reader.ReadInt32(), menuMessageCount, menuSize);

                    byte[] condition = reader.ReadBytes(32);
                    Obfuscate(condition, menuMessageCount, menuSize);
                    message.Condition = encoding.GetString(condition).TrimEnd('\0');

                    byte[] action = reader.ReadBytes(32);
                    Obfuscate(action, menuMessageCount, menuSize);
                    message.Action = encoding.GetString(action).TrimEnd('\0');

                    message.StringID = Obfuscate(reader.ReadInt32(), menuMessageCount, menuSize);

                    menu.Messages.Add(message);
                }

                Menus.Add(menu);
            }

            stream.Seek(scriptOffset, SeekOrigin.Begin);

            int scriptSize = reader.ReadInt32();

            byte[] script = reader.ReadBytes(scriptSize);

            Obfuscate(script, scriptSize, (int)fileSize);

            Script = script;
        }
Example #35
0
        void Awake()
        {
#if UNDO_PATCH
            DrivenRectTransformTracker.BlockUndo = true;
#endif
            s_Instance     = this; // Used only by PreferencesGUI
            Nested.evr     = this; // Set this once for the convenience of all nested classes
            m_DefaultTools = defaultTools;
            SetHideFlags(defaultHideFlags);
            ClearDeveloperConsoleIfNecessary();
            HandleInitialization();

            m_Interfaces = (Interfaces)AddNestedModule(typeof(Interfaces));
            AddModule <SerializedPreferencesModule>(); // Added here in case any nested modules have preference serialization
            AddNestedModule(typeof(SerializedPreferencesModuleConnector));

            var nestedClassTypes = ObjectUtils.GetExtensionsOfClass(typeof(Nested));
            foreach (var type in nestedClassTypes)
            {
                AddNestedModule(type);
            }
            LateBindNestedModules(nestedClassTypes);

            AddModule <HierarchyModule>();
            AddModule <ProjectFolderModule>();

            var viewer = GetNestedModule <Viewer>();
            viewer.preserveCameraRig = preserveLayout;
            viewer.InitializeCamera();

            var deviceInputModule = AddModule <DeviceInputModule>();
            deviceInputModule.InitializePlayerHandle();
            deviceInputModule.CreateDefaultActionMapInputs();
            deviceInputModule.processInput            = ProcessInput;
            deviceInputModule.updatePlayerHandleMaps  = Tools.UpdatePlayerHandleMaps;
            deviceInputModule.inputDeviceForRayOrigin = rayOrigin =>
                                                        (from deviceData in m_DeviceData
                                                         where deviceData.rayOrigin == rayOrigin
                                                         select deviceData.inputDevice).FirstOrDefault();

            GetNestedModule <UI>().Initialize();

            AddModule <KeyboardModule>();

            var multipleRayInputModule = GetModule <MultipleRayInputModule>();

            var dragAndDropModule = AddModule <DragAndDropModule>();
            multipleRayInputModule.rayEntered  += dragAndDropModule.OnRayEntered;
            multipleRayInputModule.rayExited   += dragAndDropModule.OnRayExited;
            multipleRayInputModule.dragStarted += dragAndDropModule.OnDragStarted;
            multipleRayInputModule.dragEnded   += dragAndDropModule.OnDragEnded;

            var tooltipModule = AddModule <TooltipModule>();
            this.ConnectInterfaces(tooltipModule);
            multipleRayInputModule.rayEntered  += tooltipModule.OnRayEntered;
            multipleRayInputModule.rayHovering += tooltipModule.OnRayHovering;
            multipleRayInputModule.rayExited   += tooltipModule.OnRayExited;

            AddModule <ActionsModule>();
            AddModule <HighlightModule>();

            var lockModule = AddModule <LockModule>();
            lockModule.updateAlternateMenu = (rayOrigin, o) => Menus.SetAlternateMenuVisibility(rayOrigin, o != null);

            AddModule <SelectionModule>();

            var spatialHashModule = AddModule <SpatialHashModule>();
            spatialHashModule.shouldExcludeObject = go => go.GetComponentInParent <EditorVR>();
            spatialHashModule.Setup();

            var intersectionModule = AddModule <IntersectionModule>();
            this.ConnectInterfaces(intersectionModule);
            intersectionModule.Setup(spatialHashModule.spatialHash);
            // TODO: Support module dependencies via ConnectInterfaces
            GetNestedModule <Rays>().ignoreList = intersectionModule.standardIgnoreList;

            AddModule <SnappingModule>();

            var vacuumables = GetNestedModule <Vacuumables>();

            var miniWorlds      = GetNestedModule <MiniWorlds>();
            var workspaceModule = AddModule <WorkspaceModule>();
            workspaceModule.preserveWorkspaces  = preserveLayout;
            workspaceModule.workspaceCreated   += vacuumables.OnWorkspaceCreated;
            workspaceModule.workspaceCreated   += miniWorlds.OnWorkspaceCreated;
            workspaceModule.workspaceCreated   += workspace => { deviceInputModule.UpdatePlayerHandleMaps(); };
            workspaceModule.workspaceDestroyed += vacuumables.OnWorkspaceDestroyed;
            workspaceModule.workspaceDestroyed += miniWorlds.OnWorkspaceDestroyed;

            UnityBrandColorScheme.sessionGradient          = UnityBrandColorScheme.GetRandomCuratedLightGradient();
            UnityBrandColorScheme.saturatedSessionGradient = UnityBrandColorScheme.GetRandomCuratedGradient();

            var sceneObjectModule = AddModule <SceneObjectModule>();
            sceneObjectModule.tryPlaceObject = (obj, targetScale) =>
            {
                foreach (var miniWorld in miniWorlds.worlds)
                {
                    if (!miniWorld.Contains(obj.position))
                    {
                        continue;
                    }

                    var referenceTransform = miniWorld.referenceTransform;
                    obj.transform.parent = null;
                    obj.position         = referenceTransform.position + Vector3.Scale(miniWorld.miniWorldTransform.InverseTransformPoint(obj.position), miniWorld.referenceTransform.localScale);
                    obj.rotation         = referenceTransform.rotation * Quaternion.Inverse(miniWorld.miniWorldTransform.rotation) * obj.rotation;
                    obj.localScale       = Vector3.Scale(Vector3.Scale(obj.localScale, referenceTransform.localScale), miniWorld.miniWorldTransform.lossyScale.Inverse());

                    spatialHashModule.AddObject(obj.gameObject);
                    return(true);
                }

                return(false);
            };

            AddModule <HapticsModule>();
            AddModule <SpatialHintModule>();
            AddModule <SpatialScrollModule>();

            AddModule <FeedbackModule>();

            AddModule <WebModule>();

            //TODO: External module support (removes need for CCU in this instance)
#if INCLUDE_POLY_TOOLKIT
            AddModule <PolyModule>();
#endif

            viewer.AddPlayerModel();

            GetNestedModule <Rays>().CreateAllProxies();

            // In case we have anything selected at start, set up manipulators, inspector, etc.
            EditorApplication.delayCall += OnSelectionChanged;
        }
Example #36
0
 public MenuBar(AutomationElement automationElement, ActionListener actionListener)
     : base(automationElement, actionListener)
 {
     topLevelMenu = new Menus(automationElement, actionListener);
 }
        public override void OnInspectorGUI()
        {
            CharacterSelection t = (CharacterSelection)target;

            EditorGUILayout.Space();
            actualMenu = (Menus)GUILayout.SelectionGrid((int)actualMenu, menuNames, 3);

            switch (actualMenu)
            {
            //
            //
            // UI
            //
            //
            case Menus.UI:
                EditorGUILayout.Space();
                EditorGUILayout.LabelField("Main Screen");
                EditorGUIUtility.labelWidth = 150;
                t.coinsText           = EditorGUILayout.ObjectField("Coins Text", t.coinsText, typeof(Text), true) as Text;
                t.nameText            = EditorGUILayout.ObjectField("Name Text", t.nameText, typeof(Text), true) as Text;
                t.descriptionText     = EditorGUILayout.ObjectField("Description Text", t.descriptionText, typeof(Text), true) as Text;
                t.descriptionTextSize = EditorGUILayout.IntField("Description Text Size", t.descriptionTextSize);
                t.selectButton        = EditorGUILayout.ObjectField("Select Button", t.selectButton, typeof(GameObject), true) as GameObject;
                t.buyButton           = EditorGUILayout.ObjectField("Buy Button", t.buyButton, typeof(GameObject), true) as GameObject;
                t.priceText           = EditorGUILayout.ObjectField("Price Text", t.priceText, typeof(Text), true) as Text;

                EditorGUILayout.Space();
                EditorGUILayout.LabelField("Confirm Purchase Screen");
                t.confirmPurchaseScreen = EditorGUILayout.ObjectField("Screen Rect", t.confirmPurchaseScreen, typeof(RectTransform), true) as RectTransform;
                t.confirmPurchaseText   = EditorGUILayout.ObjectField("Confirm Text", t.confirmPurchaseText, typeof(Text), true) as Text;
                t.confirmPurchaseButton = EditorGUILayout.ObjectField("Buy Button", t.confirmPurchaseButton, typeof(GameObject), true) as GameObject;
                break;

            //
            //
            // GLOBAL
            //
            //
            case Menus.Global:
                EditorGUILayout.Space();
                EditorGUIUtility.labelWidth = 107;
                t.prefabContainer           = EditorGUILayout.ObjectField(new GUIContent(
                                                                              "Prefab Container",
                                                                              "Here all the prefab from the characters will be stored. Is also the reference position to where the characters will be shown in the scene"),
                                                                          t.prefabContainer, typeof(Transform), true) as Transform;

                GUILayout.BeginHorizontal();
                EditorGUILayout.LabelField(new GUIContent(
                                               "Camera Offset",
                                               "How far from the characters should the Camera be"),
                                           GUILayout.MaxWidth(90));
                t.cameraOffset = EditorGUILayout.Vector3Field("", t.cameraOffset, GUILayout.MinWidth(10));
                GUILayout.EndHorizontal();

                EditorGUILayout.Space();
                EditorGUIUtility.labelWidth = 175;
                t.dragDeltaMultiplty        = EditorGUILayout.FloatField(new GUIContent(
                                                                             "Drag Multiply",
                                                                             "The bigger the number, the faster the camera will move when a finger/mouse is draged in the screen"),
                                                                         t.dragDeltaMultiplty);

                t.distanceBetweenCharacters = EditorGUILayout.FloatField(new GUIContent(
                                                                             "Distance Between Characters",
                                                                             "How far should the character be from each other"),
                                                                         t.distanceBetweenCharacters);

                EditorGUILayout.Space();
                EditorGUILayout.LabelField("Highlighted State");
                EditorGUIUtility.labelWidth = 10;

                GUILayout.BeginHorizontal();
                EditorGUILayout.LabelField(new GUIContent(
                                               "Scale",
                                               "The scale of the highlighted character"),
                                           GUILayout.MaxWidth(50));
                t.highlightedScale = EditorGUILayout.Vector3Field("", t.highlightedScale);
                GUILayout.EndHorizontal();

                GUILayout.BeginHorizontal();
                EditorGUILayout.LabelField(new GUIContent(
                                               "Offset",
                                               "The position of the highlighted character relative to its original position"),
                                           GUILayout.MaxWidth(50));
                t.highlightedOffsetPosition = EditorGUILayout.Vector3Field("", t.highlightedOffsetPosition);
                GUILayout.EndHorizontal();

                EditorGUILayout.Space();
                EditorGUILayout.Space();
                EditorGUIUtility.labelWidth = 50;
                t.rotate = (CharacterSelection.Rotate)EditorGUILayout.EnumPopup("Rotate", t.rotate, GUILayout.MaxWidth(175));
                if (t.rotate != CharacterSelection.Rotate.None)
                {
                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.LabelField(new GUIContent(
                                                   "Speed",
                                                   "How many angles per second should the character rotate"),
                                               GUILayout.MaxWidth(50));
                    EditorGUIUtility.labelWidth = 0;
                    t.rotationSpeed             = EditorGUILayout.Vector3Field("", t.rotationSpeed);
                    EditorGUILayout.EndHorizontal();
                }
                if (t.rotate == CharacterSelection.Rotate.OnlyHighlighted)
                {
                    EditorGUIUtility.labelWidth = 100;
                    t.returnSpeed = EditorGUILayout.FloatField(new GUIContent(
                                                                   "Return Speed",
                                                                   "How fast should the character returns to its original rotation after another one was selected"),
                                                               t.returnSpeed, GUILayout.MaxWidth(150));
                }
                break;

            //
            //
            // SPECIFIC
            //
            //
            case Menus.Specific:
                EditorGUILayout.Space();
                EditorGUILayout.LabelField((actualCharacterIndex + 1).ToString() + " / " + t.characterSetup.Length.ToString());

                EditorGUILayout.BeginHorizontal();
                if (GUILayout.Button("<"))
                {
                    if (actualCharacterIndex > 0)
                    {
                        actualCharacterIndex--;
                    }
                }
                if (GUILayout.Button(">"))
                {
                    if (actualCharacterIndex < t.characterSetup.Length - 1)
                    {
                        actualCharacterIndex++;
                    }
                }
                if (GUILayout.Button("+"))
                {
                    System.Array.Resize(ref t.characterSetup, t.characterSetup.Length + 1);
                    t.characterSetup[t.characterSetup.Length - 1] = new CharacterSelection.CharacterSetup();
                    actualCharacterIndex = t.characterSetup.Length - 1;
                }
                if (GUILayout.Button("-"))
                {
                    if (t.characterSetup.Length > 1)
                    {
                        System.Array.Resize(ref t.characterSetup, t.characterSetup.Length - 1);
                    }
                    if (actualCharacterIndex > t.characterSetup.Length - 1)
                    {
                        actualCharacterIndex = t.characterSetup.Length - 1;
                    }
                }
                GUILayout.EndHorizontal();

                EditorGUILayout.Space();

                EditorGUIUtility.labelWidth = 115;
                t.characterSetup[actualCharacterIndex].preFabScreen = EditorGUILayout.ObjectField("Prerab (Screen)",
                                                                                                  t.characterSetup[actualCharacterIndex].preFabScreen, typeof(GameObject), true) as GameObject;

                EditorGUIUtility.labelWidth = 115;
                t.characterSetup[actualCharacterIndex].prefabGameplay = EditorGUILayout.ObjectField("Prerab (Gameplay)",
                                                                                                    t.characterSetup[actualCharacterIndex].prefabGameplay, typeof(GameObject), true) as GameObject;

                EditorGUIUtility.labelWidth = 50;
                t.characterSetup[actualCharacterIndex].name = EditorGUILayout.TextField("Name",
                                                                                        t.characterSetup[actualCharacterIndex].name);

                EditorGUIUtility.labelWidth = 50;
                t.characterSetup[actualCharacterIndex].price =
                    EditorGUILayout.IntField(new GUIContent(
                                                 "Price",
                                                 "If the price is set as 0 or less the character will be considered unlocked"),
                                             t.characterSetup[actualCharacterIndex].price, GUILayout.MaxWidth(115));



                EditorGUILayout.LabelField("Description");
                EditorStyles.textField.wordWrap = true;
                t.characterSetup[actualCharacterIndex].description = EditorGUILayout.TextArea(
                    t.characterSetup[actualCharacterIndex].description, GUILayout.MinHeight(250));
                break;
            }

            Undo.RecordObject(t, "Character Selection");
            EditorUtility.SetDirty(t);
        }
Example #38
0
        private void SetMenu(int index)
        {
            int oldIndex = (int)menu;
            menus[oldIndex].SetActive(false);
            menuButtons[oldIndex].isEnabled = true;

            menu = (Menus)index;
            menus[index].SetActive(true);
            menuButtons[index].isEnabled = false;

            description.transform.parent.gameObject.SetActive(NeedDescription[index]);
            description.text = string.Empty;
        }
        static void Main(string[] args)
        {
            Menus      menu = new Menus();
            Repository repo = new Repository();

            //declaring userInput so the scanner menu input works
            string userInput = "";

            do
            {
                // displays main menu
                menu.DisplayMainMenu();
                userInput = Console.ReadLine();

                //nested if-statements for users input
                if (userInput == "1")
                {
                    //displays which MediaType they want to add
                    menu.DisplayMediaTypeMenu();
                    userInput = Console.ReadLine();

                    switch (userInput)
                    {
                    case "1":
                        //movie menu
                        menu.AskUserForMovie();
                        break;

                    case "2":
                        //show menu
                        menu.AskUserForShow();
                        break;

                    case "3":
                        //video menu
                        menu.AskUserForVideo();
                        break;
                    }
                }
                else if (userInput == "2")
                {
                    //displays menu for reading the media from the file
                    menu.DisplayReadMediaMenu();
                    userInput = Console.ReadLine();

                    switch (userInput)
                    {
                    case "1":
                        //movie menu
                        repo.DeserializeMovies();
                        break;

                    case "2":
                        //show menu
                        repo.DeserializeShows();
                        break;

                    case "3":
                        //video menu
                        repo.DeserializeVideos();
                        break;
                    }
                }
            } while (userInput != ".");

            Console.WriteLine("Program Ended");
        }
	// Use this for initialization
	IEnumerator Start ()
	{
		#if !UNITY_WEBPLAYER || !PLAYPLAYFUN
		playPlayFun.SetActive(false);
		#endif

		#if UNITY_WEBPLAYER
		shopButton.SetActive(false);
		overtimeHubButton.SetActive(false);
		highScoreMenu.SetActive(false);
		shopGO.SetActive(false);
		overtimeHubGO.SetActive(false);
		#endif

		instance = this;

		activeMenu = Menus.Main;
		lastMenu = Menus.None;

		activeScreen = mainScreen.gameObject;

		//hide all others menus
		settingsScreen.gameObject.SetActive (false);
		creditsScreen.gameObject.SetActive (false);
		creepypediaScreen.gameObject.SetActive (false);
		gameStatsScreen.gameObject.SetActive (false);
		howToPlayScreen.gameObject.SetActive(false);

		wallTop = mainScreen.FindChild ("WallTop").GetComponent<TweenPosition> ();
		wallBottom = mainScreen.FindChild ("WallBottom").GetComponent<TweenPosition> ();
		highScore = wallTop.transform.FindChild ("High Score").FindChild ("Score").GetComponent<UILabel> ();

		hud.SetActive (false);
		UpdateScore ();

		#if UNITYANALYTICS_IMPLEMENTED
		if(!Global.sentOnEnterMenu)
		{
			UnityAnalyticsHelper.EnterOnMenu();
			Global.sentOnEnterMenu = true;
		}
		#endif

		yield return new WaitForSeconds(0.3f);

		hubConnectionScreen.gameObject.SetActive (false);
		shopScreen.gameObject.SetActive (false);
	}
        void fileCommandMenu_Selected(object sender, EventArgs e)
        {
            Global.game_system.play_se(System_Sounds.Confirm);
            var fileCommandMenu = sender as FileSelectedCommandMenu;
            var startGameMenu   = (Menus.ElementAt(1) as Window_Title_Start_Game);

            switch (fileCommandMenu.SelectedOption)
            {
            case Start_Game_Options.World_Map:
                MenuHandler.TitleStartGame(startGameMenu.file_id);
                break;

            case Start_Game_Options.Load_Suspend:
                startGameMenu.preview_suspend();
                var suspendConfirmWindow = FileConfirmWindow(
                    fileCommandMenu,
                    startGameMenu,
                    "Load suspend?");

                var suspendConfirmMenu = new ConfirmationMenu(suspendConfirmWindow);
                suspendConfirmMenu.Confirmed += suspendConfirmMenu_Confirmed;
                suspendConfirmMenu.Canceled  += suspendConfirmMenu_Canceled;
                AddMenu(suspendConfirmMenu);
                break;

            case Start_Game_Options.Load_Map_Save:
                startGameMenu.preview_checkpoint();
                var checkpointConfirmWindow = FileConfirmWindow(
                    fileCommandMenu,
                    startGameMenu,
                    "Load checkpoint?");

                var checkpointConfirmMenu = new ConfirmationMenu(checkpointConfirmWindow);
                checkpointConfirmMenu.Confirmed += checkpointConfirmMenu_Confirmed;
                checkpointConfirmMenu.Canceled  += suspendConfirmMenu_Canceled;
                AddMenu(checkpointConfirmMenu);
                break;

            case Start_Game_Options.Move:
                menu_Closed(sender, e);
                startGameMenu.moving_file = true;
                break;

            case Start_Game_Options.Copy:
                menu_Closed(sender, e);
                startGameMenu.copying = true;
                break;

            case Start_Game_Options.Delete:
                var deleteConfirmWindow = FileConfirmWindow(
                    fileCommandMenu,
                    startGameMenu,
                    "Are you sure?");

                var deleteConfirmMenu = new ConfirmationMenu(deleteConfirmWindow);
                deleteConfirmMenu.Confirmed += deleteConfirmMenu_Confirmed;
                deleteConfirmMenu.Canceled  += menu_Closed;
                AddMenu(deleteConfirmMenu);
                break;
            }
        }
	public void MoveToSettings()
	{
		if(menuTween.isActiveAndEnabled || DailyRewardController.IsActive || Popup.IsActive || Plasmette.IsSpinning) return;

		SoundController.Instance.PlaySoundFX(SoundController.SoundFX.Click);

		ActiveScreen = settingsScreen.gameObject;

		lastMenu = activeMenu;
		activeMenu = Menus.Settings;

		settingsScreen.gameObject.SetActive(false);
		settingsScreen.gameObject.SetActive(true);

		MoveScreen (true);
	}
        void checkpointConfirmMenu_Confirmed(object sender, EventArgs e)
        {
            var startGameMenu = (Menus.ElementAt(2) as Window_Title_Start_Game);

            MenuHandler.TitleLoadCheckpoint(startGameMenu.file_id);
        }
	public void MoveToGameStats()
	{
		if(menuTween.isActiveAndEnabled || DailyRewardController.IsActive || Popup.IsActive) return;

		SoundController.Instance.PlaySoundFX(SoundController.SoundFX.Click);

		ActiveScreen = gameStatsScreen.gameObject;

		lastMenu = activeMenu;
		activeMenu = Menus.GameStats;
		
		MoveScreen (true);
	}
Example #45
0
        public ActionResult Edit(Menus menus)
        {
            Menus objOri = db.Menus.Find(menus.Id);
            if (ModelState.IsValid)
            {
                var c = Request.Files[0];
                if (c != null && c.ContentLength > 0)
                {
                    #region 保存新文件
                    int lastSlashIndex = c.FileName.LastIndexOf("\\");
                    string fileName = c.FileName.Substring(lastSlashIndex + 1, c.FileName.Length - lastSlashIndex - 1);
                    int lastDotIndex = fileName.LastIndexOf(".");
                    string fileType = fileName.Substring(lastDotIndex + 1);
                    string guid = Guid.NewGuid().ToString();
                    string realName = guid + "." + fileType;
                    string savePath = Path.Combine(Server.MapPath("/Images/Products/"), realName);
                    c.SaveAs(savePath);
                    #endregion

                    #region 删除旧文件
                    bool isExists = System.IO.File.Exists(Path.Combine(Server.MapPath("/Images/Products/"), objOri.Src));
                    if (isExists)
                    {
                        System.IO.File.Delete(Path.Combine(Server.MapPath("/Images/Products/"), objOri.Src));
                    }
                    #endregion

                    objOri.Src = realName;
                }
                objOri.Pid = menus.Pid;
                objOri.Title = menus.Title;
                objOri.OrderNo = menus.OrderNo;
                objOri.IsPearlProvided = menus.IsPearlProvided;
                objOri.IsDelist = menus.IsDelist;
                objOri.EditerId = (int)Session["CurrentEmp"];
                objOri.EditTime = DateTime.Now;
                db.Entry(objOri).State = EntityState.Modified;
                db.SaveChanges();
                return RedirectToAction("Index");
            }
            IEnumerable<Menus> models = db.Database.SqlQuery<Menus>(_queryStr);
            ViewBag.Pid = new SelectList(models, "Id", "Title", menus.Id);
            return View(menus);
        }
	public void CloseScreen()
	{
		ActiveScreen = lastScreen;

		SoundController.Instance.PlaySoundFX(SoundController.SoundFX.Click);

		Menus lastlastMenu = activeMenu;
		activeMenu = lastMenu;
		lastMenu = lastlastMenu;

		MoveScreen(true);
	}
Example #47
0
 public StatusStrip(AutomationElement automationElement, ActionListener actionListener)
     : base(automationElement, actionListener)
 {
     topLevelMenu = new Menus(automationElement, actionListener);
 }
 void titleMenu_ClassReel(object sender, EventArgs e)
 {
     Menus.Clear();
     MenuHandler.TitleClassReel();
 }
Example #49
0
        public override WinformMenu GetMenuOrNull(string name)
        {
            var menu = Menus.GetOrDefault(name);

            return(menu);
        }
        public async Task <IActionResult> Index2()
        {
            var CurrentUser = await _userManager.GetUserAsync(User);

            var DefaultLanguageID = CurrentUser.DefaultLanguageId;

            var UICustomizationArray = new UICustomization(_context);

            ViewBag.Terms = await UICustomizationArray.UIArray(this.ControllerContext.RouteData.Values["controller"].ToString(), this.ControllerContext.RouteData.Values["action"].ToString(), DefaultLanguageID);

            Menus a = new Menus(_context);


            var FlowIds   = _context.ZdbInt.FromSql("FrontProcessToDoIndex2GetFlowId").ToList();
            var AndOrList = _context.ZdbFrontProcessToDoIndex2GetForAndOr.FromSql("FrontProcessToDoIndex2GetForAndOr").ToList();
//            int OldFlowId = 0;
            string FromStringStart = "SELECT DbProcess.Id , DbProcessTemplateLanguage.Name , dbprocess.CreatedDate " +
                                     " FROM DbProcess " +
                                     "JOIN DbProcessTemplateFlow " +
                                     "   ON DbProcess.ProcessTemplateId = DbProcessTemplateFlow.ProcessTemplateId " +
                                     "   AND DbProcess.StepId = DbProcessTemplateFlow.ProcessTemplateFromStepId " +
                                     "JOIN DbProcessTemplateFlowCondition " +
                                     "   ON DbProcessTemplateFlow.Id = DbProcessTemplateFlowCondition.ProcessTemplateFlowId " +
                                     "LEFT JOIN DbComparison " +
                                     "   ON DbProcessTemplateFlowCondition.ComparisonOperatorId = DbComparison.Id " +
                                     "JOIN DbProcessTemplateLanguage " +
                                     "   ON DbProcess.ProcessTemplateId = DbProcessTemplateLanguage.ProcessTemplateId ";

            string WhereStringStart = " WHERE StepId <> 0 AND ";
            string WhereString      = "";
            string FromString       = "";
            //string FullSQLFrom = "";
            //string FullSQLWhere = "";
            string FullSQL     = "";
            bool   FirstRecord = true;

            foreach (var FlowId in FlowIds)
            {
                FromString  = FromStringStart;
                WhereString = WhereStringStart + " DbProcessTemplateFlow.ID = " + FlowId.intValue;// + " AND ";

                if (AndOrList.Where(AndOr => AndOr.FlowId == FlowId.intValue).Count() > 0)
                {
                    WhereString += " AND ";
                }

                foreach (var AndOr in AndOrList.Where(AndOr => AndOr.FlowId == FlowId.intValue))
                {
                    switch (AndOr.ConditionTypeId)
                    {
                    case 1:
                        WhereString = WhereString + " DbProcessTemplateField AS TemplateField" + AndOr.ConditionId.ToString() + ".Id = " + AndOr.ConditionFieldId.ToString();

                        FromString = FromString + " JOIN DbProcessTemplateField TemplateField" + AndOr.ConditionId.ToString() + " ON DbProcessTemplateFlow.ProcessTemplateId = TemplateField" + AndOr.ConditionId.ToString() + ".ProcessTemplateId ";
                        FromString = FromString + " JOIN DbProcessField Field" + AndOr.ConditionId.ToString() + " ON Field" + AndOr.ConditionId.ToString() + ".ProcessTemplateFieldId = TemplateField" + AndOr.ConditionId.ToString() + ".Id";
                        FromString = FromString + " AND Field" + AndOr.ConditionId.ToString() + ".ProcessId = DbProcess.Id";
                        break;

                    case 2:
                        WhereString = WhereString + " DbProcess.CreatorId = '" + CurrentUser.Id.ToString() + "' ";
                        break;

                    case 3:
                        FromString = FromString + " JOIN DbProcessTemplateField TemplateField" + AndOr.ConditionId.ToString() + " ON DbProcessTemplateFlow.ProcessTemplateId = TemplateField" + AndOr.ConditionId.ToString() + ".ProcessTemplateId ";
                        FromString = FromString + " JOIN DbProcessField Field" + AndOr.ConditionId.ToString() + " ON Field" + AndOr.ConditionId.ToString() + ".ProcessTemplateFieldId = TemplateField" + AndOr.ConditionId.ToString() + ".Id";
                        FromString = FromString + " AND Field" + AndOr.ConditionId.ToString() + ".ProcessId = DbProcess.Id ";
                        FromString = FromString + " JOIN AspNetUsers User" + AndOr.ConditionId.ToString() + " ON User" + AndOr.ConditionId.ToString() + ".Id = Field" + AndOr.ConditionId.ToString() + ".StringValue ";

                        WhereString = WhereString + " DbProcessTemplateFlowCondition.ProcessTemplateFlowConditionInt <= " + CurrentUser.SecurityLevel.ToString() + " ";
                        break;

                    case 4:

                        FromString = FromString + " JOIN DbProcessTemplateField TemplateField" + AndOr.ConditionId.ToString() + " ON DbProcessTemplateFlow.ProcessTemplateId = TemplateField" + AndOr.ConditionId.ToString() + ".ProcessTemplateId ";
                        FromString = FromString + " JOIN DbProcessField Field" + AndOr.ConditionId.ToString() + " ON Field" + AndOr.ConditionId.ToString() + ".ProcessTemplateFieldId = TemplateField" + AndOr.ConditionId.ToString() + ".Id ";
                        FromString = FromString + " AND Field" + AndOr.ConditionId.ToString() + ".ProcessId = DbProcess.Id";
                        FromString = FromString + " JOIN AspNetUserRoles Role" + AndOr.ConditionId.ToString() + " ON Role" + AndOr.ConditionId.ToString() + ".RoleId = Field" + AndOr.ConditionId.ToString() + ".StringValue ";

                        WhereString = WhereString + " Role" + AndOr.ConditionId.ToString() + ".UserId ='" + CurrentUser.Id.ToString() + "' ";
                        break;

                    case 5:

                        FromString = FromString + " JOIN DbProcessTemplateField TemplateField" + AndOr.ConditionId.ToString() + " ON DbProcessTemplateFlow.ProcessTemplateId = TemplateField" + AndOr.ConditionId.ToString() + ".ProcessTemplateId ";
                        FromString = FromString + " JOIN DbProcessField Field1 ON Field" + AndOr.ConditionId.ToString() + ".ProcessTemplateFieldId = TemplateField" + AndOr.ConditionId.ToString() + ".Id ";
                        FromString = FromString + " AND Field" + AndOr.ConditionId.ToString() + ".ProcessId = DbProcess.Id ";
                        FromString = FromString + " JOIN dbUserRelation Relation" + AndOr.ConditionId.ToString() + " ON Relation" + AndOr.ConditionId.ToString() + ".FromUserId = Field" + AndOr.ConditionId.ToString() + ".StringValue ";

                        WhereString = WhereString + " Relation" + AndOr.ConditionId.ToString() + ".ToUserId ='" + CurrentUser.Id.ToString() + "' ";
                        WhereString = WhereString + " AND DbProcessTemplateField AS TemplateField" + AndOr.ConditionId.ToString() + ".ProcessTemplateFieldTypeId = 11" + AndOr.ConditionFieldId.ToString();
                        WhereString = WhereString + " AND DbProcessField AS Field" + AndOr.ConditionId.ToString() + ".StringValue = Relation" + AndOr.ConditionId.ToString() + ".FromUserId ";
                        break;

                    case 6:
                        WhereString = WhereString + " DbProcessTemplateField AS TemplateField" + AndOr.ConditionId.ToString() + ".ProcessTemplateFieldTypeId = 13" + AndOr.ConditionFieldId.ToString();
                        WhereString = WhereString + " AND DbProcessField AS Field" + AndOr.ConditionId.ToString() + ".StringValue = DbUserOrganization.OrganizationId ";
                        WhereString = WhereString + " AND DbUserOrganization AS UserOrganization" + AndOr.ConditionId.ToString() + ".UserId = '" + CurrentUser.Id + "' ";
                        break;

                    case 9:
                        WhereString += " ( ";
                        break;

                    case 10:
                        WhereString += " AND ";
                        break;

                    case 11:
                        WhereString += " OR ";
                        break;

                    case 12:
                        WhereString += " ) ";
                        break;

                    case 13:
                        FromString = FromString + " JOIN DbProcessTemplateField TemplateField" + AndOr.ConditionId.ToString() + " ON DbProcessTemplateFlow.ProcessTemplateId = TemplateField" + AndOr.ConditionId.ToString() + ".ProcessTemplateId ";
                        FromString = FromString + " JOIN DbProcessField Field1 ON Field" + AndOr.ConditionId.ToString() + ".ProcessTemplateFieldId = TemplateField" + AndOr.ConditionId.ToString() + ".Id ";
                        FromString = FromString + " AND Field" + AndOr.ConditionId.ToString() + ".ProcessId = DbProcess.Id ";
                        break;

                    case 14:

                        FromString = FromString + " JOIN dbUserRelation Relation" + AndOr.ConditionId.ToString() + " ON Relation" + AndOr.ConditionId.ToString() + ".FromUserId = dbProcess.CreatorId ";

                        WhereString = WhereString + " DbProcess.CreatorId = Relation" + AndOr.ConditionId.ToString() + ".FromUserId ";// + CurrentUser.Id.ToString() + "' ";
                        WhereString = WhereString + " AND Relation" + AndOr.ConditionId.ToString() + ".ToUserId ='" + CurrentUser.Id.ToString() + "' ";
                        break;

                    case 15:
                        FromString = FromString + " JOIN AspNetUsers User" + AndOr.ConditionId.ToString() + " ON User" + AndOr.ConditionId.ToString() + ".Id = dbProcess.CreatorId ";
                        break;
                    }
                }
                if (FirstRecord)
                {
                    FullSQL = FullSQL + FromString + WhereString;
                }
                else
                {
                    FullSQL = FullSQL + " UNION ALL " + FromString + WhereString;
                }
                FirstRecord = false;

                //  FullSQL = FullSQL + FromStringStart + FromString + WhereString;

                //if (AndOr.FlowId != OldFlowId )
                //{
                //    WhereString = WhereString + ")) ";
                //}

                // OldFlowId = AndOr.FlowId;
            }
            //            WhereString = WhereString + " ) )";
            var ToDo = _context.ZdbFrontProcessToDoIndex2Get.FromSql(FullSQL).ToList();

            return(View(ToDo));
        }
Example #51
0
	// Use this for initialization
	void Start () {
        Menus.instance = this;
	}
Example #52
0
        public MenuLoader(Menus.MenusManager manager)
        {
            this.m_Manager = manager;

            // Check to make sure our menu information file exists.
            if (!File.Exists(Central.Manager.Settings["RootPath"] + Path.DirectorySeparatorChar + "Menus.xml"))
                throw new Exception("Menu information file was not found.  Please make sure Menus.xml exists in the application directory.");

            // Set the default stores.
            this.ActiveMenuStore = this.MainMenu;
            this.ActiveToolStore = this.ToolBar;

            // Read our menu data.
            this.m_Reader = XmlReader.Create(new StreamReader(Central.Manager.Settings["RootPath"] + Path.DirectorySeparatorChar + "Menus.xml"));
            while (this.m_Reader.Read())
            {
                switch (this.m_Reader.NodeType)
                {
                    case XmlNodeType.Element:
                        switch (this.m_Reader.Name)
                        {
                            case "menus":
                            case "menubar":
                            case "toolbar":
                                // Nothing to do here.
                                break;
                            case "menuitem":
                                {
                                    // Check to see if this is an empty element.
                                    if (this.m_Reader.IsEmptyElement)
                                    {
                                        // Use reflection to create an instance of the action.
                                        Action a = this.GetActionByName(this.m_Reader.GetAttribute("action"));

                                        // Add it to the list of main menu items.
                                        this.ActiveMenuStore.Add(a);
                                    }
                                    else
                                    {
                                        // This menu item contains other menu items, move the currently
                                        // active menu store into the parent list and create a new active
                                        // menu store.
                                        this.ParentMenuStores.Push(this.ActiveMenuStore);
                                        this.ActiveMenuStore = new DynamicGroupAction(this.m_Reader.GetAttribute("text"));
                                    }
                                }
                                break;
                            case "menuseperator":
                                {
                                    // Create a new SeperatorAction.
                                    Action a = new SeperatorAction();

                                    // Add it to the list of main menu items.
                                    this.ActiveMenuStore.Add(a);
                                }
                                break;
                            case "toolitem":
                                {
                                    // Check to see if this is an empty element.
                                    if (this.m_Reader.IsEmptyElement)
                                    {
                                        // Use reflection to create an instance of the action.
                                        Action a = this.GetActionByName(this.m_Reader.GetAttribute("action"));

                                        // Add it to the list of main menu items.
                                        this.ActiveToolStore.Add(a);
                                    }
                                    else if (this.m_Reader.GetAttribute("action") != null)
                                    {
                                        // Use reflection to create an instance of the action.
                                        Action a = this.GetActionByName(this.m_Reader.GetAttribute("action"));

                                        // This menu item contains other menu items, move the currently
                                        // active menu store into the parent list and create a new active
                                        // menu store.
                                        this.ParentToolStores.Push(this.ActiveToolStore);
                                        this.ActiveToolStore = new DynamicGroupAction(a);
                                    }
                                    else
                                    {
                                        // This menu item contains other menu items, move the currently
                                        // active menu store into the parent list and create a new active
                                        // menu store.
                                        this.ParentToolStores.Push(this.ActiveToolStore);
                                        this.ActiveToolStore = new DynamicGroupAction(this.m_Reader.GetAttribute("text"));
                                    }
                                }
                                break;
                            case "toolseperator":
                                {
                                    // Create a new SeperatorAction.
                                    Action a = new SeperatorAction();

                                    // Add it to the list of main menu items.
                                    this.ActiveToolStore.Add(a);
                                }
                                break;
                                /*
                            case "toolitem":
                                if (this.m_Reader.GetAttribute("type") == "dropdown")
                                    this.AddToolDropDown(this.m_Reader.GetAttribute("text"));
                                else
                                    this.AddToolItem(this.m_Reader.GetAttribute("text"));

                                this.AddReflectionHandler(this.m_Reader.GetAttribute("action"));

                                if (this.m_Reader.IsEmptyElement)
                                {
                                    // Automatically end element.
                                    c_ActiveItem = c_ActiveItem.OwnerItem;
                                    this.UpdateObjects();

                                    // The parent had some menu items, therefore we
                                    // enable it regardless of whether it has an action.
                                    if (c_ActiveItem != null)
                                        c_ActiveItem.Enabled = true;
                                }
                                break;
                            case "toolseperator":
                                this.AddToolItem("-");

                                if (this.m_Reader.IsEmptyElement)
                                {
                                    // Automatically end element.
                                    c_ActiveItem = c_ActiveItem.OwnerItem;
                                    this.UpdateObjects();

                                    // The parent had some menu items, therefore we
                                    // enable it regardless of whether it has an action.
                                    if (c_ActiveItem != null)
                                        c_ActiveItem.Enabled = true;
                                }
                                break;
                            case "toolcombo":
                                this.AddToolComboBox(this.m_Reader.GetAttribute("text"));

                                /* FIXME: Implement this.
                                if (this.m_Reader.GetAttribute("editable") == "false")
                                    c_ActiveComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
                                 *

                                //this.AddReflectionHandler(this.Reader.GetAttribute("action"));

                                if (this.m_Reader.IsEmptyElement)
                                {
                                    // Automatically end element.
                                    c_ActiveItem = c_ActiveItem.OwnerItem;
                                    this.UpdateObjects();

                                    // The parent had some menu items, therefore we
                                    // enable it regardless of whether it has an action.
                                    if (c_ActiveItem != null)
                                        c_ActiveItem.Enabled = true;
                                }
                                break;
                            case "text":
                                this.UpdateObjects();

                                if (c_ActiveComboBox != null)
                                {
                                    Type enumType = m_CurrentAssembly.GetType(this.m_Reader.GetAttribute("type"));
                                    if (enumType != null)
                                    {
                                        Array enumValues = Enum.GetValues(enumType);
                                        foreach (object o in enumValues)
                                        {
                                            String name = Enum.GetName(enumType, o);
                                            if (this.m_Reader.GetAttribute("type") + "." + name == this.m_Reader.GetAttribute("value"))
                                            {
                                                // HACK: This could probably be organised better by
                                                //       using classes instead of enums, but oh well..
                                                switch (this.m_Reader.GetAttribute("type"))
                                                {
                                                    case "Moai.Compilation.BuildMode":
                                                        c_ActiveComboBox.Items.Add(
                                                            new EnumWrapper(
                                                                (Int32)o,
                                                                new List<String>() { "Debug", "Release" })
                                                            );
                                                        break;
                                                    default:
                                                        c_ActiveComboBox.Items.Add(o);
                                                        break;
                                                }
                                            }
                                        }
                                    }
                                }
                                break;
                                 */
                        }
                        break;
                    case XmlNodeType.EndElement:
                        switch (this.m_Reader.Name)
                        {
                            case "menus":
                            case "menubar":
                            case "toolbar":
                                // Nothing to do here.
                                break;
                            case "menuitem":
                                {
                                    // Check to see if this is not an empty element.
                                    if (!this.m_Reader.IsEmptyElement)
                                    {
                                        // Finish this menu section up.
                                        this.ParentMenuStores.Peek().Add(this.ActiveMenuStore);
                                        this.ActiveMenuStore = this.ParentMenuStores.Pop();
                                    }
                                }
                                break;
                            case "toolitem":
                                {
                                    // Check to see if this is not an empty element.
                                    if (!this.m_Reader.IsEmptyElement)
                                    {
                                        // Finish this menu section up.
                                        this.ParentToolStores.Peek().Add(this.ActiveToolStore);
                                        this.ActiveToolStore = this.ParentToolStores.Pop();
                                    }
                                }
                                break;
                                /*
                            case "toolitem":
                                c_ActiveItem = c_ActiveItem.OwnerItem;
                                this.UpdateObjects();

                                // The parent had some menu items, therefore we
                                // enable it regardless of whether it has an action.
                                if (c_ActiveItem != null)
                                    c_ActiveItem.Enabled = true;
                                break;
                            case "menuseperator":
                                c_ActiveItem = c_ActiveItem.OwnerItem;
                                this.UpdateObjects();

                                // The parent had some menu items, therefore we
                                // enable it regardless of whether it has an action.
                                if (c_ActiveItem != null && !(c_ActiveItem is IToolStripDropDownButton))
                                    c_ActiveItem.Enabled = true;
                                break;
                            case "toolseperator":
                                c_ActiveItem = c_ActiveItem.OwnerItem;
                                this.UpdateObjects();

                                // The parent had some menu items, therefore we
                                // enable it regardless of whether it has an action.
                                if (c_ActiveItem != null)
                                    c_ActiveItem.Enabled = true;
                                break;
                                 */
                        }
                        break;
                }
            }

            this.m_Reader.Close();
        }
Example #53
0
    void OnGUI()
    {
        if (!isPaused)
        {
            return;
        }

        if (currentMenu == Menus.Main)
        {
            GUI.BeginGroup(new Rect(Screen.width / 2 - 125, Screen.height / 2 - 125, 250, 370));
            GUI.Box(new Rect(0, 0, 250, 570), "Menu");
            if (GUI.Button(new Rect(25, 20, 200, 50), "Resume"))
            {
                unpause();
            }
            if (GUI.Button(new Rect(25, 90, 200, 50), "Levels"))
            {
                currentMenu = Menus.Levels;
            }
            if (GUI.Button(new Rect(25, 160, 200, 50), "Options"))
            {
                if (playerObject)
                {
                    currentMenu = Menus.Options;
                }
            }
            if (GUI.Button(new Rect(25, 230, 200, 50), "Restart"))
            {
                unpause();
                Application.LoadLevel(Application.loadedLevel);
            }
            if (GUI.Button(new Rect(25, 290, 200, 50), "Exit"))
            {
                Application.Quit();
            }
            GUI.EndGroup();
        }
        else if (currentMenu == Menus.Levels)
        {
            GUI.BeginGroup(new Rect(Screen.width / 2 - 125, Screen.height / 2 - 125, 500, 370));
            GUI.Box(new Rect(0, 0, 250, 570), "Levels");
            for (int i = 0; i < availableLevels.Length; i++)
            {
                if (GUI.Button(new Rect(25, i * 70 + 20, 200, 50), availableLevels[i]))
                {
                    Application.LoadLevel(i);
                    unpause();
                }
            }

            if (GUI.Button(new Rect(25, 290, 200, 50), "Back"))
            {
                currentMenu = Menus.Main;
            }
            GUI.EndGroup();
        }
        else if (isPaused && currentMenu == Menus.Options && playerObject)
        {
            GUI.BeginGroup(new Rect(Screen.width / 2 - 250, Screen.height / 2 - 125, 500, 300));
            GUI.Box(new Rect(0, 0, 500, 300), "Menu");
            if (GUI.Button(new Rect(150, 240, 200, 50), "Done"))
            {
                currentMenu = Menus.Main;
            }
            ff.Inverted = GUI.Toggle(new Rect(25, 20, 200, 20), ff.Inverted, "Inverted Controls");
            StatsView sv = gameObject.GetComponent <StatsView>();
            if (sv)
            {
                sv.enabled           = GUI.Toggle(new Rect(25, 40, 200, 20), sv.enabled, "Show Physics Statistics");
                sv.showAbbreviations = GUI.Toggle(new Rect(25, 60, 200, 20), sv.showAbbreviations, "Show Unit Abbreviations");
                if (ff.flightPhysics != null)
                {
                    //Admittedly, this is a bit hacky. We convert the Unit enum to an integer,
                    //asign the selection to a string array that *matches* the enums by index,
                    //then convert the integer back to a Unit enum. Hacky, but works. Maybe it
                    //would be better to add string-settable unit types to the unit converter.
                    int      unitSelection = (int)ff.flightPhysics.Unit;
                    string[] choices       = new string[] { "Metric", "Imperial" };
                    unitSelection         = GUI.SelectionGrid(new Rect(25, 80, 150, 30), unitSelection, choices, 2);
                    ff.flightPhysics.Unit = (UnitConverter.Units)unitSelection;
                }
            }
            GUI.EndGroup();
        }
    }
 void pause()
 {
     Time.timeScale = 0.0f;
     isPaused = true;
     currentMenu = Menus.Main;
 }
Example #55
0
        public static Menus getOpciones(string id)
        {
            Menus menu = new Menus();

            switch (id)
            {
            case "Abm Rol":
                menu.carpeta = "Abm_Rol";
                menu.form    = "Form1";
                break;

            case "Abm Cliente":
                menu.carpeta = "Abm_Cliente";
                menu.form    = "Form1";
                break;

            case "Abm Empresa Espectaculo":
                menu.carpeta = "Abm_Empresa_Espectaculo";
                menu.form    = "Form1";
                break;

            case "Abm Rubro":
                menu.carpeta = "Abm_Rubro";
                menu.form    = "Form1";
                break;

            case "Abm Grado":
                menu.carpeta = "Abm_Grado";
                menu.form    = "Form1";
                break;

            case "Generar Publicacion":
                menu.carpeta = "Generar_Publicacion";
                menu.form    = "Form1";
                break;

            case "Editar Publicacion":
                menu.carpeta = "Editar_Publicacion";
                menu.form    = "Form1";
                break;

            case "Comprar":
                menu.carpeta = "Comprar";
                menu.form    = "Form1";
                break;

            case "Historial del Cliente":
                menu.carpeta = "Historial_Cliente";
                menu.form    = "Form1";
                break;

            case "Canjear Puntos":
                menu.carpeta = "Canje_Puntos";
                menu.form    = "Form1";
                break;

            case "Generar Pago de Comisiones":
                menu.carpeta = "Generar_Rendicion_Comisiones";
                menu.form    = "Form1";
                break;

            case "Listado Estadistico":
                menu.carpeta = "Listado_Estadistico";
                menu.form    = "Form1";
                break;
            }
            return(menu);
        }
Example #56
0
 public void NewGame()
 {
     //Go to Character Creation Screen
     currentMenu = Menus.NewGame;
 }
Example #57
0
 void pause()
 {
     Time.timeScale = 0.0f;
     isPaused       = true;
     currentMenu    = Menus.Main;
 }