Beispiel #1
0
 public GUI(Game pmGame)
 {
     game=	pmGame;
     game.window.viewport.Resize+=	onViewportResize;
     pSet=	null;
     bRenderByBillboard=	false;
 }
Beispiel #2
0
        public GameFrame(Game pmGame)
        {
            game=	pmGame;
            frame=	new GameWindow();
            viewport=	new Viewport();
            resizeComponents=	defaultResizeComponents;

            frame.setDoubleBuffered(true);
            viewport.clearColor=	new Color(224, 224, 224);
            viewport.initContexts();
            viewport.isGraphics3D=	true;
            frame.Text=	"Game";
            frame.Size=	new Sdx.Size(800, 640);
            frame.Resize+=	frameResize;

            frame.Controls.Add(viewport);
        }
Beispiel #3
0
        public ZMapWindow(Game pmGame)
            : base(pmGame)
        {
            frame.Controls.Clear();
            frame.Text=	"ZMapper";

            controller=	new ComboBox();
            keyboard=	new ComboBox();
            mouse=	new ComboBox();
            refresh=	new Button();

            controller.DropDownStyle=	ComboBoxStyle.DropDownList;
            keyboard.DropDownStyle=	ComboBoxStyle.DropDownList;
            mouse.DropDownStyle=	ComboBoxStyle.DropDownList;
            resizeComponents=	nresizeComponents;

            frame.Controls.Add(controller);
            frame.Controls.Add(keyboard);
            frame.Controls.Add(mouse);
            frame.Controls.Add(refresh);
        }
Beispiel #4
0
 internal AudioPlayer(Game pmGame)
 {
     pMasterVolume=	1f;
     game=	pmGame;
     channels=	new FList<int>();
 }
Beispiel #5
0
 // Renders the gui component
 public override void render(ref GameTime time, ref Game game)
 {
     //game.graphics.startScissorCut(pLocation, pSize);
     base.render(ref time, ref game);
     //game.graphics.stopScissorCut();
 }
Beispiel #6
0
        // Redners the gui component when it is pressed down
        protected override void renderPressed(ref GameTime time, ref Game game)
        {
            if(textSprites.items[0].getColors()[0]!= pPressedColor)
            {
                for(int i= 0; i< textSprites.size; i++)
                    textSprites.items[i].applyColor(pPressedColor);
            }

            for(int i= 0; i< textSprites.size; i++)
                game.graphics.render(textSprites.items[i]);
        }
Beispiel #7
0
        // Renders the gui component when it is pressed
        protected virtual void renderPressed(ref Game game, ref GameTime time)
        {
            if(!pSprite.textureBounds.Equals(pPressedTexBounds))
                pSprite.setTextureBounds(pPressedTexBounds);
            if(pSprite.getColors()[0]!= pPressedColor)
                pSprite.setColor(pPressedColor);
            if(pSprite.texture!= pPressedTexture)
                pSprite.setTexture(pPressedTexture);

            game.graphics.render(pSprite);
        }
Beispiel #8
0
        // Renders the gui component when it's disabled
        protected override void renderDisabled(ref Game game, ref GameTime time)
        {
            if(!pSprite.textureBounds.Equals(pDisabledTexBounds))
                pSprite.setTextureBounds(pDisabledTexBounds);
            if(pSprite.getColors()[0]!= pDisableColor)
                pSprite.setColor(pDisableColor);
            if(pSprite.texture!= pDisabledTexture)
                pSprite.setTexture(pDisabledTexture);

            game.graphics.render(pSprite);
        }
Beispiel #9
0
        // Initiates textures of the game from the plugins
        public void initPluginTextures(Game game)
        {
            if(size== 0)
                return;
            if(bInit[3])
                return;

            bInit[3]=	true;
            for(int i= 0; i< size; i++)
                pPlugins[i].initTextures(game);
        }
Beispiel #10
0
        // Initiates sounds of the game from the plugins
        public void initPluginSounds(Game game)
        {
            if(size== 0)
                return;
            if(bInit[2])
                return;

            bInit[2]=	true;
            for(int i= 0; i< size; i++)
                pPlugins[i].initSounds(game);
        }
Beispiel #11
0
        // Initiates models of the game from the plugins
        public void initPlugins(Game game)
        {
            if(size== 0)
                return;
            if(bInit[1])
                return;

            bInit[1]=	true;
            Console.WriteLine("Initiating plugins");
            for(int i= 0; i< size; i++)
                pPlugins[i].startInit(game);
        }
Beispiel #12
0
        // Initiates models of the game from the plugins
        public void initPluginModels(Game game)
        {
            if(size== 0)
                return;
            if(bInit[5])
                return;

            bInit[5]=	true;
            for(int i= 0; i< size; i++)
                pPlugins[i].initModels(game);
        }
Beispiel #13
0
        // Initiates plugins for miscellaneous things
        public void initPluginMisc(Game game)
        {
            if(size== 0)
                return;
            if(bInit[6])
                return;

            bInit[6]=	true;
            for(int i= 0; i< size; i++)
                pPlugins[i].initMisc(game);
        }
Beispiel #14
0
        // Initiates fonts of the game from the plugins
        public void initPluginFonts(Game game)
        {
            if(size== 0)
                return;
            if(bInit[4])
                return;

            bInit[4]=	true;
            for(int i= 0; i< size; i++)
                pPlugins[i].initFonts(game);
        }
Beispiel #15
0
        public SEPtWindow(Game pmGame)
            : base(pmGame)
        {
            frame.Size=	new Sdx.Size(800, 640);
            frame.MinimumSize=	new Sdx.Size(800, 640);
            frame.Text=	"Saserdote Editor Packet [MODE: smap editor]";
            viewport.clearColor=	new Color(0, 10, 128);

            options=	new Panel();
            opbtns=	new Button[7];
            for(int i= 0; i< opbtns.Length; i++)
                opbtns[i]=	new Button();
            lstInViewport=	new ListBox();
            pnlInViewport=	new Panel();
            viewNav=	new Panel();
            vnbtns=	new Button[4];
            for(int i= 0; i< vnbtns.Length; i++)
                vnbtns[i]=	new Button();
            ofd=	new OpenFileDialog();
            lad=	new LoadedAssetsDialog(this, game);

            opbtns[0].Text=	"New...";
            opbtns[0].Click+=	onNewBtnClick;
            opbtns[1].Text=	"Open...";
            opbtns[1].Click+=	onOpenBtnClick;
            opbtns[2].Text=	"Save";
            opbtns[2].Click+=	onSaveBtnClick;
            opbtns[3].Text=	"Save As...";
            opbtns[3].Click+=	onSaveAsBtnClick;
            opbtns[4].Text=	"Import...";
            opbtns[4].Click+=	onImportBtnClick;
            opbtns[5].Text=	"Loaded Assets...";
            opbtns[5].Click+=	onLoadedBtnClick;
            opbtns[6].Text=	"Switch Editors...";
            opbtns[6].Click+=	onSwitchBtnClick;

            vnbtns[0].Text=	"Relocate...";
            vnbtns[0].Enabled=	false;
            vnbtns[1].Text=	"Rotate...";
            vnbtns[1].Enabled=	false;
            vnbtns[2].Text=	"Scale...";
            vnbtns[2].Enabled=	false;
            vnbtns[3].Text=	"Edit Environment...";

            for(int i= 0; i< 100; i++)
                lstInViewport.Items.Add(i);
            pnlInViewport.BackColor=	Sdx.Color.Crimson;

            ofd.Multiselect=	true;
            ofd.CheckFileExists=	true;
            ofd.CheckPathExists=	true;
            ofd.Filter=	"All Files(*.*)|*.*";
            ofd.Filter+=	"|WaveFront Object Files (*.obj)|*.obj";
            ofd.Filter+=	"|Saserdote Graphics Model (*.sgmdl)|*.sgmdl";
            ofd.Filter+=	"|Png File (*.png)|*.png";

            options.Controls.AddRange(opbtns);
            viewNav.Controls.AddRange(vnbtns);

            frame.Controls.Add(options);
            frame.Controls.Add(lstInViewport);
            frame.Controls.Add(pnlInViewport);
            frame.Controls.Add(viewNav);
        }
Beispiel #16
0
        // Updates the gui component
        public override void update(ref GameTime time, ref Game game)
        {
            for(int i= 0; i< containerSize; i++)
                components.items[i].update(ref time, ref game);

            base.update(ref time, ref game);
        }
Beispiel #17
0
        // Renders the gui component
        public override void render(ref Game game, ref GameTime time)
        {
            if(!pVisible)
                return;
            if(pSprite== null)
                return;

            if(!pEnabled)
                renderDisabled(ref game, ref time);
            else if(click!= 0)
                renderPressed(ref game, ref time);
            else if(bHover)
                renderHover(ref game, ref time);
            else
                renderNormal(ref game, ref time);
        }
Beispiel #18
0
 // Renders the gui component
 public override void render(ref Game game, ref GameTime time)
 {
     for(int i= 0; i< size; i++)
         components[i].render(ref game, ref time);
 }
Beispiel #19
0
        // Renders the gui component normally
        protected override void renderNormal(ref Game game, ref GameTime time)
        {
            if(!pSprite.textureBounds.Equals(pTexBounds))
                pSprite.setTextureBounds(pTexBounds);

            base.renderNormal(ref game, ref time);
        }
Beispiel #20
0
        // Initiates the input
        internal static void init(Game pmGame)
        {
            game=	pmGame;
            Sdl.SDL_Init(Sdl.SDL_INIT_JOYSTICK);

            game.window.viewport.LostFocus+=	onLostFocus;
            game.window.viewport.GotFocus+=	onGotFocus;

            bFocused=	true;
            pUseFocus=	true;

            mhelper=	new MouseHelper(game.window.viewport);
            khelper=	new KeyboardHelper(game.window.viewport);
            gamepadDetector=	new FList<GamepadInfo>();
            gamepadDetector.add(new GamepadInfo(15, 0, 3, typeof(Xbox360Gamepad)));
            gamepadDetector.add(new GamepadInfo(12, 1, 2, typeof(PS2Gamepad)));

            if(Sdl.SDL_NumJoysticks()> 0)
            {
                gamepad=	getGamepadNoQuit(0);
            }
        }
Beispiel #21
0
 public GUI(Game pmGame)
 {
     game=	pmGame;
     set=	null;
 }
Beispiel #22
0
        // Renders the gui component
        public override void render(ref GameTime time, ref Game game)
        {
            if(pText.Length== 0)
                return;
            if(!bVisible)
                return;

            textSprites.clear();

            for(int i= 0; i< pText.Length; i++)
                textSprites.add(font.createSprite(pText[i], location.x+i*16, location.y, 16));

            if(!pEnabled)
                renderDisabled(ref time, ref game);
            else if(bHover)
                renderHovered(ref time, ref game);
            else if(click!= 0)
                renderPressed(ref time, ref game);
            else
                renderNormal(ref time, ref game);
        }