Compare commits
12
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d2c32ed14f | ||
|
|
4b9b9ebf47 | ||
|
|
457dfd8c30 | ||
|
|
8ec5cf104c | ||
|
|
306328367e | ||
|
|
3901749d93 | ||
|
|
cee0c3bbd4 | ||
|
|
63ca20db04 | ||
|
|
0388e339db | ||
|
|
d4554b0f4c | ||
|
|
d5471bb36c | ||
|
|
f238eeae0e |
No files matched your search
@@ -1260,7 +1260,7 @@ async function replayOnboarding(mode) {
|
||||
|
||||
async function finishOnboarding() {
|
||||
const wasReplay = onboardingReplay.value
|
||||
const settings = onboardingSettings.value ?? (await getSettings())
|
||||
const settings = await getSettings()
|
||||
if (!onboardingReplay.value) {
|
||||
if (onboardingMode.value === 'instance') {
|
||||
settings.onboarding_instance_tour_completed = true
|
||||
|
||||
@@ -32,6 +32,53 @@ export const ANNOUNCEMENT_CHANGE_TYPES: readonly AnnouncementChangeType[] = [
|
||||
]
|
||||
|
||||
export const launcherAnnouncements: readonly LauncherAnnouncement[] = [
|
||||
{
|
||||
id: 'launcher-1.0.1-beta10',
|
||||
version: '1.0.1-beta10',
|
||||
publishedAt: '2026-10-02',
|
||||
title: {
|
||||
'en-US': 'Starlight Launcher 1.0.1-beta10',
|
||||
'zh-CN': 'Starlight Launcher 1.0.1-beta10',
|
||||
},
|
||||
changes: {
|
||||
added: [
|
||||
{
|
||||
'en-US': 'Reworked the instance-page tour into four steps covering content, files, worlds, and logs.',
|
||||
'zh-CN': '重做实例页导览,分为内容、文件、世界、日志四步。',
|
||||
},
|
||||
{
|
||||
'en-US': 'When the install location is a drive root, the installer now creates a Starlight subfolder automatically.',
|
||||
'zh-CN': '安装位置选到盘符根目录时,安装器会自动创建 Starlight 子文件夹。',
|
||||
},
|
||||
],
|
||||
fixed: [
|
||||
{
|
||||
'en-US': 'Fixed the launcher UI scale reverting after a restart.',
|
||||
'zh-CN': '修复启动器界面缩放重启后恢复原状的问题。',
|
||||
},
|
||||
{
|
||||
'en-US': 'Fixed developer feature flags not saving.',
|
||||
'zh-CN': '修复开发者功能开关无法保存的问题。',
|
||||
},
|
||||
{
|
||||
'en-US': 'Fixed instance group edits not saving for instances without an applied content set.',
|
||||
'zh-CN': '修复没有应用内容集的实例无法保存分组修改的问题。',
|
||||
},
|
||||
{
|
||||
'en-US': 'Fixed the launcher crashing on startup when feature flags were out of sync between the frontend and backend.',
|
||||
'zh-CN': '修复前后端功能开关不同步导致启动器启动崩溃的问题。',
|
||||
},
|
||||
{
|
||||
'en-US': 'Fixed being unable to copy text inside the embedded skin site.',
|
||||
'zh-CN': '修复内嵌皮肤站中无法复制文本的问题。',
|
||||
},
|
||||
{
|
||||
'en-US': 'Fixed the onboarding prompt not dismissing when clicking anywhere.',
|
||||
'zh-CN': '修复导览提示点击任意位置无法关闭的问题。',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'launcher-1.0.1-beta9',
|
||||
version: '1.0.1-beta9',
|
||||
|
||||
@@ -16,6 +16,7 @@ const messages = defineMessages({
|
||||
<template>
|
||||
<iframe
|
||||
:src="skinSiteFrameUrl"
|
||||
allow="clipboard-write; clipboard-read"
|
||||
:title="formatMessage(messages.frameTitle)"
|
||||
class="block h-full min-h-0 w-full border-0"
|
||||
/>
|
||||
|
||||
@@ -61,6 +61,7 @@ import {
|
||||
ButtonStyled,
|
||||
commonMessages,
|
||||
defineMessages,
|
||||
injectNotificationManager,
|
||||
NewModal,
|
||||
RadioButtons,
|
||||
StyledInput,
|
||||
@@ -72,6 +73,7 @@ import { edit, list } from '@/helpers/instance'
|
||||
import type { GameInstance } from '@/helpers/types'
|
||||
|
||||
const { formatMessage } = useVIntl()
|
||||
const { handleError } = injectNotificationManager()
|
||||
|
||||
const props = defineProps<{
|
||||
instanceIds: string[]
|
||||
@@ -148,7 +150,7 @@ async function deleteGroup(group: string) {
|
||||
for (const instance of allInstances.value) {
|
||||
if (instance.groups.includes(group)) {
|
||||
const newGroups = instance.groups.filter((g) => g !== group)
|
||||
await edit(instance.id, { groups: newGroups }).catch(() => {})
|
||||
await edit(instance.id, { groups: newGroups }).catch(handleError)
|
||||
instance.groups = newGroups
|
||||
}
|
||||
}
|
||||
@@ -167,7 +169,7 @@ async function confirm() {
|
||||
const groups = selectedGroup.value ? [selectedGroup.value.trim().substring(0, 32)] : []
|
||||
|
||||
for (const instanceId of props.instanceIds) {
|
||||
await edit(instanceId, { groups }).catch(() => {})
|
||||
await edit(instanceId, { groups }).catch(handleError)
|
||||
}
|
||||
|
||||
emit('applied')
|
||||
|
||||
@@ -35,7 +35,7 @@ const progressWidth = computed(() => `${Math.min(100, (props.current / props.tot
|
||||
<h2 :id="`onboarding-title-${step.id}`">{{ formatMessage(step.title) }}</h2>
|
||||
</div>
|
||||
<ButtonStyled circular type="transparent">
|
||||
<button :aria-label="formatMessage(onboardingMessages.skip)" @click.stop="$emit('skip')">
|
||||
<button data-onboarding-skip :aria-label="formatMessage(onboardingMessages.skip)" @click.stop="$emit('skip')">
|
||||
<XIcon />
|
||||
</button>
|
||||
</ButtonStyled>
|
||||
|
||||
@@ -252,6 +252,42 @@ export const onboardingMessages = defineMessages({
|
||||
id: 'app.onboarding.instance-tabs.description',
|
||||
defaultMessage: 'Use these tabs for content, files, screenshots, worlds, and logs. Tidy chaos.',
|
||||
},
|
||||
instanceContentTabTitle: {
|
||||
id: 'app.onboarding.instance-content-tab.title',
|
||||
defaultMessage: 'Content',
|
||||
},
|
||||
instanceContentTabDescription: {
|
||||
id: 'app.onboarding.instance-content-tab.description',
|
||||
defaultMessage:
|
||||
'Manage this instance’s mods, resource packs, and shaders here. Search, enable or disable entries, check for updates, and browse for more.',
|
||||
},
|
||||
instanceFilesTabTitle: {
|
||||
id: 'app.onboarding.instance-files-tab.title',
|
||||
defaultMessage: 'Files',
|
||||
},
|
||||
instanceFilesTabDescription: {
|
||||
id: 'app.onboarding.instance-files-tab.description',
|
||||
defaultMessage:
|
||||
'Browse the instance folder and open configs or logs in the built-in editor without leaving the launcher.',
|
||||
},
|
||||
instanceWorldsTabTitle: {
|
||||
id: 'app.onboarding.instance-worlds-tab.title',
|
||||
defaultMessage: 'Worlds',
|
||||
},
|
||||
instanceWorldsTabDescription: {
|
||||
id: 'app.onboarding.instance-worlds-tab.description',
|
||||
defaultMessage:
|
||||
'Manage saved worlds: back them up, rename, edit world settings, and open the world folder.',
|
||||
},
|
||||
instanceLogsTabTitle: {
|
||||
id: 'app.onboarding.instance-logs-tab.title',
|
||||
defaultMessage: 'Logs',
|
||||
},
|
||||
instanceLogsTabDescription: {
|
||||
id: 'app.onboarding.instance-logs-tab.description',
|
||||
defaultMessage:
|
||||
'Read the instance’s live logs to trace crashes and errors without digging through files.',
|
||||
},
|
||||
labTitle: {
|
||||
id: 'app.onboarding.lab.title',
|
||||
defaultMessage: 'Useful tools, built in',
|
||||
@@ -509,15 +545,29 @@ export const onboardingTours: Record<OnboardingMode, OnboardingStep[]> = {
|
||||
onboardingMessages.instanceActionsTitle,
|
||||
onboardingMessages.instanceActionsDescription,
|
||||
),
|
||||
step(
|
||||
'instance-tabs',
|
||||
'inspect',
|
||||
copy(
|
||||
onboardingMessages.instanceTabsTitle,
|
||||
onboardingMessages.instanceTabsDescription,
|
||||
onboardingMessages.finishArea,
|
||||
),
|
||||
{ targetId: 'instance-tabs' },
|
||||
inspect(
|
||||
'instance-content-tab',
|
||||
'instance-tab-content',
|
||||
onboardingMessages.instanceContentTabTitle,
|
||||
onboardingMessages.instanceContentTabDescription,
|
||||
),
|
||||
inspect(
|
||||
'instance-files-tab',
|
||||
'instance-tab-files',
|
||||
onboardingMessages.instanceFilesTabTitle,
|
||||
onboardingMessages.instanceFilesTabDescription,
|
||||
),
|
||||
inspect(
|
||||
'instance-worlds-tab',
|
||||
'instance-tab-worlds',
|
||||
onboardingMessages.instanceWorldsTabTitle,
|
||||
onboardingMessages.instanceWorldsTabDescription,
|
||||
),
|
||||
inspect(
|
||||
'instance-logs-tab',
|
||||
'instance-tab-logs',
|
||||
onboardingMessages.instanceLogsTabTitle,
|
||||
onboardingMessages.instanceLogsTabDescription,
|
||||
),
|
||||
],
|
||||
}
|
||||
|
||||
@@ -279,8 +279,11 @@ export function useOnboardingTour(
|
||||
function handleDocumentClick(event: MouseEvent) {
|
||||
if (!visible.value) return
|
||||
const clickedElement = event.target instanceof Element ? event.target : null
|
||||
if (clickedElement?.closest('[data-onboarding-overlay-ui]')) return
|
||||
|
||||
// 跳过/关闭按钮由其自身处理,不在全局点击里推进
|
||||
if (clickedElement?.closest('[data-onboarding-skip]')) return
|
||||
|
||||
// inspect 步:点击任意位置(含导览气泡本身)都继续下一步
|
||||
if (step.value.interaction === 'inspect') {
|
||||
event.preventDefault()
|
||||
event.stopImmediatePropagation()
|
||||
@@ -288,6 +291,9 @@ export function useOnboardingTour(
|
||||
return
|
||||
}
|
||||
|
||||
// 非 inspect 步:点在导览 UI 自身时不处理
|
||||
if (clickedElement?.closest('[data-onboarding-overlay-ui]')) return
|
||||
|
||||
if (!step.value.targetId || !['navigate', 'activate'].includes(step.value.interaction)) return
|
||||
if (clickedElement && handleBranchClick(clickedElement)) return
|
||||
if (!targetElement.value?.contains(event.target as Node)) return
|
||||
|
||||
@@ -6008,6 +6008,30 @@
|
||||
"app.onboarding.instance-actions.title": {
|
||||
"message": "The main controls"
|
||||
},
|
||||
"app.onboarding.instance-content-tab.title": {
|
||||
"message": "Content"
|
||||
},
|
||||
"app.onboarding.instance-content-tab.description": {
|
||||
"message": "Manage this instance’s mods, resource packs, and shaders here. Search, enable or disable entries, check for updates, and browse for more."
|
||||
},
|
||||
"app.onboarding.instance-files-tab.title": {
|
||||
"message": "Files"
|
||||
},
|
||||
"app.onboarding.instance-files-tab.description": {
|
||||
"message": "Browse the instance folder and open configs or logs in the built-in editor without leaving the launcher."
|
||||
},
|
||||
"app.onboarding.instance-worlds-tab.title": {
|
||||
"message": "Worlds"
|
||||
},
|
||||
"app.onboarding.instance-worlds-tab.description": {
|
||||
"message": "Manage saved worlds: back them up, rename, edit world settings, and open the world folder."
|
||||
},
|
||||
"app.onboarding.instance-logs-tab.title": {
|
||||
"message": "Logs"
|
||||
},
|
||||
"app.onboarding.instance-logs-tab.description": {
|
||||
"message": "Read the instance’s live logs to trace crashes and errors without digging through files."
|
||||
},
|
||||
"app.onboarding.instance-mode.description": {
|
||||
"message": "StarLight automatically installs the administrator-selected modpack and versions, then checks and completes updates before every launch. A StarLight login is required. Choose Local to select your own versions and modpacks for other servers or single-player."
|
||||
},
|
||||
|
||||
@@ -5995,6 +5995,30 @@
|
||||
"app.onboarding.instance-actions.title": {
|
||||
"message": "主操作台"
|
||||
},
|
||||
"app.onboarding.instance-content-tab.title": {
|
||||
"message": "内容"
|
||||
},
|
||||
"app.onboarding.instance-content-tab.description": {
|
||||
"message": "在这里管理实例的 Mod、资源包与光影。可搜索、启用或禁用条目、检查更新,也能继续浏览安装新内容。"
|
||||
},
|
||||
"app.onboarding.instance-files-tab.title": {
|
||||
"message": "文件"
|
||||
},
|
||||
"app.onboarding.instance-files-tab.description": {
|
||||
"message": "浏览实例目录,用内置编辑器直接打开配置文件或日志,无需离开启动器。"
|
||||
},
|
||||
"app.onboarding.instance-worlds-tab.title": {
|
||||
"message": "世界"
|
||||
},
|
||||
"app.onboarding.instance-worlds-tab.description": {
|
||||
"message": "管理存档世界:备份、重命名、编辑世界设置,或打开世界所在文件夹。"
|
||||
},
|
||||
"app.onboarding.instance-logs-tab.title": {
|
||||
"message": "日志"
|
||||
},
|
||||
"app.onboarding.instance-logs-tab.description": {
|
||||
"message": "查看实例的实时日志,排查崩溃与报错,不必再翻找文件。"
|
||||
},
|
||||
"app.onboarding.instance-tabs.description": {
|
||||
"message": "内容、文件、截图、世界和日志都在这些标签里。乱中有序。"
|
||||
},
|
||||
|
||||
@@ -688,11 +688,13 @@ const tabs = computed(() => [
|
||||
label: formatMessage(messages.contentTab),
|
||||
href: `${basePath.value}`,
|
||||
icon: BoxesIcon,
|
||||
onboardingId: 'instance-tab-content',
|
||||
},
|
||||
{
|
||||
label: formatMessage(messages.filesTab),
|
||||
href: `${basePath.value}/files`,
|
||||
icon: FolderOpenIcon,
|
||||
onboardingId: 'instance-tab-files',
|
||||
},
|
||||
{
|
||||
label: formatMessage(messages.screenshotsTab),
|
||||
@@ -703,11 +705,13 @@ const tabs = computed(() => [
|
||||
label: formatMessage(messages.worldsTab),
|
||||
href: `${basePath.value}/worlds`,
|
||||
icon: GlobeIcon,
|
||||
onboardingId: 'instance-tab-worlds',
|
||||
},
|
||||
{
|
||||
label: formatMessage(messages.logsTab),
|
||||
href: `${basePath.value}/logs`,
|
||||
icon: TerminalSquareIcon,
|
||||
onboardingId: 'instance-tab-logs',
|
||||
},
|
||||
])
|
||||
|
||||
|
||||
@@ -650,6 +650,15 @@ Function PageLeaveOptions
|
||||
Abort
|
||||
${EndIf}
|
||||
|
||||
; 若安装位置被选在盘符根目录(如 E:\),自动在其下创建 Starlight 子目录,
|
||||
; 避免启动器文件直接散落在根目录。用户选的具体子目录不受影响。
|
||||
${GetRoot} "$INSTDIR" $0
|
||||
StrCpy $1 "$0" -1
|
||||
${If} "$INSTDIR" == "$1"
|
||||
StrCpy $INSTDIR "$INSTDIR\Starlight"
|
||||
${NSD_SetText} $InstallDirInput $INSTDIR
|
||||
${EndIf}
|
||||
|
||||
${NSD_GetState} $DesktopShortcutCheckbox $DesktopShortcutState
|
||||
|
||||
${If} $FreshInstall <> 1
|
||||
|
||||
@@ -478,27 +478,51 @@ fn edit_to_core(edit_instance: EditInstance) -> Result<CoreEditInstance> {
|
||||
None => Ok(CoreInstanceLink::Unmanaged),
|
||||
})
|
||||
.transpose()?,
|
||||
launch_overrides: Some(InstanceLaunchOverridesPatch {
|
||||
player: None,
|
||||
instance_mode: None,
|
||||
java_path: edit_instance.java_path,
|
||||
extra_launch_args: edit_instance.extra_launch_args,
|
||||
custom_env_vars: edit_instance.custom_env_vars,
|
||||
memory: edit_instance.memory,
|
||||
force_fullscreen: edit_instance.force_fullscreen,
|
||||
maximize_window: edit_instance.maximize_window,
|
||||
game_resolution: edit_instance.game_resolution,
|
||||
launch_preparation_timeout: edit_instance
|
||||
.launch_preparation_timeout,
|
||||
hooks: edit_instance.hooks,
|
||||
}),
|
||||
content_set_patch: Some(AppliedContentSetPatch {
|
||||
source_kind: None,
|
||||
game_version: edit_instance.game_version,
|
||||
protocol_version: Some(None),
|
||||
loader: edit_instance.loader,
|
||||
loader_version: edit_instance.loader_version,
|
||||
}),
|
||||
launch_overrides: {
|
||||
let has_launch_change = edit_instance.java_path.is_some()
|
||||
|| edit_instance.extra_launch_args.is_some()
|
||||
|| edit_instance.custom_env_vars.is_some()
|
||||
|| edit_instance.memory.is_some()
|
||||
|| edit_instance.force_fullscreen.is_some()
|
||||
|| edit_instance.maximize_window.is_some()
|
||||
|| edit_instance.game_resolution.is_some()
|
||||
|| edit_instance.launch_preparation_timeout.is_some()
|
||||
|| edit_instance.hooks.is_some();
|
||||
if has_launch_change {
|
||||
Some(InstanceLaunchOverridesPatch {
|
||||
player: None,
|
||||
instance_mode: None,
|
||||
java_path: edit_instance.java_path,
|
||||
extra_launch_args: edit_instance.extra_launch_args,
|
||||
custom_env_vars: edit_instance.custom_env_vars,
|
||||
memory: edit_instance.memory,
|
||||
force_fullscreen: edit_instance.force_fullscreen,
|
||||
maximize_window: edit_instance.maximize_window,
|
||||
game_resolution: edit_instance.game_resolution,
|
||||
launch_preparation_timeout: edit_instance
|
||||
.launch_preparation_timeout,
|
||||
hooks: edit_instance.hooks,
|
||||
})
|
||||
} else {
|
||||
None
|
||||
}
|
||||
},
|
||||
content_set_patch: {
|
||||
let has_content_change = edit_instance.game_version.is_some()
|
||||
|| edit_instance.loader.is_some()
|
||||
|| edit_instance.loader_version.is_some();
|
||||
if has_content_change {
|
||||
Some(AppliedContentSetPatch {
|
||||
source_kind: None,
|
||||
game_version: edit_instance.game_version,
|
||||
protocol_version: Some(None),
|
||||
loader: edit_instance.loader,
|
||||
loader_version: edit_instance.loader_version,
|
||||
})
|
||||
} else {
|
||||
None
|
||||
}
|
||||
},
|
||||
last_played: None,
|
||||
submitted_time_played: None,
|
||||
recent_time_played: None,
|
||||
|
||||
@@ -181,6 +181,7 @@ pub struct Settings {
|
||||
pub migrated: bool,
|
||||
|
||||
pub developer_mode: bool,
|
||||
#[serde(deserialize_with = "deserialize_feature_flags")]
|
||||
pub feature_flags: HashMap<FeatureFlag, bool>,
|
||||
|
||||
pub skipped_update: Option<String>,
|
||||
@@ -222,6 +223,43 @@ pub enum FeatureFlag {
|
||||
AutoInstallDependencies,
|
||||
}
|
||||
|
||||
/// 反序列化 feature flags,遇到未知的 flag 名称时直接忽略,而不是报错。
|
||||
///
|
||||
/// 这样即使前端(或更新的版本)写入了当前后端不认识的 flag,
|
||||
/// 旧版本也能正常读取设置,而不是整包失败导致启动器初始化崩溃。
|
||||
fn deserialize_feature_flags<'de, D>(
|
||||
deserializer: D,
|
||||
) -> Result<HashMap<FeatureFlag, bool>, D::Error>
|
||||
where
|
||||
D: serde::Deserializer<'de>,
|
||||
{
|
||||
let raw = HashMap::<String, bool>::deserialize(deserializer)?;
|
||||
Ok(filter_known_feature_flags(raw))
|
||||
}
|
||||
|
||||
/// 从 JSON 字符串解析 feature flags,忽略未知名称。
|
||||
fn parse_feature_flags_json(value: &str) -> HashMap<FeatureFlag, bool> {
|
||||
match serde_json::from_str::<HashMap<String, bool>>(value) {
|
||||
Ok(raw) => filter_known_feature_flags(raw),
|
||||
Err(_) => HashMap::new(),
|
||||
}
|
||||
}
|
||||
|
||||
/// 只保留能解析为 [`FeatureFlag`] 的条目,未知名称静默丢弃。
|
||||
fn filter_known_feature_flags(
|
||||
raw: HashMap<String, bool>,
|
||||
) -> HashMap<FeatureFlag, bool> {
|
||||
let mut flags = HashMap::with_capacity(raw.len());
|
||||
for (key, value) in raw {
|
||||
if let Ok(flag) = serde_json::from_value::<FeatureFlag>(
|
||||
serde_json::Value::String(key),
|
||||
) {
|
||||
flags.insert(flag, value);
|
||||
}
|
||||
}
|
||||
flags
|
||||
}
|
||||
|
||||
impl Settings {
|
||||
const CURRENT_VERSION: usize = 3;
|
||||
|
||||
@@ -384,8 +422,8 @@ impl Settings {
|
||||
migrated: res.migrated == 1,
|
||||
feature_flags: res
|
||||
.feature_flags
|
||||
.as_ref()
|
||||
.and_then(|x| serde_json::from_str(x).ok())
|
||||
.as_deref()
|
||||
.map(parse_feature_flags_json)
|
||||
.unwrap_or_default(),
|
||||
skipped_update: res.skipped_update,
|
||||
pending_update_toast_for_version: res
|
||||
|
||||
Reference in new issue
Block a user