refactor: Add screen width and height to matcher function

This commit is contained in:
kwaroran
2024-06-10 22:28:03 +09:00
parent 8a8b9a8b9e
commit 0f9b7e1789

View File

@@ -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){