Jump to content

haosura

Members
  • Posts

    8
  • Joined

  • Last visited

Everything posted by haosura

  1. I have solve the problem above, this is new source code for TextBox update. I make a recognize to find which text should be replaced and delete them first. This source is for Vietnamese. If u are using other languages, update the RemoveUnicode() with ur alphabet table. public static char RemoveUnicode(char chr) { string text2 = chr.ToString(); string[] arr1 = new string[] { "á", "à", "ả", "ã", "ạ", "â", "ấ", "ầ", "ẩ", "ẫ", "ậ", "ă", "ắ", "ằ", "ẳ", "ẵ", "ặ", "đ", "é","è","ẻ","ẽ","ẹ","ê","ế","ề","ể","ễ","ệ", "í","ì","ỉ","ĩ","ị", "ó","ò","ỏ","õ","ọ","ô","ố","ồ","ổ","ỗ","ộ","ơ","ớ","ờ","ở","ỡ","ợ", "ú","ù","ủ","ũ","ụ","ư","ứ","ừ","ử","ữ","ự", "ý","ỳ","ỷ","ỹ","ỵ",}; string[] arr2 = new string[] { "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "d", "e","e","e","e","e","e","e","e","e","e","e", "i","i","i","i","i", "o","o","o","o","o","o","o","o","o","o","o","o","o","o","o","o","o", "u","u","u","u","u","u","u","u","u","u","u", "y","y","y","y","y",}; for (int i = 0; i < arr1.Length; i++) { text2 = text2.Replace(arr1[i], arr2[i]); text2 = text2.Replace(arr1[i].ToUpper(), arr2[i].ToUpper()); } char res = char.Parse(text2); return res; } /// <summary> /// Handler for character input event. /// </summary> /// <param name="chr">Character typed.</param> /// <returns> /// True if handled. /// </returns> protected override bool OnChar(char chr) { base.OnChar(chr); if (chr == '\t') { return false; } if (chr >= (char)230) { char chrFind = RemoveUnicode(chr); //using (StreamWriter writetext = new StreamWriter("D:\\TEMP\\WriteLines.txt", true)) //{ //writetext.WriteLine(Text); //} int i; for (i = mCursorPos; i > 0; i--) { //using (StreamWriter writetext = new StreamWriter("D:\\TEMP\\WriteLines.txt", true)) //{ //writetext.WriteLine(Text[i-1]); //} char checkChr = Text[i-1]; if (checkChr == ' ') { i = mCursorPos+1; break; } char checkChrNormalize = RemoveUnicode(checkChr); if (chrFind == checkChrNormalize) break; } if (i>0&&i<= mCursorPos) { //using (StreamWriter writetext = new StreamWriter("D:\\TEMP\\WriteLines.txt", true)) //{ //writetext.WriteLine(Text[i-1]+' '+ i.ToString() + ' ' + Text.Length.ToString()); //} DeleteText(i-1, Text.Length-i+1); } // for (int j = i-1; j < Text.Length; j++) OnKeyBackspace(true); //return false; } InsertText(chr.ToString()); return true; }
  2. I want to ask if we can change all Input Box (chatbox, name box) into basic window Text Box or something already available. Because custom Chat Box conflict with Unicode Inputer. Example when I want to input "á". The inputer must delete "a" then replace with "á" but current chat box may steal SendMessage or PostMessage of inputer, so it return "aá", for double Unicode like "toán" it's become "toanán". The only way to input Unicode I can use now is copy paste from Notepad. If u can input Unicode, pls suggest for me some inputer working well here pls.
  3. Oh, thanks a lot, it solve my headache.
  4. I try to make fogs resource like this image, u can see the right side must connect to left side, the bottom must connect to top, it's hard to make this by just normal drawing tool, what drawing tool is useful for create it? pls help me. Thanks
  5. Yeah, I think I need another way. Or make mutiple global and random what will be using each time to reduce the chance that happen.
  6. Firstly, I make an event to caculate how much the killed one worth. Then I set a global variable with that value. Like this. This event proc when PvP Death Then I make an event that reward the killer by that value. Like this, I put an very small wait at head for sure that first event was proc. With small ping on server, this should be done well, there is very very small chance for two player be killed at same time. But I need some idea to improve this work 100%. Can you give me some. Thanks. Sorry if my english not good.
×
×
  • Create New...