Module:Constants: Difference between revisions

Added the coloring aspect of the getModifier thing
(Created page with p.getModifierText)
 
(Added the coloring aspect of the getModifier thing)
Line 3: Line 3:
local ConstantData = mw.loadData('Module:Constants/data')
local ConstantData = mw.loadData('Module:Constants/data')


--Just hardcoding these because I guess that's where we're at
local modifierTypes = {
local modifierTypes = {
   ["increasedGlobalAccuracy"] = { text =  "+{V}% Global Accuracy", },
   ["increasedGlobalAccuracy"] = { text =  "+{V}% Global Accuracy", },
Line 187: Line 188:
     result = string.gsub(result, '{VMS}', value / 1000)
     result = string.gsub(result, '{VMS}', value / 1000)
     result = string.gsub(result, '{VX}', value * 10)
     result = string.gsub(result, '{VX}', value * 10)
  end
  if doColor then
    if template.isNegative ~= nil and template.isNegative then
      result = '<span color="red">'..result..'</span>'
    else
      result = '<span color="green">'..result..'</span>'
    end
   end
   end