1.4.3
This commit is contained in:
parent
8b0656c133
commit
b8ff90fe9e
10
main.js
10
main.js
|
|
@ -65,7 +65,9 @@ const DEFAULT_SETTINGS = {
|
||||||
},
|
},
|
||||||
appearance: {
|
appearance: {
|
||||||
theme: 'light',
|
theme: 'light',
|
||||||
scale: '110'
|
scale: '110',
|
||||||
|
playStartupAnimation: true,
|
||||||
|
skipSplash: false
|
||||||
},
|
},
|
||||||
download: {
|
download: {
|
||||||
maxConcurrent: 64,
|
maxConcurrent: 64,
|
||||||
|
|
@ -78,7 +80,6 @@ const DEFAULT_SETTINGS = {
|
||||||
autoClearLogs: true,
|
autoClearLogs: true,
|
||||||
logRetentionValue: 7,
|
logRetentionValue: 7,
|
||||||
logRetentionUnit: 'day',
|
logRetentionUnit: 'day',
|
||||||
playStartupAnimation: true,
|
|
||||||
developerMode: false
|
developerMode: false
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -403,8 +404,9 @@ app.whenReady().then(() => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 提前初始化 BASE_DIR 以读取配置文件
|
// 提前初始化 BASE_DIR 和日志路径,确保所有 writeLog 都写入文件
|
||||||
BASE_DIR = app.getPath('userData');
|
BASE_DIR = app.getPath('userData');
|
||||||
|
initPaths();
|
||||||
|
|
||||||
// 检查是否启用防止多次启动
|
// 检查是否启用防止多次启动
|
||||||
let preventMultipleLaunch = true;
|
let preventMultipleLaunch = true;
|
||||||
|
|
@ -430,8 +432,6 @@ app.whenReady().then(() => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
initPaths();
|
|
||||||
|
|
||||||
cleanupExpiredLogs();
|
cleanupExpiredLogs();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "gpcl",
|
"name": "gpcl",
|
||||||
"version": "1.4.2",
|
"version": "1.4.3",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "gpcl",
|
"name": "gpcl",
|
||||||
"version": "1.4.2",
|
"version": "1.4.3",
|
||||||
"description": "GoodPlanCraftLauncher",
|
"description": "GoodPlanCraftLauncher",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<!--
|
<!--
|
||||||
CaelLab BY-SA Code License
|
CaelLab BY-SA Code License
|
||||||
Copyright (c) 2026 Yunyun(云云) By 虚舟实验室(CaelLab) / CaelLabGameTS
|
Copyright (c) 2026 Yunyun(云云) By 虚舟实验室(CaelLab) / CaelLabGameTS
|
||||||
|
|
||||||
|
|
@ -571,6 +571,36 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="setting-card">
|
||||||
|
<div class="setting-row">
|
||||||
|
<div class="setting-left">
|
||||||
|
<div class="setting-label">播放启动动画</div>
|
||||||
|
<div class="setting-desc">启动游戏时全屏播放 Minecraft 欢迎动画</div>
|
||||||
|
</div>
|
||||||
|
<div class="setting-control">
|
||||||
|
<label class="switch">
|
||||||
|
<input type="checkbox" id="play-startup-animation">
|
||||||
|
<span class="slider"></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="setting-card">
|
||||||
|
<div class="setting-row">
|
||||||
|
<div class="setting-left">
|
||||||
|
<div class="setting-label">不渲染Splash</div>
|
||||||
|
<div class="setting-desc">尝试在启动时不渲染Splash直接进入主界面,但可能延长白屏时间,同时对于预编译不友好</div>
|
||||||
|
</div>
|
||||||
|
<div class="setting-control">
|
||||||
|
<label class="switch">
|
||||||
|
<input type="checkbox" id="skip-splash">
|
||||||
|
<span class="slider"></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -667,21 +697,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="setting-card">
|
|
||||||
<div class="setting-row">
|
|
||||||
<div class="setting-left">
|
|
||||||
<div class="setting-label">播放启动动画</div>
|
|
||||||
<div class="setting-desc">启动游戏时全屏播放 Minecraft 欢迎动画</div>
|
|
||||||
</div>
|
|
||||||
<div class="setting-control">
|
|
||||||
<label class="switch">
|
|
||||||
<input type="checkbox" id="play-startup-animation">
|
|
||||||
<span class="slider"></span>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="setting-card">
|
<div class="setting-card">
|
||||||
<div class="setting-row">
|
<div class="setting-row">
|
||||||
<div class="setting-left">
|
<div class="setting-left">
|
||||||
|
|
|
||||||
|
|
@ -866,7 +866,12 @@ async function reloadAllSettingsToUI() {
|
||||||
|
|
||||||
const playStartupAnimationEl = document.getElementById('play-startup-animation');
|
const playStartupAnimationEl = document.getElementById('play-startup-animation');
|
||||||
if (playStartupAnimationEl) {
|
if (playStartupAnimationEl) {
|
||||||
playStartupAnimationEl.checked = settings.advanced?.playStartupAnimation === true;
|
playStartupAnimationEl.checked = settings.appearance?.playStartupAnimation === true;
|
||||||
|
}
|
||||||
|
|
||||||
|
const skipSplashEl = document.getElementById('skip-splash');
|
||||||
|
if (skipSplashEl) {
|
||||||
|
skipSplashEl.checked = settings.appearance?.skipSplash === true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const developerModeEl = document.getElementById('developer-mode');
|
const developerModeEl = document.getElementById('developer-mode');
|
||||||
|
|
@ -1723,12 +1728,12 @@ async function launchGame() {
|
||||||
let windowMode = settings.game?.windowMode || 'windowed';
|
let windowMode = settings.game?.windowMode || 'windowed';
|
||||||
let welcomeAnimPlaying = false;
|
let welcomeAnimPlaying = false;
|
||||||
|
|
||||||
if (settings.advanced?.playStartupAnimation && window.gpcl && window.gpcl.playStartupAnimation) {
|
if (settings.appearance?.playStartupAnimation && window.gpcl && window.gpcl.playStartupAnimation) {
|
||||||
setStatus('[启动动画] 正在播放欢迎动画...');
|
setStatus('[启动动画] 正在播放欢迎动画...');
|
||||||
welcomeAnimPlaying = true;
|
welcomeAnimPlaying = true;
|
||||||
windowMode = 'fullscreen';
|
windowMode = 'fullscreen';
|
||||||
|
|
||||||
settings.advanced.playStartupAnimation = false;
|
settings.appearance.playStartupAnimation = false;
|
||||||
await gpcl.saveSettings(settings);
|
await gpcl.saveSettings(settings);
|
||||||
const playStartupEl = document.getElementById('play-startup-animation');
|
const playStartupEl = document.getElementById('play-startup-animation');
|
||||||
if (playStartupEl) playStartupEl.checked = false;
|
if (playStartupEl) playStartupEl.checked = false;
|
||||||
|
|
@ -2582,12 +2587,28 @@ launchBtn.addEventListener('click', launchGame);
|
||||||
if (playStartupAnimation) {
|
if (playStartupAnimation) {
|
||||||
(async () => {
|
(async () => {
|
||||||
const settings = await loadSettings();
|
const settings = await loadSettings();
|
||||||
playStartupAnimation.checked = settings.advanced?.playStartupAnimation === true;
|
playStartupAnimation.checked = settings.appearance?.playStartupAnimation === true;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
playStartupAnimation.addEventListener('change', async () => {
|
playStartupAnimation.addEventListener('change', async () => {
|
||||||
const settings = await loadSettings();
|
const settings = await loadSettings();
|
||||||
settings.advanced.playStartupAnimation = playStartupAnimation.checked;
|
if (!settings.appearance) settings.appearance = {};
|
||||||
|
settings.appearance.playStartupAnimation = playStartupAnimation.checked;
|
||||||
|
await gpcl.saveSettings(settings);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const skipSplash = document.getElementById('skip-splash');
|
||||||
|
if (skipSplash) {
|
||||||
|
(async () => {
|
||||||
|
const settings = await loadSettings();
|
||||||
|
skipSplash.checked = settings.appearance?.skipSplash === true;
|
||||||
|
})();
|
||||||
|
|
||||||
|
skipSplash.addEventListener('change', async () => {
|
||||||
|
const settings = await loadSettings();
|
||||||
|
if (!settings.appearance) settings.appearance = {};
|
||||||
|
settings.appearance.skipSplash = skipSplash.checked;
|
||||||
await gpcl.saveSettings(settings);
|
await gpcl.saveSettings(settings);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -2708,6 +2729,18 @@ launchBtn.addEventListener('click', launchGame);
|
||||||
setCustomSelectValue('settings-scale', scale);
|
setCustomSelectValue('settings-scale', scale);
|
||||||
applyScale(scale);
|
applyScale(scale);
|
||||||
|
|
||||||
|
// 播放启动动画
|
||||||
|
const playStartupAnimSync = document.getElementById('play-startup-animation');
|
||||||
|
if (playStartupAnimSync) {
|
||||||
|
playStartupAnimSync.checked = settings.appearance?.playStartupAnimation === true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 不渲染Splash
|
||||||
|
const skipSplashSync = document.getElementById('skip-splash');
|
||||||
|
if (skipSplashSync) {
|
||||||
|
skipSplashSync.checked = settings.appearance?.skipSplash === true;
|
||||||
|
}
|
||||||
|
|
||||||
// Java镜像
|
// Java镜像
|
||||||
const javaMirror = settings.download?.javaMirror || 'tsinghua';
|
const javaMirror = settings.download?.javaMirror || 'tsinghua';
|
||||||
setCustomSelectValue('java-mirror-select', javaMirror);
|
setCustomSelectValue('java-mirror-select', javaMirror);
|
||||||
|
|
@ -3172,7 +3205,9 @@ async function loadSettings() {
|
||||||
},
|
},
|
||||||
appearance: {
|
appearance: {
|
||||||
theme: 'light',
|
theme: 'light',
|
||||||
scale: '100'
|
scale: '100',
|
||||||
|
playStartupAnimation: true,
|
||||||
|
skipSplash: false
|
||||||
},
|
},
|
||||||
download: {
|
download: {
|
||||||
maxConcurrent: 64,
|
maxConcurrent: 64,
|
||||||
|
|
@ -3185,7 +3220,6 @@ async function loadSettings() {
|
||||||
autoClearLogs: true,
|
autoClearLogs: true,
|
||||||
logRetentionValue: 7,
|
logRetentionValue: 7,
|
||||||
logRetentionUnit: 'day',
|
logRetentionUnit: 'day',
|
||||||
playStartupAnimation: true,
|
|
||||||
developerMode: false
|
developerMode: false
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<!--
|
<!--
|
||||||
CaelLab BY-SA Code License
|
CaelLab BY-SA Code License
|
||||||
Copyright (c) 2026 Yunyun(云云) By 虚舟实验室(CaelLab) / CaelLabGameTS
|
Copyright (c) 2026 Yunyun(云云) By 虚舟实验室(CaelLab) / CaelLabGameTS
|
||||||
|
|
||||||
|
|
@ -168,19 +168,33 @@
|
||||||
createParticles();
|
createParticles();
|
||||||
|
|
||||||
window.addEventListener('DOMContentLoaded', () => {
|
window.addEventListener('DOMContentLoaded', () => {
|
||||||
if (window.gpcl && window.gpcl.getAppVersion) {
|
const checkSkipSplash = async () => {
|
||||||
window.gpcl.getAppVersion().then(version => {
|
try {
|
||||||
document.getElementById('version-info').textContent = 'v' + version;
|
if (window.gpcl && window.gpcl.getSettings) {
|
||||||
});
|
const settings = await window.gpcl.getSettings();
|
||||||
}
|
if (settings && settings.appearance && settings.appearance.skipSplash === true) {
|
||||||
|
window.location.href = 'index.html';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {}
|
||||||
|
|
||||||
|
if (window.gpcl && window.gpcl.getAppVersion) {
|
||||||
|
window.gpcl.getAppVersion().then(version => {
|
||||||
|
document.getElementById('version-info').textContent = 'v' + version;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
setTimeout(() => {
|
|
||||||
const splashContent = document.getElementById('splash-content');
|
|
||||||
splashContent.classList.add('fade-out');
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
window.location.href = 'index.html';
|
const splashContent = document.getElementById('splash-content');
|
||||||
}, 500);
|
splashContent.classList.add('fade-out');
|
||||||
}, 2000);
|
setTimeout(() => {
|
||||||
|
window.location.href = 'index.html';
|
||||||
|
}, 500);
|
||||||
|
}, 2000);
|
||||||
|
};
|
||||||
|
|
||||||
|
checkSkipSplash();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue