Remove trigger code mode
This commit is contained in:
@@ -656,25 +656,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}}>{language.blockMode}</button>
|
}}>{language.blockMode}</button>
|
||||||
<button class="bg-bgcolor py-1 rounded-md text-sm px-2" class:ring-1={currentChar.data?.triggerscript?.[0]?.effect?.[0]?.type === 'triggercode'} on:click|stopPropagation={async () => {
|
|
||||||
if(currentChar.type === 'character' && currentChar.data?.triggerscript?.[0]?.effect?.[0]?.type !== 'triggercode'){
|
|
||||||
if(currentChar.data?.triggerscript && currentChar.data?.triggerscript.length > 0){
|
|
||||||
const t = await alertConfirm(language.triggerSwitchWarn)
|
|
||||||
if(!t){
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
currentChar.data.triggerscript = [{
|
|
||||||
comment: "",
|
|
||||||
type: "start",
|
|
||||||
conditions: [],
|
|
||||||
effect: [{
|
|
||||||
type: "triggercode",
|
|
||||||
code: ""
|
|
||||||
}]
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
}}>{language.codeMode}</button>
|
|
||||||
<button class="bg-bgcolor py-1 rounded-md text-sm px-2" class:ring-1={currentChar.data?.triggerscript?.[0]?.effect?.[0]?.type === 'triggerlua'} on:click|stopPropagation={async () => {
|
<button class="bg-bgcolor py-1 rounded-md text-sm px-2" class:ring-1={currentChar.data?.triggerscript?.[0]?.effect?.[0]?.type === 'triggerlua'} on:click|stopPropagation={async () => {
|
||||||
if(currentChar.type === 'character' && currentChar.data?.triggerscript?.[0]?.effect?.[0]?.type !== 'triggerlua'){
|
if(currentChar.type === 'character' && currentChar.data?.triggerscript?.[0]?.effect?.[0]?.type !== 'triggerlua'){
|
||||||
if(currentChar.data?.triggerscript && currentChar.data?.triggerscript.length > 0){
|
if(currentChar.data?.triggerscript && currentChar.data?.triggerscript.length > 0){
|
||||||
|
|||||||
@@ -498,19 +498,6 @@ export async function runTrigger(char:character,mode:triggerMode, arg:{
|
|||||||
setVar(effect.inputVar, res)
|
setVar(effect.inputVar, res)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
case 'triggercode':{
|
|
||||||
const triggerCodeResult = await risuCommandParser(effect.code,{
|
|
||||||
chara:char,
|
|
||||||
lowLevelAccess: trigger.lowLevelAccess,
|
|
||||||
funcName: mode
|
|
||||||
})
|
|
||||||
|
|
||||||
if(triggerCodeResult['__stop_chat__'] === '1'){
|
|
||||||
stopSending = true
|
|
||||||
}
|
|
||||||
break
|
|
||||||
}
|
|
||||||
case 'triggerlua':{
|
case 'triggerlua':{
|
||||||
const triggerCodeResult = await runLua(effect.code,{
|
const triggerCodeResult = await runLua(effect.code,{
|
||||||
lowLevelAccess: trigger.lowLevelAccess,
|
lowLevelAccess: trigger.lowLevelAccess,
|
||||||
|
|||||||
Reference in New Issue
Block a user