Module:MOS mode degrees: Difference between revisions

Ganaram inukshuk (talk | contribs)
bugfixing default name use
Ganaram inukshuk (talk | contribs)
No edit summary
Line 55: Line 55:
local input_mos = input_mos or mos.new(5, 2)
local input_mos = input_mos or mos.new(5, 2)
local mos_prefix = mos_prefix or "mos"
local mos_prefix = mos_prefix or "mos"
-- If default mode names are to be used, they'll overwrite whatever mode names are passed in, even if there aren't any
local mode_names = mode_names or nil
local mode_names = mode_names or nil
local use_default_mode_names = use_default_mode_names == true
local use_default_mode_names = use_default_mode_names == true
Line 137: Line 139:
-- Add mode names if present
-- Add mode names if present
local mode_names_given = mode_names ~= nil and #mode_names == #step_patterns
local mode_names_given = (mode_names ~= nil and #mode_names == #step_patterns) or use_default_mode_names
if mode_names_given then
if mode_names_given then
result = result .. " !! rowspan=\"2\" class=\"unsortable\" | Mode names"
result = result .. " !! rowspan=\"2\" class=\"unsortable\" | Mode names"
Line 163: Line 165:
-- Add mode name if given
-- Add mode name if given
if mode_names_given then
if mode_names_given then
if use_default_mode_names then
result = result .. string.format(" || %s", mode_names[i])
result = result .. string.format(" || %s %s", scale_sig, udps[i])
else
result = result .. string.format(" || %s", mode_names[i])
end
end
end