Vorlage:TalentList: Unterschied zwischen den Versionen

Aus Eco - Deutsches Wiki
Wechseln zu:Navigation, Suche
[gesichtete Version][gesichtete Version]
(Die Seite wurde neu angelegt: „-- Credit: Original SkillList was created by Fyre (FishAus) then edited by Scotty (ZeelNightwolf) and used as a base for TalentList. local p = {} -- Grabs ar…“)
 
Keine Bearbeitungszusammenfassung
 
Zeile 1: Zeile 1:
-- Credit: Original SkillList was created by Fyre (FishAus) then edited by Scotty (ZeelNightwolf) and used as a base for TalentList.
<includeonly>
{{#invoke:TalentList|main}}
</includeonly>


local p = {}
<noinclude>
==Documentation==
<pre>
{{TalentList|list = talents}}
</pre>
This template can be used to grab Talents and list them.
TalentList will generate the information, using the following Modules:
*[[Modul:TalentList]]
*[[Modul:TalentData]]


-- Grabs args from the parent frame
==Usage==
-- Trims and parses the args into a table, then returns the table
===Parameters===
function norm()
; list
    local origArgs = mw.getCurrentFrame():getParent().args
: talents, for a list of all talents.
    local args = {}
   
    for k, v in pairs( origArgs ) do
        v = mw.text.trim( tostring( v ) )
        if v ~= '' then
            args[k] = v
        end
    end
   
    return args
end


-- Main entry point for the Module
==Example==
function p.main()
{{TalentList|list = talents}}
    -- get args from the Template
</noinclude>
    local args = norm()
   
if args.list == nil or args.list == '' then
        return '\'list\' must be specified.'
    end
    -- assign variables for list
    local list = args.list
    -- load lists
    local talentData = require( "Module:TalentData" )
local talentList = ''
 
--Check Passes
if list ~= 'talents' then
        return talentList .. ' Incorrect use of pass. '
    end
local a = {}
--Talent List
if list == 'talents' then
talentList = talentList .. '=== Talents List ===\n' 
talentList = talentList .. '<div style=\"column-count:3;-moz-column-count:3;-webkit-column-count:3\">\n'
   
for k,v in pairs(talentData.talents) do       
            if talentData.talents[k].group == 'Talents' then
              table.insert(a,k)
            end
        end
        table.sort(a)
        for i,n in ipairs(a) do
            talentList = talentList .. '* [[' .. n .. ']]\n'               
        end
talentList = talentList .. '</div>'
end
 
return talentList
end
 
return p

Aktuelle Version vom 14. Februar 2021, 03:46 Uhr


Documentation[Quelltext bearbeiten]

{{TalentList|list = talents}}

This template can be used to grab Talents and list them. TalentList will generate the information, using the following Modules:

Usage[Quelltext bearbeiten]

Parameters[Quelltext bearbeiten]

list
talents, for a list of all talents.

Example[Quelltext bearbeiten]

Talents List