Skip to content

Commit f623fe5

Browse files
author
kritsu
committed
1.7.1.3 update
1 parent 2257d07 commit f623fe5

File tree

12 files changed

+88
-46
lines changed

12 files changed

+88
-46
lines changed

ExtractorSharp.Core/Draw/Paint/Canvas.cs

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,20 @@ namespace ExtractorSharp.Draw.Paint {
66
public class Canvas : IPaint {
77
public string Name { set; get; }
88
public Bitmap Image { set; get; }
9-
public Rectangle Rectangle {
9+
public Rectangle Rectangle => new Rectangle(_Location, Size);
10+
11+
private Point _Location {
1012
get {
1113
var location = Location;
12-
if (Tag is Sprite sprite && RealPosition) {
13-
location = location.Add(sprite.Location);
14-
}
15-
return new Rectangle(location, Size);
14+
if (RealPosition) {
15+
if (Tag is Sprite sprite) {
16+
location = location.Add(sprite.Location);
17+
}
18+
}
19+
return location;
1620
}
1721
}
22+
1823
public bool Contains(Point point) => Rectangle.Contains(point);
1924
public Point Offset { set; get; } = Point.Empty;
2025
public Size CanvasSize { set; get; }
@@ -30,14 +35,22 @@ public void Draw(Graphics g) {
3035
public bool Visible { set; get; }
3136
public bool Locked { set; get; }
3237

33-
public bool RealPosition { set; get; }
38+
public bool RealPosition {
39+
set {
40+
_realPostion = value;
41+
if (!value) {
42+
Location = Point.Empty;
43+
}
44+
}
45+
get {
46+
return _realPostion;
47+
}
48+
}
49+
50+
private bool _realPostion;
3451

3552
public override string ToString() {
36-
var location = Location;
37-
if (Tag is Sprite sprite && RealPosition) {
38-
location = location.Add(sprite.Location);
39-
}
40-
return $"{Language.Default[Name]},{Language.Default["Position"]}({location.X},{location.Y}),{Language.Default["Size"]}({Size.Width},{Size.Height})";
53+
return $"{Language.Default[Name]},{Language.Default["Position"]}({_Location.GetString()}),{Language.Default["Size"]}({Size.GetString()})";
4154
}
4255
}
4356
}

ExtractorSharp.Core/Lib/Reader/Npks.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,17 @@ public static List<Album> Find(IEnumerable<Album> Items, bool allCheck, params s
342342
return list;
343343
}
344344

345+
public static List<Album> FindByCode(IEnumerable<Album> array, string code) => FindByCode(array, code, false, false);
345346

346-
public static List<Album> FindByCode(IEnumerable<Album> array, string code) {
347+
348+
public static List<Album> FindByCode(IEnumerable<Album> array, string code, bool mask, bool ban) {
347349
var list = new List<Album>(array.Where(item => {
350+
if (!mask && item.Name.Contains("mask")) {
351+
return false;
352+
}
353+
if (!ban && Regex.IsMatch(item.Name, @"\(.*\)+")) { //过滤掉和谐图层
354+
return false;
355+
}
348356
var regex = new Regex("\\d+");
349357
var match = regex.Match(item.Name);
350358
return match.Success && match.Value.Equals(code);

ExtractorSharp/Command/FileCommand/RepairFile.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public void Action(params Album[] array) {
6161

6262
public void Undo() {
6363
for (var i = 0; i < Array.Length; i++) {
64-
if (Counts[i] > 0) {
64+
if (Counts[i] > 0 && Counts[i] < Array[i].List.Count) {
6565
Array[i].List.RemoveRange(Array[i].List.Count - Counts[i], Counts[i]);
6666
}
6767
}

ExtractorSharp/ExtractorSharp.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@
153153
<Compile Include="Core\Clipboarder.cs" />
154154
<Compile Include="Core\Sorter\DefaultSorter.cs" />
155155
<Compile Include="Core\Sorter\ISorter.cs" />
156-
<Compile Include="Data\Result.cs" />
157-
<Compile Include="Data\VersionInfo.cs" />
156+
<Compile Include="Model\Result.cs" />
157+
<Compile Include="Model\VersionInfo.cs" />
158158
<Compile Include="Draw\Brush\Eraser.cs" />
159159
<Compile Include="Draw\Brush\Straw.cs" />
160160
<Compile Include="Draw\Paint\Border.cs" />

ExtractorSharp/MainForm.MainConnector.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,9 @@ public void AddFile(bool clear, params Album[] array) {
198198

199199
public void RemoveFile(params Album[] array) {
200200
foreach (var album in array) {
201-
List.Remove(album);
201+
if (album != null) {
202+
List.Remove(album);
203+
}
202204
}
203205
}
204206

ExtractorSharp/MainForm.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using ExtractorSharp.Command;
2+
using ExtractorSharp.Command.ImgCommand;
23
using ExtractorSharp.Component;
34
using ExtractorSharp.Composition;
45
using ExtractorSharp.Config;
@@ -286,7 +287,7 @@ private void AddListenter() {
286287
saveFileItem.Click += (o, e) => Connector.Save();
287288
layerList.ItemCheck += HideLayer;
288289
adjustPositionItem.Click += AdjustPosition;
289-
repairFileItem.Click += (o, e) => Connector.Do("repairFile", Connector.CheckedFiles);
290+
repairFileItem.Click += RepairFile;
290291

291292
Drawer.BrushChanged += (o, e) => box.Cursor = e.Brush.Cursor;
292293
Drawer.LayerChanged += (o, e) => LayerFlush();
@@ -332,6 +333,14 @@ private void AddListenter() {
332333
RecentChanged(null, null);
333334
}
334335

336+
private void RepairFile(object sender,EventArgs e) {
337+
if (!Directory.Exists(Config["ResourcePath"].Value)) {
338+
Connector.SendError("SelectPathIsInvalid");
339+
return;
340+
}
341+
Connector.Do("repairFile", Connector.CheckedFiles);
342+
}
343+
335344
private void Dye(object sender, EventArgs e) {
336345
Config["Dye"] = new ConfigValue(dyeBox.Checked);
337346
Flush(sender, e);

ExtractorSharp/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
3434
// 方法是按如下所示使用“*”: :
3535
// [assembly: AssemblyVersion("1.0.*")]
36-
[assembly: AssemblyVersion("1.7.1.2")]
36+
[assembly: AssemblyVersion("1.7.1.3")]
3737
[assembly: AssemblyFileVersion("1.7.1.0")]
3838
[assembly: NeutralResourcesLanguage("zh-CN")]
3939

ExtractorSharp/Resources/version.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,9 +1022,18 @@
10221022
"Version": "1.7.1.2",
10231023
"Info": [
10241024
"修复了Ver5输出文件的一些bug",
1025-
"修复了补帧时无贴图的bug",
1025+
"修复了修复文件时无贴图的bug",
10261026
"修复了替换链接贴图时色位默认导致报错的bug"
10271027
]
1028+
},
1029+
{
1030+
"Version": "1.7.1.3",
1031+
"Info": [
1032+
"修复了部分版本转换的一些bug",
1033+
"修复了打开错误文件撤销的一些bug",
1034+
"修复了文件检索算法的一些bug",
1035+
"修复了取消真实坐标时不会重置坐标的bug",
1036+
"完善了未选择游戏目录的提示"
1037+
]
10281038
}
1029-
10301039
]

0 commit comments

Comments
 (0)