Beispiel #1
0
		public CustomContextEntry(int clilocID, Action<IEntity, Mobile> callback, bool enabled, Color555 color)
			: base(clilocID)
		{
			Callback = callback;
			Enabled = enabled;
			Color = color;
		}
 public CustomContextEntry(int clilocID, Action <IEntity, Mobile> callback, bool enabled, Color555 color)
     : base(clilocID)
 {
     Callback = callback;
     Enabled  = enabled;
     Color    = color;
 }
Beispiel #3
0
        public unsafe Bitmap GetImage(bool fill, Color555 bgColor, Color555 textColor)
        {
            if (Width * Height <= 0)
            {
                return(null);
            }

            var image = new Bitmap(Width, Height, UOFont.PixelFormat);

            var bound = new Rectangle(0, 0, Width, Height);

            var dataSrc  = Image.LockBits(bound, ImageLockMode.ReadOnly, UOFont.PixelFormat);
            var lineSrc  = (ushort *)dataSrc.Scan0;
            var deltaSrc = dataSrc.Stride >> 1;

            var dataTrg  = image.LockBits(bound, ImageLockMode.WriteOnly, UOFont.PixelFormat);
            var lineTrg  = (ushort *)dataTrg.Scan0;
            var deltaTrg = dataTrg.Stride >> 1;

            int x, y;

            for (y = 0; y < Height; y++, lineSrc += deltaSrc, lineTrg += deltaTrg)
            {
                var source = lineSrc;
                var target = lineTrg;

                if (source == null || target == null)
                {
                    continue;
                }

                for (x = 0; x < Width; x++)
                {
                    if (source[x] != 0)
                    {
                        target[x] = textColor;
                    }
                    else if (fill)
                    {
                        target[x] = bgColor;
                    }
                }
            }

            Image.UnlockBits(dataSrc);
            image.UnlockBits(dataTrg);

            return(image);
        }
 public CustomContextEntry(int clilocID, Action <IEntity, Mobile> callback, Color555 color)
     : this(clilocID, callback, true, color)
 {
 }
 public CustomContextEntry(int clilocID, Action <Mobile> callback, bool enabled, Color555 color)
     : this(clilocID, WrapCallback(callback), enabled, color)
 {
 }
Beispiel #6
0
 public static string WrapUOHtmlBG(this string str, Color555 color)
 {
     return(WrapUOHtmlBG(str ?? String.Empty, color.ToColor()));
 }
Beispiel #7
0
 public static string WrapUOHtmlColor(this string str, Color color, Color555 reset, bool close = true)
 {
     return(WrapUOHtmlColor(str ?? String.Empty, color, reset.ToColor(), close));
 }
Beispiel #8
0
 public static string WrapUOHtmlColor(this string str, Color555 color, KnownColor reset, bool close = true)
 {
     return(WrapUOHtmlColor(str ?? String.Empty, color.ToColor(), Color.FromKnownColor(reset), close));
 }
Beispiel #9
0
 public static string WrapUOHtmlColor(this string str, Color555 color, bool close = true)
 {
     return(WrapUOHtmlColor(str ?? String.Empty, color.ToColor(), Color.White, close));
 }
Beispiel #10
0
 public Bitmap GetImage(bool fill, Color555 bgColor)
 {
     return(GetImage(fill, bgColor, Color555.Black));
 }
Beispiel #11
0
		public CustomContextEntry(int clilocID, Action<IEntity, Mobile> callback, Color555 color)
			: this(clilocID, callback, true, color)
		{ }
Beispiel #12
0
		public CustomContextEntry(int clilocID, Action<Mobile> callback, bool enabled, Color555 color)
			: this(clilocID, WrapCallback(callback), enabled, color)
		{ }
Beispiel #13
0
 public static string WrapUOHtmlColors(this string str, Color start, Color555 end)
 {
     return(WrapUOHtmlColors(str ?? String.Empty, start, end.ToColor()));
 }