Skip to content

Commit 5ba2466

Browse files
committed
#60 #5 の修正
1 parent 2f8b779 commit 5ba2466

File tree

2 files changed

+16
-23
lines changed

2 files changed

+16
-23
lines changed

MainForms/BackupDataListView.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,10 @@ private void ReturnBackup_Click(object sender, EventArgs e) {
129129
if (!selectedItem.World.IsAlive) {
130130
//バックアップ元ワールドが死んでいる場合messageBox出現
131131
logger.Info(" 死亡済みワールドのバックアップが選択されました");
132-
MessageBox.Show("同名の別ワールドがゲームディレクトリ内に存在しています", "Minecraft Auto Backup", buttons: MessageBoxButtons.OK);
132+
//同名のワールドがゲームディレクトリ内に存在する場合
133+
if (Directory.Exists(selectedItem.World.WorldPath)) {
134+
MessageBox.Show("同名の別ワールドがゲームディレクトリ内に存在しています", "Minecraft Auto Backup", buttons: MessageBoxButtons.OK);
135+
}
133136
}
134137
DateTime dt = DateTime.ParseExact(selectedItem.SubItems[0].Text, "yyyy-MM-dd HH:mm", null);
135138
string fileName = dt.ToString("yyyyMMddHHmm");

MainForms/RestoreFromBackupForm.cs

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,14 @@ public RestoreFromBackupForm(string backupSourcePath, World backupTarget) {
3434
Text = "バックアップから復元します";
3535
Icon = new Icon(".\\Image\\app.ico");
3636
Font = Util.FontStyle;
37-
Padding = new Padding((int)Util.FontStyle.Size * 2);
38-
ClientSize = new Size((int)Util.FontStyle.Size * 30, (int)Util.FontStyle.Size * 35);
37+
ClientSize = new Size(500, 220);
3938
FormBorderStyle = FormBorderStyle.FixedSingle;
4039

4140
panel = new FlowLayoutPanel() {
42-
Padding = new Padding((int)Util.FontStyle.Size),
43-
BorderStyle = BorderStyle.FixedSingle,
41+
Padding = new Padding(20),
4442
Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right,
4543
Dock = DockStyle.Fill,
46-
BackColor = SystemColors.Window,
44+
//BackColor = SystemColors.Window,
4745
WrapContents = false,
4846
FlowDirection = FlowDirection.TopDown
4947
};
@@ -54,43 +52,36 @@ public RestoreFromBackupForm(string backupSourcePath, World backupTarget) {
5452
catch (FormatException) {
5553
//zipファイルの場合FormatExceptionが発生するため
5654
time = DateTime.ParseExact(Path.GetFileName(pathSrc.Substring(0, pathSrc.Length - 4)), "yyyyMMddHHmm", null);
57-
5855
}
59-
60-
6156
Font lFont = (Util.FontStyle);
62-
6357
description = new Label() {
64-
Font = new Font(Util.FontStyle.FontFamily, Util.FontStyle.Size + 2),
58+
Font = new Font(Util.FontStyle.FontFamily, Util.FontStyle.Size),
6559
Text = time.ToString("yyyy-MM-dd HH:mm") + " のバックアップから復元します ",
66-
Height = (int)Util.FontStyle.Height * 3 + 4,
6760
//BackColor = Color.Blue,
6861
Margin = new Padding(0, 0, 0, 20),
69-
//AutoSize = true,
62+
AutoSize = true,
7063
};
7164

7265
removeBackup = new CheckBox() {
7366
Text = $"バックアップ元({Path.GetFileName(pathSrc)})を削除する",
74-
Width = Width - Padding.Left * 2 - panel.Padding.Left * 2 - 10,
75-
Height = (int)Util.FontStyle.Height * 2 + 2,
7667
//BackColor = Color.Blue,
77-
//AutoSize = true,
68+
AutoSize = true,
69+
Margin = new Padding(0),
7870
};
7971

8072
dontOverwriting = new CheckBox() {
8173
Text = $"バックアップ先({Path.GetFileName(Path.GetDirectoryName(Path.GetDirectoryName(pathTar)))}\\saves\\{Path.GetFileName(pathTar)})を上書きしない\n(別名で新規作成する)",
82-
Width = Width - Padding.Left * 2 - panel.Padding.Left * 2 - 10,
83-
Height = (int)Util.FontStyle.Height * 6,
8474
//BackColor = Color.Blue,
75+
AutoSize = true,
76+
8577
};
8678

8779
doRestore = new Button() {
8880
Text = "バックアップから復元する",
89-
Height = (int)Util.FontStyle.Size * 5,
90-
Width = Width - Padding.Left * 2 - panel.Padding.Left * 2 - 10,
91-
Margin = new Padding(0, 0, 0, 20),
81+
Height = 40,
82+
BackColor = SystemColors.Control,
9283
UseVisualStyleBackColor = true,
93-
BackColor = SystemColors.Control
84+
Margin = new Padding(0, 30, 0, 0),
9485
};
9586
doRestore.Click += new EventHandler(doRestore_Click);
9687

@@ -108,7 +99,6 @@ public RestoreFromBackupForm(string backupSourcePath, World backupTarget) {
10899
removeBackup.Width = panel.Width - panel.Padding.Left * 2 - 10;
109100
dontOverwriting.Width = panel.Width - panel.Padding.Left * 2 - 10;
110101
doRestore.Width = panel.Width - panel.Padding.Left * 2 - 10;
111-
112102
}
113103

114104
private void doRestore_Click(object sender, EventArgs e) {

0 commit comments

Comments
 (0)