diff --git a/resolution_matrix.py b/resolution_matrix.py index 4d39d9f..b12976b 100644 --- a/resolution_matrix.py +++ b/resolution_matrix.py @@ -46,10 +46,14 @@ class PixelForge: ["1 MP", "2 MP", "4 MP", "6 MP", "8 MP", "12 MP", "16 MP"], {"default": f"{cls._last_max_mp} MP"}, ), - "resolution": ("STRING", {"default": "1024×1024"}), + "resolution": (resolutions,), } } + @classmethod + def VALIDATE_INPUTS(cls, **kwargs): + return True + RETURN_TYPES = ("INT", "INT", "INT", "INT", "STRING", "FLOAT") RETURN_NAMES = ( "width_px", diff --git a/web/js/pixel_forge.js b/web/js/pixel_forge.js index de3db6e..9556458 100644 --- a/web/js/pixel_forge.js +++ b/web/js/pixel_forge.js @@ -18,18 +18,19 @@ app.registerExtension({ const onNodeCreated = nodeType.prototype.onNodeCreated; nodeType.prototype.onNodeCreated = function () { const r = onNodeCreated ? onNodeCreated.apply(this, arguments) : undefined; + console.log("PixelForge: Node created, initializing dropdown logic"); const aspectWidget = this.widgets.find(w => w.name === "aspect_ratio"); const divisibleWidget = this.widgets.find(w => w.name === "divisible_by"); const mpLimitWidget = this.widgets.find(w => w.name === "max_megapixels"); const resolutionWidget = this.widgets.find(w => w.name === "resolution"); - resolutionWidget.type = "combo"; resolutionWidget.options = { values: [] }; const updateResolutions = () => { const aspect = aspectWidget.value; const div = parseInt(divisibleWidget.value); const maxMp = parseInt(mpLimitWidget.value.split(" ")[0]); + console.log("PixelForge: Updating resolutions for aspect:", aspect, "divisible by:", div, "max MP:", maxMp); const ratio = ASPECT_RATIOS[aspect]; if (!ratio) return;