Add CustomEffects as usermod: step 2: ui works
This commit is contained in:
@@ -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)"></i><br>
|
||||
<script src="index.js"></script>
|
||||
<script src="../../usermods/customeffects/customeffects.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -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":"")}>
|
||||
|
||||
3803
wled00/html_ui.h
3803
wled00/html_ui.h
File diff suppressed because it is too large
Load Diff
@@ -108,6 +108,12 @@ void deserializeSegment(JsonObject elem, byte it, byte presetId)
|
||||
bool on = elem["on"] | seg.on;
|
||||
if (elem["on"].is<const char*>() && elem["on"].as<const char*>()[0] == 't') on = !on;
|
||||
seg.setOption(SEG_OPTION_ON, on); // use transition
|
||||
|
||||
//WLEDSR Custom Effects (but general usable)
|
||||
bool reset = elem["reset"];
|
||||
if (reset)
|
||||
seg.markForReset();
|
||||
|
||||
bool frz = elem["frz"] | seg.freeze;
|
||||
if (elem["frz"].is<const char*>() && elem["frz"].as<const char*>()[0] == 't') frz = !seg.freeze;
|
||||
seg.freeze = frz;
|
||||
|
||||
Reference in New Issue
Block a user