Adding alpha to color picker causes error #2


  • New
  • Defect
Open
Assigned to ckknight
  • Seerah1 created this issue Nov 3, 2008

    What steps will reproduce the problem?
    Take a color picker option that works perfectly fine without alpha.  Then change hasAlpha from false to true, and add defaultA and currentA to the array.

    What is the expected output? What do you see instead?
    Expected: there to be an alpha slider in the color picker, with the default/current values set
    Instead: the color picker does not display in the options window, and an error is generated (below)

    What version of the product are you using?
    r41  (WoW-3.0-release-2)

    Do you have an error log of what happened?
    [2008/11/03 22:20:15-1204-x1]: LibSimpleOptions-1.0-90039 (PocketPlot):911: attempt to perform arithmetic on local 'currentA' (a nil value)
    PocketPlot-2.0\pocketplot.lua:181: in function <Interface\AddOns\PocketPlot\pocketplot.lua:165>
    PocketPlot-2.0\pocketplot.lua:221: in function `controlCreationFunc'
    LibSimpleOptions-1.0-90039 (PocketPlot):101: in function <...face\AddOns\PocketPlot\libs\LibSimpleOptions-1.0.lua:99>
    <in C code>: in function `Show'
    Interface\FrameXML\UIOptionsFrame.lua:204: in function `InterfaceOptionsFrame_Show':
    Interface\FrameXML\UIOptionsFrame.lua:484: in function `InterfaceOptionsFrame_OpenToCategory':
    LibSimpleOptions-1.0-90039 (PocketPlot):946: in function `value'
    Interface\FrameXML\ChatFrame.lua:3212: in function `ChatEdit_ParseText':
    Interface\FrameXML\ChatFrame.lua:2911: in function `ChatEdit_SendText':
    Interface\FrameXML\ChatFrame.lua:2932: in function `ChatEdit_OnEnterPressed':
    <string>:"*:OnEnterPressed":1: in function <[string "*:OnEnterPressed"]:1>

    Please provide any additional information below.

  • Seerah1 added the tags New Defect Nov 3, 2008
  • _ForgeUser551077 posted a comment Mar 17, 2009

    The error is caused by two typos in "LibSimpleOptions-1.0.lua":

    Line 864:
    currentR = args.currentA

    change to:
    currentA = args.currentA

    Line 911:
    g = currentB,
    b = currentG,

    change to:
    g = currentG,
    b = currentB,

  • Forge_User_19205249 posted a comment Jan 17, 2010

    Also on line 740 change the end from: "hasAlpha and 1 - previousValues.opacity or 1"

    to: "1 - previousValues.opacity"

    This will prevent the opacity being changed to 1 when the cancel or esc button is pressed.

    Regards,

    Zas


    Edited Jan 17, 2010

To post a comment, please login or register a new account.