timofey260 / RWE-Plus

Better version of official rain world editor
MIT License
27 stars 8 forks source link

Everytime I try to open the program on nobara linux, `return pg.image.load(resolved)` doesn't return a file object causing crash #41

Closed d3bugIANgl17ch closed 7 months ago

d3bugIANgl17ch commented 7 months ago

Basically, whenever I try to open the program, i get:

Traceback (most recent call last):
  File "/home/d3bug/Downloads/RWE+/main.py", line 6, in <module>
    manager = ProcessManager()
              ^^^^^^^^^^^^^^^^
  File "/home/d3bug/Downloads/RWE+/LevelProcess.py", line 24, in __init__
    self.tiles = inittolist(self.window)
                 ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/d3bug/Downloads/RWE+/lingotojson.py", line 255, in inittolist
    img = loadimage(f"{path2graphics}{item['nm']}.png")
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/d3bug/Downloads/RWE+/files.py", line 37, in loadimage
    return pg.image.load(resolved)
           ^^^^^^^^^^^^^^^^^^^^^^^
TypeError: not a file object

I'm using Nobara linux to run this program, hopefully this is a simple fix

timofey260 commented 7 months ago

try to update files.py at 35th line with if filepath is None or resolved is None:

d3bugIANgl17ch commented 7 months ago

try to update files.py at 35th line with if filepath is None or resolved is None:

Yay it worked, thank you!