tModLoader Hotbar Swapper

Thank you very much. This is much more user-friendly than my old way.

However, I'm still having one small problem. I can't get the default key to work. I have the following in my Mod class.
Code:
public override void Load()
{
    hotBarSwap = RegisterHotKey("Swap Hot Bar", /*"CapsLock"*/ /*Keys.CapsLock.ToString()*/ "P");
}
Neither "CapsLock", Keys.CapsLock.ToString() or even "P" was recognised as the default key. I can manually change the key allright, but when I click Reset To Defaults it just goes back to <Unbound>. Any thoughts?

On a slightly different topic, on very rare occasions I've had the following error pop up when I click Build & Reload:
Code:
The given key was not present in the dictionary.
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at Terraria.GameInput.PlayerInput.PostInput()
   at Terraria.GameInput.PlayerInput.UpdateInput()
   at Terraria.Main.DoUpdate(GameTime gameTime)
   at Terraria.Main.Update(GameTime gameTime)
After this happened, I'd click Continue, then reload again and everything would be fine. I've put this down to a tModLoader quirk, but I wonder if it could be this mod causing this glitch?

"CapsLock" worked for me. Make sure you saved, rebuilt, and clicked the reset to defaults button, try again.

That reload error we know about.
 
"CapsLock" worked for me. Make sure you saved, rebuilt, and clicked the reset to defaults button, try again.

That reload error we know about.
H'ok... after much rebuilding and reloading and experimenting with code and fretting about, I still couldn't solve my problem. I then deleted my input profiles.json file and allowed it to rebuild, and found that it was working. For some reason, I'd left keybindings set to Console (Playstation), and this prevented the 'Reset To Default' button from finding the default keybinding. I experimented a bit and found that the only config settings where the default button worked are Custom and Redigit's Pick. I also found that if I selected controller settings, all configurations displayed <Unbound> even though Custom and Redigit's Pick still worked in game.

So it was kind of my fault and kind of a bug in tModLoader.
 
Is there a way to disable the double tab functionality? Playing on a server and while I (the host of the server) dont have any issues, someone on my server has an issue where only pressing the button of an active item will swap that one out. Say he's swinging a sword, and presses that key once, it swaps the item out.
Ok, I've added a function for disabling single item swapping. Type /swap into chat and single items won't be swapped until /swap is typed into chat again or mods are reloaded.

Can you make the key configurable in the game's gui like the other mods?
Done! :)
 
Every time I hit a number key it swaps the item and switches to the slot. It's behaved occasionally as it should, but always manages to default back to auto-swapping.

Edit: This behavior seems to reset after selling something to a shopkeeper, but reverts quickly.

This other "Feature" has led the rather useful and completely mandatory (in modded terraria) function to be impossible to use, as the people on my sever seem to have the same issue.
 
Last edited:
Every time I hit a number key it swaps the item and switches to the slot. It's behaved occasionally as it should, but always manages to default back to auto-swapping.

Edit: This behavior seems to reset after selling something to a shopkeeper, but reverts quickly.

This other "Feature" has led the rather useful and completely mandatory (in modded terraria) function to be impossible to use, as the people on my sever seem to have the same issue.
Hm, I've had one other person with the same problem, so I built in a work-around. Type /swap into chat to disable the double-tap swapping.

I'm not able to duplicate this problem when running my own server, which makes it tricky to debug. My guess that some other mod is interfering with this mod. Could I have a list of the mods that you are using?

Is there a way to disable the double tab functionality? Playing on a server and while I (the host of the server) dont have any issues, someone on my server has an issue where only pressing the button of an active item will swap that one out. Say he's swinging a sword, and presses that key once, it swaps the item out.
Could I also have a list of the mods that you were using when the bug occured? It should help to narrow it down a bit.
 
/swap doesn't appear to be working since tModLoader update to 0.9.2.1 =(

Very annoying for multiplayer games. As host, hotbar swapping works as expected but for everyone else it swaps with single press.

Please let me know what other info I can provide that might help get multiplayer solved once and for all or at least get /swap working so I don't have to listen to my minions, I mean friends, whine.

Thanks.
 
/swap doesn't appear to be working since tModLoader update to 0.9.2.1 =(

Very annoying for multiplayer games. As host, hotbar swapping works as expected but for everyone else it swaps with single press.

Please let me know what other info I can provide that might help get multiplayer solved once and for all or at least get /swap working so I don't have to listen to my minions, I mean friends, whine.

Thanks.
I probably just need to rebuild it again. And I'll have another look into the swap problem, when I have a bit more free time on my hands.
 
/swap doesn't appear to be working since tModLoader update to 0.9.2.1 =(

Very annoying for multiplayer games. As host, hotbar swapping works as expected but for everyone else it swaps with single press.

Please let me know what other info I can provide that might help get multiplayer solved once and for all or at least get /swap working so I don't have to listen to my minions, I mean friends, whine.

Thanks.
Right, I'm mostly confident I've fixed the item swapping bug. tModLoader has changed the way that chat commands work, so I removed the /swap command and replaced it with a keybinding. The default for it is 'P'.
 
Right, I'm mostly confident I've fixed the item swapping bug. tModLoader has changed the way that chat commands work, so I removed the /swap command and replaced it with a keybinding. The default for it is 'P'.

Awesome. I will try it out and report back my results. Thanks!
 
I probably just need to rebuild it again. And I'll have another look into the swap problem, when I have a bit more free time on my hands.
hey, I know this might be selfish but I was wondering if u could make a unique thing for me instead of tapping twice to switch I could just tap once that's all.Thanks
 
hey, I know this might be selfish but I was wondering if u could make a unique thing for me instead of tapping twice to switch I could just tap once that's all.Thanks
I could certainly add a hotkey that enables this feature. I'm working on other things right now, so it may be a while before I get to it, though.
 
hey, I know this might be selfish but I was wondering if u could make a unique thing for me instead of tapping twice to switch I could just tap once that's all.Thanks
Ok, I've added the option to swap items in the hotbars with just one button press. Use the hotkey O to toggle this option. Check your keybindings first, because it'll probably be unbound the first time you load it.

Also, updated to tModLoader v0.10.0.1.
 
:O u did it THANKS

Edit: I was gonna check it but the default key is P and is to toggle but how do i actually swap items
 
Last edited:
:O u did it THANKS

Edit: I was gonna check it but the default key is P and is to toggle but how do i actually swap items
It's actually O that you use. P was to turn off the feature completely all together. I added that so that people playing on a Multiplayer server could disable swapping if they wanted to. I'll update the OP with a better description.
 
It's actually O that you use. P was to turn off the feature completely all together. I added that so that people playing on a Multiplayer server could disable swapping if they wanted to. I'll update the OP with a better description.

Hey I know am being really annoying with all these questions and stuff but I was wondering if there a way to install Hotbar Swapper without Tmodloader?.
I have my reason :p but it's okay if it can't it's not that important.
 
Hey I know am being really annoying with all these questions and stuff but I was wondering if there a way to install Hotbar Swapper without Tmodloader?.
I have my reason :p but it's okay if it can't it's not that important.
Sadly, no. I'd love it if this feature was integrated into the Vanilla game, but there's no way for me to make it happen.

Here's hoping they one day add official mod support.
 
Back
Top Bottom