Comments

Log in with itch.io to leave a comment.

Bug:

If LayeredImage is defined with spaces, the code doesn't trigger.

Suggested fix:

-> I uploaded all these changes to pastebin, if you prefer: https://pastebin.com/fBpRBPaR

After

init python in director:

Create:

    def get_registered_image():
        import itertools
        reg = state.tag and renpy.get_registered_image(state.tag)
        if state.tag and reg is None:
            for attr_choice in itertools.product(state.attributes):
                reg = renpy.get_registered_image(' '.join((state.tag,) + attr_choice))
                if reg is not None:
                    return reg

In:

def get_ordered_layeredimage_attributes():

Assign:

reg = get_registered_image()

Replace both for with:

for group_att in reg.attributes:

At:

if isinstance(renpy.get_registered_image(state.tag), LayeredImage):

Replace with:

        if isinstance(director.get_registered_image(), LayeredImage):

Thank you for the attention

Bug:

It's possible for state.tag to be None.

`if isinstance(renpy.get_registered_image(state.tag), LayeredImage):`

When that happens, it causes an exception inside renpy when calling renpy.get_registered_image()

  File "renpy/python.py", line 1375, in py_eval_bytecode

    return eval(bytecode, globals, locals)

           ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "game/layeredimage-visual-editor-v3/01cute_layeredimage_editor.rpy", line 86, in <module>

    if isinstance(renpy.get_registered_image(state.tag), LayeredImage):

                  ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^                

  File "renpy/display/image.py", line 310, in get_registered_image

    name = tuple(name.split())

                 ^^^^^^^^^^   

AttributeError: 'NoneType' object has no attribute 'split'


Reproduction steps:

  1. Open director mode
  2. Click + to add in between a line
  3. click "show"
  4. Without selecting a tag, click "(properties)" (at top)
  5. exception happens.