致谢页添加

This commit is contained in:
2026-04-28 14:34:26 +08:00
parent 00729fbe17
commit 647038b27a
3 changed files with 31 additions and 16 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB

+3 -2
View File
@@ -590,6 +590,7 @@ void OpenCreditScreen()
*/ */
void ChangeCreditPage(int direction) void ChangeCreditPage(int direction)
{ {
constexpr int creditPageCount = 3;
if (direction == 0) if (direction == 0)
{ {
return; return;
@@ -609,9 +610,9 @@ void ChangeCreditPage(int direction)
if (creditPageIndex < 0) if (creditPageIndex < 0)
{ {
creditPageIndex = 1; creditPageIndex = creditPageCount - 1;
} }
if (creditPageIndex > 1) if (creditPageIndex >= creditPageCount)
{ {
creditPageIndex = 0; creditPageIndex = 0;
} }
+28 -14
View File
@@ -131,11 +131,12 @@ static Bitmap* LoadBackgroundImage()
*/ */
static Bitmap* LoadCreditImage(int index) static Bitmap* LoadCreditImage(int index)
{ {
constexpr int creditPageCount = 3;
static ULONG_PTR gdiplusToken = 0; static ULONG_PTR gdiplusToken = 0;
static Bitmap* creditImages[2] = {}; static Bitmap* creditImages[creditPageCount] = {};
static bool attempted[2] = {}; static bool attempted[creditPageCount] = {};
if (index < 0 || index >= 2) if (index < 0 || index >= creditPageCount)
{ {
return nullptr; return nullptr;
} }
@@ -147,10 +148,11 @@ static Bitmap* LoadCreditImage(int index)
GdiplusStartupInput startupInput; GdiplusStartupInput startupInput;
if (GdiplusStartup(&gdiplusToken, &startupInput, nullptr) == Ok) if (GdiplusStartup(&gdiplusToken, &startupInput, nullptr) == Ok)
{ {
const wchar_t* imageNames[2] = const wchar_t* imageNames[creditPageCount] =
{ {
L"assets\\images\\qls.jpg", L"assets\\images\\qls.jpg",
L"assets\\images\\wyk.jpg" L"assets\\images\\wyk.jpg",
L"assets\\images\\swj.jpg"
}; };
const std::wstring candidates[] = const std::wstring candidates[] =
{ {
@@ -879,15 +881,18 @@ void TDrawScreen(HDC hdc, HWND hWnd)
else if (helpState.currentPage == 4) else if (helpState.currentPage == 4)
{ {
const int creditAnimationTotalTicks = 60; const int creditAnimationTotalTicks = 60;
const TCHAR* creditNames[2] = constexpr int creditPageCount = 3;
const TCHAR* creditNames[creditPageCount] =
{ {
_T("qls"), _T("qls"),
_T("wyk") _T("wyk"),
_T("juju")
}; };
const TCHAR* creditTexts[2] = const TCHAR* creditTexts[creditPageCount] =
{ {
_T("\u611f\u8c22\u6fc0\u60c5\u6295\u8eab\u4e8e\u6d4b\u8bd5\u4e4b\u4e2d\u7684Lisa"), _T("\u611f\u8c22\u6fc0\u60c5\u6295\u8eab\u4e8e\u6d4b\u8bd5\u4e4b\u4e2d\u7684Lisa"),
_T("\u611f\u8c22\u70ed\u5ff1coding\u7684\u5c0f\u86cb\u7cd5") _T("\u611f\u8c22\u70ed\u5ff1coding\u7684\u5c0f\u86cb\u7cd5"),
_T("\u611f\u8c22\u8bfe\u524d\u95f2\u91cc\u5077\u5fd9\u7684juju")
}; };
int currentCredit = creditPageIndex; int currentCredit = creditPageIndex;
@@ -895,17 +900,17 @@ void TDrawScreen(HDC hdc, HWND hWnd)
{ {
currentCredit = 0; currentCredit = 0;
} }
if (currentCredit > 1) if (currentCredit >= creditPageCount)
{ {
currentCredit = 1; currentCredit = creditPageCount - 1;
} }
int previousCredit = currentCredit - creditAnimationDirection; int previousCredit = currentCredit - creditAnimationDirection;
if (previousCredit < 0) if (previousCredit < 0)
{ {
previousCredit = 1; previousCredit = creditPageCount - 1;
} }
if (previousCredit > 1) if (previousCredit >= creditPageCount)
{ {
previousCredit = 0; previousCredit = 0;
} }
@@ -941,6 +946,7 @@ void TDrawScreen(HDC hdc, HWND hWnd)
Bitmap* preloadedCreditImageA = LoadCreditImage(0); Bitmap* preloadedCreditImageA = LoadCreditImage(0);
Bitmap* preloadedCreditImageB = LoadCreditImage(1); Bitmap* preloadedCreditImageB = LoadCreditImage(1);
Bitmap* preloadedCreditImageC = LoadCreditImage(2);
Graphics creditGraphics(hdc); Graphics creditGraphics(hdc);
creditGraphics.SetInterpolationMode(InterpolationModeHighQualityBilinear); creditGraphics.SetInterpolationMode(InterpolationModeHighQualityBilinear);
@@ -951,7 +957,15 @@ void TDrawScreen(HDC hdc, HWND hWnd)
OffsetRect(&shiftedImageArea, offset, 0); OffsetRect(&shiftedImageArea, offset, 0);
OffsetRect(&shiftedTextArea, offset, 0); OffsetRect(&shiftedTextArea, offset, 0);
Bitmap* creditImage = (cardIndex == 0) ? preloadedCreditImageA : preloadedCreditImageB; Bitmap* creditImage = preloadedCreditImageA;
if (cardIndex == 1)
{
creditImage = preloadedCreditImageB;
}
else if (cardIndex == 2)
{
creditImage = preloadedCreditImageC;
}
if (creditImage != nullptr) if (creditImage != nullptr)
{ {
int imageWidth = static_cast<int>(creditImage->GetWidth()); int imageWidth = static_cast<int>(creditImage->GetWidth());