コード例 #1
0
        public void PaintWorld(WorldLayer layer)
        {
            try                 // minimap overlay exceptions happen sometimes, but no harm...so let it just pass
            {
                var cnt  = 0;   // for type1~3 (B&W)
                var cnt1 = 0;   // for webbbs 1~3 (color)
                var cnt2 = 0;   // for chat1~3 (B&W)
                foreach (var p in Hud.Queue.GetItems <Popup>())
                {
                    w = p.Text.Length * 13;
                    if (w > 1300)
                    {
                        w      = 1300;                      // max width
                        p.Text = p.Text.Substring(100);     // cut it if too long
                    }

                    var deco = 1;
                    switch (p.PopUpDecoratorTouse)
                    {
                    case EnumPopupDecoratorToUse.Default:
                        x = fixedX = Hud.Window.Size.Width / 2 - (int)(w / 2);
                        h = 55;
                        y = 280;
                        break;

                    case EnumPopupDecoratorToUse.Type1:
                        x = fixedX = Hud.Window.Size.Width / 2 - (int)(w / 2);
                        h = 50;
                        w = 80;
                        y = 350 + (cnt * h);
                        cnt++;
                        break;

                    case EnumPopupDecoratorToUse.WebBB1:
                        deco = 2;
                        x    = 50;
                        h    = 60;
                        y    = 250 + (cnt1 * h);
                        cnt1++;
                        break;

                    case EnumPopupDecoratorToUse.Chat1:
                        x = 50;
                        h = 60;
                        y = 440 + (cnt2 * h);
                        cnt2++;
                        break;
                    }
                    if (deco == 1)
                    {
                        PopupDecorator1.Paint(x, y, w, h, p.Text, p.Title);     // black&white
                    }
                    else
                    {
                        PopupDecorator2.Paint(x, y, w, h, p.Text, p.Title);     // color
                    }
                }
            }
            catch
            {
                Console.Beep(300, 100);
            }
        }
コード例 #2
0
        public void PaintWorld(WorldLayer layer)
        {
            try
            {
                foreach (Popup p in Hud.Queue.GetItems <Popup>().Take(9))
                {
                    w = p.Text.Length * 13;
                    h = 60;
                    switch (p.PopUpDecoratorTouse)
                    {
                    case EnumPopupDecoratorToUse.Default:
                    case EnumPopupDecoratorToUse.Type1:
                    case EnumPopupDecoratorToUse.Type2:
                    case EnumPopupDecoratorToUse.Type3:
                        x = Hud.Window.Size.Width / 2 - (int)(w / 2);
                        break;

                    default:
                        x = 50;
                        break;
                    }
                    if (w < 65)
                    {
                        w = 65;
                    }
                    if (w > 1300)
                    {
                        w      = 1300;
                        p.Text = p.Text.Substring(100);
                    }
                    y = 250;

                    var deco = 1;
                    switch (p.PopUpDecoratorTouse)
                    {
                    case EnumPopupDecoratorToUse.Default:
                        if (w < 100)
                        {
                            w = 100;
                        }
                        h = 50;
                        y = 280;
                        break;

                    case EnumPopupDecoratorToUse.Type1:
                        break;

                    case EnumPopupDecoratorToUse.Type2:
                        y += h;
                        break;

                    case EnumPopupDecoratorToUse.Type3:
                        y += (h * 2);
                        break;

                    case EnumPopupDecoratorToUse.WebBB1:
                        deco = 2;
                        break;

                    case EnumPopupDecoratorToUse.WebBB2:
                        y   += h;
                        deco = 2;
                        break;

                    case EnumPopupDecoratorToUse.WebBB3:
                        y   += (h * 2);
                        deco = 2;
                        break;

                    case EnumPopupDecoratorToUse.Chat1:
                        y += (h * 3);
                        break;

                    case EnumPopupDecoratorToUse.Chat2:
                        y += (h * 4);
                        break;

                    case EnumPopupDecoratorToUse.Chat3:
                        y += (h * 5);
                        break;
                    }
                    if (deco == 1)
                    {
                        PopupDecorator1.Paint(x, y, w, h, p.Text, p.Title);                             // black&white
                    }
                    else
                    {
                        PopupDecorator2.Paint(x, y, w, h, p.Text, p.Title);                             // color
                    }
                }
            }
            catch               //(Exception ex)
            {
                //throw;
            }
        }