📄 icebloxxappui.cpp
字号:
#include "icebloxxappui.h"
#include "icebloxxview.h"
#include "icebloxx.h"
#include "icebloxx.hrh"
#include <reent.h>
#include <icebloxx.rsg>
#include <eikenv.h>
CIceBloxxAppUi::CIceBloxxAppUi()
{
}
CIceBloxxAppUi::~CIceBloxxAppUi()
{
delete iIceBloxGame;
#ifndef UIQ3
if(iView)
{
DeregisterViewAndRemoveStack(*iView);
RemoveFromStack(iView);
delete iView;
}
#endif
CloseSTDLIB();
}
void CIceBloxxAppUi::ConstructL()
{
CQikAppUi::BaseConstructL();
#ifdef UIQ3
iView = new (ELeave) CIceBloxxView(*this);
iView->ConstructL();
AddViewL(*iView);
#else
iView = new (ELeave) CIceBloxxView();
iView->ConstructL();
RegisterViewAndAddStackL(*iView);
AddToViewStackL(*iView,iView);
SetDefaultViewL(*iView);
#endif
iIceBloxGame = new (ELeave) Icebloxx(iView,NULL,0);
iView->SetIceBloxxGame(iIceBloxGame);
}
CIceBloxxView* CIceBloxxAppUi::GameView()
{
return iView;
}
void CIceBloxxAppUi::HandleCommandL(TInt aCommand)
{
switch(aCommand)
{
case EStartNewGame:
iIceBloxGame->Field().start();
break;
case ENormalSpeed:
iIceBloxGame->updateSpeed(6);
iIceBloxGame->Field().updateSpeed(6);
break;
case EFastSpeed:
iIceBloxGame->updateSpeed(9);
iIceBloxGame->Field().updateSpeed(9);
break;
case ERoadRunnerSpeed:
iIceBloxGame->updateSpeed(12);
iIceBloxGame->Field().updateSpeed(12);
break;
case EWeakStrength:
iIceBloxGame->updateStrength(6);
iIceBloxGame->Field().updateStrength(6);
break;
case ENormalStrength:
iIceBloxGame->updateStrength(12);
iIceBloxGame->Field().updateStrength(12);
break;
case EStrongStrength:
iIceBloxGame->updateStrength(18);
iIceBloxGame->Field().updateStrength(18);
break;
case ESuperStrength:
iIceBloxGame->updateStrength(24);
iIceBloxGame->Field().updateStrength(24);
break;
case E3Coins:
case E4Coins:
case E5Coins:
case E6Coins:
case E7Coins:
case E8Coins:
iIceBloxGame->updateCoins((aCommand-E3Coins)+3);
iIceBloxGame->Field().updateCoins((aCommand-E3Coins)+3);
break;
case EEikCmdExit:
iIceBloxGame->writeConfig();
Exit();
break;
case EAboutIceBloxx:
TBuf<64> title;
HBufC* text = NULL;;
iEikonEnv->ReadResource(title,R_HELP_TITLE);
text = iEikonEnv->AllocReadResourceLC(R_HELP_TEXT);
iEikonEnv->InfoWinL(title, *text);
CleanupStack::PopAndDestroy(text);
break;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -