Skip to content

Commit e5c5aa9

Browse files
committed
chore: 移除 builtin AquaMai
1 parent 2cd6a66 commit e5c5aa9

6 files changed

Lines changed: 29 additions & 83 deletions

File tree

MaiChartManager/Controllers/Mod/InstallationController.cs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ public record GameModInfo(
3030
bool MelonLoaderInstalled,
3131
bool AquaMaiInstalled,
3232
string AquaMaiVersion,
33-
string BundledAquaMaiVersion,
3433
bool IsJudgeDisplay4BInstalled,
3534
bool IsHidConflictExist,
3635
AquaMaiSignatureV2.VerifyResult? Signature,
@@ -53,8 +52,6 @@ public GameModInfo GetGameModInfo()
5352
aquaMaiVersion = FileVersionInfo.GetVersionInfo(ModPaths.AquaMaiDllInstalledPath).ProductVersion ?? "N/A";
5453
}
5554

56-
var aquaMaiBuiltinVersion = FileVersionInfo.GetVersionInfo(ModPaths.AquaMaiDllBuiltinPath).ProductVersion;
57-
5855
var muModInstalled = muModService.IsMuModInstalled();
5956

6057
AquaMaiSignatureV2.VerifyResult? sig = null;
@@ -79,7 +76,6 @@ public GameModInfo GetGameModInfo()
7976
IsMelonInstalled(),
8077
aquaMaiInstalled,
8178
aquaMaiVersion,
82-
aquaMaiBuiltinVersion!,
8379
GetIsJudgeDisplay4BInstalled(),
8480
GetIsHidConflictExist(),
8581
sig,
@@ -216,18 +212,6 @@ public void InstallMelonLoader()
216212
}
217213
}
218214

219-
[HttpPost]
220-
public void InstallAquaMai()
221-
{
222-
var src = Path.Combine(StaticSettings.exeDir, "AquaMai.dll");
223-
var dest = Path.Combine(StaticSettings.GamePath, @"Mods\AquaMai.dll");
224-
CopyFile(src, dest);
225-
if (System.IO.File.Exists(ModPaths.MuModDllInstalledPath))
226-
{
227-
System.IO.File.Delete(ModPaths.MuModDllInstalledPath);
228-
}
229-
}
230-
231215
[HttpPost]
232216
public void OpenJudgeAccuracyInfoPdf()
233217
{

MaiChartManager/Controllers/Mod/ModPaths.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ public static class ModPaths
55
public static string AquaMaiConfigPath => Path.Combine(StaticSettings.GamePath, "AquaMai.toml");
66
public static string AquaMaiConfigBackupDirPath => Path.Combine(StaticSettings.GamePath, "AquaMai.toml.bak");
77
public static string AquaMaiDllInstalledPath => Path.Combine(StaticSettings.GamePath, @"Mods\AquaMai.dll");
8-
public static string AquaMaiDllBuiltinPath => Path.Combine(StaticSettings.exeDir, "AquaMai.dll");
98

109
public static string MuModDllInstalledPath => Path.Combine(StaticSettings.GamePath, @"Mods\MuMod.dll");
1110
public static string MuModDllBuiltinPath => Path.Combine(StaticSettings.exeDir, "MuMod.dll");

MaiChartManager/Front/src/store/appUpdate.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,12 @@ import { ref } from "vue";
22
import { useStorage } from "@vueuse/core";
33
import { locale } from "@/locales";
44
import { aquaMaiVersionConfig } from "@/client/api";
5-
import { GetGetConfigTypeEnum } from "@/client/aquaMaiVersionConfigApiGen";
65

76
const CHANGELOG_BUCKET_BASE = 'https://munet-version-config-1251600285.cos.ap-shanghai.myqcloud.com/mcm-changelog';
87

98
// --- Mod 更新 ---
109

11-
export const modUpdateInfo = ref<Awaited<ReturnType<typeof aquaMaiVersionConfig.getGetConfig>>['data']>([{
12-
type: GetGetConfigTypeEnum.Builtin,
13-
}])
10+
export const modUpdateInfo = ref<Awaited<ReturnType<typeof aquaMaiVersionConfig.getGetConfig>>['data']>([])
1411

1512
export const updateModUpdateInfo = async () => {
1613
try {

MaiChartManager/Front/src/views/ModManager/ModInstallDropdown.tsx

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,13 @@ export default defineComponent({
1111
setup() {
1212
const showDone = ref(false);
1313
const { t } = useI18n();
14-
const installType = ref<'builtin' | 'slow' | 'ci' | 'mumod'>('slow');
14+
const installType = ref<'slow' | 'ci' | 'mumod'>('slow');
1515

1616
const { isLoading: installing, execute: doInstallAsync } = useAsyncState(
1717
async () => {
1818
const type = installType.value;
1919
if (type === 'mumod') {
2020
await api.InstallMuMod();
21-
} else if (type === 'builtin') {
22-
await api.InstallAquaMai();
2321
} else {
2422
const version = modUpdateInfo.value?.find(it => it.type === type);
2523
if (!version) throw new Error(t('mod.versionNotFound'));
@@ -39,7 +37,7 @@ export default defineComponent({
3937
}
4038
);
4139

42-
const doInstall = (type: 'builtin' | 'slow' | 'ci' | 'mumod') => {
40+
const doInstall = (type: 'slow' | 'ci' | 'mumod') => {
4341
installType.value = type;
4442
doInstallAsync(0);
4543
};
@@ -52,31 +50,32 @@ export default defineComponent({
5250
};
5351

5452
const installChannel = (type: 'slow' | 'ci') => {
55-
const hasOnlineVersion = modUpdateInfo.value?.find(it => it.type === type && it.url);
56-
if (hasOnlineVersion) {
57-
doInstall(type);
58-
} else {
59-
doInstall('builtin');
60-
}
53+
doInstall(type);
6154
};
6255

63-
const options = computed(() => [
64-
{
65-
label: t('mod.stableChannel'),
66-
desc: formatVersionDesc('slow'),
67-
action: () => installChannel('slow'),
68-
},
69-
{
70-
label: t('mod.fastChannel'),
71-
desc: formatVersionDesc('ci'),
72-
action: () => installChannel('ci'),
73-
},
74-
{
56+
const options = computed(() => {
57+
const result = [];
58+
if (modUpdateInfo.value?.find(it => it.type === 'slow' && it.url)) {
59+
result.push({
60+
label: t('mod.stableChannel'),
61+
desc: formatVersionDesc('slow'),
62+
action: () => installChannel('slow'),
63+
});
64+
}
65+
if (modUpdateInfo.value?.find(it => it.type === 'ci' && it.url)) {
66+
result.push({
67+
label: t('mod.fastChannel'),
68+
desc: formatVersionDesc('ci'),
69+
action: () => installChannel('ci'),
70+
});
71+
}
72+
result.push({
7573
label: 'MuMod',
7674
desc: t('mod.mumodDesc'),
7775
action: () => doInstall('mumod'),
78-
},
79-
]);
76+
});
77+
return result;
78+
});
8079

8180
return () => (
8281
<DropMenu options={options.value}>

MaiChartManager/Front/src/views/ModManager/shouldShowUpdateController.ts

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,11 @@ export const latestVersion = computed(() => {
5454
const defaultVersionInfo =
5555
modUpdateInfo.value?.find(it => it.type === effectiveChannel) ||
5656
modUpdateInfo.value?.find(it => it.default) ||
57-
modUpdateInfo.value?.[0] || { type: 'builtin' };
58-
if (defaultVersionInfo.type === "builtin") {
57+
modUpdateInfo.value?.[0];
58+
if (!defaultVersionInfo?.version) {
5959
return {
60-
version: modInfo.value!.bundledAquaMaiVersion!,
61-
type: 'builtin',
62-
};
63-
}
64-
let latestVersionStr = defaultVersionInfo.version!;
65-
let builtinVersion = modInfo.value!.bundledAquaMaiVersion!;
66-
if (compareVersions(latestVersionStr, builtinVersion) < 0) {
67-
return {
68-
version: builtinVersion,
69-
type: 'builtin',
60+
version: undefined as string | undefined,
61+
type: 'unknown',
7062
};
7163
}
7264
return defaultVersionInfo;
@@ -85,7 +77,7 @@ export const shouldShowUpdate = computed(() => {
8577
if (!modInfo.value?.aquaMaiVersion) return true;
8678
let currentVersion = modInfo.value.aquaMaiVersion;
8779

88-
if (!latestVersion.value?.version) return true;
80+
if (!latestVersion.value?.version) return false;
8981

9082
return compareVersions(currentVersion, latestVersion.value.version) < 0;
9183
})

Packaging/Build.ps1

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -72,31 +72,6 @@ if (Test-Path $PackDir) { Remove-Item $PackDir -Recurse -Force }
7272
Remove-Item "$PSScriptRoot\*.appx" -ErrorAction SilentlyContinue
7373
Remove-Item "$PSScriptRoot\*.msix" -ErrorAction SilentlyContinue
7474

75-
# ==========================================
76-
# 3. 构建 AquaMai
77-
# ==========================================
78-
Write-Host "Building AquaMai..." -ForegroundColor Cyan
79-
Push-Location "$ProjectRoot\AquaMai"
80-
try {
81-
Stop-Process -Name "dotnet" -Force -ErrorAction SilentlyContinue
82-
./build.ps1
83-
84-
$TargetResDir = "$ProjectRoot\MaiChartManager\Resources"
85-
if (-not (Test-Path $TargetResDir)) { New-Item -ItemType Directory -Path $TargetResDir }
86-
Copy-Item "Output\AquaMai.dll" $TargetResDir -Force
87-
88-
# AquaMai 签名
89-
if (Get-Command "AquaMaiLocalBuild.exe" -ErrorAction SilentlyContinue) {
90-
Write-Host "Signing AquaMai.dll..." -ForegroundColor Cyan
91-
AquaMaiLocalBuild.exe "$TargetResDir\AquaMai.dll"
92-
} else {
93-
Write-Host "AquaMaiLocalBuild.exe not found, skipping AquaMai signing." -ForegroundColor Yellow
94-
}
95-
96-
} finally {
97-
Pop-Location
98-
}
99-
10075
# Canary 模式下 wwwroot 由 CI 的 Linux job 预构建,跳过前端构建
10176
# Release 模式下(本地构建)始终构建前端
10277
if ($Mode -ne "Canary" -or -not (Test-Path "$ProjectRoot\MaiChartManager\wwwroot\index.html")) {

0 commit comments

Comments
 (0)