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");
        }
예제 #3
0
        public void ContextMenuLoad(object source, ContextMenuArgs e)
        {
            string filename = DialogHelpers.GetFilePath("Open world file", "world.OSMP");

            if (filename != "")
            {
                Load(filename);
            }
        }
예제 #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));
     }
 }
예제 #5
0
        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);
        }
예제 #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));
     }
 }
예제 #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);
        }
예제 #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);
        }
예제 #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));
     }
     // }
 }
예제 #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);
        }
예제 #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 );
            }
        }
예제 #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);
            }
        }
예제 #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);
            }
        }
예제 #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);
        }
예제 #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));
        }
예제 #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 ) );
                }
            }
        }
예제 #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);
 }
예제 #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 ) );
                }
            }
        }
예제 #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);
 }
예제 #21
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 ) );
                }
            }
        }
예제 #22
0
 public void ContextMenuSave(object source, ContextMenuArgs e)
 {
     SaveWorld();
 }
예제 #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));
     }
     // }
 }
예제 #25
0
 void EditTerrainContextMenuHandler( object o, ContextMenuArgs e )
 {
     ViewerState.GetInstance().ActivateEditTerrain();
     //mainwindow.Show();
 }
예제 #26
0
 // hook for uicontextmenu to call event
 public void OnContextMenuPopup(object source, ContextMenuArgs e)
 {
     ContextMenuPopup(source, e);
 }
예제 #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 ) );
     }
 }
예제 #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 ) );
        }
예제 #29
0
 public void DeleteClick(object source, ContextMenuArgs e)
 {
     MetaverseClient.GetInstance().worldstorage.DeleteEntity(entity);
 }
예제 #30
0
 public void ContextMenuQuit(object source, ContextMenuArgs e)
 {
     Quit();
 }
예제 #31
0
 public void DeleteClick(object source, ContextMenuArgs e)
 {
     MetaverseClient.GetInstance().worldstorage.DeleteEntity(entity);
 }
예제 #32
0
 public void ContextMenuLoad(object source, ContextMenuArgs e)
 {
     LoadWorld();
 }
예제 #33
0
 public void ContextMenuLoadFromUrl(object source, ContextMenuArgs e)
 {
     new InputBox("Please enter URL:", new InputBox.Callback(LoadFromUrl));
 }
예제 #34
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);
        }
예제 #35
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 ) );
                }
            }
        }
예제 #36
0
 // hook for uicontextmenu to call event
 public void OnContextMenuPopup(object source, ContextMenuArgs e)
 {
     ContextMenuPopup(source, e);
 }
예제 #37
0
 public void ContextMenuLoad( object source, ContextMenuArgs e )
 {
     LoadWorld();
 }
예제 #38
0
 void EditTerrainContextMenuHandler(object o, ContextMenuArgs e)
 {
     ViewerState.GetInstance().ActivateEditTerrain();
     //mainwindow.Show();
 }
예제 #39
0
 public void ContextMenuSave( object source, ContextMenuArgs e )
 {
     SaveWorld();
 }
예제 #40
0
 public void ContextMenuQuit( object source, ContextMenuArgs e )
 {
     Quit();
 }