Forged Alliance Forever Forged Alliance Forever Forums 2016-07-23T13:53:10+02:00 /feed.php?f=41&t=12785 2016-07-23T13:53:10+02:00 2016-07-23T13:53:10+02:00 /viewtopic.php?t=12785&p=131081#p131081 <![CDATA[Re: Lazy Evaluation: Circular Dependency]]> I also found the same answer in the webarchives: http://web.archive.org/web/201310051321 ... php?t=9184

It told me the same.
It's a shame that 90% of the links present on that website are not archived.

Thanks anyway!

Lots of love,
Jip

Statistics: Posted by Jip — 23 Jul 2016, 13:53


]]>
2016-07-23T04:30:31+02:00 2016-07-23T04:30:31+02:00 /viewtopic.php?t=12785&p=131055#p131055 <![CDATA[Re: Lazy Evaluation: Circular Dependency]]>
It's something like this: if you dont specify left and width, it tries to work out the width from the left and right. However since there is no right it tries to work that out form the left and width. And then it realizes it is doing something stupid (detecting in a circle) and gives the error.

Statistics: Posted by nine2 — 23 Jul 2016, 04:30


]]>
2016-07-23T02:33:37+02:00 2016-07-23T02:33:37+02:00 /viewtopic.php?t=12785&p=131053#p131053 <![CDATA[Lazy Evaluation: Circular Dependency]]>
It appears to be a not-critical bug, however, when making my UI mod I keep getting the following errors:
Code:
WARNING: Evaluating LazyVar failed: error evaluating lazy variable: ... alliance\gamedata\mohodata.scd\lua\maui\control.lua(37): error evaluating lazy variable: ... alliance\gamedata\mohodata.scd\lua\maui\control.lua(35): circular dependency in lazy evaluation for variable set from:
         stack traceback:
            ...orged alliance\gamedata\mohodata.scd\lua\lazyvar.lua(64): in function `SetFunction'
            ...orged alliance\gamedata\mohodata.scd\lua\lazyvar.lua(95): in function `Set'
            ... alliance\gamedata\mohodata.scd\lua\maui\control.lua(37): in function `ResetLayout'
            ...d alliance\gamedata\mohodata.scd\lua\maui\bitmap.lua(68): in function `ResetLayout'
            ... alliance\gamedata\mohodata.scd\lua\maui\control.lua(43): in function `OnInit'
            ...d alliance\gamedata\mohodata.scd\lua\maui\bitmap.lua(74): in function <...d alliance\gamedata\mohodata.scd\lua\maui\bitmap.lua:73>
            [C]: in function `InternalCreateBitmap'
            ...d alliance\gamedata\mohodata.scd\lua\maui\bitmap.lua(35): in function `__init'
            ...d alliance\gamedata\mohodata.scd\lua\maui\button.lua(9): in function `initfn'
            ... alliance\gamedata\mohodata.scd\lua\system\class.lua(258): in function <... alliance\gamedata\mohodata.scd\lua\system\class.lua:246>
            ...rselection\modules\helpmodules\helpuserinterface.lua(27): in function `CreateButton'
            ...rselection\modules\helpmodules\helpfilterbuttons.lua(19): in function `CreateFilterButton'
            ...iance\mods\filterselection\modules\userinterface.lua(8): in function `CreateUI'
            ...d alliance\gamedata\lua.scd\lua\ui\game\gamemain.lua(721): in function <...d alliance\gamedata\lua.scd\lua\ui\game\gamemain.lua:717>
            ...d alliance\gamedata\lua.scd\lua\ui\game\gamemain.lua(738): in function `CreateUI'
            ...d alliance\gamedata\lua.scd\lua\ui\game\gamemain.lua(322): in function <...d alliance\gamedata\lua.scd\lua\ui\game\gamemain.lua:316>

And I got no clue why. The files mentioned are:

Userinterface:
Code:
local helpFilter = import("/Mods/FilterSelection/Modules/HelpModules/HelpFilterButtons.lua")
local LayoutHelpers = import('/lua/maui/layouthelpers.lua')



function CreateUI(parent)

   local a = helpFilter.CreateFilterButton(parent, "land", true)
   --LayoutHelpers.AtRightTopIn(a, parent, 200 , 200)

end


Helpuserinterface:
Code:
local UIUtil = import('/lua/ui/uiutil.lua')
local Bitmap = import('/lua/maui/bitmap.lua').Bitmap
local Button = import('/lua/maui/button.lua').Button

-- Creates a bitmap.
-- parent: The UI element that is the parent of this UI element. Position is relative to the UI element.
-- normal: The path to the normal icon of this bitmap.
function CreateBitmap(parent, normal)

   LOG("Helpuserinterface: Bitmap path: " .. normal)

   bit = Bitmap(parent)
   bit:SetTexture(RetrieveIcon(normal))

   return bit

end

-- Creates a button.
-- parent: The UI element that is parent of this UI element. Position is relative to the parent.
-- normal: The way the button looks generally.
-- hover: The way the button looks when the mouse is over it.
-- down: the way the button looks when clicked.
-- up: the way the button looks right after clicking and right before going back to the normal / hover state.
function CreateButton(parent, normal, hover, down, up)

   button = Button(parent, RetrieveIcon(normal), RetrieveIcon(hover), RetrieveIcon(down), RetrieveIcon(up) )
   return button

end

-- Retrieves the actual icon from the path.
function RetrieveIcon(iconpath)

    if DiskGetFileInfo(iconpath) == false then
       LOG("Helpuserinterface: Can't find icon in path: " .. iconpath)
        iconpath = '/textures/ui/common/icons/units/default_icon.dds'
    end

    icon = UIUtil.UIFile(iconpath)
    return icon

end


Helpfilterbuttons:
Code:
local helpUI = import("/Mods/FilterSelection/Modules/HelpModules/HelpUserinterface.lua")
local helpTex = import("/Mods/FilterSelection/Modules/HelpModules/HelpTexture.lua")

function CreateFilterButton(parent, iconname, multipleicons)

   local normal, hover, down, up

   if multipleicons then
      normal, hover, down, up = helpTex.GetPathMultipleIcons(iconname)
   else
      normal = helpTex.GetPathIcon(iconname)
      hover = normal
      down = normal
      up = normal
   end

   LOG("We got here!")

   local UIGroup = helpUI.CreateButton(parent, hover, hover, down, up)
   UIGroup.Depth:Set(42)
   UIGroup.Width:Set(34)
   UIGroup.Height:Set(34)

   UIGroup.Neutral = helpUI.CreateBitmap(UIGroup, helpTex.textureNeutral)
   UIGroup.FilterOut = helpUI.CreateBitmap(UIGroup, helpTex.textureFilterOut)
   UIGroup.FilterIn = helpUI.CreateBitmap(UIGroup, helpTex.textureFilterIn)
   UIGroup.Active = false

      UIGroup.OnHide = function (self, hidden)
         if hidden then
            UIGroup.Neutral:Hide()
            UIGroup.FilterOut:Hide()
            UIGroup.FilterIn:Hide()
         else
            if not UIGroup.Active then
               UIGroup.Neutral:Show()
            else
               --UIGroup[tostring(import("/Mods/FilterSelection/Modules/Functionality.lua").functionality)]:Show()
            end
         end

         return true
      end

   return UIGroup
end


Now -before I started redoing a lot of my code it all worked fine.
And, the errors do not make Supreme crash.
However, the bitmaps are not shown (only the button is).

Does anyone have any idea about what could be causing this?

Lots of love,
Jip

Statistics: Posted by Jip — 23 Jul 2016, 02:33


]]>