alexw5335 / NativeCursor

A mod for Terraria
0 stars 0 forks source link

Using System Native Pointers for Smart Cursor, Favorite, Sell, Chat Share? #1

Open seowth opened 1 year ago

seowth commented 1 year ago

Tested all the contextual cursors and they work great. Especially the Bin/ Trash cursor; when holding CTRL over an item(to trash) it turns to my Windows "Link Select" Mouse Pointer which I have set as a Terraria Power Glove with a finger pointing. (I changed the .ani/ .cur file of each Windows Pointer in the Mouse Properties of the Control Panel)

Currently the Windows "Normal Select" pointer and "Link Select" pointers are being used/ called upon by the mod. I see "SDL_SYSTEM_CURSOR_ARROW" and "SDL_SYSTEM_CURSOR_HAND" which I believe refer to the above pointers respectively?

QUESTION: For the Smart Cursor (golden arrow), Favorite (pin icon), Sell (Money Sign), and Chat Share (Magnifying Glass) Cursor, would you be able to make it so that those cursors call upon other System Pointers? For example, in addition to the "Normal" and "Link Select", the "Text Select" cursor is used often.

Theoretically, I'm thinking that if you can call upon those cursor names/ classes then it should be no different than how you assigned the 2 system cursors for Cursors[i] and [0] ?

Referring to: Link to Windows Cursor Properties, you can scroll down to Cursor Properties. Do these help?

While all the cursors work great and have suitable designs, it's a little strange that only the two cursors(default & trash) out of six are native pointers and it would be more comprehensive if ALL the contextual cursors use native windows pointers. Though...again, If the four custom cursors are purposeful design choices they do work fine.

alexw5335 commented 1 year ago

The cursors are all native in the sense that they are rendered by the operating system and not the game. Using the system cursors is tricky because they vary between users.

So, I added a config system so that users could choose the cursor to use for each context. This way, you can choose to use either a system cursor or a custom cursor for each context. I hope this config system solves this issue.

The Forms.Cursor class is Windows-specific and I couldn't get it to work, so I used SDL instead, which may limit the options for system cursors since SDL is platform-independent.

Also, I assumed that quick-trash had a custom cursor, but apparently it uses the hand system cursor instead? For me, it uses the custom cursor.

seowth commented 1 year ago

Just had a quick test and all the cursors work perfectly except the Quick Trash Cursor - It seems to use the config that the default cursor is set to. (I tested this by setting cursor to Smart Cursor then checking what happens when Quick Trash is pressed.

I also tested the Quick Trash cursor using your custom designs to confirm so I think something is wrong there.

I did not manage to test in a vanilla environment, but didn't have any cursor altering mods except this.

If the problem cannot be reproduced I can re-test.

_"Also, I assumed that quick-trash...For me, it uses the custom cursor." -_Yes before the latest patch somehow it was using the hand system cursor.

Thx for the info & really awesome stuff with the new configs, really clean!

alexw5335 commented 1 year ago

Quick trash is working for me, maybe you have another mod that alters quick trash in some way?

seowth commented 1 year ago

Yes, it was a mod issue: Auto Trash

Has a function: "CTRL+SHIFT click inventory items to quickly add to auto trash list."... but it might be some other feature causing the problem…maybe the "config to have the Auto-Trash slot instead act as an Auto-Sell slot"? [<-- Edit: Turned the config off; same problem]

Should I report on that mod?

alexw5335 commented 1 year ago

Auto Trash was setting Main.CursorOverride to 5 for some reason, but luckily I could just assign the quick trash cursor to that override since it's unused by the game, so it should be working now. Thanks for letting me know about it.