Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ebb8325e98 | ||
|
|
c7592404f1 |
@@ -3,7 +3,7 @@ return {
|
||||
name = 'Jeopardy', -- name of the game for your executable
|
||||
developer = 'Ryan Ward', -- dev name used in metadata of the file
|
||||
output = 'bin', -- output location for your game, defaults to $SAVE_DIRECTORY
|
||||
version = '1.0.4', -- 'version' of your game, used to name the folder in output
|
||||
version = '1.0.5', -- 'version' of your game, used to name the folder in output
|
||||
love = '11.5', -- version of LÖVE to use, must match github releases
|
||||
ignore = {'bin', 'love', 'server_test', '.gitignore', '.gitmodules', 'build.lua', 'login_dialog.yaml', 'package.bat', 'README.md'}, -- folders/files to ignore in your project
|
||||
icon = 'assets/icon.png', -- 256x256px PNG icon for game, will be converted for you
|
||||
|
||||
+1
-1
Submodule gui updated: 27995af07f...4bc968e8dc
+41
-5
@@ -37,6 +37,9 @@ local dd_count = 0
|
||||
local dd_enabled = false
|
||||
local applied_dd = false
|
||||
local board, question
|
||||
local visibility = 1
|
||||
local headerVis = .9
|
||||
local footerVis = .9
|
||||
|
||||
local function cleanUp(frameRef)
|
||||
boardLog:debug("Cleaning up state and returning to title screen")
|
||||
@@ -171,6 +174,12 @@ function LoadTemplate(name, path)
|
||||
ALIGN_LEFT = gui.ALIGN_LEFT,
|
||||
ALIGN_RIGHT = gui.ALIGN_RIGHT,
|
||||
ALIGN_JUSTIFY = gui.ALIGN_JUSTIFY,
|
||||
IMAGE = "image",
|
||||
AUDIO = "audio",
|
||||
VIDEO = "video",
|
||||
TEXT = "text",
|
||||
LIST = "list",
|
||||
NUMBER = "number",
|
||||
-- Global vars
|
||||
color = color,
|
||||
error = multi.error,
|
||||
@@ -182,6 +191,7 @@ function LoadTemplate(name, path)
|
||||
-- love stuff
|
||||
newSource = love.audio.newSource,
|
||||
log = templateLog,
|
||||
|
||||
}
|
||||
|
||||
env._G = env
|
||||
@@ -209,6 +219,15 @@ local function manageCosmetics(frame, cosmetics)
|
||||
colC = color.shaderColC
|
||||
})
|
||||
end
|
||||
if cosmetics.visibility then
|
||||
visibility = cosmetics.visibility
|
||||
end
|
||||
if cosmetics["header-visibility"] then
|
||||
headerVis = cosmetics["header-visibility"]
|
||||
end
|
||||
if cosmetics["footer-visibility"] then
|
||||
footerVis = cosmetics["footer-visibility"]
|
||||
end
|
||||
end
|
||||
|
||||
function gui:cleanup()
|
||||
@@ -221,7 +240,8 @@ end
|
||||
|
||||
function Menu(frame, path, deb)
|
||||
local frameRef = frame:newImageLabel():fullFrame()
|
||||
frameRef.visibility = 0
|
||||
frameRef.visibility = 0
|
||||
frame.visibility = 0
|
||||
boardLog:info("Building board")
|
||||
if path:match(".zip") then
|
||||
local success = love.filesystem.mount(path, "quiz", true)
|
||||
@@ -246,6 +266,7 @@ function Menu(frame, path, deb)
|
||||
local scoreboard = ScoreBoard(frameRef, 0, 0, 0, 0, .06, .1, .170, .8)
|
||||
|
||||
local qframe = frameRef:newFrame(0, 0, 0, 0, .24, .1, .70, .8)
|
||||
qframe.visibility = 0
|
||||
|
||||
local dframe = frameRef:newTextLabel("",0, 0, 0, 0, .24, .1, .7, .8)
|
||||
dframe:scaleFont(.075)
|
||||
@@ -332,6 +353,11 @@ function Menu(frame, path, deb)
|
||||
local wrong = handler:newTextButton("Wrong", 5,0,-10,0,2/3,.1,1/3,.8)
|
||||
wrong.color = color.wrong
|
||||
|
||||
function SetVisibility()
|
||||
handler.visibility = footerVis
|
||||
label.visibility = headerVis
|
||||
end
|
||||
|
||||
gui.apply({
|
||||
setRoundness = {15,15,60},
|
||||
centerFont = {},
|
||||
@@ -360,7 +386,7 @@ function Menu(frame, path, deb)
|
||||
handler.visible = false
|
||||
end
|
||||
end,
|
||||
},correct,skip,wrong)
|
||||
},correct, skip, wrong)
|
||||
|
||||
label.visibility = .85
|
||||
label.drawBorder = false
|
||||
@@ -376,6 +402,8 @@ function Menu(frame, path, deb)
|
||||
|
||||
local data = loader:new(path)
|
||||
board, question, dailydouble = qframe:newFrame(), qframe:newFrame(), qframe:newImageLabel("assets/images/double.jpg")
|
||||
board.visibility = 0
|
||||
question.visibility = 0
|
||||
index = data.index
|
||||
|
||||
local cosmetics = index.cosmetics or {}
|
||||
@@ -385,13 +413,13 @@ function Menu(frame, path, deb)
|
||||
if not cosmetics.colors[v] then
|
||||
cosmetics.colors[v] = color.rgbToHex(color[v])
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
frameRef:shaderTime()
|
||||
manageCosmetics(frameRef, cosmetics)
|
||||
|
||||
board:fullFrame()
|
||||
question:fullFrame()
|
||||
question.visibility = visibility
|
||||
dailydouble:fullFrame()
|
||||
|
||||
dailydouble.visible = false
|
||||
@@ -414,6 +442,7 @@ function Menu(frame, path, deb)
|
||||
if index.dev["auto-reveal"] then
|
||||
autoreveal = true
|
||||
end
|
||||
|
||||
if type(index.dev.players) == "table" then
|
||||
for i,v in ipairs(index.dev.players) do
|
||||
if type(v) == "string" then
|
||||
@@ -428,12 +457,13 @@ function Menu(frame, path, deb)
|
||||
reset(function(q)
|
||||
question:cleanup()
|
||||
manageCosmetics(frameRef, cosmetics)
|
||||
SetVisibility()
|
||||
label.text = default_text
|
||||
if q["display-answer"] then
|
||||
displayAnswer(q)
|
||||
end
|
||||
end)
|
||||
|
||||
SetVisibility()
|
||||
for cat,v in pairs(index.categories) do
|
||||
local c
|
||||
if v.image then
|
||||
@@ -444,6 +474,7 @@ function Menu(frame, path, deb)
|
||||
c.textColor = color.header_font
|
||||
c.color = color.header_tile
|
||||
end
|
||||
c.visibility = visibility
|
||||
|
||||
c.UUID = multi.generate_uuid7() -- Each otpion gets a unique UUID
|
||||
|
||||
@@ -469,6 +500,7 @@ function Menu(frame, path, deb)
|
||||
t.category = v.name
|
||||
t.index = tier
|
||||
t.price = start + inc*(tier-1)
|
||||
t.visibility = visibility
|
||||
t:OnEnter(function(self)
|
||||
self:setShader(gui.SHADERS.glow)
|
||||
end)
|
||||
@@ -502,6 +534,8 @@ function Menu(frame, path, deb)
|
||||
self.textVisibility = 0
|
||||
local template = LoadTemplate(q.template, path)
|
||||
question.visible = true
|
||||
board.visible = false
|
||||
-- question.visibility = visibility
|
||||
local player = GetActivePlayer()
|
||||
local tm
|
||||
local stop
|
||||
@@ -538,6 +572,7 @@ function Menu(frame, path, deb)
|
||||
player:Add((self.price*mul)*m)
|
||||
finished = true
|
||||
question.visible = false
|
||||
board.visible = true
|
||||
reset:Fire(q)
|
||||
elseif ans == false then
|
||||
player:Add(-self.price*mul)
|
||||
@@ -545,6 +580,7 @@ function Menu(frame, path, deb)
|
||||
else
|
||||
finished = true
|
||||
question.visible = false
|
||||
board.visible = true
|
||||
reset:Fire(q)
|
||||
end -- nil is a valid option where you weren't right or wrong, you just skipped
|
||||
self.text = ""
|
||||
|
||||
@@ -44,6 +44,11 @@ local function index(window, q, callback)
|
||||
}, imageHolder, plusLabel, imageHolder2)
|
||||
|
||||
useDefaultHandler(callback)
|
||||
|
||||
return {
|
||||
{imageA=IMAGE, description="First image to display"},
|
||||
{imageB=IMAGE, description="Second image to display"},
|
||||
}
|
||||
end
|
||||
|
||||
local function update(dt)
|
||||
|
||||
@@ -84,6 +84,11 @@ local function index(window, q, callback)
|
||||
end
|
||||
end,
|
||||
},confirm)
|
||||
|
||||
-- Return the expected types
|
||||
return {
|
||||
{choices=LIST, description="List of options"}
|
||||
}
|
||||
end
|
||||
|
||||
local function update(dt) -- time in seconds that has passed since
|
||||
|
||||
@@ -29,6 +29,11 @@ local function index(window, q, callback)
|
||||
imageHolder:setDualDim(0,0,imageHolder.imageWidth,imageHolder.imageHeight)
|
||||
|
||||
useDefaultHandler(callback)
|
||||
|
||||
-- Return the expected types
|
||||
return {
|
||||
{image=IMGAE, description="Image the question is about"}
|
||||
}
|
||||
end
|
||||
|
||||
local function update(dt) -- time in seconds that has passed since
|
||||
|
||||
@@ -10,6 +10,7 @@ local label
|
||||
|
||||
local function index(window, q, callback)
|
||||
label = window:newTextLabel(q.title)
|
||||
label.visibility = 0--q.cosmetics.visibility
|
||||
label.align = ALIGN_CENTER
|
||||
label:fullFrame()
|
||||
label.textColor = color.white
|
||||
|
||||
@@ -15,7 +15,7 @@ local function index(window, q, callback)
|
||||
callback()
|
||||
return
|
||||
end
|
||||
frame = window:newFrame(0,0,0,0,0,.2,1,.8)
|
||||
local frame = window:newFrame(0,0,0,0,0,.2,1,.8)
|
||||
frame.visibility = 0
|
||||
label = window:newTextLabel(" " ..q.title.. " ",0,0,0,0,0,0,1,.2)
|
||||
label.align = ALIGN_CENTER
|
||||
@@ -24,9 +24,8 @@ local function index(window, q, callback)
|
||||
label:scaleFont(.4)
|
||||
label:centerFont()
|
||||
label.drawBorder = false
|
||||
imageHolder = frame:newImageButton("assets/images/speaker.png",0,0,0,0,0,0,.3,.3)
|
||||
imageHolder = window:newImageButton("assets/images/speaker.png",0,0,0,0,0,0,.3,.3)
|
||||
imageHolder.scale = "h"
|
||||
imageHolder:setAspectSize(imageHolder.imageWidth,imageHolder.imageHeight)
|
||||
imageHolder:centerX(true)
|
||||
imageHolder:centerY(true)
|
||||
local sound = newSource(q.sound,"stream")
|
||||
@@ -44,10 +43,15 @@ local function index(window, q, callback)
|
||||
end)
|
||||
|
||||
useDefaultHandler(callback)
|
||||
|
||||
-- Return the expected types
|
||||
return {
|
||||
{sound=AUDIO, description="Sound that will be played"}
|
||||
}
|
||||
end
|
||||
|
||||
local function update(dt) -- time in seconds that has passed since
|
||||
|
||||
|
||||
end
|
||||
|
||||
return {
|
||||
|
||||
@@ -36,6 +36,11 @@ local function index(window, q, callback)
|
||||
video.XButton.visible = false
|
||||
|
||||
useDefaultHandler(callback)
|
||||
|
||||
-- Return the expected types
|
||||
return {
|
||||
{video=VIDEO, description="Video that will be played"}
|
||||
}
|
||||
end
|
||||
|
||||
local function update(dt) -- time in seconds that has passed since
|
||||
|
||||
@@ -73,6 +73,22 @@ local function index(window, q, callback)
|
||||
end)
|
||||
|
||||
useDefaultHandler(callback)
|
||||
|
||||
-- Return the expected types
|
||||
return {
|
||||
{
|
||||
zoom=IMAGE,
|
||||
description = "Full zoom in on an image"
|
||||
},
|
||||
{
|
||||
minzoom=IMAGE,
|
||||
description = "Minimum zoom before the full image is revealed"
|
||||
},
|
||||
{
|
||||
fullimage=IMAGE,
|
||||
description = "Full image to show"
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
local function update(dt) -- time in seconds that has passed since
|
||||
|
||||
Reference in New Issue
Block a user