添加模式选择与Rogue升级界面

This commit is contained in:
2026-04-24 17:39:06 +08:00
parent 8f651e896e
commit 37f11394bb
4 changed files with 407 additions and 17 deletions
+36 -3
View File
@@ -14,8 +14,10 @@ constexpr int nHeight = 22;
constexpr int WINDOW_PADDING = 28;
constexpr int SIDE_PANEL_WIDTH = 320;
constexpr int SIDE_PANEL_GAP = 28;
constexpr int SIDE_PANEL_HEIGHT = 760;
constexpr int WINDOW_CLIENT_WIDTH = WINDOW_PADDING * 2 + nGameWidth * GRID + SIDE_PANEL_GAP + SIDE_PANEL_WIDTH;
constexpr int WINDOW_CLIENT_HEIGHT = WINDOW_PADDING * 2 + nGameHeight * GRID + 20;
constexpr int BOARD_CLIENT_HEIGHT = WINDOW_PADDING * 2 + nGameHeight * GRID + 20;
constexpr int WINDOW_CLIENT_HEIGHT = (BOARD_CLIENT_HEIGHT > SIDE_PANEL_HEIGHT) ? BOARD_CLIENT_HEIGHT : SIDE_PANEL_HEIGHT;
struct Point
{
@@ -29,10 +31,36 @@ struct MenuState
int optionCount;
};
struct PlayerStats
{
int score;
int level;
int exp;
int requiredExp;
int totalLinesCleared;
};
struct UpgradeOption
{
const TCHAR* name;
const TCHAR* category;
const TCHAR* description;
};
struct UpgradeUiState
{
int selectedIndex;
int optionCount;
int pendingCount;
int totalChosenCount;
UpgradeOption options[3];
};
enum ScreenState
{
SCREEN_MENU = 0,
SCREEN_PLAYING = 1
SCREEN_PLAYING = 1,
SCREEN_UPGRADE = 2
};
enum GameMode
@@ -52,6 +80,9 @@ extern int workRegion[20][10];
extern Point point;
extern Point target;
extern MenuState menuState;
extern PlayerStats classicStats;
extern PlayerStats rogueStats;
extern UpgradeUiState upgradeUiState;
extern int currentScreen;
extern int currentMode;
extern int bricks[7][4][4][4];
@@ -67,10 +98,12 @@ void Rotate();
void DropDown();
void Fixing();
void DeleteOneLine(int number);
void DeleteLines();
int DeleteLines();
void ComputeTarget();
void Restart();
void StartGameWithMode(int mode);
void ReturnToMainMenu();
void OpenUpgradeMenu();
void ConfirmUpgradeSelection();
void TDrawScreen(HDC hdc, HWND hWnd);