ok-script 0.0.151__tar.gz → 0.0.153__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ok-script-0.0.151/ok_script.egg-info → ok-script-0.0.153}/PKG-INFO +1 -1
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/capture/HwndWindow.py +23 -14
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/capture/adb/DeviceManager.py +7 -3
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/capture/adb/WindowsCaptureFactory.py +2 -1
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/capture/windows/WindowsGraphicsCaptureMethod.py +3 -1
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/firebase/Analytics.py +1 -1
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/StartController.py +11 -10
- {ok-script-0.0.151 → ok-script-0.0.153/ok_script.egg-info}/PKG-INFO +1 -1
- {ok-script-0.0.151 → ok-script-0.0.153}/setup.py +1 -1
- {ok-script-0.0.151 → ok-script-0.0.153}/LICENSE.txt +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/README.md +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/OK.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/alas/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/alas/emulator_base.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/alas/emulator_windows.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/alas/platform_base.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/alas/platform_windows.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/alas/utils.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/capture/BaseCaptureMethod.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/capture/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/capture/adb/ADBCaptureMethod.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/capture/adb/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/capture/adb/bin/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/capture/image/ImageCaptureMethod.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/capture/image/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/capture/windows/BaseWindowsCaptureMethod.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/capture/windows/BitBltCaptureMethod.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/capture/windows/DesktopDuplicationCaptureMethod.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/capture/windows/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/capture/windows/d3d11.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/capture/windows/dump.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/capture/windows/utils.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/capture/windows/window.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/color/Color.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/color/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/config/Config.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/config/ConfigOption.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/config/GlobalConfig.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/config/InfoDict.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/config/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/display/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/display/custom_types.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/display/display.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/display/display_adapters.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/display/display_monitors.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/display/windows_types.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/feature/Box.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/feature/CompressCoco.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/feature/Feature.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/feature/FeatureSet.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/feature/FindFeature.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/feature/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/firebase/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/App.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/Communicate.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/MainWindow.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/MessageWindow.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/TabTitles.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/about/AboutTab.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/about/HttpTextEdit.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/about/VersionCard.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/about/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/common/OKIcon.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/common/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/common/config.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/common/style_sheet.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/config/AppConfigWidget.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/config/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/debug/AspectRatioWidget.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/debug/DebugTab.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/debug/FrameWidget.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/debug/InfoWidget.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/debug/LogWindow.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/debug/Screenshot.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/debug/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/i18n/GettextTranslator.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/i18n/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/i18n/path.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/i18n/update.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/icon/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/icon/icon.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/overlay/OverlayWindow.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/overlay/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/qss/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/resources.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/settings/GlobalConfigCard.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/settings/SettingTab.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/settings/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/start/SelectCaptureListView.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/start/StartCard.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/start/StartTab.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/start/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/tasks/ConfigCard.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/tasks/ConfigItemFactory.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/tasks/ConfigLabelAndWidget.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/tasks/LabelAndDoubleSpinBox.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/tasks/LabelAndDropDown.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/tasks/LabelAndLineEdit.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/tasks/LabelAndList.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/tasks/LabelAndSpinBox.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/tasks/LabelAndSwitchButton.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/tasks/LabelAndWidget.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/tasks/ModifyListDialog.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/tasks/ModifyListItem.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/tasks/OneTimeTaskTab.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/tasks/StartButton.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/tasks/TaskCard.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/tasks/TaskOpButton.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/tasks/TaskTab.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/tasks/TooltipTableWidget.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/tasks/TriggerTaskTab.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/tasks/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/util/Alert.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/util/InitWorker.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/util/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/widget/Card.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/widget/EmptyCard.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/widget/FramelessDialog.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/widget/ListTableWidgetItem.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/widget/NumericTableWidgetItem.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/widget/StartLoadingDialog.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/widget/StatusBar.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/widget/Tab.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/widget/TabWidget.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/widget/UpdateConfigWidgetItem.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/widget/YesNonWidgetItem.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/gui/widget/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/interaction/ADBInteraction.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/interaction/BaseInteraction.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/interaction/DoNothingInteraction.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/interaction/PostMessageInteraction.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/interaction/PyDirectInteraction.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/interaction/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/logging/Logger.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/logging/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/ocr/OCR.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/ocr/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/rotypes/Windows/Foundation/Collections.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/rotypes/Windows/Foundation/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/rotypes/Windows/Globalization/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/rotypes/Windows/Graphics/Capture/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/rotypes/Windows/Graphics/DirectX/Direct3D11/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/rotypes/Windows/Graphics/DirectX/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/rotypes/Windows/Graphics/Imaging/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/rotypes/Windows/Graphics/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/rotypes/Windows/Media/Ocr/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/rotypes/Windows/Media/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/rotypes/Windows/Security/Cryptography/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/rotypes/Windows/Security/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/rotypes/Windows/Storage/Streams/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/rotypes/Windows/Storage/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/rotypes/Windows/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/rotypes/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/rotypes/delegate.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/rotypes/export.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/rotypes/idldsl.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/rotypes/inspectable.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/rotypes/roapi.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/rotypes/types.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/rotypes/winstring.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/save/BlackBarProcessor.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/save/PostProcessor.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/save/SaveByInterval.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/save/SaveByKeyPress.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/save/SaveMethodBase.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/save/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/scene/FeatureScene.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/scene/Scene.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/scene/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/stats/StreamStats.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/stats/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/task/BaseTask.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/task/ExecutorOperation.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/task/TaskExecutor.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/task/TriggerTask.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/task/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/update/GithubMultiDownloader.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/update/Updater.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/update/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/update/gen_md5.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/util/Handler.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/util/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/util/exit_event.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/util/json.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/util/list.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/util/path.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/util/thread.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/util/win32_process.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok/util/yaml.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok_script.egg-info/SOURCES.txt +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok_script.egg-info/dependency_links.txt +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok_script.egg-info/requires.txt +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/ok_script.egg-info/top_level.txt +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/setup.cfg +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/tests/__init__.py +0 -0
- {ok-script-0.0.151 → ok-script-0.0.153}/tests/test_updater.py +0 -0
|
@@ -17,7 +17,7 @@ logger = get_logger(__name__)
|
|
|
17
17
|
|
|
18
18
|
class HwndWindow:
|
|
19
19
|
|
|
20
|
-
def __init__(self, exit_event, title, exe_name=None, frame_width=0, frame_height=0, player_id=-1):
|
|
20
|
+
def __init__(self, exit_event, title, exe_name=None, frame_width=0, frame_height=0, player_id=-1, hwnd_class=None):
|
|
21
21
|
super().__init__()
|
|
22
22
|
self.app_exit_event = exit_event
|
|
23
23
|
self.exe_name = exe_name
|
|
@@ -44,10 +44,12 @@ class HwndWindow:
|
|
|
44
44
|
self.real_y_offset = 0
|
|
45
45
|
self.scaling = 1.0
|
|
46
46
|
self.frame_aspect_ratio = 0
|
|
47
|
+
self.hwnd_class = hwnd_class
|
|
48
|
+
self.pos_valid = False
|
|
49
|
+
self._hwnd_title = ""
|
|
47
50
|
self.update_window(title, exe_name, frame_width, frame_height)
|
|
48
51
|
self.thread = threading.Thread(target=self.update_window_size, name="update_window_size")
|
|
49
52
|
self.thread.start()
|
|
50
|
-
self._hwnd_title = ""
|
|
51
53
|
|
|
52
54
|
def stop(self):
|
|
53
55
|
self.stop_event.set()
|
|
@@ -84,7 +86,7 @@ class HwndWindow:
|
|
|
84
86
|
name, self.hwnd, self.exe_full_path, self.real_x_offset, self.real_y_offset, self.real_width, self.real_height = find_hwnd(
|
|
85
87
|
self.title,
|
|
86
88
|
self.exe_name,
|
|
87
|
-
self.frame_width, self.frame_height, player_id=self.player_id)
|
|
89
|
+
self.frame_width, self.frame_height, player_id=self.player_id, class_name=self.hwnd_class)
|
|
88
90
|
if self.hwnd is not None:
|
|
89
91
|
logger.info(
|
|
90
92
|
f'found hwnd {self.hwnd} {self.exe_full_path} {win32gui.GetClassName(self.hwnd)} real:{self.real_x_offset},{self.real_y_offset},{self.real_width},{self.real_height}')
|
|
@@ -100,6 +102,14 @@ class HwndWindow:
|
|
|
100
102
|
if window_ratio < self.frame_aspect_ratio:
|
|
101
103
|
cropped_window_height = int(width / self.frame_aspect_ratio)
|
|
102
104
|
height = cropped_window_height
|
|
105
|
+
pos_valid = check_pos(x, y, width, height)
|
|
106
|
+
if not pos_valid and pos_valid != self.pos_valid and ok.gui.executor is not None:
|
|
107
|
+
ok.gui.executor.pause()
|
|
108
|
+
logger.error(f'ok.gui.executor.pause pos_invalid: {x, y, width, height}')
|
|
109
|
+
communicate.notification.emit('Paused because game window is minimized or out of screen!', None,
|
|
110
|
+
True, True)
|
|
111
|
+
if pos_valid != self.pos_valid:
|
|
112
|
+
self.pos_valid = pos_valid
|
|
103
113
|
else:
|
|
104
114
|
ok.gui.executor.pause()
|
|
105
115
|
communicate.notification.emit('Paused because game exited', None, True, True)
|
|
@@ -140,14 +150,18 @@ class HwndWindow:
|
|
|
140
150
|
return f"title_{self.title}_{self.exe_name}_{self.width}x{self.height}_{self.hwnd}_{self.exists}_{self.visible}"
|
|
141
151
|
|
|
142
152
|
|
|
143
|
-
def
|
|
153
|
+
def check_pos(x, y, width, height):
|
|
154
|
+
return x >= 0 and y >= 0 and width >= 0 and height >= 0
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
def find_hwnd(title, exe_name, frame_width, frame_height, player_id=-1, class_name=None):
|
|
144
158
|
results = []
|
|
145
159
|
if exe_name is None and title is None:
|
|
146
160
|
return None, None, None, 0, 0, 0, 0
|
|
147
161
|
frame_aspect_ratio = frame_width / frame_height if frame_height != 0 else 0
|
|
148
162
|
|
|
149
163
|
def callback(hwnd, lParam):
|
|
150
|
-
if win32gui.
|
|
164
|
+
if win32gui.IsWindow(hwnd) and win32gui.IsWindowEnabled(hwnd) and win32gui.IsWindowVisible(hwnd):
|
|
151
165
|
text = win32gui.GetWindowText(hwnd)
|
|
152
166
|
if title:
|
|
153
167
|
if isinstance(title, str):
|
|
@@ -169,11 +183,15 @@ def find_hwnd(title, exe_name, frame_width, frame_height, player_id=-1):
|
|
|
169
183
|
logger.debug(
|
|
170
184
|
f'player id check failed,cmdline {cmdline} {get_player_id_from_cmdline(cmdline)} != {player_id}')
|
|
171
185
|
return True
|
|
186
|
+
if class_name is not None:
|
|
187
|
+
if win32gui.GetClassName(hwnd) != class_name:
|
|
188
|
+
return True
|
|
172
189
|
results.append(ret)
|
|
173
190
|
return True
|
|
174
191
|
|
|
175
192
|
win32gui.EnumWindows(callback, None)
|
|
176
193
|
if len(results) > 0:
|
|
194
|
+
logger.info(f'find_hwnd {results}')
|
|
177
195
|
biggest = None
|
|
178
196
|
for result in results:
|
|
179
197
|
if biggest is None or (result[2] * result[3]) > biggest[2] * biggest[3]:
|
|
@@ -252,12 +270,3 @@ def get_exe_by_hwnd(hwnd):
|
|
|
252
270
|
except Exception as e:
|
|
253
271
|
logger.error('get_exe_by_hwnd error', e)
|
|
254
272
|
return None, None, None
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
if __name__ == '__main__':
|
|
258
|
-
print(find_hwnd("MuMu模拟器12", None))
|
|
259
|
-
# hwnd_window = HwndWindow(threading.Event(), None, 'D:\\MuMuPlayer-12.0\\shell\\MuMuPlayer.exe', 16, 9)
|
|
260
|
-
# from ok.capture.windows.BitBltCaptureMethod import BitBltCaptureMethod
|
|
261
|
-
#
|
|
262
|
-
# method = BitBltCaptureMethod(hwnd_window)
|
|
263
|
-
# method.get_frame()
|
|
@@ -35,7 +35,8 @@ class DeviceManager:
|
|
|
35
35
|
self.resolution_dict = {}
|
|
36
36
|
if self.windows_capture_config is not None:
|
|
37
37
|
self.hwnd = HwndWindow(exit_event, self.windows_capture_config.get('title'),
|
|
38
|
-
self.windows_capture_config.get('exe')
|
|
38
|
+
self.windows_capture_config.get('exe'),
|
|
39
|
+
hwnd_class=self.windows_capture_config.get('hwnd_class'))
|
|
39
40
|
from ok.interaction.PostMessageInteraction import PostMessageInteraction
|
|
40
41
|
from ok.interaction.PyDirectInteraction import PyDirectInteraction
|
|
41
42
|
self.win_interaction_class = PostMessageInteraction if self.windows_capture_config.get(
|
|
@@ -117,7 +118,9 @@ class DeviceManager:
|
|
|
117
118
|
def update_pc_device(self):
|
|
118
119
|
if self.windows_capture_config is not None:
|
|
119
120
|
name, hwnd, full_path, x, y, width, height = find_hwnd(self.windows_capture_config.get('title'),
|
|
120
|
-
self.windows_capture_config.get('exe'), 0, 0
|
|
121
|
+
self.windows_capture_config.get('exe'), 0, 0,
|
|
122
|
+
class_name=self.windows_capture_config.get(
|
|
123
|
+
'hwnd_class'))
|
|
121
124
|
nick = name or self.windows_capture_config.get('exe')
|
|
122
125
|
pc_device = {"address": "", "imei": 'pc', "device": "windows",
|
|
123
126
|
"model": "", "nick": nick, "width": width,
|
|
@@ -289,7 +292,8 @@ class DeviceManager:
|
|
|
289
292
|
|
|
290
293
|
def ensure_hwnd(self, title, exe, frame_width=0, frame_height=0, player_id=-1):
|
|
291
294
|
if self.hwnd is None:
|
|
292
|
-
self.hwnd = HwndWindow(self.exit_event, title, exe, frame_width, frame_height, player_id
|
|
295
|
+
self.hwnd = HwndWindow(self.exit_event, title, exe, frame_width, frame_height, player_id,
|
|
296
|
+
self.windows_capture_config.get('hwnd_class'))
|
|
293
297
|
else:
|
|
294
298
|
self.hwnd.update_window(title, exe, frame_width, frame_height, player_id)
|
|
295
299
|
|
|
@@ -40,7 +40,8 @@ def get_win_graphics_capture(capture_method, hwnd):
|
|
|
40
40
|
from ok.capture.windows.WindowsGraphicsCaptureMethod import WindowsGraphicsCaptureMethod
|
|
41
41
|
target_method = WindowsGraphicsCaptureMethod
|
|
42
42
|
capture_method = get_capture(capture_method, target_method, hwnd)
|
|
43
|
-
|
|
43
|
+
if capture_method.start_or_stop():
|
|
44
|
+
return capture_method
|
|
44
45
|
|
|
45
46
|
|
|
46
47
|
def get_capture(capture_method, target_method, hwnd):
|
|
@@ -159,11 +159,13 @@ class WindowsGraphicsCaptureMethod(BaseWindowsCaptureMethod):
|
|
|
159
159
|
if WINDOWS_BUILD_NUMBER >= WGC_NO_BORDER_MIN_BUILD:
|
|
160
160
|
self.session.IsBorderRequired = False
|
|
161
161
|
self.session.StartCapture()
|
|
162
|
+
return True
|
|
162
163
|
except Exception as e:
|
|
163
164
|
logger.error(f'start_or_stop failed: {self.hwnd_window}', exception=e)
|
|
165
|
+
return False
|
|
164
166
|
elif not self.hwnd_window.exists and self.frame_pool is not None:
|
|
165
167
|
self.close()
|
|
166
|
-
|
|
168
|
+
return False
|
|
167
169
|
return self.hwnd_window.exists
|
|
168
170
|
|
|
169
171
|
def create_device(self):
|
|
@@ -105,7 +105,7 @@ class Analytics:
|
|
|
105
105
|
|
|
106
106
|
logger.info(f'send report {params}')
|
|
107
107
|
|
|
108
|
-
response = requests.post(self.report_url, json=params)
|
|
108
|
+
response = requests.post(self.report_url, json=params, timeout=10)
|
|
109
109
|
|
|
110
110
|
if response.status_code == 200:
|
|
111
111
|
logger.debug(f'Successfully send report')
|
|
@@ -76,16 +76,17 @@ class StartController(QObject):
|
|
|
76
76
|
if not ok.gui.device_manager.capture_method.connected():
|
|
77
77
|
logger.error(f'Game window is not connected {ok.gui.device_manager.capture_method}')
|
|
78
78
|
return self.tr("Game window is not connected, please select the game window and capture method.")
|
|
79
|
-
if isinstance(ok.gui.device_manager.capture_method, BaseWindowsCaptureMethod)
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
79
|
+
if isinstance(ok.gui.device_manager.capture_method, BaseWindowsCaptureMethod):
|
|
80
|
+
if self.config.get('windows', {}).get('check_hdr_and_night_light', False):
|
|
81
|
+
logger.info(f'start checking for hdr and night light')
|
|
82
|
+
from ok.display.display import is_night_light_enabled
|
|
83
|
+
if is_night_light_enabled():
|
|
84
|
+
return self.tr(f'Windows night light is enabled, please turn it off first.')
|
|
85
|
+
from ok.display.display import is_hdr_enabled
|
|
86
|
+
if is_hdr_enabled():
|
|
87
|
+
return self.tr(f'Windows HDR is enabled, please turn it off first.')
|
|
88
|
+
if not ok.gui.device_manager.capture_method.hwnd_window.pos_valid:
|
|
89
|
+
return self.tr(f'Game window is minimized or out of screen, please restore it first!')
|
|
89
90
|
frame = self.try_capture_a_frame()
|
|
90
91
|
if frame is None:
|
|
91
92
|
return self.tr('Capture failed, please check game window')
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ok-script-0.0.151 → ok-script-0.0.153}/ok/capture/windows/DesktopDuplicationCaptureMethod.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ok-script-0.0.151 → ok-script-0.0.153}/ok/rotypes/Windows/Graphics/DirectX/Direct3D11/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ok-script-0.0.151 → ok-script-0.0.153}/ok/rotypes/Windows/Security/Cryptography/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|