Skip to content

Commit

Permalink
Fixed QA issues and bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
elsoazemelet committed Nov 5, 2024
1 parent cb833c9 commit 01f60d8
Show file tree
Hide file tree
Showing 19 changed files with 112 additions and 121 deletions.
18 changes: 8 additions & 10 deletions src/renderer/config-blocks/Lookup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand All @@ -78,6 +76,7 @@
array.push(pair.output);
});
console.log(lookupTable);
array = [lookupTable.source, ...array];
const script = Script.toScript({
Expand Down Expand Up @@ -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;
</script>

<config-lookup
Expand All @@ -138,7 +135,7 @@
return new Validator(e).NotEmpty().Result();
}}
on:input={(e) => {
lookupTable.source = e.detail;
sendData();
}}
on:validator={(e) => {
const data = e.detail;
Expand Down Expand Up @@ -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();
Expand Down
6 changes: 2 additions & 4 deletions src/renderer/config-blocks/Macro.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
});
$: {
scriptToKeyList({ script: config.script });
scriptToKeyList({ script: $config.script });
}
function change_layout() {
Expand Down Expand Up @@ -395,9 +395,7 @@
}
</script>

<div
class="{$$props.class} flex w-full flex-col px-4 py-2 gap-2 pointer-events-auto"
>
<div class="flex w-full flex-col px-4 py-2 gap-2 pointer-events-auto">
<div class="flex flex-col">
<div class="flex flex-row justify-between mb-2">
<div class="text-gray-500 text-sm truncate">Macro Input Field</div>
Expand Down
3 changes: 0 additions & 3 deletions src/renderer/config-blocks/SettingsButton.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@
bind:value={bmo}
suggestions={suggestions[0]}
on:input={(e) => {
bmo = e.detail;
sendData();
}}
validator={(e) => {
Expand All @@ -145,7 +144,6 @@
: new Validator(e).Result();
}}
on:input={(e) => {
bmi = e.detail;
sendData();
}}
on:validator={(e) => {
Expand All @@ -167,7 +165,6 @@
: new Validator(e).Result();
}}
on:input={(e) => {
bma = e.detail;
sendData();
}}
on:validator={(e) => {
Expand Down
16 changes: 9 additions & 7 deletions src/renderer/config-blocks/SettingsEncoder.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -174,7 +176,7 @@
: new Validator(e).Result();
}}
on:input={(e) => {
emi = e.detail;
//emi = e.detail;
}}
on:validator={(e) => {
const data = e.detail;
Expand All @@ -195,7 +197,7 @@
: new Validator(e).Result();
}}
on:input={(e) => {
ema = e.detail;
//ema = e.detail;
}}
on:validator={(e) => {
const data = e.detail;
Expand All @@ -218,7 +220,7 @@
: new Validator(e).Result();
}}
on:input={(e) => {
ese = e.detail;
//ese = e.detail;
}}
on:validator={(e) => {
const data = e.detail;
Expand Down
18 changes: 10 additions & 8 deletions src/renderer/config-blocks/SettingsEndless.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -160,15 +162,15 @@
<div class="w-full grid grid-flow-col auto-cols-fr gap-2">
<MeltCombo
title={"Min"}
disabled={minMaxEnabled}
disabled={!minMaxEnabled}
bind:value={epmi}
validator={(e) => {
return minMaxEnabled
? new Validator(e).NotEmpty().Result()
: new Validator(e).Result();
}}
on:input={(e) => {
epmi = e.detail;
//epmi = e.detail;
}}
on:validator={(e) => {
const data = e.detail;
Expand All @@ -189,7 +191,7 @@
: new Validator(e).Result();
}}
on:input={(e) => {
epma = e.detail;
//epma = e.detail;
}}
on:validator={(e) => {
const data = e.detail;
Expand All @@ -213,7 +215,7 @@
: new Validator(e).Result();
}}
on:input={(e) => {
epse = e.detail;
//epse = e.detail;
}}
on:validator={(e) => {
const data = e.detail;
Expand Down
12 changes: 7 additions & 5 deletions src/renderer/config-blocks/SettingsPotmeter.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down Expand Up @@ -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;
Expand All @@ -142,7 +144,7 @@
: new Validator(e).Result();
}}
on:input={(e) => {
pmi = e.detail;
//pmi = e.detail;
}}
on:validator={(e) => {
const data = e.detail;
Expand All @@ -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;
Expand Down
9 changes: 4 additions & 5 deletions src/renderer/config-blocks/TimerStop.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/config-blocks/VarGlobal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -242,7 +242,7 @@
<div class="w-full h-full bg-secondary">
{#key rerenderList}
<LineEditor
on:output={(e) => {
on:input={(e) => {
saveChangesOnInput(e.detail.script, i, "value");
}}
action={config}
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/config-blocks/VarLocals.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -245,7 +245,7 @@
<div class="w-full h-full bg-secondary">
{#key rerenderList}
<LineEditor
on:output={(e) => {
on:input={(e) => {
saveChangesOnInput(e.detail.script, i, "value");
}}
action={config}
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/config-blocks/VarSelf.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -246,7 +246,7 @@
<div class="w-full h-full bg-secondary">
{#key rerenderList}
<LineEditor
on:output={(e) => {
on:input={(e) => {
saveChangesOnInput(e.detail.script, i, "value");
}}
action={config}
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/config-blocks/components/MeltCombo.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
}
value = input;
inputValue.set(value);
dispatch("validator", { isError });
dispatch("input", postProcessor(input));
}
Expand Down
Loading

0 comments on commit 01f60d8

Please sign in to comment.