1hubert / genshin-dialogue-autoskip

A simple python script to automatically skip dialogue in Genshin Impact
MIT License
63 stars 23 forks source link

Added support for wider screens. #44

Closed 0withoutface0 closed 2 months ago

0withoutface0 commented 2 months ago

This is my first ever pull request so I might have made mistakes.

Tested up to 5760x1080 resolution. Added some functions like get_position_right to calculate the position of certain pixels on larger screens. Brute forced it out that genshin uses the right and the left window borders to calculate button positions and it follows a pretty similar pattern so it can be calculated by ratio + a few extra pixels.

Some examples: screen 5760x1080

  BOTTOM_DIALOGUE_MIN_X  4287
  BOTTOM_DIALOGUE_MAX_X  4848
  PLAYING_ICON_X  230

screen 3840x1080

  BOTTOM_DIALOGUE_MIN_X  2734
  BOTTOM_DIALOGUE_MAX_X  3303
  PLAYING_ICON_X  230

screen 2560x1080 (in theory)

  BOTTOM_DIALOGUE_MIN_X  1778
  BOTTOM_DIALOGUE_MAX_X  2234
  PLAYING_ICON_X  132

screen 1920x1080

  BOTTOM_DIALOGUE_MIN_X  1300
  BOTTOM_DIALOGUE_MAX_X  1700
  PLAYING_ICON_X  84