예제 #1
0
    public override bool DoDialog()
    {
        bool    result = false;
        GUISkin skin   = GUI.skin;

        GUI.skin = GUISkinFinder.Instance.GetGUISkin();
        imgList.Draw();
        labelList.Draw();
        if (exit.Draw())
        {
            result = true;
        }
        scrollView.SetListCount(benefitList.Count);
        scrollView.BeginScroll();
        for (int i = 0; i < benefitList.Count; i++)
        {
            itemIcon.texImage = benefitList[i].texImage;
            itemText.textKey  = benefitList[i].textKey;
            scrollView.SetListPostion(i);
            scrollView.Draw();
        }
        scrollView.EndScroll();
        if (!ContextMenuManager.Instance.IsPopup)
        {
            WindowUtil.EatEvent();
        }
        GUI.skin = skin;
        return(result);
    }
예제 #2
0
    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);
    }
예제 #3
0
    public override bool DoDialog()
    {
        bool    result = false;
        GUISkin skin   = GUI.skin;

        GUI.skin = GUISkinFinder.Instance.GetGUISkin();
        imgList.Draw();
        labelList.Draw();
        ok.Draw();
        exit.Draw();
        BrickManDesc[] array = BrickManManager.Instance.ToDescriptorArray();
        scrollNameList.SetListCount(array.Length);
        scrollNameList.BeginScroll();
        for (int i = 0; i < array.Length; i++)
        {
            int level = XpManager.Instance.GetLevel(array[i].Xp);
            rankMark.texImage = XpManager.Instance.GetBadge(level, array[i].Rank);
            name.SetText(array[i].Nickname);
            if (currentSelect == i)
            {
                selected.IsDraw = true;
            }
            else
            {
                selected.IsDraw = false;
            }
            scrollNameList.SetListPostion(i);
            scrollNameList.Draw();
            if (backButton.isClick())
            {
                currentSelect = i;
            }
        }
        scrollNameList.EndScroll();
        curse.Draw();
        hackTool.Draw();
        noManner.Draw();
        etc.Draw();
        if (exit.isClick() || GlobalVars.Instance.IsEscapePressed())
        {
            result = true;
        }
        if (ok.isClick())
        {
            int reason = GetReason();
            if (reason == 0)
            {
                SystemMsgManager.Instance.ShowMessage(StringMgr.Instance.Get("KICK_VOTE_MESSAGE17"));
            }
            else
            {
                CSNetManager.Instance.Sock.SendCS_START_KICKOUT_VOTE_REQ(array[currentSelect].Seq, reason);
                result = true;
            }
        }
        if (!ContextMenuManager.Instance.IsPopup)
        {
            WindowUtil.EatEvent();
        }
        GUI.skin = skin;
        return(result);
    }
예제 #4
0
    public override bool DoDialog()
    {
        bool    result = false;
        GUISkin skin   = GUI.skin;

        GUI.skin = GUISkinFinder.Instance.GetGUISkin();
        imgList.Draw();
        labelList.Draw();
        if (inviteSetUp.Draw())
        {
            InviteManager.Instance.RemoveAll();
            SettingDialog settingDialog = (SettingDialog)DialogManager.Instance.Popup(DialogManager.DIALOG_INDEX.SETTING, exclusive: true);
            if (settingDialog != null)
            {
                settingDialog.InitDialog();
                settingDialog.SetTab(5);
            }
        }
        if (allRejection.Draw())
        {
            InviteManager.Instance.RemoveAll();
        }
        if (exit.Draw() || btnClose.Draw())
        {
            InviteManager.Instance.RemoveAll();
            result = true;
        }
        List <Invite> listInvite = InviteManager.Instance.listInvite;

        scrollView.SetListCount(listInvite.Count);
        scrollView.BeginScroll();
        for (int i = 0; i < listInvite.Count; i++)
        {
            Channel channel = ChannelManager.Instance.Get(listInvite[i].channelIndex);
            if (channel != null)
            {
                string text = string.Format(StringMgr.Instance.Get("INVITE_MESSAGE"), listInvite[i].invitorNickname, channel.Name, Room.Type2String(listInvite[i].mode));
                inviteText.SetText(text);
            }
            scrollView.SetListPostion(i);
            scrollView.Draw();
            if (go.isClick())
            {
                Compass.Instance.SetDestination(Compass.DESTINATION_LEVEL.ROOM, listInvite[i].channelIndex, listInvite[i].roomNo, listInvite[i].pswd);
                InviteManager.Instance.RemoveAll();
                result = true;
            }
            if (no.isClick())
            {
                InviteManager.Instance.Remove(listInvite[i].invitorSeq);
                GlobalVars.Instance.clanSendJoinREQ = -1;
            }
        }
        scrollView.EndScroll();
        if (!ContextMenuManager.Instance.IsPopup)
        {
            WindowUtil.EatEvent();
        }
        GUI.skin = skin;
        return(result);
    }