fix resource finding

This commit is contained in:
John Alanbrook 2024-08-24 08:04:41 -05:00
parent 27fa286625
commit ed7d65523a
4 changed files with 8 additions and 2 deletions

View file

@ -1,4 +1,6 @@
debug.build = function(fn) { fn(); }
debug.build = function(fn) { if (!debug.show) return; fn(); }
debug.show = true;
debug.urnames = false;
debug.fn_break = function(fn,obj = globalThis) {
if (typeof fn !== 'function') return;

View file

@ -25,7 +25,7 @@ mum.base = {
inset: null,
anchor: [0,1], // where to draw the item from, relative to the cursor. [0,1] is from the top left corner. [1,0] is from the bottom right
background_image: null,
slice: null,
slice: null, // pass to slice an image as a 9 slice. see render.slice9 for its format
hover: {
color: Color.red,
},

View file

@ -197,6 +197,9 @@ game.tex_hotreload = function()
}
game.texture = function (path) {
if (!io.exists(path))
path = Resources.find_image(path);
if (!io.exists(path)) {
console.warn(`Missing texture: ${path}`);
game.texture.cache[path] = game.texture("icons/no_tex.gif");

View file

@ -24,6 +24,7 @@ audio.dsp = dspsound;
audio.cry = function(file)
{
if (!io.exists(file)) file = Resources.find_sound(file);
var player = audio.play(file);
if (!player) return;