⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lvtetrismenu.h

📁 俄罗斯方块
💻 H
字号:
#ifndef LVTETRISMENU_H_
#define LVTETRISMENU_H_

#include <w32std.h>


const TInt MenuItemSum			= 5;
//const TInt MenuStr				= 20;
//const TInt OptionsStr			= 60;
const TInt OptionsLevelItem			= 3;
const TInt OptionsRotateItem			= 2;

//for game status
enum TGameStatus
{
	GAMEMENUING = 0x20, 
	GAMERUNNING, 
	GAMEPAUSING, 
	GAMEOVERING,
	GAMEQUITING
};

enum TMenuItem
{
	EMenuItem_Start = 0,
	EMenuItem_Options,
	EMenuItem_HighScores,
	EMenuItem_Help,
	EMenuItem_Quit,
	EMenuItem_None
};

enum TMenuState
{
	EMenuState_Main = 0,
	EMenuState_Options,
	EMenuState_HighScores,
	EMenuState_Help,
	EMenuState_Quit,
	EMenuState_None
};

enum TOptionsLevelItem
{
	EOptionsItem_Level1 = 0,
	EOptionsItem_Level2,
	EOptionsItem_Level3,
	EOptionsItem_LevelNone
};

enum TOptionsRotateItem
{

	EOptionsItem_RotateDir1 = 0,
	EOptionsItem_RotateDir2,
	EOptionsItem_RotateDirNone
	
};

enum TOptionsState
{
	EOptionsState_Level = 0,
	EOptionsState_RotateDir,
	EOptionsState_None
};

class CLvtetrisMenu : public CBase
{
// Construct and destruct
public:
	static CLvtetrisMenu* NewL(CFbsBitGc* aFbsBitGc);
	~CLvtetrisMenu();

private:
	void ConstructL();
	CLvtetrisMenu(CFbsBitGc* aFbsBitGc);


//////////////////////////////////////////////////////////////////////
// Other Method
public:
	// draw the menu
	void DrawMenu();
	// handel command
	TGameStatus Command(TInt aCommand);
	
	TInt8 Level();
	TInt8 RotateDir();

private:
	// set the frame contains the text
	// Dymamic modify the frame's position if possible
//	void SetFrameDynamic(TInt aMenuItem);
	// don't modify it's position
//	void SetFrame(TInt aMenuItem);

	void ResetPos();

//	void DrawPage(TInt aItemForm, TInt aItemTo);

//	void DrawBg();

	// Init menu positon and Txt
	void LoadResL();
	// Index
//	TInt Index(TInt aMenuItem);
/////////////////////////////////////////////////////////////////////
// Data

private:

	CFbsBitGc*		iGc;							// graphic context

	TOptionsLevelItem			iLevel;
	TOptionsRotateItem			iRotateDir;
	
//	TMenuItem		iMenuItem;
	TInt8			iMenuItem;
	TMenuState		iMenuState;	
	
	TOptionsLevelItem	iOptionsLevelItem;
	TOptionsRotateItem	iOptionsRotateItem;
//	TOptionsLevelItem	iPrevOptionsItemLevel;
//	TOptionsRotateItem	iPrevOptionsItemRotateDir;
	TOptionsState	iOptionsState;
	
	TFixedArray<TPoint, MenuItemSum> iMenuItemPos;	// menu item position
	TFixedArray<HBufC*, MenuItemSum> iMenuItemTxt;	// menu item text

	TFixedArray<HBufC*, OptionsLevelItem> iOptionsLevelTxt;
	TFixedArray<TPoint, OptionsLevelItem> iOptionsLevelPos;
	
	TFixedArray<HBufC*, OptionsRotateItem> iOptionsRotateTxt;
	TFixedArray<TPoint, OptionsRotateItem> iOptionsRotatePos;

	TFixedArray<HBufC*, 6> iMenuHelpTxt;
	TFixedArray<TPoint, 6> iMenuHelpPos;
	
//	TFixedArray<TPoint, MenuPageSum> iMenuPagePos;	// Menu Page start&end menuItem num

	CFbsBitmap*		iMenubackgroud;
	CFbsBitmap*		iOptionsbackgroud;
	CFbsBitmap*		iHighScoresbackgroud;
	CFbsBitmap*		iHelpbackgroud;
#if 0
	TPoint			iPos;							// used for background

	TPoint			iPointList[12];					// 12 points form a frame

	TPoint			iCurrentMenuItemPos[MenuItemSum];

	TInt			iBlink;							// used for blink menu

	TInt			iSpeed;							// used for showing menu

	TBool			iSelect;						// used for highlight menu one time when selected		

	//CEikLabel*		iLabel;

public:
	TFixedArray<TInt, SettingItem>	iSetting;			// used for return
#endif
};


#endif /*LVTETRISMENU_H_*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -