mirror of
https://github.com/LorisYounger/VPet.git
synced 2024-08-30 18:42:36 +00:00
新增自动启用DLC插件功能
This commit is contained in:
parent
a8107a6ea8
commit
537d5ad543
1
.gitignore
vendored
1
.gitignore
vendored
@ -353,3 +353,4 @@ MigrationBackup/
|
||||
*.rar
|
||||
*_PDLC_*
|
||||
*_DLC_*
|
||||
VPet-Simulator.Windows/mod/1111_ChatGPTPlus
|
||||
|
@ -16,6 +16,11 @@ namespace VPet_Simulator.Windows
|
||||
{
|
||||
public class CoreMOD
|
||||
{
|
||||
/// <summary>
|
||||
/// 自动启用MOD名称
|
||||
/// </summary>
|
||||
public static readonly string[] OnModDefList = new string[] { "Core", "PCat", "ModMaker" };
|
||||
|
||||
public static HashSet<string> LoadedDLL { get; } = new HashSet<string>()
|
||||
{
|
||||
"Panuon.WPF.dll","steam_api.dll","Panuon.WPF.UI.dll","steam_api64.dll",
|
||||
@ -274,7 +279,7 @@ namespace VPet_Simulator.Windows
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
catch (Exception e)
|
||||
{
|
||||
ErrorMessage = e.Message;
|
||||
Tag.Add("该模组已损坏");
|
||||
@ -338,7 +343,7 @@ namespace VPet_Simulator.Windows
|
||||
}
|
||||
public static bool IsOnMod(this Setting t, string ModName)
|
||||
{
|
||||
if (ModName == "Core")
|
||||
if (CoreMOD.OnModDefList.Contains(ModName))
|
||||
return true;
|
||||
var line = t.FindLine("onmod");
|
||||
if (line == null)
|
||||
|
@ -547,11 +547,13 @@ namespace VPet_Simulator.Windows
|
||||
|
||||
private void ButtonDisEnable_MouseDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (mod.Name.ToLower() == "core")
|
||||
if (mod.Name == "Core")
|
||||
{
|
||||
MessageBoxX.Show("模组 Core 为<虚拟桌宠模拟器>核心文件,无法停用".Translate(), "停用失败".Translate());
|
||||
return;
|
||||
}
|
||||
else if (CoreMOD.OnModDefList.Contains(mod.Name))
|
||||
return;
|
||||
mw.Set.OnModRemove(mod.Name);
|
||||
ShowMod(mod.Name);
|
||||
ButtonRestart.Visibility = Visibility.Visible;
|
||||
@ -577,7 +579,7 @@ namespace VPet_Simulator.Windows
|
||||
MessageBoxX.Show("请先登录Steam后才能上传文件".Translate(), "上传MOD需要Steam登录".Translate(), MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (mods.Name.ToLower() == "core")
|
||||
if (CoreMOD.OnModDefList.Contains(mods.Name))
|
||||
{
|
||||
MessageBoxX.Show("模组 Core 为<虚拟桌宠模拟器>核心文件,无法发布\n如需发布自定义内容,请复制并更改名称".Translate(), "MOD上传失败".Translate(), MessageBoxIcon.Error);
|
||||
return;
|
||||
|
@ -1,9 +1,17 @@
|
||||
chcp 65001
|
||||
|
||||
mklink /d "%~dp0\bin\x64\Debug\net462\mod" "%~dp0\mod"
|
||||
|
||||
echo ^"以下是其他相关MOD的自动链接生成, 若提示错误为正常现象,无需理会"
|
||||
echo "The following is the automatic link generation for other related MODs. If an error is prompted, it is a normal phenomenon and should not be ignored"
|
||||
|
||||
mklink /d "%~dp0\bin\x64\Release\net462\mod" "%~dp0\mod"
|
||||
|
||||
mklink /d "%~dp0\mod\0001_ModMaker" "%~dp0\..\..\VPet.ModMaker\0001_ModMaker"
|
||||
mklink /d "%~dp0\mod\1100_DemoClock" "%~dp0\..\..\VPet.Plugin.Demo\VPet.Plugin.DemoClock\1100_DemoClock"
|
||||
mklink /d "%~dp0\mod\1111_ChatGPTPlus" "%~dp0\..\..\VPet.Plugin.ChatGPTPlus\VPet.Plugin.ChatGPTPlus\1111_ChatGPTPlus"
|
||||
mklink /d "%~dp0\mod\1101_EdgeTTS" "%~dp0\..\..\VPet.Plugin.Demo\VPet.Plugin.EdgeTTS\1101_EdgeTTS"
|
||||
mklink /d "%~dp0\mod\1110_ChatGPT" "%~dp0\..\..\VPet.Plugin.Demo\VPet.Plugin.ChatGPT\1110_ChatGPT"
|
||||
|
||||
|
||||
pause
|
Loading…
Reference in New Issue
Block a user