Define ROOT_PATH to fix using absolute paths for assets

This commit is contained in:
2026-04-20 12:25:19 -05:00
parent 30776857a2
commit dc9e737587
10 changed files with 61 additions and 52 deletions

View File

@@ -6,14 +6,14 @@ module W3DHubLauncher
def safe_get_image(path, retro: false)
return get_image(path, retro: retro) if File.exist?(path)
path = "./media/default.png"
path = "#{ROOT_PATH}/media/default.png"
return get_image(path, retro: retro) if File.exist?(path)
WHITE_IMAGE
end
def rounded_avatar(image)
circle = get_image("./media/ui/circle.png")
circle = get_image("#{ROOT_PATH}/media/ui/circle.png")
scale = [(circle.width.to_f / image.width).abs, (circle.width.to_f / image.height).abs].min
Gosu.render(circle.width, circle.height) do