diff --git a/src/renderer/config-blocks/Lookup.svelte b/src/renderer/config-blocks/Lookup.svelte index c528a93e..5a84a012 100644 --- a/src/renderer/config-blocks/Lookup.svelte +++ b/src/renderer/config-blocks/Lookup.svelte @@ -52,12 +52,10 @@ let scriptSegments = []; let lookupTable = {}; - $: { - lookupTable = createLookupTable(config.script); - } + $: handleScriptChange($config.script); - $: if (lookupTable.source || lookupTable.pairs.length) { - sendData(); + function handleScriptChange(script) { + lookupTable = createLookupTable(script); } let suggestions = []; @@ -78,6 +76,7 @@ array.push(pair.output); }); + console.log(lookupTable); array = [lookupTable.source, ...array]; const script = Script.toScript({ @@ -115,15 +114,13 @@ function addNewLine() { lookupTable.pairs = [...lookupTable.pairs, ["", ""]]; + sendData(); } function removeLine(i) { lookupTable.pairs.splice(i, 1); lookupTable.pairs = [...lookupTable.pairs]; } - - let suggestionElement1 = undefined; - let suggestionElement2 = undefined; { - lookupTable.source = e.detail; + sendData(); }} on:validator={(e) => { const data = e.detail; @@ -209,7 +206,8 @@ {suggestions} bind:value={lookupTable.destination} on:input={(e) => { - lookupTable.destination = e.detail; + //lookupTable.destination = e.detail; + sendData(); }} validator={(e) => { return new Validator(e).NotEmpty().Result(); diff --git a/src/renderer/config-blocks/Macro.svelte b/src/renderer/config-blocks/Macro.svelte index cec7133d..788077fb 100644 --- a/src/renderer/config-blocks/Macro.svelte +++ b/src/renderer/config-blocks/Macro.svelte @@ -89,7 +89,7 @@ }); $: { - scriptToKeyList({ script: config.script }); + scriptToKeyList({ script: $config.script }); } function change_layout() { @@ -395,9 +395,7 @@ } -
+
Macro Input Field
diff --git a/src/renderer/config-blocks/SettingsButton.svelte b/src/renderer/config-blocks/SettingsButton.svelte index e0ffe1ad..9d6ce35f 100644 --- a/src/renderer/config-blocks/SettingsButton.svelte +++ b/src/renderer/config-blocks/SettingsButton.svelte @@ -118,7 +118,6 @@ bind:value={bmo} suggestions={suggestions[0]} on:input={(e) => { - bmo = e.detail; sendData(); }} validator={(e) => { @@ -145,7 +144,6 @@ : new Validator(e).Result(); }} on:input={(e) => { - bmi = e.detail; sendData(); }} on:validator={(e) => { @@ -167,7 +165,6 @@ : new Validator(e).Result(); }} on:input={(e) => { - bma = e.detail; sendData(); }} on:validator={(e) => { diff --git a/src/renderer/config-blocks/SettingsEncoder.svelte b/src/renderer/config-blocks/SettingsEncoder.svelte index f6828fb5..5af27330 100644 --- a/src/renderer/config-blocks/SettingsEncoder.svelte +++ b/src/renderer/config-blocks/SettingsEncoder.svelte @@ -44,8 +44,10 @@ const whatsInParenthesis = /\(([^)]+)\)/; - $: { - const arr = config.script.split("self:").slice(1); + $: handleScriptChange($config.script); + + function handleScriptChange(script) { + const arr = script.split("self:").slice(1); const extractParam = (index) => { const param = whatsInParenthesis.exec(arr[index]); @@ -130,7 +132,7 @@ return new Validator(e).NotEmpty().Result(); }} on:input={(e) => { - emo = e.detail; + //emo = e.detail; }} on:validator={(e) => { const data = e.detail; @@ -149,7 +151,7 @@ return new Validator(e).NotEmpty().Result(); }} on:input={(e) => { - ev0 = e.detail; + //ev0 = e.detail; }} on:validator={(e) => { const data = e.detail; @@ -174,7 +176,7 @@ : new Validator(e).Result(); }} on:input={(e) => { - emi = e.detail; + //emi = e.detail; }} on:validator={(e) => { const data = e.detail; @@ -195,7 +197,7 @@ : new Validator(e).Result(); }} on:input={(e) => { - ema = e.detail; + //ema = e.detail; }} on:validator={(e) => { const data = e.detail; @@ -218,7 +220,7 @@ : new Validator(e).Result(); }} on:input={(e) => { - ese = e.detail; + //ese = e.detail; }} on:validator={(e) => { const data = e.detail; diff --git a/src/renderer/config-blocks/SettingsEndless.svelte b/src/renderer/config-blocks/SettingsEndless.svelte index 99b00b77..feda3e0d 100644 --- a/src/renderer/config-blocks/SettingsEndless.svelte +++ b/src/renderer/config-blocks/SettingsEndless.svelte @@ -44,8 +44,10 @@ const whatsInParenthesis = /\(([^)]+)\)/; - $: { - const arr = config.script.split("self:").slice(1); + $: handleScriptChange($config.script); + + function handleScriptChange(script) { + const arr = script.split("self:").slice(1); const extractParam = (index) => { const param = whatsInParenthesis.exec(arr[index]); @@ -126,7 +128,7 @@ return new Validator(e).NotEmpty().Result(); }} on:input={(e) => { - epmo = e.detail; + //epmo = e.detail; }} on:validator={(e) => { const data = e.detail; @@ -145,7 +147,7 @@ return new Validator(e).NotEmpty().Result(); }} on:input={(e) => { - epv0 = e.detail; + //epv0 = e.detail; }} on:validator={(e) => { const data = e.detail; @@ -160,7 +162,7 @@
{ return minMaxEnabled @@ -168,7 +170,7 @@ : new Validator(e).Result(); }} on:input={(e) => { - epmi = e.detail; + //epmi = e.detail; }} on:validator={(e) => { const data = e.detail; @@ -189,7 +191,7 @@ : new Validator(e).Result(); }} on:input={(e) => { - epma = e.detail; + //epma = e.detail; }} on:validator={(e) => { const data = e.detail; @@ -213,7 +215,7 @@ : new Validator(e).Result(); }} on:input={(e) => { - epse = e.detail; + //epse = e.detail; }} on:validator={(e) => { const data = e.detail; diff --git a/src/renderer/config-blocks/SettingsPotmeter.svelte b/src/renderer/config-blocks/SettingsPotmeter.svelte index 89ee4f89..60be023b 100644 --- a/src/renderer/config-blocks/SettingsPotmeter.svelte +++ b/src/renderer/config-blocks/SettingsPotmeter.svelte @@ -42,8 +42,10 @@ const whatsInParenthesis = /\(([^)]+)\)/; - $: { - const arr = config.script.split("self:").slice(1); + $: handleScriptChange($config.script); + + function handleScriptChange(script) { + const arr = script.split("self:").slice(1); const extractParam = (index) => { const param = whatsInParenthesis.exec(arr[index]); @@ -118,7 +120,7 @@ return new Validator(e).NotEmpty().Result(); }} on:input={(e) => { - pmo = e.detail; + //pmo = e.detail; }} on:validator={(e) => { const data = e.detail; @@ -142,7 +144,7 @@ : new Validator(e).Result(); }} on:input={(e) => { - pmi = e.detail; + //pmi = e.detail; }} on:validator={(e) => { const data = e.detail; @@ -162,7 +164,7 @@ return new Validator(e).NotEmpty().Result(); }} on:input={(e) => { - pma = e.detail; + //pma = e.detail; }} on:validator={(e) => { const data = e.detail; diff --git a/src/renderer/config-blocks/TimerStop.svelte b/src/renderer/config-blocks/TimerStop.svelte index 2700dd5f..08cd80dd 100644 --- a/src/renderer/config-blocks/TimerStop.svelte +++ b/src/renderer/config-blocks/TimerStop.svelte @@ -43,14 +43,13 @@ const dispatch = createEventDispatcher(); - const whatsInParenthesis = /\(([^)]+)\)/; + const whatsInParenthesis = /gtp\(([^"]*)\)/; let scriptValue = ""; - $: handleConfigChange(config.script); - - function handleConfigChange(config) { - let param1 = whatsInParenthesis.exec(config.script); + $: handleScriptChange($config.script); + function handleScriptChange(script) { + let param1 = whatsInParenthesis.exec(script); if (param1 !== null) { if (param1.length > 0) { scriptValue = param1[1]; diff --git a/src/renderer/config-blocks/VarGlobal.svelte b/src/renderer/config-blocks/VarGlobal.svelte index 8fcbcde6..cf77328f 100644 --- a/src/renderer/config-blocks/VarGlobal.svelte +++ b/src/renderer/config-blocks/VarGlobal.svelte @@ -63,7 +63,7 @@ // config.script cannot be undefined $: { // this works differently from normal _utils... - scriptSegments = globalsToConfig({ script: config.script }); + scriptSegments = globalsToConfig({ script: $config.script }); } function saveChangesOnInput(e, i, k) { @@ -242,7 +242,7 @@
{#key rerenderList} { + on:input={(e) => { saveChangesOnInput(e.detail.script, i, "value"); }} action={config} diff --git a/src/renderer/config-blocks/VarLocals.svelte b/src/renderer/config-blocks/VarLocals.svelte index d73cb420..bc8fedba 100644 --- a/src/renderer/config-blocks/VarLocals.svelte +++ b/src/renderer/config-blocks/VarLocals.svelte @@ -63,7 +63,7 @@ // config.script cannot be undefined $: { // this works differently from normal _utils... - scriptSegments = localsToConfig({ script: config.script }); + scriptSegments = localsToConfig({ script: $config.script }); } function saveChangesOnInput(e, i, k) { @@ -245,7 +245,7 @@
{#key rerenderList} { + on:input={(e) => { saveChangesOnInput(e.detail.script, i, "value"); }} action={config} diff --git a/src/renderer/config-blocks/VarSelf.svelte b/src/renderer/config-blocks/VarSelf.svelte index c08982cf..2b290b76 100644 --- a/src/renderer/config-blocks/VarSelf.svelte +++ b/src/renderer/config-blocks/VarSelf.svelte @@ -63,7 +63,7 @@ // config.script cannot be undefined $: { // this works differently from normal _utils... - scriptSegments = selfsToConfig({ script: config.script }); + scriptSegments = selfsToConfig({ script: $config.script }); } function saveChangesOnInput(e, i, k) { @@ -246,7 +246,7 @@
{#key rerenderList} { + on:input={(e) => { saveChangesOnInput(e.detail.script, i, "value"); }} action={config} diff --git a/src/renderer/config-blocks/components/MeltCombo.svelte b/src/renderer/config-blocks/components/MeltCombo.svelte index abe1a056..32c6d9ac 100644 --- a/src/renderer/config-blocks/components/MeltCombo.svelte +++ b/src/renderer/config-blocks/components/MeltCombo.svelte @@ -72,7 +72,7 @@ } value = input; - + inputValue.set(value); dispatch("validator", { isError }); dispatch("input", postProcessor(input)); } diff --git a/src/renderer/config-blocks/headers/ConditionElseIfFace.svelte b/src/renderer/config-blocks/headers/ConditionElseIfFace.svelte index 8c64aabd..fbfdc1c3 100644 --- a/src/renderer/config-blocks/headers/ConditionElseIfFace.svelte +++ b/src/renderer/config-blocks/headers/ConditionElseIfFace.svelte @@ -1,39 +1,26 @@ - -
- Else if +
+ Else If
{ sendData(e.detail.script); }} + on:change={() => dispatch("sync")} action={config} - {sidebarWidth} value={scriptSegment} />
- +
diff --git a/src/renderer/config-blocks/headers/ConditionIfFace.svelte b/src/renderer/config-blocks/headers/ConditionIfFace.svelte index 93785c79..74053343 100644 --- a/src/renderer/config-blocks/headers/ConditionIfFace.svelte +++ b/src/renderer/config-blocks/headers/ConditionIfFace.svelte @@ -1,5 +1,5 @@ - @@ -49,10 +42,11 @@ on:input={(e) => { sendData(e.detail.script); }} + on:change={() => dispatch("sync")} action={config} value={scriptSegment} />
Then
- +
diff --git a/src/renderer/config-blocks/headers/ForLoopHeader.svelte b/src/renderer/config-blocks/headers/ForLoopHeader.svelte index 2291e46b..0200051e 100644 --- a/src/renderer/config-blocks/headers/ForLoopHeader.svelte +++ b/src/renderer/config-blocks/headers/ForLoopHeader.svelte @@ -109,9 +109,10 @@ > {#key displayValue} dispatch("sync")} /> {/key}
diff --git a/src/renderer/config-blocks/headers/FunctionStartFace.svelte b/src/renderer/config-blocks/headers/FunctionStartFace.svelte index 8114bbce..c65fc808 100644 --- a/src/renderer/config-blocks/headers/FunctionStartFace.svelte +++ b/src/renderer/config-blocks/headers/FunctionStartFace.svelte @@ -12,17 +12,10 @@ let scriptSegment = ""; // local script part - let loaded = false; - - $: if (config.script && !loaded) { - scriptSegment = GridScript.humanize(config.script.slice(9)); - loaded = true; + $: { + scriptSegment = GridScript.humanize($config.script.slice(9)); } - onDestroy(() => { - loaded = false; - }); - function sendData(e) { if (parenthesis(e)) { const script = GridScript.shortify(e); @@ -47,6 +40,7 @@ on:input={(e) => { sendData(e.detail.script); }} + on:change={() => dispatch("sync")} action={config} value={scriptSegment} /> diff --git a/src/renderer/config-blocks/headers/RegularActionBlockFace.svelte b/src/renderer/config-blocks/headers/RegularActionBlockFace.svelte index a8fc92f3..cb9c95ea 100644 --- a/src/renderer/config-blocks/headers/RegularActionBlockFace.svelte +++ b/src/renderer/config-blocks/headers/RegularActionBlockFace.svelte @@ -79,7 +79,12 @@ class="bg-primary font-normal my-auto rounded flex items-center flex-grow h-full" on:click|stopPropagation > - + dispatch("sync")} + />
{:else} - - - -
+ +
+ + {#if $config_panel_blocks.length === 0 && $runtime.modules.length > 0}
@@ -359,7 +361,7 @@ on:mouseleave={() => { clearInterval(autoScroll); }} - class="flex flex-col w-full h-auto overflow-y-auto justify-start" + class="flex flex-col w-full" > {#if typeof $config_drag === "undefined"} {/if}
+
{:else} - - +
+ +
{/if}
diff --git a/src/renderer/main/user-interface/LineEditor.svelte b/src/renderer/main/user-interface/LineEditor.svelte index 56e0cbc0..b9156428 100644 --- a/src/renderer/main/user-interface/LineEditor.svelte +++ b/src/renderer/main/user-interface/LineEditor.svelte @@ -1,4 +1,5 @@