From 655ca7a9012230dddbce7be5f2c0bedbd19f2d6f Mon Sep 17 00:00:00 2001 From: ePi Date: Mon, 25 Apr 2022 12:22:02 +0900 Subject: [PATCH] =?UTF-8?q?r21=20=E5=86=8D=E4=BF=AE=E6=AD=A3=20=E3=81=A8?= =?UTF-8?q?=E3=81=84=E3=81=86=E3=81=8B=E3=82=84=E3=82=8A=E6=96=B9=E5=A4=89?= =?UTF-8?q?=E3=81=88=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- patch.aul.txt | 9 +++++++-- patch/macro.h | 2 +- patch/patch_setting_dialog_move.hpp | 18 ++++++------------ .../patch_setting_dialog_wndproc_override.cpp | 8 ++------ .../patch_setting_dialog_wndproc_override.hpp | 2 -- 5 files changed, 16 insertions(+), 23 deletions(-) diff --git a/patch.aul.txt b/patch.aul.txt index 673054a5..5d14231c 100644 --- a/patch.aul.txt +++ b/patch.aul.txt @@ -1,4 +1,4 @@ -patch.aul r20 +patch.aul r21 Copyright (c) 2021-2022 ePi https://scrapbox.io/ePi5131/patch.aul @@ -171,7 +171,7 @@ https://scrapbox.io/ePi5131/patch.aul Lua追加要素詳細 _PATCH patch.aulのバージョン情報 - 現在は "patch.aul r20" という文字列が格納されている + 現在は "patch.aul r21" という文字列が格納されている obj.randex(seed,time) seed : integer @@ -279,3 +279,8 @@ Lua追加要素詳細 r20 設定ダイアログのサイズが変更されたときの画面外の領域が正しく描画されないのを修正 + + r21 + 再修正 というかやり方を変えた + settingdialog_moveスイッチが機能してなかったのを修正 + \ No newline at end of file diff --git a/patch/macro.h b/patch/macro.h index 4f591280..ed67b86d 100644 --- a/patch/macro.h +++ b/patch/macro.h @@ -90,7 +90,7 @@ #endif //define PATCH_SWITCH_FAST #else // ifdef PATCH_INTERNAL -#define PATCH_VERSION_STR "r20" +#define PATCH_VERSION_STR "r21" #define PATCH_SWITCH_EXCEPTION_LOG #define PATCH_SWITCH_SYSINFO_MODIFY diff --git a/patch/patch_setting_dialog_move.hpp b/patch/patch_setting_dialog_move.hpp index 5552f06a..5d2ace16 100644 --- a/patch/patch_setting_dialog_move.hpp +++ b/patch/patch_setting_dialog_move.hpp @@ -25,20 +25,14 @@ namespace patch { inline class setting_dialog_move_t { inline static std::jthread th; inline static std::atomic_bool waiting; + + static bool enabled() { + return PATCH_SWITCHER_MEMBER(PATCH_SWITCH_SETTINGDIALOG_MOVE); + } public: void operator()(HWND hwnd) { - if (!waiting.load()) { - PostMessage(hwnd, WM_SETREDRAW, FALSE, NULL); - th = std::jthread( - [](HWND hwnd) { - waiting.store(true); - std::this_thread::sleep_for(std::chrono::milliseconds{ 10 }); - PostMessage(hwnd, WM_SETREDRAW, TRUE, NULL); - waiting.store(false); - }, - hwnd - ); - } + if (!enabled())return; + std::this_thread::sleep_for(std::chrono::milliseconds{ 10 }); } } setting_dialog_move; } diff --git a/patch/patch_setting_dialog_wndproc_override.cpp b/patch/patch_setting_dialog_wndproc_override.cpp index 28ce95c1..256a2dc1 100644 --- a/patch/patch_setting_dialog_wndproc_override.cpp +++ b/patch/patch_setting_dialog_wndproc_override.cpp @@ -15,6 +15,8 @@ #include "patch_setting_dialog_wndproc_override.hpp" +#include "patch_setting_dialog_move.hpp" + namespace patch { LRESULT CALLBACK setting_dialog_t::wndproc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) { switch (message) { @@ -23,12 +25,6 @@ namespace patch { setting_dialog_move(hwnd); #endif break; - case WM_SIZE: - #ifdef PATCH_SWITCH_FAST_SETTINGDIALOG - InvalidateRect(hwnd, nullptr, FALSE); - UpdateWindow(hwnd); - #endif - break; } return wndproc_orig(hwnd, message, wparam, lparam); } diff --git a/patch/patch_setting_dialog_wndproc_override.hpp b/patch/patch_setting_dialog_wndproc_override.hpp index 1d765282..5eed6913 100644 --- a/patch/patch_setting_dialog_wndproc_override.hpp +++ b/patch/patch_setting_dialog_wndproc_override.hpp @@ -19,8 +19,6 @@ #include "global.hpp" #include "util_magic.hpp" -#include "patch_setting_dialog_move.hpp" - namespace patch { inline class setting_dialog_t {