From bd41d84bbd61de37bd880c591ecce690ebe294bd Mon Sep 17 00:00:00 2001 From: hch <305670599@qq.com> Date: 星期日, 19 十月 2025 18:12:49 +0800 Subject: [PATCH] 65 子 【公会】基础主体 / 【公会】基础主体-客户端 --- Main/Utility/UIHelper.cs | 28 ++++++++++++++++++++++++++-- 1 files changed, 26 insertions(+), 2 deletions(-) diff --git a/Main/Utility/UIHelper.cs b/Main/Utility/UIHelper.cs index 6757b45..4365874 100644 --- a/Main/Utility/UIHelper.cs +++ b/Main/Utility/UIHelper.cs @@ -325,6 +325,13 @@ return false; } + // 妫�鏌ュ瓧绗︿覆鏄笉鏄函鏁存暟 + public static bool IsNumeric(string input) + { + return int.TryParse(input, out _); + } + + public static string GetColorNameByItemColor(int itemColor) { switch (itemColor) @@ -1256,13 +1263,15 @@ return content; } + //妫�鏌ュ悕瀛楅暱搴︼紝鐜╁鍚嶅拰鍏細鍚� + //涓嶅悓鍥藉闀垮害涓嶅悓锛屾帓鐗堜笉鍚� public static bool SatisfyNameLength(string name, out int error) { error = 0; //bool pureChinese = Regex.IsMatch(name, "^[\u4e00-\u9fa5]+$"); //var chsCount = GetChsCount(name); int length = Encoding.Default.GetBytes(name).Length; - var maxlength = 20; + var maxlength = 14; //绾腑鏂囦笉寤鸿瓒呰繃7涓瓧 var minlength = 3; if (length > maxlength) { @@ -1362,9 +1371,24 @@ public static string RemoveColor(string content) - { + { content = WordAnalysis.Color_Start_Regex.Replace(content, string.Empty); content = WordAnalysis.Color_End_Regex.Replace(content, string.Empty); return content; } + + //澶嶅埗鍒板壀璐存澘 + // TODO 鏆備笉鏀寔web鍚庣画琛ュ厖 + public static void CopyToClipboard(string text) + { + GUIUtility.systemCopyBuffer = text; + Debug.Log("鏂囧瓧宸插鍒跺埌鍓创鏉�: " + text); + } + + //鑾峰彇鍓垏鏉垮唴瀹� + public static string GetClipboardText() + { + return GUIUtility.systemCopyBuffer; + } + } -- Gitblit v1.8.0