Vinifera-Developers / Vinifera

Vinifera is a C&C: Tiberian Sun engine extension implementing new logics and fixing bugs.
GNU General Public License v3.0
46 stars 10 forks source link

[New Feature] Custom mouse cursors #283

Open OmegaBolt opened 3 years ago

OmegaBolt commented 3 years ago

Add custom mouse cursors for (ideally) every action in the game. I suggest starting with a system similar to Ares which allows you to define an enumerated cursor type in rules, then use it for superweapons, regular weapon targeting and technos for move orders, entering, infiltration and deploy.

Possible Implementation:

A rules section which lets you define cursors with all the necessary information. Frames refer to mouse.sha frames. Alignment (or hotspot as it's called in Ares) refers to the "click points" position relative to the art. Default cursors (such as Sell/NoSell etc) can also be defined and override the hardcoded values. Refer to Ares documentation for more specifics.

[MouseCursors] CursorID=start frame, frame count, rate of animation, minimap frame, minimap frame count, alignment x, alignment y

[Techno] Cursor.Move= ;; Specifies the cursor to use when giving a move order Cursor.NoMove= ;; Cursor when movement is blocked Cursor.MoveLongDistance= ;; Cursor when the distance is long enough to go subterranean or jumpjet Cursor.Deploy= ;; Cursor displayed over a deployable unit and it is able to deploy Cursor.NoDeploy= ;; Cursor displayed over a deployable unit but it is unable to deploy Cursor.Enter= ;; Cursor given to other units trying to enter this techno (such as if it can take passengers, can be captured or docked at) Cursor.NoEnter= ;; Cursor given to other units when this techno cannot be entered Cursor.Spy= ;; Cursor given to units with Agent=yes when they are able to infiltrate this techno Cursor.Hijack= ;; Cursor given to units with Hijacker=yes when they are able to hijack this techno

[Weapon] Cursor.Attack= ;; Cursor when issuing an attack order with this weapon Cursor.AttackOutOfRange= ;; Cursor when issuing an attack order with this weapon, but the unit is out of range

[Superweapon] Cursor.Fire= ;; Cursor when this superweapon can successfully fire at the target Cursor.NoFire= ;; Cursor when this superweapon is unable to fire at the target

All this can be used to give greater indication to the player of the expected interaction. For instance, you could have a sniper that mutates infantry into visceroids, and show that in the attack cursor. Cursor.MoveLongDistance would be especially useful to know if your order is far enough away to force a Subterranean APC underground. You could visibly show the difference between deploying an MCV or deploying a weapon, like the Mobile EMP. It would also de-hardcode some cursors, such as the Medic heal cursor which is currently displayed on any weapon that does negative damage to infantry AFAIK and, through the use of the default cursor IDs, would allow customisation of length, rate of animation, hotspot of existing cursors.

Ares Implementation:

How to define cursors in Ares: http://ares-developers.github.io/Ares-docs/new/mousecursors.html List of default cursors in Ares: http://ares-developers.github.io/Ares-docs/_downloads/MouseCursors.txt Cursors on units on structures: http://ares-developers.github.io/Ares-docs/new/cursors.html Cursors on weapons: http://ares-developers.github.io/Ares-docs/new/weapons/cursors.html Cursors on superweapons: http://ares-developers.github.io/Ares-docs/new/superweapons/cursors.html

CCHyper commented 3 years ago

Thanks for taking the time to post this @OmegaBolt.

Does anyone have any suggestions on how we could improve or expand on the Ares system?