Exemple #1
0
        void ParseJSON(string sLobby)
        {
            LobbyList o = JsonConvert.DeserializeObject <LobbyList>(sLobby);

            if (o == null)
            {
                MMessageBus.Status(this, "Error retrieving lobby");
            }
            Entries = o.data;
        }
Exemple #2
0
        public static void Mc_DoubleClick(MObject mo)
        {
            if (string.IsNullOrEmpty((string)mo.Tag))
            {
                return;
            }
            MMessageBus.Status(null, "Opening:" + mo.Tag);
            ProductInfoForm form = new ProductInfoForm();

            form.Setup(mo, true);
            form.Show(Globals.GUIThreadOwner);
        }
        public static void Mc_DoubleClick(MObject mo)
        {
            string sTag = (string)mo.Tag;

            string[] parms = sTag.Split('|');
            if (parms.Length > 0)
            {
                NavigationBarDecoder dec = new NavigationBarDecoder();
                Vector3d             v   = dec.Decode(parms[1]);
                MMessageBus.Status(mo, "Teleporting to:" + parms[1] + " - " + parms[2]);
                MMessageBus.TeleportRequest(mo, v, Quaterniond.Identity);
            }
        }
Exemple #4
0
 public static void Mc_DoubleClick(MObject mo)
 {
     if (string.IsNullOrEmpty((string)mo.Tag))
     {
         return;
     }
     MMessageBus.Status(null, "Opening:" + mo.Tag);
     try
     {
         Process.Start((string)mo.Tag);
     }
     catch (Exception ee)
     {
         Console.WriteLine(ee.Message);
         MMessageBus.Error(mo, ee.Message);
     }
 }
Exemple #5
0
        void CheckPick(Point p, bool DoubleClick = false, bool RightClick = false)
        {
            GL.Enable(EnableCap.DepthTest);
            GL.ClearColor(Color.Black);
            GL.Clear(ClearBufferMask.DepthBufferBit | ClearBufferMask.ColorBufferBit);

            MScene.ScreenPick.RenderPick(MScene.ModelRoot);
            //_glcontrol.SwapBuffers();

            Vector3d p3d   = new Vector3d(p.X, _glcontrol.Height - p.Y, 0);
            int      index = _Scene.GetPick(p3d);

            //Log("Pick id:" + index + " @" + p.ToString());
            if (index != -1)
            {
                //Console.WriteLine("Clicked:" + index);
                MObject mobj = MScene.ModelRoot.FindModuleByIndex(index, null);
                if (mobj == null)
                {
                    return;
                }
                if (!mobj.Renderable)
                {
                    return;
                }
                MSceneObject mo = (MSceneObject)mobj;

                if (mo != null)
                {
                    if ((mo.Type == MObject.EType.Mesh) && (mo.Parent.Renderable))
                    {
                        mo = (MSceneObject)mo.Parent;
                    }
                    else
                    {
                        return;
                    }
                    //Console.WriteLine("Pick id:" + index + " @" + p.ToString() + " Owner:" + mo.OwnerID);
                    if (mo.OwnerID == null)
                    {
                        MMessageBus.Status(this, "ID: + " + mo.Index + " Object " + mo.Name + " with ID:" + mo.InstanceID + " has no owner");
                    }
                    else
                    if (!mo.OwnerID.Equals(Globals.UserAccount.UserID))
                    {
                        MMessageBus.Status(this, "ID:" + mo.Index + " Object " + mo.Name + "," + mo.InstanceID);
                    }
                    // else
                    {
                        mo.OnClick(DoubleClick, RightClick);
                        MMessageBus.Select(this, new SelectEvent(mo));
                        MMaterial m = (MMaterial)mo.FindModuleByType(EType.Material);
                        MMessageBus.Status(this, "Selected:" + mo.TemplateID + "," + mo.InstanceID);
                    }
                }


                MScene.SelectedObject = mo;
            }
            else
            {
                MScene.SelectedObject = null;
            }
        }