mirror of
https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
synced 2026-12-03 03:52:50 +08:00
feat: complete runtime and KAAK skin updates
This commit is contained in:
1 parent
c994722016
commit
7fd1ea96fe
40 files changed
+3436
-1088
No files matched your search
@@ -214,16 +214,23 @@ export default defineComponent({
|
||||
const definition = component.actions[actionId];
|
||||
if (!definition || !isSkinPluginComponentApproved(props.skinId, props.skinVersion, component)) return;
|
||||
const args = resolveActionArgs(definition, context, state);
|
||||
if (definition.type === "ui.setState") {
|
||||
if (typeof args.key === "string" && component.state && Object.hasOwn(component.state, args.key) && "value" in args) state[args.key] = args.value;
|
||||
return;
|
||||
}
|
||||
if (definition.type === "ui.toggleState") {
|
||||
if (typeof args.key === "string" && component.state && Object.hasOwn(component.state, args.key) && typeof state[args.key] === "boolean") {
|
||||
state[args.key] = !state[args.key];
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (definition.type === "ui.setState") {
|
||||
if (typeof args.key === "string" && component.state && Object.hasOwn(component.state, args.key) && "value" in args) {
|
||||
state[args.key] = args.value;
|
||||
refresh.value += 1;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (definition.type === "ui.toggleState") {
|
||||
if (typeof args.key === "string" && component.state && Object.hasOwn(component.state, args.key) && typeof state[args.key] === "boolean") {
|
||||
state[args.key] = !state[args.key];
|
||||
if (typeof args.resetKey === "string" && component.state && Object.hasOwn(component.state, args.resetKey) && typeof state[args.resetKey] === "boolean") {
|
||||
state[args.resetKey] = false;
|
||||
}
|
||||
refresh.value += 1;
|
||||
}
|
||||
return;
|
||||
}
|
||||
const handler = props.actions[definition.type];
|
||||
if (handler) void Promise.resolve(handler(args, component)).catch(() => undefined);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user