Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 34 additions & 34 deletions javascript/sdppp-custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,36 +87,32 @@ export default function (sdppp) {
*/
sdppp.widgetable.add('PrimitiveNode', {
formatter: (node) => {
let title = node.title.startsWith("Primitive") ? nameByConnectedOutputOrTitle(node) : getTitle(node);
if (!node.widgets || node.widgets.length == 0) {
return null;
}
let sliceNum = 2;
if (node.widgets.length == 2 && node.widgets[1].name == "control_after_generate" && node.widgets[1].value == 'fixed') {
sliceNum = 1;
}
let widgets = node.widgets.slice(0, sliceNum)
.map((widget, index) => {
const ret = {
value: widget.value,
outputType: widget.type || "string",
options: widget.options,
uiWeight: 12
}
if (widget.type == "number" || widget.type == "combo") {
ret.uiWeight = index == 0 ? (sliceNum == 2 ? 8 : 6) : 4
}
if (widget.type == "toggle") {
ret.uiWeight = 4;
ret.name = widget.label || widget.name
}
return ret
})
.filter(Boolean)
return {
title,
widgets
}
let title = node.title.startsWith("Primitive") ? nameByConnectedOutputOrTitle(node) : getTitle(node);
if (!node.widgets || node.widgets.length == 0) {
return null;
}
let widgets = node.widgets.slice(0, 1)
.map((widget, index) => {
const ret = {
value: widget.value,
outputType: widget.type || "string",
options: widget.options,
uiWeight: 12
}
if (widget.type == "number" || widget.type == "combo") {
ret.uiWeight = 12
}
if (widget.type == "toggle") {
ret.uiWeight = 4;
ret.name = widget.label || widget.name
}
return ret
})
.filter(Boolean)
return {
title,
widgets
}
}
})
/**
Expand All @@ -128,15 +124,19 @@ export default function (sdppp) {
*/
sdppp.widgetable.add('*rgthree*', {
formatter: (node) => {
if (node.type.startsWith('Fast Groups Muter')|| node.type.startsWith('Fast Muter')) {
if (
node.type.startsWith('Fast Groups Muter') ||
node.type.startsWith('Fast Muter') ||
node.type.startsWith('Fast Groups Bypasser')////////增加类型/////
) {
return {
title: getTitle(node),
widgets: node.widgets.map((widget) => ({
value: fixRGthreeWidgetValue(widget.type, widget.value),
name: (widget.label || widget.name).replace(/^(enable[-_ ]?)?/gi, ''),
outputType: fixRGthreeWidgetType(widget.type),
options: widget.options,
uiWeight: 4
uiWeight: 3
}))
}
}
Expand All @@ -150,7 +150,7 @@ export default function (sdppp) {
name: widget.value.lora,
outputType: 'toggle',
options: {on: true, off: false},
uiWeight: 4
uiWeight: 3///////////////////////////////////////////显示 4 个/////////
}))
}
}
Expand Down Expand Up @@ -328,4 +328,4 @@ function nameByConnectedOutputOrTitle(node) {
*/
function getTitle(node) {
return sdpppX.getNodeTitle(node);
}
}