feat: add Fabric version update and improve launch params handling
This commit is contained in:
@ -21,7 +21,19 @@ declare global {
|
||||
}
|
||||
}
|
||||
|
||||
const LaunchPage = () => {
|
||||
const launchOptions = {
|
||||
downloadUrl:
|
||||
'https://github.com/DIKER0K/Comfort/releases/latest/download/Comfort.zip',
|
||||
apiReleaseUrl: 'https://api.github.com/repos/DIKER0K/Comfort/releases/latest',
|
||||
versionFileName: 'comfort_version.txt',
|
||||
packName: 'Comfort',
|
||||
memory: 4096,
|
||||
baseVersion: '1.21.4',
|
||||
serverIp: 'popa-popa.ru',
|
||||
fabricVersion: 'fabric0.16.14',
|
||||
};
|
||||
|
||||
const LaunchPage = (launchOptions: any) => {
|
||||
const navigate = useNavigate();
|
||||
const [isDownloading, setIsDownloading] = useState(false);
|
||||
const [downloadProgress, setDownloadProgress] = useState(0);
|
||||
@ -90,15 +102,12 @@ const LaunchPage = () => {
|
||||
localStorage.getItem('launcher_config') || '{}',
|
||||
);
|
||||
|
||||
// Опции для скачивания и запуска сборки
|
||||
// Опции для скачивания сборки
|
||||
const packOptions = {
|
||||
downloadUrl:
|
||||
'https://github.com/DIKER0K/Comfort/releases/latest/download/Comfort.zip',
|
||||
apiReleaseUrl:
|
||||
'https://api.github.com/repos/DIKER0K/Comfort/releases/latest',
|
||||
versionFileName: 'comfort_version.txt',
|
||||
packName: 'Comfort',
|
||||
serverIp: 'popa-popa.ru',
|
||||
downloadUrl: launchOptions.downloadUrl,
|
||||
apiReleaseUrl: launchOptions.apiReleaseUrl,
|
||||
versionFileName: launchOptions.versionFileName,
|
||||
packName: launchOptions.packName,
|
||||
};
|
||||
|
||||
// Передаем опции для скачивания
|
||||
@ -124,19 +133,20 @@ const LaunchPage = () => {
|
||||
}
|
||||
|
||||
// Опции для запуска
|
||||
const launchOptions = {
|
||||
const options = {
|
||||
accessToken: savedConfig.accessToken,
|
||||
uuid: savedConfig.uuid,
|
||||
username: savedConfig.username,
|
||||
memory: savedConfig.memory || 4096,
|
||||
baseVersion: '1.21.4',
|
||||
packName: packOptions.packName,
|
||||
serverIp: packOptions.serverIp,
|
||||
memory: launchOptions.memory,
|
||||
baseVersion: launchOptions.baseVersion,
|
||||
packName: launchOptions.packName,
|
||||
serverIp: launchOptions.serverIp,
|
||||
fabricVersion: launchOptions.fabricVersion,
|
||||
};
|
||||
|
||||
const launchResult = await window.electron.ipcRenderer.invoke(
|
||||
'launch-minecraft',
|
||||
launchOptions,
|
||||
options,
|
||||
);
|
||||
|
||||
if (needsSecondAttempt) {
|
||||
@ -149,14 +159,7 @@ const LaunchPage = () => {
|
||||
|
||||
const secondAttempt = await window.electron.ipcRenderer.invoke(
|
||||
'launch-minecraft',
|
||||
{
|
||||
accessToken: savedConfig.accessToken,
|
||||
uuid: savedConfig.uuid,
|
||||
username: savedConfig.username,
|
||||
memory: savedConfig.memory || 4096,
|
||||
serverIp: packOptions.serverIp,
|
||||
packName: packOptions.packName,
|
||||
},
|
||||
options,
|
||||
);
|
||||
|
||||
showNotification('Minecraft успешно запущен!', 'success');
|
||||
|
Reference in New Issue
Block a user