Exemplo n.º 1
0
        public override void OnInitializeScene(GameFramework g)
        {
            BindGameController();

            font_small = g.CANVAS.CreateFont(new System.Drawing.Font("Arial", 12));
            font_large = g.CANVAS.CreateFont(new System.Drawing.Font("Arial", 28));
            menu = new PanelMenu(font_small, new PanelMenuSelectHandler(MenuHandler));
            menu.ForegroundColor = Color.White;
            menu.BackgroundColor = Color.Black;
            menu.BorderColor = Color.White;

            //menu.ScrollButtonWidth = 20;
            menu.SetHeight(100);
            menu.SetPosition(200, 200);
            menu.SetWidth(100);
            //menu.DrawFormat = DrawTextFormat.None;

            int height = menu.LayoutMenuOptions(new string[] {
                "item1",
                "item2",
                "item3",
                "item4",
                "item5",
                 "item6",
                "item7",
                "item8 ",
                "item9 ",
                "item10"
            }, PanelLayout.HorizontalFree);
 


        }
Exemplo n.º 2
0
        public override void OnInitializeScene(GameFramework g)
        {
            Size DisplaySize = g.CANVAS.Size;

            BindGameController();

            this.Fonts.Add("Large", g.CANVAS.CreateFont(new System.Drawing.Font("MS Sans Serif", 14)));
            this.Fonts.Add("Medium", g.CANVAS.CreateFont(new System.Drawing.Font("MS Sans Serif", 12)));
            this.Fonts.Add("Small", g.CANVAS.CreateFont(new System.Drawing.Font("MS Sans Serif", 8)));

            int bottom = 130;

            background.X = 0;
            background.Y = 0;
            background.Height = DisplaySize.Height;
            background.Width = DisplaySize.Width;
            SetRootWindow(background);

            score.X = 0;
            score.Y = 0;
            score.Width = background.Width;
            score.Height = 40;

            time_rect.X = score.Width - 100;
            time_rect.Y = 0;
            time_rect.Width = 100;
            time_rect.Height = 40;

            information_rect.X = background.Right - 200;
            information_rect.Y = score.Bottom + 1;
            information_rect.Width = 200;
            information_rect.Height = background.Height - (score.Height + bottom);

            button_panel.X = 0;
            button_panel.Y = 41;
            button_panel.Height = 20;
            button_panel.Width = background.Width - information_rect.Width;
            
            frame.X = 0;
            frame.Y = button_panel.Bottom + 1;
            frame.Height = background.Height - (score.Height + bottom + button_panel.Height);
            frame.Width = background.Width - information_rect.Width;

            playfield_panel.X = frame.X + 20;
            playfield_panel.Y = frame.Y + 20;
            playfield_panel.Width = frame.Width - 40;
            playfield_panel.Height = frame.Height - 40;


            #region StatusPanel
            StatusPanel = new Aptima.Asim.DDD.Client.Common.GLCore.Controls.Panel(
                                                information_rect.X + 1,
                                                information_rect.Y,
                                                information_rect.Right - 1,
                                                information_rect.Y + information_rect.Height);
            StatusPanel.Layout = PanelLayout.VerticalFree;
            StatusPanel.Background = Window.BackgroundColor;
            StatusPanel.Hide = true;

            ObjectIDLbl = (PanelLabel)StatusPanel.BindPanelControl(new PanelLabel("Object Name", 0, 0, StatusPanel.ClientArea.Width, 50));
            ObjectIDLbl.BackgroundColor = Color.Black;
            ObjectIDLbl.ForegroundColor = Color.Yellow;
            ObjectIDLbl.Font = Fonts["Large"];

            PanelLabel b = (PanelLabel)StatusPanel.BindPanelControl(new PanelLabel(0, 0, StatusPanel.ClientArea.Width, 12));
            b.BackgroundColor = StatusPanel.Background;
            b.Font = Fonts["Medium"];

            b = (PanelLabel)StatusPanel.BindPanelControl(new PanelLabel("Class Name", 0, 0, StatusPanel.ClientArea.Width, 25));
            b.BackgroundColor = Color.Black;
            b.Font = Fonts["Medium"];
            ObjectClassLbl = (PanelLabel)StatusPanel.BindPanelControl(new PanelLabel(0, 0, StatusPanel.ClientArea.Width, 25));
            ObjectClassLbl.BackgroundColor = StatusPanel.Background;
            ObjectClassLbl.Font = Fonts["Small"];

            b = (PanelLabel)StatusPanel.BindPanelControl(new PanelLabel("State", 0, 0, StatusPanel.ClientArea.Width, 25));
            b.BackgroundColor = Color.Black;
            b.Font = Fonts["Medium"];
            ObjectStateLbl = (PanelLabel)StatusPanel.BindPanelControl(new PanelLabel(0, 0, StatusPanel.ClientArea.Width, 25));
            ObjectStateLbl.BackgroundColor = StatusPanel.Background;
            ObjectStateLbl.Font = Fonts["Small"];

            b = (PanelLabel)StatusPanel.BindPanelControl(new PanelLabel("Location", 0, 0, StatusPanel.ClientArea.Width, 25));
            b.BackgroundColor = Color.Black;
            b.Font = Fonts["Medium"];
            LocationLbl = (PanelLabel)StatusPanel.BindPanelControl(new PanelLabel(0, 0, StatusPanel.ClientArea.Width, 25));
            LocationLbl.ForegroundColor = Color.Lime;
            LocationLbl.BackgroundColor = StatusPanel.Background;
            LocationLbl.Font = Fonts["Small"];

            AltitudeLbl = (PanelLabel)StatusPanel.BindPanelControl(new PanelLabel(0, 0, StatusPanel.ClientArea.Width, 25));
            AltitudeLbl.BackgroundColor = StatusPanel.Background;
            AltitudeLbl.Font = Fonts["Small"];

            b = (PanelLabel)StatusPanel.BindPanelControl(new PanelLabel("Destination", 0, 0, StatusPanel.ClientArea.Width, 25));
            b.BackgroundColor = Color.Black;
            b.Font = Fonts["Medium"];
            DestinationLbl = (PanelLabel)StatusPanel.BindPanelControl(new PanelLabel(0, 0, StatusPanel.ClientArea.Width, 25));
            DestinationLbl.ForegroundColor = Color.Lime;
            DestinationLbl.BackgroundColor = StatusPanel.Background;
            DestinationLbl.Font = Fonts["Small"];

            TtdLbl = (PanelLabel)StatusPanel.BindPanelControl(new PanelLabel(0, 0, StatusPanel.ClientArea.Width, 25));
            TtdLbl.ForegroundColor = Color.Lime;
            TtdLbl.BackgroundColor = StatusPanel.Background;
            TtdLbl.Font = Fonts["Medium"];

            b = (PanelLabel)StatusPanel.BindPanelControl(new PanelLabel("Speed", 0, 0, StatusPanel.ClientArea.Width, 25));
            b.BackgroundColor = Color.Black;
            b.Font = Fonts["Medium"];
            SpeedLbl = (PanelLabel)StatusPanel.BindPanelControl(new PanelLabel(0, 0, StatusPanel.ClientArea.Width, 25));
            SpeedLbl.BackgroundColor = StatusPanel.Background;
            SpeedLbl.Font = Fonts["Small"];

            b = (PanelLabel)StatusPanel.BindPanelControl(new PanelLabel("Maximum Speed", 0, 0, StatusPanel.ClientArea.Width, 25));
            b.BackgroundColor = Color.Black;
            b.Font = Fonts["Medium"];
            MaxSpeedLbl = (PanelLabel)StatusPanel.BindPanelControl(new PanelLabel(0, 0, StatusPanel.ClientArea.Width, 25));
            MaxSpeedLbl.BackgroundColor = StatusPanel.Background;
            MaxSpeedLbl.Font = Fonts["Small"];

            b = (PanelLabel)StatusPanel.BindPanelControl(new PanelLabel("Throttle", 0, 0, StatusPanel.ClientArea.Width, 25));
            b.BackgroundColor = Color.Black;
            b.Font = Fonts["Medium"];

            Throttle = (PanelSlider)StatusPanel.BindPanelControl(new PanelSlider(0, 0, StatusPanel.ClientArea.Width,30));
            Throttle.BackgroundColor = StatusPanel.Background;
            Throttle.Font = Fonts["Small"];
            Throttle.Handler = new PanelSliderChangeHandler(SliderHandler);

            b = (PanelLabel)StatusPanel.BindPanelControl(new PanelLabel("Fuel Amount", 0, 0, StatusPanel.ClientArea.Width, 25));
            b.BackgroundColor = Color.Black;
            b.Font = Fonts["Medium"];
            FuelAmountLbl = (PanelProgressLabel)StatusPanel.BindPanelControl(new PanelProgressLabel(0, 0, StatusPanel.ClientArea.Width, 25));
            FuelAmountLbl.BackgroundColor = StatusPanel.Background;
            FuelAmountLbl.Font = Fonts["Small"];

            b = (PanelLabel)StatusPanel.BindPanelControl(new PanelLabel("Fuel Capacity", 0, 0, StatusPanel.ClientArea.Width, 25));
            b.BackgroundColor = Color.Black;
            b.Font = Fonts["Medium"];
            FuelCapacityLbl = (PanelLabel)StatusPanel.BindPanelControl(new PanelLabel(0, 0, StatusPanel.ClientArea.Width, 25));
            FuelCapacityLbl.BackgroundColor = StatusPanel.Background;
            FuelCapacityLbl.Font = Fonts["Small"];

            b = (PanelLabel)StatusPanel.BindPanelControl(new PanelLabel("Vulnerabilities", 0, 0, StatusPanel.ClientArea.Width, 25));
            b.BackgroundColor = Color.Black;
            b.Font = Fonts["Medium"];
            VulnerabilityMenu = (PanelMenu)StatusPanel.BindPanelControl(new PanelMenu(Fonts["Medium"], string.Empty, 0, 0, StatusPanel.ClientArea.Width, 75, null));
            VulnerabilityMenu.BackgroundColor = Color.Black;
            VulnerabilityMenu.ForegroundColor = Window.CaptionColor;
            VulnerabilityMenu.Font = Fonts["Medium"];

            b = (PanelLabel)StatusPanel.BindPanelControl(new PanelLabel(0, 0, StatusPanel.ClientArea.Width, 12));
            b.BackgroundColor = StatusPanel.Background;
            b.Font = Fonts["Medium"];

            DeSelectBtn = new PanelStaticButton(0, 0, StatusPanel.ClientArea.Width, 25);
            DeSelectBtn.Text = "Cancel / DeSelect";
            DeSelectBtn.MouseClick = new MouseEventHandler(this.DeSelectBtnHandler);
            DeSelectBtn.Vertical = true;
            DeSelectBtn.Font = Fonts["Medium"];

            StatusPanel.BindPanelControl(DeSelectBtn);


            #endregion

            #region AssetPanel
            AssetPanel = new Aptima.Asim.DDD.Client.Common.GLCore.Controls.Panel(
                                    information_rect.X + 1,
                                    information_rect.Y,
                                    information_rect.Right - 1,
                                    information_rect.Y + information_rect.Height);
            AssetPanel.Layout = PanelLayout.VerticalFree;
            AssetPanel.Background = Window.BackgroundColor;

            AssetPanel.Hide = true;

            AssetModeLbl = (PanelLabel)AssetPanel.BindPanelControl(new PanelLabel("Asset Menu", 0, 0, AssetPanel.ClientArea.Width, 50));
            AssetModeLbl.BackgroundColor = Color.Black;
            AssetModeLbl.ForegroundColor = Color.Yellow;
            AssetModeLbl.Font = Fonts["Large"];

            AssetHeaderLbl = (PanelLabel)AssetPanel.BindPanelControl(new PanelLabel("Managed Assets ...", 0, 0, AssetPanel.ClientArea.Width, 25));
            AssetHeaderLbl.BackgroundColor = Color.Black;
            AssetHeaderLbl.Font = Fonts["Medium"];

            AssetMenu = new PanelMenu(Fonts["Medium"], string.Empty, 0, 0, AssetPanel.ClientArea.Width, AssetHeaderLbl.ClientArea.Bottom,
                new PanelMenuSelectHandler(AssetHandler));
            AssetMenu.SetHeight(information_rect.Height / 3);
            AssetMenu.BackgroundColor = AssetPanel.Background;
            AssetPanel.BindPanelControl(AssetMenu);

            MiscAssetHeaderLbl = (PanelLabel)AssetPanel.BindPanelControl(new PanelLabel("UnManaged Assets ...", 0, 0, AssetPanel.ClientArea.Width, 25));
            MiscAssetHeaderLbl.BackgroundColor = Color.Black;
            MiscAssetHeaderLbl.Font = Fonts["Medium"];

            MiscAssetMenu = new PanelMenu(Fonts["Medium"], string.Empty, 0, 0, AssetPanel.ClientArea.Width, MiscAssetHeaderLbl.ClientArea.Bottom,
                new PanelMenuSelectHandler(AssetHandler));
            MiscAssetMenu.SetHeight(information_rect.Height / 3);
            MiscAssetMenu.BackgroundColor = AssetPanel.Background;
            AssetPanel.BindPanelControl(MiscAssetMenu);

            #endregion
            
            #region AttackPanel
            AttackPanel = new Aptima.Asim.DDD.Client.Common.GLCore.Controls.Panel(
                                                information_rect.X + 1,
                                                information_rect.Y,
                                                information_rect.Right - 1,
                                                information_rect.Y + information_rect.Height);
            AttackPanel.Layout = PanelLayout.VerticalFree;
            AttackPanel.Background = Window.BackgroundColor;
            AttackPanel.Hide = true;

            AttackModeLbl = (PanelLabel) AttackPanel.BindPanelControl(new PanelLabel("Object Name", 0, 0, AttackPanel.ClientArea.Width, 50));
            AttackModeLbl.BackgroundColor = Color.Black;
            AttackModeLbl.ForegroundColor = Color.Yellow;
            AttackModeLbl.Font = Fonts["Large"];

            AttackHeaderLbl = (PanelLabel)AttackPanel.BindPanelControl(new PanelLabel("Choose Weapon ...", 0, 0, AttackPanel.ClientArea.Width, 25));
            AttackHeaderLbl.BackgroundColor = Color.Black;
            AttackHeaderLbl.Font = Fonts["Medium"];


            AttackMenu = new PanelMenu(Fonts["Medium"], string.Empty, 0, 0, AttackPanel.ClientArea.Width, AttackModeLbl.ClientArea.Bottom,  
                new PanelMenuSelectHandler(AttackHandler));
            AttackMenu.SetHeight(information_rect.Height / 2);
            AttackMenu.BackgroundColor = AttackPanel.Background;
            AttackPanel.BindPanelControl(AttackMenu);


            CancelAttackBtn = new PanelStaticButton(0, 0, AttackMenu.ClientArea.Width, 25);
            CancelAttackBtn.Text = "Cancel";
            CancelAttackBtn.MouseClick = new MouseEventHandler(this.CancelAttackBtnHandler);
            CancelAttackBtn.Vertical = true;
            CancelAttackBtn.Font = Fonts["Medium"];

            AttackPanel.BindPanelControl(CancelAttackBtn);
            #endregion AttackPanel
            
            #region SubPPanel
            SubPlatformPanel = new Aptima.Asim.DDD.Client.Common.GLCore.Controls.Panel(
                                                information_rect.X + 1,
                                                information_rect.Y,
                                                information_rect.Right - 1,
                                                information_rect.Y + information_rect.Height);
            SubPlatformPanel.Layout = PanelLayout.VerticalFree;
            SubPlatformPanel.Background = Window.BackgroundColor;
            SubPlatformPanel.Hide = true;

            SubPModeLbl = (PanelLabel)SubPlatformPanel.BindPanelControl(new PanelLabel("Object Name", 0, 0, SubPlatformPanel.ClientArea.Width, 50));
            SubPModeLbl.BackgroundColor = Color.Black;
            SubPModeLbl.ForegroundColor = Color.Yellow;
            SubPModeLbl.Font = Fonts["Large"];

            SubPHeaderLbl = (PanelLabel)SubPlatformPanel.BindPanelControl(new PanelLabel("Choose Sub-Platform ...", 0, 0, SubPlatformPanel.ClientArea.Width, 25));
            SubPHeaderLbl.BackgroundColor = Color.Black;
            SubPHeaderLbl.Font = Fonts["Medium"];


            SubPlatformMenu = new PanelMenu(Fonts["Medium"], string.Empty, 0, 0, AttackPanel.ClientArea.Width, AttackModeLbl.ClientArea.Bottom,
                new PanelMenuSelectHandler(SubPHandler));
            SubPlatformMenu.SetHeight(information_rect.Height / 2);
            SubPlatformMenu.BackgroundColor = SubPlatformPanel.Background;
            SubPlatformPanel.BindPanelControl(SubPlatformMenu);


            CancelSubPBtn = new PanelStaticButton(0, 0, SubPlatformMenu.ClientArea.Width, 25);
            CancelSubPBtn.Text = "Cancel SubP";
            CancelSubPBtn.MouseClick = new MouseEventHandler(this.CancelSubPBtnHandler);
            CancelSubPBtn.Vertical = true;
            CancelSubPBtn.Font = Fonts["Medium"];

            SubPlatformPanel.BindPanelControl(CancelSubPBtn);
            #endregion AttackPanel
            
            #region Misc UI

            PlayfieldPanel = CreatePanel(playfield_panel.X, playfield_panel.Y, playfield_panel.Right, playfield_panel.Bottom);
            ButtonPanel = CreatePanel(button_panel.X, button_panel.Y, button_panel.Right, button_panel.Bottom);
            ButtonPanel.Background = StatusPanel.Background;
            ButtonPanel.Layout = PanelLayout.HorizontalFree;

            MapNameLbl = (PanelLabel)ButtonPanel.BindPanelControl(
                new PanelLabel("Map: " + DDD_Global.Instance.MapName.Substring(0, DDD_Global.Instance.MapName.Length - 4)
                , 0, 0, ButtonPanel.ClientArea.Width, ButtonPanel.ClientArea.Height));
            MapNameLbl.BackgroundColor = ButtonPanel.Background;
            MapNameLbl.Font = Fonts["Medium"];

            

            MsgWindow = CreateWindow(g.CANVAS.CreateFont(new System.Drawing.Font("MS Sans Serif", 12)),
                "Messages", 0, frame.Bottom + 2, (int)(background.Width / 2), background.Bottom);

            MsgWindowPanel = (PanelTextRegion)MsgWindow.BindPanelControl(new Aptima.Asim.DDD.Client.Common.GLCore.Controls.PanelTextRegion(g.CANVAS.CreateFont(new System.Drawing.Font("MS Sans Serif", 10))
               , 0, frame.Bottom + 2, (int)(background.Width / 2), background.Bottom));

            MsgWindowPanel.Sticky = true;


            ChatWindow = CreateWindow(g.CANVAS.CreateFont(new System.Drawing.Font("MS Sans Serif", 12)), "Chat",
                MsgWindowPanel.ClientArea.Right + 2,
                frame.Bottom + 2,
                background.Right - 2,
                background.Bottom);

            ChatWindowPanel = (PanelTextRegion)ChatWindow.BindPanelControl(new Aptima.Asim.DDD.Client.Common.GLCore.Controls.PanelTextRegion(g.CANVAS.CreateFont(new System.Drawing.Font("MS Sans Serif", 10)),
                MsgWindowPanel.ClientArea.Right + 2,
                frame.Bottom + 2,
                background.Right - 2,
                background.Bottom));

            ChatWindowPanel.HasInput = true;
            ChatWindowPanel.Sticky = true;
            ChatWindowPanel.OnTextChat = new TextChatEventHandler(this.TextChatHandler);


            LeftScrollPanel = CreatePanel(frame.X, playfield_panel.Y, playfield_panel.X - 1, playfield_panel.Bottom);
            LeftScrollBtn = (PanelDynamicButton)LeftScrollPanel.BindPanelControl(new Aptima.Asim.DDD.Client.Common.GLCore.Controls.PanelDynamicButton(frame.X, playfield_panel.Y, playfield_panel.X - 1, playfield_panel.Bottom));
            LeftScrollBtn.MouseDown = new MouseEventHandler(this.LeftScroll);
            LeftScrollBtn.MouseUp = new MouseEventHandler(this.StopScroll);
            left_arrow.X = LeftScrollPanel.ClientArea.X + (LeftScrollPanel.ClientArea.Width / 2) - 6;
            left_arrow.Y = LeftScrollPanel.ClientArea.Top + (LeftScrollPanel.ClientArea.Height / 2) - 6;
            left_arrow.Width = 12;
            left_arrow.Height = 12;


            RightScrollPanel = CreatePanel(playfield_panel.Right + 1, playfield_panel.Y, frame.Right, playfield_panel.Bottom);
            RightScrollBtn = (PanelDynamicButton)RightScrollPanel.BindPanelControl(new Aptima.Asim.DDD.Client.Common.GLCore.Controls.PanelDynamicButton(playfield_panel.Right + 1, playfield_panel.Y, frame.Right, playfield_panel.Bottom));
            RightScrollBtn.MouseDown = new MouseEventHandler(this.RightScroll);
            RightScrollBtn.MouseUp = new MouseEventHandler(this.StopScroll);
            right_arrow.X = RightScrollPanel.ClientArea.X + (RightScrollPanel.ClientArea.Width / 2) - 6;
            right_arrow.Y = RightScrollPanel.ClientArea.Top + (RightScrollPanel.ClientArea.Height / 2) - 6;
            right_arrow.Width = 12;
            right_arrow.Height = 12;


            DownScrollPanel = CreatePanel(playfield_panel.X, playfield_panel.Bottom + 1, playfield_panel.Right, frame.Bottom);
            DownScrollBtn = (PanelDynamicButton)DownScrollPanel.BindPanelControl(new Aptima.Asim.DDD.Client.Common.GLCore.Controls.PanelDynamicButton(playfield_panel.X, playfield_panel.Bottom + 1, playfield_panel.Right, frame.Bottom));
            DownScrollBtn.MouseDown = new MouseEventHandler(this.DownScroll);
            DownScrollBtn.MouseUp = new MouseEventHandler(this.StopScroll);
            down_arrow.X = DownScrollPanel.ClientArea.X + (DownScrollPanel.ClientArea.Width / 2) - 6;
            down_arrow.Y = DownScrollPanel.ClientArea.Top + (DownScrollPanel.ClientArea.Height / 2) - 6;
            down_arrow.Width = 12;
            down_arrow.Height = 12;


            UpScrollPanel = CreatePanel(playfield_panel.X, frame.Top, playfield_panel.Right, playfield_panel.Top - 1);
            UpScrollBtn = (PanelDynamicButton)UpScrollPanel.BindPanelControl(new Aptima.Asim.DDD.Client.Common.GLCore.Controls.PanelDynamicButton(playfield_panel.X, frame.Top, playfield_panel.Right, playfield_panel.Top - 1));
            UpScrollBtn.MouseDown = new MouseEventHandler(this.UpScroll);
            UpScrollBtn.MouseUp = new MouseEventHandler(this.StopScroll);
            up_arrow.X = UpScrollPanel.ClientArea.X + (UpScrollPanel.ClientArea.Width / 2) - 6;
            up_arrow.Y = UpScrollPanel.ClientArea.Top + (UpScrollPanel.ClientArea.Height / 2) - 6;
            up_arrow.Width = 12;
            up_arrow.Height = 12;
            #endregion


            foreach (string str in g.Textures.Keys)
            {
                if (str.CompareTo("MAP") != 0)
                {
                    Obj_Sprite s = CreateSprite(str, SpriteFlags.AlphaBlend);
                    s.Initialize(g.CANVAS);
                    s.Texture(g.Textures[str]);
                }
            }
                
            Map = CreateSprite("MAP", SpriteFlags.SortTexture | SpriteFlags.AlphaBlend);
            Map.Initialize(g.CANVAS);
            Map.Texture(g.GetTexture("MAP"));
            Map.Diffuse = Color.Gray; 



            MapScene = new MapPlayfield(g.CANVAS, Map, PlayfieldPanel.ClientArea, _commands);
            Playfield = (PanelSceneRegion)PlayfieldPanel.BindPanelControl(
                new Aptima.Asim.DDD.Client.Common.GLCore.Controls.PanelSceneRegion(playfield_panel.X, playfield_panel.Y, playfield_panel.Right, playfield_panel.Bottom, MapScene)
                );
            Playfield.Sticky = false;
            Playfield.MouseClick = new MouseEventHandler(MapScene.OnMouseClick);
            Playfield.MouseWheel = new MouseEventHandler(MapScene.OnMouseWheel);
            Playfield.MouseDown = new MouseEventHandler(MapScene.OnMouseDown);
            Playfield.MouseUp = new MouseEventHandler(MapScene.OnMouseUp);
            Playfield.MouseMove = new MouseEventHandler(MapScene.OnMouseMove);


            Map.SetPosition(PlayfieldPanel.ClientArea.X, PlayfieldPanel.ClientArea.Y, 0);
            MapScene.OnInitializeScene(g);


            if (!DDD_Global.Instance.nc.IsConnected())
            {
                ViewProMotionUpdate update = new ViewProMotionUpdate();

                update.ObjectId = "object1";
                update.Throttle = 1;
                update.StartX = 600;
                update.StartY = 600;
                update.StartZ = 0;
                update.PlayerColor = Color.White.ToArgb();
                update.Icon = "ImageLib.Persuade.Blue.BTTR.png";
                InitializeObjects(update);

                update.ObjectId = "object2";
                update.Throttle = 1;
                update.StartX = 630;
                update.StartY = 630;
                update.StartZ = 0;
                update.PlayerColor = Color.Green.ToArgb();
                update.Icon = "ImageLib.Persuade.Blue.CA.png";
                InitializeObjects(update);

                update.ObjectId = "object1b";
                update.Throttle = 1;
                update.StartX = 660;
                update.StartY = 660;
                update.StartZ = 0;
                update.PlayerColor = Color.Yellow.ToArgb();
                update.Icon = "ImageLib.Persuade.Blue.CH47.png";
                InitializeObjects(update);

                update.ObjectId = "object1c";
                update.Throttle = 1;
                update.StartX = 690;
                update.StartY = 690;
                update.StartZ = 0;
                update.PlayerColor = Color.Blue.ToArgb();
                update.Icon = "ImageLib.Persuade.Blue.CMBT-ENGR-CO.png";
                InitializeObjects(update);

                update.ObjectId = "object1d";
                update.Throttle = 1;
                update.StartX = 720;
                update.StartY = 720;
                update.StartZ = 0;
                update.PlayerColor = Color.Black.ToArgb();
                update.Icon = "ImageLib.Persuade.Blue.DSM-TRP.png";
                InitializeObjects(update);

                update.ObjectId = "object1e";
                update.Throttle = 1;
                update.StartX = 750;
                update.StartY = 750;
                update.StartZ = 0;
                update.PlayerColor = Color.Red.ToArgb();
                update.Icon = "ImageLib.Persuade.Blue.FA-BTTR.png";
                InitializeObjects(update);

                //update.ObjectId = update.OwnerID = update.PlayerId = "object2";
                //update.Throttle = 1;
                //update.StartX = 30;
                //update.StartY = 30;
                //update.StartZ = 0;
                //InitializeObjects(update);

                //update.ObjectId = update.OwnerID = update.PlayerId = "object3";
                //update.Throttle = 1;
                //update.StartX = 50;
                //update.StartY = 50;
                //update.StartZ = 0;
                //InitializeObjects(update);

                //update.ObjectId = update.OwnerID = update.PlayerId = "object4";
                //update.Throttle = 1;
                //update.StartX = 70;
                //update.StartY = 70;
                //update.StartZ = 0;
                //InitializeObjects(update);

                //update.ObjectId = update.OwnerID = update.PlayerId = "object5";
                //update.Throttle = 1;
                //update.StartX = 90;
                //update.StartY = 90;
                //update.StartZ = 0;
                //InitializeObjects(update);

              
                //MsgWindowPanel.AddText("UTM Northing units: " + UTM_Mapping.VerticalMetersPerPixel);
                //MsgWindowPanel.AddText("UTM Easting units: " + UTM_Mapping.HorizonalMetersPerPixel);
                MsgWindowPanel.AddText(DDD_Global.Instance.ScenarioDescription);
                //MsgWindowPanel.AddText("Demo Mode...");
            }
            else
            {
                //MsgWindowPanel.AddText("UTM Northing units: " + UTM_Mapping.VerticalMetersPerPixel);
                //MsgWindowPanel.AddText("UTM Easting units: " + UTM_Mapping.HorizonalMetersPerPixel);
                MsgWindowPanel.AddText(DDD_Global.Instance.ScenarioDescription);
                //MsgWindowPanel.AddText("Connected to server...");
            }

            ScoreHeader = string.Format("Scenario: {0}             Player: {1}", DDD_Global.Instance.ScenarioName, DDD_Global.Instance.PlayerID);
            _commands.HandshakeInitializeGUIDone(DDD_Global.Instance.PlayerID);

        }