OpenMods / OpenPeripheral-Addons

An addon for OpenPeripheral, adding physical blocks and items to the game
MIT License
11 stars 10 forks source link

Added "Item Selector" peripheral #47

Closed davenonymous closed 9 years ago

davenonymous commented 9 years ago

Screenshot: http://dave.thrawn.de/instant/screens/2015-01-26_11.45.24.png

What you see in the screenshot is a computer randomly showing items from the chest on the screens.

The peripheral allows displaying items in 1, 4 or 9 slots of the monitor area. These can be set via lua (setSlot() or setSlots()), read out via getItemDetail() or interacted with in the GUI of the block itself. The items in the slots do not really exist, i.e. they cannot get pulled out and they don't use up an item when clicking them with an item stack. If a player clicks on one of the items on the display an event is being triggered on the computer "slot_click" passing along the slot number.

This system allows for a variety of different usages from buttons, to simple item selectors and recipe-displays up to games like tic tac toe.

davenonymous commented 9 years ago

Oh, this Pull Request requires the PR on OpenModsLib as well.