优化选择强化ui 下降升级数值
This commit is contained in:
@@ -163,7 +163,7 @@ void ResetPlayerStats(PlayerStats& stats, bool useRogueRules)
|
|||||||
stats.score = 0;
|
stats.score = 0;
|
||||||
stats.level = 1;
|
stats.level = 1;
|
||||||
stats.exp = 0;
|
stats.exp = 0;
|
||||||
stats.requiredExp = useRogueRules ? 30 : 0;
|
stats.requiredExp = useRogueRules ? 10 : 0;
|
||||||
stats.totalLinesCleared = 0;
|
stats.totalLinesCleared = 0;
|
||||||
stats.scoreMultiplierPercent = 100;
|
stats.scoreMultiplierPercent = 100;
|
||||||
stats.expMultiplierPercent = 100;
|
stats.expMultiplierPercent = 100;
|
||||||
|
|||||||
+19
-46
@@ -1609,20 +1609,25 @@ void TDrawScreen(HDC hdc, HWND hWnd)
|
|||||||
int gap = SS(18);
|
int gap = SS(18);
|
||||||
int horizontalPadding = SS(36);
|
int horizontalPadding = SS(36);
|
||||||
int verticalTop = overlayRect.top + SS(138);
|
int verticalTop = overlayRect.top + SS(138);
|
||||||
int rowCount = (upgradeUiState.optionCount + 1) / 2;
|
int columnCount = upgradeUiState.optionCount <= 3 ? upgradeUiState.optionCount : 3;
|
||||||
|
if (columnCount < 1)
|
||||||
|
{
|
||||||
|
columnCount = 1;
|
||||||
|
}
|
||||||
|
int rowCount = (upgradeUiState.optionCount + columnCount - 1) / columnCount;
|
||||||
if (rowCount < 1)
|
if (rowCount < 1)
|
||||||
{
|
{
|
||||||
rowCount = 1;
|
rowCount = 1;
|
||||||
}
|
}
|
||||||
int cardWidth = (overlayRect.right - overlayRect.left - horizontalPadding * 2 - gap) / 2;
|
int cardWidth = (overlayRect.right - overlayRect.left - horizontalPadding * 2 - gap * (columnCount - 1)) / columnCount;
|
||||||
int availableHeight = overlayRect.bottom - verticalTop - SS(72) - (rowCount - 1) * gap;
|
int availableHeight = overlayRect.bottom - verticalTop - SS(72) - (rowCount - 1) * gap;
|
||||||
int cardHeight = availableHeight / rowCount;
|
int cardHeight = availableHeight / rowCount;
|
||||||
|
|
||||||
for (int i = 0; i < upgradeUiState.optionCount; i++)
|
for (int i = 0; i < upgradeUiState.optionCount; i++)
|
||||||
{
|
{
|
||||||
bool isSelected = (i == upgradeUiState.selectedIndex);
|
bool isSelected = (i == upgradeUiState.selectedIndex);
|
||||||
int column = i % 2;
|
int column = i % columnCount;
|
||||||
int row = i / 2;
|
int row = i / columnCount;
|
||||||
int left = overlayRect.left + horizontalPadding + column * (cardWidth + gap);
|
int left = overlayRect.left + horizontalPadding + column * (cardWidth + gap);
|
||||||
int top = verticalTop + row * (cardHeight + gap);
|
int top = verticalTop + row * (cardHeight + gap);
|
||||||
int right = left + cardWidth;
|
int right = left + cardWidth;
|
||||||
@@ -1637,8 +1642,6 @@ void TDrawScreen(HDC hdc, HWND hWnd)
|
|||||||
|
|
||||||
COLORREF cardFill = RGB(255, 247, 250);
|
COLORREF cardFill = RGB(255, 247, 250);
|
||||||
COLORREF cardBorder = RGB(221, 197, 208);
|
COLORREF cardBorder = RGB(221, 197, 208);
|
||||||
COLORREF iconFill = RGB(233, 206, 217);
|
|
||||||
COLORREF categoryColor = RGB(122, 95, 110);
|
|
||||||
COLORREF descColor = RGB(108, 86, 99);
|
COLORREF descColor = RGB(108, 86, 99);
|
||||||
COLORREF footerColor = RGB(128, 104, 118);
|
COLORREF footerColor = RGB(128, 104, 118);
|
||||||
|
|
||||||
@@ -1646,8 +1649,6 @@ void TDrawScreen(HDC hdc, HWND hWnd)
|
|||||||
{
|
{
|
||||||
cardFill = isSelected ? RGB(255, 233, 233) : RGB(255, 243, 243);
|
cardFill = isSelected ? RGB(255, 233, 233) : RGB(255, 243, 243);
|
||||||
cardBorder = isSelected ? RGB(210, 92, 92) : RGB(224, 156, 156);
|
cardBorder = isSelected ? RGB(210, 92, 92) : RGB(224, 156, 156);
|
||||||
iconFill = isSelected ? RGB(235, 128, 128) : RGB(232, 182, 182);
|
|
||||||
categoryColor = RGB(146, 73, 73);
|
|
||||||
descColor = RGB(120, 74, 74);
|
descColor = RGB(120, 74, 74);
|
||||||
footerColor = RGB(150, 70, 70);
|
footerColor = RGB(150, 70, 70);
|
||||||
}
|
}
|
||||||
@@ -1655,7 +1656,6 @@ void TDrawScreen(HDC hdc, HWND hWnd)
|
|||||||
{
|
{
|
||||||
cardFill = RGB(255, 235, 242);
|
cardFill = RGB(255, 235, 242);
|
||||||
cardBorder = accentColor;
|
cardBorder = accentColor;
|
||||||
iconFill = RGB(242, 176, 202);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HBRUSH cardBrush = CreateSolidBrush(cardFill);
|
HBRUSH cardBrush = CreateSolidBrush(cardFill);
|
||||||
@@ -1668,44 +1668,17 @@ void TDrawScreen(HDC hdc, HWND hWnd)
|
|||||||
DeleteObject(cardBrush);
|
DeleteObject(cardBrush);
|
||||||
DeleteObject(cardPen);
|
DeleteObject(cardPen);
|
||||||
|
|
||||||
RECT iconRect =
|
|
||||||
{
|
|
||||||
cardRect.left + SS(20),
|
|
||||||
cardRect.top + SS(20),
|
|
||||||
cardRect.left + SS(84),
|
|
||||||
cardRect.top + SS(84)
|
|
||||||
};
|
|
||||||
|
|
||||||
HBRUSH iconBrush = CreateSolidBrush(iconFill);
|
|
||||||
HPEN iconPen = CreatePen(PS_SOLID, 1, RGB(255, 250, 252));
|
|
||||||
oldPen = (HPEN)SelectObject(hdc, iconPen);
|
|
||||||
oldBrush = (HBRUSH)SelectObject(hdc, iconBrush);
|
|
||||||
RoundRect(hdc, iconRect.left, iconRect.top, iconRect.right, iconRect.bottom, SS(18), SS(18));
|
|
||||||
SelectObject(hdc, oldBrush);
|
|
||||||
SelectObject(hdc, oldPen);
|
|
||||||
DeleteObject(iconBrush);
|
|
||||||
DeleteObject(iconPen);
|
|
||||||
|
|
||||||
SelectObject(hdc, smallFont);
|
|
||||||
SetTextColor(hdc, categoryColor);
|
|
||||||
RECT categoryRect =
|
|
||||||
{
|
|
||||||
cardRect.left + SS(20),
|
|
||||||
cardRect.top + SS(96),
|
|
||||||
cardRect.right - SS(20),
|
|
||||||
cardRect.top + SS(122)
|
|
||||||
};
|
|
||||||
DrawText(hdc, upgradeUiState.options[i].category, -1, &categoryRect, DT_LEFT | DT_VCENTER | DT_SINGLELINE);
|
|
||||||
|
|
||||||
TCHAR levelText[32];
|
TCHAR levelText[32];
|
||||||
_stprintf_s(levelText, _T("Lv.%d"), upgradeUiState.options[i].currentLevel + 1);
|
_stprintf_s(levelText, _T("Lv.%d"), upgradeUiState.options[i].currentLevel + 1);
|
||||||
RECT levelRect =
|
RECT levelRect =
|
||||||
{
|
{
|
||||||
cardRect.right - SS(88),
|
cardRect.right - SS(88),
|
||||||
cardRect.top + SS(24),
|
cardRect.top + SS(20),
|
||||||
cardRect.right - SS(20),
|
cardRect.right - SS(20),
|
||||||
cardRect.top + SS(54)
|
cardRect.top + SS(48)
|
||||||
};
|
};
|
||||||
|
SelectObject(hdc, smallFont);
|
||||||
|
SetTextColor(hdc, footerColor);
|
||||||
DrawText(hdc, levelText, -1, &levelRect, DT_RIGHT | DT_VCENTER | DT_SINGLELINE);
|
DrawText(hdc, levelText, -1, &levelRect, DT_RIGHT | DT_VCENTER | DT_SINGLELINE);
|
||||||
|
|
||||||
SelectObject(hdc, sectionFont);
|
SelectObject(hdc, sectionFont);
|
||||||
@@ -1713,18 +1686,18 @@ void TDrawScreen(HDC hdc, HWND hWnd)
|
|||||||
RECT nameRect =
|
RECT nameRect =
|
||||||
{
|
{
|
||||||
cardRect.left + SS(20),
|
cardRect.left + SS(20),
|
||||||
cardRect.top + SS(126),
|
cardRect.top + SS(44),
|
||||||
cardRect.right - SS(20),
|
cardRect.right - SS(96),
|
||||||
cardRect.top + SS(170)
|
cardRect.top + SS(98)
|
||||||
};
|
};
|
||||||
DrawText(hdc, upgradeUiState.options[i].name, -1, &nameRect, DT_LEFT | DT_VCENTER | DT_WORDBREAK);
|
DrawText(hdc, upgradeUiState.options[i].name, -1, &nameRect, DT_LEFT | DT_TOP | DT_WORDBREAK);
|
||||||
|
|
||||||
SelectObject(hdc, bodyFont);
|
SelectObject(hdc, bodyFont);
|
||||||
SetTextColor(hdc, descColor);
|
SetTextColor(hdc, descColor);
|
||||||
RECT descRect =
|
RECT descRect =
|
||||||
{
|
{
|
||||||
cardRect.left + SS(20),
|
cardRect.left + SS(20),
|
||||||
cardRect.top + SS(182),
|
cardRect.top + SS(116),
|
||||||
cardRect.right - SS(20),
|
cardRect.right - SS(20),
|
||||||
cardRect.bottom - SS(64)
|
cardRect.bottom - SS(64)
|
||||||
};
|
};
|
||||||
@@ -1741,7 +1714,7 @@ void TDrawScreen(HDC hdc, HWND hWnd)
|
|||||||
SetTextColor(hdc, footerColor);
|
SetTextColor(hdc, footerColor);
|
||||||
DrawText(
|
DrawText(
|
||||||
hdc,
|
hdc,
|
||||||
upgradeUiState.options[i].cursed ? _T("\u547d\u8fd0\u8f6e\u76d8\uff1a\u9644\u5e26\u8bc5\u5492") : _T("\u5360\u4f4d\u56fe\u6807 / \u5360\u4f4d\u7a00\u6709\u5ea6"),
|
upgradeUiState.options[i].cursed ? _T("\u7a00\u6709\u5ea6\uff1a\u8bc5\u5492") : _T("\u7a00\u6709\u5ea6\uff1a\u5360\u4f4d"),
|
||||||
-1,
|
-1,
|
||||||
&footerRect,
|
&footerRect,
|
||||||
DT_LEFT | DT_VCENTER | DT_SINGLELINE);
|
DT_LEFT | DT_VCENTER | DT_SINGLELINE);
|
||||||
|
|||||||
@@ -990,7 +990,7 @@ static int ApplyLevelProgress(PlayerStats& stats)
|
|||||||
{
|
{
|
||||||
stats.exp -= stats.requiredExp;
|
stats.exp -= stats.requiredExp;
|
||||||
stats.level++;
|
stats.level++;
|
||||||
stats.requiredExp = 20 + stats.level * 10;
|
stats.requiredExp = 8 + stats.level * 6;
|
||||||
levelUps++;
|
levelUps++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user