Add CustomEffects as usermod: step 2: ui works

This commit is contained in:
Ewowi
2022-08-30 12:55:01 +02:00
parent 9a87d2bd8e
commit 068089751d
7 changed files with 2130 additions and 1874 deletions

View File

@@ -51,6 +51,7 @@
setTimeout(()=>{h.appendChild(l)},100);
</script>
<link rel="stylesheet" href="index.css">
<link rel="stylesheet" href="../../usermods/customeffects/customeffects.css">
</head>
<body>
@@ -365,6 +366,11 @@
</div>
</div>
<!-- WLEDSR Custom Effects -->
<div id="ceEditor" class="modal">
<div id="kceEditor">Loading...</div><br>
</div>
<div id="mliveview2D" class="modal">
<div id="kliveview2D" style="width:100%; height:100%">Loading...</div><br>
</div>
@@ -380,5 +386,6 @@
</div>
<i id="roverstar" class="icons huge" onclick="setLor(0)">&#xe410;</i><br>
<script src="index.js"></script>
<script src="../../usermods/customeffects/customeffects.js"></script>
</body>
</html>

View File

@@ -684,7 +684,11 @@ function populateSegments(s)
let li = lastinfo;
segCount = 0; lowestUnused = 0; lSeg = 0;
console.log(s);
for (var inst of (s.seg||[])) {
console.log(inst);
segCount++;
let i = parseInt(inst.id);
@@ -728,6 +732,7 @@ function populateSegments(s)
<option value="3" ${inst.ssim==3?' selected':''}>U14_3</option>
</select></div>
</div>`;
let cusEff = `<button class="btn" onclick="toggleCEEditor('${inst.n?inst.n:"default"}', ${i})">Custom Effect Editor</button><br>`;
cn += `<div class="seg lstI ${i==s.mainseg ? 'selected' : ''} ${exp ? "expanded":""}" id="seg${i}">
<label class="check schkl">
<input type="checkbox" id="seg${i}sel" onchange="selSeg(${i})" ${inst.sel ? "checked":""}>
@@ -774,6 +779,7 @@ function populateSegments(s)
${!isM?rvXck:''}
${isM&&stoY-staY>1&&stoX-staX>1?map2D:''}
${s.AudioReactive && s.AudioReactive.on ? "" : sndSim}
${s.CustomEffects && s.CustomEffects.on ? cusEff : ""}
<label class="check revchkl" id="seg${i}lbtm">
${isM?'Transpose':'Mirror effect'}
<input type="checkbox" id="seg${i}${isM?'tp':'mi'}" onchange="${(isM?'setTp(':'setMi(')+i})" ${isM?(inst.tp?"checked":""):(inst.mi?"checked":"")}>