public override bool DoDialog()
    {
        bool    result = false;
        GUISkin skin   = GUI.skin;

        GUI.skin = GUISkinFinder.Instance.GetGUISkin();
        successRotate.Draw();
        successEffect.Draw();
        background.BeginGroup();
        imgList.Draw();
        labelList.Draw();
        itemName.Draw();
        itemBackNomal.Draw();
        itemBackRare.Draw();
        itemIcon.Draw();
        itemTime.Draw();
        property.DoPropertyGuage(85f);
        itemExplain.Draw();
        if (exit.Draw() || ok.Draw() || GlobalVars.Instance.IsReturnPressed())
        {
            result = true;
        }
        background.EndGroup();
        if (!ContextMenuManager.Instance.IsPopup)
        {
            WindowUtil.EatEvent();
        }
        GUI.skin = skin;
        return(result);
    }
Example #2
0
 public override bool DoDialog()
 {
     if (tItem != null)
     {
         size.y     = totalHeight();
         curUIPos.y = 0f;
         GUISkin skin = GUI.skin;
         GUI.skin = GUISkinFinder.Instance.GetGUISkin();
         Color byteColor2FloatColor = GlobalVars.Instance.GetByteColor2FloatColor(244, 151, 25);
         float num      = (float)(int)((float)tItem.CurIcon().width * 0.4f);
         float num2     = (float)(int)((float)tItem.CurIcon().height * 0.4f);
         Rect  position = new Rect(size.x - num - 4f, 4f, num, num2);
         TextureUtil.DrawTexture(position, tItem.CurIcon(), ScaleMode.StretchToFill);
         Color color = GUI.color;
         GUI.color = byteColor2FloatColor;
         float    width = size.x - num - 8f;
         GUIStyle style = GUI.skin.GetStyle("Label");
         float    num3  = style.CalcHeight(new GUIContent(tItem.Name), width);
         GUI.Label(new Rect(4f, 4f, width, num3), tItem.Name, "Label");
         curUIPos.y += Mathf.Max(num3, num2);
         GUI.color   = color;
         if (!BuildOption.Instance.IsNetmarble && !BuildOption.Instance.IsDeveloper && isShop && tItem.upgradeCategory != TItem.UPGRADE_CATEGORY.NONE)
         {
             Rect position2 = new Rect(size.x - 20f, 5f, 16f, 16f);
             TextureUtil.DrawTexture(position2, GlobalVars.Instance.iconUpgrade, ScaleMode.StretchToFill);
         }
         property.categoryPosY = curUIPos.y;
         curUIPos.y           += 24f;
         Rect position3 = new Rect(6f, curUIPos.y, size.x - 6f, 1f);
         TextureUtil.DrawTexture(position3, GlobalVars.Instance.headLine, ScaleMode.StretchToFill);
         curUIPos.y += 4f;
         style       = GUI.skin.GetStyle("MiniLabel");
         num3        = style.CalcHeight(new GUIContent(StringMgr.Instance.Get(tItem.comment)), size.x - 16f);
         GUI.Label(new Rect(8f, curUIPos.y, size.x - 16f, num3), StringMgr.Instance.Get(tItem.comment), "MiniLabel");
         curUIPos.y += num3;
         curUIPos.y += brunchGap;
         curUIPos.y  = property.DoPropertyGuage(curUIPos.y);
         DoCashBack();
         DoPriceTag();
         DoAmount();
         GUI.skin = skin;
     }
     return(false);
 }
    public override bool DoDialog()
    {
        bool    result = false;
        GUISkin skin   = GUI.skin;

        GUI.skin = GUISkinFinder.Instance.GetGUISkin();
        imgList.Draw();
        labelList.Draw();
        TcStatus[] array = TreasureChestManager.Instance.ToArray();
        scrollBoard.ListResetAddPosition();
        scrollBoard.SetListCount(array.Length);
        scrollBoard.BeginScroll();
        for (int i = 0; i < scrollBoard.GetListCount(); i++)
        {
            TcStatus tcStatus = array[i];
            select.IsDraw           = (curBoard == i);
            boardBack.toolTipString = tcStatus.Seq.ToString();
            boardName.SetText(tcStatus.GetTitle());
            if (tcStatus.TokenPrice == 0)
            {
                token.IsDraw      = false;
                tokenCount.IsDraw = false;
            }
            else
            {
                token.IsDraw      = true;
                tokenCount.IsDraw = true;
                tokenCount.SetText(tcStatus.TokenPrice.ToString());
            }
            if (tcStatus.CoinPrice == 0)
            {
                coin.IsDraw      = false;
                coinCount.IsDraw = false;
                premium.IsDraw   = true;
            }
            else
            {
                coin.IsDraw      = true;
                coinCount.IsDraw = true;
                premium.IsDraw   = false;
                coinCount.SetText(tcStatus.CoinPrice.ToString());
            }
            if (BuildOption.Instance.Props.randomBox == BuildOption.RANDOM_BOX_TYPE.INFERNUM)
            {
                maxRare.SetListCount(tcStatus.MaxKey);
                currentRare.SetListCount(tcStatus.Key);
                count.SetText(tcStatus.GetDescription());
                itemIconTable.IsDraw = false;
                itemTimeTable.IsDraw = false;
            }
            else
            {
                TcTItem firstRare = tcStatus.GetFirstRare();
                if (!firstRare.IsNull())
                {
                    TItem tItem = TItemManager.Instance.Get <TItem>(firstRare.code);
                    if (tItem != null)
                    {
                        itemIconTable.IsDraw   = true;
                        itemTimeTable.IsDraw   = true;
                        premium.IsDraw         = false;
                        itemIconTable.texImage = tItem.CurIcon();
                        if (tItem.IsAmount)
                        {
                            itemTimeTable.SetText(firstRare.opt.ToString() + " " + StringMgr.Instance.Get("TIMES_UNIT"));
                        }
                        else if (firstRare.opt >= 1000000)
                        {
                            itemTimeTable.SetText(StringMgr.Instance.Get("INFINITE"));
                        }
                        else
                        {
                            itemTimeTable.SetText(firstRare.opt.ToString() + " " + StringMgr.Instance.Get("DAYS"));
                        }
                    }
                    else
                    {
                        itemIconTable.IsDraw = false;
                        itemTimeTable.IsDraw = false;
                    }
                }
            }
            scrollBoard.SetListPostion(i);
            scrollBoard.Draw();
            if (boardBack.isClick())
            {
                curBoard = i;
                if (Time.time - lastClickTime < doubleClickTimeout && clickBoard == curBoard)
                {
                    doubleClicked = true;
                }
                else
                {
                    lastClickTime = Time.time;
                    clickBoard    = curBoard;
                }
            }
        }
        scrollBoard.EndScroll();
        if (curBoard >= 0 && curBoard < array.Length)
        {
            TcTItem[] arraySorted = array[curBoard].GetArraySorted();
            scrollRare.ListResetAddPosition();
            itemLine.ResetAddPosition();
            scrollRare.SetListCount(arraySorted.Length);
            scrollRare.BeginScroll();
            for (int j = 0; j < arraySorted.Length; j++)
            {
                TItem tItem2 = TItemManager.Instance.Get <TItem>(arraySorted[j].code);
                if (tItem2 != null)
                {
                    itemName.textKey    = tItem2.name;
                    itemIcon.texImage   = tItem2.CurIcon();
                    itemExplain.textKey = tItem2.comment;
                    if (tItem2.IsAmount)
                    {
                        itemTime.SetText(arraySorted[j].opt.ToString() + " " + StringMgr.Instance.Get("TIMES_UNIT"));
                    }
                    else if (arraySorted[j].opt >= 1000000)
                    {
                        itemTime.SetText(StringMgr.Instance.Get("INFINITE"));
                    }
                    else
                    {
                        itemTime.SetText(arraySorted[j].opt.ToString() + " " + StringMgr.Instance.Get("DAYS"));
                    }
                    if (arraySorted[j].isKey)
                    {
                        itemBackNomal.IsDraw = false;
                        itemBackRare.IsDraw  = true;
                    }
                    else
                    {
                        itemBackNomal.IsDraw = true;
                        itemBackRare.IsDraw  = false;
                    }
                    scrollRare.SetListPostion(j);
                    bool flag = scrollRare.IsSkipAble();
                    if (!flag)
                    {
                        scrollRare.Draw();
                        property.sizeX = size.x - 100f;
                        property.Start();
                        property.tItem = tItem2;
                        TooltipProperty tooltipProperty = property;
                        Vector2         showPosition    = itemName.showPosition;
                        tooltipProperty.categoryPosX = showPosition.x;
                        TooltipProperty tooltipProperty2 = property;
                        Vector2         showPosition2    = itemName.showPosition;
                        tooltipProperty2.categoryPosY = showPosition2.y + 22f;
                        TooltipProperty tooltipProperty3 = property;
                        Vector2         showPosition3    = itemName.showPosition;
                        tooltipProperty3.DoPropertyGuage(showPosition3.y + 2f);
                    }
                    if (j != arraySorted.Length - 1)
                    {
                        if (!flag)
                        {
                            itemLine.Draw();
                        }
                        itemLine.AddPositionY(scrollRare.offSetY);
                    }
                }
            }
            scrollRare.EndScroll();
        }
        if (exit.Draw() || GlobalVars.Instance.IsEscapePressed())
        {
            result = true;
        }
        if ((enter.Draw() || GlobalVars.Instance.IsReturnPressed() || doubleClicked) && curBoard >= 0 && curBoard < array.Length)
        {
            CSNetManager.Instance.Sock.SendCS_TC_ENTER_REQ(array[curBoard].Seq);
        }
        myTokenHave.SetText(MyInfoManager.Instance.Cash.ToString("n0"));
        myCoinHave.SetText(MyInfoManager.Instance.FreeCoin.ToString("n0"));
        myToken.Draw();
        myTokenHave.Draw();
        myCoinHave.Draw();
        if (!ContextMenuManager.Instance.IsPopup)
        {
            WindowUtil.EatEvent();
        }
        GUI.skin = skin;
        return(result);
    }