Esempio n. 1
0
 private void Vm_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
 {
     if (e.PropertyName == "Logs")
     {
         this.UpdateGrid(ref logList, vm.Logs.Count, grid, prefab, (i) => {
             logList[i].init(vm.Logs[i]);
         });
     }
     else if (e.PropertyName == "Logs_End")
     {
         mouthDd.interactable = !autoNowday.isOn;
         yearDd.interactable  = !autoNowday.isOn;
         dayDd.interactable   = !autoNowday.isOn;
         nowbtn.interactable  = !autoNowday.isOn;
         weekbtn.interactable = !autoNowday.isOn;
         if (timeOutCo != null)
         {
             StopCoroutine(timeOutCo);
         }
     }
     else if (e.PropertyName == "Login_Failed")
     {
         MessageLine.Show("登录失败".color("red"));
     }
 }
Esempio n. 2
0
    private void Start()
    {
        Config.loadConfig();
        OpenWindow <MainWindow> ();

        if (!Config.name.valid() || !Config.password.valid())
        {
            OpenDialogWindow <SettingWindow> ();
            MessageLine.Show("请输出帐号和密码");
        }
    }
Esempio n. 3
0
    IEnumerator getLogTimeout()
    {
        yield return(new WaitForSeconds(15));

        MessageLine.Show("请求超时");
        mouthDd.interactable = true;
        yearDd.interactable  = true;
        dayDd.interactable   = true;
        nowbtn.interactable  = true;
        weekbtn.interactable = true;
    }
Esempio n. 4
0
 void close()
 {
     if (window)
     {
         window.FinishWindow();
     }
     else if (exitGame)
     {
         if (exitnow)
         {
             doclose();
         }
         exitnow = true;
         MessageLine.Show("再点一次" + "退出".color("red"), () => exitnow = false);
     }
 }
Esempio n. 5
0
    // HANDLERS

    void OnUpdateTableRow(GUIBase_Widget widget, int rowIndex, int itemIndex)
    {
        MessageLine row = m_MessageLines[rowIndex];

        if (itemIndex < m_Messages.Length)
        {
            Message message = m_Messages[itemIndex];
            bool    active  = m_ActiveMessage == itemIndex ? true : false;

            row.Show();
            row.Update(message, itemIndex, active);
        }
        else
        {
            row.Hide();
        }
    }
Esempio n. 6
0
    IEnumerator getVersion()
    {
        if (Lancher.Instance == null)
        {
            yield break;
        }
        var www = UnityWebRequest.Get(Lancher.Instance.versionUrl);

        yield return(www.Send());

        if (www.isError)
        {
            yield break;
        }
        string raw = www.downloadHandler.text;

        if (!raw.valid())
        {
            yield break;
        }
        Debug.Log(raw);

        var json = MiniJSON.Json.Deserialize(raw) as Dictionary <string, object>;

        if (json.ContainsKey(Lancher.Instance.platform))
        {
            var plat = json[Lancher.Instance.platform] as Dictionary <string, object>;

            // 版本
            if (plat.ContainsKey("version"))
            {
                var ver = plat["version"] as string;
                Debug.Log("version : " + ver.color("red"));
                if (ver != Lancher.Instance.version)
                {
                    // url
                    if (plat.ContainsKey("url"))
                    {
                        var urls = plat["url"] as List <object>;
                        if (urls != null)
                        {
                            for (int i = 0; i < urls.Count; i++)
                            {
                                var hww = UnityWebRequest.Head(urls[i] as string);
                                yield return(hww.Send());

                                if (!hww.isDone || hww.responseCode == 404)
                                {
                                    Debug.Log("Url no existed:" + urls[i].ToString().color("red"));
                                    continue;
                                }

                                base.url  = urls[i] as string;
                                text.text = "更新\n" + ver.color("red");
                                MessageLine.Show("有新版本: " + ver.color("cayn"));
                                Debug.Log("new version url : " + base.url.color("red"));
                                break;
                            }
                        }
                    }
                }
            }
        }

        yield return(new WaitForSeconds(60));

        url = "";
    }