qualified name for category dropdown

This commit is contained in:
Simon Hirsig
2015-09-30 11:46:43 +02:00
parent e99d09e8ce
commit 04ab7b3174
+16 -8
View File
@@ -340,7 +340,7 @@ function AuxBuyCategoryDropDown_Initialize(arg1)
hasArrow = GetAuctionItemSubClasses(value.class), hasArrow = GetAuctionItemSubClasses(value.class),
text = class, text = class,
value = value, value = value,
func = AuxBuyCategoryDropDown_OnClick(class, value), func = AuxBuyCategoryDropDown_OnClick,
}, 1) }, 1)
end end
end end
@@ -353,7 +353,7 @@ function AuxBuyCategoryDropDown_Initialize(arg1)
hasArrow = GetAuctionInvTypes(value.class, value.subclass), hasArrow = GetAuctionInvTypes(value.class, value.subclass),
text = subclass, text = subclass,
value = value, value = value,
func = AuxBuyCategoryDropDown_OnClick(subclass, value), func = AuxBuyCategoryDropDown_OnClick,
}, 2) }, 2)
end end
end end
@@ -366,18 +366,26 @@ function AuxBuyCategoryDropDown_Initialize(arg1)
UIDropDownMenu_AddButton({ UIDropDownMenu_AddButton({
text = slot_name, text = slot_name,
value = value, value = value,
func = AuxBuyCategoryDropDown_OnClick(slot_name, value), func = AuxBuyCategoryDropDown_OnClick,
}, 3) }, 3)
end end
end end
end end
function AuxBuyCategoryDropDown_OnClick(text, value) function AuxBuyCategoryDropDown_OnClick()
return function() local qualified_name = ({ GetAuctionItemClasses() })[this.value.class]
UIDropDownMenu_SetSelectedValue(AuxBuyCategoryDropDown, value) if this.value.subclass then
UIDropDownMenu_SetText(text, AuxBuyCategoryDropDown) -- shouldn't be necessary ... local subclass_name = ({ GetAuctionItemSubclasses(this.value.class) })[this.value.subclass]
CloseDropDownMenus(1) -- nor this qualified_name = qualified_name .. ' - ' .. subclass_name
if this.value.slot then
local slot_name = getglobal(({ GetAuctionInvTypes(this.value.class, this.value.subclass) })[this.value.slot])
qualified_name = qualified_name .. ' - ' .. slot_name
end
end end
UIDropDownMenu_SetSelectedValue(AuxBuyCategoryDropDown, this.value)
UIDropDownMenu_SetText(qualified_name, AuxBuyCategoryDropDown)
CloseDropDownMenus(1)
end end
function AuxBuySlotDropDown_Initialize(arg1) function AuxBuySlotDropDown_Initialize(arg1)