Example #1
0
        public void HandshakeInitializeGUI()
        {
            Scene s = GameFramework.Instance().GetCurrentScene();

            if (s is SplashScene2)
            {
                ((SplashScene2)s).HandshakeInitializeGUI();
            }
        }
Example #2
0
        public void AttackUpdate(string attacker, string target, int time, int end_time)
        {
            Scene s = GameFramework.Instance().GetCurrentScene();

            if (s is DDD_HeadsUpDisplay)
            {
                ((DDD_HeadsUpDisplay)s).AttackUpdate(attacker, target, time, end_time);
            }
        }
Example #3
0
        public void ResumeScenario()
        {
            Scene s = GameFramework.Instance().GetCurrentScene();

            if (s is DDD_HeadsUpDisplay)
            {
                ((DDD_HeadsUpDisplay)s).ResumeGame();
            }
        }
Example #4
0
        public void RemoveObject(string object_id)
        {
            Scene s = GameFramework.Instance().GetCurrentScene();

            if (s is DDD_HeadsUpDisplay)
            {
                ((DDD_HeadsUpDisplay)s).RemoveObject(object_id);
            }
        }
Example #5
0
        public void TimeTick(string time)
        {
            Scene s = GameFramework.Instance().GetCurrentScene();

            if (s is DDD_HeadsUpDisplay)
            {
                ((DDD_HeadsUpDisplay)s).TimeTick(time);
            }
        }
Example #6
0
        public void HandshakeAvailablePlayers(string[] players)
        {
            Scene s = GameFramework.Instance().GetCurrentScene();

            if (s is SplashScene2)
            {
                ((SplashScene2)s).HandshakeAvailablePlayers(players);
            }
        }
Example #7
0
        public void ViewProStopObjectUpdate(string object_ID)
        {
            Scene s = GameFramework.Instance().GetCurrentScene();

            if (s is DDD_HeadsUpDisplay)
            {
                ((DDD_HeadsUpDisplay)s).ViewProStopObjectUpdate(object_ID);
            }
        }
Example #8
0
        public void SystemMessageUpdate(string message, int argbColor)
        {
            Scene s = GameFramework.Instance().GetCurrentScene();

            if (s is DDD_HeadsUpDisplay)
            {
                ((DDD_HeadsUpDisplay)s).SystemMessageUpdate(message, argbColor);
            }
        }
Example #9
0
        public void TextChatRequest(string user_id, string message, string target_id)
        {
            Scene s = GameFramework.Instance().GetCurrentScene();

            if (s is DDD_HeadsUpDisplay)
            {
                ((DDD_HeadsUpDisplay)s).TextChatRequest(user_id, message, target_id);
            }
        }
Example #10
0
        public void ViewProInitializeUpdate(ViewProMotionUpdate update)
        {
            Scene s = GameFramework.Instance().GetCurrentScene();

            if (s is DDD_HeadsUpDisplay)
            {
                ((DDD_HeadsUpDisplay)s).InitializeObjects(update);
            }
        }
Example #11
0
        public void ViewProAttributeUpdate(ViewProAttributeUpdate update)
        {
            Scene s = GameFramework.Instance().GetCurrentScene();

            if (s is DDD_HeadsUpDisplay)
            {
                ((DDD_HeadsUpDisplay)s).AttributeUpdateObjects(update);
            }
        }
Example #12
0
        /// <summary>
        /// Internal messaging, when a selection happens set it to default mode.
        /// </summary>
        public void SelectionUpdate()
        {
            Scene s = GameFramework.Instance().GetCurrentScene();

            if (s is DDD_HeadsUpDisplay)
            {
                ((DDD_HeadsUpDisplay)s).Mode = MenuMode.DEFAULT;
                ((DDD_HeadsUpDisplay)s).ResetVunerabilities();
            }
        }
Example #13
0
        public void HandshakeInitializeGUI()
        {
            Thread t = new Thread(new ParameterizedThreadStart(this.LoadTextures));

            t.Start((object)GameFramework.Instance());
            _loading_textures = true;
            lock (this)
            {
                Stage = LoadingStage.TEXTURE;
            }
            SceneMode = MODE.SCENE_RENDER;
        }
Example #14
0
        public void HandshakeInitializeGUI()
        {
            Thread t = new Thread(new ParameterizedThreadStart(this.LoadTextures));

            t.Start((object)GameFramework.Instance());
            //DDD_Global.Instance.PlayerID = _menu_selection;
            _player_window.Hide();
            _continue = true;
            _continue_btn.Selected = false;
            _loading_textures      = true;
            lock (this)
            {
                Stage = LoadingStage.TEXTURE;
            }
        }
Example #15
0
        private void LoginDialog()
        {
            bool Continue = true;

            _LoginDialog = new ConnectDialog();
            while (Continue)
            {
                _LoginDialog.ShowDialog();
                switch (_LoginDialog.DialogResult)
                {
                case DialogResult.Cancel:
                    Continue = false;
                    return;

                case DialogResult.OK:
                    Continue = false;
                    GameFramework.Instance().Run(this, (IGameControl)this);
                    break;
                }
            }
        }
Example #16
0
        public void LoadTextures(object obj)
        {
            string path = string.Empty;

            try
            {
                path = string.Format("{0}\\{1}.dll", DDD_Global.Instance.DDDClientShareFolder, DDD_Global.Instance.ImageLibrary);
                if (!File.Exists(path))
                {
                    path = string.Format(@"{0}\DDDClient\{1}.dll", Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), DDD_Global.Instance.ImageLibrary);
                }
                ImageLib = Assembly.LoadFile(path);
            }
            catch (Exception e)
            {
                lock (this)
                {
                    SceneMode = MODE.SCENE_ERROR;
                    Message   = "Missing Image Libary";
                    MsgColor  = Color.Red;
                    Thread.Sleep(2000);

                    throw new Exception(Message + ":" + path + ":" + e.Message);
                }
                return;
            }


            GameFramework g = (GameFramework)obj;
            GameTexture   _texture;
            List <string> names = new List <string>();


            try
            {
                StreamReader s = new StreamReader(ImageLib.GetManifestResourceStream("ImageLibrary.mf"));

                while (!s.EndOfStream)
                {
                    names.Add(s.ReadLine());
                }
                for (int i = 0; i < names.Count; i++)
                {
                    string[] texture_name = names[i].Split(':');
                    _texture        = g.CreateTexture(ImageLib.GetManifestResourceStream(texture_name[0]));
                    _texture.rotate = bool.Parse(texture_name[1]);
                    g.StoreTexture(texture_name[0], _texture);
                    lock (this)
                    {
                        Message = string.Format("Texture {0} of {1}", i + 1, names.Count);
                    }
                }
                s.Close();
            }
            catch (Exception)
            {
                lock (this)
                {
                    SceneMode = MODE.SCENE_ERROR;
                    Message   = "Error loading texture";
                    MsgColor  = Color.Red;
                }
                return;
            }

            lock (this)
            {
                Stage = LoadingStage.BACKGROUND;
            }

            bool        continue_looping = true;
            GameTexture Map;

            while (continue_looping)
            {
                if (DDD_Global.Instance.MapLocation != string.Empty)
                {
                    try
                    {
                        if (File.Exists(DDD_Global.Instance.MapLocation))
                        {
                            Map = g.CreateTexture(DDD_Global.Instance.MapLocation);
                        }
                        else
                        {
                            Map = g.CreateTexture(string.Format("{0}\\MapLib\\{1}", DDD_Global.Instance.DDDClientShareFolder, DDD_Global.Instance.MapName));
                        }
                        Controller.UTM_Mapping.ImageHeight = Map.height;
                        Controller.UTM_Mapping.ImageWidth  = Map.width;
                        g.StoreTexture("MAP", Map);
                        continue_looping = false;
                    }
                    catch (Exception)
                    {
                        SceneMode        = MODE.SCENE_ERROR;
                        Message          = "Map file missing: " + DDD_Global.Instance.MapName;
                        MsgColor         = Color.Red;
                        continue_looping = false;
                        Thread.Sleep(2000);

                        throw new Exception(Message);
                    }
                }
                else
                {
                    Thread.Sleep(2000);
                }
            }


            lock (this)
            {
                Stage = LoadingStage.FINISHED;
                DDD_RangeRings.SetCanvasPtr(GameFramework.Instance().CANVAS);
            }
        }