Skip to content

Commit

Permalink
workaround for weird issue on windows where double clicking a shortcu…
Browse files Browse the repository at this point in the history
…t to a html file doesn't open it
  • Loading branch information
wheybags committed Oct 16, 2020
1 parent 6019447 commit cf85f8b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions game.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,14 @@ def get_map(self, highlight_pos=None):
return "\n".join(lines)

def render_resource_in_room(self, room, resource_name, name_in_room, env):
# workaround for weird issue on windows where double clicking a shortcut to a html file doesn't open it
if resource_name.endswith("html"):
for r in self.resources:
if r[0] == resource_name:
create_file(room.get_dir(env) + "/" + name_in_room, r[1])
return
raise Exception()

if convert_gifs_to_html:
resource_name = resource_name.replace(".gif", ".gif.html")
name_in_room = name_in_room.replace(".gif", ".gif.html")
Expand Down

0 comments on commit cf85f8b

Please sign in to comment.