Jump to content

Module:Cast: Difference between revisions

From Heroes Wiki
Content deleted Content added
Created page with "local data = require("Module:Cast/data") local p = {} -- Function 1: Get cast type function p.getCastType(frame) local key = string.lower(frame.args[1] or "") local entry = data[key] if not entry then return "Ending Credits in" end local cast, _ = unpack(entry) return string.format("%s", cast) end -- Function 2: Get cast marking function p.getCastType(frame) local key = string.lower(frame.args[1] or "") local entry = data[key]..."
 
mNo edit summary
 
Line 17: Line 17:


-- Function 2: Get cast marking
-- Function 2: Get cast marking
function p.getCastType(frame)
function p.getCastMarking(frame)
local key = string.lower(frame.args[1] or "")
local key = string.lower(frame.args[1] or "")
local entry = data[key]
local entry = data[key]

Latest revision as of 21:40, 10 February 2026

local data = require("Module:Cast/data")
local p = {}

-- Function 1: Get cast type
function p.getCastType(frame)
    local key = string.lower(frame.args[1] or "")
    local entry = data[key]

    if not entry then
        return "Ending Credits in"
    end

    local cast, _ = unpack(entry)

    return string.format("%s", cast)
end

-- Function 2: Get cast marking
function p.getCastMarking(frame)
    local key = string.lower(frame.args[1] or "")
    local entry = data[key]

    if not entry then
        return "Ending Credits"
    end

    local _, marking = unpack(entry)

    return string.format("%s", marking)
end

return p