public void ShowTipsById(uint errorid, params object[] args) { table.LocalTextDataBase data = GameTableManager.Instance.GetTableItem <table.LocalTextDataBase>(errorid); if (data != null) { if (string.IsNullOrEmpty(data.text)) { Engine.Utility.Log.Error(string.Format("错误码{0}的内容为空", errorid)); } if (data.dwType != 2) { //if(args.Length >= 1) //{ // if ( args[0].GetType() == typeof( string ) ) // { // name = args[0].ToString(); // } // else // { // int roleID = (int)args[0]; // //先暂时把所有额外参数当错人名处理 后期服务器要改成字符串 add by zhudianyu // IEntitySystem es = ClientGlobal.Instance().GetEntitySystem(); // if ( es != null ) // { // IPlayer en = es.FindEntity<IPlayer>( (uint)roleID ); // if ( en != null ) // { // name = en.GetName(); // } // } // } //} string strOutLog = ""; if (args.Length == 0) { strOutLog = string.Format(data.text, ""); } else { strOutLog = string.Format(data.text, args);; } ShowTips(strOutLog); } else { ShowTipWindow(TipWindowType.Ok, data.text, null); } } else { ShowTips("找不到提示id:" + errorid); } }
void onClick_BtnRepare_Btn(GameObject obj) { /// 这是修复,不是准备 Action agree = delegate { if (Application.platform == RuntimePlatform.Android) { string strPath = Application.persistentDataPath + "/assets/game.version"; System.IO.FileInfo fi = new System.IO.FileInfo(strPath); if (fi.Exists) { fi.Delete(); } } else if (Application.platform == RuntimePlatform.IPhonePlayer) { DelectDir(Application.persistentDataPath); } Application.Quit(); RestartApplication(); }; Action refuse = delegate { }; string des; table.LocalTextDataBase data = GameTableManager.Instance.GetTableItem <table.LocalTextDataBase>(460001); if (data != null) { des = data.text; } else { des = string.Format("当登录界面显示异常,无法登录游戏时,可以尝试进行修复。该操作会清除本地补丁并重新下载,请在良好的网络环境下进行,并注意手动重启客户端"); } TipsManager.Instance.ShowTipWindow(Client.TipWindowType.CancelOk, des, agree, refuse, null, "修复", "进行修复", "取消", 1); }
/// <summary> /// 初始化本地文本 /// </summary> private void InitLocalText() { List <table.LocalTextDataBase> localTxts = GameTableManager.Instance.GetTableList <table.LocalTextDataBase>(); UILocalText.RegisterOnLocalText(GetLocalText); if (null == localTxts || localTxts.Count == 0) { Engine.Utility.Log.Error("读取本地表格错误"); return; } if (null == enumStringDic) { enumStringDic = new Dictionary <string, int>(); } enumStringDic.Clear(); if (null == textDic) { textDic = new Dictionary <int, string>(); } textDic.Clear(); table.LocalTextDataBase ldb = null; for (int i = 0; i < localTxts.Count; i++) { ldb = localTxts[i]; if (null == ldb) { continue; } if (!string.IsNullOrEmpty(ldb.enumString) && !enumStringDic.ContainsKey(ldb.enumString)) { enumStringDic.Add(ldb.enumString, (int)ldb.id); } if (!textDic.ContainsKey((int)ldb.id)) { textDic.Add((int)ldb.id, ldb.text); } } }
void OnEvent(int nEventid, object param) { if (nEventid == (int)Client.GameEventID.TIPS_EVENT) { stTipsEvent en = (stTipsEvent)param; table.LocalTextDataBase db = GameTableManager.Instance.GetTableItem <table.LocalTextDataBase>(en.errorID); if (db != null) { TipsManager.Instance.ShowLocalFormatTips((LocalTextType)en.errorID, en.tips); } else { if (en.errorID != 0) { TipsManager.Instance.ShowTipsById(en.errorID); } } } else if (nEventid == (int)Client.GameEventID.RECONNECT_SUCESS) { } }