示例#1
0
        //public

        //private
        protected override void OnEnter()
        {
            ServiceLocator.ProvideService(typeof(GameDoorRegistry));

            loadingText   = new TextBox(new Font(FontUtil.GetFont("pixel"), 18.0f, FontStyle.Regular), "Load'n");
            loadingText.X = Window.Width / 2.0d - loadingText.Width / 2.0d;
            loadingText.Y = Window.Height / 2.0d - loadingText.Height / 2.0d;
            AddChild(loadingText);
        }
示例#2
0
    private void GetLangStrByID(uint id, TextWrap txtw, params object[] args)
    {
        LanguageConfig config;

        if (!m_LanDic.TryGetValue(id, out config))
        {
            Debuger.LogError(Tag, string.Empty, "language id not exist " + id);
            txtw.Txt.text = string.Empty;
            return;
        }
        txtw.ID     = id;
        txtw.Config = config;
        sb.Clear();
        switch (GameConfig.Language)
        {
        case LangType.zh_Hans:
            sb.Append(config.Cn);
            break;

        case LangType.en:
            sb.Append(config.En);
            break;

        default:
            break;
        }
        if (config.Count > 0)
        {
            string tempstr;
            try
            {
                tempstr   = string.Format(sb.ToString(), args);
                txtw.args = args;
            }
            catch (System.Exception e)
            {
                tempstr = string.Empty;
                Debuger.LogError(Tag, "GetLangStrByID", e.Message);
            }
            txtw.Txt.text = tempstr;
        }
        txtw.Txt.text     = sb.ToString();
        txtw.Txt.fontSize = (int)txtw.Config.Fontsize[(int)GameConfig.Language];
        txtw.Txt.font     = FontUtil.GetFont(txtw.Config.Fonttype[(int)GameConfig.Language]);
    }
示例#3
0
        public override void OnViewMessageReceived(string key, object obj)
        {
            switch (key)
            {
            case CoreSettings.LoadResources:
                Task.Run(async() => {
                    this.LoadingMessageHUD = "Syncing data with server...";
                    this.IsLoadingHUD      = true;
                    CurrentTodoList        = await this.TodoLogic.GetAllByCurrentUser().ToObservable();
                    DataExists             = CurrentTodoList.Count > 0 ? true : false;
                    this.IsLoadingHUD      = false;
                    EmptyDataIcon          = FontUtil.GetFont("fa-frown-o", FontType.FontAwesome);
                    await this.HubCommunication.StartListening();
                });
                break;

            case CoreSettings.DataUpdated:
                Task.Run(async() => {
                    CurrentTodoList = await this.TodoLogic.GetAllByCurrentUser().ToObservable();
                    DataExists      = CurrentTodoList.Count > 0 ? true : false;
                });
                break;
            }
        }
示例#4
0
    private void SetSelectedLang(TextWrap txtw)
    {
        sb.Clear();
        LanguageConfig config = txtw.Config;

        switch (GameConfig.Language)
        {
        case LangType.zh_Hans:
            sb.Append(config.Cn);
            break;

        case LangType.en:
            sb.Append(config.En);
            break;

        default:
            break;
        }
        if (txtw.args != null)
        {
            string tempstr;
            try
            {
                tempstr = string.Format(sb.ToString(), txtw.args);
            }
            catch (System.Exception e)
            {
                tempstr = string.Empty;
                Debuger.LogError(Tag, "GetLangStrByID", e.Message);
            }
            txtw.Txt.text = tempstr;
        }
        txtw.Txt.text     = sb.ToString();
        txtw.Txt.fontSize = (int)txtw.Config.Fontsize[(int)GameConfig.Language];
        txtw.Txt.font     = FontUtil.GetFont(txtw.Config.Fonttype[(int)GameConfig.Language]);
    }