public void ContextMenuProperties(object source, ContextMenuArgs e)
        {
            if (entitypropertiesdialog != null)
            {
                entitypropertiesdialog.Destroy();
            }

            LogFile.WriteLine("opening properties box ...");

            Glade.XML app = new Glade.XML(EnvironmentHelper.GetExeDirectory() + "/metaverse.client.glade", "entitypropertiesdialog", "");
            app.Autoconnect(this);

            PropertyInfos     = new List <EntityPropertyInfo>();
            ControlsIndex     = new Dictionary <string, Widget>();
            nextpropertyindex = 0;

            thisentity.RegisterProperties(this);
            LoadProperties();
            // Show();

            ViewerState.GetInstance().ActivateEdit3d();

            // hack to add a semblance of user-friendliness
            //DialogHelpers.ShowInfoMessageModal(null, "Hold down z to move the object, x to change scale and v to rotate.");
            new MessageBox(MessageBox.MessageType.Info, "Editing controls", "Hold down z to move the object, x to change scale and v to rotate.", null);

            entitypropertiesdialog.ShowAll();
            //entitypropertiesdialog.Show();

            selectionmodel.Clear();
            selectionmodel.ToggleObjectInSelection(thisentity, true);
            LogFile.WriteLine("...opened");
        }
        public void ContextMenuProperties(object source, ContextMenuArgs e)
        {
            if (entitypropertiesdialog != null)
            {
                entitypropertiesdialog.Destroy();
            }

            LogFile.WriteLine( "opening properties box ..." );

            Glade.XML app = new Glade.XML( EnvironmentHelper.GetExeDirectory() + "/metaverse.client.glade", "entitypropertiesdialog", "" );
            app.Autoconnect(this);

            PropertyInfos = new List<EntityPropertyInfo>();
            ControlsIndex = new Dictionary<string,Widget>();
            nextpropertyindex = 0;

            thisentity.RegisterProperties(this);
            LoadProperties();
            // Show();

            ViewerState.GetInstance().ActivateEdit3d();

            // hack to add a semblance of user-friendliness
            //DialogHelpers.ShowInfoMessageModal(null, "Hold down z to move the object, x to change scale and v to rotate.");
            new MessageBox( MessageBox.MessageType.Info, "Editing controls", "Hold down z to move the object, x to change scale and v to rotate.", null );

            entitypropertiesdialog.ShowAll();
            //entitypropertiesdialog.Show();

            selectionmodel.Clear();
            selectionmodel.ToggleObjectInSelection(thisentity, true);
            LogFile.WriteLine("...opened");
        }
Example #3
0
        public void ContextMenuLoad(object source, ContextMenuArgs e)
        {
            string filename = DialogHelpers.GetFilePath("Open world file", "world.OSMP");

            if (filename != "")
            {
                Load(filename);
            }
        }
Example #4
0
 public void ContextMenuPopup(object source, ContextMenuArgs e)
 {
     entity = e.Entity;
     if (entity != null)
     {
         LogFile.WriteLine("EntityDelete registering in contextmenu");
         ContextMenuController.GetInstance().RegisterContextMenu(new string[] { "Delete" }, new ContextMenuHandler(DeleteClick));
     }
 }
        public static void Create( object source, ContextMenuArgs e )
        {
            EntityCreationProperties buildproperties = new EntityCreationProperties( e.MouseX, e.MouseY );

            FractalSplineCylinder newentity = new FractalSplineCylinder();
            buildproperties.WriteToEntity( newentity, "Cylinder" );

            MetaverseClient.GetInstance().worldstorage.AddEntity(newentity);
        }
Example #6
0
 public void ContextMenuPopup(object source, ContextMenuArgs e)
 {
     entity = e.Entity;
     if (entity != null)
     {
         LogFile.WriteLine("EntityDelete registering in contextmenu");
         ContextMenuController.GetInstance().RegisterContextMenu(new string[] { "Delete" }, new ContextMenuHandler(DeleteClick));
     }
 }
Example #7
0
        public static void Create(object source, ContextMenuArgs e)
        {
            EntityCreationProperties buildproperties = new EntityCreationProperties(e.MouseX, e.MouseY);

            FractalSplineBox newentity = new FractalSplineBox();

            buildproperties.WriteToEntity(newentity, "Box");

            MetaverseClient.GetInstance().worldstorage.AddEntity(newentity);
        }
Example #8
0
        public static void CreateCube( object soure, ContextMenuArgs e )
        {
            EntityCreationProperties buildproperties = new EntityCreationProperties( e.MouseX, e.MouseY );

            SimpleCube newcube = new SimpleCube();
            newcube.pos = buildproperties.pos;
            newcube.rot = buildproperties.rot;
            newcube.scale = new Vector3( 0.2, 0.2, 0.2 );
            newcube.name = "new cube";

            MetaverseClient.GetInstance().worldstorage.AddEntity(newcube);
        }
Example #9
0
 public void ContextMenuPopup( object source, ContextMenuArgs e )
 {
     iMouseX = e.MouseX;
     iMouseY = e.MouseY;
     entity = e.Entity;
     if( entity != null )
     {
         LogFile.WriteLine("AssignTextureHandler registering in contextmenu");
         ContextMenuController.GetInstance().RegisterContextMenu(new string[]{ "Assign &Texture", "&All Faces" }, new ContextMenuHandler( AssignTextureAllFacesClick ) );
         ContextMenuController.GetInstance().RegisterContextMenu( new string[] { "Assign &Texture", "&Single Face" }, new ContextMenuHandler( AssignTextureSingleFaceClick ) );
     }
 }
 public void _ContextMenuPopup(object source, ContextMenuArgs e)
 {
     //    if( selectionmodel.GetNumSelected() == 1 )
     //  {
     thisentity = e.Entity;
     if (thisentity != null)
     {
         LogFile.WriteLine("EntityPropertiesDialog registering in contextmenu");
         ContextMenuController.GetInstance().RegisterContextMenu(new string[] { "&Edit" }, new ContextMenuHandler(ContextMenuProperties));
     }
     // }
 }
Example #11
0
        public static void Create(object source, ContextMenuArgs e)
        {
            EntityCreationProperties buildproperties = new EntityCreationProperties(e.MouseX, e.MouseY);

            SimpleCone prim = new SimpleCone();

            prim.pos   = buildproperties.pos;
            prim.rot   = buildproperties.rot;
            prim.scale = new Vector3(0.2, 0.2, 0.2);
            prim.name  = "new cube";

            MetaverseClient.GetInstance().worldstorage.AddEntity(prim);
        }
Example #12
0
        public void AssignColorAllFacesClick( object source, ContextMenuArgs e )
        {
            if (!(entity is Prim))
            {
                return;
            }

            int FaceNumber = FractalSpline.Primitive.AllFaces;

            Color newcolor = DialogHelpers.GetColor();

            if (newcolor != null)
            {
                AssignColor( FaceNumber, newcolor );
            }
        }
Example #13
0
        public void AssignColorSingleFaceClick(object source, ContextMenuArgs e)
        {
            if (!(entity is Prim))
            {
                return;
            }

            int FaceNumber = Picker3dController.GetInstance().GetClickedFace(entity as Prim, iMouseX, iMouseY);

            Color newcolor = DialogHelpers.GetColor();

            if (newcolor != null)
            {
                AssignColor(FaceNumber, newcolor);
            }
        }
Example #14
0
        public void AssignColorAllFacesClick(object source, ContextMenuArgs e)
        {
            if (!(entity is Prim))
            {
                return;
            }

            int FaceNumber = FractalSpline.Primitive.AllFaces;

            Color newcolor = DialogHelpers.GetColor();

            if (newcolor != null)
            {
                AssignColor(FaceNumber, newcolor);
            }
        }
Example #15
0
        void ShowDialog(object source, ContextMenuArgs e)
        {
            if (connecttoserverdialog != null)
            {
                connecttoserverdialog.Destroy();
            }

            Glade.XML app = new Glade.XML(EnvironmentHelper.GetExeDirectory() + "/metaverse.client.glade", "connecttoserverdialog", "");
            app.Autoconnect(this);

            entryserveripaddress.Text = "127.0.0.1";
            entryserverport.Text      = "2501";

            // note: events are configurable from Glade, but it's possibly easier to control from here
            btnok.Clicked     += new EventHandler(btnok_Clicked);
            btncancel.Clicked += new EventHandler(btncancel_Clicked);
        }
Example #16
0
        void ServerInfoDialog(object source, ContextMenuArgs e)
        {
            if (serverinfowindow != null)
            {
                serverinfowindow.Destroy();
            }
            Glade.XML app = new Glade.XML(EnvironmentHelper.GetExeDirectory() + "/metaverse.client.glade", "serverinfowindow", "");
            app.Autoconnect(this);

            btnsendping.Clicked += new EventHandler(btnsendping_Clicked);
            //btnholdopen.Pressed += new EventHandler( btnholdopen_Pressed );
            //btnholdopen.Released += new EventHandler( btnholdopen_Released );
            btnclose.Clicked += new EventHandler(btnclose_Clicked);

            localipaddressentry.Text = MetaverseServer.GetInstance().network.networkimplementation.LocalIPAddress.ToString();
            localportentry.Text      = MetaverseServer.GetInstance().ServerPort.ToString();
            STUN stun = new STUN(MetaverseServer.GetInstance().network.networkimplementation, new STUN.GotExternalAddress(STUNResponse));
        }
Example #17
0
        public void AssignTextureAllFacesClick( object source, ContextMenuArgs e )
        {
            if (!(entity is Prim))
            {
                return;
            }

            int FaceNumber = FractalSpline.Primitive.AllFaces;

            string filename = DialogHelpers.GetFilePath( "Select image file (*.bmp,*.jpg,*.gif,*.tga):", "*.JPG" );
            if (filename != "")
            {
                Console.WriteLine( filename );
                if (File.Exists( filename ))
                {
                    AssignTexture( FaceNumber, new Uri( filename ) );
                }
            }
        }
Example #18
0
 public void About(object source, ContextMenuArgs e)
 {
     //DialogHelpers.ShowInfoMessageModal(null,
     //  "OSMP C# written by Hugh Perkins hughperkins at gmail"  + Environment.NewLine +
     //"Website at http://metaverse.sf.net by Zenaphex" + Environment.NewLine +
     //"Forums designed by Nick Merrill" + Environment.NewLine +
     //"OSMP C# based on original C++ version written by Hugh Perkins and contributed to by Jack Didgeridoo, Christopher Omega, Jorge Lima, and Carnildo" + Environment.NewLine +
     //Environment.NewLine +
     //"OSMP C# compilation date/time: " + EnvironmentHelper.GetCompilationDateTime()
     //);
     new MessageBox(MessageBox.MessageType.Info, "About OSMP",
                    "OSMP C# written by Hugh Perkins hughperkins at gmail" + Environment.NewLine +
                    "Website at http://metaverse.sf.net by Zenaphex" + Environment.NewLine +
                    "Forums designed by Nick Merrill" + Environment.NewLine +
                    "OSMP C# based on original C++ version written by Hugh Perkins and contributed to by Jack Didgeridoo, Christopher Omega, Jorge Lima, and Carnildo" + Environment.NewLine +
                    Environment.NewLine +
                    "OSMP C# compilation date/time: " + EnvironmentHelper.GetCompilationDateTime(),
                    null);
 }
Example #19
0
        public void AssignTextureSingleFaceClick( object source, ContextMenuArgs e )
        {
            if( ! ( entity is Prim ) )
            {
                return;
            }
            
            int FaceNumber = Picker3dController.GetInstance().GetClickedFace( entity as Prim, iMouseX, iMouseY );

            string filename = DialogHelpers.GetFilePath("Select image file (*.bmp,*.jpg,*.gif,*.tga):","*.JPG");
            if( filename != "" )
            {
                Console.WriteLine ( filename );
                if( File.Exists( filename ) )
                {
                    AssignTexture( FaceNumber, new Uri( filename ) );
                }
            }
        }
Example #20
0
 public void About( object source, ContextMenuArgs e)
 {
     //DialogHelpers.ShowInfoMessageModal(null,
       //  "OSMP C# written by Hugh Perkins hughperkins at gmail"  + Environment.NewLine +
         //"Website at http://metaverse.sf.net by Zenaphex" + Environment.NewLine +
         //"Forums designed by Nick Merrill" + Environment.NewLine +
         //"OSMP C# based on original C++ version written by Hugh Perkins and contributed to by Jack Didgeridoo, Christopher Omega, Jorge Lima, and Carnildo" + Environment.NewLine +
         //Environment.NewLine +
         //"OSMP C# compilation date/time: " + EnvironmentHelper.GetCompilationDateTime()
     //);
     new MessageBox(MessageBox.MessageType.Info, "About OSMP",
         "OSMP C# written by Hugh Perkins hughperkins at gmail" + Environment.NewLine +
         "Website at http://metaverse.sf.net by Zenaphex" + Environment.NewLine +
         "Forums designed by Nick Merrill" + Environment.NewLine +
         "OSMP C# based on original C++ version written by Hugh Perkins and contributed to by Jack Didgeridoo, Christopher Omega, Jorge Lima, and Carnildo" + Environment.NewLine +
         Environment.NewLine +
         "OSMP C# compilation date/time: " + EnvironmentHelper.GetCompilationDateTime(),
         null);
 }
        public void AssignTextureAllFacesClick( object source, ContextMenuArgs e )
        {
            if (!(entity is Prim))
            {
                return;
            }

            int FaceNumber = FractalSpline.Primitive.AllFaces;

            string filename = DialogHelpers.GetFilePath( "Select image file (*.bmp,*.jpg,*.gif,*.tga):", "*.JPG" );
            if (filename != "")
            {
                Console.WriteLine( filename );
                if (File.Exists( filename ))
                {
                    AssignTexture( FaceNumber, new Uri( filename ) );
                }
            }
        }
Example #22
0
 public void ContextMenuSave(object source, ContextMenuArgs e)
 {
     SaveWorld();
 }
Example #23
0
        public void AssignColorSingleFaceClick( object source, ContextMenuArgs e )
        {
            if( ! ( entity is Prim ) )
            {
                return;
            }

            int FaceNumber = Picker3dController.GetInstance().GetClickedFace( entity as Prim, iMouseX, iMouseY );

            Color newcolor = DialogHelpers.GetColor();

            if (newcolor != null)
            {
                AssignColor(FaceNumber, newcolor );
            }
        }
 public void _ContextMenuPopup(object source, ContextMenuArgs e)
 {
     //    if( selectionmodel.GetNumSelected() == 1 )
     //  {
     thisentity = e.Entity;
     if (thisentity != null)
     {
         LogFile.WriteLine("EntityPropertiesDialog registering in contextmenu");
         ContextMenuController.GetInstance().RegisterContextMenu(new string[] { "&Edit" }, new ContextMenuHandler(ContextMenuProperties));
     }
     // }
 }
Example #25
0
 void EditTerrainContextMenuHandler( object o, ContextMenuArgs e )
 {
     ViewerState.GetInstance().ActivateEditTerrain();
     //mainwindow.Show();
 }
 // hook for uicontextmenu to call event
 public void OnContextMenuPopup(object source, ContextMenuArgs e)
 {
     ContextMenuPopup(source, e);
 }
Example #27
0
 public void ContextMenuPopup( object source, ContextMenuArgs e )
 {
     iMouseX = e.MouseX;
     iMouseY = e.MouseY;
     entity = e.Entity;
     if( entity != null )
     {
         LogFile.WriteLine("AssignColorHandler registering in contextmenu");
         ContextMenuController.GetInstance().RegisterContextMenu(new string[]{ "Assign &Color", "&All Faces" }, new ContextMenuHandler( AssignColorAllFacesClick ) );
         ContextMenuController.GetInstance().RegisterContextMenu( new string[] { "Assign &Color", "&Single Face" }, new ContextMenuHandler( AssignColorSingleFaceClick ) );
     }
 }
Example #28
0
        void ServerInfoDialog(object source, ContextMenuArgs e)
        {
            if (serverinfowindow != null)
            {
                serverinfowindow.Destroy();
            }
            Glade.XML app = new Glade.XML( EnvironmentHelper.GetExeDirectory() + "/metaverse.client.glade", "serverinfowindow", "" );
            app.Autoconnect( this );

            btnsendping.Clicked += new EventHandler( btnsendping_Clicked );
            //btnholdopen.Pressed += new EventHandler( btnholdopen_Pressed );
            //btnholdopen.Released += new EventHandler( btnholdopen_Released );
            btnclose.Clicked += new EventHandler( btnclose_Clicked );

            localipaddressentry.Text = MetaverseServer.GetInstance().network.networkimplementation.LocalIPAddress.ToString();
            localportentry.Text = MetaverseServer.GetInstance().ServerPort.ToString();
            STUN stun = new STUN( MetaverseServer.GetInstance().network.networkimplementation, new STUN.GotExternalAddress( STUNResponse ) );
        }
Example #29
0
 public void DeleteClick(object source, ContextMenuArgs e)
 {
     MetaverseClient.GetInstance().worldstorage.DeleteEntity(entity);
 }
Example #30
0
 public void ContextMenuQuit(object source, ContextMenuArgs e)
 {
     Quit();
 }
Example #31
0
 public void DeleteClick(object source, ContextMenuArgs e)
 {
     MetaverseClient.GetInstance().worldstorage.DeleteEntity(entity);
 }
Example #32
0
 public void ContextMenuLoad(object source, ContextMenuArgs e)
 {
     LoadWorld();
 }
Example #33
0
 public void ContextMenuLoadFromUrl(object source, ContextMenuArgs e)
 {
     new InputBox("Please enter URL:", new InputBox.Callback(LoadFromUrl));
 }
        void ShowDialog(object source, ContextMenuArgs e)
        {
            if( connecttoserverdialog != null )
            {
                connecttoserverdialog.Destroy();
            }

            Glade.XML app = new Glade.XML( EnvironmentHelper.GetExeDirectory() + "/metaverse.client.glade", "connecttoserverdialog", "" );
            app.Autoconnect(this);

            entryserveripaddress.Text = "127.0.0.1";
            entryserverport.Text = "2501";

            // note: events are configurable from Glade, but it's possibly easier to control from here
            btnok.Clicked += new EventHandler(btnok_Clicked);
            btncancel.Clicked += new EventHandler(btncancel_Clicked);
        }
        public void AssignTextureSingleFaceClick( object source, ContextMenuArgs e )
        {
            if( ! ( entity is Prim ) )
            {
                return;
            }

            int FaceNumber = Picker3dController.GetInstance().GetClickedFace( entity as Prim, iMouseX, iMouseY );

            string filename = DialogHelpers.GetFilePath("Select image file (*.bmp,*.jpg,*.gif,*.tga):","*.JPG");
            if( filename != "" )
            {
                Console.WriteLine ( filename );
                if( File.Exists( filename ) )
                {
                    AssignTexture( FaceNumber, new Uri( filename ) );
                }
            }
        }
 // hook for uicontextmenu to call event
 public void OnContextMenuPopup(object source, ContextMenuArgs e)
 {
     ContextMenuPopup(source, e);
 }
 public void ContextMenuLoad( object source, ContextMenuArgs e )
 {
     LoadWorld();
 }
Example #38
0
 void EditTerrainContextMenuHandler(object o, ContextMenuArgs e)
 {
     ViewerState.GetInstance().ActivateEditTerrain();
     //mainwindow.Show();
 }
 public void ContextMenuSave( object source, ContextMenuArgs e )
 {
     SaveWorld();
 }
Example #40
0
 public void ContextMenuQuit( object source, ContextMenuArgs e )
 {
     Quit();
 }