diff --git a/src/randomizer.lua b/src/randomizer.lua index ca7bef5..12b6268 100644 --- a/src/randomizer.lua +++ b/src/randomizer.lua @@ -38,6 +38,10 @@ function C:setPath(path) csdirectory = path end +function C:ready() + return csdirectory ~= nil +end + function C:randomize() resetLog() logNotice('=== Cave Story Randomizer v' .. VERSION .. ' ===') diff --git a/src/ui/draw.lua b/src/ui/draw.lua index 96483a9..9884fc2 100644 --- a/src/ui/draw.lua +++ b/src/ui/draw.lua @@ -20,8 +20,12 @@ layout.twitter.text = '(@shruuu and @duncathan_salt)' layout.footer.text = 'Original randomizer:\r\nshru.itch.io/cave-story-randomizer' layout.go:onPress(function() - C:setStatus(Randomizer:randomize()) - Randomizer:new() + if Randomizer:ready() then + C:setStatus(Randomizer:randomize()) + Randomizer:new() + else + C:setStatus("No Cave Story folder found!\r\nDrag and drop your Cave Story folder here.") + end end) function C:draw()