示例#1
0
    public static string GetLangDesc(string textid)
    {
        Global.COUNTRYCODE code = UnityUtil.GetEnumByStringNonError <Global.COUNTRYCODE>(GetLocalCode());

        switch (code)
        {
        case Global.COUNTRYCODE.KO:
        {
            RandomWarsResource.Data.TDataLangKO tDataLangKO;
            if (TableManager.Get().LangKO.GetData(text => String.Compare(text.name, textid, StringComparison.Ordinal) == 0, out tDataLangKO))
            {
                return(tDataLangKO.textDesc);
            }
            else
            {
                return($"KO {textid}");
            }
        }

        default:
        {
            RandomWarsResource.Data.TDataLangEN tDataLangEN;
            if (TableManager.Get().LangEN.GetData(text => String.Compare(text.name, textid, StringComparison.Ordinal) == 0, out tDataLangEN))
            {
                return(tDataLangEN.textDesc);
            }
            else
            {
                return($"EN {textid}");
            }
        }
        }
    }
示例#2
0
    public void Click_Button(int num)
    {
        Global.COUNTRYCODE c = (Global.COUNTRYCODE)num;

        if (c.ToString() == ObscuredPrefs.GetString("CountryCode"))
        {
            return;
        }

        UI_Main.Get().commonMessageBoxPopup.Initialize("Language change", "Change and restart game?", "Change", null, () =>
        {
            ObscuredPrefs.SetString("CountryCode", c.ToString());
            GameStateManager.Get().ChangeScene(Global.E_GAMESTATE.STATE_START);
        });
    }