Ejemplo n.º 1
0
        public override void PaintIcon(PaintValueEventArgs e, Rectangle r)
        {
            MapItemProperties mip = (MapItemProperties)e.Context.Instance;
            byte   sprite         = (byte)(int)e.Value;
            int    palette        = mip.mp.rom[mip.eo + 0x1] & 3;
            Bitmap b = mip.me.make_icon(sprite, palette, true, 1);

            e.Graphics.DrawImage(b, r);
        }
Ejemplo n.º 2
0
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (value.GetType() != typeof(int))
            {
                return(value);
            }
            IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));

            if (edSvc != null)
            {
                int iv = (int)value;
                int i  = (((iv & 1) ^ 1) << 6) | (iv >> 2);
                MapItemProperties mip  = (MapItemProperties)context.Instance;
                SpriteControl     prop = new SpriteControl(mip.me, i);
                edSvc.DropDownControl(prop);
                iv = prop.result;
                if (prop.valid)
                {
                    return(((iv >> 6) ^ 1) | ((iv & 63) << 2));
                }
            }
            return(value);
        }