Example #1
0
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (provider != null)
                service = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));

            if (service != null)
            {
                // This is the code you want to run when the [...] is clicked and after it has been verified.

                // Get our currently selected color.
                MyColor color = (MyColor)value;

                // Create a new instance of the ColorDialog.
                ColorDialog selectionControl = new ColorDialog();

                // Set the selected color in the dialog.
                selectionControl.Color = Color.FromArgb(color.GetARGB());

                // Show the dialog.
                selectionControl.ShowDialog();

                // Return the newly selected color.
                value = new MyColor(selectionControl.Color.ToArgb());
                //value = ColorTranslator.ToHtml(selectionControl.Color);
            }

            return value;
        }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProgramSettings"/> class.
 /// </summary>
 public ProgramSettings()
 {
     // Defaults.
     CameraMoveSpeed = 0.5f;
     CameraMouseSpeed = 0.05f;
     CameraRunSpeed = 3f;
     CameraScrollSpeed = 0.05f;
     SnapToGrid = true;
     SnapValue = 1f;
     UseAdvanceTexturing = true;
     TextureNormalSuffix = "_n";
     TextureSpecularSuffix = "_s";
     TextureHeightSuffix = "_h";
     Antialiasing = _Antialiasing.None;
     VSync = true;
     RotationValue = 5.0f;
     BackColor = new MyColor(Color.LightGray.R, Color.LightGray.G, Color.LightGray.B);
     Script = string.Empty;
     ScriptFileExtension = string.Empty;
     Shadows = false;
     ScriptLanguage = Lexer.Lua;
     FolderBase = "assets";
     FolderModels = "assets\\models";
     FolderTextures = "assets\\textures";
     FolderSounds = "assets\\sounds";
     FolderLevels = "assets\\levels";
 }
Example #3
0
        public Trigger(ICore core)
            : base(core)
        {
            this.core = core;
            Name      = core.GetName <Trigger>();
            Color     = new MyColor(0, 255, 0);

            mesh = core.Scene.CreateMeshBuilder();
            mesh.CreateBox(1f, 1f, 1f, false);
            mesh.SetColor(core.Globals.RGBA(Color.R / 255f, Color.G / 255f, Color.B / 255f, 1));
            mesh.SetLightingMode(CONST_TV_LIGHTINGMODE.TV_LIGHTING_MANAGED);
            mesh.SetAlphaTest(true);
            mesh.SetBlendingMode(CONST_TV_BLENDINGMODE.TV_BLEND_ADD);

            UniqueId = mesh.GetMeshName();
        }
Example #4
0
        public Trigger(ICore core)
            : base(core)
        {
            this.core = core;
            Name = core.GetName<Trigger>();
            Color = new MyColor(0, 255, 0);

            mesh = core.Scene.CreateMeshBuilder();
            mesh.CreateBox(1f, 1f, 1f, false);
            mesh.SetColor(core.Globals.RGBA(Color.R / 255f, Color.G / 255f, Color.B / 255f, 1));
            mesh.SetLightingMode(CONST_TV_LIGHTINGMODE.TV_LIGHTING_MANAGED);
            mesh.SetAlphaTest(true);
            mesh.SetBlendingMode(CONST_TV_BLENDINGMODE.TV_BLEND_ADD);

            UniqueId = mesh.GetMeshName();
        }