예제 #1
0
        private void BrowseButtonClick(object sender, EventArgs e)
        {
            int  offset = (int)this.offsetNumericUpDown.Value;
            bool twice  = this.twiceCheckBox.Checked;

            if (this.compressRadioButton.Checked)
            {
                byte[] data = null;
                if (UITools.ShowImportDataDialog(fileName => data = File.ReadAllBytes(fileName), FileDialogFilters.Binary))
                {
                    int limit = (int)this.offsetNumericUpDown.Maximum;
                    CodecControl.Compress(data, offset, twice, limit);
                }
            }
            else
            {
                UITools.ShowExportDataDialog(fileName => File.WriteAllBytes(fileName, Context.Game.Decompress(offset, twice)), string.Empty, FileDialogFilters.Binary);
            }
        }
예제 #2
0
 public static bool ShowImportBinaryDataDialog(Action <byte[]> setDataMethod, string filter)
 {
     return(UITools.ShowImportDataDialog(filePath => setDataMethod(File.ReadAllBytes(filePath)), filter));
 }
예제 #3
0
 public static bool ShowImportDataDialog(Action <string> setDataMethod, string filter)
 {
     return(UITools.ShowImportDataDialog((index, filePath) => setDataMethod(filePath), filter, 1));
 }
예제 #4
0
 public static bool ShowImportTilesetGraphicsDialog(Tile[] tileset)
 {
     return(UITools.ShowImportDataDialog(filePath => UITools.ImportTilesetGraphics(filePath, tileset), FileDialogFilters.ImageOrBinary));
 }