Author Topic: [Documentation] Touch buttons  (Read 5311 times)

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9088
    • View Profile
[Documentation] Touch buttons
« on: March 06, 2021, 12:21:49 pm »
Hi everyone,

on desktops, this functionality is available via keyboard modifiers (Ctrl, Alt and Shift) and mouse buttons (RMB and MMB).

On mobile platforms, some functions are simulated via long press:
- right-click on a base facility
- right-click on a soldier in a craft to open soldier info UI
- right-click to turn a soldier and to open/close doors
- right-click to zeroize the soldier's TUs
- right-click to prime grenades in the inventory

Since OXCE v7.0, many other battlescape functions are also available via on-screen touch buttons.
The touch buttons can be activated via extended links, see: https://openxcom.org/forum/index.php/topic,9506.0.html

The buttons can be used for the following functionality:
- shift: ignore spotted enemies/mutual surprise
- ctrl: running
- ctrl: strafing
- ctrl: force-fire
- ctrl+shift: spray targeting
- alt: cursor damage preview
- alt: motion scanner arrows
- alt: unit facing preview
- alt: temporarily turn off camera following projectiles
- alt: minimap borders preview
- RMB: unit turning
- RMB: door opening
- RMB: next unit icon click = select previous unit
- RMB: weapon click = reaction fire preference (yellow dot)
- ctrl+RMB: tank turret turning
- MMB: unit/alien inventory preview
- MMB: weapon/special weapon click = Ufopedia

Big thanks to robin to the button artwork.
« Last Edit: March 08, 2021, 01:27:16 pm by Meridian »

Offline robin

  • Commander
  • *****
  • Posts: 1224
  • ULTIMATE ROOKIE
    • View Profile
Re: [Documentation] Touch buttons
« Reply #1 on: March 15, 2021, 11:48:59 pm »
I notice there are some artifacts on the TFTD buttons. Is there something that I need to fix?

Edit: could be related to the palette? I noticed the "pure white" color appears 3 times, one of which is in the transparent position (the last color).
Strange. I used the top one (see attachment), but the circled ones are all the same color.
I'm not really familiar with this palette, I used the depth-0 one, but I used the standard colors used in the default UI, those should be always there.
« Last Edit: March 15, 2021, 11:59:07 pm by robin »

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9088
    • View Profile
Re: [Documentation] Touch buttons
« Reply #2 on: March 15, 2021, 11:59:13 pm »
Yeah, the palette seems to have white color on index 255 in your image.

The color in the game is close to pure black though. e.g. rgb (0,20,16)  #001410 in hex

Btw. index 255 is not transparent, only index 0 is transparent.
« Last Edit: March 16, 2021, 12:22:28 am by Meridian »

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9088
    • View Profile
Re: [Documentation] Touch buttons
« Reply #3 on: March 16, 2021, 12:02:36 am »
You can use the palette from `oxceLinks.png` in `\standard\xcom2\Resources\Extended\` if you want.

Offline robin

  • Commander
  • *****
  • Posts: 1224
  • ULTIMATE ROOKIE
    • View Profile
Re: [Documentation] Touch buttons
« Reply #4 on: March 16, 2021, 12:12:24 am »
seems an issue with photoshop, if I extract the palette from a tftd sprite sheet, I still get the white color in the last index...
no wait, even using irfanview on PCK-viewer extracted images, shows white. lol
« Last Edit: March 16, 2021, 12:14:44 am by robin »

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9088
    • View Profile
Re: [Documentation] Touch buttons
« Reply #5 on: March 16, 2021, 12:16:29 am »
I prepared photoshop palettes here: https://github.com/MeridianOXC/OpenXcom/tree/oxce-plus/bin/common/Palettes/TFTD-ACT-SAFE

If you download from there, does it look better?

I'm not exactly sure which one is mostly used to draw battlescape sprites, I think it's either PAL_BATTLESCAPE_2_SAFE.act (or PAL_BATTLESCAPE_SAFE.act).

Offline robin

  • Commander
  • *****
  • Posts: 1224
  • ULTIMATE ROOKIE
    • View Profile
Re: [Documentation] Touch buttons
« Reply #6 on: March 16, 2021, 12:42:38 am »
This should be fixed.
My old version of photoshop is a pain in the ass for managing the palettes.

I think you should upload link those palettes here:
https://openxcom.org/forum/index.php/topic,1557.0.html
the ones already there are problematic at this point.
Edit: nope, my photoshop can't into your palettes, I have to fix manually my old ones. Anyway the attached buttons should be ok, hopefully.
« Last Edit: March 16, 2021, 12:52:11 am by robin »

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9088
    • View Profile
Re: [Documentation] Touch buttons
« Reply #7 on: March 16, 2021, 09:43:54 am »
thank you

Offline robin

  • Commander
  • *****
  • Posts: 1224
  • ULTIMATE ROOKIE
    • View Profile
Re: [Documentation] Touch buttons
« Reply #8 on: March 16, 2021, 10:12:51 pm »
no problem!
let me know if you notice something else.

Offline Nord

  • Commander
  • *****
  • Posts: 1746
  • The Gate is open.
    • View Profile
Re: [Documentation] Touch buttons
« Reply #9 on: March 17, 2021, 05:53:33 am »
At last! Many thanks.