mirror of
https://github.com/jie65535/GrasscutterCommandGenerator.git
synced 2025-08-02 16:59:14 +08:00
Clean up all code using CodeMaid
This commit is contained in:
parent
e9a3f4014e
commit
eef4687ed6
@ -29,6 +29,7 @@ using GrasscutterTools.Game;
|
||||
using GrasscutterTools.Game.Gacha;
|
||||
using GrasscutterTools.Properties;
|
||||
using GrasscutterTools.Utils;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace GrasscutterTools.Forms
|
||||
@ -504,6 +505,5 @@ namespace GrasscutterTools.Forms
|
||||
}
|
||||
|
||||
#endregion - 卡池参数 -
|
||||
|
||||
}
|
||||
}
|
@ -305,7 +305,6 @@ namespace GrasscutterTools.Forms
|
||||
|
||||
#endregion - 初始化 Init -
|
||||
|
||||
|
||||
#region - 快捷键执行 HotKey -
|
||||
|
||||
/// <summary>
|
||||
@ -612,6 +611,5 @@ namespace GrasscutterTools.Forms
|
||||
}
|
||||
|
||||
#endregion - 通用 General -
|
||||
|
||||
}
|
||||
}
|
@ -71,7 +71,8 @@ namespace GrasscutterTools.Game
|
||||
{
|
||||
get
|
||||
{
|
||||
foreach (var map in Values) {
|
||||
foreach (var map in Values)
|
||||
{
|
||||
var n = map[id];
|
||||
if (n != ItemMap.EmptyName)
|
||||
return n;
|
||||
|
@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
using GrasscutterTools.Game;
|
||||
using GrasscutterTools.Properties;
|
||||
using GrasscutterTools.Utils;
|
||||
|
@ -200,6 +200,5 @@ namespace GrasscutterTools.Pages
|
||||
LnkNewVersion.Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -1,4 +1,23 @@
|
||||
using System;
|
||||
/**
|
||||
* Grasscutter Tools
|
||||
* Copyright (C) 2023 jie65535
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
**/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
@ -6,6 +25,7 @@ using System.Windows.Forms;
|
||||
|
||||
using GrasscutterTools.Properties;
|
||||
using GrasscutterTools.Utils;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace GrasscutterTools.Pages
|
||||
@ -75,7 +95,8 @@ namespace GrasscutterTools.Pages
|
||||
item.Tag,
|
||||
item.HotKey,
|
||||
item.Commands
|
||||
}) { Checked = item.IsEnabled };
|
||||
})
|
||||
{ Checked = item.IsEnabled };
|
||||
|
||||
/// <summary>
|
||||
/// 列表选中项改变时触发
|
||||
|
@ -75,7 +75,6 @@ namespace GrasscutterTools.Pages
|
||||
Scenes = GameData.Dungeons.Lines;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 选中过场时触发
|
||||
/// </summary>
|
||||
|
@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
using GrasscutterTools.Game.Props;
|
||||
using GrasscutterTools.Properties;
|
||||
|
||||
|
@ -4,11 +4,13 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
using GrasscutterTools.Game;
|
||||
using GrasscutterTools.Game.Activity;
|
||||
using GrasscutterTools.Game.CutScene;
|
||||
using GrasscutterTools.Game.Dungeon;
|
||||
using GrasscutterTools.Properties;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace GrasscutterTools.Pages
|
||||
@ -77,8 +79,6 @@ namespace GrasscutterTools.Pages
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void BtnConvertCutScene_Click(object sender, EventArgs e)
|
||||
{
|
||||
var src = new OpenFileDialog
|
||||
|
@ -20,10 +20,10 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
|
||||
using GrasscutterTools.OpenCommand;
|
||||
using GrasscutterTools.Properties;
|
||||
using GrasscutterTools.Utils;
|
||||
@ -100,7 +100,6 @@ namespace GrasscutterTools
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#region - 命令行参数 -
|
||||
|
||||
/// <summary>
|
||||
@ -155,7 +154,6 @@ namespace GrasscutterTools
|
||||
// UID
|
||||
//Settings.Default.RemoteUid = decimal.Parse(parser.GetToggleValueOrDefault("uid", Settings.Default.RemoteUid.ToString()));
|
||||
|
||||
|
||||
if (!string.IsNullOrEmpty(Settings.Default.Host) && !string.IsNullOrEmpty(Settings.Default.TokenCache))
|
||||
{
|
||||
Common.OC = new OpenCommandAPI(Settings.Default.Host, Settings.Default.TokenCache);
|
||||
@ -218,7 +216,7 @@ namespace GrasscutterTools
|
||||
return raw.Trim().Replace("\\r", "\r").Replace("\\n", "\n");
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion - 命令行参数 -
|
||||
|
||||
#region - 全局异常处理 -
|
||||
|
||||
|
@ -1,4 +1,23 @@
|
||||
using System;
|
||||
/**
|
||||
* Grasscutter Tools
|
||||
* Copyright (C) 2023 jie65535
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
**/
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows.Forms;
|
||||
|
@ -24,6 +24,7 @@ namespace GrasscutterTools.Utils
|
||||
public static OpenCommandAPI OC { get; set; }
|
||||
|
||||
private static string AppDataFolder { get; } = GetAppDataFolder();
|
||||
|
||||
private static string GetAppDataFolder()
|
||||
{
|
||||
var dir = Path.Combine(
|
||||
@ -42,7 +43,6 @@ namespace GrasscutterTools.Utils
|
||||
return Path.Combine(AppDataFolder, filename);
|
||||
}
|
||||
|
||||
|
||||
public static KeyGo KeyGo { get; set; }
|
||||
}
|
||||
}
|
@ -1,4 +1,23 @@
|
||||
using System;
|
||||
/**
|
||||
* Grasscutter Tools
|
||||
* Copyright (C) 2023 jie65535
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
**/
|
||||
|
||||
using System;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
@ -1,4 +1,23 @@
|
||||
using System;
|
||||
/**
|
||||
* Grasscutter Tools
|
||||
* Copyright (C) 2023 jie65535
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
**/
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace GrasscutterTools.Utils
|
||||
@ -10,12 +29,16 @@ namespace GrasscutterTools.Utils
|
||||
{
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
private static extern bool AttachConsole(int dwProcessId);
|
||||
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
private static extern IntPtr GetStdHandle(StandardHandle nStdHandle);
|
||||
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
private static extern bool SetStdHandle(StandardHandle nStdHandle, IntPtr handle);
|
||||
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
private static extern FileType GetFileType(IntPtr handle);
|
||||
|
||||
//[DllImport("kernel32.dll", SetLastError = true)]
|
||||
//[return: MarshalAs(UnmanagedType.Bool)]
|
||||
//static extern bool AllocConsole();
|
||||
|
@ -1,4 +1,22 @@
|
||||
using System;
|
||||
/**
|
||||
* Grasscutter Tools
|
||||
* Copyright (C) 2023 jie65535
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
**/
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace GrasscutterTools.Utils
|
||||
|
@ -1,4 +1,23 @@
|
||||
using System;
|
||||
/**
|
||||
* Grasscutter Tools
|
||||
* Copyright (C) 2023 jie65535
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
**/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
|
@ -1,4 +1,23 @@
|
||||
using System;
|
||||
/**
|
||||
* Grasscutter Tools
|
||||
* Copyright (C) 2023 jie65535
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
**/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
|
@ -46,7 +46,6 @@ namespace GrasscutterTools.Utils
|
||||
listBox.EndUpdate();
|
||||
}
|
||||
|
||||
|
||||
private static bool Contains(string source, string filter)
|
||||
{
|
||||
source = source.ToLower();
|
||||
|
Loading…
Reference in New Issue
Block a user