can now copy sharecode after randomization

This commit is contained in:
duncathan 2020-02-28 03:28:46 -06:00
parent ee3c595077
commit d7969ecd65
2 changed files with 20 additions and 2 deletions

View file

@ -54,6 +54,8 @@ layout.twitter.text = '(@shruuu and @duncathan_salt)'
layout.footer.text = 'Original randomizer:\r\nshru.itch.io/cave-story-randomizer'
layout.go:onPress(function()
Randomizer:new()
if Randomizer:ready() then
if settings.seedselect.value and settings.customseed.value ~= "" then
Randomizer.customseed = settings.customseed.value
@ -71,7 +73,8 @@ layout.go:onPress(function()
Randomizer.puppy = settings.puppy.value
C:setStatus(Randomizer:randomize())
Randomizer:new()
layout.sharecode.text = "Copy Sharecode"
else
C:setStatus("No Cave Story folder found!\r\nDrag and drop your Cave Story folder here.")
end
@ -87,6 +90,13 @@ settings.closeButton:onPress(function()
layout:show()
end)
layout.sharecode:onPress(function()
if Randomizer.sharecode ~= "" then
love.system.setClipboardText(Randomizer.sharecode)
layout.sharecode.text = "Copied!"
end
end)
settings.customseed:onChange(function()
if #settings.customseed.value > 20 then
settings.customseed.value = settings.customseed.value:sub(1, 20)

View file

@ -37,7 +37,15 @@ return { id = 'window',
type = 'button',
style = 'button',
id = 'go',
text = 'Randomize',
text = 'Randomize!',
width = 100,
height = 32,
},
{
type = 'button',
style = 'button',
id = 'sharecode',
text = "Copy Sharecode",
width = 100,
height = 32,
},