Railcraft

Railcraft

34M Downloads

Set the Analog Controller Box to accept individual signal strengths

wooky opened this issue ยท 10 comments

commented

One issue I've encountered when using the Analog Controller Box in my play world is that if I want to use non-continuous redstone levels to control my boxes, it becomes very annoying. For instance, if I want my signal to switch red on strengths of 0-4 and 7, I have to come up with some external way to control it at strength 7, since it's outside the range of 0-4.

My solution is to make the box very flexible by letting the player set different strengths for each color. The GUI that I have in mind looks like this:
untitled
So now if I want to implement the above, all I need to do is to press 0, 1, 2, 3, 4, and 7 for the red aspect, and my box will work as I want it to without further headache.

While this interface does make the box more flexible, one issue I can see is that it's too cluttered. Not everyday you see a simple GUI with 64 buttons on it.

What do you think?

commented

Well, I attempted to create the above. Here's what it looks like:
2014-12-29_23 01 15
It looks alright, aside from the (obviously glaring) problem that it's too damn wide. I'd appreciate if someone hints me on how to get large GUIs working, or suggest a better method.

commented

The user could just use multiple Analog Controller Boxes and link them to a multiple receiver array which transmits via a regular controller.

Example below corresponds to your sections in the image.

2014-12-30_12 55 37
2014-12-30_12 51 18
2014-12-30_12 51 21

It feels like this would add a lot of visual complexity and only solves a space/materials problem.

commented

While the idea of using multiple analog boxes sounds good, the entire purpose of it is to save up on space so you avoid having a bunch of boxes.

As for the "off" aspect, remember that if you don't have any aspects selected for a signal strength, it's considered off.

commented

I think you may add another aspect of off in the output list.

commented

Okay, so I have come up with a couple other ideas that don't take up nearly as much horizontal space.

Option 1: type in the ranges
opt1
You don't have to constantly click on buttons, and all you have to do is to type in a range or ranges that you want it to work. This requires text parsing, but I don't think that will be a big issue. The only problem I have with this is that it looks... unusual, because instead of selecting a value, you have to type it in.

Option 2: put the redstone strengths in a grid
opt2
This one you have to select the desired aspect rather than the redstone strengths. Lots and lots of clicking will be needed to set up all the necessary aspects. Also, a bit of math will be needed.

Personally, I like option 1 more. Which one do you like? Both? Neither? Any other suggestions?

commented

Its fairly trivial to change the GUI width. You just need to change the width value in the GUI class and provide an appropriately wide image.

As for the other options, I also prefer Option 1. Option 2 is just confusing to me.

commented

Okay, so I implemented option 1 as such:
analogbox

What happens here is that when the user types in the desired frequencies, the text is parsed client-sided using regex and then sent to the server as a series of booleans; similarly in reverse.

You may notice a strange thing about this dialog: the textboxes do not have borders around them. I cannot, for the life of me, figure out how to get those to be drawn, since setting GuiTextField.setEnableBackgroundDrawing(true) draws a gray box and you can't see the text. If someone can give me a hint on how to fix that, I'll quickly fix the issue and submit a pull request.

commented

Well...there is always the standard fall back of just editing the background image.

Which it appears you need to do anyway, since the borders are all screwed up.

commented

Alright, so as soon as I added textboxes to the picture itself, I found out how to get the actual textfields to behave. It turns out that you have to disable GL_LIGHTING before drawing the boxes themselves. That's a rather odd requirement.

Nevertheless, here is the (hopefully) final result:
untitled

It looks a tad bit crammed since I decided to use gui_basic.png rather than making another GUI just for this box, which is a tad bit short. But I think it looks fine.

If people are OK with this, I'll make a pull request shortly.

commented

Looks good.