Module:ScriptItem: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 772: Line 772:
return args.name
return args.name
end
end
end
function p.getTypeRgb()
return '#009106'
end
function p.getNameRgb()
return '#0645ad'
end
end


function p.getDisplayedNameColoured(frame)
function p.getDisplayedNameColoured(frame)
local typeRgb = '#009106'
local typeRgb = p.getTypeRgb()
local nameRgb = '#0645ad'
local nameRgb = p.getNameRgb()
local args = p.getArgs(frame)
local args = p.getArgs(frame)
if p.isOOP(frame) then
if p.isOOP(frame) then
Line 908: Line 916:
text1 = 'Methods use the dot "." operator in JS and Squirrel, or the colon operator ":" in Lua.'
text1 = 'Methods use the dot "." operator in JS and Squirrel, or the colon operator ":" in Lua.'
end
end
rows[1] = { "<span style=\"font-family: 'Source Code Pro', monospace;\">"..parts[1].."</span>", "Object", "Userdata type in Lua and Squirrel, or Object type in JS." }
rows[1] = { "<span style=\"font-family: 'Source Code Pro', monospace; color: "..p.getTypeRgb()..";\">"..parts[1].."</span>", "Object", "Userdata type in Lua and Squirrel, or Object type in JS." }
rows[2] = { "<span style=\"font-family: 'Source Code Pro', monospace;\">"..parts[2].."</span>", p.properCase(args.type), text1 }
rows[2] = { "<span style=\"font-family: 'Source Code Pro', monospace; color: "..p.getNameRgb()..";\">"..parts[2].."</span>", p.properCase(args.type), text1 }
end
end
if #rows > 0 then
if #rows > 0 then
6,833

edits