Example #1
0
 // Token: 0x0600042C RID: 1068 RVA: 0x00023718 File Offset: 0x00021918
 public static void paint(mGraphics g, string str, int x, int y, int w, int h, mFont f)
 {
     if (TextInfo.wStr != f.getWidth(str) || !TextInfo.laststring.Equals(str))
     {
         TextInfo.laststring = str;
         TextInfo.dx         = 0;
         TextInfo.wStr       = f.getWidth(str);
         TextInfo.isBack     = false;
         TextInfo.tx         = 0;
     }
     g.setClip(x, y, w, h);
     if (TextInfo.wStr > w)
     {
         f.drawString(g, str, x - TextInfo.dx, y, 0);
     }
     else
     {
         f.drawString(g, str, x + w / 2, y, 2);
     }
     GameCanvas.resetTrans(g);
     if (TextInfo.wStr > w)
     {
         if (!TextInfo.isBack)
         {
             TextInfo.tx++;
             if (TextInfo.tx > 50)
             {
                 TextInfo.dx++;
                 if (TextInfo.dx >= TextInfo.wStr)
                 {
                     TextInfo.tx     = 0;
                     TextInfo.dx     = -w + 30;
                     TextInfo.isBack = true;
                 }
             }
         }
         else
         {
             if (TextInfo.dx < 0)
             {
                 int num = w + TextInfo.dx >> 1;
                 TextInfo.dx += num;
             }
             if (TextInfo.dx > 0)
             {
                 TextInfo.dx = 0;
             }
             if (TextInfo.dx == 0)
             {
                 TextInfo.tx++;
                 if (TextInfo.tx == 50)
                 {
                     TextInfo.tx     = 0;
                     TextInfo.isBack = false;
                 }
             }
         }
     }
 }
 // Token: 0x060008AC RID: 2220 RVA: 0x0007E2EC File Offset: 0x0007C4EC
 public void paintIcon(mGraphics g)
 {
     g.translate(-this.cmx, 0);
     PopUp.paintPopUp(g, this.x, this.y - 17, this.w, this.h + 17, -1, true);
     mFont.tahoma_7b_dark.drawString(g, mResources.select_clan_icon, this.x + this.w / 2, this.y - 7, 2);
     if (this.lastSelect >= 0 && this.lastSelect <= ClanImage.vClanImage.size() - 1)
     {
         ClanImage clanImage = (ClanImage)ClanImage.vClanImage.elementAt(this.lastSelect);
         if (clanImage.idImage != null)
         {
             global::Char.myCharz().paintBag(g, clanImage.idImage, GameCanvas.w / 2, this.y + 45, 1, false);
         }
     }
     global::Char.myCharz().paintCharBody(g, GameCanvas.w / 2, this.y + 45, 1, global::Char.myCharz().cf, false);
     g.setClip(this.x, this.y + this.disStart, this.w, this.h - this.disStart - 10);
     if (TabClanIcon.scrMain != null)
     {
         g.translate(0, -TabClanIcon.scrMain.cmy);
     }
     for (int i = 0; i < this.nItem; i++)
     {
         int num  = this.x + 10;
         int num2 = this.y + i * this.WIDTH + this.disStart;
         if (num2 + this.WIDTH - ((TabClanIcon.scrMain == null) ? 0 : TabClanIcon.scrMain.cmy) >= this.y + this.disStart && num2 - ((TabClanIcon.scrMain == null) ? 0 : TabClanIcon.scrMain.cmy) <= this.y + this.disStart + this.h)
         {
             ClanImage clanImage2 = (ClanImage)ClanImage.vClanImage.elementAt(i);
             mFont     mFont      = mFont.tahoma_7_grey;
             if (i == this.lastSelect)
             {
                 mFont = mFont.tahoma_7_blue;
             }
             if (clanImage2.name != null)
             {
                 mFont.drawString(g, clanImage2.name, num + 20, num2, 0);
             }
             if (clanImage2.xu > 0)
             {
                 mFont.drawString(g, clanImage2.xu + " " + mResources.XU, num + this.w - 20, num2, mFont.RIGHT);
             }
             else if (clanImage2.luong > 0)
             {
                 mFont.drawString(g, clanImage2.luong + " " + mResources.LUONG, num + this.w - 20, num2, mFont.RIGHT);
             }
             else
             {
                 mFont.drawString(g, mResources.free, num + this.w - 20, num2, mFont.RIGHT);
             }
             if (clanImage2.idImage != null)
             {
                 SmallImage.drawSmallImage(g, (int)clanImage2.idImage[0], num, num2, 0, 0);
             }
         }
     }
     g.translate(0, -g.getTranslateY());
     g.setClip(0, 0, GameCanvas.w, GameCanvas.h);
     GameCanvas.paintz.paintCmdBar(g, this.left, this.center, this.right);
 }
    // Token: 0x06000210 RID: 528 RVA: 0x000117D8 File Offset: 0x0000F9D8
    public void paint(mGraphics g, int x, int y)
    {
        mFont mFont = mFont.tahoma_7b_dark;

        if ((int)this.role == 0)
        {
            mFont = mFont.tahoma_7b_red;
        }
        else if ((int)this.role == 1)
        {
            mFont = mFont.tahoma_7b_green;
        }
        else if ((int)this.role == 2)
        {
            mFont = mFont.tahoma_7b_green2;
        }
        if (this.type == 0)
        {
            mFont.drawString(g, this.playerName, x + 3, y + 1, 0);
            if ((int)this.color == 0)
            {
                mFont.tahoma_7_grey.drawString(g, this.chat[0] + ((this.chat.Length <= 1) ? string.Empty : "..."), x + 3, y + 11, 0);
            }
            else
            {
                mFont.tahoma_7_red.drawString(g, this.chat[0] + ((this.chat.Length <= 1) ? string.Empty : "..."), x + 3, y + 11, 0);
            }
            mFont.tahoma_7_grey.drawString(g, NinjaUtil.getTimeAgo(this.timeAgo) + " " + mResources.ago, x + GameCanvas.panel.wScroll - 3, y + 1, mFont.RIGHT);
        }
        if (this.type == 1)
        {
            mFont.drawString(g, string.Concat(new object[]
            {
                this.playerName,
                " (",
                this.recieve,
                "/",
                this.maxCap,
                ")"
            }), x + 3, y + 1, 0);
            mFont.tahoma_7_blue.drawString(g, string.Concat(new string[]
            {
                mResources.request_pea,
                " ",
                NinjaUtil.getTimeAgo(this.timeAgo),
                " ",
                mResources.ago
            }), x + 3, y + 11, 0);
        }
        if (this.type == 2)
        {
            mFont.drawString(g, this.playerName, x + 3, y + 1, 0);
            mFont.tahoma_7_blue.drawString(g, mResources.request_join_clan, x + 3, y + 11, 0);
        }
    }
Example #4
0
    // Token: 0x06000370 RID: 880 RVA: 0x0001B348 File Offset: 0x00019548
    public void paintCmdBar(mGraphics g, Command left, Command center, Command right)
    {
        mFont mFont = (!GameCanvas.isTouch) ? mFont.tahoma_7b_dark : mFont.tahoma_7b_dark;
        int   num   = 3;

        if (left != null)
        {
            Paint.lenCaption = mFont.getWidth(left.caption);
            if (Paint.lenCaption > 0)
            {
                if (left.x >= 0 && left.y > 0)
                {
                    left.paint(g);
                }
                else
                {
                    g.drawImage((mScreen.keyTouch != 0) ? GameScr.imgLbtn : GameScr.imgLbtnFocus, 1, GameCanvas.h - mScreen.cmdH - 1, 0);
                    mFont.drawString(g, left.caption, 35, GameCanvas.h - mScreen.cmdH + 3 + num, 2);
                }
            }
        }
        if (center != null)
        {
            Paint.lenCaption = mFont.getWidth(center.caption);
            if (Paint.lenCaption > 0)
            {
                if (center.x > 0 && center.y > 0)
                {
                    center.paint(g);
                }
                else
                {
                    g.drawImage((mScreen.keyTouch != 1) ? GameScr.imgLbtn : GameScr.imgLbtnFocus, GameCanvas.hw - 35, GameCanvas.h - mScreen.cmdH - 1, 0);
                    mFont.drawString(g, center.caption, GameCanvas.hw, GameCanvas.h - mScreen.cmdH + 3 + num, 2);
                }
            }
        }
        if (right != null)
        {
            Paint.lenCaption = mFont.getWidth(right.caption);
            if (Paint.lenCaption > 0)
            {
                if (right.x > 0 && right.y > 0)
                {
                    right.paint(g);
                }
                else
                {
                    g.drawImage((mScreen.keyTouch != 2) ? GameScr.imgLbtn : GameScr.imgLbtnFocus, GameCanvas.w - 71, GameCanvas.h - mScreen.cmdH - 1, 0);
                    mFont.drawString(g, right.caption, GameCanvas.w - 35, GameCanvas.h - mScreen.cmdH + 3 + num, 2);
                }
            }
        }
    }
Example #5
0
 // Token: 0x06000180 RID: 384 RVA: 0x00004469 File Offset: 0x00002669
 public void drawStringBorder(mGraphics g, string st, int x, int y, int align, mFont font2)
 {
     if (mGraphics.zoomLevel == 1)
     {
         this.drawString(g, st, x, y, align, font2);
     }
     else
     {
         this.drawStringBd(g, st, x, y, align, font2);
     }
 }
Example #6
0
 // Token: 0x06000304 RID: 772 RVA: 0x00017840 File Offset: 0x00015A40
 public void addInfo(string s, int speed, mFont f)
 {
     if (GameCanvas.w == 128)
     {
         this.limLeft = 1;
     }
     if (this.infoWaitToShow.size() > 10)
     {
         this.infoWaitToShow.removeElementAt(0);
     }
     this.infoWaitToShow.addElement(new InfoItem(s, f, speed));
 }
Example #7
0
 // Token: 0x06000181 RID: 385 RVA: 0x0000E414 File Offset: 0x0000C614
 public void drawStringBd(mGraphics g, string st, int x, int y, int align, mFont font)
 {
     this.setTypePaint(g, st, x - 1, y - 1, align, 0);
     this.setTypePaint(g, st, x - 1, y + 1, align, 0);
     this.setTypePaint(g, st, x + 1, y - 1, align, 0);
     this.setTypePaint(g, st, x + 1, y + 1, align, 0);
     this.setTypePaint(g, st, x, y - 1, align, 0);
     this.setTypePaint(g, st, x, y + 1, align, 0);
     this.setTypePaint(g, st, x + 1, y, align, 0);
     this.setTypePaint(g, st, x - 1, y, align, 0);
     this.setTypePaint(g, st, x, y, align, 0);
 }
Example #8
0
 // Token: 0x06000182 RID: 386 RVA: 0x0000E4B8 File Offset: 0x0000C6B8
 public void drawString(mGraphics g, string st, int x, int y, int align, mFont font)
 {
     if (mGraphics.zoomLevel == 1)
     {
         int length = st.Length;
         int num;
         if (align == 0)
         {
             num = x;
         }
         else if (align == 1)
         {
             num = x - this.getWidth(st);
         }
         else
         {
             num = x - (this.getWidth(st) >> 1);
         }
         for (int i = 0; i < length; i++)
         {
             int num2 = this.strFont.IndexOf(st[i]);
             if (num2 == -1)
             {
                 num2 = 0;
             }
             if (num2 > -1)
             {
                 int x2   = this.fImages[num2][0];
                 int num3 = this.fImages[num2][1];
                 int w    = this.fImages[num2][2];
                 int num4 = this.fImages[num2][3];
                 if (num3 + num4 > this.imgFont.texture.height)
                 {
                     num3 -= this.imgFont.texture.height;
                     x2    = this.imgFont.texture.width / 2;
                 }
                 if (!GameCanvas.lowGraphic && font != null)
                 {
                     g.drawRegion(font.imgFont, x2, num3, w, num4, 0, num + 1, y, 20);
                     g.drawRegion(font.imgFont, x2, num3, w, num4, 0, num, y + 1, 20);
                 }
                 g.drawRegion(this.imgFont, x2, num3, w, num4, 0, num, y, 20);
             }
             num += this.fImages[num2][2] + this.space;
         }
     }
     else
     {
         this.setTypePaint(g, st, x, y + 1, align, font.id);
         this.setTypePaint(g, st, x, y, align, 0);
     }
 }
 // Token: 0x060006ED RID: 1773 RVA: 0x00006799 File Offset: 0x00004999
 public InfoItem(string s, mFont f, int speed)
 {
     this.f     = f;
     this.s     = s;
     this.speed = speed;
 }
Example #10
0
    // Token: 0x06000300 RID: 768 RVA: 0x00016E58 File Offset: 0x00015058
    public void paint(mGraphics g, int x, int y, int dir)
    {
        if (this.infoWaitToShow.size() != 0)
        {
            g.translate(x, y);
            if (this.says != null && this.says.Length != 0 && this.type != 1)
            {
                if (this.outSide)
                {
                    this.cx -= GameScr.cmx;
                    this.cy -= GameScr.cmy;
                    this.cy += 35;
                }
                int num = (mGraphics.zoomLevel != 1) ? 10 : 0;
                if (this.info.charInfo == null)
                {
                    PopUp.paintPopUp(g, this.X, this.Y, this.W, this.H, 16777215, false);
                }
                else
                {
                    mSystem.paintPopUp2(g, this.X - 23, this.Y - num / 2, this.W + 15, this.H + ((!GameCanvas.isTouch) ? 14 : 0) + num);
                }
                if (this.info.charInfo == null)
                {
                    g.drawRegion(Info.gocnhon, 0, 0, 9, 8, (dir != 1) ? 2 : 0, this.cx - 3 + ((dir != 1) ? 20 : -15), this.cy - this.ch - 20 + this.sayRun + 2, mGraphics.TOP | mGraphics.HCENTER);
                }
                int num2 = -1;
                int i    = 0;
                while (i < this.says.Length)
                {
                    mFont  mFont = mFont.tahoma_7;
                    string text  = this.says[i];
                    int    num4;
                    if (this.says[i].StartsWith("|"))
                    {
                        string[] array = Res.split(this.says[i], "|", 0);
                        if (array.Length == 3)
                        {
                            text = array[2];
                        }
                        if (array.Length == 4)
                        {
                            text = array[3];
                            int num3 = int.Parse(array[2]);
                        }
                        num4 = int.Parse(array[1]);
                        num2 = num4;
                    }
                    else
                    {
                        num4 = num2;
                    }
                    int num5 = num4;
                    switch (num5 + 1)
                    {
                    case 0:
                        mFont = mFont.tahoma_7;
                        break;

                    case 1:
                        mFont = mFont.tahoma_7b_dark;
                        break;

                    case 2:
                        mFont = mFont.tahoma_7b_green;
                        break;

                    case 3:
                        mFont = mFont.tahoma_7b_blue;
                        break;

                    case 4:
                        mFont = mFont.tahoma_7_red;
                        break;

                    case 5:
                        mFont = mFont.tahoma_7_green;
                        break;

                    case 6:
                        mFont = mFont.tahoma_7_blue;
                        break;

                    case 8:
                        mFont = mFont.tahoma_7b_red;
                        break;
                    }
IL_290:
                    if (this.info.charInfo == null)
                    {
                        mFont.drawString(g, text, this.cx, this.cy - this.ch - 15 + this.sayRun + i * 12 - this.says.Length * 12 - 9, 2);
                    }
                    else
                    {
                        int num6 = this.X - 23;
                        int num7 = this.Y - num / 2;
                        int num8 = (mSystem.clientType != 1) ? (this.W + 25) : (this.W + 28);
                        int num9 = this.H + ((!GameCanvas.isTouch) ? 14 : 0) + num;
                        g.setColor(4465169);
                        g.fillRect(num6, num7 + num9, num8, 2);
                        int num10 = this.info.timeCount * num8 / this.info.maxTime;
                        if (num10 < 0)
                        {
                            num10 = 0;
                        }
                        g.setColor(43758);
                        g.fillRect(num6, num7 + num9, num10, 2);
                        if (this.info.timeCount == 0)
                        {
                            return;
                        }
                        this.info.charInfo.paintHead(g, this.X + 10, this.Y + this.H / 2, 0);
                        if (mGraphics.zoomLevel == 1)
                        {
                            ((!this.info.isChatServer) ? mFont.tahoma_7b_greenSmall : mFont.tahoma_7b_yellowSmall2).drawString(g, this.info.charInfo.cName, this.X + 12, this.Y + 3, 0);
                        }
                        else
                        {
                            ((!this.info.isChatServer) ? mFont.tahoma_7b_greenSmall : mFont.tahoma_7b_yellowSmall2).drawString(g, this.info.charInfo.cName, this.X + 12, this.Y - 3, 0);
                        }
                        if (!GameCanvas.isTouch)
                        {
                            if (!TField.isQwerty)
                            {
                                mFont.tahoma_7b_green2Small.drawString(g, "Nhấn # để chat", this.X + this.W / 2 + 10, this.Y + this.H, mFont.CENTER);
                            }
                            else
                            {
                                mFont.tahoma_7b_green2Small.drawString(g, "Nhấn Y để chat", this.X + this.W / 2 + 10, this.Y + this.H, mFont.CENTER);
                            }
                        }
                        if (mGraphics.zoomLevel == 1)
                        {
                            TextInfo.paint(g, text, this.X + 14, this.Y + this.H / 2 + 2, this.W - 16, this.H, mFont.tahoma_7_whiteSmall);
                        }
                        else
                        {
                            string[] array2 = mFont.tahoma_7_whiteSmall.splitFontArray(text, 120);
                            for (int j = 0; j < array2.Length; j++)
                            {
                                mFont.tahoma_7_whiteSmall.drawString(g, array2[j], this.X + 12, this.Y + 12 + j * 12 - 3, 0);
                            }
                            GameCanvas.resetTrans(g);
                        }
                    }
                    i++;
                    continue;
                    goto IL_290;
                }
                if (this.info.charInfo != null)
                {
                }
            }
            g.translate(-x, -y);
        }
    }