示例#1
0
    private void DrawDefaultPrice(Good good)
    {
        Rect position = new Rect(crdItemSpecialIcon);

        if (good.isSale)
        {
            TextureUtil.DrawTexture(position, iconSale, ScaleMode.StretchToFill);
            position.x += 20f;
        }
        if (good.isNew)
        {
            TextureUtil.DrawTexture(position, iconNew, ScaleMode.StretchToFill);
            position.x += 20f;
        }
        if (good.isHot)
        {
            TextureUtil.DrawTexture(position, iconHot, ScaleMode.StretchToFill);
            position.x += 20f;
        }
        Texture2D mark = TokenManager.Instance.currentToken.mark;

        if (selFilter == 0)
        {
            Rect position2 = new Rect(crdItemPriceIcon);
            if (good.IsPointable)
            {
                TextureUtil.DrawTexture(position2, iconPoint, ScaleMode.StretchToFill);
                position2.x += (float)(mark.width + 2);
            }
            if (good.IsBrickPointable && BuildOption.Instance.Props.useBrickPoint)
            {
                TextureUtil.DrawTexture(position2, iconBrick, ScaleMode.StretchToFill);
                position2.x += (float)(mark.width + 2);
            }
            if (good.IsCashable)
            {
                TextureUtil.DrawTexture(position2, mark, ScaleMode.StretchToFill);
            }
        }
        else
        {
            switch (selFilter)
            {
            case 1:
                if (good.IsCashable)
                {
                    TextureUtil.DrawTexture(crdItemPriceIcon, mark, ScaleMode.StretchToFill);
                    LabelUtil.TextOut(crdItemPrice, good.GetDefaultTokenPrice(), "MiniLabel", GlobalVars.Instance.txtMainColor, GlobalVars.txtEmptyColor, TextAnchor.MiddleLeft);
                }
                break;

            case 2:
                if (good.IsPointable)
                {
                    TextureUtil.DrawTexture(crdItemPriceIcon, iconPoint, ScaleMode.StretchToFill);
                    LabelUtil.TextOut(crdItemPrice, good.GetDefaultPrice(), "MiniLabel", GlobalVars.Instance.txtMainColor, GlobalVars.txtEmptyColor, TextAnchor.MiddleLeft);
                }
                break;

            case 3:
                if (good.IsBrickPointable)
                {
                    TextureUtil.DrawTexture(crdItemPriceIcon, iconBrick, ScaleMode.StretchToFill);
                    LabelUtil.TextOut(crdItemPrice, good.GetDefaultBrickPrice(), "MiniLabel", GlobalVars.Instance.txtMainColor, GlobalVars.txtEmptyColor, TextAnchor.MiddleLeft);
                }
                break;
            }
        }
    }
示例#2
0
 public void DoPriceTag()
 {
     if (isShop && good != null && tcPrize == null)
     {
         curUIPos.y += brunchGap;
         float num = curUIPos.y;
         if (good.IsPointable)
         {
             if (bCalcHeight)
             {
                 curUIPos.y += priceOffset;
             }
             else
             {
                 TextureUtil.DrawTexture(new Rect(10f, num + 4f, (float)iconPoint.width, (float)iconPoint.height), iconPoint, ScaleMode.StretchToFill);
                 LabelUtil.TextOut(new Vector2(30f, num), good.GetDefaultPrice() + "/" + good.GetDefaultOption(Good.BUY_HOW.GENERAL_POINT), "MiniLabel", Color.white, GlobalVars.txtEmptyColor, TextAnchor.UpperLeft);
             }
             if (BuildOption.Instance.Props.itemBuyLimit)
             {
                 Texture2D badge = XpManager.Instance.GetBadge(good.minlvFp);
                 string    rank  = XpManager.Instance.GetRank(good.minlvFp);
                 if (null != badge)
                 {
                     Vector2 vector = LabelUtil.CalcLength("MiniLabel", good.GetDefaultPrice() + "/" + good.GetDefaultOption(Good.BUY_HOW.GENERAL_POINT));
                     TextureUtil.DrawTexture(new Rect(40f + vector.x, num, (float)badge.width, (float)badge.height), badge);
                     string text = string.Format(StringMgr.Instance.Get("ITEM_PURCHASE_LIMIT_MSG05"), rank);
                     LabelUtil.TextOut(new Vector2(40f + vector.x + (float)badge.width + 4f, num), text, "MiniLabel", GlobalVars.Instance.txtMainColor, GlobalVars.txtEmptyColor, TextAnchor.UpperLeft);
                 }
             }
             num += priceOffset;
         }
         if (good.IsBrickPointable && BuildOption.Instance.Props.useBrickPoint)
         {
             if (bCalcHeight)
             {
                 curUIPos.y += priceOffset;
             }
             else
             {
                 TextureUtil.DrawTexture(new Rect(10f, num + 4f, (float)iconPoint.width, (float)iconPoint.height), iconBrick, ScaleMode.StretchToFill);
                 LabelUtil.TextOut(new Vector2(30f, num), good.GetDefaultBrickPrice() + "/" + good.GetDefaultOption(Good.BUY_HOW.BRICK_POINT), "MiniLabel", Color.white, GlobalVars.txtEmptyColor, TextAnchor.UpperLeft);
                 num += priceOffset;
             }
         }
         if (good.IsCashable)
         {
             if (bCalcHeight)
             {
                 curUIPos.y += priceOffset;
             }
             else
             {
                 Texture2D mark = TokenManager.Instance.currentToken.mark;
                 TextureUtil.DrawTexture(new Rect(10f, num + 4f, (float)iconPoint.width, (float)iconPoint.height), mark, ScaleMode.StretchToFill);
                 LabelUtil.TextOut(new Vector2(30f, num), good.GetDefaultTokenPrice() + "/" + good.GetDefaultOption(Good.BUY_HOW.CASH_POINT), "MiniLabel", Color.white, GlobalVars.txtEmptyColor, TextAnchor.UpperLeft);
             }
             if (BuildOption.Instance.Props.itemBuyLimit)
             {
                 Texture2D badge2 = XpManager.Instance.GetBadge(good.minlvTk);
                 string    rank2  = XpManager.Instance.GetRank(good.minlvTk);
                 if (null != badge2)
                 {
                     Vector2 vector2 = LabelUtil.CalcLength("MiniLabel", good.GetDefaultTokenPrice() + "/" + good.GetDefaultOption(Good.BUY_HOW.CASH_POINT));
                     TextureUtil.DrawTexture(new Rect(40f + vector2.x, num, (float)badge2.width, (float)badge2.height), badge2);
                     string text2 = string.Format(StringMgr.Instance.Get("ITEM_PURCHASE_LIMIT_MSG05"), rank2);
                     LabelUtil.TextOut(new Vector2(40f + vector2.x + (float)badge2.width + 4f, num), text2, "MiniLabel", GlobalVars.Instance.txtMainColor, GlobalVars.txtEmptyColor, TextAnchor.UpperLeft);
                 }
             }
             num += priceOffset;
         }
     }
 }