From 0f9b7e1789c6d742349095fc71f460c48197ee08 Mon Sep 17 00:00:00 2001 From: kwaroran Date: Mon, 10 Jun 2024 22:28:03 +0900 Subject: [PATCH] refactor: Add screen width and height to matcher function --- src/ts/parser.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ts/parser.ts b/src/ts/parser.ts index 01b58d2b..645dce19 100644 --- a/src/ts/parser.ts +++ b/src/ts/parser.ts @@ -6,7 +6,7 @@ import { getFileSrc } from './storage/globalApi'; import { processScriptFull } from './process/scripts'; import { get } from 'svelte/store'; import css from '@adobe/css-tools' -import { selectedCharID } from './stores'; +import { SizeStore, selectedCharID } from './stores'; import { calcString } from './process/infunctions'; import { findCharacterbyId, parseKeyValue, sfc32, uuidtoNumber } from './util'; import { getInlayImage } from './process/files/image'; @@ -764,6 +764,12 @@ const matcher = (p1:string,matcherArg:matcherArg) => { case 'unixtime':{ return (Date.now() / 1000).toFixed(2) } + case 'screen_width':{ + return get(SizeStore).w.toString() + } + case 'screen_height':{ + return get(SizeStore).h.toString() + } } const arra = p1.split("::") if(arra.length > 1){