示例#1
0
        private void ImportTTFFont(string fileName, string newTTFName, string newWFNName)
        {
            int fontSize = NumberEntryDialog.Show("Font size", "Select the font size to import this TTF font at:", DEFAULT_IMPORTED_FONT_SIZE, 1);

            if (fontSize > 0)
            {
                File.Copy(fileName, newTTFName, true);
                try
                {
                    if (File.Exists(newWFNName))
                    {
                        Factory.AGSEditor.DeleteFileOnDiskAndSourceControl(newWFNName);
                    }
                    Factory.NativeProxy.ReloadFont(_item.ID);
                    _item.PointSize      = fontSize;
                    _item.SizeMultiplier = 1;
                    _item.SourceFilename = Utilities.GetRelativeToProjectPath(fileName);
                }
                catch (AGSEditorException ex)
                {
                    Factory.GUIController.ShowMessage("Unable to import the font.\n\n" + ex.Message, MessageBoxIcon.Warning);
                    File.Delete(newTTFName);
                }
            }
        }
示例#2
0
 public static int Show(string titleBar, string headerText, int currentValue)
 {
     int result = -1;
     NumberEntryDialog dialog = new NumberEntryDialog(titleBar, headerText, currentValue);
     if (dialog.ShowDialog() == DialogResult.OK)
     {
         result = dialog.Number;
     }
     dialog.Dispose();
     return result;
 }
示例#3
0
        public static int Show(string titleBar, string headerText, int currentValue, int minValue = Int32.MinValue, int maxValue = Int32.MaxValue)
        {
            int result = -1;
            NumberEntryDialog dialog = new NumberEntryDialog(titleBar, headerText, currentValue, minValue, maxValue);

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                result = dialog.Number;
            }
            dialog.Dispose();
            return(result);
        }