[feat] new sidebar

This commit is contained in:
kwaroran
2023-07-26 00:13:56 +09:00
parent 9d0c48574d
commit 5e9683a5e4
22 changed files with 186 additions and 57 deletions

View File

@@ -524,12 +524,17 @@ const blockMatcher = (p1:string,matcherArg:matcherArg) => {
const content = p1.substring(bn + 1)
const statement = logic.split(" ", 2)
if(["","0","-1"].includes(statement[1])){
return ''
switch(statement[0]){
case 'if':{
if(["","0","-1"].includes(statement[1])){
return ''
}
return content.trim()
}
}
return content.trim()
return null
}
@@ -562,6 +567,7 @@ export function risuChatParser(da:string, arg:{
let nested:string[] = [""]
let pf = performance.now()
let v = new Uint8Array(512)
let pureMode = false
const matcherObj = {
chatID: chatID,
chara: chara,
@@ -603,7 +609,7 @@ export function risuChatParser(da:string, arg:{
}
pointer++
const dat = nested.shift()
const mc = matcher(dat, matcherObj)
const mc = (pureMode) ? null :matcher(dat, matcherObj)
nested[0] += mc ?? `{{${dat}}}`
break
}
@@ -612,8 +618,21 @@ export function risuChatParser(da:string, arg:{
break
}
const dat = nested.shift()
const mc = smMatcher(dat, matcherObj)
nested[0] += mc ?? `<${dat}>`
switch(dat){
case 'Pure':{
pureMode = true
break
}
case '/Pure':{
pureMode = false
break
}
default:{
const mc = (pureMode) ? null : smMatcher(dat, matcherObj)
nested[0] += mc ?? `<${dat}>`
break
}
}
break
}
default:{

View File

@@ -39,7 +39,7 @@ interface fetchLog{
let fetchLog:fetchLog[] = []
export async function downloadFile(name:string, data:Uint8Array) {
export async function downloadFile(name:string, data:Uint8Array|ArrayBuffer) {
const downloadURL = (data:string, fileName:string) => {
const a = document.createElement('a')
a.href = data

View File

@@ -5,17 +5,20 @@ function updateSize(){
w: window.innerWidth,
h: window.innerHeight
})
DynamicGUI.set(window.innerWidth <= 1024)
}
export const SizeStore = writable({
w: 0,
h: 0
})
export const DynamicGUI = writable(false)
export const sideBarStore = writable(window.innerWidth > 1024)
export const selectedCharID = writable(-1)
export const CharEmotion = writable({} as {[key:string]: [string, string, number][]})
export const ViewBoxsize = writable({ width: 12 * 16, height: 12 * 16 }); // Default width and height in pixels
export const settingsOpen = writable(false)
export const botMakerMode = writable(false)
updateSize()
window.addEventListener("resize", updateSize);