Fandom

Fire Emblem Wiki

Module:Common

5,333pages on
this wiki
Add New Page
Talk0
--[[ This module contains common objects that could be used by many other modules
     Therefore it cannot be invoked by templates ]]
-------------------------------------------------------------------------------
--[[
Functions:
+ setDefault(argument, value): Set default 'value' to argument, if 'value' is not defined, argument will be default to empty string.
 
+ colorLink(argument):  fix link and font color for games that have light BG.
 
+ isnotNil(argument): return true if not nil, else false
 
+ capitalize(argument): capitalize string
]]
-------------------------------------------------------------------------------
local common = {}
 
function common.setDefault(arg, val)
    if(arg == nil) then
        if(val == nil) then arg = ''
        else arg = val end
    end
    return arg
end
 
function common.colorLinks(arg)
    local class
    local games = { 'fe6', 'fe8', 'fe9', 'fe10', 'fe12', 'fe13', 'fe14', 'ts2', 'tms', 'smt' }
 
    for i = 0, #games do
        if(arg == games[i]) then
            class = 'light'
            break
        else class = ''
        end
    end
    return class
end
 
function common.isnotNil(arg)
    if(arg ~= nil) then return true
    else return false end
end
 
function common.capitalize(arg)
    -- in progress
end
 
return common
--[[Category:Modules]]

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

Also on Fandom

Random Wiki