Пример #1
0
        public SplashDialog(GameFramework g)
        {
            InitializeComponent();
            ResourceThread = new Thread(new ParameterizedThreadStart(this.LoadResources));
            ResourceThread.Start(g);

        }
Пример #2
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);
 


        }
Пример #3
0
 public static GameFramework Instance()
 {
     if (_instance_ == null)
     {
         _instance_ = new GameFramework();
     }
     return(_instance_);
 }
Пример #4
0
        public override void OnInitializeScene(GameFramework g)
        {
            BindGameController();

            
           
            //font_small = g.CANVAS.CreateFont(new System.Drawing.Font("Arial", 12));
            font_small = g.CANVAS.CreateFont(new System.Drawing.Font("MS Sans Serif", 14));

            font_large = g.CANVAS.CreateFont(new System.Drawing.Font("Arial", 28));

        }
Пример #5
0
        public void Initialize(GameFramework g)
        {
            if (!_initialized)
            {
                OnInitializeSceneProjection(g);
                g.CANVAS.MtxProjection = _perspective;

                OnInitializeCameraView();
                g.CANVAS.MtxView = GetCameraView();

                OnInitializeScene(g);

                _initialized = true;
            }
        }
Пример #6
0
 public virtual void OnSceneLoading(GameFramework g)
 {
 }
Пример #7
0
 public virtual void OnInitializeScene(GameFramework g)
 {
 }
Пример #8
0
 public override void OnSceneCleanup(GameFramework g)
 {
     UnbindGameController();
     Fonts["Large"].Dispose();
     Fonts["Medium"].Dispose();
 }
Пример #9
0
 public virtual void OnInitializeScene(GameFramework g)
 {
 }
Пример #10
0
 public static GameFramework Instance()
 {
     if (_instance_ == null)
     {
         _instance_ = new GameFramework();
     }
     return _instance_;
 }
Пример #11
0
 public virtual void OnSceneCleanup(GameFramework g)
 {
 }
Пример #12
0
        public Scene[] InitializeScenes(GameFramework g)
        {
            try
            {
                _Controller = new GUIController(DDD_Global.Instance.PlayerID, DDD_Global.Instance.HostName,
                    DDD_Global.Instance.SimModel);


                return new Scene[] { new WinForm_Splash(this, _Controller), new MapPlayfieldContainer(this, _Controller) };
            }
            catch (Exception exc)
            {
                throw new Exception(exc.Message);
            }
        }
Пример #13
0
        public override void OnSceneLoading(GameFramework g)
        {
            if (!DDD_Global.Instance.IsConnected)
            {
                // Assumes we're in Demo mode.
                DDD_Global.Instance.MapName = "Map.jpg";
                DDD_Global.Instance.MapLocation = @"C:\DDDClient\Map.jpg";
                UTM_Mapping.HorizonalMetersPerPixel = 8.49990671075954650f;
                UTM_Mapping.VerticalMetersPerPixel = 8.56718696599567760f;
                DDD_Global.Instance.ScenarioName = "Demo";
                DDD_Global.Instance.ScenarioDescription = "This is a locally connected demo.";
                _menu_selection = "Demo Player";
                HandshakeInitializeGUI();
                SceneMode = MODE.SCENE_RENDER;

                return;
            }
            else
            {

                _commands.HandshakeGUIRegister(DDD_Global.Instance.TerminalID);
                SceneMode = MODE.SCENE_RENDER;
            }
        }
Пример #14
0
        public override void OnInitializeScene(GameFramework g)
        {
            BindGameController();

            _background.X = 0;
            _background.Y = 0;
            _background.Width = g.CANVAS.Size.Width;
            _background.Height = g.CANVAS.Size.Height;
            
            //string path = System.Environment.CurrentDirectory + @"\ImageLib.dll";
            string path = string.Format(@"\\{0}\DDDClient\ImageLib.dll", DDD_Global.Instance.HostName);
            ImageLib = Assembly.LoadFile(path);
           
            //font_small = g.CANVAS.CreateFont(new System.Drawing.Font("Arial", 12));
            font_small = g.CANVAS.CreateFont(new System.Drawing.Font("MS Sans Serif", 14));

            font_large = g.CANVAS.CreateFont(new System.Drawing.Font("Arial", 28));

            bounding_rect = font_large.MeasureString(null, Message, DrawTextFormat.NoClip, Color.Yellow);
            bounding_rect.X = (_background.Width - bounding_rect.Width) / 2;
            bounding_rect.Y = (int)(_background.Height - (2*bounding_rect.Height));

            player_rect.X = (int)((_background.Width - (_background.Width / 4)) / 2);
            player_rect.Y = (int)((_background.Height - (_background.Height / 3)) / 2);
            player_rect.Width = (int)(_background.Width / 4);
            player_rect.Height = (int)( _background.Height / 3);

            _player_window = CreateWindow(g.CANVAS.CreateFont(new System.Drawing.Font("MS Sans Serif", 12)), "Available Players",
                 player_rect.X,
                 player_rect.Y,
                 player_rect.Right ,
                 player_rect.Bottom);

            _player_window.AllowMove = false;
            _player_window.AllowShade = false;
            _player_window.AllowResize = false;
            _player_window.HasScrollBars = false;
           

            _player_menu = new PanelMenu(
                                                     g.CANVAS.CreateFont(new System.Drawing.Font("MS Sans Serif", 14)),
                                                    new PanelMenuSelectHandler(PlayerSelection)
                                                    );
            _player_menu.BackgroundColor = Color.Black;
             _player_window.BindPanelControl(_player_menu);
           _player_window.Show();
            _player_menu.LayoutMenuOptions(new string[] { "Populating ..." }, PanelLayout.Vertical);

           
           _continue_btn = (PanelStaticButton)new PanelStaticButton(_player_window.ClientArea.Left,
               _player_window.ClientArea.Bottom + 2,
               _player_window.ClientArea.Right,
               _player_window.ClientArea.Bottom + 27);
            _continue_btn.Text = "Continue";
            _continue_btn.BackgroundColor = Color.FromArgb(204, 63, 63, 63);
            _continue_btn.BorderColor = Color.White;
            _continue_btn.Font = font_small;
            _continue_btn.MouseClick = new System.Windows.Forms.MouseEventHandler(this.Btn_Continue);



        }
Пример #15
0
 public virtual void OnSceneCleanup(GameFramework g)
 {
 }
Пример #16
0
 public virtual void OnAfterRender(GameFramework g)
 {
 }
Пример #17
0
 public virtual void OnBeforeRender(GameFramework g)
 {
 }
Пример #18
0
 public virtual void OnSceneLoading(GameFramework g)
 {
 }
Пример #19
0
 public virtual void OnBeforeRender(GameFramework g)
 {
 }
Пример #20
0
 public virtual void OnAfterRender(GameFramework g)
 {
 }
Пример #21
0
 public override void OnSceneLoading(GameFramework g)
 {
     SceneMode = MODE.SCENE_RENDER;
 }
Пример #22
0
 public override void OnInitializeScene(GameFramework g)
 {
     this.Fonts.Add("Small", g.CANVAS.CreateFont(new System.Drawing.Font("Arial", 9, FontStyle.Bold)));
 }
Пример #23
0
        public override void OnBeforeRender(GameFramework g)
        {
            switch (SceneMode)
            {
                case MODE.SCENE_RENDER:

                    if (_loading_textures)
                    {
                        lock (this)
                        {
                            switch (Stage)
                            {
                                case LoadingStage.TEXTURE:
                                        //Message = "LOADING TEXTURES ...";
                                        MsgColor = Color.Yellow;
                                    return;
                                case LoadingStage.BACKGROUND:
                                        Message = "LOADING MAP ...";
                                        MsgColor = Color.Yellow;
                                    return;
                                case LoadingStage.FINISHED:
                                        Message = "READY ...";
                                        SceneMode = MODE.SCENE_FINISHED;
                                        MsgColor = Color.Yellow;
                                    return;
                                default:
                                        SceneMode = MODE.SCENE_ERROR;
                                        Message = "Unknown State.";
                                        MsgColor = Color.Red;
                                    return;
                            }
                        }

                    }
                    break;
                    
                case MODE.SCENE_ERROR:
                    break;

            }
           

        }
Пример #24
0
 public void GameOver(GameFramework g)
 {
 }
Пример #25
0
 public virtual void OnInitializeSceneProjection(GameFramework g)
 {
 }
Пример #26
0
 public override void OnSceneCleanup(GameFramework g)
 {
     UnbindGameController();
 }
Пример #27
0
        public Scene[] InitializeScenes(GameFramework g)
        {
            //_Controller = null;
            //return new Scene[] { new SandBox(this) };
            //_Controller = null;
            //return new Scene[] { new SplashScene(this) };

            _Controller = new GUIController(DDD_Global.Instance.PlayerID, DDD_Global.Instance.HostName,
                DDD_Global.Instance.nc, DDD_Global.Instance.SimModel);

            DDD_HeadsUpDisplay h = new DDD_HeadsUpDisplay(this, _Controller);
            return new Scene[] { new SplashScene2(this, _Controller), h };
        }
Пример #28
0
        public override void OnInitializeScene(GameFramework g)
        {
            Size DisplaySize = g.CANVAS.Size;

            BindGameController();

            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)));
            this.Fonts.Add("Arial10B", g.CANVAS.CreateFont(new System.Drawing.Font("Arial", 10, FontStyle.Bold)));
            this.Fonts.Add("Arial8B", g.CANVAS.CreateFont(new System.Drawing.Font("Arial", 8, FontStyle.Bold)));
            this.Fonts.Add("RangeRing", g.CANVAS.CreateFont(new System.Drawing.Font("Times New Roman", 8)));

            _current_unit_sprite = g.CANVAS.CreateSprite();

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


            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);
            _mini_map.Width = 150;
            Map.Initialize(g.CANVAS);
            Map.Texture(g.GetTexture("MAP"));
            //Map.Diffuse = Color.Gray;
            MapTextureHeight = Map.TextureHeight;
            MapTextureWidth = Map.TextureWidth;



            _playfield = new MapPlayfield(g.CANVAS, Map, background, _commands);
            _playfield.WinForm_Mode = true;

            MinScale = _playfield.GetMinimumScale();
            Map.SetPosition(background.X, background.Y, 0);
            SetMapScale(MinScale);
            _playfield.OnInitializeScene(g);
            _playfield.SendMapPosition(true); //attempt to resolve bug 4539, send an initial screen map position

            _playfield.DrawUnmanagedAssetLabels = DefaultUnmanagedUnitLabelValue;

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

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

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

                update.ObjectId = "object3";
                update.Throttle = 1;
                update.StartX = 60;
                update.StartY = 60;
                update.StartZ = 0;
                update.PlayerColor = Color.Yellow.ToArgb();
                update.Icon = "ImageLib.Persuade.Blue.CH47.png";
                ((IController)_game_control).ViewProInitializeUpdate(update);

                update.ObjectId = "object4";
                update.Throttle = 1;
                update.StartX = 90;
                update.StartY = 10;
                update.StartZ = 0;
                update.PlayerColor = Color.Blue.ToArgb();
                update.Icon = "ImageLib.Persuade.Blue.CMBT-ENGR-CO.png";
                ((IController)_game_control).ViewProInitializeUpdate(update);

                update.ObjectId = "object5";
                update.Throttle = 1;
                update.StartX = 10;
                update.StartY = 60;
                update.StartZ = 0;
                update.PlayerColor = Color.Black.ToArgb();
                update.Icon = "ImageLib.Persuade.Blue.DSM-TRP.png";
                ((IController)_game_control).ViewProInitializeUpdate(update);

                update.ObjectId = "object1e";
                update.Throttle = 1;
                update.StartX = 10;
                update.StartY = 30;
                update.StartZ = 0;
                update.PlayerColor = Color.Red.ToArgb();
                update.Icon = "ImageLib.Persuade.Blue.FA-BTTR.png";
                ((IController)_game_control).ViewProInitializeUpdate(update);
            }

            AnimationTimer = GameFramework.QueryPerformanceTimer();
            _commands.HandshakeInitializeGUIDone(DDD_Global.Instance.PlayerID);


        }
Пример #29
0
        public void Initialize(GameFramework g)
        {
            if (!_initialized)
            {
                OnInitializeSceneProjection(g);
                g.CANVAS.MtxProjection = _perspective;

                OnInitializeCameraView();
                g.CANVAS.MtxView = GetCameraView();

                OnInitializeScene(g);

                _initialized = true;
            }
        }
Пример #30
0
 public override void OnSceneCleanup(GameFramework g)
 {
     font_small.Dispose();
     font_large.Dispose();
     UnbindGameController();
 }
Пример #31
0
 public virtual void OnInitializeSceneProjection(GameFramework g)
 {
 }
Пример #32
0
        public override void OnSceneLoading(GameFramework g)
        {
            if (!DDD_Global.Instance.IsConnected)
            {
                // Assumes we're in Demo mode.
                DDD_Global.Instance.MapName = "Map.jpg";
                DDD_Global.Instance.MapLocation = string.Format("{0}MapLib\\Map.jpg", DDD_Global.Instance.DDDClientShareFolder);
                UTM_Mapping.HorizonalMetersPerPixel = 8.49990671075954650f;
                UTM_Mapping.VerticalMetersPerPixel = 8.56718696599567760f;
                DDD_Global.Instance.ScenarioName = "Demo";
                DDD_Global.Instance.ScenarioDescription = "This is a locally connected demo.";
                _menu_selection = "Demo Player";
                SceneMode = MODE.SCENE_RENDER;

                HandshakeInitializeGUI();
                return;
            }
        }
Пример #33
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);

        }