Moved THEME into its own file, added safe_get_image to prevent crash if image is not present, stubbed worker and some other bits for later.

This commit is contained in:
2026-04-16 10:14:53 -05:00
parent 451b08bb9e
commit 7d6fce2969
12 changed files with 188 additions and 99 deletions

15
lib/gui_ext.rb Normal file
View File

@@ -0,0 +1,15 @@
module W3DHubLauncher
module GuiExt
BLACK_IMAGE = Gosu.render(64, 64, retro: true) { Gosu.draw_rect(0, 0, 32, 32, Gosu::Color::BLACK) }
WHITE_IMAGE = Gosu.render(64, 64, retro: true) { Gosu.draw_rect(0, 0, 32, 32, Gosu::Color::WHITE) }
def safe_get_image(path, retro: false)
return get_image(path, retro: retro) if File.exist?(path)
path = "./media/default.png"
return get_image(path, retro: retro) if File.exist?(path)
WHITE_IMAGE
end
end
end