mirror of
https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
synced 2026-12-03 03:52:50 +08:00
release: prepare v0.2.8
This commit is contained in:
1 parent
4375f01d05
commit
54e154be1a
36 files changed
+1158
-195
No files matched your search
@@ -69,6 +69,7 @@ import LanguageSwitcher from "../components/LanguageSwitcher.vue";
|
||||
import SkinLoadRecoveryNotice from "../components/SkinLoadRecoveryNotice.vue";
|
||||
import SkinSwitcher, { type SkinOption } from "../components/SkinSwitcher.vue";
|
||||
import { saveLocalPreferences } from "../services/local-persistence.js";
|
||||
import { resolveSkinMessages } from "../services/skin-content.js";
|
||||
import { BUILTIN_ILLUSIA_SKIN_ID, isPublicSkinEnabled } from "../services/skin-catalog.js";
|
||||
import { BUILTIN_DARK_SKIN, BUILTIN_LIGHT_SKIN } from "../services/skin-runtime.js";
|
||||
import { usePublicSkin } from "../composables/usePublicSkin.js";
|
||||
@@ -105,6 +106,7 @@ const copy = computed(() => {
|
||||
}
|
||||
return result;
|
||||
});
|
||||
const skinMessages = computed(() => resolveSkinMessages(activeSkin.value?.contentData, language.value));
|
||||
const selectedChannelId = ref("quiet");
|
||||
const activeTab = ref<Tab>("channel");
|
||||
const speakingId = ref("illusia");
|
||||
@@ -139,6 +141,7 @@ function sendMessage() { const text = draft.value.trim(); if (!text) return; mes
|
||||
function avatarStyle(name: string) { let hash = 0; for (const char of name) hash = char.charCodeAt(0) + ((hash << 5) - hash); const colors = ["#168f83", "#7b9ed0", "#b99070", "#8b78b9"]; return { background: colors[Math.abs(hash) % colors.length] }; }
|
||||
|
||||
const skinPluginContext = computed(() => ({
|
||||
skin: { locale: language.value, messages: skinMessages.value },
|
||||
session: {
|
||||
status: { connected: true, connecting: false, channelId: selectedChannel.value.id, channelName: selectedChannel.value.name, userName: "illusia" },
|
||||
channels: channels.map((channel, depth) => ({ id: channel.id, name: channel.name, parentId: "", depth, memberCount: channel.members.length, current: channel.id === selectedChannel.value.id })),
|
||||
|
||||
@@ -1003,6 +1003,7 @@ import { applyTheme, getStoredTheme, type ThemeMode } from "../services/theme.js
|
||||
import { createScreenWakeLockController, getScreenWakeLockApi, type ScreenWakeLockController, type ScreenWakeLockSnapshot } from "../services/screen-wake-lock.js";
|
||||
import { createMobileAwayController, type MobileAwayController } from "../services/mobile-away.js";
|
||||
import { createSkinPluginQuickServerProjection, safeSkinServerDisplayName } from "../services/skin-plugin-context.js";
|
||||
import { resolveSkinMessages } from "../services/skin-content.js";
|
||||
import { loadSkinPluginAuthoringDocument } from "../services/skin-plugin-authoring.js";
|
||||
import type { SkinPluginDocument, SkinPluginWidgetOptions } from "../../../src/shared/skin-plugin.js";
|
||||
import { combineTeamSpeakTarget, DEFAULT_TEAM_SPEAK_PORT, isValidTeamSpeakPort, splitTeamSpeakTarget } from "../services/teamspeak-target.js";
|
||||
@@ -1147,7 +1148,7 @@ watch(activeSkin, () => {
|
||||
skinPluginSurfaceActive.value = false;
|
||||
skinRuntimePluginSurfaceActive.value = false;
|
||||
}, { flush: "sync" });
|
||||
const skinMessageOverrides = computed(() => resolveSkinMessages(activeSkin.value, language.value));
|
||||
const skinMessageOverrides = computed(() => resolveSkinMessages(activeSkin.value?.contentData, language.value));
|
||||
const { t: translate, localizedMessage, localizedAudioNotice, visibleErrorCode } = useWebClientI18n(language);
|
||||
function t(key: string, variables: Record<string, string | number> = {}) {
|
||||
const template = skinMessageOverrides.value[key];
|
||||
@@ -1599,8 +1600,12 @@ const skinPluginMembers = computed(() => memberChannels.value.flatMap((item) =>
|
||||
};
|
||||
})));
|
||||
|
||||
const skinPluginContext = computed(() => ({
|
||||
session: {
|
||||
const skinPluginContext = computed(() => ({
|
||||
skin: {
|
||||
locale: language.value,
|
||||
messages: skinMessageOverrides.value,
|
||||
},
|
||||
session: {
|
||||
status: {
|
||||
connected: voiceState.connected,
|
||||
connecting: voiceState.connecting,
|
||||
@@ -2230,16 +2235,7 @@ function resolveSkinHomeCopy(skin: InstalledSkin | null, locale: Language): Skin
|
||||
return result;
|
||||
}
|
||||
|
||||
function resolveSkinMessages(skin: InstalledSkin | null, locale: Language): Record<string, string> {
|
||||
const content = skin?.contentData;
|
||||
if (!content) return {};
|
||||
const fullLocale = locale === "zh" ? "zh-CN" : locale === "en" ? "en-US" : locale === "de" ? "de-DE" : locale === "ru" ? "ru-RU" : "ja-JP";
|
||||
const candidates = [...new Set([content.defaultLocale, locale, fullLocale])];
|
||||
const result: Record<string, string> = {};
|
||||
for (const candidate of candidates) Object.assign(result, content.locales[candidate]?.messages ?? {});
|
||||
return result;
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
||||
<style scoped src="../styles/web-client.css"></style>
|
||||
|
||||
|
||||
Reference in new issue
Block a user