Exemplo n.º 1
0
        private void Update()
        {
            if (Provider.isConnected && !Provider.isLoading && Provider.isInitialized && SayGreeting)
            {
                StartCoroutine(Greetings());
                SayGreeting = false;
            }

            if (Provider.isConnected)
            {
                if (_obj == null)
                {
                    _obj  = new GameObject();
                    Menu  = _obj.AddComponent <Menu.Menu>();
                    Binds = _obj.AddComponent <Binds>();

                    Object.DontDestroyOnLoad(Menu);
                    Object.DontDestroyOnLoad(Binds);
                }
            }
            else
            {
                if (_obj != null)
                {
                    Object.Destroy(Menu);
                    Object.Destroy(Binds);

                    _obj  = null;
                    Menu  = null;
                    Binds = null;
                }
            }
        }
Exemplo n.º 2
0
 public Scene(SceneManager sceneManager)
 {
     Entities     = new List <BaseEntity>();
     Camera       = new Point(-40, 180);
     Menu         = new MainMenu(this);
     SceneManager = sceneManager;
 }
Exemplo n.º 3
0
        public override IEnumerator <LoadStatus> OnExitRoutine()
        {
            yield return(new LoadStatus(0.0f, "Shutting down..."));

            if (AudioManager.HasInstance)
            {
                AudioManager.Instance.StopAllMusic();
            }

            if (InputManager.HasInstance)
            {
                InputManager.Instance.EventSystem.UIModule.DisableAllActions();
            }

            Destroy(_menu.gameObject);
            _menu = null;

            yield return(new LoadStatus(0.5f, "Shutting down..."));

            IEnumerator <LoadStatus> runner = base.OnExitRoutine();

            while (runner.MoveNext())
            {
                yield return(runner.Current);
            }

            yield return(new LoadStatus(1.0f, "Done!"));
        }
Exemplo n.º 4
0
 public void Initialize()
 {
     _pauseMenu = InstantiateUIPrefab(_pauseMenuPrefab);
     if (null != _pauseMenu)
     {
         _pauseMenu.gameObject.SetActive(PartyParrotManager.Instance.IsPaused);
     }
 }
Exemplo n.º 5
0
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            // Allows the game to exit
            if (Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                if (core != null)
                {
                    core.Dispose();
                }
                core = null;
                Menu.Return.Message = "OK";
                GameState.setState("Menu");
            }
            MouseHandler.Update(gameTime);
            KeyboardHandler.Update(gameTime);
            if (GameState.getState() == "Menu")
            {
                if (menu == null)
                {
                    menu = new Menu.Menu();
                }
                else
                {
                    var msg = menu.Update(gameTime);
                    switch (msg)
                    {
                    case "OK": break;

                    case "Exit": Exit(); break;

                    default:
                        var  ctor = typeof(Song).GetConstructor(BindingFlags.NonPublic | BindingFlags.Instance, null, new[] { typeof(string), typeof(string), typeof(int) }, null);
                        Song song = (Song)ctor.Invoke(new object[] { "name", msg, 0 });
                        core = new Core.Core(song);
                        menu = null;
                        GameState.setState("Game");
                        break;
                    }
                }
            }
            else
            {
                if (core != null)
                {
                    var msg = core.Update(gameTime);
                    switch (msg)
                    {
                    case "DEAD": break;

                    default: break;
                    }
                }
            }
            // TODO: Add your update logic here

            base.Update(gameTime);
        }
Exemplo n.º 6
0
        public void Initialize()
        {
            _pauseMenu = InstantiateUIPrefab(_pauseMenuPrefab);
            if (null != _pauseMenu)
            {
                _pauseMenu.gameObject.SetActive(PartyParrotManager.Instance.IsPaused);
            }

            _floatingTextRoutine = StartCoroutine(FloatingTextRoutine());
        }
Exemplo n.º 7
0
        protected override void DoEnter()
        {
            base.DoEnter();

            if (null != _menuPrefab)
            {
                InputManager.Instance.EventSystem.UIModule.EnableAllActions();

                _menu = GameStateManager.Instance.GameUIManager.InstantiateUIPrefab(_menuPrefab);
                _menu.Initialize();
            }
        }
Exemplo n.º 8
0
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
            {
                this.Exit();
            }
            if (GameState.getState() == "Menu")
            {
                if (menu == null)
                {
                    menu = new Menu.Menu();
                }
                switch (menu.Update(gameTime))
                {
                case "Exit": this.Exit(); break;

                case "New Game":
                    GameState.setState("Game");
                    Heigth = menu.GetHeigth();
                    Width  = menu.GetWidth();
                    Mines  = menu.GetMines();
                    graphics.PreferredBackBufferHeight = Heigth * Core.Map.Ground.CellSize;
                    graphics.PreferredBackBufferWidth  = Width * Core.Map.Ground.CellSize;
                    graphics.ApplyChanges();
                    menu = null; break;
                }
            }
            else
            if (GameState.getState() == "Game")
            {
                if (core == null)
                {
                    //IsMouseVisible = false;
                    core = new Core.Core(this, spriteBatch, Heigth, Width, Mines);
                }
                switch (core.Update(gameTime))
                {
                case "Game Over": GameState.setState("Menu"); core = null; break;

                case "Exit": this.Exit(); break;

                case "Retry": core = null; break;

                default: break;
                }
            }


            base.Update(gameTime);
        }
Exemplo n.º 9
0
        internal HealthPredictionImplB()
        {
            Game.OnUpdate += this.GameOnUpdate;
            Obj_AI_Base.OnProcessAutoAttack += this.ObjAiBaseOnOnProcessAutoAttack;
            GameObject.OnDestroy            += this.GameObjectOnOnDestroy;
            Obj_AI_Base.OnPerformCast       += this.Obj_AI_Base_OnPerformCast;
            SpellBook.OnStopCast            += this.SpellBook_OnStopCast;

            Config = new Menu.Menu("HealthPred", "HealthPrediction");
            Config.Add(new MenuSeperator("seperator", "Default value should be 180"));
            Config.Add(new MenuSlider("ExtraDelay", "Extra Delay", 180, 0, 250));

            AimtecMenu.Instance.Add(this.Config);
        }
Exemplo n.º 10
0
        public void Shutdown()
        {
            if (null != _gameUI)
            {
                Destroy(_gameUI.gameObject);
            }
            _gameUI = null;

            if (null != _pauseMenu)
            {
                Destroy(_pauseMenu.gameObject);
            }
            _pauseMenu = null;
        }
Exemplo n.º 11
0
        public int AddRole(Entity.User.UserRole role)
        {
            // string sqlstr = "insert into t_R_Role(RoleName,LevelID,ReadRight,WriteRight,ImportRight,ExportRight,UpLoadRight,CheckRight)values('" + role.CName + "'," + role.ILevel + ",'" + role.ReadRight + "','" + role.WriteRight + "','" + role.ImportRight + "','" + role.ExportRight + "','" + role.UpLoadRight + "','" + role.CheckRight + "')";
            int                   iReturn   = 0;
            DBOperatorBase        db        = new DataBase();
            IDBTypeElementFactory dbFactory = db.GetDBTypeElementFactory();
            SqlTransactionHelper  thelper   = new SqlTransactionHelper(Config.constr);
            IDbTransaction        trans     = thelper.StartTransaction();

            try
            {
                IDbDataParameter[] prams =
                {
                    dbFactory.MakeInParam("@RoleName",    DBTypeConverter.ConvertCsTypeToOriginDBType(role.CName.GetType().ToString()),       role.CName,       50),
                    dbFactory.MakeInParam("@LevelID",     DBTypeConverter.ConvertCsTypeToOriginDBType(role.ILevel.GetType().ToString()),      role.ILevel,       0),
                    dbFactory.MakeInParam("@ReadRight",   DBTypeConverter.ConvertCsTypeToOriginDBType(role.ReadRight.GetType().ToString()),   role.ReadRight,    0),
                    dbFactory.MakeInParam("@WriteRight",  DBTypeConverter.ConvertCsTypeToOriginDBType(role.WriteRight.GetType().ToString()),  role.WriteRight,   0),
                    dbFactory.MakeInParam("@ImportRight", DBTypeConverter.ConvertCsTypeToOriginDBType(role.ImportRight.GetType().ToString()), role.ImportRight,  0),
                    dbFactory.MakeInParam("@ExportRight", DBTypeConverter.ConvertCsTypeToOriginDBType(role.ExportRight.GetType().ToString()), role.ExportRight,  0),
                    dbFactory.MakeInParam("@UpLoadRight", DBTypeConverter.ConvertCsTypeToOriginDBType(role.UpLoadRight.GetType().ToString()), role.UpLoadRight,  0),
                    dbFactory.MakeInParam("@CheckRight",  DBTypeConverter.ConvertCsTypeToOriginDBType(role.CheckRight.GetType().ToString()),  role.CheckRight,   0),

                    dbFactory.MakeInParam("@bAdmin",      DBTypeConverter.ConvertCsTypeToOriginDBType(role.Admin.GetType().ToString()),       role.Admin,        0),
                    dbFactory.MakeOutReturnParam()
                };
                iReturn = db.ExecuteNonQueryTrans(trans, CommandType.StoredProcedure, "proc_AddRole", prams);
                int                roleid   = int.Parse(prams[9].Value.ToString());
                DAl.Menu.Menu      menu     = new Menu.Menu();
                List <Entity.Menu> MenuList = menu.GetMenusByIsShow(1);
                foreach (Entity.Menu entity in MenuList)
                {
                    string str = @"insert into t_R_RoleMenu(MenuID,RoleID,checked,createuser,createdate)values('" + entity.ID + "','" + roleid + "','0','" + role.CreateUser + "','" + role.CreateDate + "')";
                    db.ExecuteNonQueryTrans(trans, CommandType.Text, str, prams);
                }
                thelper.CommitTransaction(trans);
                iReturn = 1;
            }
            catch (Exception ex)
            {
                thelper.RollTransaction(trans);
                Comm.EsbLogger.Log(ex.GetType().ToString(), ex.Message.ToString(), 0, ErrorLevel.Fatal);
                iReturn = 0;
            }
            finally
            {
                db.Conn.Close();
            }
            return(iReturn);
        }
Exemplo n.º 12
0
        protected override void DoEnter()
        {
            base.DoEnter();

            if (null == _menuPrefab)
            {
                _completeTimer = TimeManager.Instance.AddTimer();
                _completeTimer.TimesUpEvent += CompleteTimerTimesUpEventHandler;
                _completeTimer.Start(_completeWaitTimeSeconds);
            }
            else if (null != GameStateManager.Instance.GameUIManager)
            {
                _menu = GameStateManager.Instance.GameUIManager.InstantiateUIPrefab(_menuPrefab);
                _menu.Initialize();
            }
        }
Exemplo n.º 13
0
        protected override void DoExit()
        {
            if (InputManager.HasInstance)
            {
                InputManager.Instance.EventSystem.UIModule.DisableAllActions();
            }

            if (null != _menu)
            {
                Destroy(_menu.gameObject);
                _menu = null;
            }

            AudioManager.Instance.StopAllMusic();

            base.DoExit();
        }
Exemplo n.º 14
0
        public LotusGame(GraphicsFacade graphics)
        {
            Console.Write("Name:");
            name = Console.ReadLine();

            me = this;
            this.graphics = graphics;

            graphics.Init();
            graphics.onUpdate += new GraphicsFacade.UpdateEventHandler(this.Update);
            graphics.onDraw += new GraphicsFacade.DrawEventHandler(this.Draw);

            title = new TitleScreen();
            currentMenu = title;

            graphics.Run();
        }
Exemplo n.º 15
0
        protected override void DoExit()
        {
            if (null == _menu)
            {
                TimeManager.Instance.RemoveTimer(_completeTimer);
                _completeTimer = null;
            }
            else
            {
                Destroy(_menu.gameObject);
                _menu = null;
            }

            AudioManager.Instance.StopAllMusic();

            base.DoExit();
        }
Exemplo n.º 16
0
        override protected void Update()
        {
            if (manager == null)
            {
                GameObject ManagerGO = GameObject.Find("Manager");
                if (ManagerGO == null)
                {
                    ManagerGO = new GameObject("Manager");
                }
                manager = ManagerGO.GetComponent <Menu.Menu>();
                if (manager == null)
                {
                    manager = ManagerGO.AddComponent <Menu.Menu>();
                }
            }

            base.Update();
        }
Exemplo n.º 17
0
        protected override void DoExit()
        {
            if (null == _menu)
            {
                // NOTE: this relies on the state unloading process
                // yielding for a frame so we're out of the TimeManager loop
                TimeManager.Instance.RemoveTimer(_completeTimer);
                _completeTimer = null;
            }
            else
            {
                Destroy(_menu.gameObject);
                _menu = null;
            }

            AudioManager.Instance.StopAllMusic();

            base.DoExit();
        }
Exemplo n.º 18
0
        public HealthPredictionImplB()
        {
            Obj_AI_Base.OnProcessAutoAttack += this.Obj_AI_Base_OnProcessAutoAttack;
            GameObject.OnCreate             += this.GameObject_OnCreate;
            GameObject.OnDestroy            += this.GameObject_OnDestroy;
            Game.OnUpdate             += this.Game_OnUpdate;
            Obj_AI_Base.OnPerformCast += this.Obj_AI_Base_OnPerformCast;
            SpellBook.OnStopCast      += this.SpellBook_OnStopCast;


            this.Config = new Menu.Menu("HealthPred", "HealthPrediction")
            {
                new MenuSeperator("Seperator", "Delays are 0 by default"),
                new MenuSlider("ExtraDelayRanged", "Extra Ranged Delay", 0, 0, 150).SetToolTip("Delay for processing minion ranged attacks"),
                new MenuSlider("ExtraDelayMelee", "Extra Melee Attacks Delay", 0, 0, 150).SetToolTip("Delay for processing minion melee attacks"),
            };

            AimtecMenu.Instance.Add(this.Config);
        }
Exemplo n.º 19
0
        public override IEnumerator <LoadStatus> OnEnterRoutine()
        {
            yield return(new LoadStatus(0.0f, "Initializing..."));

            IEnumerator <LoadStatus> runner = base.OnEnterRoutine();

            while (runner.MoveNext())
            {
                yield return(runner.Current);
            }

            yield return(new LoadStatus(0.5f, "Initializing..."));

            InputManager.Instance.EventSystem.UIModule.EnableAllActions();

            AudioManager.Instance.PlayMusic(_music);

            _menu = UIManager.Instance.InstantiateUIPrefab(_menuPrefab);

            yield return(new LoadStatus(1.0f, "Done!"));
        }
Exemplo n.º 20
0
        public void Shutdown()
        {
            if (null != _floatingTextRoutine)
            {
                StopCoroutine(_floatingTextRoutine);
            }
            _floatingTextRoutine = null;

            _floatingText.Clear();

            if (null != _playerUI)
            {
                Destroy(_playerUI.gameObject);
            }
            _playerUI = null;

            if (null != _pauseMenu)
            {
                Destroy(_pauseMenu.gameObject);
            }
            _pauseMenu = null;
        }
Exemplo n.º 21
0
 public void SetMenu(Menu.Menu menu)
 {
     _menu = menu;
 }
Exemplo n.º 22
0
 public MenuScreen(GameWrapper i_Game)
     : base(i_Game)
 {
     m_Menu = new Menu.Menu(i_Game);
     this.Add(m_Menu);
 }
Exemplo n.º 23
0
        private static string GerarHtmlMenu(Menu.Menu menu, HtmlHelper htmlHelper)
        {
            var highlight     = false;
            var currentAction = (string)htmlHelper.ViewContext.RouteData.Values["controller"];

            if (string.Equals(currentAction, menu.ControllerName, StringComparison.CurrentCultureIgnoreCase) || menu.SubMenu.Any(c => c.ControllerName == currentAction))
            {
                highlight = true;
            }

            var urlHelper = new UrlHelper(HttpContext.Current.Request.RequestContext);

            var temSubItem = menu.SubMenu.Count() > 0;
            var url        = string.Empty;

            if (!temSubItem)
            {
                url = urlHelper.Action(menu.ActionName, menu.ControllerName);
            }
            var writer = new StringWriter();

            using (HtmlTextWriter html = new HtmlTextWriter(writer))
            {
                var classe = temSubItem ? "has-sub" : "";
                classe += highlight ? " highlight active" : "";
                if (!string.IsNullOrEmpty(classe))
                {
                    html.AddAttribute(HtmlTextWriterAttribute.Class, classe);
                }

                html.RenderBeginTag(HtmlTextWriterTag.Li);

                if (!temSubItem)
                {
                    html.AddAttribute(HtmlTextWriterAttribute.Href, url);
                }
                if (highlight)
                {
                    html.AddAttribute(HtmlTextWriterAttribute.Class, "select");
                }
                html.RenderBeginTag(HtmlTextWriterTag.A);

                html.AddAttribute(HtmlTextWriterAttribute.Class, menu.Icone);
                html.RenderBeginTag(HtmlTextWriterTag.I);
                html.RenderEndTag();
                html.RenderBeginTag(HtmlTextWriterTag.Span);
                html.Write(menu.Nome);
                html.RenderEndTag();
                if (!temSubItem && highlight)
                {
                    html.AddAttribute(HtmlTextWriterAttribute.Class, "current-page");
                    html.RenderBeginTag(HtmlTextWriterTag.Span);
                    html.RenderEndTag();
                }
                html.RenderEndTag();
                //Adicionar SubItens
                if (temSubItem)
                {
                    if (highlight)
                    {
                        html.AddAttribute(HtmlTextWriterAttribute.Style, "display: block;");
                    }
                    html.RenderBeginTag(HtmlTextWriterTag.Ul);
                }
                foreach (var item in menu.SubMenu)
                {
                    html.Write(GerarHtmlMenu(item, htmlHelper));
                }
                if (temSubItem)
                {
                    html.RenderEndTag();
                }
            }
            var resultado = writer.ToString();

            return(resultado);
        }
Exemplo n.º 24
0
 public InicioDeSesion(Menu.Menu menuForm)
 {
     InitializeComponent();
     _menuForm = menuForm;
 }
Exemplo n.º 25
0
 public Global(List<Planetas> ListPlanetas)
  {
      listPlanetas = ListPlanetas;
      menu = new Menu.Menu();
      
  }