public SceneEditorWidget() { CanFocus = true; Hexpand = true; Vexpand = true; FocusOnClick = true; HasAlpha = false; HasDepthBuffer = true; HasStencilBuffer = true; Events |= Gdk.EventMask.AllEventsMask; SetRequiredVersion(3, 3); FrameTime = Time.SECOND / GameSettings.GameFps; SceneEditorGameElementsTree.Initialize(); }
private MainWindow(Gtk.Builder builder) : base(builder.GetObject("MainWindow").Handle) { builder.Autoconnect(this); DeleteEvent += Window_DeleteEvent; // Create a status bar context _fpsStatusbarContextID = _appStatusbar.GetContextId("FPS"); // Create the scene editor _sceneGLWidget = new SceneEditorWidget(); _sceneGLWidget.FpsChange += SceneGLWidgetOnFpsChange; // Add the GL widget to the UI _sceneGLAlignement.Add(_sceneGLWidget); // AlienEngine logo _alienEngineLogoSquare.Pixbuf = new Gdk.Pixbuf(typeof(Program).Assembly, "Windows.Resources.Images.AlienEngineLogo"); _alienEngineLogoSquare.Pixbuf = _alienEngineLogoSquare.Pixbuf.ScaleSimple(36, 36, Gdk.InterpType.Bilinear); // Command buttons _commandButtonMoveImage.Pixbuf = new Gdk.Pixbuf(typeof(Program).Assembly, "Windows.Resources.Images.commandButtonMove"); _commandButtonRotateImage.Pixbuf = new Gdk.Pixbuf(typeof(Program).Assembly, "Windows.Resources.Images.commandButtonRotate"); _commandButtonScaleImage.Pixbuf = new Gdk.Pixbuf(typeof(Program).Assembly, "Windows.Resources.Images.commandButtonScale"); _commandButtonGlobalViewImage.Pixbuf = new Gdk.Pixbuf(typeof(Program).Assembly, "Windows.Resources.Images.commandButtonGlobal"); _commandButtonLocalViewImage.Pixbuf = new Gdk.Pixbuf(typeof(Program).Assembly, "Windows.Resources.Images.commandButtonLocal"); // Toolbar buttons _commandButtonUndoImage.Pixbuf = new Gdk.Pixbuf(typeof(Program).Assembly, "Windows.Resources.Images.commandButtonUndo"); _commandButtonRedoImage.Pixbuf = new Gdk.Pixbuf(typeof(Program).Assembly, "Windows.Resources.Images.commandButtonRedo"); // Options buttons _optionButtonHelpImage.Pixbuf = new Gdk.Pixbuf(typeof(Program).Assembly, "Windows.Resources.Images.commandButtonHelp"); _optionButtonSettingsImage.Pixbuf = new Gdk.Pixbuf(typeof(Program).Assembly, "Windows.Resources.Images.commandButtonSettings"); _optionButtonProjectsImage.Pixbuf = new Gdk.Pixbuf(typeof(Program).Assembly, "Windows.Resources.Images.commandButtonProjects"); _sceneEditorGameElementsTreeView.RowActivated += _sceneEditorGameElementsTreeView_RowActivated; _sceneEditorTransformComponentTranstateSpinX.SetRange(double.MinValue, double.MaxValue); _sceneEditorTransformComponentTranstateSpinY.SetRange(double.MinValue, double.MaxValue); _sceneEditorTransformComponentTranstateSpinZ.SetRange(double.MinValue, double.MaxValue); _sceneEditorTransformComponentRotateSpinX.SetRange(double.MinValue, double.MaxValue); _sceneEditorTransformComponentRotateSpinY.SetRange(double.MinValue, double.MaxValue); _sceneEditorTransformComponentRotateSpinZ.SetRange(double.MinValue, double.MaxValue); _sceneEditorTransformComponentScaleSpinX.SetRange(double.MinValue, double.MaxValue); _sceneEditorTransformComponentScaleSpinY.SetRange(double.MinValue, double.MaxValue); _sceneEditorTransformComponentScaleSpinZ.SetRange(double.MinValue, double.MaxValue); _sceneEditorTransformComponentRevealerSwitchImage.Pixbuf = new Gdk.Pixbuf(typeof(Program).Assembly, "Windows.Resources.Images.Components.Transform"); _sceneEditorTransformComponentRevealerSwitch.Clicked += (sender, args) => _sceneEditorTransformComponentRevealer.RevealChild = !_sceneEditorTransformComponentRevealer.RevealChild; _sceneEditorTransformComponentTranslateImage.Pixbuf = new Gdk.Pixbuf(typeof(Program).Assembly, "Windows.Resources.Images.Icons.move"); _sceneEditorTransformComponentRotateImage.Pixbuf = new Gdk.Pixbuf(typeof(Program).Assembly, "Windows.Resources.Images.Icons.rotate"); _sceneEditorTransformComponentScaleImage.Pixbuf = new Gdk.Pixbuf(typeof(Program).Assembly, "Windows.Resources.Images.Icons.scale"); _sceneEditorTransformComponentTranstateSpinX.ValueChanged += _sceneEditorTransformComponentChanged; _sceneEditorTransformComponentTranstateSpinY.ValueChanged += _sceneEditorTransformComponentChanged; _sceneEditorTransformComponentTranstateSpinZ.ValueChanged += _sceneEditorTransformComponentChanged; _sceneEditorTransformComponentRotateSpinX.ValueChanged += _sceneEditorTransformComponentChanged; _sceneEditorTransformComponentRotateSpinY.ValueChanged += _sceneEditorTransformComponentChanged; _sceneEditorTransformComponentRotateSpinZ.ValueChanged += _sceneEditorTransformComponentChanged; _sceneEditorTransformComponentScaleSpinX.ValueChanged += _sceneEditorTransformComponentChanged; _sceneEditorTransformComponentScaleSpinY.ValueChanged += _sceneEditorTransformComponentChanged; _sceneEditorTransformComponentScaleSpinZ.ValueChanged += _sceneEditorTransformComponentChanged; SceneEditorGameElementsTree.SetTree(ref _sceneEditorGameElementsTreeStore, ref _sceneEditorGameElementsTreeView); }
public void RefreshGameElementsTree() { SceneEditorGameElementsTree.Populate(); }