Cursor

Discuss modding questions and implementation details.
Post Reply
User avatar
King of Worms
Posts: 4752
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Cursor

Post by King of Worms »

So, as I plan to wrap up the DREAM and release the summer versions on all platforms and take a break for a while Id like to include this awesome cursor made by VMBlast.

But how can I do so?

I want it to be a part of a DFMOD, Ive tryed everything but no luck.

What should the name of a cursor file be exactly?

What should I do?

Help!!! :D
cursor 32.png
cursor 32.png (2.37 KiB) Viewed 1709 times
cursor 64.png
cursor 64.png (4.99 KiB) Viewed 1709 times

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Cursor

Post by Interkarma »

I use a hardware cursor in DFU so that it's decoupled from resolution and frame-rate. Cursor is currently baked into build and not exposed to mod system.

I'm not sure if cursor texture can be changed at runtime, but Cursor.SetCursor() looks about right. I wonder if this is something TheLacus would be interested at looking into further?

User avatar
TheLacus
Posts: 1305
Joined: Wed Sep 14, 2016 6:22 pm

Re: Cursor

Post by TheLacus »

I can do it but there are two limitations:
- It requires a specific texture type to be set in editor, so it can't be imported from loose files.
- Default cursor is used inside the main menu because mods are not loaded at that point yet.

User avatar
King of Worms
Posts: 4752
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: Cursor

Post by King of Worms »

TheLacus wrote: Tue Apr 16, 2019 3:40 pm I can do it but there are two limitations:
- It requires a specific texture type to be set in editor, so it can't be imported from loose files.
- Default cursor is used inside the main menu because mods are not loaded at that point yet.
Hi, specific texture type settings are not a problem and I plan to use it in a DFMOD anyway.
Default cursor in the main menu is something we need to live with than, not a huge deal tho.
Would be great if this could be done, thank you for considering it Lacus!

User avatar
TheLacus
Posts: 1305
Joined: Wed Sep 14, 2016 6:22 pm

Re: Cursor

Post by TheLacus »

An update on this:

- Read/Write flag must be enabled.
- A log warning is produced when cursor is set but the operation is actually succesful. Might be due to this bug, fixed in a later version.
- Given that this is only a specific texture to be loaded passively from an assetbundle, i can actually apply it from SetupGameWizard without waiting for the actual game scene. I don't think there are any particular contraindications.

I'm going to submit a PR.

User avatar
King of Worms
Posts: 4752
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: Cursor

Post by King of Worms »

Awesome thanks a lot, finally the blue 320*200 cursor will be gone, fingers crossed .)

Post Reply