Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implements system to customize mouse cursor type properties and mouse cursors used by actions. #1000

Merged
merged 15 commits into from
Oct 24, 2024

Conversation

CCHyper
Copy link
Contributor

@CCHyper CCHyper commented Mar 28, 2023

Closes #999, closes #800, partially #283

This pull request implements a new system to customize the mouse cursor type properties. Loading of a new INI has been where these properties can be adjusted, if the INI is not present, the game will default to the normal hardcoded mouse type properties.

The following is the MOUSE.INI that should be used;

;============================================================================
; MOUSE.INI
;
; This control file is used to control the frames and rates of the various
; mouse pointers.
;
; $Author: $
; $Archive: $
; $Modtime: $
; $Revision: $
;============================================================================


; ******* Mouse List *******
; Lists the mouse types in this control file. Each mouse pointer is given a
; unique (internal only) identifier name, these can not be renamed or removed!
;
; FORMAT;
;   <StartFrame>,<FrameCount>,<FrameRate>,<SmallFrame>,<SmallFrameCount>,<SmallFrameRate>,<HotspotX>,<HotspotY>
;
;   A hotspot value can either be an integer value (ranged between the negative value of the width/height
;   of the shape frame, and the positive value of the width/height of the shape frame), or one of the
;   following hotspot types;
;      HotspotX = left, center, right
;      HotspotY = top, middle, bottom
;
; NOTE: 
;   A SmallFrame value of "-1" means it will use the normal pointer when
;   the mouse is over the radar panel.

[MouseTypes]
Normal=0,1,0,1,1,0,left,top
ScrollN=2,1,0,-1,1,0,center,top
ScrollNE=3,1,0,-1,1,0,right,top
ScrollE=4,1,0,-1,1,0,right,middle
ScrollSE=5,1,0,-1,1,0,right,bottom
ScrollS=6,1,0,-1,1,0,center,bottom
ScrollSW=7,1,0,-1,1,0,left,bottom
ScrollW=8,1,0,-1,1,0,left,middle
ScrollNW=9,1,0,-1,1,0,left,top
NoScrollN=10,1,0,-1,1,0,center,top
NoScrollNE=11,1,0,-1,1,0,right,top
NoScrollE=12,1,0,-1,1,0,right,middle
NoScrollSE=13,1,0,-1,1,0,right,bottom
NoScrollS=14,1,0,-1,1,0,center,bottom
NoScrollSW=15,1,0,-1,1,0,left,bottom
NoScrollW=16,1,0,-1,1,0,left,middle
NoScrollNW=17,1,0,-1,1,0,left,top
CanSelect=18,13,4,-1,13,4,center,middle
CanMove=31,10,4,42,10,4,center,middle
NoMove=41,1,0,52,1,0,center,middle
StayAttack=53,5,4,63,5,4,center,middle
CanAttack=58,5,4,63,5,4,center,middle
AreaGuard=68,5,4,73,5,4,center,middle
Tote=78,10,4,-1,10,4,center,middle
NoTote=88,1,0,-1,1,0,center,middle
Enter=89,10,4,100,10,4,center,middle
NoEnter=99,1,0,63,1,0,center,middle
Deploy=110,9,4,-1,9,4,center,middle
NoDeploy=119,1,0,-1,1,0,center,middle
Undeploy=120,9,4,-1,9,4,center,middle
Sell=129,10,4,-1,10,4,center,middle
SellUnit=139,10,4,-1,10,4,center,middle
NoSell=149,1,0,-1,1,0,center,middle
GRepair=150,20,4,-1,20,4,center,middle
Repair=170,20,4,-1,20,4,center,middle
NoRepair=190,1,0,-1,1,0,center,middle
Waypoint=191,10,4,-1,10,4,center,middle
PlaceWaypoint=201,10,4,-1,10,4,center,middle
NoPlaceWaypoint=211,1,0,-1,1,0,center,middle
SelectWaypoint=212,7,4,-1,7,4,center,middle
EnterWaypointMode=219,10,4,-1,10,4,center,middle
FollowWaypoint=229,10,4,-1,10,4,center,middle
ToteWaypoint=239,10,4,-1,10,4,center,middle
RepairWaypoint=249,10,4,-1,10,4,center,middle
AttackWaypoint=259,10,4,-1,10,4,center,middle
EnterWaypoint=269,10,4,-1,10,4,center,middle
LoopWaypointPath=356,1,0,-1,1,0,center,middle
AirStrike=279,20,4,-1,20,4,center,middle               ; Ion Cannon
ChemBomb=299,10,4,-1,10,4,center,middle
Demolitions=309,10,4,-1,10,4,center,middle
NuclearBomb=319,10,4,-1,10,4,center,middle
TogglePower=329,16,2,-1,16,2,center,middle
NoTogglePower=345,1,0,-1,1,0,center,middle
Heal=346,10,4,42,10,4,center,middle
EMPulse=357,20,3,-1,20,3,center,middle
EMPulseRange=377,1,0,-1,1,0,center,middle
ScrollCoast=378,1,0,-1,1,0,center,middle
ScrollCoastN=379,1,0,-1,1,0,center,middle
ScrollCoastNE=380,1,0,-1,1,0,center,middle
ScrollCoastE=381,1,0,-1,1,0,center,middle
ScrollCoastSE=382,1,0,-1,1,0,center,middle
ScrollCoastS=383,1,0,-1,1,0,center,middle
ScrollCoastSW=384,1,0,-1,1,0,center,middle
ScrollCoastW=385,1,0,-1,1,0,center,middle
ScrollCoastNW=386,1,0,-1,1,0,center,middle
PatrolWaypoint=387,10,4,-1,10,4,center,middle

NOTE: All entries must be present in the INI, otherwise loading of the INI will fail!

@CCHyper CCHyper added the new-feature New feature or request. label Mar 28, 2023
@CCHyper CCHyper requested a review from a team March 28, 2023 19:25
@github-actions
Copy link

github-actions bot commented Mar 28, 2023

This comment is automatically generated by Nightly.link and allows non-registered users to get download the artifacts for this pull request.

These links are also updated when the pull request is pushed to.

@CCHyper CCHyper self-assigned this Mar 28, 2023
@CCHyper CCHyper force-pushed the feature/mouse-cursors branch 3 times, most recently from 47dd248 to e6af600 Compare March 29, 2023 11:47
@CCHyper CCHyper force-pushed the feature/mouse-cursors branch from e6af600 to 4f85393 Compare December 26, 2023 14:25
@Longshanks1
Copy link

Tested with Freeware TS and TS Client. Did not test every cursor on the list, but the ones I checked did work correctly. I did have two issues however. If you move the HotSpotX or Y locations for the Normal cursor, the game will crash on starting up. Also, the locations seem to be inverted, as I moved the Deploy cursor to left bottom and it showed up in top right

@CCHyper CCHyper force-pushed the feature/mouse-cursors branch 9 times, most recently from 1ec6234 to 1d967c2 Compare February 5, 2024 15:21
@ZivDero ZivDero force-pushed the develop branch 2 times, most recently from 65abfa3 to 5be9542 Compare September 26, 2024 13:00
@CCHyper CCHyper removed their assignment Oct 7, 2024
@ZivDero ZivDero force-pushed the develop branch 5 times, most recently from a307ea7 to 735e008 Compare October 17, 2024 22:42
@ZivDero ZivDero force-pushed the develop branch 2 times, most recently from f40cd5a to ce12b49 Compare October 22, 2024 15:52
@ZivDero ZivDero force-pushed the feature/mouse-cursors branch from 1d967c2 to e0780ba Compare October 23, 2024 20:22
@ZivDero ZivDero force-pushed the feature/mouse-cursors branch from e0780ba to b08a5ba Compare October 23, 2024 20:43
@ZivDero
Copy link
Member

ZivDero commented Oct 23, 2024

Updated comment:

This PR was updated to also include new ActionTypes.

Here is the default Action.ini

;============================================================================
; ACTION.INI
;
; This control file is used to control the mouse pointers used for various actions.
;
; $Author: $
; $Archive: $
; $Modtime: $
; $Revision: $
;============================================================================


; ******* Action List *******
; Lists the action types in this control file. Each action is given a
; unique (internal only) identifier name, these can not be renamed or removed!
;
; FORMAT;
;   <Mouse>,<ShadowMouse>
;
;   Mouse and ShadowMouse must be names of mouse types, listed in MOUSE.INI.
;   ShadowMouse is shown when the mouse pointer is over shroud, Mouse is shown otherwise.

[ActionTypes]
None=Normal,Normal
Move=CanMove,CanMove
NoMove=NoMove,NoMove
Enter=Enter,Normal
Self=Deploy,Normal
Attack=CanAttack,CanMove
Harvest=CanAttack,Normal
Select=CanSelect,Normal
ToggleSelect=CanSelect,Normal
Capture=Enter,Normal
Repair=Repair,NoRepair
Sell=Sell,NoSell
SellUnit=SellUnit,NoSell
NoSell=NoSell,NoSell
NoRepair=NoRepair,NoRepair
Sabotage=Demolitions,Normal
Tote=Tote,NoTote
DontUse2=Normal,Normal
DontUse3=Normal,Normal
Nuke=NuclearBomb,NuclearBomb
DontUse4=Normal,Normal
DontUse5=Normal,Normal
DontUse6=Normal,Normal
DontUse7=Normal,Normal
DontUse8=Normal,Normal
GuardArea=AreaGuard,AreaGuard
Heal=Heal,Heal
Damage=Enter,Normal
GRepair=GRepair,Normal
NoDeploy=NoDeploy,NoDeploy
NoEnter=NoEnter,NoEnter
NoGRepair=NoRepair,NoRepair
TogglePower=TogglePower,NoTogglePower
NoTogglePower=NoTogglePower,NoTogglePower
EnterTunnel=Enter,Normal
NoEnterTunnel=Normal,NoEnter
EMPulse=EMPulse,EMPulse
IonCannon=AirStrike,AirStrike
EMPulseRange=EMPulseRange,EMPulseRange
ChemBomb=ChemBomb,ChemBomb
PlaceWaypoint=PlaceWaypoint,PlaceWaypoint
NoPlaceWaypoint=NoPlaceWaypoint,NoPlaceWaypoint
EnterWaypointMode=EnterWaypointMode,EnterWaypointMode
FollowWaypoint=FollowWaypoint,FollowWaypoint
SelectWaypoint=SelectWaypoint,SelectWaypoint
LoopWaypointPath=LoopWaypointPath,LoopWaypointPath
DragWaypoint=Normal,Normal
AttackWaypoint=AttackWaypoint,AttackWaypoint
EnterWaypoint=EnterWaypoint,EnterWaypoint
PatrolWaypoint=PatrolWaypoint,PatrolWaypoint
DropPod=AirStrike,AirStrike
RallyToPoint=Normal,Normal
AttackSupport=Normal,Normal

Additionally, it is no longer required to list vanilla mouse and action types. If unlisted, their defaults values will be used.

  • Vinifera allows setting a custom attack cursor used by a weapon.

In RULES.INI:

[SOMEWEAPON]         ; WeaponType
CursorAttack=Attack      ; ActionType, the action whose cursor properties will be used for this weapon's attack cursor when the unit is not in range of the target.
CursorStayAttack=Attack  ; ActionType, the action whose cursor properties will be used for this weapon's attack cursor when the unit is in range of the target.
  • Vinifera allows customizing the mouse cursor used for ranged super weapons (currently, the EMPulse Cannon).

In RULES.INI:

[SOMESUPERWEAPON]         ; SuperWeaponType
ActionOutOfRange=EMPulseRange  ; ActionType, the action used by this super weapon when it's out of range.

@ZivDero ZivDero changed the title Implements system to customize the mouse cursor type properties. Implements system to customize the mouse cursor type properties and mouse cursors used by actions. Oct 23, 2024
@ZivDero ZivDero changed the title Implements system to customize the mouse cursor type properties and mouse cursors used by actions. Implements system to customize mouse cursor type properties and mouse cursors used by actions. Oct 23, 2024
@ZivDero ZivDero force-pushed the feature/mouse-cursors branch 4 times, most recently from 72aaff7 to 9086d18 Compare October 24, 2024 09:35
@ZivDero ZivDero force-pushed the feature/mouse-cursors branch from f39ee6e to 7cde748 Compare October 24, 2024 12:36
@ZivDero ZivDero merged commit bfcc529 into Vinifera-Developers:develop Oct 24, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature New feature or request.
Projects
3 participants