diff --git a/gui b/gui index 38b07e5..4bc968e 160000 --- a/gui +++ b/gui @@ -1 +1 @@ -Subproject commit 38b07e5f2701a27752d983bcd13d9733667d1fe8 +Subproject commit 4bc968e8dcec7f0fc31976d82659e1193de16e62 diff --git a/main.lua b/main.lua index c95cd24..d76b496 100644 --- a/main.lua +++ b/main.lua @@ -24,8 +24,6 @@ log = logger.new("jeopardy", { local gui = require("gui") local color = require("gui.core.color") -local title = require("menus.title") -local menu = require("gui.core.menus") color.indexColor("bg","#2b348b") 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("shaderColB","rgb01(0.20, 0.22, 0.58)") 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") diff --git a/menus/board.lua b/menus/board.lua index 860d7a9..76bb231 100644 --- a/menus/board.lua +++ b/menus/board.lua @@ -264,6 +264,13 @@ function Menu(frame, path, deb) end 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) qframe.visibility = 0 @@ -291,7 +298,7 @@ function Menu(frame, path, deb) refresh:centerFont() refresh:scaleFont(.9) refresh.align = gui.ALIGN_CENTER - refresh.color = color.green + refresh.color = color.new("#12a217") refresh:OnReleased(function() cleanUp(frameRef) menu.getMenu("title"):visible(true) @@ -312,7 +319,7 @@ function Menu(frame, path, deb) local function displayAnswer(q) dframe.text = q.answer - dframe.textColor = color.white + dframe.textColor = color.question_font dframe.visible = true dframe.click = q["display-mode"] == "click" @@ -463,7 +470,9 @@ function Menu(frame, path, deb) displayAnswer(q) end end) + SetVisibility() + for cat,v in pairs(index.categories) do local c if v.image then @@ -601,8 +610,6 @@ function Menu(frame, path, deb) return background end - - function GetActivePlayer() if not activePlayer then return end return activePlayer.link @@ -634,43 +641,33 @@ function love.filedropped(file) print("Load file? " .. file:getFilename()) end +local C_BG_PANEL = color.scoreboard_panel_bg +local C_BG_HEADER = color.scoreboard_header_bg +local C_ACCENT = color.scoreboard_accent_color +local C_ROW_TOP = color.scoreboard_row_top_bg +local C_ROW_NORM = color.scoreboard_row_norm_bg +local C_BORDER_TOP = color.scoreboard_border_top_color +local C_BORDER_NRM = color.scoreboard_border_nrm_color +local C_BAR_EMPTY = color.scoreboard_bar_empty_color +local C_TEXT_MUTED = color.scoreboard_text_muted_color +local C_WHITE = color.scoreboard_pure_white +local C_GOLD = color.scoreboard_precious_gold +local C_SILVER = color.scoreboard_precious_silver +local C_BRONZE = color.scoreboard_precious_bronze + +local LEADER_HEIGHT_SCALE = .06 +local HEIGHT_SCALE = .03 +local PLAYER_HEIGHT = .05 + +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) - -- 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_HEADER = color.scoreboard_header_bg - local C_ACCENT = color.scoreboard_accent_color - local C_ROW_TOP = color.scoreboard_row_top_bg - local C_ROW_NORM = color.scoreboard_row_norm_bg - local C_BORDER_TOP = color.scoreboard_border_top_color - local C_BORDER_NRM = color.scoreboard_border_nrm_color - local C_BAR_EMPTY = color.scoreboard_bar_empty_color - local C_TEXT_MUTED = color.scoreboard_text_muted_color - local C_WHITE = color.scoreboard_pure_white - local C_GOLD = color.scoreboard_precious_gold - local C_SILVER = color.scoreboard_precious_silver - local C_BRONZE = color.scoreboard_precious_bronze - -- Config stuff - local LEADER_HEIGHT_SCALE = .06 - local HEIGHT_SCALE = .03 - local PLAYER_HEIGHT = .05 - -- - - local rankColors = { C_GOLD, C_SILVER, C_BRONZE } local leaderboard = frame:newFrame(x, y, w, h, sx, sy, sw, sh) leaderboard.color = C_BORDER_NRM @@ -883,7 +880,7 @@ function ScoreBoard(frame, x, y, w, h, sx, sy, sw, sh) end end end - + scoreboard.leaderboard = leaderboard return scoreboard end diff --git a/templates/imageword.lua b/templates/imageword.lua index 3d7108e..7f5e333 100644 --- a/templates/imageword.lua +++ b/templates/imageword.lua @@ -8,8 +8,8 @@ local function index(window, q, callback) frame.visibility = 0 label = window:newTextLabel(" " ..q.title.. " ",0,0,0,0,0,0,1,.2) label.align = ALIGN_CENTER - label.textColor = color.white - label.color = color.new("#363ac8") + label.textColor = color.question_font + label.color = color.question_bg label.drawBorder = false label:scaleFont(.4) 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.square = "w" plusLabel.align = ALIGN_CENTER - plusLabel.textColor = color.white + plusLabel.textColor = color.question_font -- plusLabel.visibility=0 -- Right image: takes up 0.58 to 1.0 of width diff --git a/templates/multiplechoice.lua b/templates/multiplechoice.lua index c6cb600..2d3e5a5 100644 --- a/templates/multiplechoice.lua +++ b/templates/multiplechoice.lua @@ -20,15 +20,15 @@ local selected local function index(window, q, callback) label = window:newTextLabel(" " ..q.title.. " ",noOf(0,0,1,.3)) label.align = ALIGN_CENTER - label.textColor = color.white - label.color = color.new("#363ac8") + label.textColor = color.question_font + label.color = color.question_bg label:setFont(50) label:centerFont() label:scaleFont(2/3) label.drawBorder = false local choices = window:newFrame(noOf(0,.3,1,.7)) - choices.color = color.new("#363ac8") + choices.color = color.question_bg function choices:newChoice(choice, i) 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 local choiceText = c:newTextLabel(choice,noOf(.3,0,1,1)) choiceText.visibility = 0 - choiceText.textColor = color.white + choiceText.textColor = color.question_font -- choiceText.align = window.ALIGN_CENTER choiceText:setFont(40) choiceText:centerFont() diff --git a/templates/one-image.lua b/templates/one-image.lua index 47dfc1f..0eb0fc0 100644 --- a/templates/one-image.lua +++ b/templates/one-image.lua @@ -14,8 +14,8 @@ local function index(window, q, callback) frame.visibility = 0 label = window:newTextLabel(" " ..q.title.. " ",0,0,0,0,0,0,1,.2) label.align = ALIGN_CENTER - label.textColor = color.white - label.color = color.new("#363ac8") + label.textColor = color.question_font + label.color = color.question_bg label:scaleFont(.4) label:centerFont() label.drawBorder = false diff --git a/templates/whatis.lua b/templates/whatis.lua index 69ab361..ba1b9d0 100644 --- a/templates/whatis.lua +++ b/templates/whatis.lua @@ -13,8 +13,8 @@ local function index(window, q, callback) label.visibility = 0--q.cosmetics.visibility label.align = ALIGN_CENTER label:fullFrame() - label.textColor = color.white - label.color = color.new("#363ac8") + label.textColor = color.question_font + label.color = color.question_bg label:centerFont() label:scaleFont(.075) label.drawBorder = false diff --git a/templates/whatsound.lua b/templates/whatsound.lua index b8cd283..7c1ed0f 100644 --- a/templates/whatsound.lua +++ b/templates/whatsound.lua @@ -19,8 +19,8 @@ local function index(window, q, callback) frame.visibility = 0 label = window:newTextLabel(" " ..q.title.. " ",0,0,0,0,0,0,1,.2) label.align = ALIGN_CENTER - label.textColor = color.white - label.color = color.new("#363ac8") + label.textColor = color.question_font + label.color = color.question_bg label:scaleFont(.4) label:centerFont() label.drawBorder = false diff --git a/templates/whatvideo.lua b/templates/whatvideo.lua index 26b7a78..ee120a2 100644 --- a/templates/whatvideo.lua +++ b/templates/whatvideo.lua @@ -19,8 +19,8 @@ local function index(window, q, callback) frame.visibility = 0 label = window:newTextLabel(" " ..q.title.. " ",0,0,0,0,0,0,1,.2) label.align = ALIGN_CENTER - label.textColor = color.white - label.color = color.new("#363ac8") + label.textColor = color.question_font + label.color = color.question_bg label:centerFont() label:scaleFont(.4) label.drawBorder = false diff --git a/templates/zoom.lua b/templates/zoom.lua index e8992c6..dc35212 100644 --- a/templates/zoom.lua +++ b/templates/zoom.lua @@ -14,8 +14,8 @@ local function index(window, q, callback) frame.visibility = 0 label = window:newTextLabel(" " ..q.title.. " ",0,0,0,0,0,0,1,.2) label.align = ALIGN_CENTER - label.textColor = color.white - label.color = color.new("#363ac8") + label.textColor = color.question_font + label.color = color.question_bg label:scaleFont(.4) label:centerFont() label.drawBorder = false diff --git a/utils/utils.lua b/utils/utils.lua index 490e30e..0bb88ee 100644 --- a/utils/utils.lua +++ b/utils/utils.lua @@ -8,10 +8,10 @@ local function startTimer(opt) autoText = true, autoColor = true, autoCleanup = false, - startColor = color.green, - textColor = color.black, - warnColor = color.yellow, - timeColor = color.red, + startColor = color.timer_start, + textColor = color.timer_font, + warnColor = color.timer_warn, + timeColor = color.timer_end, finegrained = false, visibility = 1 }