mirror of
https://github.com/huiyadanli/RevokeMsgPatcher.git
synced 2025-05-25 15:26:08 +08:00
[+] 无文件修改器对象的时候的提示优化
This commit is contained in:
parent
016a48eb11
commit
8eb032e339
|
@ -90,7 +90,12 @@ namespace RevokeMsgPatcher
|
||||||
panelCategories.Controls.Clear();
|
panelCategories.Controls.Clear();
|
||||||
|
|
||||||
// 重新计算并修改界面元素
|
// 重新计算并修改界面元素
|
||||||
modifier.InitEditors(path);
|
bool hasEditors = modifier.InitEditors(path);
|
||||||
|
if (!hasEditors)
|
||||||
|
{
|
||||||
|
btnPatch.Enabled = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
modifier.SetVersionLabelAndCategoryCategories(lblVersion, panelCategories);
|
modifier.SetVersionLabelAndCategoryCategories(lblVersion, panelCategories);
|
||||||
|
|
||||||
EnableAllButton(true);
|
EnableAllButton(true);
|
||||||
|
@ -134,7 +139,12 @@ namespace RevokeMsgPatcher
|
||||||
|
|
||||||
EnableAllButton(false);
|
EnableAllButton(false);
|
||||||
// a.重新初始化编辑器
|
// a.重新初始化编辑器
|
||||||
modifier.InitEditors(txtPath.Text);
|
bool hasEditors = modifier.InitEditors(txtPath.Text);
|
||||||
|
if (!hasEditors)
|
||||||
|
{
|
||||||
|
btnPatch.Enabled = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
// b.获取选择的功能 (精准匹配返回null) // TODO 此处逻辑可以优化 不可完全信任UI信息
|
// b.获取选择的功能 (精准匹配返回null) // TODO 此处逻辑可以优化 不可完全信任UI信息
|
||||||
List<string> categories = UIController.GetCategoriesFromPanel(panelCategories);
|
List<string> categories = UIController.GetCategoriesFromPanel(panelCategories);
|
||||||
if (categories != null && categories.Count == 0)
|
if (categories != null && categories.Count == 0)
|
||||||
|
|
|
@ -235,7 +235,7 @@ namespace RevokeMsgPatcher.Modifier
|
||||||
/// a.初始化修改器
|
/// a.初始化修改器
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="installPath">APP安装路径</param>
|
/// <param name="installPath">APP安装路径</param>
|
||||||
public void InitEditors(string installPath)
|
public bool InitEditors(string installPath)
|
||||||
{
|
{
|
||||||
// 初始化文件修改器
|
// 初始化文件修改器
|
||||||
editors = new List<FileHexEditor>();
|
editors = new List<FileHexEditor>();
|
||||||
|
@ -251,8 +251,10 @@ namespace RevokeMsgPatcher.Modifier
|
||||||
}
|
}
|
||||||
if (editors.Count == 0)
|
if (editors.Count == 0)
|
||||||
{
|
{
|
||||||
throw new BusinessException("no_support_editor", "当前版本没有对应的文件修改信息,请确认补丁信息是否正常!");
|
MessageBox.Show("当前版本没有对应的文件修改信息,请确认补丁信息是否正常!");
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user