Move linkRenderMode extension to core (#1359)

This commit is contained in:
Chenlei Hu
2024-10-29 11:00:10 -04:00
committed by GitHub
parent 10f43be911
commit 1f91a88d7b
6 changed files with 25 additions and 30 deletions

View File

@@ -8,7 +8,6 @@ import './groupNodeManage'
import './groupOptions'
import './invertMenuScrolling'
import './keybinds'
import './linkRenderMode'
import './maskeditor'
import './nodeTemplates'
import './noteNode'

View File

@@ -1,27 +0,0 @@
import { app, ComfyApp } from '../../scripts/app'
import { LiteGraph } from '@comfyorg/litegraph'
const id = 'Comfy.LinkRenderMode'
const ext = {
name: id,
async setup(app: ComfyApp) {
app.ui.settings.addSetting({
id,
category: ['Comfy', 'Graph', 'LinkRenderMode'],
name: 'Link Render Mode',
defaultValue: 2,
type: 'combo',
options: [
{ value: LiteGraph.STRAIGHT_LINK.toString(), text: 'Straight' },
{ value: LiteGraph.LINEAR_LINK.toString(), text: 'Linear' },
{ value: LiteGraph.SPLINE_LINK.toString(), text: 'Spline' },
{ value: LiteGraph.HIDDEN_LINK.toString(), text: 'Hidden' }
],
onChange(value: number) {
app.canvas.links_render_mode = +value
app.canvas.setDirty(/* fg */ false, /* bg */ true)
}
})
}
}
app.registerExtension(ext)