thisdp/dgs

dgsDxGridListGetSelectedItem returns even if nothing selected

ImSkully opened this issue · 1 comments

dgsDxGridListGetSelectedItem is used to get the value of a selected item in grid list, but even if nothing is selected, it returns a value.

Example:

local myItem = dgsDxGridListGetSelectedItem(gridList)

if (myItem) then -- It will always be this
     outputDebugString("Something was selected.", 3)
else
    outputDebugString("Nothing is selected.", 3)
end

So you cannot check if a player did not select anything yet.

If nothing selected, it returns -1. just as guiGridListGetSelectedItem.