Ejemplo n.º 1
0
        public Cursor(Code2015 game, Game parent, GameScene scene, GameState gamelogic, Picker picker,
                      CitySelectInfo citySelectInfo, ObjectSelectInfo objSelectInfo, RBallTypeSelect sendBallSelect, MiniMap map, SelectionMarker marker, RankInfo rankInfo)
        {
            this.parent   = parent;
            this.logic    = gamelogic;
            this.player   = gamelogic.LocalHumanPlayer;
            this.rankInfo = rankInfo;

            this.game      = game;
            this.renderSys = game.RenderSystem;
            this.scene     = scene;

            this.picker = picker;

            this.selectionMarker = marker;
            this.citySelectInfo  = citySelectInfo;
            this.objSelectInfo   = objSelectInfo;
            this.sendBallSelect  = sendBallSelect;
            this.miniMap         = map;

            FileLocation fl = FileSystem.Instance.Locate("cursor.tex", GameFileLocs.GUI);

            cursor = UITextureManager.Instance.CreateInstance(fl);

            fl           = FileSystem.Instance.Locate("cursor_u.tex", GameFileLocs.GUI);
            cursor_up    = UITextureManager.Instance.CreateInstance(fl);
            fl           = FileSystem.Instance.Locate("cursor_l.tex", GameFileLocs.GUI);
            cursor_left  = UITextureManager.Instance.CreateInstance(fl);
            fl           = FileSystem.Instance.Locate("cursor_d.tex", GameFileLocs.GUI);
            cursor_down  = UITextureManager.Instance.CreateInstance(fl);
            fl           = FileSystem.Instance.Locate("cursor_r.tex", GameFileLocs.GUI);
            cursor_right = UITextureManager.Instance.CreateInstance(fl);

            fl          = FileSystem.Instance.Locate("cursor_lu.tex", GameFileLocs.GUI);
            cursor_ul   = UITextureManager.Instance.CreateInstance(fl);
            fl          = FileSystem.Instance.Locate("cursor_ru.tex", GameFileLocs.GUI);
            cursor_ur   = UITextureManager.Instance.CreateInstance(fl);
            fl          = FileSystem.Instance.Locate("cursor_ld.tex", GameFileLocs.GUI);
            cursor_dl   = UITextureManager.Instance.CreateInstance(fl);
            fl          = FileSystem.Instance.Locate("cursor_rd.tex", GameFileLocs.GUI);
            cursor_dr   = UITextureManager.Instance.CreateInstance(fl);
            fl          = FileSystem.Instance.Locate("cursor_move.tex", GameFileLocs.GUI);
            cursor_move = UITextureManager.Instance.CreateInstance(fl);

            fl          = FileSystem.Instance.Locate("cursor_stop.tex", GameFileLocs.GUI);
            cursor_stop = UITextureManager.Instance.CreateInstance(fl);

            fl            = FileSystem.Instance.Locate("cursor_toofar.tex", GameFileLocs.GUI);
            cursor_toofar = UITextureManager.Instance.CreateInstance(fl);

            cursor_sel = new Texture[11];

            for (int i = 0; i < cursor_sel.Length; i++)
            {
                fl            = FileSystem.Instance.Locate("selcursor" + (i + 13).ToString("D2") + ".tex", GameFileLocs.GUI);
                cursor_sel[i] = UITextureManager.Instance.CreateInstance(fl);
            }

            cursor_attack = new Texture[11];
            for (int i = 0; i < cursor_attack.Length; i++)
            {
                fl = FileSystem.Instance.Locate("selcursor" + (i + 1).ToString("D2") + ".tex", GameFileLocs.GUI);
                cursor_attack[i] = UITextureManager.Instance.CreateInstance(fl);
            }

            cursorState = MouseCursor.Normal;
        }
Ejemplo n.º 2
0
        public InGameUI(Code2015 game, Game parent, GameScene scene, GameState gamelogic)
        {
            this.parent = parent;
            this.logic = gamelogic;

            this.game = game;
            this.renderSys = game.RenderSystem;
            this.scene = scene;
        

            this.player = parent.HumanPlayer;


            picker = new Picker(game, parent, scene, gamelogic);
            AddElement(picker);


            //this.infoUI = new InfoUI(game, parent, scene, gamelogic);
            //AddElement(infoUI);

          
            this.miniMap = new MiniMap(game, parent, scene, gamelogic);
            AddElement(miniMap);
         

            //-----Ruan-----------


            cityStatusInfo = new CitySelectInfo(game, parent, scene, gamelogic);
            AddElement(cityStatusInfo);

            objectStatusInfo = new ObjectSelectInfo(game, parent, scene, gamelogic);
            AddElement(objectStatusInfo);

            sendBallSelect = new RBallTypeSelect(game, parent, scene, gamelogic);
            AddElement(sendBallSelect);



            nigMenu = new NIGMenu(game, parent, scene, gamelogic);
            AddElement(nigMenu);
            nigColor = new NIGColor(game, parent, scene, gamelogic);
            AddElement(nigColor);
            nigWin = new NIGWin(game, parent, scene, gamelogic);
            AddElement(nigWin);
            nigFail = new NIGFail(game, parent, scene, gamelogic);
            AddElement(nigFail);
            nigObjective = new NIGObjective(game, parent, scene, gamelogic);
            AddElement(nigObjective);
            nigColor = new NIGColor(game, parent, scene, gamelogic);
            AddElement(nigColor);

            rankInfo = new RankInfo(game, parent, scene, gamelogic);
            AddElement(rankInfo);

            selectionMarker = new SelectionMarker(renderSys, gamelogic.Field, player);
            scene.Scene.AddObjectToScene(selectionMarker);


            layeredCursor = new Cursor(game, parent, scene, gamelogic, picker, cityStatusInfo, objectStatusInfo,
                                           sendBallSelect,  miniMap, selectionMarker, rankInfo);
            AddElement(layeredCursor);


            exit = new ExitGame(game, parent, scene, gamelogic, nigMenu);
            AddElement(exit);

            quest = new Quest(game, parent, scene, gamelogic);
            AddElement(quest);

            
        }
Ejemplo n.º 3
0
        public Cursor(Code2015 game, Game parent, GameScene scene, GameState gamelogic, Picker picker,
             CitySelectInfo citySelectInfo, ObjectSelectInfo objSelectInfo, RBallTypeSelect sendBallSelect, MiniMap map, SelectionMarker marker, RankInfo rankInfo)
        {
            this.parent = parent;
            this.logic = gamelogic;
            this.player = gamelogic.LocalHumanPlayer;
            this.rankInfo = rankInfo;

            this.game = game;
            this.renderSys = game.RenderSystem;
            this.scene = scene;

            this.picker = picker;

            this.selectionMarker = marker;
            this.citySelectInfo = citySelectInfo;
            this.objSelectInfo = objSelectInfo;
            this.sendBallSelect = sendBallSelect;
            this.miniMap = map;

            FileLocation fl = FileSystem.Instance.Locate("cursor.tex", GameFileLocs.GUI);
            cursor = UITextureManager.Instance.CreateInstance(fl);

            fl = FileSystem.Instance.Locate("cursor_u.tex", GameFileLocs.GUI);
            cursor_up = UITextureManager.Instance.CreateInstance(fl);
            fl = FileSystem.Instance.Locate("cursor_l.tex", GameFileLocs.GUI);
            cursor_left = UITextureManager.Instance.CreateInstance(fl);
            fl = FileSystem.Instance.Locate("cursor_d.tex", GameFileLocs.GUI);
            cursor_down = UITextureManager.Instance.CreateInstance(fl);
            fl = FileSystem.Instance.Locate("cursor_r.tex", GameFileLocs.GUI);
            cursor_right = UITextureManager.Instance.CreateInstance(fl);

            fl = FileSystem.Instance.Locate("cursor_lu.tex", GameFileLocs.GUI);
            cursor_ul = UITextureManager.Instance.CreateInstance(fl);
            fl = FileSystem.Instance.Locate("cursor_ru.tex", GameFileLocs.GUI);
            cursor_ur = UITextureManager.Instance.CreateInstance(fl);
            fl = FileSystem.Instance.Locate("cursor_ld.tex", GameFileLocs.GUI);
            cursor_dl = UITextureManager.Instance.CreateInstance(fl);
            fl = FileSystem.Instance.Locate("cursor_rd.tex", GameFileLocs.GUI);
            cursor_dr = UITextureManager.Instance.CreateInstance(fl);
            fl = FileSystem.Instance.Locate("cursor_move.tex", GameFileLocs.GUI);
            cursor_move = UITextureManager.Instance.CreateInstance(fl);

            fl = FileSystem.Instance.Locate("cursor_stop.tex", GameFileLocs.GUI);
            cursor_stop = UITextureManager.Instance.CreateInstance(fl);

            fl = FileSystem.Instance.Locate("cursor_toofar.tex", GameFileLocs.GUI);
            cursor_toofar = UITextureManager.Instance.CreateInstance(fl);

            cursor_sel = new Texture[11];

            for (int i = 0; i < cursor_sel.Length; i++)
            {
                fl = FileSystem.Instance.Locate("selcursor" + (i + 13).ToString("D2") + ".tex", GameFileLocs.GUI);
                cursor_sel[i] = UITextureManager.Instance.CreateInstance(fl);
            }

            cursor_attack = new Texture[11];
            for (int i = 0; i < cursor_attack.Length; i++)
            {
                fl = FileSystem.Instance.Locate("selcursor" + (i + 1).ToString("D2") + ".tex", GameFileLocs.GUI);
                cursor_attack[i] = UITextureManager.Instance.CreateInstance(fl);
            }

            cursorState = MouseCursor.Normal;

        }