all colors customizable with defined names, todo in app quiz builder
This commit is contained in:
+1
-1
Submodule gui updated: 38b07e5f27...4bc968e8dc
@@ -24,8 +24,6 @@ log = logger.new("jeopardy", {
|
|||||||
|
|
||||||
local gui = require("gui")
|
local gui = require("gui")
|
||||||
local color = require("gui.core.color")
|
local color = require("gui.core.color")
|
||||||
local title = require("menus.title")
|
|
||||||
local menu = require("gui.core.menus")
|
|
||||||
|
|
||||||
color.indexColor("bg","#2b348b")
|
color.indexColor("bg","#2b348b")
|
||||||
color.indexColor("tile_bg","#5459e4")
|
color.indexColor("tile_bg","#5459e4")
|
||||||
@@ -41,6 +39,27 @@ color.indexColor("wrong", "#bd2626")
|
|||||||
color.indexColor("shaderColA","rgb01(0.10, 0.12, 0.38)")
|
color.indexColor("shaderColA","rgb01(0.10, 0.12, 0.38)")
|
||||||
color.indexColor("shaderColB","rgb01(0.20, 0.22, 0.58)")
|
color.indexColor("shaderColB","rgb01(0.20, 0.22, 0.58)")
|
||||||
color.indexColor("shaderColC","rgb01(0.55, 0.58, 0.78)")
|
color.indexColor("shaderColC","rgb01(0.55, 0.58, 0.78)")
|
||||||
|
color.indexColor("scoreboard_panel_bg", "#1a1a2e")
|
||||||
|
color.indexColor("scoreboard_header_bg", "#16213e")
|
||||||
|
color.indexColor("scoreboard_accent_color", "#e94560")
|
||||||
|
color.indexColor("scoreboard_row_top_bg", "#1c2641")
|
||||||
|
color.indexColor("scoreboard_row_norm_bg", "#121226")
|
||||||
|
color.indexColor("scoreboard_border_top_color", "#323c6e")
|
||||||
|
color.indexColor("scoreboard_border_nrm_color", "#1c1c37")
|
||||||
|
color.indexColor("scoreboard_bar_empty_color", "#232341")
|
||||||
|
color.indexColor("scoreboard_text_muted_color", "#786e96")
|
||||||
|
color.indexColor("scoreboard_pure_white", "#ffffff")
|
||||||
|
color.indexColor("scoreboard_precious_gold", "#ffd700")
|
||||||
|
color.indexColor("scoreboard_precious_silver", "#C0C0C0")
|
||||||
|
color.indexColor("scoreboard_precious_bronze", "#cd7f32")
|
||||||
|
color.indexColor("timer_start","#12a217")
|
||||||
|
color.indexColor("timer_font","#000000")
|
||||||
|
color.indexColor("timer_warn","#ffff14")
|
||||||
|
color.indexColor("timer_end","#e50000")
|
||||||
|
color.indexColor("question_font","rgb(255,255,255)")
|
||||||
|
|
||||||
|
local title = require("menus.title")
|
||||||
|
local menu = require("gui.core.menus")
|
||||||
|
|
||||||
require("gui.addons")
|
require("gui.addons")
|
||||||
|
|
||||||
|
|||||||
+21
-24
@@ -264,6 +264,13 @@ function Menu(frame, path, deb)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local scoreboard = ScoreBoard(frameRef, 0, 0, 0, 0, .06, .1, .170, .8)
|
local scoreboard = ScoreBoard(frameRef, 0, 0, 0, 0, .06, .1, .170, .8)
|
||||||
|
local properties = Properties(frameRef, 0, 0, 0, 0, .06, .1, .170, .8)
|
||||||
|
gui:setHotKey({"lctrl","q"})(function()
|
||||||
|
scoreboard.leaderboard.visible = not scoreboard.leaderboard.visible
|
||||||
|
end)
|
||||||
|
gui:setHotKey({"lctrl","e"})(function()
|
||||||
|
properties.visible = not properties.visible
|
||||||
|
end)
|
||||||
|
|
||||||
local qframe = frameRef:newFrame(0, 0, 0, 0, .24, .1, .70, .8)
|
local qframe = frameRef:newFrame(0, 0, 0, 0, .24, .1, .70, .8)
|
||||||
qframe.visibility = 0
|
qframe.visibility = 0
|
||||||
@@ -291,7 +298,7 @@ function Menu(frame, path, deb)
|
|||||||
refresh:centerFont()
|
refresh:centerFont()
|
||||||
refresh:scaleFont(.9)
|
refresh:scaleFont(.9)
|
||||||
refresh.align = gui.ALIGN_CENTER
|
refresh.align = gui.ALIGN_CENTER
|
||||||
refresh.color = color.green
|
refresh.color = color.new("#12a217")
|
||||||
refresh:OnReleased(function()
|
refresh:OnReleased(function()
|
||||||
cleanUp(frameRef)
|
cleanUp(frameRef)
|
||||||
menu.getMenu("title"):visible(true)
|
menu.getMenu("title"):visible(true)
|
||||||
@@ -312,7 +319,7 @@ function Menu(frame, path, deb)
|
|||||||
|
|
||||||
local function displayAnswer(q)
|
local function displayAnswer(q)
|
||||||
dframe.text = q.answer
|
dframe.text = q.answer
|
||||||
dframe.textColor = color.white
|
dframe.textColor = color.question_font
|
||||||
|
|
||||||
dframe.visible = true
|
dframe.visible = true
|
||||||
dframe.click = q["display-mode"] == "click"
|
dframe.click = q["display-mode"] == "click"
|
||||||
@@ -463,7 +470,9 @@ function Menu(frame, path, deb)
|
|||||||
displayAnswer(q)
|
displayAnswer(q)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
SetVisibility()
|
SetVisibility()
|
||||||
|
|
||||||
for cat,v in pairs(index.categories) do
|
for cat,v in pairs(index.categories) do
|
||||||
local c
|
local c
|
||||||
if v.image then
|
if v.image then
|
||||||
@@ -601,8 +610,6 @@ function Menu(frame, path, deb)
|
|||||||
return background
|
return background
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function GetActivePlayer()
|
function GetActivePlayer()
|
||||||
if not activePlayer then return end
|
if not activePlayer then return end
|
||||||
return activePlayer.link
|
return activePlayer.link
|
||||||
@@ -634,22 +641,6 @@ function love.filedropped(file)
|
|||||||
print("Load file? " .. file:getFilename())
|
print("Load file? " .. file:getFilename())
|
||||||
end
|
end
|
||||||
|
|
||||||
function ScoreBoard(frame, x, y, w, h, sx, sy, sw, sh)
|
|
||||||
-- Colors
|
|
||||||
color.indexColor("scoreboard_panel_bg", "#1a1a2e")
|
|
||||||
color.indexColor("scoreboard_header_bg", "#16213e")
|
|
||||||
color.indexColor("scoreboard_accent_color", "#e94560")
|
|
||||||
color.indexColor("scoreboard_row_top_bg", "#1c2641")
|
|
||||||
color.indexColor("scoreboard_row_norm_bg", "#121226")
|
|
||||||
color.indexColor("scoreboard_border_top_color", "#323c6e")
|
|
||||||
color.indexColor("scoreboard_border_nrm_color", "#1c1c37")
|
|
||||||
color.indexColor("scoreboard_bar_empty_color", "#232341")
|
|
||||||
color.indexColor("scoreboard_text_muted_color", "#786e96")
|
|
||||||
color.indexColor("scoreboard_pure_white", "#ffffff")
|
|
||||||
color.indexColor("scoreboard_precious_gold", "#ffd700")
|
|
||||||
color.indexColor("scoreboard_precious_silver", "#C0C0C0")
|
|
||||||
color.indexColor("scoreboard_precious_bronze", "#cd7f32")
|
|
||||||
|
|
||||||
local C_BG_PANEL = color.scoreboard_panel_bg
|
local C_BG_PANEL = color.scoreboard_panel_bg
|
||||||
local C_BG_HEADER = color.scoreboard_header_bg
|
local C_BG_HEADER = color.scoreboard_header_bg
|
||||||
local C_ACCENT = color.scoreboard_accent_color
|
local C_ACCENT = color.scoreboard_accent_color
|
||||||
@@ -664,13 +655,19 @@ function ScoreBoard(frame, x, y, w, h, sx, sy, sw, sh)
|
|||||||
local C_SILVER = color.scoreboard_precious_silver
|
local C_SILVER = color.scoreboard_precious_silver
|
||||||
local C_BRONZE = color.scoreboard_precious_bronze
|
local C_BRONZE = color.scoreboard_precious_bronze
|
||||||
|
|
||||||
-- Config stuff
|
|
||||||
local LEADER_HEIGHT_SCALE = .06
|
local LEADER_HEIGHT_SCALE = .06
|
||||||
local HEIGHT_SCALE = .03
|
local HEIGHT_SCALE = .03
|
||||||
local PLAYER_HEIGHT = .05
|
local PLAYER_HEIGHT = .05
|
||||||
--
|
|
||||||
|
|
||||||
local rankColors = { C_GOLD, C_SILVER, C_BRONZE }
|
function Properties(frame, x, y, w, h, sx, sy, sw, sh)
|
||||||
|
local prop = frame:newFrame(x, y, w, h, sx, sy, sw, sh)
|
||||||
|
prop.color = C_BORDER_NRM
|
||||||
|
|
||||||
|
return prop
|
||||||
|
end
|
||||||
|
|
||||||
|
function ScoreBoard(frame, x, y, w, h, sx, sy, sw, sh)
|
||||||
|
-- Config stuff
|
||||||
|
|
||||||
local leaderboard = frame:newFrame(x, y, w, h, sx, sy, sw, sh)
|
local leaderboard = frame:newFrame(x, y, w, h, sx, sy, sw, sh)
|
||||||
leaderboard.color = C_BORDER_NRM
|
leaderboard.color = C_BORDER_NRM
|
||||||
@@ -883,7 +880,7 @@ function ScoreBoard(frame, x, y, w, h, sx, sy, sw, sh)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
scoreboard.leaderboard = leaderboard
|
||||||
return scoreboard
|
return scoreboard
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ local function index(window, q, callback)
|
|||||||
frame.visibility = 0
|
frame.visibility = 0
|
||||||
label = window:newTextLabel(" " ..q.title.. " ",0,0,0,0,0,0,1,.2)
|
label = window:newTextLabel(" " ..q.title.. " ",0,0,0,0,0,0,1,.2)
|
||||||
label.align = ALIGN_CENTER
|
label.align = ALIGN_CENTER
|
||||||
label.textColor = color.white
|
label.textColor = color.question_font
|
||||||
label.color = color.new("#363ac8")
|
label.color = color.question_bg
|
||||||
label.drawBorder = false
|
label.drawBorder = false
|
||||||
label:scaleFont(.4)
|
label:scaleFont(.4)
|
||||||
label:centerFont()
|
label:centerFont()
|
||||||
@@ -31,7 +31,7 @@ local function index(window, q, callback)
|
|||||||
plusLabel = frame:newImageLabel("assets/images/plus.png", 0, 0, 0, 0, .4125, .4, .175)
|
plusLabel = frame:newImageLabel("assets/images/plus.png", 0, 0, 0, 0, .4125, .4, .175)
|
||||||
plusLabel.square = "w"
|
plusLabel.square = "w"
|
||||||
plusLabel.align = ALIGN_CENTER
|
plusLabel.align = ALIGN_CENTER
|
||||||
plusLabel.textColor = color.white
|
plusLabel.textColor = color.question_font
|
||||||
-- plusLabel.visibility=0
|
-- plusLabel.visibility=0
|
||||||
|
|
||||||
-- Right image: takes up 0.58 to 1.0 of width
|
-- Right image: takes up 0.58 to 1.0 of width
|
||||||
|
|||||||
@@ -20,15 +20,15 @@ local selected
|
|||||||
local function index(window, q, callback)
|
local function index(window, q, callback)
|
||||||
label = window:newTextLabel(" " ..q.title.. " ",noOf(0,0,1,.3))
|
label = window:newTextLabel(" " ..q.title.. " ",noOf(0,0,1,.3))
|
||||||
label.align = ALIGN_CENTER
|
label.align = ALIGN_CENTER
|
||||||
label.textColor = color.white
|
label.textColor = color.question_font
|
||||||
label.color = color.new("#363ac8")
|
label.color = color.question_bg
|
||||||
label:setFont(50)
|
label:setFont(50)
|
||||||
label:centerFont()
|
label:centerFont()
|
||||||
label:scaleFont(2/3)
|
label:scaleFont(2/3)
|
||||||
label.drawBorder = false
|
label.drawBorder = false
|
||||||
|
|
||||||
local choices = window:newFrame(noOf(0,.3,1,.7))
|
local choices = window:newFrame(noOf(0,.3,1,.7))
|
||||||
choices.color = color.new("#363ac8")
|
choices.color = color.question_bg
|
||||||
|
|
||||||
function choices:newChoice(choice, i)
|
function choices:newChoice(choice, i)
|
||||||
local c = choices:newFrame(noOf(.25,(i-1)/#q.choices,.5,1/#q.choices))
|
local c = choices:newFrame(noOf(.25,(i-1)/#q.choices,.5,1/#q.choices))
|
||||||
@@ -53,7 +53,7 @@ local function index(window, q, callback)
|
|||||||
c.drawBorder = false
|
c.drawBorder = false
|
||||||
local choiceText = c:newTextLabel(choice,noOf(.3,0,1,1))
|
local choiceText = c:newTextLabel(choice,noOf(.3,0,1,1))
|
||||||
choiceText.visibility = 0
|
choiceText.visibility = 0
|
||||||
choiceText.textColor = color.white
|
choiceText.textColor = color.question_font
|
||||||
-- choiceText.align = window.ALIGN_CENTER
|
-- choiceText.align = window.ALIGN_CENTER
|
||||||
choiceText:setFont(40)
|
choiceText:setFont(40)
|
||||||
choiceText:centerFont()
|
choiceText:centerFont()
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ local function index(window, q, callback)
|
|||||||
frame.visibility = 0
|
frame.visibility = 0
|
||||||
label = window:newTextLabel(" " ..q.title.. " ",0,0,0,0,0,0,1,.2)
|
label = window:newTextLabel(" " ..q.title.. " ",0,0,0,0,0,0,1,.2)
|
||||||
label.align = ALIGN_CENTER
|
label.align = ALIGN_CENTER
|
||||||
label.textColor = color.white
|
label.textColor = color.question_font
|
||||||
label.color = color.new("#363ac8")
|
label.color = color.question_bg
|
||||||
label:scaleFont(.4)
|
label:scaleFont(.4)
|
||||||
label:centerFont()
|
label:centerFont()
|
||||||
label.drawBorder = false
|
label.drawBorder = false
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ local function index(window, q, callback)
|
|||||||
label.visibility = 0--q.cosmetics.visibility
|
label.visibility = 0--q.cosmetics.visibility
|
||||||
label.align = ALIGN_CENTER
|
label.align = ALIGN_CENTER
|
||||||
label:fullFrame()
|
label:fullFrame()
|
||||||
label.textColor = color.white
|
label.textColor = color.question_font
|
||||||
label.color = color.new("#363ac8")
|
label.color = color.question_bg
|
||||||
label:centerFont()
|
label:centerFont()
|
||||||
label:scaleFont(.075)
|
label:scaleFont(.075)
|
||||||
label.drawBorder = false
|
label.drawBorder = false
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ local function index(window, q, callback)
|
|||||||
frame.visibility = 0
|
frame.visibility = 0
|
||||||
label = window:newTextLabel(" " ..q.title.. " ",0,0,0,0,0,0,1,.2)
|
label = window:newTextLabel(" " ..q.title.. " ",0,0,0,0,0,0,1,.2)
|
||||||
label.align = ALIGN_CENTER
|
label.align = ALIGN_CENTER
|
||||||
label.textColor = color.white
|
label.textColor = color.question_font
|
||||||
label.color = color.new("#363ac8")
|
label.color = color.question_bg
|
||||||
label:scaleFont(.4)
|
label:scaleFont(.4)
|
||||||
label:centerFont()
|
label:centerFont()
|
||||||
label.drawBorder = false
|
label.drawBorder = false
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ local function index(window, q, callback)
|
|||||||
frame.visibility = 0
|
frame.visibility = 0
|
||||||
label = window:newTextLabel(" " ..q.title.. " ",0,0,0,0,0,0,1,.2)
|
label = window:newTextLabel(" " ..q.title.. " ",0,0,0,0,0,0,1,.2)
|
||||||
label.align = ALIGN_CENTER
|
label.align = ALIGN_CENTER
|
||||||
label.textColor = color.white
|
label.textColor = color.question_font
|
||||||
label.color = color.new("#363ac8")
|
label.color = color.question_bg
|
||||||
label:centerFont()
|
label:centerFont()
|
||||||
label:scaleFont(.4)
|
label:scaleFont(.4)
|
||||||
label.drawBorder = false
|
label.drawBorder = false
|
||||||
|
|||||||
+2
-2
@@ -14,8 +14,8 @@ local function index(window, q, callback)
|
|||||||
frame.visibility = 0
|
frame.visibility = 0
|
||||||
label = window:newTextLabel(" " ..q.title.. " ",0,0,0,0,0,0,1,.2)
|
label = window:newTextLabel(" " ..q.title.. " ",0,0,0,0,0,0,1,.2)
|
||||||
label.align = ALIGN_CENTER
|
label.align = ALIGN_CENTER
|
||||||
label.textColor = color.white
|
label.textColor = color.question_font
|
||||||
label.color = color.new("#363ac8")
|
label.color = color.question_bg
|
||||||
label:scaleFont(.4)
|
label:scaleFont(.4)
|
||||||
label:centerFont()
|
label:centerFont()
|
||||||
label.drawBorder = false
|
label.drawBorder = false
|
||||||
|
|||||||
+4
-4
@@ -8,10 +8,10 @@ local function startTimer(opt)
|
|||||||
autoText = true,
|
autoText = true,
|
||||||
autoColor = true,
|
autoColor = true,
|
||||||
autoCleanup = false,
|
autoCleanup = false,
|
||||||
startColor = color.green,
|
startColor = color.timer_start,
|
||||||
textColor = color.black,
|
textColor = color.timer_font,
|
||||||
warnColor = color.yellow,
|
warnColor = color.timer_warn,
|
||||||
timeColor = color.red,
|
timeColor = color.timer_end,
|
||||||
finegrained = false,
|
finegrained = false,
|
||||||
visibility = 1
|
visibility = 1
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user