Dead by Daylight Wiki
mNo edit summary
mNo edit summary
Line 23: Line 23:
 
--common strings
 
--common strings
 
cstr = {
 
cstr = {
file = "Media:", --[[File: ...]]
+
file = "File:", --[[File: ...]]
  +
media = "Media:",
 
empty = "",
 
empty = "",
 
the = "The",
 
the = "The",

Revision as of 20:37, 1 December 2021

Template-info Documentation

List of functions

  • Note that the ... indicates dynamic count of parameters. I.e. the function accepts an indefinite number of parameters.
clr(color, text) - Colours the text with the color (that are stored in Module:Utils, under clr function)

clro(text[, true]) - clr function with preset colouring scheme order. Fucntion has optional parameter for resetting the colouring order back to start: clro(text[, true]) bclr(color, text) - clr function with additional bolding: '''clr(color, text)''' iclr(color, text) - clr functionwith additional italic style: ''clr(color, text)'' quote(text, author) - Flourished text, usually used at the end of description of Perk/Offering/Item/Add-on link(text, ...) - Wraps the text with brackets making it as a link: [[text|additional parameter]] templateLink(text) - Wraps the text with brackets making it as a template: {{text}} quotes(text) - Wraps the text with quotes: "text" center(text) - Wraps the text with center html tags: <center>text</center> list(...) - Makes list from individual parameters file(text, ...) - Wraps the text with link brackets and adds "File:" prefix to the name: [[File:text|additional parameter1|additional parameter2]] brackets(text) - Wraps the text with basic brackets: (text) b(text) - Boldes the text: '''text''' i(text) - Italic style for text: ''text'' skip(text) - Wrapping the text into hashtags (which is used for making a phrase in dynamic string. I.e. multiple words encapsulated in hashtags will behave as a single word): #text# note(text) - Wrapping text with span styling the text as a note. Mainly used as a small text for Notice feature. join(...) - Concatenates passed parameters with separator that is either passed as last parameter, or if passed table second parameter is used as spearator or can be skipped at all to use default ", " separator: join("hello", "creepy", "world", " - ") => "hello - creepy - world"

the(alter, spaceless) - writes the article before a subject. first parameter should be always passed in order to keep compatibility for non English wikis so the logic can be amended to language's needs to modify the article: the(killer) article(alter, spaceless) - general version of the() function, currently the major use is for indefinite articles ptb(content, title, patch) - wraps the content with PTB box with optional title above the box. Can be automated with passing a patch



To see whole documentation Expand the view

Functions

clr

  • clr(color, text) - Colours the text with the color (that are stored in Module:Utils, under clr function)
  • bclr(color, text) - Variation of clr function with additional wrap of bold style
  • iclr(color, text) - Variation of clr function with additional wrap of bold style
    • color - [Mandatory] used color. Their variations can be found at Clr Documentation. Colors are added in
      clr()
      function
      .
    • text - [Mandatory] text being coloured
Example(s)
clr("Chartreuse", "Coloured text with Chartreuse color")
{{#Invoke:Utils|clr|Chartreuse|Coloured text with Chartreuse color}}
Coloured text with Chartreuse color
bclr(6, "Coloured text with Teachable color")
'''{{#Invoke:Utils|clr|6|Coloured text with Teachable color with bold style}}'''
Coloured text with Teachable color with bold style
iclr("Red", "Coloured text with red color")
''{{#Invoke:Utils|clr|Red|Coloured text with red color with italic style}}''
Coloured text with red color with italic style


quote

  • quote(text, author) - Adjusts the text with the color according colour and applies italic styling
    • text - [Mandatory] quoted text
    • author - [Optional] used if the quote has its author
Example(s)
quote("Those who want to, look for a way, those who don't, look for a reason", "Jan Werich")
''{{#Invoke:Utils|clr|9|Those who want to, look for a way, those who don't, look for a reason — Jan Werich}}''
Those who want to, look for a way, those who don't, look for a reason — Jan Werich
quote("I got a present fo ya'")
''{{#Invoke:Utils|clr|9|I've got a present for ya'}}''
I've got a present for ya'


link, file

  • link(text, ...) - Wraps the text into brackets making a link from text. Can be passed additional parameter
  • file(text, ...) - Variation of link function with addition of
    File:
    • text - [Mandatory] Link redirecting to its destination
    • ... - [Optional] Used for renaming the link
Example(s)
link("Killers")
[[Killers]]
Killers
link("Left Behind (DLC)", "Left behind")
[[Left Behind (DLC)|Left behind]]
Left behind
file("BloodpointsIcon2.png", "56px", "link=")
[[File:BloodpointsIcon2.png|56px|link=]]
BloodpointsIcon2


templateLink

  • templateLink(text) - Wraps the text into brackets making a template name from text. (It shouldn't be used, unless it's necessary, since we try to minmise using templates)
    • text - [Mandatory] Link redirecting to its destination
Example(s)
templateLink("Patch 1.0.1a")
{{Patch 1.0.1a}}
CONTENT
  • Added art book for owners of the Deluxe Edition

quotes

  • templateLink(text) - Wraps the text with quotes. Function is mainly used for cases when one of the quotes would be sole string in combination with other string concatenations.
    • text - [Mandatory] text to be wrapped with quotes
Example(s)
quotes("Accidentally")
"Accidentally"
"Accidentally"
quotes("Accidentally" .. string.done)
"\"Accidentally" .. strings.done .. "\""
"Accidentally done"

center

  • center(text) - Wraps the text with
    <center>
    HTML tag. Function is mainly used for cases when one of the quotes would be sole string in combination with other string concatenations.
    • text - [Mandatory] text to be centered
Example(s)
center("Centered text")
<center>Centered text</center>
Centered text

list

  • list(...) - Creates a list (* notation) from individual passed parameters. It is strongly recommended to use this function for making any list.
    • ... - [Mandatory] String(s) that are to be formatted into a list
Example(s)
list("First item", "Second item", "Third item")
*First item *Second item *Third item
  • First item
  • Second item
  • Third item
list("Sole point")
*Sole point
  • Sole point

brackets

  • file(text) - Wraps the text with simple brackets. Function has the same purpose as .
    • ... - [Mandatory] String(s) that are to be concatenated after filename
Example(s)
brackets("Wrapped text")
(Wrapped text)
(Wrapped text)
brackets("This effect is applied to all " .. strings.survivors)
"(This effect is applied to all " .. string.survivors .. ")"
(This effect is applied to all survivors)


b, i

  • b(text) - Wraps the text with a triple of apostrophes making text bold.
  • i(text) - Wraps the text with a pair of apostrophes making text with italic style.
    • text - [Mandatory] String that are to be wrapped with apostrophes.
Example(s)
b("Bold text")
'''Bold text'''
Bold text
i("Italic text")
''Italic text''
Italic text

join

  • join(...) - Concatenates passed parameters with separator that is either passed as last parameter, or if passed table the second parameter is used as spearator or can be skipped at all to use default ", " separator.
    • ..., sep - [Mandatory] Strings that are to be joined together by separator (string), being last parameter
    • {...}, sep - [Mandatory] Strings encapsulated as a table that are to be joined together by separator (string), being second parameter (table of strings is considered as a one parameter)
Example(s)
join("Hello", "cruel", "world.", " - ")
Hello - cruel - world.
Hello - cruel - world.
join({"Hello", "cruel", "world."}, ";")
Hello;cruel;world.
Hello;cruel;world.
join({"First action", "Second action", "Thrid action"})
Hello, cruel, world.
First action, Second action, Thrid action.

the

  • the(alter, spaceless) - Function for evaluating the article before the object it is inserted in front of. This function is mainly used on non-English wikis as their rules for articles differ.
    • alter - [Mandatory/Optional] Object with the help of which the article is evaluated.
    • spaceless - [Optional] Flag indicating whether to append a space after the article.
Example(s)
the(killer) The Trapper

ptb

  • ptb(content, title, patch) - Wraps the content into a stylised box indicating that the content inside contains changes that are not on live server, resp. are on PTB.
    • content - [Mandatory] String/Content to be wrapped
    • title - [Optional] If title is passed it will appear above the box describing further details about the changed content
    • patch - [Optional] If patch parameter is passed the PTB Box will evaluate whether the patch is live. If so it won't show the box at all, otherwise the PTB Box will be rendered as usual. Patch list is stored in Module:Datatable
Example(s)
ptb("Changed values from upcoming patch")
{{ptb|Changed values from upcoming patch}}
Changed values from upcoming patch
ptb("Changed values from upcoming patch", "This change is aprt of patch x.y.z")
{{ptb|Changed values from upcoming patch|This change is aprt of patch x.y.z}}
This change is aprt of patch x.y.z
Changed values from upcoming patch
ptb("Changed values from upcoming patch", "This change is aprt of patch x.y.z", "6.0.0")
{{ptb|Changed values from upcoming patch|This change is aprt of patch x.y.z|6.0.0}}
Lua error in Module:Utils at line 1011: attempt to index global 'types' (a nil value).
ptb("Changed values from upcoming patch", "This change is aprt of patch x.y.z", "99.99.99")
{{ptb|Changed values from upcoming patch|This change is aprt of patch x.y.z|99.99.99}}
This change is aprt of patch x.y.z
Changed values from upcoming patch




*Most funtions are only emulated as they don't have a hook to be used directly from wiki. The purpose of these functions is mainly to ease the work with strings in LUA/Scribunto and keep better clarity in strings to see actual content with minimum of escaping characters, etc.


--DO NOT CHANGE
bar = "&#124;" -- code for |
br = "<br>" --break
brnl = "<br>\n" --break new line
space = " "
dot = "."
comma = ", "
colon = ":"
bullet = "\n* " --deprecated, do not use!
nbullet = "*" --newBullet -> please use this version, the old will be removed eventually
dbullet = "\n** " --deprecated
ndbullet = "**"
nl = "\n" --new line
dnl = "\n\n" -- double new line
tnl = "\n\n\n" --tripple new line
nlp = "\n<p>" --new line paragraph
pg = "<p>" --paragraph
ntl = "|-" -- new table line
hl = "! " -- header line
tl = "|" --table line
dtl = "||" -- double table line

--common strings
cstr = {
	file = "File:", --[[File: ...]]
	media = "Media:",
	empty = "",
	the = "The",
	contact = "Please Contact [[User:Jouki|Jouki]]",
	
	--File Formats
	ogg = 'ogg',
	mp3 = 'mp3',
	mp4 = 'mp4',
	jpg = 'jpg',
	jpeg= 'jpeg',
	png = 'png',
	gif = 'gif',
}

--iconLinkStrings
ils = {
	-- Interaction
	baseHooks		= "Basement Hooks",
	blastMines		= "Blast Mines",
	bWall			= "Breakable Wall",
	bWalls			= "Breakable Walls",
	boonTotem		= "Boon Totem",
	chest			= "Chest",
	chests			= "Chests",
	dullTotem		= "Dull Totem",
	eMedkit			= "Emergency Med-Kit",
	exitGate		= "Exit Gate",
	exitGates		= "Exit Gates",
	eGateSwitches	= "Exit Gate Switches",
	failedSChecks	= "Failed Skill Checks",
	firecrackers	= "Firecrackers",
	flashlights		= "Flashlights",
	flashbangs		= "Flashbangs",
	flashGrenade	= "Flash Grenade",
	gen				= "Generator",
	gens			= "Generators",
	gSkillCheck		= "Good Skill Check",
	gSkillChecks	= "Good Skill Checks",
	hatch			= "Hatch",
	hexTotem		= "Hex Totem",
	hexTotems		= "Hex Totems",
	hook			= "Hook",
	hooks			= "Hooks",
	item			= "Item",
	items			= "Items",
	locker			= "Locker",
	lockers			= "Lockers",
	map				= "Map",
	medkit			= "Med-Kit",
	medkits			= "Med-Kits",
	pallet			= "Pallet",
	pallets			= "Pallets",
	survivor		= "Survivor",
	survivors		= "Survivors",
	skillCheck		= "Skill Check",
	skillChecks		= "Skill Checks",
	toolbox			= "Toolbox",
	totem			= "Totem",
	totems			= "Totems",
	greatSCheck		= "Great Skill Check",
	greatSChecks	= "Great Skill Checks",
	window			= "Window",
	windows			= "Windows",
	
	-- UI (Status Effects, Auras)
	adrenaline		= "Adrenaline",
	aura			= "Aura",
	auras			= "Auras",
	bleeding		= "Bleeding",
	blindness		= "Blindness",
	bloodlust		= "Bloodlust",
	broken			= "Broken",
	cursed			= "Cursed",
	deepWound		= "Deep Wound",
	endurance		= "Endurance",
	exhausted		= "Exhausted",
	exhaustion		= "Exhaustion",
	exposed			= "Exposed",
	haemorrhage		= "Haemorrhage",
	haste			= "Haste",
	hindered		= "Hindered",
	incapacitated	= "Incapacitated",
	luck			= "Luck",
	mangled			= "Mangled",
	obsession		= "Obsession",
	oblivious		= "Oblivious",
	undetectable	= "Undetectable",
	
	-- Killers
	killer			= "Killer",
	nightmare		= "Nightmare",
	
	-- Misc.
	addon			= "Add-on",
	altruism		= "Altruism",
	basement		= "Basement",
	bloodpoints		= "Bloodpoints",
	crows			= "Crows",
	devious			= "Deviousness",
	dyingState		= "Dying State",
	entity			= "Entity",
	healthState		= "Health State",
	healthy			= "Healthy",
	hunter			= "Hunter",
	injuredState    = "Injured State",
	poolsBlood		= "Pools of Blood",
	scratchMarks	= "Scratch Marks",
	stillCrows      = "Stillness Crows",
	terrorRadius	= "Terror Radius",
}

function clr(color, text)
	local utils = require("Module:Utils")
	return utils.clr(text, color)
end

function bclr(color, text)
	local utils = require("Module:Utils")
	return b(utils.clr(text, color))
end

function iclr(color, text)
	local utils = require("Module:Utils")
	return i(utils.clr(text, color))
end

function link(text)
	return '[[' .. text .. ']]'
end

function brackets(text)
	return '(' .. text .. ')'
end

--bold function
function b(text)
	return "'''" .. text .. "'''"
end

--italic function
function i(text)
	return "''" .. text .. "''"
end

function the(alter)
	return (type(alter) == "table" and alter.the) or alter or cstr.the
end