Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
| | |
| | | get { return _modelInterface ?? (_modelInterface = ModelCenter.Instance.GetModel<PackModelInterface>()); }
|
| | | }
|
| | |
|
| | | PlayerPackModel playerPack { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
|
| | |
|
| | | ItemAttrData itemAttrData;
|
| | |
|
| | |
|
| | |
| | | foreach (ItemWinBtnType key in itemAttrData.tipsFuncBtnDic.Keys)
|
| | | {
|
| | | Button btn = OnGUIButton(btnGroup.gameObject, operateBtn, key.ToString(), Language.Get(StringUtility.Contact("ItemHandle_", key.ToString())));
|
| | | if(itemAttrData.guid == playerPack.lookItemGUID && playerPack.lookLineIndex != -1)
|
| | | {
|
| | | switch (key)
|
| | | {
|
| | | case ItemWinBtnType.putOn:
|
| | |
| | | }
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | btn.RemoveAllListeners();
|
| | | btn.onClick.AddListener(() => {
|
| | |
| | | if (string.IsNullOrEmpty(guid) || guid == "")
|
| | | {
|
| | | lookLineIndex = -1;
|
| | | lookItemGUID = "";
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | return;
|
| | | }
|
| | | int error = 0;
|
| | | if (!SatisfyNameLength(userNameInput.text, out error))
|
| | | if (!UIHelper.SatisfyNameLength(userNameInput.text, out error))
|
| | | {
|
| | | switch (error)
|
| | | {
|
| | |
| | | private void RemoveRoleModel()
|
| | | {
|
| | | m_CreateRoleShow.Dispose();
|
| | | }
|
| | |
|
| | | public bool SatisfyNameLength(string name, out int error)
|
| | | {
|
| | | error = 0;
|
| | | bool pureChinese = Regex.IsMatch(name, "^[\u4e00-\u9fa5]+$");
|
| | | if (pureChinese)
|
| | | {
|
| | | if (name.Length > 5)
|
| | | {
|
| | | error = 1;
|
| | | }
|
| | | else if (name.Length < 2)
|
| | | {
|
| | | error = 2;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (name.Length > 6)
|
| | | {
|
| | | error = 1;
|
| | | }
|
| | | else if (name.Length < 3)
|
| | | {
|
| | | error = 2;
|
| | | }
|
| | | }
|
| | | return error == 0;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | send.Extra = "";
|
| | | break;
|
| | | case VersionAuthority.Release:
|
| | | send.Extra = string.Format("{0}|{1}",VersionConfig.Get().appId,VersionConfig.Get().SpID);
|
| | | send.Extra = VersionConfig.Get().SpID;
|
| | | send.ExtraLen = (byte)send.Extra.Length;
|
| | | if (SDKUtility.Instance.ChannelPlatform == SDKUtility.E_ChannelPlatform.Free)
|
| | | {
|
| | |
| | | }
|
| | |
|
| | | int error = 0;
|
| | | if (!SatisfyNameLength(renameInput.text, out error))
|
| | | if (!UIHelper.SatisfyNameLength(renameInput.text, out error))
|
| | | {
|
| | | switch (error)
|
| | | {
|
| | |
| | | });
|
| | |
|
| | | }
|
| | |
|
| | | public bool SatisfyNameLength(string name, out int error)
|
| | | {
|
| | | error = 0;
|
| | | bool pureChinese = Regex.IsMatch(name, "^[\u4e00-\u9fa5]+$");
|
| | | if (pureChinese)
|
| | | {
|
| | | if (name.Length > 5)
|
| | | {
|
| | | error = 1;
|
| | | }
|
| | | else if (name.Length < 2)
|
| | | {
|
| | | error = 2;
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (name.Length > 6)
|
| | | {
|
| | | error = 1;
|
| | | }
|
| | | else if (name.Length < 3)
|
| | | {
|
| | | error = 2;
|
| | | }
|
| | | }
|
| | | return error == 0;
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | | }
|
| | |
| | | content = content.Replace(" ", string.Empty);
|
| | | return content;
|
| | | }
|
| | |
|
| | | public static bool SatisfyNameLength(string name, out int error)
|
| | | {
|
| | | error = 0;
|
| | | bool pureChinese = Regex.IsMatch(name, "^[\u4e00-\u9fa5]+$");
|
| | | var chsCount = GetChsCount(name);
|
| | | var maxlength = pureChinese ? 5 : chsCount > 0 ? 6 : 8;
|
| | | var minlength = pureChinese ? 2 : 3;
|
| | | if (name.Length > maxlength)
|
| | | {
|
| | | error = 1;
|
| | | }
|
| | | else if (name.Length < minlength)
|
| | | {
|
| | | error = 2;
|
| | | }
|
| | | return error == 0;
|
| | | }
|
| | |
|
| | | public static int GetChsCount(string name)
|
| | | {
|
| | | var count = 0;
|
| | | for (int i = 0; i < name.Length; i++)
|
| | | {
|
| | | if (Regex.IsMatch(name[i].ToString(), "[\u4e00-\u9fa5]"))
|
| | | {
|
| | | count++;
|
| | | }
|
| | | }
|
| | | return count;
|
| | | }
|
| | | }
|