Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added stubs for D3DShot #8652

Merged
merged 38 commits into from Sep 12, 2022
Merged

Added stubs for D3DShot #8652

merged 38 commits into from Sep 12, 2022

Conversation

Avasam
Copy link
Sponsor Collaborator

@Avasam Avasam commented Aug 30, 2022

I've filled in the types as best as I could. But I might need help with a few things.

  1. I am not sure how to deal with the placeholder _Pointer types yet. I think I may have to create new classes just to expose their methods when type-checking. Although I think this PR is probably acceptable keeping them as Incomplete for now.
  2. I created a placeholder _Frame type. Is it possible to type the D3DShot class based on which backend it uses? Otherwise I have to keep casting the _Frames when using it: Edit, doesn't matter because of Allow non-types dependencies #5768
    image
  3. I don't know how to deal with import issues in the CI. Allow non-types dependencies #5768

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Avasam added a commit to Avasam/AutoSplit that referenced this pull request Aug 31, 2022
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@Avasam
Copy link
Sponsor Collaborator Author

Avasam commented Aug 31, 2022

I don't understand the stubtest. Other than that, ready for review.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@Avasam Avasam marked this pull request as draft September 2, 2022 15:35
Avasam added a commit to Avasam/AutoSplit that referenced this pull request Sep 3, 2022
Avasam added a commit to Avasam/AutoSplit that referenced this pull request Sep 3, 2022
Toufool pushed a commit to Toufool/AutoSplit that referenced this pull request Sep 3, 2022
Toufool added a commit to Toufool/AutoSplit that referenced this pull request Sep 4, 2022
* Fix #52 Comparisons with empty masks

* Save 'Check For Updates On Open' immediatly

* showErrorSignal to show error message box from another thread

* Fixes #86 Stop uncaught exceptions from silently crashing the app

* Fixes #86 Stop uncaught exceptions from silently crashing the app

* Fix #114, try to load Start Image on browse & load settings, don't allow a start image to load if hotkeys are not set.

* First linting pass
Configured VSCode and Markdownlint settings
Added and configured the following linters as strict as I could: pylint, flake8, mypy, bandit, pyright
Partially filled in some type stubs: cv2, imagehash, keyboard, pyautogui, pythonwin, win32helper
[Breaking change] Using interpolation=cv2.INTER_NEAREST everywhere as it is the fastest interlpolation method
Hide generated/compiled files
SelectRegionWidget width and height as functions
Added validate_images_before_parsing() to validate images both before maxFPS and starting autosplitter

* Moved most settings to pyproject.toml and ran autopep8

* Removed mypy and Fixed import-outside-toplevel

* Double quotes and pylint complete linting

* Configured linting workflow

* Async check for updates

* Fix crash on LiveSplit open and missing link in error message

* Merge

* Fixed certificate error and random crash on open when compiled

* Using python/typeshed/pull/6492

* PEP8 naming convention

* Added build artifact

* AutoSplitImage Class and simplified code
Simplified and reduced image conversions
Reduced duplicated code, especially in settings
Build Artifact

* Average FPS over all images with all actions

* Added badges

* Fixed "Select Window" not working for windows with negative coordinates
Split screen_region in smaller functions
WIP towards #94:
No pop-up on loading settings with no capture window
 Don't stop/reset AutoSplit upon loosing capture window
 No pop-up on loosing capture window
 Don't allow selecting desktop.

* Ability to recover window

Fixed regressions:
Fix crash on clising window mid-run
Forgot to migrate split_delay to image.delay
Removed dead load_pyqt_settings code
Fixed dummy groups
Pause time from filename not set correctly
Setting hotkeys on load

* Differentiate "undo/skip split" from "previous/next image"
Skip/udo will now actually call command
This makes grouping option obsolete as user now has finer control anyway
UI is a bit cramped, but that should be resolved with UI revamp
Updated README

* Make Save Settings more intuitive
Don't close if user has cancelled "saving sattings as"
Removed more attributes from AutoSplit class
Don't update last_successfully_loaded_settings_file_path if load was not successful
"Save Settings As" defaults to the last_successfully_loaded_settings_file_path THEN the .exe
When closing app, ue save_settings instead of save_settings_as

* Initial UI update for 2.0.0. Add settings window.

* Hooked new settings window to actual values (#151)

* Initial UI update for 2.0.0. Add settings window.

* hooked new settings window to actual values

* Better "seconds remaining" text

* Undo split goes to the end of the group

Co-authored-by: Austin <37423484+Toufool@users.noreply.github.com>

* Image comparison method and default delay time (#135)

* hooked new settings window to actual values

* Implemented image specific comparison method and default delay time.
Closes #26

* Initial UI update for 2.0.0. Add settings window.

* hooked new settings window to actual values

* Better "seconds remaining" text

* Undo split goes to the end of the group

* Fixed images comparison method defaulting to 0 rather than none

Co-authored-by: Austin <37423484+Toufool@users.noreply.github.com>

* Support hotkeys with modifiers (#136)

* hooked new settings window to actual values

* Better "seconds remaining" text

* Support modifiers the same way LiveSplit does. Closes #34

* Initial UI update for 2.0.0. Add settings window.

* hooked new settings window to actual values

* Better "seconds remaining" text

* Undo split goes to the end of the group

Co-authored-by: Austin <37423484+Toufool@users.noreply.github.com>

* Linted pyi files (#137)

* hooked new settings window to actual values

* Linted pyi files

* Initial UI update for 2.0.0. Add settings window.

* hooked new settings window to actual values

* Better "seconds remaining" text

* Undo split goes to the end of the group

* Turn off pyright(reportFunctionMemberAccess) in favor of pylint(no-member)

* Massively sped up Flake tests
Removed 400+kb of type stubs

* Centralized qWait typing fix

* Autosort imports

* Resynced settings

Co-authored-by: Austin <37423484+Toufool@users.noreply.github.com>

* Toml profiles + Python 3.10 (#140)

* Typings update

* Full setup and configuration update

* User Profile, Revamped settings, Start image fixes & __auto_splitter method refactor

* Added new Capture Method system for more capture options + utils (#141)

* Add D3DShot types
from python/typeshed#8652

* New Capture Method system

* Warning if AutoSplit is already open + Build number + Splash Screen + Doc update + Fixes (#161)

* Doc + Setup update

* typings update

* Warning if AutoSplit is already open + Build number + Splash Screen

* Target the right repository/fork

* Fix #155

* Actions shortcut and prevent double open window
Closes #154

* ImageHash hotfix

* Toggle autoreset image + ui adjustments

Co-authored-by: Austin <37423484+Toufool@users.noreply.github.com>
Toufool added a commit to Toufool/AutoSplit that referenced this pull request Sep 4, 2022
* update credits

* oops

* Toggle autoreset image (#162)

* Fix #52 Comparisons with empty masks

* Save 'Check For Updates On Open' immediatly

* showErrorSignal to show error message box from another thread

* Fixes #86 Stop uncaught exceptions from silently crashing the app

* Fixes #86 Stop uncaught exceptions from silently crashing the app

* Fix #114, try to load Start Image on browse & load settings, don't allow a start image to load if hotkeys are not set.

* First linting pass
Configured VSCode and Markdownlint settings
Added and configured the following linters as strict as I could: pylint, flake8, mypy, bandit, pyright
Partially filled in some type stubs: cv2, imagehash, keyboard, pyautogui, pythonwin, win32helper
[Breaking change] Using interpolation=cv2.INTER_NEAREST everywhere as it is the fastest interlpolation method
Hide generated/compiled files
SelectRegionWidget width and height as functions
Added validate_images_before_parsing() to validate images both before maxFPS and starting autosplitter

* Moved most settings to pyproject.toml and ran autopep8

* Removed mypy and Fixed import-outside-toplevel

* Double quotes and pylint complete linting

* Configured linting workflow

* Async check for updates

* Fix crash on LiveSplit open and missing link in error message

* Merge

* Fixed certificate error and random crash on open when compiled

* Using python/typeshed/pull/6492

* PEP8 naming convention

* Added build artifact

* AutoSplitImage Class and simplified code
Simplified and reduced image conversions
Reduced duplicated code, especially in settings
Build Artifact

* Average FPS over all images with all actions

* Added badges

* Fixed "Select Window" not working for windows with negative coordinates
Split screen_region in smaller functions
WIP towards #94:
No pop-up on loading settings with no capture window
 Don't stop/reset AutoSplit upon loosing capture window
 No pop-up on loosing capture window
 Don't allow selecting desktop.

* Ability to recover window

Fixed regressions:
Fix crash on clising window mid-run
Forgot to migrate split_delay to image.delay
Removed dead load_pyqt_settings code
Fixed dummy groups
Pause time from filename not set correctly
Setting hotkeys on load

* Differentiate "undo/skip split" from "previous/next image"
Skip/udo will now actually call command
This makes grouping option obsolete as user now has finer control anyway
UI is a bit cramped, but that should be resolved with UI revamp
Updated README

* Make Save Settings more intuitive
Don't close if user has cancelled "saving sattings as"
Removed more attributes from AutoSplit class
Don't update last_successfully_loaded_settings_file_path if load was not successful
"Save Settings As" defaults to the last_successfully_loaded_settings_file_path THEN the .exe
When closing app, ue save_settings instead of save_settings_as

* Initial UI update for 2.0.0. Add settings window.

* Hooked new settings window to actual values (#151)

* Initial UI update for 2.0.0. Add settings window.

* hooked new settings window to actual values

* Better "seconds remaining" text

* Undo split goes to the end of the group

Co-authored-by: Austin <37423484+Toufool@users.noreply.github.com>

* Image comparison method and default delay time (#135)

* hooked new settings window to actual values

* Implemented image specific comparison method and default delay time.
Closes #26

* Initial UI update for 2.0.0. Add settings window.

* hooked new settings window to actual values

* Better "seconds remaining" text

* Undo split goes to the end of the group

* Fixed images comparison method defaulting to 0 rather than none

Co-authored-by: Austin <37423484+Toufool@users.noreply.github.com>

* Support hotkeys with modifiers (#136)

* hooked new settings window to actual values

* Better "seconds remaining" text

* Support modifiers the same way LiveSplit does. Closes #34

* Initial UI update for 2.0.0. Add settings window.

* hooked new settings window to actual values

* Better "seconds remaining" text

* Undo split goes to the end of the group

Co-authored-by: Austin <37423484+Toufool@users.noreply.github.com>

* Linted pyi files (#137)

* hooked new settings window to actual values

* Linted pyi files

* Initial UI update for 2.0.0. Add settings window.

* hooked new settings window to actual values

* Better "seconds remaining" text

* Undo split goes to the end of the group

* Turn off pyright(reportFunctionMemberAccess) in favor of pylint(no-member)

* Massively sped up Flake tests
Removed 400+kb of type stubs

* Centralized qWait typing fix

* Autosort imports

* Resynced settings

Co-authored-by: Austin <37423484+Toufool@users.noreply.github.com>

* Toml profiles + Python 3.10 (#140)

* Typings update

* Full setup and configuration update

* User Profile, Revamped settings, Start image fixes & __auto_splitter method refactor

* Added new Capture Method system for more capture options + utils (#141)

* Add D3DShot types
from python/typeshed#8652

* New Capture Method system

* Warning if AutoSplit is already open + Build number + Splash Screen + Doc update + Fixes (#161)

* Doc + Setup update

* typings update

* Warning if AutoSplit is already open + Build number + Splash Screen

* Target the right repository/fork

* Fix #155

* Actions shortcut and prevent double open window
Closes #154

* ImageHash hotfix

* Toggle autoreset image + ui adjustments

Co-authored-by: Austin <37423484+Toufool@users.noreply.github.com>

* Revert "Toggle autoreset image (#162)" (#163)

This reverts commit 9e48c51.

Co-authored-by: Samuel T <samuel.06@hotmail.com>
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

1 similar comment
@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@AlexWaygood
Copy link
Member

AlexWaygood commented Sep 12, 2022

Nit: Could you possibly avoid force-pushing for typeshed PRs, where possible (once people have started reviewing)? They interact badly with the GitHub UI, making it harder to see what changed between commits, thus making it harder for us to iteratively review :)

(Everything here gets squash-merged in the end anyway, so we definitely don't care about messy history for PRs!)

@Avasam
Copy link
Sponsor Collaborator Author

Avasam commented Sep 12, 2022

Nit: Could you possibly avoid force-pushing for typeshed PRs, where possible (once people have started reviewing)? They interact badly with the GitHub UI, making it harder to see what changed between commits, thus making it harder for us to iteratively review :)

(Everything here gets squash-merged in the end anyway, so we definitely don't care about messy history for PRs!)

Ah shoot, I though it'd be fine for a quick typo fix before any re-review. But if even that messes it up, of course.

On a different note, do you know if it's possible to make CaptureOutput generic since _Frame depends on the backend? I'm less familiar with Python generic classes. Not that it really matters until #5768 anyway.

@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@AlexWaygood
Copy link
Member

On a different note, do you know if it's possible to make CaptureOutput generic since _Frame depends on the backend? I'm less familiar with Python generic classes. Not that it really matters until #5768 anyway.

We could do, and in some ways it seems like a good candidate for a generic class. But, as you say, it doesn't really matter until #5768. And there are also some serious downsides to making classes in the stub generic if they're not generic at runtime -- for example, subclassing the class becomes very annoying (see, e.g., #7855). So, I'm inclined to say, "Let's not overcomplicate it for now, and leave it as it is."

@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're very nearly there, I think. Thanks for all your work on this, this is a really tough one!

stubs/D3DShot/d3dshot/d3dshot.pyi Outdated Show resolved Hide resolved
stubs/D3DShot/d3dshot/capture_output.pyi Show resolved Hide resolved
stubs/D3DShot/d3dshot/display.pyi Outdated Show resolved Hide resolved
Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your patience! Let's land this.

@AlexWaygood AlexWaygood merged commit 3ec7b1f into python:master Sep 12, 2022
@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

2 similar comments
@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@Avasam Avasam deleted the D3DShot branch September 12, 2022 18:07
Toufool added a commit to Toufool/AutoSplit that referenced this pull request Mar 25, 2023
* First linting pass
Configured VSCode and Markdownlint settings
Added and configured the following linters as strict as I could: pylint, flake8, mypy, bandit, pyright
Partially filled in some type stubs: cv2, imagehash, keyboard, pyautogui, pythonwin, win32helper
[Breaking change] Using interpolation=cv2.INTER_NEAREST everywhere as it is the fastest interlpolation method
Hide generated/compiled files
SelectRegionWidget width and height as functions
Added validate_images_before_parsing() to validate images both before maxFPS and starting autosplitter

* Moved most settings to pyproject.toml and ran autopep8

* Removed mypy and Fixed import-outside-toplevel

* Double quotes and pylint complete linting

* Configured linting workflow

* add pause after start image tip

* Fix crash on LiveSplit open and missing link in error message

* Merge

* Fixed certificate error and random crash on open when compiled

* Using python/typeshed/pull/6492

* PEP8 naming convention

* Added build artifact

* AutoSplitImage Class and simplified code
Simplified and reduced image conversions
Reduced duplicated code, especially in settings
Build Artifact

* Average FPS over all images with all actions

* Added badges

* Fixed "Select Window" not working for windows with negative coordinates
Split screen_region in smaller functions
WIP towards #94:
No pop-up on loading settings with no capture window
 Don't stop/reset AutoSplit upon loosing capture window
 No pop-up on loosing capture window
 Don't allow selecting desktop.

* Ability to recover window

Fixed regressions:
Fix crash on clising window mid-run
Forgot to migrate split_delay to image.delay
Removed dead load_pyqt_settings code
Fixed dummy groups
Pause time from filename not set correctly
Setting hotkeys on load

* Differentiate "undo/skip split" from "previous/next image"
Skip/udo will now actually call command
This makes grouping option obsolete as user now has finer control anyway
UI is a bit cramped, but that should be resolved with UI revamp
Updated README

* Make Save Settings more intuitive
Don't close if user has cancelled "saving sattings as"
Removed more attributes from AutoSplit class
Don't update last_successfully_loaded_settings_file_path if load was not successful
"Save Settings As" defaults to the last_successfully_loaded_settings_file_path THEN the .exe
When closing app, ue save_settings instead of save_settings_as

* Initial UI update for 2.0.0. Add settings window.

* Hooked new settings window to actual values (#151)

* Initial UI update for 2.0.0. Add settings window.

* hooked new settings window to actual values

* Better "seconds remaining" text

* Undo split goes to the end of the group

Co-authored-by: Austin <37423484+Toufool@users.noreply.github.com>

* Image comparison method and default delay time (#135)

* hooked new settings window to actual values

* Implemented image specific comparison method and default delay time.
Closes #26

* Initial UI update for 2.0.0. Add settings window.

* hooked new settings window to actual values

* Better "seconds remaining" text

* Undo split goes to the end of the group

* Fixed images comparison method defaulting to 0 rather than none

Co-authored-by: Austin <37423484+Toufool@users.noreply.github.com>

* Support hotkeys with modifiers (#136)

* hooked new settings window to actual values

* Better "seconds remaining" text

* Support modifiers the same way LiveSplit does. Closes #34

* Initial UI update for 2.0.0. Add settings window.

* hooked new settings window to actual values

* Better "seconds remaining" text

* Undo split goes to the end of the group

Co-authored-by: Austin <37423484+Toufool@users.noreply.github.com>

* Linted pyi files (#137)

* hooked new settings window to actual values

* Linted pyi files

* Initial UI update for 2.0.0. Add settings window.

* hooked new settings window to actual values

* Better "seconds remaining" text

* Undo split goes to the end of the group

* Turn off pyright(reportFunctionMemberAccess) in favor of pylint(no-member)

* Massively sped up Flake tests
Removed 400+kb of type stubs

* Centralized qWait typing fix

* Autosort imports

* Resynced settings

Co-authored-by: Austin <37423484+Toufool@users.noreply.github.com>

* Toml profiles + Python 3.10 (#140)

* Typings update

* Full setup and configuration update

* User Profile, Revamped settings, Start image fixes & __auto_splitter method refactor

* Added new Capture Method system for more capture options + utils (#141)

* Add D3DShot types
from python/typeshed#8652

* New Capture Method system

* Warning if AutoSplit is already open + Build number + Splash Screen + Doc update + Fixes (#161)

* Doc + Setup update

* typings update

* Warning if AutoSplit is already open + Build number + Splash Screen

* Target the right repository/fork

* Fix #155

* Actions shortcut and prevent double open window
Closes #154

* ImageHash hotfix

* Toggle autoreset image + ui adjustments (#164)

* merge master into 2.0.0 (#165)

* update credits

* oops

* Toggle autoreset image (#162)

* Fix #52 Comparisons with empty masks

* Save 'Check For Updates On Open' immediatly

* showErrorSignal to show error message box from another thread

* Fixes #86 Stop uncaught exceptions from silently crashing the app

* Fixes #86 Stop uncaught exceptions from silently crashing the app

* Fix #114, try to load Start Image on browse & load settings, don't allow a start image to load if hotkeys are not set.

* First linting pass
Configured VSCode and Markdownlint settings
Added and configured the following linters as strict as I could: pylint, flake8, mypy, bandit, pyright
Partially filled in some type stubs: cv2, imagehash, keyboard, pyautogui, pythonwin, win32helper
[Breaking change] Using interpolation=cv2.INTER_NEAREST everywhere as it is the fastest interlpolation method
Hide generated/compiled files
SelectRegionWidget width and height as functions
Added validate_images_before_parsing() to validate images both before maxFPS and starting autosplitter

* Moved most settings to pyproject.toml and ran autopep8

* Removed mypy and Fixed import-outside-toplevel

* Double quotes and pylint complete linting

* Configured linting workflow

* Async check for updates

* Fix crash on LiveSplit open and missing link in error message

* Merge

* Fixed certificate error and random crash on open when compiled

* Using python/typeshed/pull/6492

* PEP8 naming convention

* Added build artifact

* AutoSplitImage Class and simplified code
Simplified and reduced image conversions
Reduced duplicated code, especially in settings
Build Artifact

* Average FPS over all images with all actions

* Added badges

* Fixed "Select Window" not working for windows with negative coordinates
Split screen_region in smaller functions
WIP towards #94:
No pop-up on loading settings with no capture window
 Don't stop/reset AutoSplit upon loosing capture window
 No pop-up on loosing capture window
 Don't allow selecting desktop.

* Ability to recover window

Fixed regressions:
Fix crash on clising window mid-run
Forgot to migrate split_delay to image.delay
Removed dead load_pyqt_settings code
Fixed dummy groups
Pause time from filename not set correctly
Setting hotkeys on load

* Differentiate "undo/skip split" from "previous/next image"
Skip/udo will now actually call command
This makes grouping option obsolete as user now has finer control anyway
UI is a bit cramped, but that should be resolved with UI revamp
Updated README

* Make Save Settings more intuitive
Don't close if user has cancelled "saving sattings as"
Removed more attributes from AutoSplit class
Don't update last_successfully_loaded_settings_file_path if load was not successful
"Save Settings As" defaults to the last_successfully_loaded_settings_file_path THEN the .exe
When closing app, ue save_settings instead of save_settings_as

* Initial UI update for 2.0.0. Add settings window.

* Hooked new settings window to actual values (#151)

* Initial UI update for 2.0.0. Add settings window.

* hooked new settings window to actual values

* Better "seconds remaining" text

* Undo split goes to the end of the group

Co-authored-by: Austin <37423484+Toufool@users.noreply.github.com>

* Image comparison method and default delay time (#135)

* hooked new settings window to actual values

* Implemented image specific comparison method and default delay time.
Closes #26

* Initial UI update for 2.0.0. Add settings window.

* hooked new settings window to actual values

* Better "seconds remaining" text

* Undo split goes to the end of the group

* Fixed images comparison method defaulting to 0 rather than none

Co-authored-by: Austin <37423484+Toufool@users.noreply.github.com>

* Support hotkeys with modifiers (#136)

* hooked new settings window to actual values

* Better "seconds remaining" text

* Support modifiers the same way LiveSplit does. Closes #34

* Initial UI update for 2.0.0. Add settings window.

* hooked new settings window to actual values

* Better "seconds remaining" text

* Undo split goes to the end of the group

Co-authored-by: Austin <37423484+Toufool@users.noreply.github.com>

* Linted pyi files (#137)

* hooked new settings window to actual values

* Linted pyi files

* Initial UI update for 2.0.0. Add settings window.

* hooked new settings window to actual values

* Better "seconds remaining" text

* Undo split goes to the end of the group

* Turn off pyright(reportFunctionMemberAccess) in favor of pylint(no-member)

* Massively sped up Flake tests
Removed 400+kb of type stubs

* Centralized qWait typing fix

* Autosort imports

* Resynced settings

Co-authored-by: Austin <37423484+Toufool@users.noreply.github.com>

* Toml profiles + Python 3.10 (#140)

* Typings update

* Full setup and configuration update

* User Profile, Revamped settings, Start image fixes & __auto_splitter method refactor

* Added new Capture Method system for more capture options + utils (#141)

* Add D3DShot types
from python/typeshed#8652

* New Capture Method system

* Warning if AutoSplit is already open + Build number + Splash Screen + Doc update + Fixes (#161)

* Doc + Setup update

* typings update

* Warning if AutoSplit is already open + Build number + Splash Screen

* Target the right repository/fork

* Fix #155

* Actions shortcut and prevent double open window
Closes #154

* ImageHash hotfix

* Toggle autoreset image + ui adjustments

Co-authored-by: Austin <37423484+Toufool@users.noreply.github.com>

* Revert "Toggle autoreset image (#162)" (#163)

This reverts commit 9e48c51.

Co-authored-by: Samuel T <samuel.06@hotmail.com>

* test building without --windowed

* First round of QA testing fixes (#171)

* Added sonarcloud.properties

* Remove duplicate DeleteDC & allow errors to show
May fix #167

* Rename CaptureMethodInterface to CaptureMethodBase

* Added autofix script and faster linting

* Disable device probing for now. Fixes #169

* Updated settings widget text
and workaround to fix #170

* Bump AUTOSPLIT_VERSION

* Next Image even if it's not possible to split
Fixes #168

* Fix build

* First round of QA testing fixes + build fixes (#172)

* back to windowed

* Fix #47, updated some configs and types from typeshed (#173)

* Updated configs

* Updated typings

* Updated some code

* Fix #47

* Revert mypy stuff

* More consistent formatting (#174)

* More consistent formatting and types
- Added autofixes to the lint script.
- Added a quotes autofixer using `unify`
- Added a trailing comma checker and autofixer
- Applied trailing commas
- Ordered requirements alphabetically
- Ensure the last version of D3DShot is used (0.1.5, not 0.1.3)
- Remove configuration for unused linters (black/prettier/sonarlint)
- Updated types from typeshed

* Updated virtual camera link

* Update types and pylint

* Batch fixes (#176)

* pyright update

* lint-and-build cover more files

* Get IDirect3dDevice from LearningModelDevice
Closes #175

Co-authored-by: Algomancer <hibble.code@gmail.com>

* Ensure we're using the right camera size
And not OpenCV's default 640x480

* Fix rounding error in displayed decimal

* Revert "back to windowed"

This reverts commit 9553271.

* Fix highest similarity for start image

* Fix split below treshold when image is not valid

* Detect gray frames from OBS-Camera

Co-authored-by: Algomancer <hibble.code@gmail.com>

* Adaptive resizing for masked images (#177)

Especially in the case of 1080p or higher, if the non-transparent area of the mask image used for the split is small, resizing the entire image to 320x240 will lose the information inside the mask. One idea to prevent this is to adaptively determine the target size according to the number of nonzero elements in the alpha channel of the split image. At least for the L2 norm and histogram, such a change would not affect performance since they only use information about the mask's interior. Masks are not recommended with pHash anyway.

Co-authored-by: zalgo3 <zalgo3333@gmail.com>

* Bump opencv-python to 4.6 (#178)

* Point python_grabber to andreaschiavinato (#179)

* Batch of updates and fixes for 2.0.0 (#188)

* Point python_grabber to andreaschiavinato

* Added summary of histogram

* Backport changes from linux branch

* Improved pyright and formatters usage

* Config updates

* Fix links

* Disable next/previous while delaying

* proper `is_running` variable

* Fix loading and clearing of start image

* Rename "already_running" to "already_open"

* Fix delay intervals

* Add support for start image pause time

* Default to MediaCapture's d3d

* Re-enable buttons after delay

* Beta 1 (feature-freeze, bugfixes only)

* Updated configs to use Python 3.11 (#180)

* Option to build without build number + Adaptive mask fix (#189)

* Option to build without build number

* Fix repo url from workflow build

* Resize mask with image

* Pin more dependencies, Speed-up installs and update comments

* Add mypy config for optional support.

* pin requests and allow pyright warnings (#193)

* Fix B028 (#194)

* Fixed run_start_time with start image pause loop (#197)

Also fixed run_start_time not accounting for the delay in parsing images

* Disable Capture device: dropdown when Capture method: is not Video Capture Device (#198)

Fix issue with programatically setting capture_device_combobox index

* Fix start issue after finishing splits  (#199)

* Fix start issue after finishing splits
- `self.is_running = False` at the end of `__auto_splitter`
- Revert moving initialization of some values
- Move `self.run_start_time = time()` before parsing images

* Update hardcoded references to repo name

* Change default capture method to WGA (#200)

* Delete example1.6.0.gif

* 2.0.0 gif

* update gif to 2.0.0

* Update some docs and fix lint issue (#202)

* Update docs, comments and typings
Add link to dev builds
bump beta version
Update flake8 checks
"fix" typing issue caused by PyQt6 incorrect callable

* Slight build improvement

* Fix D3DDD issue on hybrid GPU laptops (#205)

* Fix D3DDD issue on hybrid gpu laptops

1. Some Desktop Duplication setup was done in advance, even if that method won't be used
2. Hybrid GPU laptops can have issues with D3D Desktop Duplication. The issue and a workaround is now documented

* Fixed some blocking typing and linting issues

* Fix obs-camera image freezing for a sec when it gives a blank frame (#206)

---------

Co-authored-by: Austin <37423484+Toufool@users.noreply.github.com>
Co-authored-by: Algomancer <hibble.code@gmail.com>
Co-authored-by: zalgo3 <zalgo3333@gmail.com>
Toufool added a commit to Toufool/AutoSplit that referenced this pull request Apr 22, 2023
* Fix #52 Comparisons with empty masks

* Save 'Check For Updates On Open' immediatly

* showErrorSignal to show error message box from another thread

* Fixes #86 Stop uncaught exceptions from silently crashing the app

* Fixes #86 Stop uncaught exceptions from silently crashing the app

* Fix #114, try to load Start Image on browse & load settings, don't allow a start image to load if hotkeys are not set.

* First linting pass
Configured VSCode and Markdownlint settings
Added and configured the following linters as strict as I could: pylint, flake8, mypy, bandit, pyright
Partially filled in some type stubs: cv2, imagehash, keyboard, pyautogui, pythonwin, win32helper
[Breaking change] Using interpolation=cv2.INTER_NEAREST everywhere as it is the fastest interlpolation method
Hide generated/compiled files
SelectRegionWidget width and height as functions
Added validate_images_before_parsing() to validate images both before maxFPS and starting autosplitter

* Moved most settings to pyproject.toml and ran autopep8

* Removed mypy and Fixed import-outside-toplevel

* Double quotes and pylint complete linting

* Configured linting workflow

* Async check for updates

* Fix crash on LiveSplit open and missing link in error message

* Merge

* Fixed certificate error and random crash on open when compiled

* Using python/typeshed/pull/6492

* PEP8 naming convention

* Added build artifact

* AutoSplitImage Class and simplified code
Simplified and reduced image conversions
Reduced duplicated code, especially in settings
Build Artifact

* Average FPS over all images with all actions

* Added badges

* Fixed "Select Window" not working for windows with negative coordinates
Split screen_region in smaller functions
WIP towards #94:
No pop-up on loading settings with no capture window
 Don't stop/reset AutoSplit upon loosing capture window
 No pop-up on loosing capture window
 Don't allow selecting desktop.

* Ability to recover window

Fixed regressions:
Fix crash on clising window mid-run
Forgot to migrate split_delay to image.delay
Removed dead load_pyqt_settings code
Fixed dummy groups
Pause time from filename not set correctly
Setting hotkeys on load

* Differentiate "undo/skip split" from "previous/next image"
Skip/udo will now actually call command
This makes grouping option obsolete as user now has finer control anyway
UI is a bit cramped, but that should be resolved with UI revamp
Updated README

* Make Save Settings more intuitive
Don't close if user has cancelled "saving sattings as"
Removed more attributes from AutoSplit class
Don't update last_successfully_loaded_settings_file_path if load was not successful
"Save Settings As" defaults to the last_successfully_loaded_settings_file_path THEN the .exe
When closing app, ue save_settings instead of save_settings_as

* Initial UI update for 2.0.0. Add settings window.

* Hooked new settings window to actual values (#151)

* Initial UI update for 2.0.0. Add settings window.

* hooked new settings window to actual values

* Better "seconds remaining" text

* Undo split goes to the end of the group

Co-authored-by: Austin <37423484+Toufool@users.noreply.github.com>

* Image comparison method and default delay time (#135)

* hooked new settings window to actual values

* Implemented image specific comparison method and default delay time.
Closes #26

* Initial UI update for 2.0.0. Add settings window.

* hooked new settings window to actual values

* Better "seconds remaining" text

* Undo split goes to the end of the group

* Fixed images comparison method defaulting to 0 rather than none

Co-authored-by: Austin <37423484+Toufool@users.noreply.github.com>

* Support hotkeys with modifiers (#136)

* hooked new settings window to actual values

* Better "seconds remaining" text

* Support modifiers the same way LiveSplit does. Closes #34

* Initial UI update for 2.0.0. Add settings window.

* hooked new settings window to actual values

* Better "seconds remaining" text

* Undo split goes to the end of the group

Co-authored-by: Austin <37423484+Toufool@users.noreply.github.com>

* Linted pyi files (#137)

* hooked new settings window to actual values

* Linted pyi files

* Initial UI update for 2.0.0. Add settings window.

* hooked new settings window to actual values

* Better "seconds remaining" text

* Undo split goes to the end of the group

* Turn off pyright(reportFunctionMemberAccess) in favor of pylint(no-member)

* Massively sped up Flake tests
Removed 400+kb of type stubs

* Centralized qWait typing fix

* Autosort imports

* Resynced settings

Co-authored-by: Austin <37423484+Toufool@users.noreply.github.com>

* Toml profiles + Python 3.10 (#140)

* Typings update

* Full setup and configuration update

* User Profile, Revamped settings, Start image fixes & __auto_splitter method refactor

* Added new Capture Method system for more capture options + utils (#141)

* Add D3DShot types
from python/typeshed#8652

* New Capture Method system

* Warning if AutoSplit is already open + Build number + Splash Screen + Doc update + Fixes (#161)

* Doc + Setup update

* typings update

* Warning if AutoSplit is already open + Build number + Splash Screen

* Target the right repository/fork

* Fix #155

* Actions shortcut and prevent double open window
Closes #154

* ImageHash hotfix

* Toggle autoreset image + ui adjustments (#164)

* merge master into 2.0.0 (#165)

* update credits

* oops

* Toggle autoreset image (#162)

* Fix #52 Comparisons with empty masks

* Save 'Check For Updates On Open' immediatly

* showErrorSignal to show error message box from another thread

* Fixes #86 Stop uncaught exceptions from silently crashing the app

* Fixes #86 Stop uncaught exceptions from silently crashing the app

* Fix #114, try to load Start Image on browse & load settings, don't allow a start image to load if hotkeys are not set.

* First linting pass
Configured VSCode and Markdownlint settings
Added and configured the following linters as strict as I could: pylint, flake8, mypy, bandit, pyright
Partially filled in some type stubs: cv2, imagehash, keyboard, pyautogui, pythonwin, win32helper
[Breaking change] Using interpolation=cv2.INTER_NEAREST everywhere as it is the fastest interlpolation method
Hide generated/compiled files
SelectRegionWidget width and height as functions
Added validate_images_before_parsing() to validate images both before maxFPS and starting autosplitter

* Moved most settings to pyproject.toml and ran autopep8

* Removed mypy and Fixed import-outside-toplevel

* Double quotes and pylint complete linting

* Configured linting workflow

* Async check for updates

* Fix crash on LiveSplit open and missing link in error message

* Merge

* Fixed certificate error and random crash on open when compiled

* Using python/typeshed/pull/6492

* PEP8 naming convention

* Added build artifact

* AutoSplitImage Class and simplified code
Simplified and reduced image conversions
Reduced duplicated code, especially in settings
Build Artifact

* Average FPS over all images with all actions

* Added badges

* Fixed "Select Window" not working for windows with negative coordinates
Split screen_region in smaller functions
WIP towards #94:
No pop-up on loading settings with no capture window
 Don't stop/reset AutoSplit upon loosing capture window
 No pop-up on loosing capture window
 Don't allow selecting desktop.

* Ability to recover window

Fixed regressions:
Fix crash on clising window mid-run
Forgot to migrate split_delay to image.delay
Removed dead load_pyqt_settings code
Fixed dummy groups
Pause time from filename not set correctly
Setting hotkeys on load

* Differentiate "undo/skip split" from "previous/next image"
Skip/udo will now actually call command
This makes grouping option obsolete as user now has finer control anyway
UI is a bit cramped, but that should be resolved with UI revamp
Updated README

* Make Save Settings more intuitive
Don't close if user has cancelled "saving sattings as"
Removed more attributes from AutoSplit class
Don't update last_successfully_loaded_settings_file_path if load was not successful
"Save Settings As" defaults to the last_successfully_loaded_settings_file_path THEN the .exe
When closing app, ue save_settings instead of save_settings_as

* Initial UI update for 2.0.0. Add settings window.

* Hooked new settings window to actual values (#151)

* Initial UI update for 2.0.0. Add settings window.

* hooked new settings window to actual values

* Better "seconds remaining" text

* Undo split goes to the end of the group

Co-authored-by: Austin <37423484+Toufool@users.noreply.github.com>

* Image comparison method and default delay time (#135)

* hooked new settings window to actual values

* Implemented image specific comparison method and default delay time.
Closes #26

* Initial UI update for 2.0.0. Add settings window.

* hooked new settings window to actual values

* Better "seconds remaining" text

* Undo split goes to the end of the group

* Fixed images comparison method defaulting to 0 rather than none

Co-authored-by: Austin <37423484+Toufool@users.noreply.github.com>

* Support hotkeys with modifiers (#136)

* hooked new settings window to actual values

* Better "seconds remaining" text

* Support modifiers the same way LiveSplit does. Closes #34

* Initial UI update for 2.0.0. Add settings window.

* hooked new settings window to actual values

* Better "seconds remaining" text

* Undo split goes to the end of the group

Co-authored-by: Austin <37423484+Toufool@users.noreply.github.com>

* Linted pyi files (#137)

* hooked new settings window to actual values

* Linted pyi files

* Initial UI update for 2.0.0. Add settings window.

* hooked new settings window to actual values

* Better "seconds remaining" text

* Undo split goes to the end of the group

* Turn off pyright(reportFunctionMemberAccess) in favor of pylint(no-member)

* Massively sped up Flake tests
Removed 400+kb of type stubs

* Centralized qWait typing fix

* Autosort imports

* Resynced settings

Co-authored-by: Austin <37423484+Toufool@users.noreply.github.com>

* Toml profiles + Python 3.10 (#140)

* Typings update

* Full setup and configuration update

* User Profile, Revamped settings, Start image fixes & __auto_splitter method refactor

* Added new Capture Method system for more capture options + utils (#141)

* Add D3DShot types
from python/typeshed#8652

* New Capture Method system

* Warning if AutoSplit is already open + Build number + Splash Screen + Doc update + Fixes (#161)

* Doc + Setup update

* typings update

* Warning if AutoSplit is already open + Build number + Splash Screen

* Target the right repository/fork

* Fix #155

* Actions shortcut and prevent double open window
Closes #154

* ImageHash hotfix

* Toggle autoreset image + ui adjustments

Co-authored-by: Austin <37423484+Toufool@users.noreply.github.com>

* Revert "Toggle autoreset image (#162)" (#163)

This reverts commit 9e48c51.

Co-authored-by: Samuel T <samuel.06@hotmail.com>

* test building without --windowed

* First round of QA testing fixes (#171)

* Added sonarcloud.properties

* Remove duplicate DeleteDC & allow errors to show
May fix #167

* Rename CaptureMethodInterface to CaptureMethodBase

* Added autofix script and faster linting

* Disable device probing for now. Fixes #169

* Updated settings widget text
and workaround to fix #170

* Bump AUTOSPLIT_VERSION

* Next Image even if it's not possible to split
Fixes #168

* Fix build

* First round of QA testing fixes + build fixes (#172)

* back to windowed

* Fix #47, updated some configs and types from typeshed (#173)

* Updated configs

* Updated typings

* Updated some code

* Fix #47

* Revert mypy stuff

* More consistent formatting (#174)

* More consistent formatting and types
- Added autofixes to the lint script.
- Added a quotes autofixer using `unify`
- Added a trailing comma checker and autofixer
- Applied trailing commas
- Ordered requirements alphabetically
- Ensure the last version of D3DShot is used (0.1.5, not 0.1.3)
- Remove configuration for unused linters (black/prettier/sonarlint)
- Updated types from typeshed

* Updated virtual camera link

* Update types and pylint

* Batch fixes (#176)

* pyright update

* lint-and-build cover more files

* Get IDirect3dDevice from LearningModelDevice
Closes #175

Co-authored-by: Algomancer <hibble.code@gmail.com>

* Ensure we're using the right camera size
And not OpenCV's default 640x480

* Fix rounding error in displayed decimal

* Revert "back to windowed"

This reverts commit 9553271.

* Fix highest similarity for start image

* Fix split below treshold when image is not valid

* Detect gray frames from OBS-Camera

Co-authored-by: Algomancer <hibble.code@gmail.com>

* Adaptive resizing for masked images (#177)

Especially in the case of 1080p or higher, if the non-transparent area of the mask image used for the split is small, resizing the entire image to 320x240 will lose the information inside the mask. One idea to prevent this is to adaptively determine the target size according to the number of nonzero elements in the alpha channel of the split image. At least for the L2 norm and histogram, such a change would not affect performance since they only use information about the mask's interior. Masks are not recommended with pHash anyway.

Co-authored-by: zalgo3 <zalgo3333@gmail.com>

* Bump opencv-python to 4.6 (#178)

* Point python_grabber to andreaschiavinato (#179)

* Batch of updates and fixes for 2.0.0 (#188)

* Point python_grabber to andreaschiavinato

* Added summary of histogram

* Backport changes from linux branch

* Improved pyright and formatters usage

* Config updates

* Fix links

* Disable next/previous while delaying

* proper `is_running` variable

* Fix loading and clearing of start image

* Rename "already_running" to "already_open"

* Fix delay intervals

* Add support for start image pause time

* Default to MediaCapture's d3d

* Re-enable buttons after delay

* Beta 1 (feature-freeze, bugfixes only)

* Updated configs to use Python 3.11 (#180)

* Option to build without build number + Adaptive mask fix (#189)

* Option to build without build number

* Fix repo url from workflow build

* Resize mask with image

* Pin more dependencies, Speed-up installs and update comments

* Add mypy config for optional support.

* pin requests and allow pyright warnings (#193)

* Fix B028 (#194)

* Fixed run_start_time with start image pause loop (#197)

Also fixed run_start_time not accounting for the delay in parsing images

* Disable Capture device: dropdown when Capture method: is not Video Capture Device (#198)

Fix issue with programatically setting capture_device_combobox index

* Fix start issue after finishing splits  (#199)

* Fix start issue after finishing splits
- `self.is_running = False` at the end of `__auto_splitter`
- Revert moving initialization of some values
- Move `self.run_start_time = time()` before parsing images

* Update hardcoded references to repo name

* Change default capture method to WGA (#200)

* Delete example1.6.0.gif

* 2.0.0 gif

* update gif to 2.0.0

* Update some docs and fix lint issue (#202)

* Update docs, comments and typings
Add link to dev builds
bump beta version
Update flake8 checks
"fix" typing issue caused by PyQt6 incorrect callable

* Slight build improvement

* Fix D3DDD issue on hybrid GPU laptops (#205)

* Fix D3DDD issue on hybrid gpu laptops

1. Some Desktop Duplication setup was done in advance, even if that method won't be used
2. Hybrid GPU laptops can have issues with D3D Desktop Duplication. The issue and a workaround is now documented

* Fixed some blocking typing and linting issues

* Fix obs-camera image freezing for a sec when it gives a blank frame (#206)

* Linting and typing fixes (#208)

* start image behavior

@Avasam I believe this is accurate, but let me know if it's not

---------

Co-authored-by: Austin <37423484+Toufool@users.noreply.github.com>
Co-authored-by: Algomancer <hibble.code@gmail.com>
Co-authored-by: zalgo3 <zalgo3333@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants