예제 #1
0
 public Node(int x, int y, Sector sector)
 {
     X = x;
     Y = y;
     Sector = sector;
     NextNodes = new List<Node>();
 }
예제 #2
0
        public void OnActivate(params object[] args)
        {
            if (args.Length >= 1 && args[0] is Sector)
            {
                Sector = (Sector)args[0];
            }
            else
            {
                Sector = new Sector();
            }

            if (args.Length >= 2 && args[1] is PlayerShip)
            {
                PlayerShip = (PlayerShip)args[1];
            }
            else
            {
                PlayerShip = new PlayerShip();
            }

            // Store window
            window = Root.Singleton.Window;
            rctScreen = Util.ScreenRect(window.Size.X, window.Size.Y, 1.7778f);

            // Add background
            var texBackground = Root.Singleton.Material("img/stars/bg_blueStarcluster.png");
            sprBackground = new Sprite(texBackground);
            sprBackground.Position = new Vector2f(rctScreen.Left, rctScreen.Top);
            sprBackground.Scale = Util.Scale(sprBackground, new Vector2f(rctScreen.Width, rctScreen.Height));

            // Init ship renderer
            playerShipRenderer.ShowRooms = true;
            playerShipRenderer.Ship = PlayerShip;
            Util.LayoutControl(playerShipRenderer, 310, 100, 660, 450, rctScreen);
            playerShipRenderer.Parent = Root.Singleton.Canvas;
            playerShipRenderer.Init();

            // Init HUD
            UpdateHullMeter();
            UpdateScrapMeter();
            UpdateShields();
            UpdateItems();

            UpdateJumpButton();
        }
예제 #3
0
        public override void OnActivate(params object[] args)
        {
            if (args.Length >= 1 && args[0] is Sector)
            {
                Sector = (Sector)args[0];
            }
            else
            {
                Sector = new Sector();
            }

            BackgroundImage = getBackgroundTexture();
            base.OnActivate();
            Util.LayoutControl(Window, (1280 - 540) / 2, (720 - 420) / 2, Window.Image.Size, ScreenRectangle);

            foreach (var b in Sector.Beacons)
            {
                var btn = new BeaconIcon();
                btn.Image = Root.Singleton.Material(b.Icon);
                btn.ShadowImage = Root.Singleton.Material(b.IconShadow);
                Util.LayoutControl(btn, b.X - 16, b.Y - 16, 32, 32, ScreenRectangle);
                btn.Parent = Window;
                btn.Init();
            }

            var btnClose = new ImageButton();
            btnClose.Image = Root.Singleton.Material("img/generalUI/general_close.png");
            btnClose.HoveredImage = Root.Singleton.Material("img/generalUI/general_close3.png");
            btnClose.DisabledImage = Root.Singleton.Material("img/generalUI/general_close4.png");
            btnClose.HoverSound = Root.Singleton.Sound("audio/waves/ui/select_light1.wav");
            btnClose.OnClick += (sender) =>
            {
                Finish = true;
            };
            Util.LayoutControl(btnClose, 504, 0, 64, 64, ScreenRectangle);
            btnClose.Parent = Window;
            btnClose.Init();
        }
예제 #4
0
 public Node AddNode(int x, int y, Sector sector)
 {
     Node n = new Node(x, y, sector);
     Nodes.Add(n);
     return n;
 }