Пример #1
0
        public Chest(Rectangle r,Map m)
            : base(m)
        {
            Body BodyDec = new Body(m.PhysicalWorld);
            BodyDec.BodyType = BodyType.Static;

            PolygonShape S = new PolygonShape(1f);
            S.SetAsBox(r.Width / 2, r.Height / 2);

            Fixture = BodyDec.CreateFixture(S);
            Fixture.Restitution = 1f;
            Fixture.Friction = 10f;

            Position = r;

            SetName("Chest");

            items = new List<Item>();

            ChestWindow = new Window(GeneralManager.GetPartialRect(0.4f, 0.2f, 0.2f, 0.6f));
            ChestWindow.BgTex = GeneralManager.Textures["GUI/InGameGUI/ChestMenuBg"];

            ChestWindow.Visible = false;

            CloseButton = new Button(new Rectangle(ChestWindow.Position.Width - 32, 8, 24, 24), "", GeneralManager.Textures["GUI/InGameGUI/CloseButton"], Color.Gray, Color.White, null);
            CloseButton.Action = CloseChestWindow;
            ChestWindow.AddGUI(CloseButton );

            list = new ListBox(new Rectangle(16,16,ChestWindow.Position.Width - 24,ChestWindow.Position.Height - 32));
            ChestWindow.AddGUI(list);

            Map.Parent.AddGUI(ChestWindow);
        }
Пример #2
0
        public WorldScreen(Game Game, int SizeX, int SizeY)
            : base(Game, SizeX, SizeY)
        {
            EqHud = new Window(new Rectangle(GeneralManager.HalfWidth - 175, GeneralManager.HalfHeight - 146, 350, 146), "Textures/Hud/EqBack"/*new Color(0, 0, 0, 0.4f)*/);
            Button CloseButton = new Button(new Rectangle(GeneralManager.HalfWidth, GeneralManager.HalfHeight,32, 32), "", GeneralManager.Textures["Textures/GUI/CloseButton"], Color.Gray, Color.White, null);
            EqHud.AddGUI(CloseButton);
            this.AddGUI(EqHud);

            CraftingHud = new Window(new Rectangle(GeneralManager.HalfWidth - 175 - 180, GeneralManager.HalfHeight - 146, 180, 216), "Textures/Hud/CraftingBack");
            this.AddGUI(CraftingHud);

            ArmorHud = new Window(new Rectangle(GeneralManager.HalfWidth + 175, GeneralManager.HalfHeight - 146, 112, 180), "Textures/Hud/ArmorBack");
            this.AddGUI(ArmorHud);

            ChatHud = new Window(new Rectangle(50, GeneralManager.ScreenY - 300, 400, 300), "Textures/Hud/Chat");
            this.AddGUI(ChatHud);

            DebugHud = new Window(new Rectangle(GeneralManager.ScreenX - 400 - 50, GeneralManager.ScreenY - 300, 400, 300), "Textures/Hud/Debug");
            this.AddGUI(DebugHud);

            ExternalGUIHud = new Window(new Rectangle(GeneralManager.HalfWidth - 175, GeneralManager.HalfHeight, 350, 200), "Textures/Hud/ExternalEqBack");
            this.AddGUI(ExternalGUIHud);

            HotbarHud = new Window(new Rectangle(GeneralManager.HalfWidth - 175, GeneralManager.ScreenY - 44, 350, 44), "Textures/Hud/HotbarBack");
            this.AddGUI(HotbarHud);

            HpBar = new Window(new Rectangle(0, GeneralManager.ScreenY - 400, 50, 400), "Textures/Hud/HpBar");
            this.AddGUI(HpBar);

            ManaBar = new Window(new Rectangle(GeneralManager.ScreenX - 50, GeneralManager.ScreenY - 400, 50, 400), "Textures/Hud/ManaBar");
            this.AddGUI(ManaBar);

            MinimapHud = new Window(new Rectangle(GeneralManager.ScreenX - 300, 0, 300, 300), "Textures/Hud/MinimapBack");
            this.AddGUI(MinimapHud);

            TooltipHud = new Window(new Rectangle(GeneralManager.HalfWidth - 100,0, 200, 50), "Textures/Hud/Tooltip");
            this.AddGUI(TooltipHud);

            World = new GameWorld(this);

            foreach (BaseMod Mod in SteamAge.Mods)
            {
                Mod.Initalize(World);
            }

            Debug = new FarseerPhysics.DebugViews.DebugViewXNA(World.PhysicalWorld);
            Debug.AppendFlags(FarseerPhysics.DebugViewFlags.Shape);
            Debug.AppendFlags(FarseerPhysics.DebugViewFlags.AABB);
            Debug.AppendFlags(FarseerPhysics.DebugViewFlags.PerformanceGraph);
            Debug.AppendFlags(FarseerPhysics.DebugViewFlags.Joint);
            Debug.AppendFlags(FarseerPhysics.DebugViewFlags.ContactPoints);
            Debug.DefaultShapeColor = Color.White;
            Debug.SleepingShapeColor = Color.LightGray;
            Debug.LoadContent(Parent.GraphicsDevice, Parent.Content);

            World.PostInit();
        }