Esempio n. 1
0
    public override bool DoDialog()
    {
        bool    result = false;
        GUISkin skin   = GUI.skin;

        GUI.skin = GUISkinFinder.Instance.GetGUISkin();
        LabelUtil.TextOut(crdTitle, StringMgr.Instance.Get("CONFIRM_BUY"), "BigLabel", GlobalVars.Instance.txtMainColor, GlobalVars.txtEmptyColor, TextAnchor.UpperCenter);
        ShowGood();
        string str = string.Empty;

        if (autoChargeConfirm.Length > 0 && !BuildOption.Instance.IsNetmarble && !BuildOption.Instance.IsDeveloper)
        {
            str = autoChargeConfirm + " ";
        }
        str += StringMgr.Instance.Get("ARE_YOU_SURE_BUY");
        GUI.Label(crdSure, str, "Label");
        if (tItem.IsEquipable)
        {
            wasEquip = GUI.Toggle(crdToggle, wasEquip, StringMgr.Instance.Get("CHECK_DIRECT_EQUIP"));
        }
        if (GlobalVars.Instance.MyButton(crdBuy, StringMgr.Instance.Get("OK"), "BtnAction") || GlobalVars.Instance.IsReturnPressed())
        {
            if (cantBuy)
            {
                MessageBoxMgr.Instance.AddMessage(StringMgr.Instance.Get("NOT_ENOUGH_MONEY"));
            }
            else
            {
                if (rebuy < 0)
                {
                    CSNetManager.Instance.Sock.SendCS_BUY_ITEM_REQ(good.tItem.code, (int)buyHow, good.GetOption(selected, buyHow), good.IsAmount, wasEquip);
                }
                else
                {
                    CSNetManager.Instance.Sock.SendCS_REBUY_ITEM_REQ(rebuy, good.tItem.code, (int)buyHow, good.GetOption(selected, buyHow), good.IsAmount, wasEquip);
                }
                result = true;
            }
        }
        if (GlobalVars.Instance.MyButton(crdCloseBtn, string.Empty, "BtnClose") || GlobalVars.Instance.IsEscapePressed())
        {
            result = true;
        }
        GUI.skin = skin;
        if (!ContextMenuManager.Instance.IsPopup)
        {
            WindowUtil.EatEvent();
        }
        return(result);
    }
Esempio n. 2
0
    public override bool DoDialog()
    {
        bool    result = false;
        GUISkin skin   = GUI.skin;

        GUI.skin = GUISkinFinder.Instance.GetGUISkin();
        LabelUtil.TextOut(crdTitle, StringMgr.Instance.Get("CONFIRM_BUY"), "BigLabel", GlobalVars.Instance.txtMainColor, GlobalVars.txtEmptyColor, TextAnchor.UpperCenter);
        ShowPresent();
        string str = string.Empty;

        if (autoChargeConfirm.Length > 0)
        {
            str = autoChargeConfirm + " ";
        }
        str += string.Format(StringMgr.Instance.Get("ARE_YOU_SURE_PRESENT"), receiver);
        GUI.Label(crdSure, str, "Label");
        if (GlobalVars.Instance.MyButton(crdPresent, StringMgr.Instance.Get("PRESENT"), "BtnAction") || GlobalVars.Instance.IsReturnPressed())
        {
            CSNetManager.Instance.Sock.SendCS_PRESENT_ITEM_REQ(tItem.code, (int)buyHow, good.GetOption(selected, buyHow), receiver, title, contents);
            result = true;
        }
        if (GlobalVars.Instance.MyButton(crdCloseBtn, string.Empty, "BtnClose") || GlobalVars.Instance.IsEscapePressed())
        {
            result = true;
        }
        GUI.skin = skin;
        if (!ContextMenuManager.Instance.IsPopup)
        {
            WindowUtil.EatEvent();
        }
        return(result);
    }