You can always call the "widget" functions of LAM controls directly in your lua code to e.g. create a LAM dropdown or checkbox somewhere else, not in a LAM panel, afaik, using the function that the widget uses itsself:
But I'm not sure if this will work for all controls of LAM. You'd have to test this.
I guess it would work though.
At the bottom of each widget lua file you will find the name of the control that is created, e.g. for a slider
Code:
LAMCreateControl.slider(container, data, name)
Similar for a submenu then:
Code:
function LAMCreateControl.submenu(parent, submenuData, controlName)
The function returns the created container of the control then.
Edit:
You need to get the rank of a guildMemberIndex
and then check if the rank got a guildmaster.
IsGuildRankGuildMaster(guildId, guildRank)
Here is an example code, !!!untested!!!
Lua Code:
--returns nilable:String nameofGuildMaster, nilable:number memberIndexOfGuildMaster
local function getGuildMasterData(guildId)
local isPlayerGuildMaster = IsPlayerGuildMaster(guildId)
---Player is not guild master, so search the guild master
if not isPlayerGuildMaster then
local numGuildMembers = GetNumGuildMembers(guildId)
for memberIndex=1, numGuildMembers, 1 do
--- @return name string, note string, rankIndex luaindex, playerStatus [PlayerStatus|#PlayerStatus], secsSinceLogoff integer
--->Hint: Not sure if name is the character name or the @displayName (account) here, so test this and use accoridngly to your needs
local name, _, rankIndex = GetGuildMemberInfo(guildId, memberIndex)
if rankIndex ~= nil then
local isGuildMemberRankGuildMaster = IsGuildRankGuildMaster(guildId, rankIndex)
if isGuildMemberRankGuildMaster == true then return name, memberIndex end
end
end
else
--Player is guild master
local accountName = GetDisplayName()
local memberIndex = GetGuildMemberIndexFromDisplayName(guildId, accountName)
if memberIndex ~= nil then
return accountName, memberIndex
end
end
return nil, nil
end