Statistics: Posted by Jip — 23 Jul 2016, 13:53
Statistics: Posted by nine2 — 23 Jul 2016, 04:30
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>
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
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
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
Statistics: Posted by Jip — 23 Jul 2016, 02:33