View Single Post
10-08-18, 07:53 PM   #3
cosmabgd
A Murloc Raider
Join Date: Oct 2018
Posts: 6
Hello. thank you for your suggestion to find the bugs . i get some bugs after 1 hour of playing but i don't think the problem with the dropmenu is from this error :
"
22x TauntMaster2\Gui\TauntMasterGUI.lua:183: attempt to index local 'powerColor' (a nil value)
TauntMaster2\Gui\TauntMasterGUI.lua:183: in function `TauntMasterGUI_UnitFrames_ResetPowerBar'
TauntMaster2\Gui\TauntMasterGUI.lua:195: in function `TauntMasterGUI_UnitFrames_ResetUnitButton'
TauntMaster2\Gui\TauntMasterGUI.lua:57: in function `handler'
TauntMaster2\Gui\TauntMasterGUI.lua:290: in function <TauntMaster2\Gui\TauntMasterGUI.lua:283>

Locals:
InCombatSkipped"


I think my problem is here :

"function Left_Spell_initialize(self,level)
local info
local tm2numTabs = GetNumSpellTabs()

for BookTabs = 1,tm2numTabs do
local name,texture,offset,numSpells = GetSpellTabInfo(BookTabs)

local currentSpec = GetSpecialization()
local currentSpecName = currentSpec and select(2, GetSpecializationInfo(currentSpec)) or select(1, UnitClass("player"))

if BookTabs == 1 or name == currentSpecName then
if level == 1 then
info = UIDropDownMenu_CreateInfo()
info.text = (name .. " Submenu")
info.value = name
info.isTitle = true
info.hasArrow = true
UIDropDownMenu_AddButton(info, level)
end
end
--print("Spell tab \"" .. name .. "\" contains spells from id " .. offset + 1 .. " through " .. offset + numSpells)
for BookSpells = offset + 1,offset + numSpells do
--TauntMaster2.db.char.Spellbook[name] = TauntMaster2.db.char.Spellbook[name] or {}

local skillName = GetSpellBookItemName(BookSpells, "spell")

if BookTabs <=5 then
if (IsAttackSpell(BookSpells, "spell")) then
--print(tmpspellid , skillName )
end
end
if ((IsHarmfulSpell(BookSpells, "spell") or IsHelpfulSpell(BookSpells, "spell")) and not (IsPassiveSpell(BookSpells, "spell"))) or (IsAttackSpell(BookSpells, "spell")) then

if (IsSpellKnown(select(7, GetSpellInfo(BookSpells, "spell"))) ) then
if level == 2 and UIDROPDOWNMENU_MENU_VALUE == name then
info = UIDropDownMenu_CreateInfo()
info.text = skillName

if info.text == TauntMaster2.db.char.Spells[TauntMaster2.db.char.id]["LeftButton"] then
info.checked = true
else
info.checked = false
end
function info.func(button)
TauntMaster2.db.char.Spells[TauntMaster2.db.char.id]["LeftButton"] = skillName
UIDropDownMenu_SetText(LeftButtonDropDown, TauntMaster2.db.char.Spells[TauntMaster2.db.char.id]["LeftButton"])
--TauntMasterUnitFrames_Header.Spell1:SetTexture(select(3, GetSpellInfo(TauntMaster2.db.char.Spells[TauntMaster2.db.char.id]["LeftButton"])))
print(TauntMaster2.db.char.Spells[TauntMaster2.db.char.id]["LeftButton"] )
print(button)
end
UIDropDownMenu_AddButton(info, level)
end

end
--UIDropDownMenu_AddButton(info, name)
end

end

end

local numAccountMacros, numCharacterMacros = GetNumMacros()
if level == 1 then
info = UIDropDownMenu_CreateInfo()
info.text = ("Account Macros Submenu")
info.value = "Account Macros"
info.isTitle = true
info.hasArrow = true
UIDropDownMenu_AddButton(info, level)

info = UIDropDownMenu_CreateInfo()
info.text = ("CharacterMacros Submenu")
info.value = "CharacterMacros"
info.isTitle = true
info.hasArrow = true
UIDropDownMenu_AddButton(info, level)

end

for MacroInfo =1,numAccountMacros do
local name = select(1,GetMacroInfo(MacroInfo) )
if level == 2 and UIDROPDOWNMENU_MENU_VALUE == "Account Macros" then
info = UIDropDownMenu_CreateInfo()
info.text = name
info.isTitle = true
if info.text == TauntMaster2.db.char.Spells[TauntMaster2.db.char.id]["LeftButton"] then
info.checked = true
else
info.checked = false
end
function info.func(button)
TauntMaster2.db.char.Spells[TauntMaster2.db.char.id]["LeftButton"] = name
UIDropDownMenu_SetText(LeftButtonDropDown, TauntMaster2.db.char.Spells[TauntMaster2.db.char.id]["LeftButton"])
--TauntMasterUnitFrames_Header.Spell1:SetTexture(select(3, GetSpellInfo(TauntMaster2.db.char.Spells[TauntMaster2.db.char.id]["LeftButton"])))
print(TauntMaster2.db.char.Spells[TauntMaster2.db.char.id]["LeftButton"] )
print(button)
end
UIDropDownMenu_AddButton(info, level)
end
end


for i =1, numCharacterMacros do
local cname = select(1,GetMacroInfo(MAX_ACCOUNT_MACROS +i ) )
if level == 2 and UIDROPDOWNMENU_MENU_VALUE == "CharacterMacros" then
info = UIDropDownMenu_CreateInfo()
info.text = cname
info.isTitle = true
if info.text == TauntMaster2.db.char.Spells[TauntMaster2.db.char.id]["LeftButton"] then
info.checked = true
else
info.checked = false
end
function info.func(button)
TauntMaster2.db.char.Spells[TauntMaster2.db.char.id]["LeftButton"] = cname
UIDropDownMenu_SetText(LeftButtonDropDown, TauntMaster2.db.char.Spells[TauntMaster2.db.char.id]["LeftButton"])
end
UIDropDownMenu_AddButton(info, level)
end
end



end
"

all that getspell
Attached Files
File Type: lua TauntMasterGUI.lua (16.6 KB, 104 views)
File Type: lua TauntMasterConfig.lua (12.7 KB, 103 views)
File Type: lua TauntMaster2.lua (6.7 KB, 89 views)
  Reply With Quote