adds working mychar selection!
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 |
|
@ -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,14 +12,14 @@ 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
|
||||||
|
@ -38,6 +38,23 @@ function C:loadSettings(puppy, obj, seed)
|
||||||
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
|
||||||
|
@ -55,8 +72,9 @@ layout.go:onPress(function()
|
||||||
end
|
end
|
||||||
|
|
||||||
Randomizer.obj = settings.objective.value
|
Randomizer.obj = settings.objective.value
|
||||||
|
|
||||||
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"
|
||||||
|
|
|
@ -22,13 +22,13 @@ return { style = 'dialog',
|
||||||
},
|
},
|
||||||
{ type = 'label', text = 'Player Sprite', minheight = 32 },
|
{ type = 'label', text = 'Player Sprite', minheight = 32 },
|
||||||
{ type = 'stepper', id = 'mychar', align = 'middle left', height = 48, width = 200,
|
{ type = 'stepper', id = 'mychar', align = 'middle left', height = 48, width = 200,
|
||||||
{ text = " Quote", value = "Quote.bmp", icon = "assets/icon/Quote.png" },
|
{ text = " Quote", value = "assets/myChar/Quote.bmp", icon = "assets/icon/Quote.png" },
|
||||||
{ text = " Curly", value = "Curly.bmp", icon = "assets/icon/Curly.png" },
|
{ text = " Curly", value = "assets/myChar/Curly.bmp", icon = "assets/icon/Curly.png" },
|
||||||
{ text = " Sue", value = "Sue.bmp", icon = "assets/icon/Sue.png" },
|
{ text = " Sue", value = "assets/myChar/Sue.bmp", icon = "assets/icon/Sue.png" },
|
||||||
{ text = " Toroko", value = "Toroko.bmp", icon = "assets/icon/Toroko.png" },
|
{ text = " Toroko", value = "assets/myChar/Toroko.bmp", icon = "assets/icon/Toroko.png" },
|
||||||
{ text = " King", value = "King.bmp", icon = "assets/icon/King.png" },
|
{ text = " King", value = "assets/myChar/King.bmp", icon = "assets/icon/King.png" },
|
||||||
{ text = " Kanpachi", value = "Kanpachi.bmp", icon = "assets/icon/Kanpachi.png" },
|
{ text = " Kanpachi", value = "assets/myChar/Kanpachi.bmp", icon = "assets/icon/Kanpachi.png" },
|
||||||
{ text = " Frog", value = "Frog.bmp", icon = "assets/icon/Frog.png" }
|
{ text = " Frog", value = "assets/myChar/Frog.bmp", icon = "assets/icon/Frog.png" }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|