Commit 137ddbb0 authored by keyongyu's avatar keyongyu

1.5.0.0

parent 156e9484
...@@ -77,7 +77,7 @@ public static string GetHtmlContentByUrl(string url) ...@@ -77,7 +77,7 @@ public static string GetHtmlContentByUrl(string url)
} }
#endregion #endregion
public static void DownLoad(string filename) public static bool DownLoad(string filename)
{ {
try try
{ {
...@@ -106,6 +106,7 @@ public static void DownLoad(string filename) ...@@ -106,6 +106,7 @@ public static void DownLoad(string filename)
isOK= false; isOK= false;
} }
isOK=true; isOK=true;
return isOK;
} }
} }
} }
/*
* date :2014-02-07
* desc :图像处理,裁剪,缩放,保存
*/
using System;
using System.IO;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
namespace DataEditorX
{
/// <summary>
/// Description of ImageHelper.
/// </summary>
public static class MyBitmap
{
#region 缩放
/// <summary>
/// 缩放图像
/// </summary>
/// <param name="img">源图像</param>
/// <param name="newW">新宽度</param>
/// <param name="newH">新高度</param>
/// <returns>处理好的图像</returns>
public static Bitmap Zoom(Bitmap sourceBitmap, int newWidth, int newHeight)
{
if ( sourceBitmap != null )
{
Bitmap b = new Bitmap(newWidth, newHeight);
Graphics graphics = Graphics.FromImage(b);
graphics.CompositingQuality = CompositingQuality.HighQuality;
graphics.SmoothingMode = SmoothingMode.HighQuality;
graphics.PixelOffsetMode = PixelOffsetMode.HighQuality;
graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
Rectangle newRect = new Rectangle(0, 0, newWidth, newHeight);
Rectangle srcRect = new Rectangle(0, 0, sourceBitmap.Width, sourceBitmap.Height);
graphics.DrawImage(sourceBitmap, newRect, srcRect, GraphicsUnit.Pixel);
graphics.Dispose();
return b;
}
return sourceBitmap;
}
#endregion
#region 裁剪
/// <summary>
/// 裁剪图像
/// </summary>
/// <param name="img">源图像</param>
/// <param name="StartX">开始x</param>
/// <param name="StartY">开始y</param>
/// <param name="iWidth">裁剪宽</param>
/// <param name="iHeight">裁剪高</param>
/// <returns>处理好的图像</returns>
public static Bitmap Cut(Bitmap sourceBitmap, int StartX, int StartY, int cutWidth, int cutHeight)
{
if ( sourceBitmap != null )
{
int w = sourceBitmap.Width;
int h = sourceBitmap.Height;
if ( ( StartX + cutWidth ) > w )
{
cutWidth = w - StartX;
}
if ( ( StartY + cutHeight ) > h )
{
cutHeight = h - StartY;
}
Bitmap bitmap = new Bitmap(cutWidth, cutHeight);
Graphics graphics = Graphics.FromImage(bitmap);
Rectangle cutRect = new Rectangle(0, 0, cutWidth, cutHeight);
Rectangle srcRect = new Rectangle(StartX, StartY, cutWidth, cutHeight);
graphics.DrawImage(sourceBitmap, cutRect, srcRect, GraphicsUnit.Pixel);
graphics.Dispose();
return bitmap;
}
return sourceBitmap;
}
#endregion
#region 保存
/// <summary>
/// 保存jpg图像
/// </summary>
/// <param name="bmp">源图像</param>
/// <param name="filename">保存路径</param>
/// <param name="quality">质量</param>
/// <returns>是否保存成功</returns>
public static bool SaveAsJPEG(Bitmap bitmap, string filename, int quality)
{
if ( bitmap != null )
{
string path=Path.GetDirectoryName(filename);
if(!Directory.Exists(path))
Directory.CreateDirectory(path);
if(File.Exists(filename))
File.Delete(filename);
ImageCodecInfo[] codecs = ImageCodecInfo.GetImageEncoders();
ImageCodecInfo ici = null;
foreach ( ImageCodecInfo codec in codecs )
{
if ( codec.MimeType.IndexOf("jpeg") > -1 )
{
ici = codec;
}
if ( quality < 0 || quality > 100 )
quality = 60;
EncoderParameters encoderParams = new EncoderParameters();
encoderParams.Param[0] = new EncoderParameter(Encoder.Quality, (long)quality);
if ( ici != null )
bitmap.Save(filename, ici, encoderParams);
else
bitmap.Save(filename);
}
return true;
}
return false;
}
#endregion
}
}
// ZipStorer, by Jaime Olivares
// Website: zipstorer.codeplex.com
// Version: 2.35 (March 14, 2010)
using System.Collections.Generic;
using System.Text;
namespace System.IO.Compression
{
/// <summary>
/// Unique class for compression/decompression file. Represents a Zip file.
/// </summary>
public class ZipStorer : IDisposable
{
/// <summary>
/// Compression method enumeration
/// </summary>
public enum Compression : ushort {
/// <summary>Uncompressed storage</summary>
Store = 0,
/// <summary>Deflate compression method</summary>
Deflate = 8 }
/// <summary>
/// Represents an entry in Zip file directory
/// </summary>
public struct ZipFileEntry
{
/// <summary>Compression method</summary>
public Compression Method;
/// <summary>Full path and filename as stored in Zip</summary>
public string FilenameInZip;
/// <summary>Original file size</summary>
public uint FileSize;
/// <summary>Compressed file size</summary>
public uint CompressedSize;
/// <summary>Offset of header information inside Zip storage</summary>
public uint HeaderOffset;
/// <summary>Offset of file inside Zip storage</summary>
public uint FileOffset;
/// <summary>Size of header information</summary>
public uint HeaderSize;
/// <summary>32-bit checksum of entire file</summary>
public uint Crc32;
/// <summary>Last modification time of file</summary>
public DateTime ModifyTime;
/// <summary>User comment for file</summary>
public string Comment;
/// <summary>True if UTF8 encoding for filename and comments, false if default (CP 437)</summary>
public bool EncodeUTF8;
/// <summary>Overriden method</summary>
/// <returns>Filename in Zip</returns>
public override string ToString()
{
return this.FilenameInZip;
}
}
#region Public fields
/// <summary>True if UTF8 encoding for filename and comments, false if default (CP 437)</summary>
public bool EncodeUTF8 = false;
/// <summary>Force deflate algotithm even if it inflates the stored file. Off by default.</summary>
public bool ForceDeflating = false;
#endregion
#region Private fields
// List of files to store
private List<ZipFileEntry> Files = new List<ZipFileEntry>();
// Filename of storage file
private string FileName;
// Stream object of storage file
private Stream ZipFileStream;
// General comment
private string Comment = "";
// Central dir image
private byte[] CentralDirImage = null;
// Existing files in zip
private ushort ExistingFiles = 0;
// File access for Open method
private FileAccess Access;
// Static CRC32 Table
private static UInt32[] CrcTable = null;
// Default filename encoder
private static Encoding DefaultEncoding = Encoding.GetEncoding(437);
#endregion
#region Public methods
// Static constructor. Just invoked once in order to create the CRC32 lookup table.
static ZipStorer()
{
// Generate CRC32 table
CrcTable = new UInt32[256];
for (int i = 0; i < CrcTable.Length; i++)
{
UInt32 c = (UInt32)i;
for (int j = 0; j < 8; j++)
{
if ((c & 1) != 0)
c = 3988292384 ^ (c >> 1);
else
c >>= 1;
}
CrcTable[i] = c;
}
}
/// <summary>
/// Method to create a new storage file
/// </summary>
/// <param name="_filename">Full path of Zip file to create</param>
/// <param name="_comment">General comment for Zip file</param>
/// <returns>A valid ZipStorer object</returns>
public static ZipStorer Create(string _filename, string _comment)
{
Stream stream = new FileStream(_filename, FileMode.Create, FileAccess.ReadWrite);
ZipStorer zip = Create(stream, _comment);
zip.Comment = _comment;
zip.FileName = _filename;
return zip;
}
/// <summary>
/// Method to create a new zip storage in a stream
/// </summary>
/// <param name="_stream"></param>
/// <param name="_comment"></param>
/// <returns>A valid ZipStorer object</returns>
public static ZipStorer Create(Stream _stream, string _comment)
{
ZipStorer zip = new ZipStorer();
zip.Comment = _comment;
zip.ZipFileStream = _stream;
zip.Access = FileAccess.Write;
return zip;
}
/// <summary>
/// Method to open an existing storage file
/// </summary>
/// <param name="_filename">Full path of Zip file to open</param>
/// <param name="_access">File access mode as used in FileStream constructor</param>
/// <returns>A valid ZipStorer object</returns>
public static ZipStorer Open(string _filename, FileAccess _access)
{
Stream stream = (Stream)new FileStream(_filename, FileMode.Open, _access == FileAccess.Read ? FileAccess.Read : FileAccess.ReadWrite);
ZipStorer zip = Open(stream, _access);
zip.FileName = _filename;
return zip;
}
/// <summary>
/// Method to open an existing storage from stream
/// </summary>
/// <param name="_stream">Already opened stream with zip contents</param>
/// <param name="_access">File access mode for stream operations</param>
/// <returns>A valid ZipStorer object</returns>
public static ZipStorer Open(Stream _stream, FileAccess _access)
{
if (!_stream.CanSeek && _access != FileAccess.Read)
throw new InvalidOperationException("Stream cannot seek");
ZipStorer zip = new ZipStorer();
//zip.FileName = _filename;
zip.ZipFileStream = _stream;
zip.Access = _access;
if (zip.ReadFileInfo())
return zip;
throw new System.IO.InvalidDataException();
}
/// <summary>
/// Add full contents of a file into the Zip storage
/// </summary>
/// <param name="_method">Compression method</param>
/// <param name="_pathname">Full path of file to add to Zip storage</param>
/// <param name="_filenameInZip">Filename and path as desired in Zip directory</param>
/// <param name="_comment">Comment for stored file</param>
public void AddFile(string _pathname, string _filenameInZip, string _comment)
{
Compression _method=Compression.Deflate;
if (Access == FileAccess.Read)
throw new InvalidOperationException("Writing is not alowed");
FileStream stream = new FileStream(_pathname, FileMode.Open, FileAccess.Read);
AddStream(_method, _filenameInZip, stream, File.GetLastWriteTime(_pathname), _comment);
stream.Close();
}
/// <summary>
/// Add full contents of a file into the Zip storage
/// </summary>
/// <param name="_method">Compression method</param>
/// <param name="_pathname">Full path of file to add to Zip storage</param>
/// <param name="_filenameInZip">Filename and path as desired in Zip directory</param>
/// <param name="_comment">Comment for stored file</param>
public void AddFile(Compression _method, string _pathname, string _filenameInZip, string _comment)
{
if (Access == FileAccess.Read)
throw new InvalidOperationException("Writing is not alowed");
FileStream stream = new FileStream(_pathname, FileMode.Open, FileAccess.Read);
AddStream(_method, _filenameInZip, stream, File.GetLastWriteTime(_pathname), _comment);
stream.Close();
}
/// <summary>
/// Add full contents of a stream into the Zip storage
/// </summary>
/// <param name="_method">Compression method</param>
/// <param name="_filenameInZip">Filename and path as desired in Zip directory</param>
/// <param name="_source">Stream object containing the data to store in Zip</param>
/// <param name="_modTime">Modification time of the data to store</param>
/// <param name="_comment">Comment for stored file</param>
public void AddStream(Compression _method, string _filenameInZip, Stream _source, DateTime _modTime, string _comment)
{
if (Access == FileAccess.Read)
throw new InvalidOperationException("Writing is not alowed");
long offset;
if (this.Files.Count==0)
offset = 0;
else
{
ZipFileEntry last = this.Files[this.Files.Count-1];
offset = last.HeaderOffset + last.HeaderSize;
}
// Prepare the fileinfo
ZipFileEntry zfe = new ZipFileEntry();
zfe.Method = _method;
zfe.EncodeUTF8 = this.EncodeUTF8;
zfe.FilenameInZip = NormalizedFilename(_filenameInZip);
zfe.Comment = (_comment == null ? "" : _comment);
// Even though we write the header now, it will have to be rewritten, since we don't know compressed size or crc.
zfe.Crc32 = 0; // to be updated later
zfe.HeaderOffset = (uint)this.ZipFileStream.Position; // offset within file of the start of this local record
zfe.ModifyTime = _modTime;
// Write local header
WriteLocalHeader(ref zfe);
zfe.FileOffset = (uint)this.ZipFileStream.Position;
// Write file to zip (store)
Store(ref zfe, _source);
_source.Close();
this.UpdateCrcAndSizes(ref zfe);
Files.Add(zfe);
}
/// <summary>
/// Updates central directory (if pertinent) and close the Zip storage
/// </summary>
/// <remarks>This is a required step, unless automatic dispose is used</remarks>
public void Close()
{
if (this.Access != FileAccess.Read)
{
uint centralOffset = (uint)this.ZipFileStream.Position;
uint centralSize = 0;
if (this.CentralDirImage != null)
this.ZipFileStream.Write(CentralDirImage, 0, CentralDirImage.Length);
for (int i = 0; i < Files.Count; i++)
{
long pos = this.ZipFileStream.Position;
this.WriteCentralDirRecord(Files[i]);
centralSize += (uint)(this.ZipFileStream.Position - pos);
}
if (this.CentralDirImage != null)
this.WriteEndRecord(centralSize + (uint)CentralDirImage.Length, centralOffset);
else
this.WriteEndRecord(centralSize, centralOffset);
}
if (this.ZipFileStream != null)
{
this.ZipFileStream.Flush();
this.ZipFileStream.Dispose();
this.ZipFileStream = null;
}
}
/// <summary>
/// Read all the file records in the central directory
/// </summary>
/// <returns>List of all entries in directory</returns>
public List<ZipFileEntry> ReadCentralDir()
{
if (this.CentralDirImage == null)
throw new InvalidOperationException("Central directory currently does not exist");
List<ZipFileEntry> result = new List<ZipFileEntry>();
for (int pointer = 0; pointer < this.CentralDirImage.Length; )
{
uint signature = BitConverter.ToUInt32(CentralDirImage, pointer);
if (signature != 0x02014b50)
break;
bool encodeUTF8 = (BitConverter.ToUInt16(CentralDirImage, pointer + 8) & 0x0800) != 0;
ushort method = BitConverter.ToUInt16(CentralDirImage, pointer + 10);
uint modifyTime = BitConverter.ToUInt32(CentralDirImage, pointer + 12);
uint crc32 = BitConverter.ToUInt32(CentralDirImage, pointer + 16);
uint comprSize = BitConverter.ToUInt32(CentralDirImage, pointer + 20);
uint fileSize = BitConverter.ToUInt32(CentralDirImage, pointer + 24);
ushort filenameSize = BitConverter.ToUInt16(CentralDirImage, pointer + 28);
ushort extraSize = BitConverter.ToUInt16(CentralDirImage, pointer + 30);
ushort commentSize = BitConverter.ToUInt16(CentralDirImage, pointer + 32);
uint headerOffset = BitConverter.ToUInt32(CentralDirImage, pointer + 42);
uint headerSize = (uint)( 46 + filenameSize + extraSize + commentSize);
Encoding encoder = encodeUTF8 ? Encoding.UTF8 : DefaultEncoding;
ZipFileEntry zfe = new ZipFileEntry();
zfe.Method = (Compression)method;
zfe.FilenameInZip = encoder.GetString(CentralDirImage, pointer + 46, filenameSize);
zfe.FileOffset = GetFileOffset(headerOffset);
zfe.FileSize = fileSize;
zfe.CompressedSize = comprSize;
zfe.HeaderOffset = headerOffset;
zfe.HeaderSize = headerSize;
zfe.Crc32 = crc32;
zfe.ModifyTime = DosTimeToDateTime(modifyTime);
if (commentSize > 0)
zfe.Comment = encoder.GetString(CentralDirImage, pointer + 46 + filenameSize + extraSize, commentSize);
result.Add(zfe);
pointer += (46 + filenameSize + extraSize + commentSize);
}
return result;
}
/// <summary>
/// Copy the contents of a stored file into a physical file
/// </summary>
/// <param name="_zfe">Entry information of file to extract</param>
/// <param name="_filename">Name of file to store uncompressed data</param>
/// <returns>True if success, false if not.</returns>
/// <remarks>Unique compression methods are Store and Deflate</remarks>
public bool ExtractFile(ZipFileEntry _zfe, string _filename)
{
// Make sure the parent directory exist
string path = System.IO.Path.GetDirectoryName(_filename);
if (!Directory.Exists(path))
Directory.CreateDirectory(path);
// Check it is directory. If so, do nothing
if (Directory.Exists(_filename))
return true;
Stream output = new FileStream(_filename, FileMode.Create, FileAccess.Write);
bool result = ExtractFile(_zfe, output);
if (result)
output.Close();
File.SetCreationTime(_filename, _zfe.ModifyTime);
File.SetLastWriteTime(_filename, _zfe.ModifyTime);
return result;
}
/// <summary>
/// Copy the contents of a stored file into an opened stream
/// </summary>
/// <param name="_zfe">Entry information of file to extract</param>
/// <param name="_stream">Stream to store the uncompressed data</param>
/// <returns>True if success, false if not.</returns>
/// <remarks>Unique compression methods are Store and Deflate</remarks>
public bool ExtractFile(ZipFileEntry _zfe, Stream _stream)
{
if (!_stream.CanWrite)
throw new InvalidOperationException("Stream cannot be written");
// check signature
byte[] signature = new byte[4];
this.ZipFileStream.Seek(_zfe.HeaderOffset, SeekOrigin.Begin);
this.ZipFileStream.Read(signature, 0, 4);
if (BitConverter.ToUInt32(signature, 0) != 0x04034b50)
return false;
// Select input stream for inflating or just reading
Stream inStream;
if (_zfe.Method == Compression.Store)
inStream = this.ZipFileStream;
else if (_zfe.Method == Compression.Deflate)
inStream = new DeflateStream(this.ZipFileStream, CompressionMode.Decompress, true);
else
return false;
// Buffered copy
byte[] buffer = new byte[16384];
this.ZipFileStream.Seek(_zfe.FileOffset, SeekOrigin.Begin);
uint bytesPending = _zfe.FileSize;
while (bytesPending > 0)
{
int bytesRead = inStream.Read(buffer, 0, (int)Math.Min(bytesPending, buffer.Length));
_stream.Write(buffer, 0, bytesRead);
bytesPending -= (uint)bytesRead;
}
_stream.Flush();
if (_zfe.Method == Compression.Deflate)
inStream.Dispose();
return true;
}
/// <summary>
/// Removes one of many files in storage. It creates a new Zip file.
/// </summary>
/// <param name="_zip">Reference to the current Zip object</param>
/// <param name="_zfes">List of Entries to remove from storage</param>
/// <returns>True if success, false if not</returns>
/// <remarks>This method only works for storage of type FileStream</remarks>
public static bool RemoveEntries(ref ZipStorer _zip, List<ZipFileEntry> _zfes)
{
if (!(_zip.ZipFileStream is FileStream))
throw new InvalidOperationException("RemoveEntries is allowed just over streams of type FileStream");
//Get full list of entries
List<ZipFileEntry> fullList = _zip.ReadCentralDir();
//In order to delete we need to create a copy of the zip file excluding the selected items
string tempZipName = Path.GetTempFileName();
string tempEntryName = Path.GetTempFileName();
try
{
ZipStorer tempZip = ZipStorer.Create(tempZipName, string.Empty);
foreach (ZipFileEntry zfe in fullList)
{
if (!_zfes.Contains(zfe))
{
if (_zip.ExtractFile(zfe, tempEntryName))
{
tempZip.AddFile(zfe.Method, tempEntryName, zfe.FilenameInZip, zfe.Comment);
}
}
}
_zip.Close();
tempZip.Close();
File.Delete(_zip.FileName);
File.Move(tempZipName, _zip.FileName);
_zip = ZipStorer.Open(_zip.FileName, _zip.Access);
}
catch
{
return false;
}
finally
{
if (File.Exists(tempZipName))
File.Delete(tempZipName);
if (File.Exists(tempEntryName))
File.Delete(tempEntryName);
}
return true;
}
#endregion
#region Private methods
// Calculate the file offset by reading the corresponding local header
private uint GetFileOffset(uint _headerOffset)
{
byte[] buffer = new byte[2];
this.ZipFileStream.Seek(_headerOffset + 26, SeekOrigin.Begin);
this.ZipFileStream.Read(buffer, 0, 2);
ushort filenameSize = BitConverter.ToUInt16(buffer, 0);
this.ZipFileStream.Read(buffer, 0, 2);
ushort extraSize = BitConverter.ToUInt16(buffer, 0);
return (uint)(30 + filenameSize + extraSize + _headerOffset);
}
/* Local file header:
local file header signature 4 bytes (0x04034b50)
version needed to extract 2 bytes
general purpose bit flag 2 bytes
compression method 2 bytes
last mod file time 2 bytes
last mod file date 2 bytes
crc-32 4 bytes
compressed size 4 bytes
uncompressed size 4 bytes
filename length 2 bytes
extra field length 2 bytes
filename (variable size)
extra field (variable size)
*/
private void WriteLocalHeader(ref ZipFileEntry _zfe)
{
long pos = this.ZipFileStream.Position;
Encoding encoder = _zfe.EncodeUTF8 ? Encoding.UTF8 : DefaultEncoding;
byte[] encodedFilename = encoder.GetBytes(_zfe.FilenameInZip);
this.ZipFileStream.Write(new byte[] { 80, 75, 3, 4, 20, 0}, 0, 6); // No extra header
this.ZipFileStream.Write(BitConverter.GetBytes((ushort)(_zfe.EncodeUTF8 ? 0x0800 : 0)), 0, 2); // filename and comment encoding
this.ZipFileStream.Write(BitConverter.GetBytes((ushort)_zfe.Method), 0, 2); // zipping method
this.ZipFileStream.Write(BitConverter.GetBytes(DateTimeToDosTime(_zfe.ModifyTime)), 0, 4); // zipping date and time
this.ZipFileStream.Write(new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, 0, 12); // unused CRC, un/compressed size, updated later
this.ZipFileStream.Write(BitConverter.GetBytes((ushort)encodedFilename.Length), 0, 2); // filename length
this.ZipFileStream.Write(BitConverter.GetBytes((ushort)0), 0, 2); // extra length
this.ZipFileStream.Write(encodedFilename, 0, encodedFilename.Length);
_zfe.HeaderSize = (uint)(this.ZipFileStream.Position - pos);
}
/* Central directory's File header:
central file header signature 4 bytes (0x02014b50)
version made by 2 bytes
version needed to extract 2 bytes
general purpose bit flag 2 bytes
compression method 2 bytes
last mod file time 2 bytes
last mod file date 2 bytes
crc-32 4 bytes
compressed size 4 bytes
uncompressed size 4 bytes
filename length 2 bytes
extra field length 2 bytes
file comment length 2 bytes
disk number start 2 bytes
internal file attributes 2 bytes
external file attributes 4 bytes
relative offset of local header 4 bytes
filename (variable size)
extra field (variable size)
file comment (variable size)
*/
private void WriteCentralDirRecord(ZipFileEntry _zfe)
{
Encoding encoder = _zfe.EncodeUTF8 ? Encoding.UTF8 : DefaultEncoding;
byte[] encodedFilename = encoder.GetBytes(_zfe.FilenameInZip);
byte[] encodedComment = encoder.GetBytes(_zfe.Comment);
this.ZipFileStream.Write(new byte[] { 80, 75, 1, 2, 23, 0xB, 20, 0 }, 0, 8);
this.ZipFileStream.Write(BitConverter.GetBytes((ushort)(_zfe.EncodeUTF8 ? 0x0800 : 0)), 0, 2); // filename and comment encoding
this.ZipFileStream.Write(BitConverter.GetBytes((ushort)_zfe.Method), 0, 2); // zipping method
this.ZipFileStream.Write(BitConverter.GetBytes(DateTimeToDosTime(_zfe.ModifyTime)), 0, 4); // zipping date and time
this.ZipFileStream.Write(BitConverter.GetBytes(_zfe.Crc32), 0, 4); // file CRC
this.ZipFileStream.Write(BitConverter.GetBytes(_zfe.CompressedSize), 0, 4); // compressed file size
this.ZipFileStream.Write(BitConverter.GetBytes(_zfe.FileSize), 0, 4); // uncompressed file size
this.ZipFileStream.Write(BitConverter.GetBytes((ushort)encodedFilename.Length), 0, 2); // Filename in zip
this.ZipFileStream.Write(BitConverter.GetBytes((ushort)0), 0, 2); // extra length
this.ZipFileStream.Write(BitConverter.GetBytes((ushort)encodedComment.Length), 0, 2);
this.ZipFileStream.Write(BitConverter.GetBytes((ushort)0), 0, 2); // disk=0
this.ZipFileStream.Write(BitConverter.GetBytes((ushort)0), 0, 2); // file type: binary
this.ZipFileStream.Write(BitConverter.GetBytes((ushort)0), 0, 2); // Internal file attributes
this.ZipFileStream.Write(BitConverter.GetBytes((ushort)0x8100), 0, 2); // External file attributes (normal/readable)
this.ZipFileStream.Write(BitConverter.GetBytes(_zfe.HeaderOffset), 0, 4); // Offset of header
this.ZipFileStream.Write(encodedFilename, 0, encodedFilename.Length);
this.ZipFileStream.Write(encodedComment, 0, encodedComment.Length);
}
/* End of central dir record:
end of central dir signature 4 bytes (0x06054b50)
number of this disk 2 bytes
number of the disk with the
start of the central directory 2 bytes
total number of entries in
the central dir on this disk 2 bytes
total number of entries in
the central dir 2 bytes
size of the central directory 4 bytes
offset of start of central
directory with respect to
the starting disk number 4 bytes
zipfile comment length 2 bytes
zipfile comment (variable size)
*/
private void WriteEndRecord(uint _size, uint _offset)
{
Encoding encoder = this.EncodeUTF8 ? Encoding.UTF8 : DefaultEncoding;
byte[] encodedComment = encoder.GetBytes(this.Comment);
this.ZipFileStream.Write(new byte[] { 80, 75, 5, 6, 0, 0, 0, 0 }, 0, 8);
this.ZipFileStream.Write(BitConverter.GetBytes((ushort)Files.Count+ExistingFiles), 0, 2);
this.ZipFileStream.Write(BitConverter.GetBytes((ushort)Files.Count+ExistingFiles), 0, 2);
this.ZipFileStream.Write(BitConverter.GetBytes(_size), 0, 4);
this.ZipFileStream.Write(BitConverter.GetBytes(_offset), 0, 4);
this.ZipFileStream.Write(BitConverter.GetBytes((ushort)encodedComment.Length), 0, 2);
this.ZipFileStream.Write(encodedComment, 0, encodedComment.Length);
}
// Copies all source file into storage file
private void Store(ref ZipFileEntry _zfe, Stream _source)
{
byte[] buffer = new byte[16384];
int bytesRead;
uint totalRead = 0;
Stream outStream;
long posStart = this.ZipFileStream.Position;
long sourceStart = _source.Position;
if (_zfe.Method == Compression.Store)
outStream = this.ZipFileStream;
else
outStream = new DeflateStream(this.ZipFileStream, CompressionMode.Compress, true);
_zfe.Crc32 = 0 ^ 0xffffffff;
do
{
bytesRead = _source.Read(buffer, 0, buffer.Length);
totalRead += (uint)bytesRead;
if (bytesRead > 0)
{
outStream.Write(buffer, 0, bytesRead);
for (uint i = 0; i < bytesRead; i++)
{
_zfe.Crc32 = ZipStorer.CrcTable[(_zfe.Crc32 ^ buffer[i]) & 0xFF] ^ (_zfe.Crc32 >> 8);
}
}
} while (bytesRead == buffer.Length);
outStream.Flush();
if (_zfe.Method == Compression.Deflate)
outStream.Dispose();
_zfe.Crc32 ^= 0xffffffff;
_zfe.FileSize = totalRead;
_zfe.CompressedSize = (uint)(this.ZipFileStream.Position - posStart);
// Verify for real compression
if (_zfe.Method == Compression.Deflate && !this.ForceDeflating && _source.CanSeek && _zfe.CompressedSize > _zfe.FileSize)
{
// Start operation again with Store algorithm
_zfe.Method = Compression.Store;
this.ZipFileStream.Position = posStart;
this.ZipFileStream.SetLength(posStart);
_source.Position = sourceStart;
this.Store(ref _zfe, _source);
}
}
/* DOS Date and time:
MS-DOS date. The date is a packed value with the following format. Bits Description
0-4 Day of the month (1?1)
5-8 Month (1 = January, 2 = February, and so on)
9-15 Year offset from 1980 (add 1980 to get actual year)
MS-DOS time. The time is a packed value with the following format. Bits Description
0-4 Second divided by 2
5-10 Minute (0?9)
11-15 Hour (0?3 on a 24-hour clock)
*/
private uint DateTimeToDosTime(DateTime _dt)
{
return (uint)(
(_dt.Second / 2) | (_dt.Minute << 5) | (_dt.Hour << 11) |
(_dt.Day<<16) | (_dt.Month << 21) | ((_dt.Year - 1980) << 25));
}
private DateTime DosTimeToDateTime(uint _dt)
{
return new DateTime(
(int)(_dt >> 25) + 1980,
(int)(_dt >> 21) & 15,
(int)(_dt >> 16) & 31,
(int)(_dt >> 11) & 31,
(int)(_dt >> 5) & 63,
(int)(_dt & 31) * 2);
}
/* CRC32 algorithm
The 'magic number' for the CRC is 0xdebb20e3.
The proper CRC pre and post conditioning
is used, meaning that the CRC register is
pre-conditioned with all ones (a starting value
of 0xffffffff) and the value is post-conditioned by
taking the one's complement of the CRC residual.
If bit 3 of the general purpose flag is set, this
field is set to zero in the local header and the correct
value is put in the data descriptor and in the central
directory.
*/
private void UpdateCrcAndSizes(ref ZipFileEntry _zfe)
{
long lastPos = this.ZipFileStream.Position; // remember position
this.ZipFileStream.Position = _zfe.HeaderOffset + 8;
this.ZipFileStream.Write(BitConverter.GetBytes((ushort)_zfe.Method), 0, 2); // zipping method
this.ZipFileStream.Position = _zfe.HeaderOffset + 14;
this.ZipFileStream.Write(BitConverter.GetBytes(_zfe.Crc32), 0, 4); // Update CRC
this.ZipFileStream.Write(BitConverter.GetBytes(_zfe.CompressedSize), 0, 4); // Compressed size
this.ZipFileStream.Write(BitConverter.GetBytes(_zfe.FileSize), 0, 4); // Uncompressed size
this.ZipFileStream.Position = lastPos; // restore position
}
// Replaces backslashes with slashes to store in zip header
private string NormalizedFilename(string _filename)
{
string filename = _filename.Replace('\\', '/');
int pos = filename.IndexOf(':');
if (pos >= 0)
filename = filename.Remove(0, pos + 1);
return filename.Trim('/');
}
// Reads the end-of-central-directory record
private bool ReadFileInfo()
{
if (this.ZipFileStream.Length < 22)
return false;
try
{
this.ZipFileStream.Seek(-17, SeekOrigin.End);
BinaryReader br = new BinaryReader(this.ZipFileStream);
do
{
this.ZipFileStream.Seek(-5, SeekOrigin.Current);
UInt32 sig = br.ReadUInt32();
if (sig == 0x06054b50)
{
this.ZipFileStream.Seek(6, SeekOrigin.Current);
UInt16 entries = br.ReadUInt16();
Int32 centralSize = br.ReadInt32();
UInt32 centralDirOffset = br.ReadUInt32();
UInt16 commentSize = br.ReadUInt16();
// check if comment field is the very last data in file
if (this.ZipFileStream.Position + commentSize != this.ZipFileStream.Length)
return false;
// Copy entire central directory to a memory buffer
this.ExistingFiles = entries;
this.CentralDirImage = new byte[centralSize];
this.ZipFileStream.Seek(centralDirOffset, SeekOrigin.Begin);
this.ZipFileStream.Read(this.CentralDirImage, 0, centralSize);
// Leave the pointer at the begining of central dir, to append new files
this.ZipFileStream.Seek(centralDirOffset, SeekOrigin.Begin);
return true;
}
} while (this.ZipFileStream.Position > 0);
}
catch { }
return false;
}
#endregion
#region IDisposable Members
/// <summary>
/// Closes the Zip file stream
/// </summary>
public void Dispose()
{
this.Close();
}
#endregion
}
}
...@@ -15,7 +15,7 @@ public struct Card : IEquatable<Card> ...@@ -15,7 +15,7 @@ public struct Card : IEquatable<Card>
/// </summary> /// </summary>
/// <param name="cardCode">密码</param> /// <param name="cardCode">密码</param>
/// <param name="cardName">名字</param> /// <param name="cardName">名字</param>
public Card(int cardCode) public Card(long cardCode)
{ {
int i; int i;
this.id = cardCode; this.id = cardCode;
...@@ -164,5 +164,11 @@ public override int GetHashCode() ...@@ -164,5 +164,11 @@ public override int GetHashCode()
} }
#endregion #endregion
public bool IsType(CardType type){
if((this.type & (long)type) == (long)type)
return true;
return false;
}
} }
} }
/*
* 由SharpDevelop创建。
* 用户: Acer
* 日期: 2014-10-13
* 时间: 9:08
*
*/
using System;
namespace DataEditorX.Core
{
/// <summary>
/// Description of CardType.
/// </summary>
public enum CardType : long
{
MONSTER = 0x1,
SPELL = 0x2,
TRAP = 0x4,
NORMAL = 0x10,
EFFECT = 0x20,
FUSION = 0x40,
RITUAL = 0x80,
TRAPMONSTER = 0x100,
SPIRIT = 0x200,
UNION = 0x400,
DUAL = 0x800,
TUNER = 0x1000,
SYNCHRO = 0x2000,
TOKEN = 0x4000,
QUICKPLAY = 0x10000,
CONTINUOUS = 0x20000,
EQUIP = 0x40000,
FIELD = 0x80000,
COUNTER = 0x100000,
FLIP = 0x200000,
TOON = 0x400000,
XYZ = 0x800000,
PENDULUM = 0x1000000,
}
}
...@@ -41,6 +41,9 @@ public class DataManager ...@@ -41,6 +41,9 @@ public class DataManager
continue; continue;
strkey=line.Substring(0,l).Replace("0x",""); strkey=line.Substring(0,l).Replace("0x","");
strword=line.Substring(l+1); strword=line.Substring(l+1);
int t=strword.IndexOf('\t');
if(t>0)
strword=strword.Substring(0,t);
if(line.StartsWith("0x")) if(line.StartsWith("0x"))
long.TryParse(strkey, NumberStyles.HexNumber, null, out lkey); long.TryParse(strkey, NumberStyles.HexNumber, null, out lkey);
else else
......
/*
* 由SharpDevelop创建。
* 用户: Acer
* 日期: 2014-10-13
* 时间: 9:02
*
*/
using System;
using System.Configuration;
namespace DataEditorX.Core
{
/// <summary>
/// Description of ImageSet.
/// </summary>
public class ImageSet
{
bool isInit;
public ImageSet(){
isInit=false;
}
public void Init()
{
if(isInit)
return;
isInit=true;
string temp=ConfigurationManager.AppSettings["image_other"];
string[] ws=string.IsNullOrEmpty(temp)?null:temp.Split(',');
if(ws!=null && ws.Length==4){
int.TryParse(ws[0],out this.other_x);
int.TryParse(ws[1],out this.other_y);
int.TryParse(ws[2],out this.other_w);
int.TryParse(ws[3],out this.other_h);
}
//MyMsg.Show(string.Format("other:{0},{1},{2},{3}",other_x,other_y,other_w,other_h));
temp=ConfigurationManager.AppSettings["image_xyz"];
ws=string.IsNullOrEmpty(temp)?null:temp.Split(',');
if(ws!=null && ws.Length==4){
int.TryParse(ws[0],out this.xyz_x);
int.TryParse(ws[1],out this.xyz_y);
int.TryParse(ws[2],out this.xyz_w);
int.TryParse(ws[3],out this.xyz_h);
}
//MyMsg.Show(string.Format("xyz:{0},{1},{2},{3}",xyz_x,xyz_y,xyz_w,xyz_h));
temp=ConfigurationManager.AppSettings["image_pendulum"];
ws=string.IsNullOrEmpty(temp)?null:temp.Split(',');
if(ws!=null && ws.Length==4){
int.TryParse(ws[0],out this.pendulum_x);
int.TryParse(ws[1],out this.pendulum_y);
int.TryParse(ws[2],out this.pendulum_w);
int.TryParse(ws[3],out this.pendulum_h);
}
//MyMsg.Show(string.Format("pendulum:{0},{1},{2},{3}",pendulum_x,pendulum_y,pendulum_w,pendulum_h));
temp=ConfigurationManager.AppSettings["image"];
ws=string.IsNullOrEmpty(temp)?null:temp.Split(',');
if(ws!=null && ws.Length==4){
int.TryParse(ws[0],out this.w);
int.TryParse(ws[1],out this.h);
int.TryParse(ws[2],out this.W);
int.TryParse(ws[3],out this.H);
}
//MyMsg.Show(string.Format("image:{0},{1},{2},{3}",w,h,W,H));
temp=ConfigurationManager.AppSettings["image_quilty"];
if(!string.IsNullOrEmpty(temp)){
int.TryParse(temp, out this.quilty);
}
//MyMsg.Show(string.Format("quilty:{0}",quilty));
}
public int quilty;
public int w,h,W,H;
public int other_x,other_y;
public int other_w,other_h;
public int xyz_x,xyz_y;
public int xyz_w,xyz_h;
public int pendulum_x,pendulum_y;
public int pendulum_w,pendulum_h;
}
}
/*
* 由SharpDevelop创建。
* 用户: Acer
* 日期: 2014-10-12
* 时间: 12:48
*
*/
using System;
namespace DataEditorX.Core
{
/// <summary>
/// Description of MSE.
/// </summary>
public class MSE
{
static bool isInit=false;
public static void Init()
{
if(isInit)
return;
//cut images
//type
//race
//effect
}
public static void Save(string file,Card[] cards,string pic){
MSE.Init();
}
}
}
/*
* 由SharpDevelop创建。
* 用户: Acer
* 日期: 2014-10-12
* 时间: 19:43
*
*/
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Drawing;
using System.Globalization;
using System.IO;
using System.Text;
using System.Windows.Forms;
using DataEditorX.Core;
using DataEditorX.Language;
namespace DataEditorX.Core
{
public enum MyTask{
NONE,
CheckUpdate,
CopyDataBase,
SaveAsMSE,
CutImages,
}
/// <summary>
/// Description of TaskHelper.
/// </summary>
public class TaskHelper
{
private static MyTask nowTask=MyTask.NONE;
private static Card[] cardlist;
private static string[] mArgs;
private static ImageSet imgSet=new ImageSet();
public static MyTask getTask(){
return nowTask;
}
public static void SetTask(MyTask myTask,Card[] cards,params string[] args){
nowTask=myTask;
cardlist=cards;
mArgs=args;
}
public static void OnCheckUpdate(bool showNew){
string newver=CheckUpdate.Check(
ConfigurationManager.AppSettings["updateURL"]);
int iver,iver2;
int.TryParse(Application.ProductVersion.Replace(".",""), out iver);
int.TryParse(newver.Replace(".",""), out iver2);
if(iver2>iver)
{//has new version
if(!MyMsg.Question(LMSG.HaveNewVersion))
return;
}
else if(iver2>0)
{//now is last version
if(!showNew)
return;
if(!MyMsg.Question(LMSG.NowIsNewVersion))
return;
}
else
{
if(!showNew)
return;
MyMsg.Error(LMSG.CheckUpdateFail);
return;
}
if(CheckUpdate.DownLoad(
Path.Combine(Application.StartupPath, newver+".zip")))
MyMsg.Show(LMSG.DownloadSucceed);
else
MyMsg.Show(LMSG.DownloadFail);
}
public static void CutImages(string imgpath,string savepath)
{
imgSet.Init();
foreach(Card c in cardlist)
{
string jpg=Path.Combine(imgpath, c.id+".jpg");
string savejpg=Path.Combine(savepath, c.id+".jpg");
if(File.Exists(jpg)){
Bitmap bp=new Bitmap(jpg);
Bitmap bmp=null;
if(c.IsType(CardType.XYZ)){
bmp = MyBitmap.Cut(bp,
imgSet.xyz_x,imgSet.xyz_y,
imgSet.xyz_w,imgSet.xyz_h);
}
else if(c.IsType(CardType.PENDULUM)){
bmp = MyBitmap.Cut(bp,
imgSet.pendulum_x,imgSet.pendulum_y,
imgSet.pendulum_w,imgSet.pendulum_h);
}
else{
bmp = MyBitmap.Cut(bp,
imgSet.other_x,imgSet.other_y,
imgSet.other_w,imgSet.other_h);
}
MyBitmap.SaveAsJPEG(bmp, savejpg, imgSet.quilty);
}
}
}
public static void ToImg(string img,string saveimg1,string saveimg2){
imgSet.Init();
if(!File.Exists(img))
return;
Bitmap bmp=new Bitmap(img);
MyBitmap.SaveAsJPEG(MyBitmap.Zoom(bmp, imgSet.W, imgSet.H),
saveimg1, imgSet.quilty);
MyBitmap.SaveAsJPEG(MyBitmap.Zoom(bmp, imgSet.w, imgSet.h),
saveimg2, imgSet.quilty);
}
public static void Run(){
switch(nowTask){
case MyTask.CheckUpdate:
bool showNew=false;
if(mArgs!=null && mArgs.Length>=1){
showNew=(mArgs[0]==Boolean.TrueString)?true:false;
}
OnCheckUpdate(showNew);
break;
case MyTask.CopyDataBase:
if(mArgs!=null && mArgs.Length>=2){
string filename=mArgs[0];
bool replace=(mArgs[1]==Boolean.TrueString)?true:false;
DataBase.CopyDB(filename, replace,cardlist);
//
MyMsg.Show(LMSG.copyDBIsOK);
}
break;
case MyTask.CutImages:
if(mArgs!=null && mArgs.Length>=2){
CutImages(mArgs[0],mArgs[1]);
MyMsg.Show(LMSG.CutImageOK);
}
break;
case MyTask.SaveAsMSE:
if(mArgs!=null && mArgs.Length>=2){
MSE.Save(mArgs[0], cardlist, mArgs[1]);
MyMsg.Show(LMSG.SaveMseOK);
}
break;
}
nowTask=MyTask.NONE;
cardlist=null;
mArgs=null;
}
}
}
...@@ -40,11 +40,17 @@ private void InitializeComponent() ...@@ -40,11 +40,17 @@ private void InitializeComponent()
this.menuitem_open = new System.Windows.Forms.ToolStripMenuItem(); this.menuitem_open = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_new = new System.Windows.Forms.ToolStripMenuItem(); this.menuitem_new = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_copyselectto = new System.Windows.Forms.ToolStripMenuItem(); this.menuitem_copyselectto = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_saveasmse_select = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_copyto = new System.Windows.Forms.ToolStripMenuItem(); this.menuitem_copyto = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_saveasmse = new System.Windows.Forms.ToolStripMenuItem();
this.tsep4 = new System.Windows.Forms.ToolStripSeparator();
this.menuitem_cutimages = new System.Windows.Forms.ToolStripMenuItem();
this.tsep1 = new System.Windows.Forms.ToolStripSeparator(); this.tsep1 = new System.Windows.Forms.ToolStripSeparator();
this.menuitem_readydk = new System.Windows.Forms.ToolStripMenuItem(); this.menuitem_readydk = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_readimages = new System.Windows.Forms.ToolStripMenuItem(); this.menuitem_readimages = new System.Windows.Forms.ToolStripMenuItem();
this.tsep3 = new System.Windows.Forms.ToolStripSeparator(); this.tsep3 = new System.Windows.Forms.ToolStripSeparator();
this.menuitem_openLastDataBase = new System.Windows.Forms.ToolStripMenuItem();
this.tsep2 = new System.Windows.Forms.ToolStripSeparator();
this.menuitem_quit = new System.Windows.Forms.ToolStripMenuItem(); this.menuitem_quit = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_help = new System.Windows.Forms.ToolStripMenuItem(); this.menuitem_help = new System.Windows.Forms.ToolStripMenuItem();
this.menuitem_about = new System.Windows.Forms.ToolStripMenuItem(); this.menuitem_about = new System.Windows.Forms.ToolStripMenuItem();
...@@ -96,6 +102,9 @@ private void InitializeComponent() ...@@ -96,6 +102,9 @@ private void InitializeComponent()
this.lb_tiptexts = new System.Windows.Forms.Label(); this.lb_tiptexts = new System.Windows.Forms.Label();
this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker(); this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker();
this.btn_undo = new System.Windows.Forms.Button(); this.btn_undo = new System.Windows.Forms.Button();
this.tb_setcode = new System.Windows.Forms.TextBox();
this.lb_setcode = new System.Windows.Forms.Label();
this.btn_img = new System.Windows.Forms.Button();
this.menuStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
...@@ -116,11 +125,17 @@ private void InitializeComponent() ...@@ -116,11 +125,17 @@ private void InitializeComponent()
this.menuitem_open, this.menuitem_open,
this.menuitem_new, this.menuitem_new,
this.menuitem_copyselectto, this.menuitem_copyselectto,
this.menuitem_saveasmse_select,
this.menuitem_copyto, this.menuitem_copyto,
this.menuitem_saveasmse,
this.tsep4,
this.menuitem_cutimages,
this.tsep1, this.tsep1,
this.menuitem_readydk, this.menuitem_readydk,
this.menuitem_readimages, this.menuitem_readimages,
this.tsep3, this.tsep3,
this.menuitem_openLastDataBase,
this.tsep2,
this.menuitem_quit}); this.menuitem_quit});
this.menuitem_file.Name = "menuitem_file"; this.menuitem_file.Name = "menuitem_file";
this.menuitem_file.Size = new System.Drawing.Size(53, 21); this.menuitem_file.Size = new System.Drawing.Size(53, 21);
...@@ -149,6 +164,14 @@ private void InitializeComponent() ...@@ -149,6 +164,14 @@ private void InitializeComponent()
this.menuitem_copyselectto.Text = "Select Copy To..."; this.menuitem_copyselectto.Text = "Select Copy To...";
this.menuitem_copyselectto.Click += new System.EventHandler(this.Menuitem_copyselecttoClick); this.menuitem_copyselectto.Click += new System.EventHandler(this.Menuitem_copyselecttoClick);
// //
// menuitem_saveasmse_select
//
this.menuitem_saveasmse_select.Enabled = false;
this.menuitem_saveasmse_select.Name = "menuitem_saveasmse_select";
this.menuitem_saveasmse_select.Size = new System.Drawing.Size(232, 22);
this.menuitem_saveasmse_select.Text = "Select Save As MSE";
this.menuitem_saveasmse_select.Click += new System.EventHandler(this.Menuitem_saveasmse_selectClick);
//
// menuitem_copyto // menuitem_copyto
// //
this.menuitem_copyto.Name = "menuitem_copyto"; this.menuitem_copyto.Name = "menuitem_copyto";
...@@ -156,6 +179,26 @@ private void InitializeComponent() ...@@ -156,6 +179,26 @@ private void InitializeComponent()
this.menuitem_copyto.Text = "All Now Copy To..."; this.menuitem_copyto.Text = "All Now Copy To...";
this.menuitem_copyto.Click += new System.EventHandler(this.Menuitem_copytoClick); this.menuitem_copyto.Click += new System.EventHandler(this.Menuitem_copytoClick);
// //
// menuitem_saveasmse
//
this.menuitem_saveasmse.Enabled = false;
this.menuitem_saveasmse.Name = "menuitem_saveasmse";
this.menuitem_saveasmse.Size = new System.Drawing.Size(232, 22);
this.menuitem_saveasmse.Text = "All Now Save As MSE";
this.menuitem_saveasmse.Click += new System.EventHandler(this.Menuitem_saveasmseClick);
//
// tsep4
//
this.tsep4.Name = "tsep4";
this.tsep4.Size = new System.Drawing.Size(229, 6);
//
// menuitem_cutimages
//
this.menuitem_cutimages.Name = "menuitem_cutimages";
this.menuitem_cutimages.Size = new System.Drawing.Size(232, 22);
this.menuitem_cutimages.Text = "Cut Images";
this.menuitem_cutimages.Click += new System.EventHandler(this.Menuitem_cutimagesClick);
//
// tsep1 // tsep1
// //
this.tsep1.Name = "tsep1"; this.tsep1.Name = "tsep1";
...@@ -180,6 +223,18 @@ private void InitializeComponent() ...@@ -180,6 +223,18 @@ private void InitializeComponent()
this.tsep3.Name = "tsep3"; this.tsep3.Name = "tsep3";
this.tsep3.Size = new System.Drawing.Size(229, 6); this.tsep3.Size = new System.Drawing.Size(229, 6);
// //
// menuitem_openLastDataBase
//
this.menuitem_openLastDataBase.Name = "menuitem_openLastDataBase";
this.menuitem_openLastDataBase.Size = new System.Drawing.Size(232, 22);
this.menuitem_openLastDataBase.Text = "Open Last DataBase";
this.menuitem_openLastDataBase.Click += new System.EventHandler(this.Menuitem_openLastDataBaseClick);
//
// tsep2
//
this.tsep2.Name = "tsep2";
this.tsep2.Size = new System.Drawing.Size(229, 6);
//
// menuitem_quit // menuitem_quit
// //
this.menuitem_quit.Name = "menuitem_quit"; this.menuitem_quit.Name = "menuitem_quit";
...@@ -305,6 +360,7 @@ private void InitializeComponent() ...@@ -305,6 +360,7 @@ private void InitializeComponent()
this.cb_setname2.Name = "cb_setname2"; this.cb_setname2.Name = "cb_setname2";
this.cb_setname2.Size = new System.Drawing.Size(140, 20); this.cb_setname2.Size = new System.Drawing.Size(140, 20);
this.cb_setname2.TabIndex = 2; this.cb_setname2.TabIndex = 2;
this.cb_setname2.SelectedIndexChanged += new System.EventHandler(this.Cb_setname2SelectedIndexChanged);
// //
// cb_setname1 // cb_setname1
// //
...@@ -314,6 +370,7 @@ private void InitializeComponent() ...@@ -314,6 +370,7 @@ private void InitializeComponent()
this.cb_setname1.Name = "cb_setname1"; this.cb_setname1.Name = "cb_setname1";
this.cb_setname1.Size = new System.Drawing.Size(140, 20); this.cb_setname1.Size = new System.Drawing.Size(140, 20);
this.cb_setname1.TabIndex = 2; this.cb_setname1.TabIndex = 2;
this.cb_setname1.SelectedIndexChanged += new System.EventHandler(this.Cb_setname1SelectedIndexChanged);
// //
// cb_setname4 // cb_setname4
// //
...@@ -323,6 +380,7 @@ private void InitializeComponent() ...@@ -323,6 +380,7 @@ private void InitializeComponent()
this.cb_setname4.Name = "cb_setname4"; this.cb_setname4.Name = "cb_setname4";
this.cb_setname4.Size = new System.Drawing.Size(140, 20); this.cb_setname4.Size = new System.Drawing.Size(140, 20);
this.cb_setname4.TabIndex = 2; this.cb_setname4.TabIndex = 2;
this.cb_setname4.SelectedIndexChanged += new System.EventHandler(this.Cb_setname4SelectedIndexChanged);
// //
// cb_setname3 // cb_setname3
// //
...@@ -332,17 +390,18 @@ private void InitializeComponent() ...@@ -332,17 +390,18 @@ private void InitializeComponent()
this.cb_setname3.Name = "cb_setname3"; this.cb_setname3.Name = "cb_setname3";
this.cb_setname3.Size = new System.Drawing.Size(140, 20); this.cb_setname3.Size = new System.Drawing.Size(140, 20);
this.cb_setname3.TabIndex = 2; this.cb_setname3.TabIndex = 2;
this.cb_setname3.SelectedIndexChanged += new System.EventHandler(this.Cb_setname3SelectedIndexChanged);
// //
// tb_cardtext // tb_cardtext
// //
this.tb_cardtext.AcceptsReturn = true; this.tb_cardtext.AcceptsReturn = true;
this.tb_cardtext.AcceptsTab = true; this.tb_cardtext.AcceptsTab = true;
this.tb_cardtext.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.tb_cardtext.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.tb_cardtext.Location = new System.Drawing.Point(220, 337); this.tb_cardtext.Location = new System.Drawing.Point(220, 365);
this.tb_cardtext.Multiline = true; this.tb_cardtext.Multiline = true;
this.tb_cardtext.Name = "tb_cardtext"; this.tb_cardtext.Name = "tb_cardtext";
this.tb_cardtext.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; this.tb_cardtext.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.tb_cardtext.Size = new System.Drawing.Size(326, 200); this.tb_cardtext.Size = new System.Drawing.Size(326, 172);
this.tb_cardtext.TabIndex = 4; this.tb_cardtext.TabIndex = 4;
this.tb_cardtext.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Tb_cardtextKeyDown); this.tb_cardtext.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Tb_cardtextKeyDown);
// //
...@@ -506,7 +565,7 @@ private void InitializeComponent() ...@@ -506,7 +565,7 @@ private void InitializeComponent()
// lb_cardcode // lb_cardcode
// //
this.lb_cardcode.AutoSize = true; this.lb_cardcode.AutoSize = true;
this.lb_cardcode.Location = new System.Drawing.Point(401, 288); this.lb_cardcode.Location = new System.Drawing.Point(399, 344);
this.lb_cardcode.Name = "lb_cardcode"; this.lb_cardcode.Name = "lb_cardcode";
this.lb_cardcode.Size = new System.Drawing.Size(59, 12); this.lb_cardcode.Size = new System.Drawing.Size(59, 12);
this.lb_cardcode.TabIndex = 7; this.lb_cardcode.TabIndex = 7;
...@@ -514,7 +573,7 @@ private void InitializeComponent() ...@@ -514,7 +573,7 @@ private void InitializeComponent()
// //
// tb_cardcode // tb_cardcode
// //
this.tb_cardcode.Location = new System.Drawing.Point(475, 285); this.tb_cardcode.Location = new System.Drawing.Point(474, 339);
this.tb_cardcode.MaxLength = 12; this.tb_cardcode.MaxLength = 12;
this.tb_cardcode.Name = "tb_cardcode"; this.tb_cardcode.Name = "tb_cardcode";
this.tb_cardcode.Size = new System.Drawing.Size(68, 21); this.tb_cardcode.Size = new System.Drawing.Size(68, 21);
...@@ -526,7 +585,7 @@ private void InitializeComponent() ...@@ -526,7 +585,7 @@ private void InitializeComponent()
// lb_cardalias // lb_cardalias
// //
this.lb_cardalias.AutoSize = true; this.lb_cardalias.AutoSize = true;
this.lb_cardalias.Location = new System.Drawing.Point(401, 261); this.lb_cardalias.Location = new System.Drawing.Point(221, 345);
this.lb_cardalias.Name = "lb_cardalias"; this.lb_cardalias.Name = "lb_cardalias";
this.lb_cardalias.Size = new System.Drawing.Size(65, 12); this.lb_cardalias.Size = new System.Drawing.Size(65, 12);
this.lb_cardalias.TabIndex = 7; this.lb_cardalias.TabIndex = 7;
...@@ -534,7 +593,7 @@ private void InitializeComponent() ...@@ -534,7 +593,7 @@ private void InitializeComponent()
// //
// tb_cardalias // tb_cardalias
// //
this.tb_cardalias.Location = new System.Drawing.Point(475, 258); this.tb_cardalias.Location = new System.Drawing.Point(301, 340);
this.tb_cardalias.MaxLength = 12; this.tb_cardalias.MaxLength = 12;
this.tb_cardalias.Name = "tb_cardalias"; this.tb_cardalias.Name = "tb_cardalias";
this.tb_cardalias.Size = new System.Drawing.Size(67, 21); this.tb_cardalias.Size = new System.Drawing.Size(67, 21);
...@@ -566,9 +625,9 @@ private void InitializeComponent() ...@@ -566,9 +625,9 @@ private void InitializeComponent()
// btn_lua // btn_lua
// //
this.btn_lua.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(64)))), ((int)(((byte)(0))))); this.btn_lua.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(64)))), ((int)(((byte)(0)))));
this.btn_lua.Location = new System.Drawing.Point(461, 539); this.btn_lua.Location = new System.Drawing.Point(465, 539);
this.btn_lua.Name = "btn_lua"; this.btn_lua.Name = "btn_lua";
this.btn_lua.Size = new System.Drawing.Size(84, 28); this.btn_lua.Size = new System.Drawing.Size(80, 28);
this.btn_lua.TabIndex = 5; this.btn_lua.TabIndex = 5;
this.btn_lua.Text = "&Lua Script"; this.btn_lua.Text = "&Lua Script";
this.btn_lua.UseVisualStyleBackColor = true; this.btn_lua.UseVisualStyleBackColor = true;
...@@ -576,9 +635,9 @@ private void InitializeComponent() ...@@ -576,9 +635,9 @@ private void InitializeComponent()
// //
// btn_reset // btn_reset
// //
this.btn_reset.Location = new System.Drawing.Point(306, 540); this.btn_reset.Location = new System.Drawing.Point(301, 539);
this.btn_reset.Name = "btn_reset"; this.btn_reset.Name = "btn_reset";
this.btn_reset.Size = new System.Drawing.Size(84, 28); this.btn_reset.Size = new System.Drawing.Size(80, 28);
this.btn_reset.TabIndex = 5; this.btn_reset.TabIndex = 5;
this.btn_reset.Text = "&Reset"; this.btn_reset.Text = "&Reset";
this.btn_reset.UseVisualStyleBackColor = true; this.btn_reset.UseVisualStyleBackColor = true;
...@@ -586,9 +645,9 @@ private void InitializeComponent() ...@@ -586,9 +645,9 @@ private void InitializeComponent()
// //
// btn_serach // btn_serach
// //
this.btn_serach.Location = new System.Drawing.Point(219, 540); this.btn_serach.Location = new System.Drawing.Point(219, 539);
this.btn_serach.Name = "btn_serach"; this.btn_serach.Name = "btn_serach";
this.btn_serach.Size = new System.Drawing.Size(84, 28); this.btn_serach.Size = new System.Drawing.Size(80, 28);
this.btn_serach.TabIndex = 0; this.btn_serach.TabIndex = 0;
this.btn_serach.Text = "&Search"; this.btn_serach.Text = "&Search";
this.btn_serach.UseVisualStyleBackColor = true; this.btn_serach.UseVisualStyleBackColor = true;
...@@ -683,11 +742,43 @@ private void InitializeComponent() ...@@ -683,11 +742,43 @@ private void InitializeComponent()
this.btn_undo.UseVisualStyleBackColor = true; this.btn_undo.UseVisualStyleBackColor = true;
this.btn_undo.Click += new System.EventHandler(this.Btn_undoClick); this.btn_undo.Click += new System.EventHandler(this.Btn_undoClick);
// //
// tb_setcode
//
this.tb_setcode.Location = new System.Drawing.Point(403, 283);
this.tb_setcode.MaxLength = 19;
this.tb_setcode.Name = "tb_setcode";
this.tb_setcode.Size = new System.Drawing.Size(139, 21);
this.tb_setcode.TabIndex = 15;
this.tb_setcode.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
this.tb_setcode.TextChanged += new System.EventHandler(this.Tb_setcodeTextChanged);
//
// lb_setcode
//
this.lb_setcode.AutoSize = true;
this.lb_setcode.Location = new System.Drawing.Point(405, 264);
this.lb_setcode.Name = "lb_setcode";
this.lb_setcode.Size = new System.Drawing.Size(113, 12);
this.lb_setcode.TabIndex = 16;
this.lb_setcode.Text = "SetCode (Max 4)";
//
// btn_img
//
this.btn_img.Location = new System.Drawing.Point(383, 539);
this.btn_img.Name = "btn_img";
this.btn_img.Size = new System.Drawing.Size(80, 28);
this.btn_img.TabIndex = 17;
this.btn_img.Text = "&Image";
this.btn_img.UseVisualStyleBackColor = true;
this.btn_img.Click += new System.EventHandler(this.Btn_imgClick);
//
// DataEditForm // DataEditForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(860, 568); this.ClientSize = new System.Drawing.Size(860, 568);
this.Controls.Add(this.btn_img);
this.Controls.Add(this.lb_setcode);
this.Controls.Add(this.tb_setcode);
this.Controls.Add(this.pl_image); this.Controls.Add(this.pl_image);
this.Controls.Add(this.pl_category); this.Controls.Add(this.pl_category);
this.Controls.Add(this.pl_cardtype); this.Controls.Add(this.pl_cardtype);
...@@ -745,6 +836,15 @@ private void InitializeComponent() ...@@ -745,6 +836,15 @@ private void InitializeComponent()
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
} }
private System.Windows.Forms.ToolStripSeparator tsep2;
private System.Windows.Forms.ToolStripMenuItem menuitem_openLastDataBase;
private System.Windows.Forms.ToolStripMenuItem menuitem_cutimages;
private System.Windows.Forms.ToolStripMenuItem menuitem_saveasmse;
private System.Windows.Forms.ToolStripMenuItem menuitem_saveasmse_select;
private System.Windows.Forms.ToolStripSeparator tsep4;
private System.Windows.Forms.Button btn_img;
private System.Windows.Forms.Label lb_setcode;
private System.Windows.Forms.TextBox tb_setcode;
private System.Windows.Forms.Button btn_undo; private System.Windows.Forms.Button btn_undo;
private System.ComponentModel.BackgroundWorker backgroundWorker1; private System.ComponentModel.BackgroundWorker backgroundWorker1;
private System.Windows.Forms.Panel pl_image; private System.Windows.Forms.Panel pl_image;
......
...@@ -21,8 +21,11 @@ namespace DataEditorX ...@@ -21,8 +21,11 @@ namespace DataEditorX
{ {
public partial class DataEditForm : Form public partial class DataEditForm : Form
{ {
string ydkfile=null;
string imagepath=null;
#region 成员变量 #region 成员变量
string GAMEPATH,PICPATH,LUAPTH; string GAMEPATH,PICPATH,PICPATH2,LUAPTH,IMAGEPATH;
Card oldCard=new Card(0); Card oldCard=new Card(0);
Card srcCard=new Card(0); Card srcCard=new Card(0);
string[] strs=null; string[] strs=null;
...@@ -31,9 +34,6 @@ public partial class DataEditForm : Form ...@@ -31,9 +34,6 @@ public partial class DataEditForm : Form
int MaxRow=20; int MaxRow=20;
int page=1,pageNum=1; int page=1,pageNum=1;
int cardcount; int cardcount;
bool isdownload;
bool isbgcheck;
string NEWVER="0.0.0.0";
string undoString; string undoString;
List<Card> cardlist=new List<Card>(); List<Card> cardlist=new List<Card>();
...@@ -66,7 +66,6 @@ public DataEditForm() ...@@ -66,7 +66,6 @@ public DataEditForm()
void DataEditFormLoad(object sender, EventArgs e) void DataEditFormLoad(object sender, EventArgs e)
{ {
InitListRows(); InitListRows();
//界面初始化 //界面初始化
string dir=ConfigurationManager.AppSettings["language"]; string dir=ConfigurationManager.AppSettings["language"];
if(string.IsNullOrEmpty(dir)) if(string.IsNullOrEmpty(dir))
...@@ -93,9 +92,9 @@ void DataEditFormLoad(object sender, EventArgs e) ...@@ -93,9 +92,9 @@ void DataEditFormLoad(object sender, EventArgs e)
//设置空白卡片 //设置空白卡片
oldCard=new Card(0); oldCard=new Card(0);
SetCard(oldCard); SetCard(oldCard);
isbgcheck=true;
isdownload=false; checkupdate(false);
//Menuitem_checkupdateClick(null,null);
if(File.Exists(nowCdbFile)) if(File.Exists(nowCdbFile))
Open(nowCdbFile); Open(nowCdbFile);
...@@ -108,16 +107,27 @@ void DataEditFormFormClosing(object sender, FormClosingEventArgs e) ...@@ -108,16 +107,27 @@ void DataEditFormFormClosing(object sender, FormClosingEventArgs e)
LANG.SaveLanguage(this, conflang+"bak.txt"); LANG.SaveLanguage(this, conflang+"bak.txt");
LANG.SaveMessage(confmsg+"bak.txt"); LANG.SaveMessage(confmsg+"bak.txt");
#endif #endif
if(!string.IsNullOrEmpty(nowCdbFile)){
Configuration cfa = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
cfa.AppSettings.Settings["cdb"].Value = nowCdbFile;
cfa.Save(ConfigurationSaveMode.Modified);
}
} }
void SetTitle()
{
if(string.IsNullOrEmpty(nowCdbFile))
this.Text=title;
else
this.Text=nowCdbFile+"-"+title;
}
//按cdb路径设置目录 //按cdb路径设置目录
void SetCDB(string cdb) void SetCDB(string cdb)
{ {
this.nowCdbFile=cdb; this.nowCdbFile=cdb;
SetTitle();
if(cdb.Length>0) if(cdb.Length>0)
{ {
this.Text=nowCdbFile+"-"+title;
char SEP=Path.DirectorySeparatorChar; char SEP=Path.DirectorySeparatorChar;
int l=nowCdbFile.LastIndexOf(SEP); int l=nowCdbFile.LastIndexOf(SEP);
GAMEPATH=(l>0)?nowCdbFile.Substring(0,l+1):cdb; GAMEPATH=(l>0)?nowCdbFile.Substring(0,l+1):cdb;
...@@ -125,6 +135,7 @@ void SetCDB(string cdb) ...@@ -125,6 +135,7 @@ void SetCDB(string cdb)
else else
GAMEPATH=Application.StartupPath; GAMEPATH=Application.StartupPath;
PICPATH=Path.Combine(GAMEPATH,"pics"); PICPATH=Path.Combine(GAMEPATH,"pics");
PICPATH2=Path.Combine(PICPATH,"thumbnail");
LUAPTH=Path.Combine(GAMEPATH,"script"); LUAPTH=Path.Combine(GAMEPATH,"script");
} }
//初始化文件路径 //初始化文件路径
...@@ -140,6 +151,8 @@ void InitPath(string datapath) ...@@ -140,6 +151,8 @@ void InitPath(string datapath)
confcategory=Path.Combine(datapath, "card-category.txt"); confcategory=Path.Combine(datapath, "card-category.txt");
confcover= Path.Combine(datapath, "cover.jpg"); confcover= Path.Combine(datapath, "cover.jpg");
confmsg = Path.Combine(datapath, "message.txt"); confmsg = Path.Combine(datapath, "message.txt");
IMAGEPATH=Path.Combine(Application.StartupPath,"Images");
} }
//保存dic //保存dic
...@@ -266,6 +279,8 @@ void SetCard(Card c) ...@@ -266,6 +279,8 @@ void SetCard(Card c)
SetSelect(dicSetnames, cb_setname2, (c.setcode>>0x10)&0xffff); SetSelect(dicSetnames, cb_setname2, (c.setcode>>0x10)&0xffff);
SetSelect(dicSetnames, cb_setname3, (c.setcode>>0x20)&0xffff); SetSelect(dicSetnames, cb_setname3, (c.setcode>>0x20)&0xffff);
SetSelect(dicSetnames, cb_setname4, (c.setcode>>0x30)&0xffff); SetSelect(dicSetnames, cb_setname4, (c.setcode>>0x30)&0xffff);
setSetcode(c.setcode);
SetCheck(pl_cardtype,c.type); SetCheck(pl_cardtype,c.type);
SetCheck(pl_category,c.category); SetCheck(pl_category,c.category);
...@@ -276,10 +291,7 @@ void SetCard(Card c) ...@@ -276,10 +291,7 @@ void SetCard(Card c)
tb_cardcode.Text=c.id.ToString(); tb_cardcode.Text=c.id.ToString();
tb_cardalias.Text=c.alias.ToString(); tb_cardalias.Text=c.alias.ToString();
string f=Path.Combine(PICPATH, c.id.ToString()+".jpg"); string f=Path.Combine(PICPATH, c.id.ToString()+".jpg");
if(File.Exists(f)) setImage(f);
pl_image.BackgroundImage=Image.FromFile(f);
else
pl_image.BackgroundImage=m_cover;
} }
//设置checkbox //设置checkbox
...@@ -349,7 +361,6 @@ int SetSelect(Dictionary<long, string> dic,ComboBox cb, long k) ...@@ -349,7 +361,6 @@ int SetSelect(Dictionary<long, string> dic,ComboBox cb, long k)
Card GetCard() Card GetCard()
{ {
int temp; int temp;
long ltemp;
Card c=new Card(0); Card c=new Card(0);
c.name=tb_cardname.Text; c.name=tb_cardname.Text;
c.desc=tb_cardtext.Text; c.desc=tb_cardtext.Text;
...@@ -360,14 +371,7 @@ Card GetCard() ...@@ -360,14 +371,7 @@ Card GetCard()
long.TryParse(GetSelect(dicCardLevels,cb_cardlevel),out c.level); long.TryParse(GetSelect(dicCardLevels,cb_cardlevel),out c.level);
long.TryParse(GetSelect(dicCardRaces,cb_cardrace),out c.race); long.TryParse(GetSelect(dicCardRaces,cb_cardrace),out c.race);
long.TryParse(GetSelect(dicSetnames, cb_setname1), out ltemp); c.setcode = getSetcodeByText();
c.setcode+=ltemp;
long.TryParse(GetSelect(dicSetnames, cb_setname2), out ltemp);
c.setcode+=(ltemp<<0x10);
long.TryParse(GetSelect(dicSetnames, cb_setname3), out ltemp);
c.setcode+=(ltemp<<0x20);
long.TryParse(GetSelect(dicSetnames, cb_setname4), out ltemp);
c.setcode+=(ltemp<<0x30);
c.type=GetCheck(pl_cardtype); c.type=GetCheck(pl_cardtype);
c.category=GetCheck(pl_category); c.category=GetCheck(pl_category);
...@@ -470,6 +474,8 @@ void AddListView(int p) ...@@ -470,6 +474,8 @@ void AddListView(int p)
mcard=cardlist[i]; mcard=cardlist[i];
items[j]=new ListViewItem(); items[j]=new ListViewItem();
items[j].Text=mcard.id.ToString(); items[j].Text=mcard.id.ToString();
if(mcard.id==oldCard.id)
items[j].Checked=true;
if ( i % 2 == 0 ) if ( i % 2 == 0 )
items[j].BackColor = Color.GhostWhite; items[j].BackColor = Color.GhostWhite;
else else
...@@ -546,9 +552,12 @@ public bool Open(string cdbFile) ...@@ -546,9 +552,12 @@ public bool Open(string cdbFile)
MyMsg.Error(LMSG.FileIsNotExists); MyMsg.Error(LMSG.FileIsNotExists);
return false; return false;
} }
ydkfile=null;
imagepath=null;
SetCDB(cdbFile); SetCDB(cdbFile);
cardlist.Clear(); cardlist.Clear();
DataBase.CheckTable(cdbFile); DataBase.CheckTable(cdbFile);
srcCard=new Card();
SetCards(DataBase.Read(cdbFile,true,""),false); SetCards(DataBase.Read(cdbFile,true,""),false);
return true; return true;
...@@ -587,6 +596,11 @@ public void Search(Card c, bool isfresh) ...@@ -587,6 +596,11 @@ public void Search(Card c, bool isfresh)
{ {
if(!Check()) if(!Check())
return; return;
if(!string.IsNullOrEmpty(ydkfile))
SetCards(DataBase.ReadYdk(nowCdbFile, ydkfile), false);
else if(!string.IsNullOrEmpty(imagepath))
SetCards(DataBase.ReadImage(nowCdbFile, imagepath), false);
else{
srcCard=c; srcCard=c;
string sql=DataBase.GetSelectSQL(c); string sql=DataBase.GetSelectSQL(c);
#if DEBUG #if DEBUG
...@@ -594,6 +608,7 @@ public void Search(Card c, bool isfresh) ...@@ -594,6 +608,7 @@ public void Search(Card c, bool isfresh)
#endif #endif
SetCards(DataBase.Read(nowCdbFile, true, sql),isfresh); SetCards(DataBase.Read(nowCdbFile, true, sql),isfresh);
} }
}
public void Reset() public void Reset()
{ {
...@@ -671,6 +686,7 @@ public bool ModCard() ...@@ -671,6 +686,7 @@ public bool ModCard()
undoString=DataBase.GetDeleteSQL(c); undoString=DataBase.GetDeleteSQL(c);
undoString+=DataBase.GetInsertSQL(oldCard,false); undoString+=DataBase.GetInsertSQL(oldCard,false);
Search(srcCard, true); Search(srcCard, true);
SetCard(c);
} }
else else
MyMsg.Error(LMSG.ModifyFail); MyMsg.Error(LMSG.ModifyFail);
...@@ -719,6 +735,8 @@ public bool OpenScript() ...@@ -719,6 +735,8 @@ public bool OpenScript()
string lua=Path.Combine(LUAPTH,"c"+tb_cardcode.Text+".lua"); string lua=Path.Combine(LUAPTH,"c"+tb_cardcode.Text+".lua");
if(!File.Exists(lua)) if(!File.Exists(lua))
{ {
if(! Directory.Exists(LUAPTH))
Directory.CreateDirectory(LUAPTH);
if(MyMsg.Question(LMSG.IfCreateScript)) if(MyMsg.Question(LMSG.IfCreateScript))
{ {
if(!Directory.Exists(LUAPTH)) if(!Directory.Exists(LUAPTH))
...@@ -736,7 +754,9 @@ public bool OpenScript() ...@@ -736,7 +754,9 @@ public bool OpenScript()
} }
} }
if(File.Exists(lua)) if(File.Exists(lua))
{
System.Diagnostics.Process.Start(lua); System.Diagnostics.Process.Start(lua);
}
return false; return false;
} }
//撤销 //撤销
...@@ -756,6 +776,8 @@ public void Undo() ...@@ -756,6 +776,8 @@ public void Undo()
//搜索卡片 //搜索卡片
void Btn_serachClick(object sender, EventArgs e) void Btn_serachClick(object sender, EventArgs e)
{ {
ydkfile=null;
imagepath=null;
Search(GetCard(), false); Search(GetCard(), false);
} }
//重置卡片 //重置卡片
...@@ -787,6 +809,35 @@ void Btn_undoClick(object sender, EventArgs e) ...@@ -787,6 +809,35 @@ void Btn_undoClick(object sender, EventArgs e)
{ {
Undo(); Undo();
} }
void Btn_imgClick(object sender, EventArgs e)
{
string tid=tb_cardcode.Text;
if(tid=="0" || tid.Length==0)
return;
using(OpenFileDialog dlg=new OpenFileDialog())
{
dlg.Title=LANG.GetMsg(LMSG.SelectImage)+"-"+tb_cardname.Text;
dlg.Filter=LANG.GetMsg(LMSG.ImageType);
if(dlg.ShowDialog()==DialogResult.OK)
{
//dlg.FileName;
pl_image.BackgroundImage.Dispose();
pl_image.BackgroundImage=m_cover;
string f=Path.Combine(PICPATH,tid+".jpg");
TaskHelper.ToImg(dlg.FileName,f,
Path.Combine(PICPATH2,tid+".jpg"));
setImage(f);
}
}
}
void setImage(string f){
if(File.Exists(f)){
Bitmap temp=new Bitmap(f);
pl_image.BackgroundImage=temp;
}
else
pl_image.BackgroundImage=m_cover;
}
#endregion #endregion
#region 文本框 #region 文本框
...@@ -799,8 +850,9 @@ void Tb_cardcodeKeyPress(object sender, KeyPressEventArgs e) ...@@ -799,8 +850,9 @@ void Tb_cardcodeKeyPress(object sender, KeyPressEventArgs e)
long.TryParse(tb_cardcode.Text, out c.id); long.TryParse(tb_cardcode.Text, out c.id);
if(c.id>0) if(c.id>0)
{ {
string sql=DataBase.GetSelectSQL(c); ydkfile=null;
SetCards(DataBase.Read(nowCdbFile, true, sql), false); imagepath=null;
Search(c, false);
} }
} }
} }
...@@ -811,8 +863,11 @@ void Tb_cardnameKeyDown(object sender, KeyEventArgs e) ...@@ -811,8 +863,11 @@ void Tb_cardnameKeyDown(object sender, KeyEventArgs e)
{ {
Card c=new Card(0); Card c=new Card(0);
c.name=tb_cardname.Text; c.name=tb_cardname.Text;
string sql=DataBase.GetSelectSQL(c); if(c.name.Length>0){
SetCards(DataBase.Read(nowCdbFile, true, sql), false); ydkfile=null;
imagepath=null;
Search(c, false);
}
} }
} }
//卡片描述编辑 //卡片描述编辑
...@@ -882,11 +937,14 @@ void Menuitem_aboutClick(object sender, EventArgs e) ...@@ -882,11 +937,14 @@ void Menuitem_aboutClick(object sender, EventArgs e)
void Menuitem_checkupdateClick(object sender, EventArgs e) void Menuitem_checkupdateClick(object sender, EventArgs e)
{ {
if(!backgroundWorker1.IsBusy) checkupdate(true);
}
void checkupdate(bool showNew)
{ {
isdownload=false; if(!isRun())
isbgcheck=false; {
backgroundWorker1.RunWorkerAsync(); TaskHelper.SetTask(MyTask.CheckUpdate,null,showNew.ToString());
Run(LANG.GetMsg(LMSG.checkUpdate));
} }
} }
...@@ -926,45 +984,6 @@ void Menuitem_newClick(object sender, EventArgs e) ...@@ -926,45 +984,6 @@ void Menuitem_newClick(object sender, EventArgs e)
} }
} }
void Menuitem_copytoClick(object sender, EventArgs e)
{
CopyTo(false);
}
void Menuitem_copyselecttoClick(object sender, EventArgs e)
{
CopyTo(true);
}
void CopyTo(bool onlyselect)
{
if(!Check())
return;
List<Card> cards=new List<Card>();
if(onlyselect)
{
foreach(ListViewItem lvitem in lv_cardlist.SelectedItems)
{
int index=lvitem.Index+(page-1)*MaxRow;
if(index<cardlist.Count)
cards.Add(cardlist[index]);
}
}
else
cards.AddRange(cardlist.ToArray());
using(OpenFileDialog dlg=new OpenFileDialog())
{
dlg.Title=LANG.GetMsg(LMSG.SelectDataBasePath);
dlg.Filter=LANG.GetMsg(LMSG.CdbType);
if(dlg.ShowDialog()==DialogResult.OK)
{
if(MyMsg.Question(LMSG.IfReplaceExistingCard))
DataBase.CopyDB(dlg.FileName,false,cards.ToArray());
else
DataBase.CopyDB(dlg.FileName,true,cards.ToArray());
}
}
}
void Menuitem_readydkClick(object sender, EventArgs e) void Menuitem_readydkClick(object sender, EventArgs e)
{ {
if(!Check()) if(!Check())
...@@ -975,7 +994,8 @@ void Menuitem_readydkClick(object sender, EventArgs e) ...@@ -975,7 +994,8 @@ void Menuitem_readydkClick(object sender, EventArgs e)
dlg.Filter=LANG.GetMsg(LMSG.ydkType); dlg.Filter=LANG.GetMsg(LMSG.ydkType);
if(dlg.ShowDialog()==DialogResult.OK) if(dlg.ShowDialog()==DialogResult.OK)
{ {
SetCards(DataBase.ReadYdk(nowCdbFile, dlg.FileName), false); ydkfile=dlg.FileName;
SetCards(DataBase.ReadYdk(nowCdbFile, ydkfile), false);
} }
} }
} }
...@@ -989,9 +1009,17 @@ void Menuitem_readimagesClick(object sender, EventArgs e) ...@@ -989,9 +1009,17 @@ void Menuitem_readimagesClick(object sender, EventArgs e)
fdlg.Description= LANG.GetMsg(LMSG.SelectImagePath); fdlg.Description= LANG.GetMsg(LMSG.SelectImagePath);
if(fdlg.ShowDialog()==DialogResult.OK) if(fdlg.ShowDialog()==DialogResult.OK)
{ {
SetCards(DataBase.ReadImage(nowCdbFile, fdlg.SelectedPath), false); imagepath=fdlg.SelectedPath;
SetCards(DataBase.ReadImage(nowCdbFile, imagepath), false);
}
} }
} }
//打开最后的数据库
void Menuitem_openLastDataBaseClick(object sender, EventArgs e)
{
string cdb=System.Configuration.ConfigurationManager.AppSettings["cdb"];
if(File.Exists(cdb))
Open(cdb);
} }
//关闭 //关闭
void Menuitem_quitClick(object sender, EventArgs e) void Menuitem_quitClick(object sender, EventArgs e)
...@@ -1001,70 +1029,220 @@ void Menuitem_quitClick(object sender, EventArgs e) ...@@ -1001,70 +1029,220 @@ void Menuitem_quitClick(object sender, EventArgs e)
#endregion #endregion
#region 线程 #region 线程
bool isRun(){
if(backgroundWorker1.IsBusy){
MyMsg.Warning(LMSG.RunError);
return true;
}
return false;
}
void Run(string name){
if(isRun())
return;
title=title+" ("+name+")";
SetTitle();
backgroundWorker1.RunWorkerAsync();
}
//线程任务 //线程任务
void BackgroundWorker1DoWork(object sender, System.ComponentModel.DoWorkEventArgs e) void BackgroundWorker1DoWork(object sender, System.ComponentModel.DoWorkEventArgs e)
{ {
if(isdownload) TaskHelper.Run();
CheckUpdate.DownLoad(Path.Combine(Application.StartupPath, NEWVER+".zip"));
else
{
NEWVER=CheckUpdate.Check(ConfigurationManager.AppSettings["updateURL"]);
}
} }
//任务完成 //任务完成
void BackgroundWorker1RunWorkerCompleted(object sender, System.ComponentModel.RunWorkerCompletedEventArgs e) void BackgroundWorker1RunWorkerCompleted(object sender, System.ComponentModel.RunWorkerCompletedEventArgs e)
{ {
if(isdownload) //TaskHelper.getTask();
int t=title.LastIndexOf(" (");
if(t>0)
{ {
if(CheckUpdate.isOK) title=title.Substring(0,t);
MyMsg.Show(LMSG.DownloadSucceed); SetTitle();
else }
MyMsg.Show(LMSG.DownloadFail);
} }
#endregion
#region setcode
void setSetcode(long setcode){
string setname="";
if(setcode<0){
setcode = getSetcodeBySelect();
}
long s1=setcode&0xffff;
long s2=(setcode>>0x10)&0xffff;
long s3=(setcode>>0x20)&0xffff;
long s4=(setcode>>0x30)&0xffff;
if(s4>0)
setname=s4.ToString("x")
+" "+s3.ToString("x")
+" "+s2.ToString("x")
+" "+s1.ToString("x");
else if(s3>0)
setname=s3.ToString("x")
+" "+s2.ToString("x")
+" "+s1.ToString("x");
else if(s2>0)
setname=s2.ToString("x")
+" "+s1.ToString("x");
else if(s1>0)
setname=s1.ToString("x");
else else
setname="0";
tb_setcode.Text=setname;
}
long getSetcodeByText(){
long ltemp;
long.TryParse(tb_setcode.Text.Replace(" ",""),
NumberStyles.HexNumber, null, out ltemp);
return ltemp;
}
long getSetcodeBySelect(){
long ltemp;
long setcode;
long.TryParse(GetSelect(dicSetnames, cb_setname1), out ltemp);
setcode=ltemp;
long.TryParse(GetSelect(dicSetnames, cb_setname2), out ltemp);
setcode+=(ltemp<<0x10);
long.TryParse(GetSelect(dicSetnames, cb_setname3), out ltemp);
setcode+=(ltemp<<0x20);
long.TryParse(GetSelect(dicSetnames, cb_setname4), out ltemp);
setcode+=(ltemp<<0x30);
return setcode;
}
void Cb_setname2SelectedIndexChanged(object sender, EventArgs e)
{ {
string newver=NEWVER; setSetcode(-1);
int iver,iver2; }
int.TryParse(Application.ProductVersion.Replace(".",""), out iver);
int.TryParse(newver.Replace(".",""), out iver2); void Cb_setname1SelectedIndexChanged(object sender, EventArgs e)
if(iver2>iver)
{ {
if(MyMsg.Question(LMSG.HaveNewVersion)) setSetcode(-1);
}
void Cb_setname3SelectedIndexChanged(object sender, EventArgs e)
{ {
if(!backgroundWorker1.IsBusy) setSetcode(-1);
}
void Cb_setname4SelectedIndexChanged(object sender, EventArgs e)
{ {
isdownload=true; setSetcode(-1);
isbgcheck=false;
backgroundWorker1.RunWorkerAsync();
} }
void Tb_setcodeTextChanged(object sender, EventArgs e)
{
long sc=getSetcodeByText();
if(sc==0 && tb_setcode.Text.Length>1){
MyMsg.Show(LMSG.Setcode_error);
} }
else
setSetcode(sc);
} }
else if(iver2>0) #endregion
#region copy cards
Card[] getCardList(bool onlyselect){
List<Card> cards=new List<Card>();
if(onlyselect)
{
foreach(ListViewItem lvitem in lv_cardlist.SelectedItems)
{ {
if(!isbgcheck) int index=lvitem.Index+(page-1)*MaxRow;
if(index<cardlist.Count)
cards.Add(cardlist[index]);
}
}
else
cards.AddRange(cardlist.ToArray());
if(cards.Count==0){
MyMsg.Show(LMSG.NoSelectCard);
return null;
}
return cards.ToArray();
}
void Menuitem_copytoClick(object sender, EventArgs e)
{ {
if( MyMsg.Question(LMSG.NowIsNewVersion)) CopyTo(false);
}
void Menuitem_copyselecttoClick(object sender, EventArgs e)
{ {
CopyTo(true);
}
if(!backgroundWorker1.IsBusy) void CopyTo(bool onlyselect)
{ {
isdownload=true; if(!Check())
isbgcheck=false; return;
backgroundWorker1.RunWorkerAsync(); if(isRun())
return;
Card[] cards=getCardList(onlyselect);
if(cards==null)
return;
//select file
bool replace=false;
string filename=null;
using(OpenFileDialog dlg=new OpenFileDialog())
{
dlg.Title=LANG.GetMsg(LMSG.SelectDataBasePath);
dlg.Filter=LANG.GetMsg(LMSG.CdbType);
if(dlg.ShowDialog()==DialogResult.OK)
{
filename=dlg.FileName;
replace=MyMsg.Question(LMSG.IfReplaceExistingCard);
} }
} }
if(!string.IsNullOrEmpty(filename)){
TaskHelper.SetTask(MyTask.CopyDataBase, cards, filename, replace.ToString());
Run(LANG.GetMsg(LMSG.copyCards));
} }
} }
else #endregion
#region MSE set
void Menuitem_cutimagesClick(object sender, EventArgs e)
{ {
if(!isbgcheck) if(!Check())
MyMsg.Error(LMSG.CheckUpdateFail); return;
if(isRun())
return;
TaskHelper.SetTask(MyTask.CutImages, cardlist.ToArray(),
PICPATH, IMAGEPATH);
Run(LANG.GetMsg(LMSG.CutImage));
}
void Menuitem_saveasmse_selectClick(object sender, EventArgs e)
{
SaveAsMSE(true);
}
void Menuitem_saveasmseClick(object sender, EventArgs e)
{
SaveAsMSE(false);
}
void SaveAsMSE(bool onlyselect){
if(!Check())
return;
if(isRun())
return;
Card[] cards=getCardList(onlyselect);
if(cards==null)
return;
//select save mse-set
using(SaveFileDialog dlg=new SaveFileDialog())
{
dlg.Title=LANG.GetMsg(LMSG.selectMseset);
dlg.Filter=LANG.GetMsg(LMSG.MseType);
if(dlg.ShowDialog()==DialogResult.OK)
{
TaskHelper.SetTask(MyTask.SaveAsMSE,cards,
dlg.FileName,IMAGEPATH);
Run(LANG.GetMsg(LMSG.SaveMse));
} }
} }
} }
#endregion #endregion
} }
} }
...@@ -56,9 +56,15 @@ ...@@ -56,9 +56,15 @@
<ItemGroup> <ItemGroup>
<Compile Include="Common\CheckUpdate.cs" /> <Compile Include="Common\CheckUpdate.cs" />
<Compile Include="Common\DoubleContorl.cs" /> <Compile Include="Common\DoubleContorl.cs" />
<Compile Include="Common\MyBitmap.cs" />
<Compile Include="Common\ZipStorer.cs" />
<Compile Include="Core\Card.cs" /> <Compile Include="Core\Card.cs" />
<Compile Include="Core\CardType.cs" />
<Compile Include="Core\DataBase.cs" /> <Compile Include="Core\DataBase.cs" />
<Compile Include="Core\DataManager.cs" /> <Compile Include="Core\DataManager.cs" />
<Compile Include="Core\ImageSet.cs" />
<Compile Include="Core\MSE.cs" />
<Compile Include="Core\TaskHelper.cs" />
<Compile Include="DataEditForm.cs" /> <Compile Include="DataEditForm.cs" />
<Compile Include="DataEditForm.Designer.cs"> <Compile Include="DataEditForm.Designer.cs">
<DependentUpon>DataEditForm.cs</DependentUpon> <DependentUpon>DataEditForm.cs</DependentUpon>
...@@ -80,6 +86,7 @@ ...@@ -80,6 +86,7 @@
<Folder Include="english" /> <Folder Include="english" />
<Folder Include="Common" /> <Folder Include="Common" />
<Folder Include="Language" /> <Folder Include="Language" />
<Folder Include="mse" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="app.config"> <None Include="app.config">
...@@ -145,6 +152,18 @@ ...@@ -145,6 +152,18 @@
<None Include="english\message.txt"> <None Include="english\message.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Include="mse\readme.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="mse\download.bat">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="mse\update.exe">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="mse\update.exe.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="readme.txt"> <None Include="readme.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
......
...@@ -49,6 +49,20 @@ public enum LMSG : uint ...@@ -49,6 +49,20 @@ public enum LMSG : uint
Author, Author,
CdbType, CdbType,
ydkType, ydkType,
Setcode_error,
SelectImage,
ImageType,
RunError,
checkUpdate,
copyCards,
copyDBIsOK,
selectMseset,
MseType,
SaveMse,
SaveMseOK,
CutImage,
CutImageOK,
NoSelectCard,
COUNT, COUNT,
} }
} }
...@@ -28,4 +28,4 @@ ...@@ -28,4 +28,4 @@
// //
// You can specify all the values or you can use the default the Revision and // You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below: // Build Numbers by using the '*' as shown below:
[assembly: AssemblyVersion("1.4.1.0")] [assembly: AssemblyVersion("1.5.0.0")]
...@@ -16,5 +16,12 @@ ...@@ -16,5 +16,12 @@
<add key="sourceURL" value="https://github.com/247321453/DataEditorX" /> <add key="sourceURL" value="https://github.com/247321453/DataEditorX" />
<!-- DataEditorX update url--> <!-- DataEditorX update url-->
<add key="updateURL" value="https://github.com/247321453/DataEditorX/tree/master/win32/readme.txt" /> <add key="updateURL" value="https://github.com/247321453/DataEditorX/tree/master/win32/readme.txt" />
<!-- Defult DataBase -->
<add key="cdb" value="cards.cdb" />
<add key="image_quilty" value="96" />
<add key="image" value="44,64,177,254" />
<add key="image_other" value="25,54,128,128" />
<add key="image_xyz" value="24,51,128,128" />
<add key="image_pendulum" value="13,46,150,120" />
</appSettings> </appSettings>
</configuration> </configuration>
DataEditForm->btn_add 添加(&A) DataEditForm->btn_add 添加(&A)
DataEditForm->btn_del 删除(&D) DataEditForm->btn_del 删除(&D)
DataEditForm->btn_lua 脚本(&L) DataEditForm->btn_lua 脚本(&L)
DataEditForm->btn_img 导入卡图(&I)
DataEditForm->btn_undo 撤销(&U) DataEditForm->btn_undo 撤销(&U)
DataEditForm->btn_mod 修改(&M) DataEditForm->btn_mod 修改(&M)
DataEditForm->btn_PageDown 下一页 DataEditForm->btn_PageDown 下一页
...@@ -15,15 +16,20 @@ DataEditForm->lb_categorys 效果种类 ...@@ -15,15 +16,20 @@ DataEditForm->lb_categorys 效果种类
DataEditForm->lb_pleft_right PScale DataEditForm->lb_pleft_right PScale
DataEditForm->lb_scripttext DataEditForm->lb_scripttext
DataEditForm->lb_tiptexts 提示文字 DataEditForm->lb_tiptexts 提示文字
DataEditForm->lb_setcode 卡片系列(最多4个)
DataEditForm->lb_types 卡片种类 DataEditForm->lb_types 卡片种类
DataEditForm->lb2 / DataEditForm->lb2 /
DataEditForm->lb4 / DataEditForm->lb4 /
DataEditForm->lb5 / DataEditForm->lb5 /
DataEditForm->lv_cardlist0 卡片密码 DataEditForm->lv_cardlist0 卡片密码
DataEditForm->lv_cardlist1 卡片名称 DataEditForm->lv_cardlist1 卡片名称
DataEditForm->menuitem_openLastDataBase 最后打开的数据库
DataEditForm->menuitem_cutimages 裁剪列表卡片的图片
DataEditForm->menuitem_saveasmse_select 所选卡片导出MSE存档
DataEditForm->menuitem_saveasmse 当前所有卡片导出MSE存档
DataEditForm->menuitem_about 关于(&A) DataEditForm->menuitem_about 关于(&A)
DataEditForm->menuitem_checkupdate 检查更新 DataEditForm->menuitem_checkupdate 检查更新
DataEditForm->menuitem_copyselectto 选中卡片复制到... DataEditForm->menuitem_copyselectto 所选卡片复制到...
DataEditForm->menuitem_copyto 当前所有卡片复制到... DataEditForm->menuitem_copyto 当前所有卡片复制到...
DataEditForm->menuitem_file 文件(&F) DataEditForm->menuitem_file 文件(&F)
DataEditForm->menuitem_github 源码主页 DataEditForm->menuitem_github 源码主页
......
...@@ -33,4 +33,17 @@ ...@@ -33,4 +33,17 @@
0x20 作者: 0x20 作者:
0x21 cdb文件(*.cdb)|*.cdb|所有文件(*.*)|*.* 0x21 cdb文件(*.cdb)|*.cdb|所有文件(*.*)|*.*
0x22 ydk文件(*.ydk)|*.ydk|所有文件(*.*)|*.* 0x22 ydk文件(*.ydk)|*.ydk|所有文件(*.*)|*.*
0x23 COUNT 0x23 系列号输入出错!
0x24 选择卡片图像
0x25 jpg图像(*.jpg)|*.jpg|bmp图像(*.bmp)|*.bmp|png图像(*.png)|*.png|所有文件(*.*)|*.*
0x26 当前有其他任务正在进行
0x27 正在检查更新
0x28 正在复制卡片
0x29 卡片复制完成
0x2a 保存MSE存档
0x2b MSE存档文件(*.mse-set)|*.mse-set|所有文件(*.*)|*.*
0x2c 正在导出MSE存档
0x2d 导出MSE存档完成
0x2e 正在裁剪图片
0x2f 裁剪图片完成
0x30 没有选中一张卡片
\ No newline at end of file
DataEditForm->btn_add Add DataEditForm->btn_add Add
DataEditForm->btn_del Delte DataEditForm->btn_del Delte
DataEditForm->btn_lua Lua DataEditForm->btn_lua Lua
DataEditForm->btn_img Image
DataEditForm->btn_mod Modify DataEditForm->btn_mod Modify
DataEditForm->btn_undo Undo DataEditForm->btn_undo Undo
DataEditForm->btn_PageDown >> DataEditForm->btn_PageDown >>
...@@ -15,12 +16,17 @@ DataEditForm->lb_categorys Category ...@@ -15,12 +16,17 @@ DataEditForm->lb_categorys Category
DataEditForm->lb_pleft_right PScale DataEditForm->lb_pleft_right PScale
DataEditForm->lb_scripttext DataEditForm->lb_scripttext
DataEditForm->lb_tiptexts TipText DataEditForm->lb_tiptexts TipText
DataEditForm->lb_setcode SetCode(Max 4)
DataEditForm->lb_types Card Type DataEditForm->lb_types Card Type
DataEditForm->lb2 / DataEditForm->lb2 /
DataEditForm->lb4 / DataEditForm->lb4 /
DataEditForm->lb5 / DataEditForm->lb5 /
DataEditForm->lv_cardlist0 Card Code DataEditForm->lv_cardlist0 Card Code
DataEditForm->lv_cardlist1 Card Name DataEditForm->lv_cardlist1 Card Name
DataEditForm->menuitem_openLastDataBase Open Last DataBase
DataEditForm->menuitem_cutimages Cut Images For Game
DataEditForm->menuitem_saveasmse_select Select Cards Save As...
DataEditForm->menuitem_saveasmse All Now Cards Save As...
DataEditForm->menuitem_about About DataEditForm->menuitem_about About
DataEditForm->menuitem_checkupdate Check Update DataEditForm->menuitem_checkupdate Check Update
DataEditForm->menuitem_copyselectto Slect Cards Copy To... DataEditForm->menuitem_copyselectto Slect Cards Copy To...
......
...@@ -33,3 +33,16 @@ ...@@ -33,3 +33,16 @@
0x20 Author : 0x20 Author :
0x21 cdb file(*.cdb)|*.cdb|all files(*.*)|*.* 0x21 cdb file(*.cdb)|*.cdb|all files(*.*)|*.*
0x22 ydk file(*.ydk)|*.ydk|all files(*.*)|*.* 0x22 ydk file(*.ydk)|*.ydk|all files(*.*)|*.*
0x23 SetCode Input Error!
0x24 Select Image For Card
0x25 jpg(*.jpg)|*.jpg|bmp(*.bmp)|*.bmp|png(*.png)|*.png|all files(*.*)|*.*
0x26 The Task is runing.
0x27 Check Update...
0x28 Copy Database...
0x29 Copy Database OK
0x2a Save Mse-set file
0x2b MSE set(*.mse-set)|*.mse-set|all files(*.*)|*.*
0x2c Export Mse-set
0x2d Export Mse-set OK
0x2e Cut Images...
0x2f Cut Images OK
\ No newline at end of file
@echo off
cd /d "%~dp0"
if exist update_new.exe move /y update_new.exe update.exe
start update.exe -d "%~dp0../" "https://github.com/247321453/MagicSetEditor2/raw/master/"
exit
\ No newline at end of file
客户端使用:
注意:
1、更新的时候,请不要打开游戏目录。
2、知道显示更新完成,才能关闭本程序。
3、客户端改名:
例如:
自动更新.exe
自动更新.exe.bat
自动更新.exe.config
设置:
保存的文件夹
key="path" value="D:\ygopro"
如果文件已经存在,则跳过,不存在则下载。
key="ignore1" value="textrue/*"
key="ignore上面的数字+1" value="忽略文件的相对路径,允许通配符*"
下载的地址(最后必须为/)
key="url" value="https://github.com/247321453/ygocore-update/raw/master/"
代理设置(可无视)
useproxy的value为true(小写),则通过代理下载文件
key="useproxy" value="false"
key="proxy" value="127.0.0.1:8080"
服务端使用:
运行update.exe.bat,即可生成对应的文件列表
update.exe -m "【需要更新的文件夹】"
【需要更新的文件夹】后最后不能为\
例如:
错误 update.exe -m "D:\pro files\"
正确 update.exe -m "D:\pro files"
注意:
【需要更新的文件夹】为D:\game
update.exe在D:\game\update 【需要更新的文件夹】的子目录
则可以直接使用update.exe -m
结果保存在 【需要更新的文件夹】\update
然后再修改rename和delete文件的内容
注意:delete先执行
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!-- <startup>
<supportedRuntime version="vv2.0.50727" sku=".NETFramework,Version=vv2.0.50727" />
</startup> -->
<appSettings>
<!-- access these values via the property:
System.Configuration.ConfigurationManager.AppSettings[key]
-->
<add key="url" value="https://github.com/247321453/MagicSetEditor2/raw/master/" />
<!-- game save path -->
<add key="path" value="D:\Magic Set Editor 2" />
<!-- use proxy -->
<add key="useproxy" value="false" />
<add key="proxy" value="127.0.0.1:8080" />
<!-- if file exitis then no download -->
<add key="ignore1" value="update/update.exe" />
</appSettings>
</configuration>
\ No newline at end of file
[DataEditorX]1.4.1.0[DataEditorX] [DataEditorX]1.5.0.0[DataEditorX]
[URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL] [URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL]
★使用前,请关联lua的打开方式,例如记事本,notepad++,等。
★支持关联cdb文件,命令参数启动。 ★支持关联cdb文件,命令参数启动。
关联cdb文件: 关联cdb文件:
请确保DataEditorX的文件夹名固定不变,然后右键随意一个cdb文件,打开方式--浏览--DataEditorX.exe。确定。 请确保DataEditorX的文件夹名固定不变,然后右键随意一个cdb文件,打开方式--浏览--DataEditorX.exe。确定。
...@@ -41,6 +43,10 @@ DataEditorX.exe.config ...@@ -41,6 +43,10 @@ DataEditorX.exe.config
描述不详细的bug,我修复不了。(都不知道是bug是什么) 描述不详细的bug,我修复不了。(都不知道是bug是什么)
★更新历史 ★更新历史
1.5.0.0
修复卡名搜索,读取ydk,读取图片
添加导出MSE存档,裁剪图片
可以记住最后打开数据库
1.4.1.0 1.4.1.0
添加撤销上一次操作。 添加撤销上一次操作。
1.4.0.0 1.4.0.0
......
No preview for this file type
...@@ -16,5 +16,12 @@ ...@@ -16,5 +16,12 @@
<add key="sourceURL" value="https://github.com/247321453/DataEditorX" /> <add key="sourceURL" value="https://github.com/247321453/DataEditorX" />
<!-- DataEditorX update url--> <!-- DataEditorX update url-->
<add key="updateURL" value="https://github.com/247321453/DataEditorX/tree/master/win32/readme.txt" /> <add key="updateURL" value="https://github.com/247321453/DataEditorX/tree/master/win32/readme.txt" />
<!-- Defult DataBase -->
<add key="cdb" value="cards.cdb" />
<add key="image_quilty" value="96" />
<add key="image" value="44,64,177,254" />
<add key="image_other" value="25,54,128,128" />
<add key="image_xyz" value="24,51,128,128" />
<add key="image_pendulum" value="13,46,150,120" />
</appSettings> </appSettings>
</configuration> </configuration>
0x0 卡片属性
0x1 地
0x2 水
0x4 炎
0x8 风
0x10 光
0x20 暗
0x40 神
\ No newline at end of file
0x1 魔陷破坏
0x2 怪兽破坏
0x4 卡片除外
0x8 送去墓地
0x10 返回手牌
0x20 返回卡组
0x40 手牌破坏
0x80 卡组破坏
0x100 抽卡辅助
0x200 卡组检索
0x400 卡片回收
0x800 表示变更
0x1000 控制权
0x2000 攻守变化
0x4000 贯穿伤害
0x8000 多次攻击
0x10000 攻击限制
0x20000 直接攻击
0x40000 特殊召唤
0x80000 衍生物
0x100000 种族相关
0x200000 属性相关
0x400000 LP伤害
0x800000 LP回复
0x1000000 破坏耐性
0x2000000 效果耐性
0x4000000 指示物
0x8000000 赌博相关
0x10000000 融合相关
0x20000000 同调相关
0x40000000 超量相关
0x80000000 效果无效
\ No newline at end of file
0x0 卡片等级/阶级
0x1 1★
0x2 2★
0x3 3★
0x4 4★
0x5 5★
0x6 6★
0x7 7★
0x8 8★
0x9 9★
0xa 10★
0xb 11★
0xc 12★
0xd 13★
\ No newline at end of file
0x0 卡片种族
0x1 战士
0x2 魔法使
0x4 天使
0x8 恶魔
0x10 不死
0x20 机械
0x40 水
0x80 炎
0x100 岩石
0x200 鸟兽
0x400 植物
0x800 昆虫
0x1000 雷
0x2000 龙
0x4000 兽
0x8000 兽战士
0x10000 恐龙
0x20000 鱼
0x40000 海龙
0x80000 爬虫类
0x100000 念动力
0x200000 幻神兽
0x400000 创造神
0x800000 幻龙
\ No newline at end of file
0x0 卡片规则
0x1 OCG专有
0x2 TCG专有
0x3 OCG&TCG
0x4 Anime/DIY
\ No newline at end of file
0x0 卡片系列
0x1 A·O·J
0x2 ジェネクス
0x1002 レアル·ジェネクス
0x2002 A·ジェネクス
0x4 アマズネス
0x5 アルカナフォース
0x6 暗黑界
0x7 アンティーク・ギア
0x8 HERO
0x3008 E·HERO
0x6008 E-HERO
0xc008 D·HERO
0x5008 V·HERO
0xa008 M·HERO
0x9 ネオス
0xa ヴェルズ
0x100a インヴェルズ
0xb インフェルニティ
0xc エーリアン
0xd セイバー
0x100d X-セイバー
0x300d XX-セイバー
0xe エレキ
0xf オジャマ
0x10 ガスタ
0x11 カラクリ
0x12 ガエル
0x13 機皇
0x3013 機皇帝
0x6013 機皇兵
0x14 ------
0x15 巨大戦艦
0x16 ロイド
0x17 シンクロン
0x18 雲魔物
0x19 剣闘獣
0x1a 黒蠍
0x1b 幻獣
0x101b 幻獣機
0x1c 幻魔
0x1d コアキメイル
0x1e C(コクーン)
0x1f N(ネオスペーシアン)
0x20 紫炎
0x21 地縛神
0x22 ジュラック
0x23 SIN
0x24 スクラップ
0x25 C(チェーン)
0x26 D(ディフォーマー)
0x27 TG(テックジーナス)
0x28 電池メン
0x29 ドラグニティ
0x2a ナチュル
0x2b 忍者
0x102b 機甲忍者
0x2c フレムベル
0x2d ハーピィ
0x2e 墓守
0x2f 氷結界
0x30 ヴァイロン
0x31 フォーチュンレディ
0x32 ヴォルカニック
0x33 BF(ブラックフェザー)
0x34 宝玉獣
0x35 魔轟神
0x1035 魔轟神獣
0x36 マシンナーズ
0x37 霞の谷
0x38 ライトロード
0x39 ラヴァル
0x3a リチュア
0x3b レッドアイズ
0x3c レプティレス
0x3d 六武衆
0x3e ワーム
0x3f セイヴァ
0x40 封印されし
0x41 LV
0x42 極星
0x3042 極星天
0x6042 極星獣
0xa042 極星霊
0x5042 極星宝
0x43 ジャンク
0x44 代行者
0x45 デーモン
0x46 融合/フュージョン
0x47 ジェム
0x1047 ジェムナイト
0x48 NO
0x1048 CNO
0x49 铳士
0x4a 時械神
0x4b 極神
0x4c 落とし穴
0x4e エヴォル
0x304e エヴォルド
0x604e エヴォルダ
0x504e エヴォルカイザー
0x4f バスター
0x104f /バスター
0x50 ヴェノム
0x51 ガジェット
0x52 ガーディアン
0x53 セイクリッド
0x54 ガガガ
0x55 フォトン
0x56 甲虫装機
0x57 リゾネーター
0x58 ゼンマイ
0x59 ゴゴゴ
0x5a ペンギン
0x5b トマボー
0x5c スフィンクス
0x60 竹光
0x61 忍法
0x62 トゥーン
0x63 リアクター
0x64 ハーピィ
0x65 侵略の
0x66 音響戦士
0x67 アイアン
0x68 ブリキ
0x69 聖刻
0x6a 幻蝶の刺客
0x6b バウンサー
0x6c ライトレイ
0x6d 魔人
0x306d 竜魔人
0x606d 儀式魔人
0x6e 魔導
0x106e 魔導書
0x6f ヒロイック
0x106f H・C
0x206f H-C
0x70 先史遺産
0x71 マドルチェ
0x72 ギアギア
0x1072 ギアギアーノ
0x73 エクシーズ
0x1073 CX
0x74 水精鱗
0x75 アビス
0x76 紋章獣
0x77 海皇
0x78 素早い
0x79 炎星
0x7a Nobel
0x107a NobelKnight
0x207a NobelArms
0x7b ギャラクシー
0x107b ギャラクシーアイズ
0x307b 银河眼时空龙
0x7c 炎舞
0x7d ヘイズ
0x107d 陽炎獣
0x7e ZW
0x7f 希望皇ホープ
0x80 ダストン
0x81 炎王
0x1081 炎王獣
0x82 ドドド
0x83 ギミック・パペット
0x84 BK
0x85 SDロボ
0x86 光天使
0x87 アンブラル
0x88 武神
0x1088 武神器
0x89 ホール
0x8a 蟲惑
0x108a 蟲惑魔
0x8b マリスボラス
0x8c ドルイド
0x8d ゴーストリック
0x8e ヴァンパイア
0x8f ズババ
0x90 森羅
0x91 ネクロバレー
0x92 メダリオン
0x93 サイバー
0x1093 サイバー・ドラゴン
0x94 サイバネティック
0x95 RUM
0x96 フィッシュボーグ
0x97 アーティファクト
0x98 「魔术师」
0x99 「异色眼」
0x9a 「超重武者」
0x9b 「幻奏」
0x9c 「テラナイト」
0x9d 「影依」
0x9e 「龙星」
0x100 同调士相关同调怪兽
0x101 奇迹同调融合相关怪兽
0x102 暗黑融合限定怪兽
0x103 电子龙限定素材的融合怪兽
\ No newline at end of file
0x1 怪兽
0x2 魔法
0x4 陷阱
0x8 N/A
0x10 通常
0x20 效果
0x40 融合
0x80 仪式
0x100 N/A
0x200 灵魂
0x400 同盟
0x800 二重
0x1000 调整
0x2000 同调
0x4000 衍生物
0x8000 N/A
0x10000 速攻
0x20000 永续
0x40000 装备
0x80000 场地
0x100000 反击
0x200000 反转
0x400000 卡通
0x800000 超量
0x1000000 摇摆
\ No newline at end of file
DataEditForm->btn_add 添加(&A)
DataEditForm->btn_del 删除(&D)
DataEditForm->btn_lua 脚本(&L)
DataEditForm->btn_img 导入卡图(&I)
DataEditForm->btn_undo 撤销(&U)
DataEditForm->btn_mod 修改(&M)
DataEditForm->btn_PageDown 下一页
DataEditForm->btn_PageUp 上一页
DataEditForm->btn_reset 重置(&R)
DataEditForm->btn_serach 搜索(&S)
DataEditForm->DataEditForm DataEditorX by 247321453
DataEditForm->lb_atkdef ATK/DEF
DataEditForm->lb_cardalias 同名卡
DataEditForm->lb_cardcode 卡片密码
DataEditForm->lb_categorys 效果种类
DataEditForm->lb_pleft_right PScale
DataEditForm->lb_scripttext
DataEditForm->lb_tiptexts 提示文字
DataEditForm->lb_setcode 卡片系列(最多4个)
DataEditForm->lb_types 卡片种类
DataEditForm->lb2 /
DataEditForm->lb4 /
DataEditForm->lb5 /
DataEditForm->lv_cardlist0 卡片密码
DataEditForm->lv_cardlist1 卡片名称
DataEditForm->menuitem_openLastDataBase 最后打开的数据库
DataEditForm->menuitem_cutimages 裁剪列表卡片的图片
DataEditForm->menuitem_saveasmse_select 所选卡片导出MSE存档
DataEditForm->menuitem_saveasmse 当前所有卡片导出MSE存档
DataEditForm->menuitem_about 关于(&A)
DataEditForm->menuitem_checkupdate 检查更新
DataEditForm->menuitem_copyselectto 所选卡片复制到...
DataEditForm->menuitem_copyto 当前所有卡片复制到...
DataEditForm->menuitem_file 文件(&F)
DataEditForm->menuitem_github 源码主页
DataEditForm->menuitem_help 帮助(&H)
DataEditForm->menuitem_new 新建(&N)
DataEditForm->menuitem_open 打开(&O)
DataEditForm->menuitem_quit 退出(&Q)
DataEditForm->menuitem_readimages 从图像文件夹读取
DataEditForm->menuitem_readydk 从ydk文件读取
\ No newline at end of file
0x0 提示
0x1 错误
0x2 警告
0x3 询问
0x4 创建成功!
0x5 创建失败!
0x6 添加成功!
0x7 添加失败!
0x8 密码不能为0!
0x9 已经存在!
0xa 内容没有改变。
0xb 是否删除卡片?
0xc 是否创建脚本文件?
0xd 是否打开数据库?
0xe 是否替换已经存在的卡片?
0xf 已经是最新版本了。/n需要重新下载,请点击“确定”重新下载。
0x10 检查更新失败,请检查网络。
0x11 发现新的版本,是否更新?
0x12 文件不存在!
0x13 没有选择数据库!
0x14 选择数据库文件
0x15 选择ydk文件
0x16 选择图像目录
0x17 下载成功!
0x18 下载失败!
0x19 没有选中脚本文本!
0x1a 删除成功!
0x1b 删除失败!
0x1c 修改成功!
0x1d 修改失败!
0x1e 关于:
0x1f 版本:
0x20 作者:
0x21 cdb文件(*.cdb)|*.cdb|所有文件(*.*)|*.*
0x22 ydk文件(*.ydk)|*.ydk|所有文件(*.*)|*.*
0x23 系列号输入出错!
0x24 选择卡片图像
0x25 jpg图像(*.jpg)|*.jpg|bmp图像(*.bmp)|*.bmp|png图像(*.png)|*.png|所有文件(*.*)|*.*
0x26 当前有其他任务正在进行
0x27 正在检查更新
0x28 正在复制卡片
0x29 卡片复制完成
0x2a 保存MSE存档
0x2b MSE存档文件(*.mse-set)|*.mse-set|所有文件(*.*)|*.*
0x2c 正在导出MSE存档
0x2d 导出MSE存档完成
0x2e 正在裁剪图片
0x2f 裁剪图片完成
0x30 没有选中一张卡片
\ No newline at end of file
0x0 Atribute
0x1 Earth
0x2 Water
0x4 Fire
0x8 Wind
0x10 Light
0x20 Dark
0x40 Divine
\ No newline at end of file
0x1 S/T Destroy
0x2 Destroy Monster
0x4 Banish
0x8 Graveyard
0x10 Back to Hand
0x20 Back to Deck
0x40 Destroy Hand
0x80 Destroy Deck
0x100 Draw
0x200 Search
0x400 Recovery
0x800 Position
0x1000 Control
0x2000 Change ATK/DEF
0x4000 Piercing
0x8000 Repeat Attack
0x10000 Limit Attack
0x20000 Direct Attack
0x40000 Special Summon
0x80000 Token
0x100000 Type-Related
0x200000 Property-Related
0x400000 Damage LP
0x800000 Recover LP
0x1000000 Destroy
0x2000000 Select
0x4000000 Counter
0x8000000 Gamble
0x10000000 Fusion-Related
0x20000000 Tuner-Related
0x40000000 Xyz-Related
0x80000000 Negate Effect
0x0 Level/Rank
0x1 1★
0x2 2★
0x3 3★
0x4 4★
0x5 5★
0x6 6★
0x7 7★
0x8 8★
0x9 9★
0xa 10★
0xb 11★
0xc 12★
0xd 13★
\ No newline at end of file
0x0 Race
0x1 Warrior
0x2 Spellcaster
0x4 Fairy
0x8 Fiend
0x10 Zombie
0x20 Machine
0x40 Aqua
0x80 Pyro
0x100 Rock
0x200 Winged Beast
0x400 Plant
0x800 Insect
0x1000 Thunder
0x2000 Dragon
0x4000 Beast
0x80000 Beast-Warrior
0x10000 Dinosaur
0x20000 Fish
0x40000 Sea Serpent
0x80000 Reptile
0x100000 Psychic
0x200000 Divine-Beast
0x400000 Creator God
0x800000 Wyrm
0x0 Rule
0x1 OCG
0x2 TCG
0x3 OCG&TCG
0x4 Anime/DIY
\ No newline at end of file
0x0 SetName
0x1 A·O·J
0x2 ジェネクス
0x1002 レアル·ジェネクス
0x2002 A·ジェネクス
0x4 アマズネス
0x5 アルカナフォース
0x6 暗黑界
0x7 アンティーク・ギア
0x8 HERO
0x3008 E·HERO
0x6008 E-HERO
0xc008 D·HERO
0x5008 V·HERO
0xa008 M·HERO
0x9 ネオス
0xa ヴェルズ
0x100a インヴェルズ
0xb インフェルニティ
0xc エーリアン
0xd セイバー
0x100d X-セイバー
0x300d XX-セイバー
0xe エレキ
0xf オジャマ
0x10 ガスタ
0x11 カラクリ
0x12 ガエル
0x13 機皇
0x3013 機皇帝
0x6013 機皇兵
0x14 ------
0x15 巨大戦艦
0x16 ロイド
0x17 シンクロン
0x18 雲魔物
0x19 剣闘獣
0x1a 黒蠍
0x1b 幻獣
0x101b 幻獣機
0x1c 幻魔
0x1d コアキメイル
0x1e C(コクーン)
0x1f N(ネオスペーシアン)
0x20 紫炎
0x21 地縛神
0x22 ジュラック
0x23 SIN
0x24 スクラップ
0x25 C(チェーン)
0x26 D(ディフォーマー)
0x27 TG(テックジーナス)
0x28 電池メン
0x29 ドラグニティ
0x2a ナチュル
0x2b 忍者
0x102b 機甲忍者
0x2c フレムベル
0x2d ハーピィ
0x2e 墓守
0x2f 氷結界
0x30 ヴァイロン
0x31 フォーチュンレディ
0x32 ヴォルカニック
0x33 BF(ブラックフェザー)
0x34 宝玉獣
0x35 魔轟神
0x1035 魔轟神獣
0x36 マシンナーズ
0x37 霞の谷
0x38 ライトロード
0x39 ラヴァル
0x3a リチュア
0x3b レッドアイズ
0x3c レプティレス
0x3d 六武衆
0x3e ワーム
0x3f セイヴァ
0x40 封印されし
0x41 LV
0x42 極星
0x3042 極星天
0x6042 極星獣
0xa042 極星霊
0x5042 極星宝
0x43 ジャンク
0x44 代行者
0x45 デーモン
0x46 融合/フュージョン
0x47 ジェム
0x1047 ジェムナイト
0x48 NO
0x1048 CNO
0x49 铳士
0x4a 時械神
0x4b 極神
0x4c 落とし穴
0x4e エヴォル
0x304e エヴォルド
0x604e エヴォルダ
0x504e エヴォルカイザー
0x4f バスター
0x104f /バスター
0x50 ヴェノム
0x51 ガジェット
0x52 ガーディアン
0x53 セイクリッド
0x54 ガガガ
0x55 フォトン
0x56 甲虫装機
0x57 リゾネーター
0x58 ゼンマイ
0x59 ゴゴゴ
0x5a ペンギン
0x5b トマボー
0x5c スフィンクス
0x60 竹光
0x61 忍法
0x62 トゥーン
0x63 リアクター
0x64 ハーピィ
0x65 侵略の
0x66 音響戦士
0x67 アイアン
0x68 ブリキ
0x69 聖刻
0x6a 幻蝶の刺客
0x6b バウンサー
0x6c ライトレイ
0x6d 魔人
0x306d 竜魔人
0x606d 儀式魔人
0x6e 魔導
0x106e 魔導書
0x6f ヒロイック
0x106f H・C
0x206f H-C
0x70 先史遺産
0x71 マドルチェ
0x72 ギアギア
0x1072 ギアギアーノ
0x73 エクシーズ
0x1073 CX
0x74 水精鱗
0x75 アビス
0x76 紋章獣
0x77 海皇
0x78 素早い
0x79 炎星
0x7a Nobel
0x107a NobelKnight
0x207a NobelArms
0x7b ギャラクシー
0x107b ギャラクシーアイズ
0x307b 银河眼时空龙
0x7c 炎舞
0x7d ヘイズ
0x107d 陽炎獣
0x7e ZW
0x7f 希望皇ホープ
0x80 ダストン
0x81 炎王
0x1081 炎王獣
0x82 ドドド
0x83 ギミック・パペット
0x84 BK
0x85 SDロボ
0x86 光天使
0x87 アンブラル
0x88 武神
0x1088 武神器
0x89 ホール
0x8a 蟲惑
0x108a 蟲惑魔
0x8b マリスボラス
0x8c ドルイド
0x8d ゴーストリック
0x8e ヴァンパイア
0x8f ズババ
0x90 森羅
0x91 ネクロバレー
0x92 メダリオン
0x93 サイバー
0x1093 サイバー・ドラゴン
0x94 サイバネティック
0x95 RUM
0x96 フィッシュボーグ
0x97 アーティファクト
0x98 「魔术师」
0x99 「异色眼」
0x9a 「超重武者」
0x9b 「幻奏」
0x9c 「テラナイト」
0x9d 「影依」
0x9e 「龙星」
0x100 同调士相关同调怪兽
0x101 奇迹同调融合相关怪兽
0x102 暗黑融合限定怪兽
0x103 电子龙限定素材的融合怪兽
\ No newline at end of file
0x1 Monster
0x2 Spell
0x4 Trap
0x8 N/A
0x10 Normal
0x20 Effect
0x40 Fusion
0x80 Ritual
0x100 T-Monster
0x200 Spirit
0x400 Union
0x800 Gemini
0x1000 Tuner
0x2000 Synchro
0x4000 Token
0x8000 N/A
0x10000 Quick-Play
0x20000 Continuous
0x40000 Equip
0x80000 Field
0x100000 Counter
0x200000 Flip
0x400000 Toon
0x800000 Xyz
0x1000000 Pendulum
DataEditForm->btn_add Add
DataEditForm->btn_del Delte
DataEditForm->btn_lua Lua
DataEditForm->btn_img Image
DataEditForm->btn_mod Modify
DataEditForm->btn_undo Undo
DataEditForm->btn_PageDown >>
DataEditForm->btn_PageUp <<
DataEditForm->btn_reset Rest
DataEditForm->btn_serach Search
DataEditForm->DataEditForm DataEditorX by 247321453
DataEditForm->lb_atkdef ATK/DEF
DataEditForm->lb_cardalias Alias
DataEditForm->lb_cardcode Card Code
DataEditForm->lb_categorys Category
DataEditForm->lb_pleft_right PScale
DataEditForm->lb_scripttext
DataEditForm->lb_tiptexts TipText
DataEditForm->lb_setcode SetCode(Max 4)
DataEditForm->lb_types Card Type
DataEditForm->lb2 /
DataEditForm->lb4 /
DataEditForm->lb5 /
DataEditForm->lv_cardlist0 Card Code
DataEditForm->lv_cardlist1 Card Name
DataEditForm->menuitem_openLastDataBase Open Last DataBase
DataEditForm->menuitem_cutimages Cut Images For Game
DataEditForm->menuitem_saveasmse_select Select Cards Save As...
DataEditForm->menuitem_saveasmse All Now Cards Save As...
DataEditForm->menuitem_about About
DataEditForm->menuitem_checkupdate Check Update
DataEditForm->menuitem_copyselectto Slect Cards Copy To...
DataEditForm->menuitem_copyto Now All Cards Copy To...
DataEditForm->menuitem_file File
DataEditForm->menuitem_github Github
DataEditForm->menuitem_help Help
DataEditForm->menuitem_new New
DataEditForm->menuitem_open Open
DataEditForm->menuitem_quit Quit
DataEditForm->menuitem_readimages Read for Image Folder
DataEditForm->menuitem_readydk Read for ydk file
\ No newline at end of file
0x0 Info
0x1 Error
0x2 Warning
0x3 Question
0x4 Create succeed!
0x5 Create fail!
0x6 Add succeed!
0x7 Add fail!
0x8 Code can't is 0!
0x9 It's exitis!
0xa It's no changed.
0xb If delete Card(s)?
0xc If create script file?
0xd If open database?
0xe If replace exitis cards?
0xf It's new version./nWhether you need to download again?
0x10 Check update fail,/nPlease Check Network.
0x11 Find a new version,/nIf Download it?
0x12 File is't exitis!
0x13 No select database!
0x14 select database file
0x15 select ydk file
0x16 selcet image folder
0x17 Download succeed!
0x18 Download fail!
0x19 No slect script text!
0x1a Delete succeed!
0x1b Delete fail!
0x1c Modify succeed!
0x1d Modify fail!
0x1e About :
0x1f Version:
0x20 Author :
0x21 cdb file(*.cdb)|*.cdb|all files(*.*)|*.*
0x22 ydk file(*.ydk)|*.ydk|all files(*.*)|*.*
0x23 SetCode Input Error!
0x24 Select Image For Card
0x25 jpg(*.jpg)|*.jpg|bmp(*.bmp)|*.bmp|png(*.png)|*.png|all files(*.*)|*.*
0x26 The Task is runing.
0x27 Check Update...
0x28 Copy Database...
0x29 Copy Database OK
0x2a Save Mse-set file
0x2b MSE set(*.mse-set)|*.mse-set|all files(*.*)|*.*
0x2c Export Mse-set
0x2d Export Mse-set OK
0x2e Cut Images...
0x2f Cut Images OK
\ No newline at end of file
@echo off
cd /d "%~dp0"
if exist update_new.exe move /y update_new.exe update.exe
start update.exe -d "%~dp0../" "https://github.com/247321453/MagicSetEditor2/raw/master/"
exit
\ No newline at end of file
客户端使用:
注意:
1、更新的时候,请不要打开游戏目录。
2、知道显示更新完成,才能关闭本程序。
3、客户端改名:
例如:
自动更新.exe
自动更新.exe.bat
自动更新.exe.config
设置:
保存的文件夹
key="path" value="D:\ygopro"
如果文件已经存在,则跳过,不存在则下载。
key="ignore1" value="textrue/*"
key="ignore上面的数字+1" value="忽略文件的相对路径,允许通配符*"
下载的地址(最后必须为/)
key="url" value="https://github.com/247321453/ygocore-update/raw/master/"
代理设置(可无视)
useproxy的value为true(小写),则通过代理下载文件
key="useproxy" value="false"
key="proxy" value="127.0.0.1:8080"
服务端使用:
运行update.exe.bat,即可生成对应的文件列表
update.exe -m "【需要更新的文件夹】"
【需要更新的文件夹】后最后不能为\
例如:
错误 update.exe -m "D:\pro files\"
正确 update.exe -m "D:\pro files"
注意:
【需要更新的文件夹】为D:\game
update.exe在D:\game\update 【需要更新的文件夹】的子目录
则可以直接使用update.exe -m
结果保存在 【需要更新的文件夹】\update
然后再修改rename和delete文件的内容
注意:delete先执行
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!-- <startup>
<supportedRuntime version="vv2.0.50727" sku=".NETFramework,Version=vv2.0.50727" />
</startup> -->
<appSettings>
<!-- access these values via the property:
System.Configuration.ConfigurationManager.AppSettings[key]
-->
<add key="url" value="https://github.com/247321453/MagicSetEditor2/raw/master/" />
<!-- game save path -->
<add key="path" value="D:\Magic Set Editor 2" />
<!-- use proxy -->
<add key="useproxy" value="false" />
<add key="proxy" value="127.0.0.1:8080" />
<!-- if file exitis then no download -->
<add key="ignore1" value="update/update.exe" />
</appSettings>
</configuration>
\ No newline at end of file
[DataEditorX]1.4.1.0[DataEditorX] [DataEditorX]1.5.0.0[DataEditorX]
[URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL] [URL]https://github.com/247321453/DataEditorX/raw/master/win32/win32.zip[URL]
★使用前,请关联lua的打开方式,例如记事本,notepad++,等。
★支持关联cdb文件,命令参数启动。 ★支持关联cdb文件,命令参数启动。
关联cdb文件: 关联cdb文件:
请确保DataEditorX的文件夹名固定不变,然后右键随意一个cdb文件,打开方式--浏览--DataEditorX.exe。确定。 请确保DataEditorX的文件夹名固定不变,然后右键随意一个cdb文件,打开方式--浏览--DataEditorX.exe。确定。
...@@ -41,6 +43,10 @@ DataEditorX.exe.config ...@@ -41,6 +43,10 @@ DataEditorX.exe.config
描述不详细的bug,我修复不了。(都不知道是bug是什么) 描述不详细的bug,我修复不了。(都不知道是bug是什么)
★更新历史 ★更新历史
1.5.0.0
修复卡名搜索,读取ydk,读取图片
添加导出MSE存档,裁剪图片
可以记住最后打开数据库
1.4.1.0 1.4.1.0
添加撤销上一次操作。 添加撤销上一次操作。
1.4.0.0 1.4.0.0
......
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment