Page MenuHomeFeedback Tracker

[Feature Request] New scripting command: setCursorType
New, NormalPublic

Description

Would be neat if it was possible to change the mouse cursor type/weapon cross-hair type via scripting.

setCursorType "path/to/some.paa"
setCursorType ["path/to/some.paa", <forced>]

Where path would be a path to image file and forced would be boolean to force it shown regardless of weapon cross-hair setting.

Assuming this would require some eachframe event to run:

_ctrl ctrlAddEventHandler ["mouseEnter", {
  eh1 = _ctrl ctrlAddEventHandler ["mouseMoving", {
    setCursorType "a3\3den\Data\CfgWrapperUI\Cursors\3denTransformScale0_ca.paa";
  }];
  eh2 = _ctrl ctrlAddEventHandler ["mouseHolding", {
    setCursorType "a3\3den\Data\CfgWrapperUI\Cursors\3denTransformScale0_ca.paa";
  }];
};

_ctrl ctrlAddEventHandler ["mouseExit", {
  (_this #0) ctrlRemoveEventHandler ["mouseMoving", eh1];
  (_this #0) ctrlRemoveEventHandler ["mouseHolding", eh2];
}];

addMissionEventHandler ["eachFrame", {
  if (currentWeapon player == "SomeWeapon") then {
    setCursorType ["a3\ui_f\data\IGUI\Cfg\WeaponCursors\laserdesignator_gs.paa", true];
  };
}];

🤔

Details

Severity
None
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10 x64
Category
Engine

Event Timeline

h- created this task.Feb 19 2022, 10:36 AM
This comment was removed by Tenshi.
Tenshi added a subscriber: Tenshi.Mar 3 2022, 1:24 PM