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

Offline zRrr

  • Sergeant
  • **
  • Posts: 28
    • 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.

Offline Yankes

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

Offline Yankes

  • Commander
  • *****
  • Posts: 3289
    • 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: 28
    • 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.


Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 8886
    • 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.)

Offline Yankes

  • Commander
  • *****
  • Posts: 3289
    • 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.

Offline Yankes

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

Offline zRrr

  • Sergeant
  • **
  • Posts: 28
    • 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)