Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: added breaking change regarding target locking

...

Note: This change is not documented in the UI-modding notes, since it's related to an asset definition change and not exactly a change on the UI-system.

Removed locking of no current target

In 4.20 Beta 1 we changed the locking behavior slightly. Before 4.20 Beta 1 it was possible to set a target lock-request without having an actual target. As of 4.20 Beta 1, this will no longer work (i.e. a call to RequestSofttargetLock() without a current target will fail now -

Jira
serverEgosoft JIRA
serverId9d4eeb41-d1c2-3d89-8ea6-0964f358c464
keyXRUIMOD-189
).

The change was done mainly in order to realize the support for explicit target locking in gamepad mode. Other reasons behind that change were that part of the target locking design relied on target lock requests being reset/cleared, if the current target was destroyed/lost. However, the design could not rely on this behavior, since it could be circumvented by calling RequestSofttargetLock() without a target. Hence, several special/edge cases had to be covered to take this fact into account, unnecessarily overcomplicating the implementation (history lesson: this implementation originated from a quick realization to get target lock support for the mouse mode in - basically using the already realized target locking support to prevent auto-targeting overwriting the target the player clicked on / later-on this early implementation was redesigned in several following iterations, ultimately no longer requiring the lock for this case).

To simplify things (and as part of that resolve several smaller issues caused by this design flaw), we decided to restrict softtarget locking on actual targets. This also eliminates situations where mods could accidentally cause problems within the target system (resulting in cases where targeting was impossible without performing a UI-reload).

If your mod relied on the old behavior (i.e. being able to prevent targets being selected), please leave us a comment and we'll try to find a suitable solution for you. We however don't know of any mod out there which relied on this (undocumented and not really obvious) behavior. That said, we don't expect this behavior change actually breaking any mods out there.