예제 #1
0
        // Update 每帧调用一次
        override public void Update()
        {
            if (!_bStartUp)
            {
                return;
            }

            base.Update();


            int ok_step = _applicationMgr.InitOkStep;

            if (ApplicationMgr._bInitOK || ok_step == -1)//未开始初始化,或已完成
            {
                UtilTools.SetServerListTip("");
            }
            else
            {
                if (ok_step == 1)
                {
                    float  process = ConfigDataMgr.getInstance().GetConfigLoadProcess();
                    string tips    = GameText.Format("initingLoadXml", Mathf.FloorToInt(process * 100).ToString());
                    UtilTools.SetServerListTip(tips, true, process);
                }
                else if (ok_step == 4)
                {
                    //UtilTools.SetServerListTip(GameText.GetStr("loadingServerList"));
                }
                else if (ok_step == 5)
                {
                    UtilTools.SetServerListTip(GameText.GetStr("loadingNotice"), false, 1f);
                }
            }

            if (ApplicationMgr._bInitOK)
            {
                if (_startUpStep == 1)
                {
                    StartUp_step2();
                }
                else if (_startUpStep == 2 && AssetManager.IsPreLoadComplete())
                {
                    StartUp_step3();
                }
                else if (_startUpStep == 3 && GameDataMgr.LOGIN_DATA.IsConnectGamerServer)
                {
                    /*MainCityController cont = UIManager.GetControler<MainCityController>();
                     * if (cont.IsActive)
                     * {
                     *  StartUp_step4();
                     * }*/
                    StartUp_step4();
                }
                else if (_startUpStep == 4 && GameDataMgr.LOGIN_DATA.IsLoginGameServer)
                {
                    StartUp_step5();
                }
            }
        }
예제 #2
0
 void Update()
 {
     if (_coolSec > 0)
     {
         coolText.text = GameText.Format("auto_back", endTime - UtilTools.GetServerTime());
         _coolSec      = endTime - UtilTools.GetServerTime();
         if (_coolSec <= 0)
         {
             OnClickOKButton(null);
         }
     }
 }
예제 #3
0
 private bool ErrorTip(string action, string code, string content)
 {
     if (!code.Equals("0"))
     {
         UtilTools.PlaySoundEffect("Sounds/UISound/error");
         string errorCode = GameText.Format("login_errorCode", code);
         UtilTools.ErrorMessageDialog(content + errorCode);
         return(false);
     }
     else
     {
         return(true);
     }
 }
예제 #4
0
    private string timeStr(int ts)
    {
        string timeS = "";

        if (type == 0)
        {
            int leftday  = ts / 86400;
            int lefthour = (ts - 86400 * leftday) / 3600;
            timeS = GameText.Format("mail_desc1", leftday, lefthour);
        }
        else if (type == 1)
        {
            TimeSpan timeSpan = new TimeSpan(0, 0, ts);
            timeS = string.Format("{0:T}", timeSpan);
        }
        return(timeS);
    }
예제 #5
0
    /// <summary>
    /// 排队时间
    /// </summary>
    /// <param name="currNum">排队总人数</param>
    private void WaitTime(uint currNum)
    {
        if (currNum <= 0)
        {
            return;
        }
        uint totalSec = (currNum + 300) / _speed;
        uint hour     = totalSec / 3600;

        if (hour <= 0)
        {
            hour = 0;
        }
        uint minute = (totalSec - hour * 3600) / 60;

        timeLabel.text = GameText.Format("queueTimeLabel", hour, minute);
    }
예제 #6
0
 void Update()
 {
     if (_bUpdateCooldwon)
     {
         int cur_time = UtilTools.GetClientTime();
         if (_ctrl.cooldownEndTime == 0) //未赋值
         {
             SetVerifyShow(false);
         }
         else if (_ctrl.cooldownEndTime - cur_time <= 0) //倒计时结束
         {
             SetVerifyShow(false);
             _ctrl.cooldownEndTime = 0;
             _bUpdateCooldwon      = false;
         }
         else //倒计时
         {
             SetVerifyShow(true);
             _btnGetverifyCodeLb.text = GameText.Format("verify_wait", _ctrl.cooldownEndTime - cur_time);
         }
     }
 }
예제 #7
0
 void Update()
 {
     if (_bUpdateCooldwon && _resetPassWordContainer.activeSelf)
     {
         int cur_time = UtilTools.GetClientTime();
         if (_registerBindingCtrl.cooldownEndTime == 0) //未赋值
         {
             SetVerifyShow(false);
         }
         else if (_registerBindingCtrl.cooldownEndTime - cur_time <= 0) //倒计时结束
         {
             SetVerifyShow(false);
             _registerBindingCtrl.cooldownEndTime = 0;
             _bUpdateCooldwon = false;
         }
         else //倒计时
         {
             SetVerifyShow(true);
             _getVerificationGrayLb.text =
                 GameText.Format("verify_wait", _registerBindingCtrl.cooldownEndTime - cur_time);
         }
     }
 }
예제 #8
0
    private void OnEventSetText(EventMultiArgs args)
    {
        string text      = args.GetArg <string>("text");
        string icon      = args.GetArg <string>("icon");
        string iconNum   = args.GetArg <string>("iconNum");
        string alignment = args.GetArg <string>("alignment");

        //string type = args.GetArg<string>("moneyKey");

        labelTipText.text = text;
        if (icon.Equals("C104"))
        {
            labelTitleText.text = GameText.Format("message_desc2", iconNum);
        }
        else if (icon.Equals("C101"))
        {
            labelTitleText.text = GameText.Format("message_desc3", iconNum);
        }
        else if (icon.Equals("C102"))
        {
            labelTitleText.text = GameText.Format("message_desc5", iconNum);
        }
        else
        {
            labelTitleText.text = GameText.Format("message_desc3", iconNum);
        }
        UIWidget uiWidget = labelTipText.GetComponent <UIWidget>();

        if (alignment == "Center")
        {
            uiWidget.pivot = UIWidget.Pivot.Top;
        }
        else if (alignment == "Left")
        {
            uiWidget.pivot = UIWidget.Pivot.TopLeft;
        }
    }
예제 #9
0
    /// <summary>
    /// 显示提示窗口
    /// </summary>
    /// <param name="text">提示内容</param>
    /// <param name="icon">游戏币图标名称</param>
    /// <param name="iconNum">游戏币数量</param>
    /// <param name="alignment">"Left" "Center"</param>
    /// <param name="okCallbackFunc"></param>
    /// <param name="cancelCallbackFunc"></param>
    public void ShowMessageDialog(string text, MoneyType _type, string iconNum, string alignment, DelegateType.MessageDialogUseMoneyCallBack okCallbackFunc, DelegateType.MessageDialogUseMoneyCallBack cancelCallbackFunc, UseType useType)
    {
        EventMultiArgs args = new EventMultiArgs();

        useflag = useType;
        args.AddArg("text", text);
        args.AddArg("iconNum", iconNum);
        args.AddArg("alignment", alignment);
        string icon = "C100";

        switch (_type)
        {
        case MoneyType.GLOD:
            icon     = "C102";
            moneyKey = 102;
            if (GameDataMgr.PLAYER_DATA.Gold >= ulong.Parse(iconNum))
            {
                isEnough = true;
            }
            else
            {
                isEnough = false;
            }
            break;

        case MoneyType.DIAMOND:
            icon     = "C104";
            moneyKey = 104;
            if (GameDataMgr.PLAYER_DATA.Diamond >= int.Parse(iconNum))
            {
                isEnough = true;
            }
            else
            {
                isEnough = false;
            }
            break;

        case MoneyType.SILVER:
            icon     = "C101";
            moneyKey = 101;
            if (GameDataMgr.PLAYER_DATA.Gold >= ulong.Parse(iconNum))
            {
                isEnough = true;
            }
            else
            {
                isEnough = false;
            }
            break;
        }
        if (!isEnough)
        {
            ItemBaseConfigItem item = ConfigDataMgr.getInstance().ItemBaseConfig.GetDataByKey(moneyKey);
            if (item != null)
            {
                UtilTools.MessageDialog(GameText.Format("message_desc4", item.name));
            }
            return;
        }
        okCallback     = okCallbackFunc;
        cancelCallback = cancelCallbackFunc;
        if (useType != UseType.DefaultType)
        {
            string flag = PlayerPrefs.GetString("CheckIsShow" + (int)useType);
            if (!string.IsNullOrEmpty(flag))
            {
                if (flag == "1")
                {
                    OnClickOK();
                    return;
                }
            }
        }
        UIManager.CreateWinByAction(UIName.MESSAGE_DIALOG_USE_MONEY);
        args.AddArg("icon", icon);

        //int callbackCount = 0;
        //if (okCallback != null)
        //    callbackCount += 1;
        //if (cancelCallback != null)
        //    callbackCount += 1;
        //args.AddArg("callbackCount", callbackCount);

        CallUIEvent(UIEventID.MESSAGE_DIALOG_SET_TEXT, args);
    }
예제 #10
0
 // Use this for initialization
 void Start()
 {
     _desc.text = GameText.Format("relife_desc1", controller._getCount);
 }
예제 #11
0
    void OnEventSetText(EventMultiArgs args)
    {
        string text          = args.GetArg <string>("text");
        string color         = args.GetArg <string>("color");
        string alignment     = args.GetArg <string>("alignment");
        int    callbackCount = args.GetArg <int>("callbackCount");
        string okBtnName     = args.GetArg <string>("okBtnName");

        _coolSec = args.GetArg <int>("closeSecond");
        bool isShowCloseBtn = args.GetArg <bool>("showClose");

        string toShowText = "[" + color + "]" + text + "[-]";

        UIWidget uiWidget = labelTipText.GetComponent <UIWidget>();

        if (alignment == "Center")
        {
            uiWidget.pivot = UIWidget.Pivot.Top;
        }
        else if (alignment == "Left")
        {
            uiWidget.pivot = UIWidget.Pivot.TopLeft;
        }
        if (_coolSec > 0)
        {
            coolText.text = GameText.Format("auto_back", _coolSec);
            endTime       = UtilTools.GetServerTime() + _coolSec;
        }
        labelTipText.text      = toShowText;
        labelTipText.alignment = (labelTipText.printedSize.y > labelTipText.defaultFontSize + labelTipText.spacingY) ? NGUIText.Alignment.Left : NGUIText.Alignment.Automatic;
        if (alignment == "CenterAll")
        {
            uiWidget.pivot         = UIWidget.Pivot.Top;
            labelTipText.alignment = NGUIText.Alignment.Automatic;
        }
        if (okBtnName != "")
        {
            oKButton.Find("Label").GetComponent <UILabel>().text = okBtnName;
        }
        if (callbackCount == 0)
        {
            cancelButton.gameObject.SetActive(false);
        }
        else
        {
            cancelButton.gameObject.SetActive(true);
        }
        closeButton.gameObject.SetActive(isShowCloseBtn);
        //if (title == "default")
        //    title = GameText.GetStr("messageDialog_tip");

        //labelTitleText.text = title;

        /*
         * if (controller.needCloseButton)
         * {
         *  closeButton.gameObject.SetActive(true);
         * }
         * else
         * {
         *  closeButton.gameObject.SetActive(false);
         * }*/
    }
예제 #12
0
 static public int Format_s(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (argc == 1)
         {
             System.String a1;
             checkType(l, 1, out a1);
             var ret = GameText.Format(a1);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         else if (matchType(l, argc, 1, typeof(string), typeof(object[])))
         {
             System.String a1;
             checkType(l, 1, out a1);
             System.Object[] a2;
             checkParams(l, 2, out a2);
             var ret = GameText.Format(a1, a2);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         else if (matchType(l, argc, 1, typeof(string), typeof(System.Object)))
         {
             System.String a1;
             checkType(l, 1, out a1);
             System.Object a2;
             checkType(l, 2, out a2);
             var ret = GameText.Format(a1, a2);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         else if (argc == 3)
         {
             System.String a1;
             checkType(l, 1, out a1);
             System.Object a2;
             checkType(l, 2, out a2);
             System.Object a3;
             checkType(l, 3, out a3);
             var ret = GameText.Format(a1, a2, a3);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         else if (argc == 4)
         {
             System.String a1;
             checkType(l, 1, out a1);
             System.Object a2;
             checkType(l, 2, out a2);
             System.Object a3;
             checkType(l, 3, out a3);
             System.Object a4;
             checkType(l, 4, out a4);
             var ret = GameText.Format(a1, a2, a3, a4);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function to call");
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
예제 #13
0
 /// <summary>
 /// 中间信息
 /// </summary>
 /// <param name="totalRank">排队人数</param>
 private void SetCenterMsg(uint total)
 {
     descLabel.text = GameText.Format("queueCenterLabel", total);
 }