Thank for a detailed answer :)
Firstly, here are some of my experiences so far:
- I only ever used shortcuts for this mod, never used the icons. I also have a lot of mods that already clutter the "shortcuts" tab, and I have already picked my set of most useful shortcuts, so neither have I noticed that shortcut icons are there nor that they are different.
- I have been searching for a way to enable separate keybinds for red,green,copper, but they were not present so it was confusing. I had to all settings tabs to see if this mod added something and there it was. Then I had to restart the game for a change to apply. This is in my opinion very questionable
- For the vast majority of time I use red/green wire. Copper wire is used super rarely.
- I have a muscle memory if I know what I want to do: for primary, ALT+F, secondary ALT+G, copper, ALT+C. I tried using ALT+W, but the situation when it equipped the wire I not intended were present maybe 1/3 of a time.
Based on what you wrote above, it seems that the only need for the "number of shortcuts" in the startup file is to assign a proper icon to the shortcut and assign a proper prototype. I think you can avoid it. I think you don't have to keep different prototypes if you write a single function that just picks wire depending on the cycle setting.
Instead of "number of shortcuts" I think it would be more useful to provide a smart wire behavior
for ALT+W select, which has three modes of operation:
- don't cycle
: only recalls last item.
- cycle red-green
: would cycle only red-green wires
- cycle red-green-copper
: would cycle all
Another thing is that the current "one shortcut" and "three shortcuts" has the same behavior for ALT+W. That essentially means, that this settings majority of the job is hiding keybind settings from settings tab.
I wonder how useful is the ALT+W shortcut anyway. For now I didn't yet have a situation, when I would want to cycle between all three red-green-copper. If I ever do any kind of wire action, I already know what kind of wire I want, and I'm always one known shortcut away from what I intend to do. IMO pressing ALT+W has only the benefit of being easier to press on keyboard than ALT+F, because it is closer.
I understand that you like it that you have a separate icon for every kind of shortcut mode, however in your place I would question their usefulness. For starters, consider replacing them with 4 fixed icons: one for red wire, one for green wire, one for copper and one for the "smart wire" that swaps the colors accordingly. Here is why:
- I've never used buttons to give me wires if I already have wire shortcuts.
- Almost all other icons and icons from other mods have a shortcut style that uses an icon of some kind.
- Incidentally Red/Green/Copper are unfortunately colors that people with red/green daltonism have hard time differentiating.
- The details are lost for the current icons.
- player already knows what kind of wires are cycled through. There is no need, in my opinion, to remind him every time about it.
If you want to keep the shortcuts, I would consider changing their icon to stylistically fit the rest of the icons - one color, only a symbol. This way you would have a red, green, copper symbol and a black symbol for swapping colors.
Another thing is — do you even need a shortcut on a shortcut bar for the swap wires? How often do you click that button? How often do you click any of the buttons? From personal experience I can tell, that I came here from the Wire Shortcuts mod, where I already had ALT+F, ALT+G, ALT+C shortcuts, so I've never yet used the buttons and swap wire yet. I tried, but it often equipped to cursor the wire type that was not the one I wanted. The current ALT+W behavior reassembles pressing a shortcut to focus and scroll a quickbar, instead of simply providing a shortcut for each item in the quickbar.
For now I see the following uses for the icon buttons:
- the shortcut bar is too cluttered and someone doesn't want keybinds (but why would he?) - only one shortcut to give a wire would be good
- someone is playing on a device that doesn't have keyboard or cannot bind keys to shortcuts
To be a bit clearer about the last point about not needing the shortcut button: I mean, there is an <kbd>R</kbd> shortcut to rotate an entity, but there is no shortcut button for it. I think ALT+W should be treated the same, because if it's meant to "swap wires quickly" then no one is gonna click this button with a mouse, but use a keyboard instead.
PS: I think (i-1) % #bufferLen + 1
is not that much of a pain in the ass ;P