Module:ScriptItem: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 838: Line 838:
line1 = line1.."globally."
line1 = line1.."globally."
elseif args.type == 'property' or args.type == 'method' then
elseif args.type == 'property' or args.type == 'method' then
line1 = line1.."via OO."
line1 = line1.."via OOP."
elseif args.type == 'event' then
elseif args.type == 'event' then
line1 = line1.."via the observer pattern. [https://wiki.gtaconnected.com/HowTo/Events Read more.]"
line1 = line1.."via the observer pattern. [https://wiki.gtaconnected.com/HowTo/Events Read more.]"
Line 862: Line 862:
if args.type ~= 'event' then
if args.type ~= 'event' then
local baseTypeLower = baseType:lower()
local baseTypeLower = baseType:lower()
local allTypes = derivedTypes[baseTypeLower] and derivedTypes[baseTypeLower] or { baseType }
local allTypes = p.copyTable(derivedTypes[baseTypeLower] and derivedTypes[baseTypeLower] or { baseType })
local types = p.copyTable(allTypes)
local types = {}
table.insert(types, baseType)
for i,type in ipairs(allTypes) do
for i,type in ipairs(types) do
types[i] = type
types[i] = type
end
end
p.sortTable(types)
p.sortTable(types)
for i,type in ipairs(types) do
for i,type in ipairs(types) do
types[i] = "{{Side|"..getTypeSide(type).."=1}} "..type
types[i] = p.loadTemplate(frame, 'Side', {[getTypeSide(type)]='1'})..type
end
end
table.insert(out, table.concat(types, "<br>"))
table.insert(out, table.concat(types, "<br>"))
6,834

edits