fixed package so it contains templates, updated config for more control
This commit is contained in:
+41
-5
@@ -1,14 +1,16 @@
|
||||
local gui = require("gui")
|
||||
local color = require("gui.core.color")
|
||||
local menu = require("menus.menus")
|
||||
local menu = require("gui.core.menus")
|
||||
local proc = gui:getProcessor():newProcessor("main-title")
|
||||
|
||||
local APP_VERSION = love.filesystem.read("version.txt")
|
||||
|
||||
local board = require("menus.board")
|
||||
|
||||
function Menu(frame)
|
||||
local background = frame:newImageLabel("assets/images/background.jpg")
|
||||
background:fullFrame()
|
||||
local title = frame:newTextLabel("Jeopardy",0,0,0,0,0,.1,1,.25)
|
||||
local title = background:newTextLabel("Jeopardy",0,0,0,0,0,.1,1,.25)
|
||||
title:setFont("assets/fonts/gyparody.ttf",300)
|
||||
|
||||
title:setShader(gui.SHADERS.vignette,{
|
||||
@@ -18,7 +20,7 @@ function Menu(frame)
|
||||
|
||||
title.align = gui.ALIGN_CENTER
|
||||
title.visibility = 0
|
||||
title.textColor = color.new("#b16d24")
|
||||
title.textColor = color.title_font
|
||||
title.drawBorder = false
|
||||
|
||||
proc:newThread(function()
|
||||
@@ -62,10 +64,44 @@ function Menu(frame)
|
||||
},play,settings,quit)
|
||||
|
||||
play:OnReleased(function()
|
||||
background.visible = false
|
||||
menu.getMenu("board"):visible(true,"anime")
|
||||
if love.filesystem.getInfo("quiz") then
|
||||
menu.getMenu("board"):visible(true, "quiz")
|
||||
return
|
||||
else
|
||||
gui:newFilePicker("File picker test",nil, {".zip"}, function(file)
|
||||
menu.getMenu("board"):visible(true, file:gsub("\\","/"):gsub(love.filesystem.getSaveDirectory(),""):sub(2,-1))
|
||||
end)
|
||||
end
|
||||
end)
|
||||
|
||||
quit:OnReleased(function()
|
||||
local f = frame:newFrame()
|
||||
f:fullFrame()
|
||||
f.visibility = .8
|
||||
f.color = color.black
|
||||
local cm = menu.getCurrentMenu()
|
||||
cm:setTag("visual")
|
||||
quit:setShader()
|
||||
gui:newMessageBox({
|
||||
title = "Confirm",
|
||||
message = "Are you sure you want to exit the game?",
|
||||
buttons = { "Yes", "No" },
|
||||
onChoice = function(label, idx)
|
||||
if label == "Yes" then os.exit() end
|
||||
cm:removeTag("visual")
|
||||
f:destroy()
|
||||
end,
|
||||
})
|
||||
end)
|
||||
|
||||
local version = frame:newTextLabel("Version: " .. APP_VERSION, -150,-30, 150, 30, 1, 1)
|
||||
thread:newThread(function()
|
||||
thread.skip(2)
|
||||
version:fitFont()
|
||||
end)
|
||||
version.textColor = color.new("#b16d24")
|
||||
version.visibility = 0
|
||||
|
||||
return background
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user