Ejemplo n.º 1
0
        private void changeNickname(object sender, MouseEventArgs e)
        {
            TextBox tb = !(sender is TextBox) ? TB_Nickname : (TextBox)sender;

            // Special Character Form
            if (ModifierKeys != Keys.Control)
            {
                return;
            }

            int offset    = LB_DataEntry.SelectedIndex * 0x1B4;
            var nicktrash = data.Skip(offset + 0x18).Take(24).ToArray();

            SAV.setString(TB_Nickname.Text, 12).CopyTo(nicktrash, 0);
            var d = new f2_Text(tb, nicktrash);

            d.ShowDialog();
            tb.Text = d.FinalString;
            d.FinalBytes.CopyTo(data, offset + 0x18);

            string nickname = Util.TrimFromZero(Encoding.Unicode.GetString(data, offset + 0x18, 24));

            TB_Nickname.Text = nickname;
        }