예제 #1
0
 public void SetTextImage()
 {
     if (type < 2)
     {
         int[] pixels = textPreview.GetPreview(fontDialogue, PaletteSet.Palettes[1], dialogue.Text, false);
         textImage = Do.PixelsToImage(pixels, 256, 32);
     }
     else
     {
         Model.BonusMessages[Index].Text = textBox.Text.ToUpper();
     }
     picture.Invalidate();
 }
예제 #2
0
        // Psychopath
        private void psychopath_TextChanged(object sender, EventArgs e)
        {
            char[] text = psychopath.Text.ToCharArray();
            char[] swap;
            for (int i = 0; i < text.Length; i++)
            {
                if (text[i] == '\n')
                {
                    int tempSel = psychopath.SelectionStart;
                    swap = new char[text.Length + 2];
                    for (int x = 0; x < i; x++)
                    {
                        swap[x] = text[x];
                    }
                    swap[i]     = '[';
                    swap[i + 1] = '1';
                    swap[i + 2] = ']';
                    for (int x = i + 3; x < swap.Length; x++)
                    {
                        swap[x] = text[x - 2];
                    }
                    psychopath.Text = new string(swap);
                    text            = psychopath.Text.ToCharArray();
                    i += 2;
                    psychopath.SelectionStart = tempSel + 2;
                }
            }
            bool flag = parser.VerifySymbols(this.psychopath.Text.ToCharArray(), byteView);

            if (flag)
            {
                this.psychopath.BackColor = SystemColors.Window;
                monster.SetPsychopath(this.psychopath.Text, byteView);
                if (!monster.PsychopathError)
                {
                    monster.SetPsychopath(psychopath.Text, byteView);
                    int[] pixels = battleDialoguePreview.GetPreview(fontDialogue, fontPaletteDialogue, monster.RawPsychopath, false);
                    psychopathTextImage = Do.PixelsToImage(pixels, 256, 32);
                    picturePsychopath.Invalidate();
                }
            }
            if (!flag || monster.PsychopathError)
            {
                this.psychopath.BackColor = Color.Red;
            }
            SetFreeBytesLabel();
        }