Author Topic: [DONE] Add access to Ctrl/Alt/Shift key state from recolorSprite/selectSprite scripts  (Read 1202 times)

Offline zRrr

  • Sergeant
  • **
  • Posts: 31
    • View Profile
Add ability check if ctrl, alt or shift are pressed to recolorUnitSprite, recolorItemSprite, selectUnitSprite and selectItemSprite scripts.

This can be useful to highlight units, items on the ground, units with primed timed explosives, units without xp, remaining shield capacity, active proxies and other stuff.

Online Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3348
    • View Profile
Doable, as this is only "readonly" script and do not affect gameplay results its safe to expose this state to this hooks.

Online Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3348
    • View Profile
After looking into code adding this was simple, but I see another opportunity Night vision toggle could be exposed too.

Offline zRrr

  • Sergeant
  • **
  • Posts: 31
    • View Profile
Can be useful, but will also need access to NV color from options, or some function that converts color to NV mode.

Currently recolors override NV completely, which is good for my use case, I like things to stand out.


Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9084
    • View Profile
Currently recolors override NV completely, which is good for my use case, I like things to stand out.

NV recolor does not apply to units.
(There is nothing to preserve/override.)

Online Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3348
    • View Profile
Yes, but some mods would like some control, like NV work more like HeatVision or some thing like this.
As long it do not affect rest of engine I would allow some custom iteration with NV and units.

Online Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3348
    • View Profile
in OXCE 7.13.8 special keys and NV state is exposed to graphic script hooks.

Offline zRrr

  • Sergeant
  • **
  • Posts: 31
    • View Profile
Thanks

Resulting mod:
  • alt - to highlight all units
  • ctrl - highlights player-controlled units with grenades/proxies in hands (can't access all inventory), changes floor sprite for active grenades and proxies last carried by xcom or mc'd aliens to flag (but game draws heaviest item on tile, so map is stil better)
  • shift - highlights units without xp (similar to ctrl+e)