Skip to content

GraphNode set_slot_custom_icon_ function uses the order on which ports were enabled instead of the slot index. #107298

@Ketei

Description

@Ketei

Tested versions

Reproducible in:

System information

Godot v4.4.1.stable - Windows 10 (build 19045) - Multi-window, 3 monitors - OpenGL 3 (Compatibility) - NVIDIA GeForce GTX 750 Ti (NVIDIA; 32.0.15.7247) - Intel(R) Core(TM) i5-6400 CPU @ 2.70GHz (4 threads)

Issue description

Using the function GraphNode.set_slot_custom_icon_right (and left too) will act differently depending on what order the port was enabled at.
So if the slot index 0 was enabled thrid, to change its icon I'll have to call GraphNode.set_slot_custom_icon_right(2, icon) instead of the correct GraphNode.set_slot_custom_icon_right(0, icon)

wrong_icon_setting.mp4

Steps to reproduce

  1. Create a GraphNode with 2 or more children
  2. Enable only the second left/right port of the slot 1 (and up)
  3. Change the icon of slot index 0 via code
  4. Icon of slot index 1 (or whichever you enabled first) changes instead.

This behaviour is similar if you create the objects via code. If the third children (slot index 2) you added is the first one to have the right slot enabled, to change the icon you'll have to use 0 instead of it's actual port index of 2

Minimal reproduction project (MRP)

bug_testing_4-4.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions