补全Rogue侧边HUD与局内结算反馈提示
This commit is contained in:
+195
-27
@@ -113,6 +113,19 @@ void TDrawScreen(HDC hdc, HWND hWnd)
|
||||
SetBkMode(hdc, TRANSPARENT);
|
||||
SetTextColor(hdc, textColor);
|
||||
|
||||
auto DrawPanelCard = [&](const RECT& rect, COLORREF fillColor, COLORREF borderColor, int radius)
|
||||
{
|
||||
HBRUSH cardBrush = CreateSolidBrush(fillColor);
|
||||
HPEN cardPen = CreatePen(PS_SOLID, 1, borderColor);
|
||||
HGDIOBJ savedPen = SelectObject(hdc, cardPen);
|
||||
HGDIOBJ savedBrush = SelectObject(hdc, cardBrush);
|
||||
RoundRect(hdc, rect.left, rect.top, rect.right, rect.bottom, SS(radius), SS(radius));
|
||||
SelectObject(hdc, savedBrush);
|
||||
SelectObject(hdc, savedPen);
|
||||
DeleteObject(cardBrush);
|
||||
DeleteObject(cardPen);
|
||||
};
|
||||
|
||||
if (currentScreen == SCREEN_MENU)
|
||||
{
|
||||
RECT menuCard =
|
||||
@@ -543,56 +556,173 @@ void TDrawScreen(HDC hdc, HWND hWnd)
|
||||
SelectObject(hdc, sectionFont);
|
||||
SetTextColor(hdc, textColor);
|
||||
|
||||
RECT overviewRect =
|
||||
{
|
||||
panelRect.left + SS(20),
|
||||
panelRect.top + SS(92),
|
||||
panelRect.right - SS(20),
|
||||
panelRect.top + SS(208)
|
||||
};
|
||||
DrawPanelCard(overviewRect, RGB(255, 247, 250), RGB(233, 191, 208), 24);
|
||||
|
||||
TCHAR scoreText[64];
|
||||
_stprintf_s(scoreText, _T("\u5f53\u524d\u5f97\u5206 %d"), tScore);
|
||||
TextOut(hdc, panelRect.left + SS(24), panelRect.top + SS(104), scoreText, lstrlen(scoreText));
|
||||
TextOut(hdc, overviewRect.left + SS(18), overviewRect.top + SS(16), scoreText, lstrlen(scoreText));
|
||||
|
||||
TCHAR modeText[64];
|
||||
_stprintf_s(modeText, _T("\u5f53\u524d\u6a21\u5f0f %s"), currentMode == MODE_CLASSIC ? _T("\u7ecf\u5178") : _T("Rogue"));
|
||||
TextOut(hdc, panelRect.left + SS(24), panelRect.top + SS(140), modeText, lstrlen(modeText));
|
||||
TextOut(hdc, overviewRect.left + SS(18), overviewRect.top + SS(48), modeText, lstrlen(modeText));
|
||||
|
||||
TCHAR linesText[64];
|
||||
int totalLines = (currentMode == MODE_CLASSIC) ? classicStats.totalLinesCleared : rogueStats.totalLinesCleared;
|
||||
_stprintf_s(linesText, _T("\u7d2f\u8ba1\u6d88\u884c %d"), totalLines);
|
||||
TextOut(hdc, panelRect.left + SS(24), panelRect.top + SS(176), linesText, lstrlen(linesText));
|
||||
TextOut(hdc, overviewRect.left + SS(18), overviewRect.top + SS(80), linesText, lstrlen(linesText));
|
||||
|
||||
if (currentMode == MODE_ROGUE)
|
||||
{
|
||||
RECT progressRect =
|
||||
{
|
||||
panelRect.left + SS(20),
|
||||
panelRect.top + SS(224),
|
||||
panelRect.right - SS(20),
|
||||
panelRect.top + SS(364)
|
||||
};
|
||||
DrawPanelCard(progressRect, RGB(255, 248, 251), RGB(233, 191, 208), 24);
|
||||
|
||||
TCHAR levelText[64];
|
||||
_stprintf_s(levelText, _T("\u5f53\u524d\u7b49\u7ea7 %d"), rogueStats.level);
|
||||
TextOut(hdc, panelRect.left + SS(24), panelRect.top + SS(212), levelText, lstrlen(levelText));
|
||||
TextOut(hdc, progressRect.left + SS(18), progressRect.top + SS(16), levelText, lstrlen(levelText));
|
||||
|
||||
TCHAR expText[64];
|
||||
_stprintf_s(expText, _T("EXP %d / %d"), rogueStats.exp, rogueStats.requiredExp);
|
||||
TextOut(hdc, panelRect.left + SS(24), panelRect.top + SS(248), expText, lstrlen(expText));
|
||||
TextOut(hdc, progressRect.left + SS(18), progressRect.top + SS(46), expText, lstrlen(expText));
|
||||
|
||||
TCHAR scoreMultiplierText[64];
|
||||
_stprintf_s(scoreMultiplierText, _T("\u5206\u6570\u500d\u7387 %d%%"), rogueStats.scoreMultiplierPercent);
|
||||
TextOut(hdc, panelRect.left + SS(24), panelRect.top + SS(284), scoreMultiplierText, lstrlen(scoreMultiplierText));
|
||||
RECT expBarRect =
|
||||
{
|
||||
progressRect.left + SS(18),
|
||||
progressRect.top + SS(82),
|
||||
progressRect.right - SS(18),
|
||||
progressRect.top + SS(106)
|
||||
};
|
||||
HBRUSH expTrackBrush = CreateSolidBrush(RGB(240, 220, 229));
|
||||
FillRect(hdc, &expBarRect, expTrackBrush);
|
||||
DeleteObject(expTrackBrush);
|
||||
|
||||
TCHAR expMultiplierText[64];
|
||||
_stprintf_s(expMultiplierText, _T("EXP \u500d\u7387 %d%%"), rogueStats.expMultiplierPercent);
|
||||
TextOut(hdc, panelRect.left + SS(24), panelRect.top + SS(320), expMultiplierText, lstrlen(expMultiplierText));
|
||||
RECT expFillRect = expBarRect;
|
||||
int expWidth = expBarRect.right - expBarRect.left;
|
||||
if (rogueStats.requiredExp > 0)
|
||||
{
|
||||
expFillRect.right = expBarRect.left + expWidth * rogueStats.exp / rogueStats.requiredExp;
|
||||
}
|
||||
if (expFillRect.right < expFillRect.left)
|
||||
{
|
||||
expFillRect.right = expFillRect.left;
|
||||
}
|
||||
HBRUSH expFillBrush = CreateSolidBrush(accentColor);
|
||||
FillRect(hdc, &expFillRect, expFillBrush);
|
||||
DeleteObject(expFillBrush);
|
||||
|
||||
TCHAR fallText[64];
|
||||
_stprintf_s(fallText, _T("\u4e0b\u843d\u95f4\u9694 %dms"), currentFallInterval);
|
||||
TextOut(hdc, panelRect.left + SS(24), panelRect.top + SS(356), fallText, lstrlen(fallText));
|
||||
RECT growthRect =
|
||||
{
|
||||
progressRect.left + SS(18),
|
||||
progressRect.top + SS(118),
|
||||
progressRect.right - SS(18),
|
||||
progressRect.bottom - SS(16)
|
||||
};
|
||||
SelectObject(hdc, smallFont);
|
||||
SetTextColor(hdc, RGB(122, 95, 110));
|
||||
TCHAR growthText[128];
|
||||
_stprintf_s(
|
||||
growthText,
|
||||
_T("\u5206\u6570 %d%% EXP %d%% \u901f\u5ea6 %dms"),
|
||||
rogueStats.scoreMultiplierPercent,
|
||||
rogueStats.expMultiplierPercent,
|
||||
currentFallInterval);
|
||||
DrawText(hdc, growthText, -1, &growthRect, DT_LEFT | DT_TOP | DT_WORDBREAK);
|
||||
|
||||
RECT combatRect =
|
||||
{
|
||||
panelRect.left + SS(20),
|
||||
panelRect.top + SS(382),
|
||||
panelRect.right - SS(20),
|
||||
panelRect.top + SS(492)
|
||||
};
|
||||
DrawPanelCard(combatRect, RGB(255, 247, 250), RGB(233, 191, 208), 24);
|
||||
|
||||
SelectObject(hdc, sectionFont);
|
||||
SetTextColor(hdc, textColor);
|
||||
TextOut(hdc, combatRect.left + SS(18), combatRect.top + SS(16), _T("\u5f53\u524d\u6218\u6597\u72b6\u6001"), lstrlen(_T("\u5f53\u524d\u6218\u6597\u72b6\u6001")));
|
||||
|
||||
SelectObject(hdc, bodyFont);
|
||||
TCHAR comboText[64];
|
||||
_stprintf_s(comboText, _T("\u8fde\u51fb\u94fe %d \u5956\u52b1\u5c42\u6570 %d"), rogueStats.comboChain, rogueStats.comboBonusStacks);
|
||||
TextOut(hdc, panelRect.left + SS(24), panelRect.top + SS(392), comboText, lstrlen(comboText));
|
||||
TextOut(hdc, combatRect.left + SS(18), combatRect.top + SS(50), comboText, lstrlen(comboText));
|
||||
|
||||
TCHAR summaryText[64];
|
||||
TCHAR summaryText[96];
|
||||
_stprintf_s(
|
||||
summaryText,
|
||||
_T("\u9884\u89c8 %d \u4fdd\u547d %d"),
|
||||
_T("\u9884\u89c8 %d \u4fdd\u547d %d \u5df2\u9009 %d"),
|
||||
rogueStats.previewCount,
|
||||
rogueStats.lastChanceCount);
|
||||
TextOut(hdc, panelRect.left + SS(24), panelRect.top + SS(428), summaryText, lstrlen(summaryText));
|
||||
rogueStats.lastChanceCount,
|
||||
upgradeUiState.totalChosenCount);
|
||||
TextOut(hdc, combatRect.left + SS(18), combatRect.top + SS(82), summaryText, lstrlen(summaryText));
|
||||
|
||||
RECT upgradeListRect =
|
||||
{
|
||||
panelRect.left + SS(20),
|
||||
panelRect.top + SS(510),
|
||||
panelRect.right - SS(20),
|
||||
panelRect.top + SS(676)
|
||||
};
|
||||
DrawPanelCard(upgradeListRect, RGB(255, 248, 251), RGB(233, 191, 208), 24);
|
||||
|
||||
SelectObject(hdc, sectionFont);
|
||||
SetTextColor(hdc, textColor);
|
||||
TextOut(hdc, upgradeListRect.left + SS(18), upgradeListRect.top + SS(16), _T("\u5df2\u83b7\u5f97\u5f3a\u5316"), lstrlen(_T("\u5df2\u83b7\u5f97\u5f3a\u5316")));
|
||||
|
||||
SelectObject(hdc, smallFont);
|
||||
SetTextColor(hdc, RGB(128, 104, 118));
|
||||
TextOut(hdc, panelRect.left + SS(24), panelRect.top + SS(464), _T("\u53f3\u4fa7 HUD \u5df2\u5f00\u59cb\u663e\u793a Rogue \u5f53\u524d\u6210\u957f\u72b6\u6001"), lstrlen(_T("\u53f3\u4fa7 HUD \u5df2\u5f00\u59cb\u663e\u793a Rogue \u5f53\u524d\u6210\u957f\u72b6\u6001")));
|
||||
RECT upgradeBodyRect =
|
||||
{
|
||||
upgradeListRect.left + SS(18),
|
||||
upgradeListRect.top + SS(48),
|
||||
upgradeListRect.right - SS(18),
|
||||
upgradeListRect.bottom - SS(14)
|
||||
};
|
||||
|
||||
TCHAR upgradeSummary[512];
|
||||
upgradeSummary[0] = _T('\0');
|
||||
|
||||
if (rogueStats.scoreUpgradeLevel > 0)
|
||||
{
|
||||
_stprintf_s(upgradeSummary + lstrlen(upgradeSummary), 512 - lstrlen(upgradeSummary), _T("\u5206\u6570\u500d\u7387 Lv.%d\r\n"), rogueStats.scoreUpgradeLevel);
|
||||
}
|
||||
if (rogueStats.expUpgradeLevel > 0)
|
||||
{
|
||||
_stprintf_s(upgradeSummary + lstrlen(upgradeSummary), 512 - lstrlen(upgradeSummary), _T("EXP \u5f3a\u5316 Lv.%d\r\n"), rogueStats.expUpgradeLevel);
|
||||
}
|
||||
if (rogueStats.slowFallStacks > 0)
|
||||
{
|
||||
_stprintf_s(upgradeSummary + lstrlen(upgradeSummary), 512 - lstrlen(upgradeSummary), _T("\u6162\u901f\u4e0b\u843d Lv.%d\r\n"), rogueStats.slowFallStacks);
|
||||
}
|
||||
if (rogueStats.comboBonusStacks > 0)
|
||||
{
|
||||
_stprintf_s(upgradeSummary + lstrlen(upgradeSummary), 512 - lstrlen(upgradeSummary), _T("\u8fde\u51fb\u52a0\u6210 Lv.%d\r\n"), rogueStats.comboBonusStacks);
|
||||
}
|
||||
if (rogueStats.previewUpgradeLevel > 0)
|
||||
{
|
||||
_stprintf_s(upgradeSummary + lstrlen(upgradeSummary), 512 - lstrlen(upgradeSummary), _T("\u989d\u5916\u9884\u89c8 Lv.%d\r\n"), rogueStats.previewUpgradeLevel);
|
||||
}
|
||||
if (rogueStats.lastChanceUpgradeLevel > 0)
|
||||
{
|
||||
_stprintf_s(upgradeSummary + lstrlen(upgradeSummary), 512 - lstrlen(upgradeSummary), _T("\u6700\u540e\u4e00\u640f Lv.1 \u5269\u4f59 %d \u6b21\r\n"), rogueStats.lastChanceCount);
|
||||
}
|
||||
if (lstrlen(upgradeSummary) == 0)
|
||||
{
|
||||
_stprintf_s(upgradeSummary, _T("\u6682\u672a\u9009\u62e9\u4efb\u4f55\u5f3a\u5316\u3002\r\n\u5347\u7ea7\u540e\u4f1a\u5728\u8fd9\u91cc\u7d2f\u79ef\u663e\u793a\u3002"));
|
||||
}
|
||||
|
||||
DrawText(hdc, upgradeSummary, -1, &upgradeBodyRect, DT_LEFT | DT_TOP | DT_WORDBREAK);
|
||||
SelectObject(hdc, sectionFont);
|
||||
SetTextColor(hdc, textColor);
|
||||
}
|
||||
@@ -600,13 +730,17 @@ void TDrawScreen(HDC hdc, HWND hWnd)
|
||||
{
|
||||
SelectObject(hdc, smallFont);
|
||||
SetTextColor(hdc, RGB(128, 104, 118));
|
||||
TextOut(hdc, panelRect.left + SS(24), panelRect.top + SS(212), _T("\u7ecf\u5178\u6a21\u5f0f\u4fdd\u6301\u539f\u7248\u7b80\u5355\u8ba1\u5206"), lstrlen(_T("\u7ecf\u5178\u6a21\u5f0f\u4fdd\u6301\u539f\u7248\u7b80\u5355\u8ba1\u5206")));
|
||||
TextOut(hdc, panelRect.left + SS(24), panelRect.top + SS(240), _T("\u6682\u4e0d\u63a5\u5165\u7b49\u7ea7\u548c\u5f3a\u5316\u7cfb\u7edf"), lstrlen(_T("\u6682\u4e0d\u63a5\u5165\u7b49\u7ea7\u548c\u5f3a\u5316\u7cfb\u7edf")));
|
||||
TextOut(hdc, panelRect.left + SS(24), panelRect.top + SS(232), _T("\u7ecf\u5178\u6a21\u5f0f\u4fdd\u6301\u539f\u7248\u7b80\u5355\u8ba1\u5206"), lstrlen(_T("\u7ecf\u5178\u6a21\u5f0f\u4fdd\u6301\u539f\u7248\u7b80\u5355\u8ba1\u5206")));
|
||||
TextOut(hdc, panelRect.left + SS(24), panelRect.top + SS(260), _T("\u6682\u4e0d\u63a5\u5165\u7b49\u7ea7\u548c\u5f3a\u5316\u7cfb\u7edf"), lstrlen(_T("\u6682\u4e0d\u63a5\u5165\u7b49\u7ea7\u548c\u5f3a\u5316\u7cfb\u7edf")));
|
||||
SelectObject(hdc, sectionFont);
|
||||
SetTextColor(hdc, textColor);
|
||||
}
|
||||
|
||||
TextOut(hdc, panelRect.left + SS(24), panelRect.top + SS(430), _T("\u4e0b\u4e00\u4e2a\u65b9\u5757"), lstrlen(_T("\u4e0b\u4e00\u4e2a\u65b9\u5757")));
|
||||
int previewTitleTop = (currentMode == MODE_ROGUE) ? panelRect.top + SS(690) : panelRect.top + SS(430);
|
||||
int nextCardTop = (currentMode == MODE_ROGUE) ? panelRect.top + SS(724) : panelRect.top + SS(472);
|
||||
int hintTop = (currentMode == MODE_ROGUE) ? panelRect.top + SS(818) : panelRect.top + SS(656);
|
||||
|
||||
TextOut(hdc, panelRect.left + SS(24), previewTitleTop, _T("\u4e0b\u4e00\u4e2a\u65b9\u5757"), lstrlen(_T("\u4e0b\u4e00\u4e2a\u65b9\u5757")));
|
||||
|
||||
int previewCount = 1;
|
||||
if (currentMode == MODE_ROGUE)
|
||||
@@ -627,9 +761,9 @@ void TDrawScreen(HDC hdc, HWND hWnd)
|
||||
RECT nextCard =
|
||||
{
|
||||
panelRect.left + SS(24) + previewIndex * SS(94),
|
||||
panelRect.top + SS(472),
|
||||
nextCardTop,
|
||||
panelRect.left + SS(24) + previewIndex * SS(94) + grid * 2 + SS(40),
|
||||
panelRect.top + SS(472) + grid * 2 + SS(40)
|
||||
nextCardTop + grid * 2 + SS(40)
|
||||
};
|
||||
|
||||
HBRUSH nextCardBrush = CreateSolidBrush(RGB(255, 238, 244));
|
||||
@@ -674,8 +808,42 @@ void TDrawScreen(HDC hdc, HWND hWnd)
|
||||
|
||||
SelectObject(hdc, smallFont);
|
||||
SetTextColor(hdc, RGB(128, 104, 118));
|
||||
TextOut(hdc, panelRect.left + SS(24), panelRect.top + SS(656), _T("M \uff1a\u8fd4\u56de\u83dc\u5355"), lstrlen(_T("M \uff1a\u8fd4\u56de\u83dc\u5355")));
|
||||
TextOut(hdc, panelRect.left + SS(24), panelRect.top + SS(688), _T("\u89c4\u5219\u8bf4\u660e\u8bf7\u5728\u4e3b\u83dc\u5355\u8fdb\u5165"), lstrlen(_T("\u89c4\u5219\u8bf4\u660e\u8bf7\u5728\u4e3b\u83dc\u5355\u8fdb\u5165")));
|
||||
TextOut(hdc, panelRect.left + SS(24), hintTop, _T("M \uff1a\u8fd4\u56de\u83dc\u5355"), lstrlen(_T("M \uff1a\u8fd4\u56de\u83dc\u5355")));
|
||||
TextOut(hdc, panelRect.left + SS(24), hintTop + SS(32), _T("\u89c4\u5219\u8bf4\u660e\u8bf7\u5728\u4e3b\u83dc\u5355\u8fdb\u5165"), lstrlen(_T("\u89c4\u5219\u8bf4\u660e\u8bf7\u5728\u4e3b\u83dc\u5355\u8fdb\u5165")));
|
||||
|
||||
if (feedbackState.visibleTicks > 0)
|
||||
{
|
||||
RECT feedbackRect =
|
||||
{
|
||||
gameRect.left + SS(16),
|
||||
gameRect.top + SS(16),
|
||||
gameRect.right - SS(16),
|
||||
gameRect.top + SS(98)
|
||||
};
|
||||
DrawPanelCard(feedbackRect, RGB(255, 245, 249), RGB(232, 170, 194), 22);
|
||||
|
||||
SelectObject(hdc, bodyFont);
|
||||
SetTextColor(hdc, titleColor);
|
||||
RECT titleRect =
|
||||
{
|
||||
feedbackRect.left + SS(16),
|
||||
feedbackRect.top + SS(12),
|
||||
feedbackRect.right - SS(16),
|
||||
feedbackRect.top + SS(40)
|
||||
};
|
||||
DrawText(hdc, feedbackState.title, -1, &titleRect, DT_LEFT | DT_VCENTER | DT_SINGLELINE);
|
||||
|
||||
SelectObject(hdc, smallFont);
|
||||
SetTextColor(hdc, RGB(116, 90, 104));
|
||||
RECT detailRect =
|
||||
{
|
||||
feedbackRect.left + SS(16),
|
||||
feedbackRect.top + SS(42),
|
||||
feedbackRect.right - SS(16),
|
||||
feedbackRect.bottom - SS(12)
|
||||
};
|
||||
DrawText(hdc, feedbackState.detail, -1, &detailRect, DT_LEFT | DT_WORDBREAK);
|
||||
}
|
||||
|
||||
if (suspendFlag || gameOverFlag)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user