Inheritance: MonoBehaviour
Beispiel #1
0
        public async Task <IHttpActionResult> Putmenu(int id, menu menu)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != menu.id)
            {
                return(BadRequest());
            }

            db.Entry(menu).State = EntityState.Modified;

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!menuExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Beispiel #2
0
        private void bntCrear_Click(object sender, EventArgs e)
        {
            string msj = "";

            try
            {
                menu men = new menu();
                men.descripcion = txtDesc.Text.Trim();
                men.precio      = int.Parse(txtPrecio.Text.Trim());
                try
                {
                    DAOMenu dAOMenu = new DAOMenu();
                    dAOMenu.ingresoMenu(men);
                    msj = "Aviso\nCorrecta creacion de menu";
                }
                catch (Exception ex)
                {
                    msj = "Error\n" + ex.Message;
                }
            }
            catch (Exception exx)
            {
                msj = "Error\n" + exx.Message;
                msj = "Error\nEn el precio solo puede ingresar numeros";
            }
            MessageBox.Show(msj);
        }
Beispiel #3
0
        private void gunaGradientButton1_Click(object sender, EventArgs e)
        {
            SqlCommand cmd = new SqlCommand("Select pass from Accounts where username = '******'", cn);

            cn.Open();
            if (cmd.ExecuteScalar() != null)
            {
                string s  = cmd.ExecuteScalar().ToString();
                string s1 = CalculateMD5Hash(gunaTextBox1.Text).ToString();
                if (s1.ToString() == s.ToString())
                {
                    SqlCommand cmd1    = new SqlCommand("Select permLevel from Accounts where username = '******'", cn);
                    int        permlvl = Convert.ToInt32(cmd1.ExecuteScalar());
                    menu       menu    = new menu();
                    menu.permleve = permlvl;
                    menu.Show();
                    menu.Text = "Menu Principal Session : [" + TxtLogin.Text.ToString() + "]";
                    this.Hide();
                }
                else
                {
                    txtWrong.Text      = "Mot de passe ou nom d'utilisateur inconnu veuillez verifier vos information";
                    txtWrong.ForeColor = System.Drawing.Color.Red;
                }
            }
            else
            {
                txtWrong.Text      = "Mot de passe ou nom d'utilisateur inconnu veuillez verifier vos information";
                txtWrong.ForeColor = System.Drawing.Color.Red;
            }
            cn.Close();
        }
Beispiel #4
0
 public void ToMonth()
 {
     curMenu = menu.Month;
     DisplayDayUI(false);
     DisplayEntryUI(false);
     DisplayMonthUI(true);
 }
        public static menu[] GetControlledVocabularyMenus()
        {
            // Get the installation path
            DirectoryInfo installationPath = StaticHelper.GetInstallationPath();

            // Iterate over Add-ins found
            DirectoryInfo buttonRoot = new DirectoryInfo(Path.Combine(installationPath.FullName, "Buttons"));

            DirectoryInfo[] buttons = buttonRoot.GetDirectories();

            menu[] menus = new menu[buttons.Length];
            int    i     = 0;

            foreach (FileInfo file in buttons.Select(button => new FileInfo(Path.Combine(button.FullName, "button.xml"))))
            {
                XmlSerializer deserializer = new XmlSerializer(typeof(menu));
                using (FileStream buttonStream = new FileStream(file.FullName, FileMode.Open, FileAccess.Read))
                {
                    try
                    {
                        menus[i] = (menu)deserializer.Deserialize(buttonStream);
                    }
                    catch (Exception ex)
                    {
                        LogMessage(MessageType.Error, ex.ToString());
                    }
                }

                i++;
            }

            return(menus);
        }
Beispiel #6
0
 public void ToTitle()
 {
     curMenu = menu.Main;
     DisplayMonthUI(false);
     titleThings.SetActive(true);
     AskProj(false);
 }
Beispiel #7
0
        public ActionResult Menuduzenle(menu model, HttpPostedFileBase ResimURL)
        {
            model.id = Convert.ToInt32(TempData["id"]);
            var kategori = sorgu.MenuGetir(model.id);

            if (ResimURL != null)
            {
                if (System.IO.File.Exists(Server.MapPath(kategori.resim)))
                {
                    System.IO.File.Delete(Server.MapPath(kategori.resim));
                }

                WebImage img           = new WebImage(ResimURL.InputStream);
                FileInfo imginfo       = new FileInfo(ResimURL.FileName);
                string   kategoriresim = Guid.NewGuid().ToString() + imginfo.Extension;
                img.Resize(370, 355, preserveAspectRatio: false);
                img.Save("~/Uploads/Menu/" + kategoriresim);
                model.resim = "/Uploads/Menu/" + kategoriresim;
            }

            else
            {
                model.resim = kategori.resim;
            }
            sorgu.MenukGuncelle(model);
            TempData["Uyari"] = "İşlem başarılı";
            return(RedirectToAction("Menuler"));
        }
        private List <menu> ListarItensMenu(int IDModulo)
        {
            DbCommand dbc = this.m_db.GetStoredProcCommand("dbo.SP_MODULOACESSOFILHO");

            this.m_db.AddInParameter(dbc, "@MODULO_ID", DbType.Int32, IDModulo);
            //
            List <menu> listaMenu = new List <menu>();

            using (IDataReader readerMenu = this.m_db.ExecuteReader(dbc))
            {
                while (readerMenu.Read())
                {
                    if (Conversion.preencheCampoInt(readerMenu["PODE_ACESSAR"]) == 1)
                    {
                        menu oMenu = new menu();
                        oMenu.ItemMenu = Conversion.preencheCampoString(readerMenu["DESCRICAO"]);
                        oMenu.Pagina   = Conversion.preencheCampoString(readerMenu["PAGINA_WEB"]);
                        oMenu.Visivel  = Conversion.preencheCampoBoolean(readerMenu["ITEM_MENU"]);

                        listaMenu.Add(oMenu);
                    }
                }
                readerMenu.Dispose();
            }
            return(listaMenu.Count > 0 ? listaMenu : null);
        }
Beispiel #9
0
        public List <menu> getAll()
        {
            List <menu> lstRS = new List <menu>();

            try
            {
                lstRS = dataContext.menus.Where(p => p.active > 0).OrderBy(x => x.master_id).ThenBy(x => x.order).ToList();
                menu root = new menu();
                root.active       = 1;
                root.code         = "ROOT";
                root.id           = 0;
                root.master_id    = 0;
                root.name         = "Menu chính";
                root.order        = 1;
                root.secure_level = 0;
                root.selectable   = 1;
                root.text         = "Menu chính";
                root.type         = 0;
                root.url          = "#";
                lstRS.Insert(0, root);
            }
            catch (Exception ex)
            {
                logger.Error("getAll error: ", ex);
            }
            return(lstRS);
        }
Beispiel #10
0
        public FacturaControl(menu parent)
        {
            this.parent = parent;
            InitializeComponent();
            this.Dock            = DockStyle.Fill;
            progressBar1.Visible = false;


            // add the clients to combobox
            foreach (clients c in clientes)
            {
                comboBox.Items.Add(c.id_client + "-" + c.nom);
            }

            dataGridView1.Controls.Add(comboBox);
            comboBox.Visible      = false;
            comboBox.TextChanged += ComboBox_TextChanged;

            //adding the datepicker to form
            dataGridView1.Controls.Add(dtp);
            dtp.Visible      = false;
            dtp.CustomFormat = "dd/MM/yyyy HH:mm";

            dtp.Format       = DateTimePickerFormat.Custom;
            dtp.TextChanged += new EventHandler(dtp_TextChange);
        }
Beispiel #11
0
        private void label1_Click(object sender, EventArgs e)
        {
            menu menu = new menu();

            menu.Show();
            this.Hide();
        }
Beispiel #12
0
        //删除
        public static int menuShanChu(menu m)
        {
            NewHope4Entities ent = new NewHope4Entities();
            var obj = ent.menu.Find(m.MID);

            obj.state = 1;
            return(ent.SaveChanges());
        }
Beispiel #13
0
 /// <summary>
 /// 添加
 /// </summary>
 public int add(menu record)
 {
     using (qdbEntities myDb = new qdbEntities())
     {
         myDb.menu.Add(record);
         return(myDb.SaveChanges());
     }
 }
Beispiel #14
0
        public ActionResult DeleteConfirmed(int id)
        {
            menu menu = db.menu.Find(id);

            db.menu.Remove(menu);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public ActionResult DeleteConfirmed(int id)
        {
            menu menu = db.menus.Find(id);

            db.menus.Remove(menu);
            db.SaveChanges();
            return(RedirectToAction("Index", new { restaurante = menu.restaurante }));
        }
Beispiel #16
0
    public void ViewEntry()
    {
        Debug.Log("click");
        var theClick = EventSystem.current.currentSelectedGameObject;

        if (theClick != null)
        {
            EntryPrefab e = theClick.GetComponent <EntryPrefab>();
            if (e != null)
            {
                Debug.Log("click2");
                curMenu = menu.Entry;
                DisplayMonthUI(false);
                DisplayDayUI(false);
                DisplayEntryUI(true);

                curEntry      = e;
                entryDay.text = e.date.text;
                entryLog.text = e.log.text;
                dudeImage.GetComponent <SpriteRenderer>().sprite = e.dude.sprite;
            }
            else if (theClick.tag == "byDate")
            {
                Debug.Log("check");
                // Check if the button was avaiable for a day
                System.DateTime dt         = new System.DateTime(curYear, curMonth, 1);
                int             firstDay   = (int)dt.DayOfWeek;
                int             clickedDay = -1;
                for (int i = firstDay; i < System.DateTime.DaysInMonth(curYear, curMonth) + firstDay; i++)
                {
                    string target = "day (" + i.ToString() + ")";
                    if (theClick.name == target)
                    {
                        clickedDay = i - firstDay;
                        curDay     = i - firstDay;
                        List <Entry> entriesOfDate = new List <Entry>();
                        List <Entry> entriesOfDay  = curProject.getEntries(curYear, curMonth, i - firstDay + 1);
                        for (int j = 0; j < entriesOfDay.Count; j++)
                        {
                            entriesOfDate.Add(entriesOfDay[j].copy());
                        }
                        break;
                    }
                }

                // Checkpoint
                if (clickedDay >= 0)
                {
                    // CHANGE DISPLAY MENU TO DATE MODE
                    DisplayMonthUI(false);
                    DisplayDayUI(true);
                    UpdateDailyEntries();
                    curMenu = menu.Day;
                }
            }
        }
    }
 void Start()
 {
     rend = GetComponent<Renderer>();
     controller = GameObject.Find ("GameController(Clone)");
     mCtrl=this.gameObject.GetComponentInParent<menu>();
     statsCtrl = GameObject.Find("gameData");
     dataBase = statsCtrl.GetComponent<statsController> ();
     rend.material.color = normalColor;
 }
Beispiel #18
0
        private static void displayMenu()
        {
            Console.WriteLine("Please select one of the following");
            Console.WriteLine("1) Add A New Expense");
            Console.WriteLine("2) Show All Expenses");
            Console.WriteLine("3) Search Item");
            Console.WriteLine("4) Modify Item");
            Console.WriteLine("5) Delete Item");
            Console.WriteLine("6) Sort Items Alphabetically");
            Console.WriteLine("7) Normalize Descriptions");
            Console.WriteLine("0) Exit Application");


            int input = int.Parse(Console.ReadLine());

            menu mainMenu = (menu)input;

            switch (mainMenu)
            {
            case menu.exit:
                Environment.Exit(0);
                break;

            case menu.add:
                addExpense();
                break;

            case menu.displayAll:
                showAllExpenses();
                break;

            case menu.search:
                searchItem();
                break;

            case menu.modify:
                modifyItem();
                break;

            case menu.delete:
                deleteItem();
                break;

            case menu.sort:
                expenses = sort(expenses);
                break;

            case menu.normalize:
                normalizeDesctiptions();
                break;

            default:
                Console.WriteLine("Unkown Input, Please Try Again");
                break;
            }
            displayMenu();
        }
Beispiel #19
0
 /// <summary>
 /// 更新
 /// </summary>
 public int updateById(menu record)
 {
     using (qdbEntities myDb = new qdbEntities())
     {
         myDb.menu.Attach(record);
         myDb.Entry(record).State = EntityState.Modified;
         return(myDb.SaveChanges());
     }
 }
Beispiel #20
0
        // menu菜单表新增
        public static int menuXinZeng(menu m)
        {
            NewHope4Entities ent = new NewHope4Entities();

            m.CreationDate = DateTime.Now;
            m.state        = 0;
            ent.menu.Add(m);
            return(ent.SaveChanges());
        }
Beispiel #21
0
 public ActionResult Edit(menu _menu)
 {
     menum.update(new menu
     {
         menu_link_name = _menu.menu_link_name,
         sitepage       = _menu.sitepage
     });
     return(RedirectToAction("Index"));
 }
Beispiel #22
0
 private void _initMenu()
 {
     _menuList[0] = new menu(GameObject.Find("confirmObject"), 1);
     _menuList[1] = new menu(GameObject.Find("mainObject"), 0);
     _menuList[2] = new menu(GameObject.Find("playObject"), 1);
     _menuList[3] = new menu(GameObject.Find("settingsObject"), 1);
     _menuList[4] = new menu(GameObject.Find("levelsObject"), 2);
     _menuList[5] = new menu(GameObject.Find("shipObject"), 1);
 }
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            menu menu = await db.menus.FindAsync(id);

            db.menus.Remove(menu);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
Beispiel #24
0
        public void testGetData()
        {
            MenuDAL menuDal = MenuDAL.getInstance();
            menu    m       = new menu();

            m.id = 1;
            m    = menuDal.selectSingle(m);
            Assert.AreEqual(m.name, "Pizzaa");
        }
        private List <quyennguoidung> GetListQuyen(TreeNodeCollection treenodecollect)
        {
            string sidnhanvien = "";

            try { sidnhanvien = c1FlexGrid1[c1FlexGrid1.RowSel, "idnhanvien"].ToString().Trim(); }
            catch { }
            menuBL         ctrmenu = new menuBL();
            quyennguoidung obj     = new quyennguoidung();

            foreach (TreeNode tn in treenodecollect)
            {
                if (tn.Checked == true)
                {
                    obj = new quyennguoidung();
                    try { obj.idmenu = Convert.ToInt32(tn.Name.Trim()); }
                    catch { obj.idmenu = 0; }
                    if (sidnhanvien.Trim().Equals("") == true)
                    {
                        MessageBox.Show("Lỗi không lấy được thông tin người dùng.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        //c1FlexGrid1.Focus();
                        return(null);
                    }
                    if (obj.idmenu == 0 && obj.idmenu == -1)
                    {
                        MessageBox.Show("Lỗi không lấy được thông tin quyền.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        treeQuyen.Focus();
                        return(null);
                    }
                    obj.idnhanvien = sidnhanvien;
                    menu objmenu = new menu();
                    objmenu      = ctrmenu.GetByID(obj.idmenu);
                    obj.kyhieucn = objmenu.menulink;
                    obj.mota     = objmenu.ghichu;
                    string sEdit = "";
                    if (chbEdit.Checked == true)
                    {
                        sEdit = "EDIT";
                    }
                    string sDel = "";
                    if (chbDel.Checked == true)
                    {
                        sDel = "DEL";
                    }
                    obj.quyendl    = sEdit + ";" + sDel;
                    obj.status     = Convert.ToBoolean(objmenu.status);
                    obj.tenquyendl = objmenu.menuname;
                    lst.Add(obj);
                    GetListQuyen(tn.Nodes);
                }
                else
                {
                    GetListQuyen(tn.Nodes);
                }
            }
            return(lst);
        }
Beispiel #26
0
        public void TestMethod1()
        {
            //Arrange
            menu menu = new menu();
            //Act
            ViewResult result = menu as ViewResult;

            //Assert
            Assert.IsNotNull(result);
        }
Beispiel #27
0
 public ActionResult Edit([Bind(Include = "id,name,link,meta,hide,order,datebegin")] menu menu)
 {
     if (ModelState.IsValid)
     {
         db.Entry(menu).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(menu));
 }
        public ActionResult slug(string id)
        {
            var  input = Server.HtmlEncode(id);
            menu data  = db.menu
                         .Where(x => x.slug == id)
                         .FirstOrDefault();

            //return Json(new { par = data }, JsonRequestBehavior.AllowGet); ;
            return(View("~/Views/front-end/pages.cshtml", data));
        }
 public ActionResult Edit(menu menu)
 {
     if (ModelState.IsValid)
     {
         db.Entry(menu).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(menu));
 }
Beispiel #30
0
        //
        // GET: /Menu/Delete/5

        public ActionResult Delete(int id = 0)
        {
            menu menu = db.menu.Find(id);

            if (menu == null)
            {
                return(HttpNotFound());
            }
            return(View(menu));
        }
Beispiel #31
0
        public MainWindow()
        {
            todayMenu = new menu();

            InitializeComponent();

            MenuView.ItemsSource  = todayMenu.Menu;
            OrderList.ItemsSource = oformlenie.C;
            AllOrders.ItemsSource = oformlenie.D;
        }
Beispiel #32
0
        public int addMenu(Menu menuEntity)
        {
            menu menuData = new menu();

            var menuNewID = from x in entity.menus orderby x.menuId descending select x;
            menuData.menuId = (menuNewID.FirstOrDefault().menuId) + 1;
            menuData.menu1 = menuEntity.MenuName;
            menuData.url = menuEntity.Url;
            menuData.parentId = menuEntity.ParentId;

            entity.menus.Add(menuData);
            entity.SaveChanges();

            return menuData.menuId;
        }
Beispiel #33
0
        public void Initialize()
        {
            inputFrameMilliSeconds = 100;
            timeSinceLastInputFrame = 0;
            screenCenter = new Vector2(MainGame.bufferWidth / 2, MainGame.bufferHeight / 2);
            titlePosition = new Vector2(MainGame.bufferWidth / 2, MainGame.bufferHeight / 3);
            titleVelocity = 20;
            titlePOffset = MainGame.bufferHeight / 3 + 5;
            titleNOffset = MainGame.bufferHeight / 3 - 5;

            menuState = menu.play;
            symPlayPos = new Vector2(MainGame.bufferWidth / 2 - 80, MainGame.bufferHeight / 2);
            symExitPos = new Vector2(MainGame.bufferWidth / 2 - 80, MainGame.bufferHeight / 2 + 75);
            playPosition = screenCenter;
            exitPosition = new Vector2(MainGame.bufferWidth/2 + 10, MainGame.bufferHeight/2 + 75);
        }
        protected override void LoadContent()
        {
            ressource.loadcontent(Content);
            spriteBatch = new SpriteBatch(GraphicsDevice);

            gameover = new GameOverScreen(this, spriteBatch, ressource.ecriture, ressource.gameover);
            Components.Add(gameover);
            gameover.hide();

            edm = new EDM(this, spriteBatch);
            Components.Add(edm);
            edm.hide();

            pause = new menudepause(this, spriteBatch, ressource.ecriture, ressource.pixel);
            Components.Add(pause);
            pause.hide();

            menu = new menu(this, spriteBatch, Content.Load<SpriteFont>("SpriteFont"), ressource.templar);
            Components.Add(menu);
            menu.hide();

            menudujeu = new menudujeu(this, spriteBatch, Content.Load<SpriteFont>("spriteFont"), ressource.th);
            Components.Add(menudujeu);
            menudujeu.hide();

            option = new option(this, spriteBatch, Content.Load<SpriteFont>("spriteFont"), ressource.option);
            Components.Add(option);
            option.hide();

            main = new gamemain(this, spriteBatch, activeScreen);
            Components.Add(main);
            main.hide();

            activeScreen = menu;
            activeScreen.Show();

            MediaPlayer.Play(ressource.menu);
            MediaPlayer.IsRepeating = true;
            MediaPlayer.Volume = 0;

            SoundEffect.MasterVolume = 0.05f;

            ecran = false;
        }
Beispiel #35
0
        private void bn_login_Click(object sender, EventArgs e)
        {
            if (radioManage.Checked == true)
            {

                if (Mytool.checkmanageaccount(this.textaccount.Text.Trim(), this.textpassword.Text))
                {
                    managemenu manmenu = new managemenu(this);
                    manmenu.Show();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("帐号或者密码错误");

                }
            }
            if (radioUser.Checked == true)
            {
                if (Mytool.checkuseraccount(this.textaccount.Text.Trim(), this.textpassword.Text))
                {
                    Mytool.currentusername = Mytool.getusername(this.textaccount.Text.Trim());
                    Mytool.currentuseraccount = this.textaccount.Text.Trim();
                    this.Hide();
                    menu menu = new menu(this);
                    menu.Show();

                }
                else
                {
                    MessageBox.Show("帐号或者密码错误");

                }

            }
        }
Beispiel #36
0
 private void switch_to_product(menu choix)
 {
     Quitter.Enabled = (choix == menu.m_principal);
     Quitter.Visible = (choix == menu.m_principal);
     Emporter.Enabled = (choix == menu.m_principal);
     Emporter.Visible = (choix == menu.m_principal);
     Sur_place.Enabled = (choix == menu.m_principal);
     Sur_place.Visible = (choix == menu.m_principal);
     Plus.Enabled = (choix == menu.m_principal);
     Plus.Visible = (choix == menu.m_principal);
     tabControl.Visible = (choix == menu.m_produits);
     tabControl.Enabled = (choix == menu.m_produits);
     button_calc.Visible = (choix == menu.m_produits);
     button_calc.Enabled = (choix == menu.m_produits);
     button_gotomain.Visible = (choix != menu.m_principal);
     button_gotomain.Enabled = (choix != menu.m_principal);
     button_reset.Visible = (choix == menu.m_plus);
     button_reset.Enabled = (choix == menu.m_plus);
     textBox_log.Enabled = (choix == menu.m_plus);
     textBox_log.Visible = (choix == menu.m_plus);
     button_raz.Enabled = (choix == menu.m_produits);
     button_raz.Visible = (choix == menu.m_produits);
     label_prix.Enabled = (choix == menu.m_produits);
     label_prix.Visible = (choix == menu.m_produits);
 }
 void Start()
 {
     player = GameObject.Find ("actionController");
     playerMenu = GameObject.Find ("currentWeaponMenu").GetComponent<menu>();
     targetLine = GetComponent <LineRenderer> ();
     BoardSetup ();
     clearSetup (new Vector2(0,0));
     commandable = true;
 }
Beispiel #38
0
        private void HandleInput(GameTime gameTime)
        {
            KeyboardState state = Keyboard.GetState();

            if (state.IsKeyDown(Keys.Down) || state.IsKeyDown(Keys.Up))
            {
                timeSinceLastInputFrame = 0;
                if (menuState == menu.play)
                {
                    menuState = menu.exit;
                }
                else
                {
                    menuState = menu.play;
                }
            }

            if (state.IsKeyDown(Keys.Enter))
            {
                if (menuState == menu.exit) MainGame.endGame = true;
                if (menuState == menu.play)
                {
                    ScreenManager screenManager = ScreenManager.Instance;
                    screenManager.SetScreen(new BattleScreen(Content));
                    screenManager.Initialize();
                    screenManager.LoadContent();
                }
            }
        }
 public void SelectMenu()
 {
     switch(pressedKey)
     {
     case "l":
         playmodeParameters = filter.playmodeParameters;
         activeMenu = menu.Filter;
         break;
     case "r":
         playmodeParameters = properties.playmodeParameters;
         activeMenu = menu.Properties;
         break;
     }
 }
    public void Update()
    {
        if(flyStick != null)
        {
            if(flyStick.GetComponent<ControllerFlyStick>().go == gameObject)
            {
                //Check for input
                if(Input.inputString != "")
                {
                    pressedKey = Input.inputString;
                }

                //Select mode
                if(pressedKey == "a" || pressedKey == "b" || pressedKey == "c")
                {
                    SelectMode();
                    pressedKey = "";
                    return;
                }

                //Select menu / parameter / index
                if(activeMode != mode.None &&
                   (pressedKey == "l" || pressedKey == "r"))
                {
                    switch(activeMode)
                    {
                    case mode.Menu:
                        SelectMenu();
                        break;
                    case mode.Parameter:
                        SelectParameter();
                        break;
                    case mode.Index:
                        SelectIndex();
                        break;
                    }

                    pressedKey = "";
                    return;
                }

                //Change value
                if(activeMode != mode.None &&
                   activeMenu != menu.None &&
                   playmodeParameter != null &&
                   (pressedKey == "u" || pressedKey == "d"))
                {
                    switch(pressedKey)
                    {
                    case "u":
                        switch(playmodeParameter.type)
                        {
                        case "int":
                            IncreaseInt();
                            break;
                        case "Vector2":
                            IncreaseVector2();
                            break;
                        case "Vector3":
                            IncreaseVector3();
                            break;
                        }
                        break;
                    case "d":
                        switch(playmodeParameter.type)
                        {
                        case "int":
                            DecreaseInt();
                            break;
                        case "Vector2":
                            DecreaseVector2();
                            break;
                        case "Vector3":
                            DecreaseVector3();
                            break;
                        }
                        break;
                    }

                    pressedKey = "";
                    return;
                }
            }
            else
            {
                activeMode = mode.None;
                activeMenu = menu.None;
                activeParameter = 0;
                activeIndex = 0;
                playmodeParameter = null;
            }
        }
    }
Beispiel #41
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            gameState = state.Title;
            menuItem = menu.Battle;
            menuX = 720;
            menuY = 680;

            this.graphics.PreferredBackBufferHeight = 720;
            this.graphics.PreferredBackBufferWidth = 1280;
            this.graphics.IsFullScreen = false;

            base.Initialize();
        }
    public void Initialize()
    {
        this.flyStick = GameObject.Find ("FlyStick");
        this.root = gameObject.transform.parent.gameObject.GetComponent<VTKRoot> ();

        this.filter = node.filter;
        this.properties = node.properties;

        activeMode = mode.None;
        activeMenu = menu.None;
        activeParameter = 0;
        activeIndex = 0;
        playmodeParameter = null;
    }
 void OnEnable()
 {
     if (Selection.activeGameObject != null) {
         gears 	= new SerializedObject(targets);
         points 	= gears.FindProperty("points");
         prefs 	= gears.FindProperty("prefs");
         Gear g = (Gear)target;
         if (target != null) {
             switchInnerGearing = g.prefs.inner;
             if (g.points != null)
                 colorPalette = g.points[g.prefs.bodyParts].uvOffX;
         }
     }
     this.currentMenu = MenuPrefs;
     SetColorPalette();
 }
 private void MenuButtons(int _i)
 {
     EditorGUILayout.Space();
     EditorGUILayout.BeginHorizontal();
     Color c = GUI.color;
     if (_i == 0) GUI.color = Color.yellow;
     if(GUILayout.Button(menuPrefs, EditorStyles.miniButtonLeft))
         this.currentMenu = MenuPrefs;
     if (_i != 1) GUI.color = c; else GUI.color = Color.green;
     if(GUILayout.Button(menuMat, EditorStyles.miniButtonMid))
         this.currentMenu = MenuMat;
     if (_i != 2) GUI.color = c; else GUI.color = Color.magenta;
     if(GUILayout.Button(menuUV, EditorStyles.miniButtonMid))
         this.currentMenu = MenuUV;
     if (_i != 3) GUI.color = c; else GUI.color = Color.red;
     if(GUILayout.Button(menuOpt, EditorStyles.miniButtonRight))
         this.currentMenu = MenuOpt;
     EditorGUILayout.EndHorizontal();
     EditorGUILayout.Space();
 }
        public static menu[] GetControlledVocabularyMenus()
        {
            // Get the installation path
            DirectoryInfo installationPath = StaticHelper.GetInstallationPath();

            // Iterate over Add-ins found
            DirectoryInfo buttonRoot = new DirectoryInfo(Path.Combine(installationPath.FullName, "Buttons"));
            DirectoryInfo[] buttons = buttonRoot.GetDirectories();

            menu[] menus = new menu[buttons.Length];
            int i = 0;
            foreach (FileInfo file in buttons.Select(button => new FileInfo(Path.Combine(button.FullName, "button.xml"))))
            {
                XmlSerializer deserializer = new XmlSerializer(typeof(menu));
                using (FileStream buttonStream = new FileStream(file.FullName, FileMode.Open, FileAccess.Read))
                {
                    menus[i] = (menu)deserializer.Deserialize(buttonStream);
                }

                i++;
            }

            return menus;
        }
 void armory()
 {
     int i;
     for (i=1; i<=dataBase.techCount; i++) {
         addItem (0);
     }
     sub = subMenuObject.GetComponent<menu> ();
     sub.subMenu(current);
 }
Beispiel #47
0
 // Use this for initialization
 void Start()
 {
     viewer = GameObject.Find("viewer").GetComponent<viewer>();
     menu = GameObject.Find("menu").GetComponent<menu>();
 }