Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions components/match_ticker/commons/match_ticker.lua
Comment thread
Rathoz marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ local NOW = os.date('%Y-%m-%d %H:%M', os.time(os.date('!*t') --[[@as osdateparam
---@field onlyHighlightOnValue string?
---@field tiers string[]?
---@field tierTypes string[]?
---@field newStyle boolean?

---@class MatchTicker
---@operator call(table): MatchTicker
Expand All @@ -88,8 +89,6 @@ local NOW = os.date('%Y-%m-%d %H:%M', os.time(os.date('!*t') --[[@as osdateparam
---@field matches table[]?
local MatchTicker = Class.new(function(self, args) self:init(args) end)

MatchTicker.DisplayComponents = Lua.import('Module:MatchTicker/DisplayComponents')

---@param args table?
---@return table
function MatchTicker:init(args)
Expand Down Expand Up @@ -124,6 +123,7 @@ function MatchTicker:init(args)
tierTypes = args.tiertypes and Array.filter(
Array.parseCommaSeparatedString(args.tiertypes), FnUtil.curry(Tier.isValid, 1)
) or nil,
newStyle = Logic.readBool(args.newStyle),
}

--min 1 of them has to be set; recent can not be set while any of the others is set
Expand Down Expand Up @@ -164,6 +164,12 @@ function MatchTicker:init(args)
end
config.wrapperClasses = wrapperClasses

if config.newStyle then
MatchTicker.DisplayComponents = Lua.import('Module:MatchTicker/DisplayComponents/New')
else
MatchTicker.DisplayComponents = Lua.import('Module:MatchTicker/DisplayComponents')
end

self.config = config

return self
Expand Down
9 changes: 9 additions & 0 deletions components/match_ticker/commons/match_ticker_custom.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ function CustomMatchTicker.mainPage(frame)
return MatchTicker(args):query():create()
end

---Entry point for display on the main page with the new style
---@param frame Frame?
---@return Html
function CustomMatchTicker.newMainPage(frame)
Comment thread
hjpalpha marked this conversation as resolved.
local args = Arguments.getArgs(frame)
args.newStyle = true
return MatchTicker(args):query():create()
end

---Entry point for display on player pages
---@param frame Frame?
---@return Html
Expand Down
Loading