This repository has been archived by the owner on Mar 2, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 48
Auto-select #23
Comments
Thanks, that should do. |
Alright.. when having 2 of those in one menu only 1 will work.. or am I doing something wrong here?
|
Yeah you are doing something wrong, you have two times the same variables "dish" change the name of the second one or add "local" in front of the var |
local food = {
"Hamburger",
"Chicken Nuggets",
"Bread",
}
local drink = {
"Coca-Cola",
"Ice-Tea",
"Sprite",
}
local foodItem = NativeUI.CreateListItem("Food", food, 1)
local drinkItem = NativeUI.CreateListItem("Drink", drink, 1)
menu:AddItem(foodItem)
menu:AddItem(drinkItem)
menu.OnListChange = function(sender, item, index)
if item == foodItem then
dish = item:IndexToItem(index)
ShowNotification("foodItem ~b~" .. dish .. "~w~...")
elseif item == drinkItem then
dish = item:IndexToItem(index)
ShowNotification("drinkItem ~b~" .. dish .. "~w~...")
end
end Sorry for the late response... if you issue is solved, you can close this. 👍 |
Solved ?? |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Is there a way to not auto-instant-select the item when changing an menu.OnListChange?
Like make you able to first scroll through the options and then hit enter to select one?
Im sorry for opening an issue for this.
The text was updated successfully, but these errors were encountered: