Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
Binary file modified lua/spec/snapshots/LeagueIcon.generate_copy_paste_gen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lua/spec/snapshots/Slider.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lua/spec/snapshots/date range display.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lua/spec/snapshots/dota2 rankings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lua/spec/snapshots/infobox_league_apexlegends.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lua/spec/snapshots/infobox_league_counterstrike.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lua/spec/snapshots/infobox_league_dota2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lua/spec/snapshots/infobox_league_leagueoflegends.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lua/spec/snapshots/infobox_league_mobilelegends.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lua/spec/snapshots/infobox_league_overwatch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lua/spec/snapshots/infobox_league_rainbowsix.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lua/spec/snapshots/infobox_league_rocketleague.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lua/spec/snapshots/infobox_league_starcraft2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lua/spec/snapshots/infobox_league_valorant.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lua/spec/snapshots/match2_matchlist_smoke_apexlegends.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lua/spec/snapshots/match2_matchlist_smoke_counterstrike.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lua/spec/snapshots/match2_matchlist_smoke_dota2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lua/spec/snapshots/match2_matchlist_smoke_leagueoflegends.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lua/spec/snapshots/match2_matchlist_smoke_mobilelegends.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lua/spec/snapshots/match2_matchlist_smoke_overwatch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lua/spec/snapshots/match2_matchlist_smoke_rainbowsix.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lua/spec/snapshots/match2_matchlist_smoke_rocketleague.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lua/spec/snapshots/match2_matchlist_smoke_starcraft2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lua/spec/snapshots/match2_matchlist_smoke_valorant.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lua/spec/snapshots/prize_pool.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lua/spec/snapshots/squad_row_apexlegends.png
Binary file modified lua/spec/snapshots/squad_row_counterstrike.png
Binary file modified lua/spec/snapshots/squad_row_dota2.png
Binary file modified lua/spec/snapshots/squad_row_leagueoflegends.png
Binary file modified lua/spec/snapshots/squad_row_mobilelegends.png
Binary file modified lua/spec/snapshots/squad_row_overwatch.png
Binary file modified lua/spec/snapshots/squad_row_rocketleague.png
Binary file modified lua/spec/snapshots/squad_row_starcraft2.png
Binary file modified lua/spec/snapshots/squad_row_valorant.png
Binary file modified lua/spec/snapshots/standings_ffa.png
Binary file modified lua/spec/snapshots/standings_legend.png
Binary file modified lua/spec/snapshots/standings_swiss.png
Binary file modified lua/spec/snapshots/tabs_dynamic_variants.png
Binary file modified lua/spec/snapshots/team_participant.png
Binary file modified lua/spec/snapshots/teamcard_legacy.png
Binary file modified lua/spec/snapshots/transfer_row_apexlegends.png
Binary file modified lua/spec/snapshots/transfer_row_counterstrike.png
Binary file modified lua/spec/snapshots/transfer_row_dota2.png
Binary file modified lua/spec/snapshots/transfer_row_leagueoflegends.png
Binary file modified lua/spec/snapshots/transfer_row_mobilelegends.png
Binary file modified lua/spec/snapshots/transfer_row_overwatch.png
Binary file modified lua/spec/snapshots/transfer_row_rainbowsix.png
Binary file modified lua/spec/snapshots/transfer_row_rocketleague.png
Binary file modified lua/spec/snapshots/transfer_row_starcraft2.png
Binary file modified lua/spec/snapshots/transfer_row_valorant.png
68 changes: 68 additions & 0 deletions lua/wikis/deltaforce/Infobox/Character/Custom.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
-- @Liquipedia
-- page=Module:Infobox/Character/Custom
--
-- Please see https://github.com/Liquipedia/Lua-Modules to contribute
--

local Lua = require('Module:Lua')

local Class = Lua.import('Module:Class')

local Character = Lua.import('Module:Infobox/Character')
local Injector = Lua.import('Module:Widget/Injector')
local PositionIcon = Lua.import('Module:OperatorsPositionIcon', {loadData = true})

local Widgets = Lua.import('Module:Widget/All')
local Cell = Widgets.Cell

---@class DeltaforceCharacterInfobox: CharacterInfobox
local CustomCharacter = Class.new(Character)
---@class DeltaforceCharacterInfoboxWidgetInjector: WidgetInjector
---@field caller DeltaforceCharacterInfobox
local CustomInjector = Class.new(Injector)

---@param frame Frame
---@return Html
function CustomCharacter.run(frame)
local character = CustomCharacter(frame)
character:setWidgetInjector(CustomInjector(character))
character.args.informationType = 'Characters'
return character:createInfobox()
end

---@param id string
---@param widgets Widget[]
---@return Widget[]
function CustomInjector:parse(id, widgets)
if id == 'role' then
return {
Cell{
name = 'Position',
children = {self:_toCellContent('position')}
},
}
end
return widgets
end

---@param key string
---@return string?
function CustomInjector:_toCellContent(key)
local args = self.caller.args
if not args[key] or args[key] == '' then return end
local iconData = PositionIcon[args[key]:lower()]
if not iconData then return args[key] end

return '[[File:' .. iconData.icon .. '|15px|link=' .. (iconData.link or '') .. ']] ' .. iconData.displayName
end

---@param lpdbData table
---@param args table
---@return table
function CustomCharacter:addToLpdb(lpdbData, args)
lpdbData.extradata.position = args.position
return lpdbData
end

return CustomCharacter