Is there a preferred button/gui api for opencomputers?

  • Please make sure you are posting in the correct place. Server ads go here and modpack bugs go here

Starfang42

New Member
Jul 29, 2019
189
0
0
I know there's the port of direwolf20's CC button api, and I'm looking through the apis on the oc forums, but I was wondering if you guys have a preferred api.

I probably don't need more than buttons for my current project, but that doesn't necessarily mean I won't be interested in other features.
 

Henry Link

Popular Member
Dec 23, 2012
2,601
553
128
USA - East Coast
I'm sort of interested in this as well. I've been a heavy CC player. But the few times I've tried OC I've been more than frustrated with the different API. So far I'm not liking how they handled bundled redstone. CC was much cleaner and easier to work with.
 

Starfang42

New Member
Jul 29, 2019
189
0
0
OC's bundled redstone seems simple enough to me. Then again, I am a programmer with a masters in CompSci, so maybe my idea of simple is skewed?

Anyways, after looking around for a bit, I found there really aren't that many options. You basically have:
Direwolf20's Button API, ported (link): Rather simple. It draws the buttons, it'll change their color based on their active status, and it has a function to check if a button was clicked and call the button's function.

dustpuppy's GUI (link): It kinda reminds me of DOS-era guis. That said, decent amount of features. Labels, checkboxes, buttons, progress bars, lists, other stuff. It seems like it only supports one group of radio buttons, which is a bit odd. Most of it's reasonably well documented in the code, though there's little to no documentation about the chart stuff. Also seems to have no good way to move elements

kevinkk525's GUI (link): Looks powerful. Poorly documented, though. Most of the meat for functionality is in the shapes_default file. I may do a longer writeup on this. Notable features I've found so far:
Items: Box, label, box with a label, list (with scrolling?), textbox.
Manipulate: You can move, resize, even change the "layer" of an item. get and set the click and scroll functions. Likely more. A lot of the default functionality is in a function called connect_functions. Some item-specific functionality is in the new item function for that item.
New Shapes: Finally, it looks like the entire thing was set up to make it easier for someone to add their own shapes/components/whatever. The creator of this GUI lib says they envisioned people releasing their own shapes libraries. Not sure anyone ever took off with it.
Overall: Only one with a layers system as far as I can tell. Fairly basic "shapes", nothing super-fancy, but with what it gives you you can easily build more complex widgets yourself. If someone were inclined, could add their own basic "shapes", making it potentially the most robust.

As you might be able to tell from the length of descriptions, I'm leaning towards kevinkk525's GUI lib, despite the lack of documentation. Direwolf20's has the basic button and is probably easiest out of the box, and dustpuppy's is well documented but a bit inflexible.