ositools icon indicating copy to clipboard operation
ositools copied to clipboard

Improve global debug functions

Open PinewoodPip opened this issue 2 years ago • 0 comments

This pull request makes minor improvements to the existing global debug functions:

  • _C() has been rewritten on the client to use PlayerManager and now takes the player index as an optional parameter, allowing it to be used to fetch the player 2's character in local co-op. In addition it now works while in the controller UI (which it previously didn't as it relied on KB+M UIs)
  • _W() has been implemented on the client, returning the EclItem equipped
  • All these global functions (_C, _W, _E, _P, _D, _DS) have been added to the IDE helpers. They are marked with @deprecated so as to trigger an IDE warning with a message stating they should not be left in mod releases. One could argue that these functions should not be present in the IDE helpers - but I thought it would offer users a way to learn about them that doesn't involve browsing the source code.

image

Note: I have not actually tested using _C(2) to fetch player 2's character as I currently do not have a second controller to test splitscreen stuff. It should work if player 2's index in the PlayerManager is 2.

PinewoodPip avatar Oct 17 '22 18:10 PinewoodPip