Merge pull request #77 from duncathan/mychars
adds 6 new mychars to choose from!
BIN
src/assets/icon/Curly.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
src/assets/icon/Frog.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
src/assets/icon/Kanpachi.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
src/assets/icon/King.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
src/assets/icon/Quote.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
src/assets/icon/Sue.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
src/assets/icon/Toroko.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
src/assets/myChar/Curly.bmp
Normal file
After Width: | Height: | Size: 6.4 KiB |
BIN
src/assets/myChar/Frog.bmp
Normal file
After Width: | Height: | Size: 6.4 KiB |
BIN
src/assets/myChar/Kanpachi.bmp
Normal file
After Width: | Height: | Size: 6.4 KiB |
BIN
src/assets/myChar/King.bmp
Normal file
After Width: | Height: | Size: 6.4 KiB |
BIN
src/assets/myChar/Quote.bmp
Normal file
After Width: | Height: | Size: 6.4 KiB |
BIN
src/assets/myChar/Sue.bmp
Normal file
After Width: | Height: | Size: 6.4 KiB |
BIN
src/assets/myChar/Toroko.bmp
Normal file
After Width: | Height: | Size: 6.4 KiB |
|
@ -102,5 +102,11 @@ Contains the index in `items` of the item being displayed.
|
||||||
if self.flow == 'x' then increment() else decrement() end
|
if self.flow == 'x' then increment() else decrement() end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
self:onChange(function (event)
|
||||||
|
if self.value == "override" then
|
||||||
|
updateValue()
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
updateValue()
|
updateValue()
|
||||||
end
|
end
|
||||||
|
|
|
@ -36,6 +36,7 @@ function C:new()
|
||||||
self.puppy = false
|
self.puppy = false
|
||||||
self.obj = ""
|
self.obj = ""
|
||||||
self.sharecode = ""
|
self.sharecode = ""
|
||||||
|
self.mychar = ""
|
||||||
end
|
end
|
||||||
|
|
||||||
function C:setPath(path)
|
function C:setPath(path)
|
||||||
|
@ -65,6 +66,7 @@ function C:randomize()
|
||||||
self:_writeModifiedData(tscFiles)
|
self:_writeModifiedData(tscFiles)
|
||||||
self:_writePlaintext(tscFiles)
|
self:_writePlaintext(tscFiles)
|
||||||
self:_writeLog()
|
self:_writeLog()
|
||||||
|
self:_copyMyChar()
|
||||||
self:_unmountDirectory(csdirectory)
|
self:_unmountDirectory(csdirectory)
|
||||||
|
|
||||||
self:_updateSettings()
|
self:_updateSettings()
|
||||||
|
@ -235,6 +237,12 @@ function C:_writeLog()
|
||||||
U.writeFile(path, data)
|
U.writeFile(path, data)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function C:_copyMyChar()
|
||||||
|
local path = self:_getWritePath() .. '/myChar.bmp'
|
||||||
|
local data = lf.read(self.mychar)
|
||||||
|
U.writeFile(path, data)
|
||||||
|
end
|
||||||
|
|
||||||
function C:_getWritePath()
|
function C:_getWritePath()
|
||||||
return select(1, self:_getWritePaths())
|
return select(1, self:_getWritePaths())
|
||||||
end
|
end
|
||||||
|
@ -277,6 +285,7 @@ end
|
||||||
function C:_updateSettings()
|
function C:_updateSettings()
|
||||||
Settings.settings.puppy = self.puppy
|
Settings.settings.puppy = self.puppy
|
||||||
Settings.settings.obj = self.obj
|
Settings.settings.obj = self.obj
|
||||||
|
Settings.settings.mychar = self.mychar
|
||||||
Settings:update()
|
Settings:update()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -20,13 +20,14 @@ function C:update()
|
||||||
end
|
end
|
||||||
|
|
||||||
function C:serialize()
|
function C:serialize()
|
||||||
local line = "return {"
|
local line = "return {\r\n "
|
||||||
|
|
||||||
line = line .. ("csdirectory = [[%s]],\r\n"):format(self.settings.csdirectory or "")
|
line = line .. ("csdirectory = [[%s]],\r\n "):format(self.settings.csdirectory or "")
|
||||||
line = line .. ("puppy = %s,\r\n"):format(self.settings.puppy)
|
line = line .. ("puppy = %s,\r\n "):format(self.settings.puppy)
|
||||||
line = line .. ("obj = \"%s\",\r\n"):format(self.settings.obj)
|
line = line .. ("obj = %q,\r\n "):format(self.settings.obj)
|
||||||
|
line = line .. ("mychar = %q,\r\n "):format(self.settings.mychar)
|
||||||
|
|
||||||
line = line .. "}"
|
line = line .. "\r\n}"
|
||||||
return line
|
return line
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -12,43 +12,49 @@ layout:setTheme(require 'lib.luigi.theme.dark')
|
||||||
settings:setTheme(require 'lib.luigi.theme.dark')
|
settings:setTheme(require 'lib.luigi.theme.dark')
|
||||||
|
|
||||||
function C:setup()
|
function C:setup()
|
||||||
self:loadSettings(Settings.settings.puppy, Settings.settings.obj)
|
self:loadSettings(Settings.settings.puppy, Settings.settings.obj, nil, Settings.settings.mychar)
|
||||||
|
|
||||||
background = lg.newImage('assets/background.png')
|
background = lg.newImage('assets/background.png')
|
||||||
self:draw()
|
self:draw()
|
||||||
layout:show()
|
layout:show()
|
||||||
end
|
end
|
||||||
|
|
||||||
function C:loadSettings(puppy, obj, seed)
|
function C:loadSettings(puppy, obj, seed, mychar)
|
||||||
settings.puppy.value = puppy
|
settings.puppy.value = puppy
|
||||||
|
|
||||||
if obj == "objBadEnd" or obj == 1 then
|
if obj == "objBadEnd" or obj == 1 then
|
||||||
settings.bad.value = true
|
settings.objective.index = 1
|
||||||
settings.norm.value = false
|
|
||||||
settings.boss.value = false
|
|
||||||
settings.best.value = false
|
|
||||||
elseif obj == "objNormalEnd" or obj == 2 then
|
elseif obj == "objNormalEnd" or obj == 2 then
|
||||||
settings.bad.value = false
|
settings.objective.index = 2
|
||||||
settings.norm.value = true
|
|
||||||
settings.boss.value = false
|
|
||||||
settings.best.value = false
|
|
||||||
elseif obj == "objAllBosses" or obj == 3 then
|
elseif obj == "objAllBosses" or obj == 3 then
|
||||||
settings.bad.value = false
|
settings.objective.index = 4
|
||||||
settings.norm.value = false
|
|
||||||
settings.boss.value = true
|
|
||||||
settings.best.value = false
|
|
||||||
else
|
else
|
||||||
settings.bad.value = false
|
settings.objective.index = 3
|
||||||
settings.norm.value = false
|
|
||||||
settings.boss.value = false
|
|
||||||
settings.best.value = true
|
|
||||||
end
|
end
|
||||||
|
settings.objective.value = "override"
|
||||||
|
|
||||||
if seed ~= nil then
|
if seed ~= nil then
|
||||||
settings.customseed.value = seed or ""
|
settings.customseed.value = seed or ""
|
||||||
settings.seedselect.value = true
|
settings.seedselect.value = true
|
||||||
settings.seedrandom.value = false
|
settings.seedrandom.value = false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if mychar == "assets/myChar/Quote.bmp" then
|
||||||
|
settings.mychar.index = 1
|
||||||
|
elseif mychar == "assets/myChar/Curly.bmp" then
|
||||||
|
settings.mychar.index = 2
|
||||||
|
elseif mychar == "assets/myChar/Sue.bmp" then
|
||||||
|
settings.mychar.index = 3
|
||||||
|
elseif mychar == "assets/myChar/Toroko.bmp" then
|
||||||
|
settings.mychar.index = 4
|
||||||
|
elseif mychar == "assets/myChar/King.bmp" then
|
||||||
|
settings.mychar.index = 5
|
||||||
|
elseif mychar == "assets/myChar/Kanpachi.bmp" then
|
||||||
|
settings.mychar.index = 6
|
||||||
|
elseif mychar == "assets/myChar/Frog.bmp" then
|
||||||
|
settings.mychar.index = 7
|
||||||
|
end
|
||||||
|
settings.mychar.value = "override"
|
||||||
end
|
end
|
||||||
|
|
||||||
layout.version.text = 'Cave Story Randomizer [Open Mode] v' .. VERSION
|
layout.version.text = 'Cave Story Randomizer [Open Mode] v' .. VERSION
|
||||||
|
@ -65,17 +71,10 @@ layout.go:onPress(function()
|
||||||
Randomizer.customseed = settings.customseed.value:gsub("^%s*(.-)%s*$", "%1") -- trim any leading/trailing whitespace
|
Randomizer.customseed = settings.customseed.value:gsub("^%s*(.-)%s*$", "%1") -- trim any leading/trailing whitespace
|
||||||
end
|
end
|
||||||
|
|
||||||
if settings.bad.value then
|
Randomizer.obj = settings.objective.value
|
||||||
Randomizer.obj = "objBadEnd"
|
|
||||||
elseif settings.norm.value then
|
|
||||||
Randomizer.obj = "objNormalEnd"
|
|
||||||
elseif settings.boss.value then
|
|
||||||
Randomizer.obj = "objAllBosses"
|
|
||||||
else
|
|
||||||
Randomizer.obj = "objBestEnd"
|
|
||||||
end
|
|
||||||
|
|
||||||
Randomizer.puppy = settings.puppy.value
|
Randomizer.puppy = settings.puppy.value
|
||||||
|
Randomizer.mychar = settings.mychar.value
|
||||||
|
|
||||||
C:setStatus(Randomizer:randomize())
|
C:setStatus(Randomizer:randomize())
|
||||||
|
|
||||||
layout.sharecode.text = "Copy Sharecode"
|
layout.sharecode.text = "Copy Sharecode"
|
||||||
|
|
|
@ -14,16 +14,28 @@ return { style = 'dialog',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
{ type = 'label', text = 'Objective', minheight = 32 },
|
{ type = 'label', text = 'Objective', minheight = 32 },
|
||||||
{ type = 'radio', group = 'objective', text = 'Bad ending', id = 'bad', minheight = 27 },
|
{ type = 'stepper', id = 'objective', align = 'center', width = 200,
|
||||||
{ type = 'radio', group = 'objective', text = 'Normal ending', id = 'norm', minheight = 27 },
|
{ text = "Bad ending", value = "objBadEnd" },
|
||||||
{ type = 'radio', group = 'objective', text = 'Best ending', id = 'best', value = true, minheight = 27 },
|
{ text = "Normal ending", value = "objNormalEnd" },
|
||||||
{ type = 'radio', group = 'objective', text = 'All bosses', id = 'boss', minheight = 27 },
|
{ text = "Best ending", value = "objBestEnd" },
|
||||||
|
{ text = "All bosses", value = "objAllBosses"}
|
||||||
|
},
|
||||||
|
{ type = 'label', text = 'Player Sprite', minheight = 32 },
|
||||||
|
{ type = 'stepper', id = 'mychar', align = 'middle left', height = 48, width = 200,
|
||||||
|
{ text = " Quote", value = "assets/myChar/Quote.bmp", icon = "assets/icon/Quote.png" },
|
||||||
|
{ text = " Curly", value = "assets/myChar/Curly.bmp", icon = "assets/icon/Curly.png" },
|
||||||
|
{ text = " Sue", value = "assets/myChar/Sue.bmp", icon = "assets/icon/Sue.png" },
|
||||||
|
{ text = " Toroko", value = "assets/myChar/Toroko.bmp", icon = "assets/icon/Toroko.png" },
|
||||||
|
{ text = " King", value = "assets/myChar/King.bmp", icon = "assets/icon/King.png" },
|
||||||
|
{ text = " Kanpachi", value = "assets/myChar/Kanpachi.bmp", icon = "assets/icon/Kanpachi.png" },
|
||||||
|
{ text = " Frog", value = "assets/myChar/Frog.bmp", icon = "assets/icon/Frog.png" }
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
flow = 'x',
|
flow = 'x',
|
||||||
{ type = 'text', id = 'sharecode', width = 350 },
|
{ type = 'text', id = 'sharecode', width = 350 },
|
||||||
{ type = 'button', style = 'dialogButton', text = "Import Sharecode", id = 'importshare', width = 180 }
|
{ type = 'button', style = 'dialogButton', text = "Import Sharecode", id = 'importshare', width = 180, align = 'center' }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ style = 'dialogFoot',
|
{ style = 'dialogFoot',
|
||||||
|
|