Exemplo n.º 1
0
        private void CheckForValidChars()
        {
            if (MessageScript.StartsWith("MESS_"))
            {
                view.AllowImport = true;
                view.StatusText  = "";
                return;
            }

            var containsInvalids = false;
            var invalidChars     = new SortedSet <char>();

            foreach (var c in MessageScript.Where(c => !validChars[AssetGeneration.GetValue(c)]))
            {
                containsInvalids = true;
                if (!invalidChars.Contains(c))
                {
                    invalidChars.Add(c);
                }
            }

            if (containsInvalids)
            {
                view.AllowImport = false;
                view.StatusText  =
                    $"Warning! Text contains one or more unsupported characters: {string.Join(",", invalidChars)}";
            }
            else
            {
                view.AllowImport = true;
                view.StatusText  = "";
            }
        }
Exemplo n.º 2
0
        public Image UpdatePreview()
        {
            Image hb   = (Bitmap)Textboxes[View.CurrentTextboxIndex].Clone();
            Image text =
                (Bitmap)
                AssetGeneration.DrawString(new Bitmap(165, 50), View.CurrentLine.Replace(Environment.NewLine, "\n"),
                                           0, 22, Color.FromArgb(68, 8, 0));

            using (var g = Graphics.FromImage(hb))
            {
                g.DrawImage(text, new Point(10, 0));
                g.DrawImage(Resources.KeyPress,
                            new Point(View.PreviewImage.Width - 30, View.PreviewImage.Height - hb.Height + 32));
            }

            return(hb);
        }
Exemplo n.º 3
0
        private void assetLoader_DoWork(object sender, DoWorkEventArgs e)
        {
            var worker = sender as BackgroundWorker;

            AssetGeneration.Initialize(worker, e, dictList);
        }