static void CB_OKBtn_Click(void *pComponentButton) { Sound_Start(WAVFN_Click); switch(ProcState.System.LastState){ case ELS_FileList: SetNextProc(ENP_FileList,EPFE_CrossFade); break; case ELS_Launch: SetNextProc(ENP_Launch,EPFE_CrossFade); break; } }
VOID CCharacterProcess::RenderScene(INT nLoopTime) { m_xBGround.Render(nLoopTime); switch(m_Progress) { case PRG_CHAR_SELE: { ShowWindow(g_xChatEditBox.GetSafehWnd(), SW_HIDE); switch(m_xSelectChr.m_nRenderState) { case 11: // Zoom in { m_xBGround.SetRenderState(_RENDER_AVI_IN); m_Progress = PRG_SEL_TO_CREA; m_xSelectChr.CloseWnd(); break; } case 12: // Zoom Out { m_xBGround.SetRenderState(_RENDER_AVI_START); m_Progress = PRG_SEL_TO_GAME; m_xSelectChr.CloseWnd(); break; } case 19: // Select; { m_xSelectChr.m_nRenderState = 0; } } m_xSelectChr.Render(nLoopTime); break; } case PRG_SEL_TO_CREA: ShowWindow(g_xChatEditBox.GetSafehWnd(), SW_HIDE); if(m_xBGround.GetRenderState()==_RENDER_STILL_2) m_Progress = PRG_CREATE_CHAR; break; case PRG_CREATE_CHAR: ShowWindow(g_xChatEditBox.GetSafehWnd(), SW_SHOW); RenderCharCreate(nLoopTime); break; case PRG_CREA_TO_SEL: ShowWindow(g_xChatEditBox.GetSafehWnd(), SW_HIDE); if(m_xBGround.GetRenderState() == _RENDER_STILL_1) { m_Progress = PRG_CHAR_SELE; m_xSelectChr.OpenWnd(); } break; case PRG_SEL_TO_GAME: ShowWindow(g_xChatEditBox.GetSafehWnd(), SW_HIDE); if(m_xBGround.GetRenderState()==_RENDER_STARTGAME) { m_Progress = PRG_PLAY_GAME; // Play Game SetNextProc(); } break; } m_xMsgBox.RenderMessageBox(0); }
static void CB_KeyPress(u32 VsyncCount,u32 Keys) { if((Keys&(KEY_L|KEY_R))!=0){ if((Keys&(KEY_X|KEY_Y))!=0){ if((Keys&KEY_X)!=0) ChangeNextBacklightLevel(); if((Keys&KEY_Y)!=0) ChangePrevBacklightLevel(); Popup_Show_BacklightLevel(); } return; } if((Keys&(KEY_X|KEY_Y))!=0){ if((Keys&KEY_Y)!=0) BookmarkUI_Start(false); if((Keys&KEY_X)!=0) BookmarkUI_Start(true); return; } if((Keys&KEY_B)!=0){ Sound_Start(WAVFN_Click); ToCustomMode=false; SetNextProc(ENP_FileList,EPFE_CrossFade); } if((Keys&(KEY_START|KEY_SELECT))!=0){ Sound_Start(WAVFN_Click); ToCustomMode=true; SetNextProc(ENP_TextCustom,EPFE_RightToLeft); } if((Keys&(KEY_A|KEY_UP|KEY_DOWN|KEY_LEFT|KEY_RIGHT))!=0){ s32 v=0; if((Keys&KEY_A)!=0) v=ShowLineCount-1; if((Keys&KEY_UP)!=0) v=-1; if((Keys&KEY_DOWN)!=0) v=1; if((Keys&KEY_LEFT)!=0) v=-(ShowLineCount-1); if((Keys&KEY_RIGHT)!=0) v=ShowLineCount-1; if((Keys&(KEY_L|KEY_R))!=0) v*=2; if(v!=0){ SetCurrentLineIndex(CurrentLineIndex+v); DrawCurrentText_Main(pScreenMain->pBackCanvas); RedrawSubScreen(); ScreenMain_Flip_ProcFadeEffect(); } } }
static bool ExecItem(u32 ItemIndex) { switch(ItemIndex){ case 0: { TProcState_FileList *pfl=&ProcState.FileList; switch(pfl->Mode){ case EPSFLM_Single: pfl->Mode=EPSFLM_Double; break; case EPSFLM_Double: pfl->Mode=EPSFLM_Single; break; } } break; case 1: { SetNextProc(ENP_Custom,EPFE_RightToLeft); return(false); } break; case 2: { Skin_ClearCustomBG_FileBody(); Skin_ClearCustomBG(); } break; case 3: { if(isExistsSoftResetToFirmware==true){ BootROM_SoftResetToFirmware(); SetNextProc(ENP_BootROM,EPFE_None); return(false); } Sound_Start(WAVFN_Notify); return(false); } break; case 4: { // for Error dialog test. static u32 i=0; if(i==EEC_UnknownError){ i=0; }else{ i++; } ErrorDialog_Set((EErrorCode)i); Sound_Start(WAVFN_Click); SetNextProc(ENP_FileList,EPFE_CrossFade); } break; } return(true); }
LRESULT CSvrSelProcess::OnKeyDown(WPARAM wParam, LPARAM lParam) { switch ( wParam ) { case VK_RETURN: { SetNextProc(); } break; } return 0L; }
static void CB_MouseUp(s32 x,s32 y) { Particle_SetMouseUp(); if(deskmf==false) return; deskmf=false; if(pPressingButton!=NULL){ pPressingButton->Pressing=false; ComponentButton_Draw(pPressingButton); for(u32 idx=0;idx<CompButtonsCount;idx++){ TComponentButton *pcb=&CompButtons[idx]; if(pcb==pPressingButton){ if(ComponentButton_GetIndexFromPos(pcb,x,y)!=-1){ ComponentButton_MouseUp(&CompButtons[idx],x,y); } } } // Setting_Redraw(); pPressingButton=NULL; return; } for(u32 idx=0;idx<CompLabelsCount;idx++){ if(ComponentLabel_MouseUp(&CompLabels[idx],x,y)==true){ // Setting_Redraw(); } } for(u32 idx=0;idx<CompChecksCount;idx++){ if(ComponentCheck_MouseUp(&CompChecks[idx],x,y)==true){ // Setting_Redraw(); } } u32 LastItemIndex=ItemIndex; ItemIndex=Items_GetIndexFromPos(x,y); if(LastItemIndex!=ItemIndex){ // ProcFadeEffect=EPFE_FastCrossFade; // Setting_Redraw(); } if(ItemIndex!=-1){ Sound_Start(WAVFN_Click); if(ExecItem(ItemIndex)==true) SetNextProc(ENP_FileList,EPFE_CrossFade); } }
VOID CLoginProcess::RenderScroll(INT nLoopTime) { static INT nScroll = 0; static INT nDelay = 0; nDelay += nLoopTime; if(nDelay > 40) { nScroll += 5; if(nScroll >= 180) { SetNextProc(); // 케릭터 셀렉트 서버로 이동 (임시) return; } } // m_Image.NewSetIndex(IMG_IDX_LOGIN_BACK); // g_xMainWnd.DrawWithImageForCompClipRgn(SCR_LEFT, SCR_TOP + nScroll, SCR_RIGHT, SCR_BOTTOM, (WORD*)(m_Image.m_pbCurrImage),SCR_LEFT,SCR_BOTTOM-nScroll); }
static void CB_KeyPress(u32 VsyncCount,u32 Keys) { if((Keys&KEY_A)!=0){ if(ItemIndex!=-1){ Sound_Start(WAVFN_Click); if(ExecItem(ItemIndex)==true){ SetNextProc(ENP_FileList,EPFE_CrossFade); } } } if((Keys&KEY_B)!=0){ Sound_Start(WAVFN_Click); CB_CancelBtn_Click(NULL); } if((Keys&(KEY_LEFT|KEY_RIGHT|KEY_UP|KEY_DOWN))!=0){ if((Keys&KEY_LEFT)!=0) ItemIndex=0; if((Keys&KEY_RIGHT)!=0) ItemIndex=ItemsCount-1; if((Keys&KEY_DOWN)!=0){ if(ItemIndex==-1){ ItemIndex=0; }else{ if(ItemIndex<(ItemsCount-1)) ItemIndex++; } } if((Keys&KEY_UP)!=0){ if(ItemIndex==-1){ ItemIndex=ItemsCount-1; }else{ if(0<ItemIndex) ItemIndex--; } } // if(lastidx!=ItemIndex) Setting_Redraw(); } }
static void CB_CancelBtn_Click(void *pComponentButton) { Sound_Start(WAVFN_Click); SetNextProc(ENP_FileList,EPFE_CrossFade); }
static void CB_Start(void) { deskmf=false; pPressingButton=NULL; mscrf=false; mbodyf=false; ToCustomMode=false; CompsInit(); Bookmark_Init(); InitMsg_Init(); u32 FontSize=ProcState.Text.FontSize; switch(FontSize){ case Text_FontSize_Small: ShowLineMargin=2; break; case Text_FontSize_Middle: ShowLineMargin=4; break; case Text_FontSize_Large: ShowLineMargin=5; break; default: { _consolePrintf("Fatal error: Illigal font size. (%d)\n",ProcState.Text.FontSize); ShowLogHalt(); } break; } switch(ProcState.Text.LineSpace){ case ETLS_Small: ShowLineMargin/=2; break; case ETLS_Middle: ShowLineMargin*=1; break; case ETLS_Large: ShowLineMargin*=2; break; } ShowLineHeight=FontSize+ShowLineMargin; ShowLineCount=(ScreenHeight-TopMargin-BottomMargin)/ShowLineHeight; InitMsg_Draw(Lang_GetUTF8("TV_PRG_LoadExtendFont")); ExtFont_Init(); { FAT_FILE *pSwapFile=Shell_FAT_fopen_SwapFile(); DFS_Init(pSwapFile); FAT2_fclose(pSwapFile); } libconv_Init(); PrintFreeMem(); FAT_FILE *pfh=Shell_FAT_fopen_Split(RelationalFilePathUnicode,RelationalFileNameUnicode); if(pfh==NULL){ _consolePrintf("Fatal error: Can not open text file.\n"); ShowLogHalt(); } u32 bufsize=FAT2_GetFileSize(pfh); u8 *pbuf=NULL; if(bufsize==0){ _consolePrintf("Not support 0byte text file.\n"); ErrorDialog_Set(EEC_Text0byte); }else{ pbuf=(u8*)safemalloc((bufsize+3)&~3); if(pbuf==NULL){ _consolePrintf("Memory overflow. %dbyte.\n",bufsize); bufsize=0; }else{ void *pdummy=safemalloc(32*1024); if(pdummy==NULL){ _consolePrintf("Memory overflow for reserved area.\n"); bufsize=0; safefree(pbuf); pbuf=NULL; }else{ safefree(pdummy); pdummy=NULL; _consolePrintf("pbuf=0x%08x, bufsize=%dbyte.\n",pbuf,bufsize); InitMsg_Draw(Lang_GetUTF8("TV_PRG_LoadTextFile")); FAT2_fread(pbuf,1,bufsize,pfh); } } } FAT2_fclose(pfh); PrintFreeMem(); if(bufsize==0){ libconv_EndConvert(); InitMsg_Free(); Bookmark_Free(); _consolePrintf("Text reader: file not found or size limit error.\n"); ErrorDialog_Set(EEC_MemoryOverflow_CanRecovery); ToCustomMode=false; SetNextProc(ENP_FileList,EPFE_CrossFade); return; } if(ManualTextEncode_OverrideFlag==true){ ManualTextEncode_OverrideFlag=false; Bookmark_SetTextEncode(ManualTextEncode); } switch(Bookmark_GetTextEncode()){ case ETE_Auto: { InitMsg_Draw(Lang_GetUTF8("TV_PRG_DetectTextEncode")); const u32 maxbufsize=16*1024; if(bufsize<maxbufsize){ libconv_AutoSelectEncode(pbuf,bufsize); }else{ libconv_AutoSelectEncode(pbuf,maxbufsize); } _consolePrintf("Detected text encode is %s.\n",pEncodeID); } break; case ETE_ANSI: libconv_SelectEncode_ANSI(); break; case ETE_SJIS: libconv_SelectEncode_SJIS(); break; case ETE_UTF16BE: libconv_SelectEncode_UTF16BE(); break; case ETE_UTF16LE: libconv_SelectEncode_UTF16LE(); break; case ETE_UTF8: libconv_SelectEncode_UTF8(); break; } InitMsg_Draw(Lang_GetUTF8("TV_PRG_DetectReturnCode")); libconv_DetectReturnCode(pbuf,bufsize); switch(ReturnCode){ case ERC_Unknown: _consolePrint("Detected return code is unknown.\n"); break; case ERC_CR: _consolePrint("Detected return code is CR.\n"); break; case ERC_LF: _consolePrint("Detected return code is LF.\n"); break; case ERC_CRLF: _consolePrint("Detected return code is CR+LF.\n"); break; case ERC_LFCR: _consolePrint("Detected return code is LF+CR.\n"); break; } InitMsg_Draw(Lang_GetUTF8("TV_PRG_ConvertToUnicode")); libconv_Convert(pbuf,bufsize,pCglFontDefault); _consolePrintf("Total lines count is %d.\n",TextLinesCount); if(pbuf!=NULL){ safefree(pbuf); pbuf=NULL; } libconv_EndConvert(); InitMsg_Draw(Lang_GetUTF8("TV_PRG_LoadExtendFont")); ExtFont_LoadBody(); // テキスト変換後にスキンを読み込む InitMsg_Draw(Lang_GetUTF8("TV_PRG_LoadSkinData")); Skin_Load_TextView_AfterLoad(); pTmpBM=new CglCanvas(NULL,ScreenWidth,ScreenHeight,pf15bit); pTmpBM->SetCglFont(pCglFontDefault); InitMsg_Free(); { u32 linenum=0; if(RelationalFilePos!=0) linenum=RelationalFilePos; if(Bookmark_GetResumeLineNum()!=0){ linenum=Bookmark_GetResumeLineNum()-1; Bookmark_SetResumeLineNum(0); } SetCurrentLineIndex(linenum); } DrawCurrentText_Main(pScreenMain->pBackCanvas); RedrawSubScreen(); ScreenMain_Flip_ProcFadeEffect(); Resume_SetResumeMode(ERM_Text); Resume_SetFilename(ConvertFull_MargeFromSplit(RelationalFilePathUnicode,RelationalFileNameUnicode)); Resume_SetPos(GetCurrentLineIndex()); Resume_Save(); Sound_Start(WAVFN_Open); ClockTimeOut=0; }
static void CB_CancelBtn_Click(void *pComponentButton) { SetNextProc(ENP_FileList,EPFE_CrossFade); ClearFlag(); }
static void CB_MouseUp(s32 x,s32 y) { TRomSetState *pCurRomSetState=&RomSetState; if(isInsideRect(menurect11,x,y)==true) { } if(isInsideRect(menurect12,x,y)==true) { } if(isInsideRect(menurect13,x,y)==true) { } if(isInsideRect(menurect14,x,y)==true) { } if(isInsideRect(menurect16,x,y)==true) { if(pCurRomSetState->CheatState) { isPressRect16=false; DSIdx=dsi(); strcpy(CheatRomInfo.FullPathAlias,RomSetInfo.FullPathAlias); memcpy(&RomSetStateTmp,&RomSetState,sizeof(TRomSetState)); SetFlag(); { strcpy(pNDSAlis,CheatRomInfo.FullPathAlias); if(isHomeBrew() == true) { //do nothing } else {//商业ROM启动代码 //打开金手指窗口 if(isUserCheatDataExits()) { NDSCheatInfo *pInfo=FindSelectNDSCheatHeadInfo(); if(pInfo) { safefree(pInfo); isPressRect16=false; SetNextProc(ENP_Cheat,EPFE_CrossFade); } } else isPressRect16=true; } } } } if(isInsideRect(menurect00,x,y)==true) { isPressA=false; CloseRomData(); CB_CancelBtn_Click(NULL); } if(isInsideRect(menurect01,x,y)==true) { isPressB=false; CB_CancelBtn_Click(NULL); } }
static void CB_KeyPress(u32 VsyncCount,u32 Keys) { TRomSetState *pCurRomSetState=&RomSetState; if((Keys&KEY_A)!=0){ isPressA=true; CloseRomData(); CB_CancelBtn_Click(NULL); } if((Keys&KEY_B)!=0){ isPressB=true; CB_CancelBtn_Click(NULL); } if((Keys&(KEY_LEFT|KEY_RIGHT|KEY_UP|KEY_DOWN))!=0){ if((Keys&KEY_LEFT)!=0) { switch(ItemIdx) { case 0: { if(pCurRomSetState->SoftReset) pCurRomSetState->SoftReset=false; else pCurRomSetState->SoftReset=true; }break; case 1: { if(pCurRomSetState->RealtimeSave) pCurRomSetState->RealtimeSave=false; else pCurRomSetState->RealtimeSave=true; }break; case 2: { if(pCurRomSetState->GameGuide) pCurRomSetState->GameGuide=false; else pCurRomSetState->GameGuide=true; }break; case 3: { if(pCurRomSetState->CheatState) pCurRomSetState->CheatState=false; else pCurRomSetState->CheatState=true; }break; case 4: { if(pCurRomSetState->DownloadPlayState) pCurRomSetState->DownloadPlayState=false; else pCurRomSetState->DownloadPlayState=true; }break; case 5: { if(pCurRomSetState->SpeciaMode) pCurRomSetState->SpeciaMode=false; else pCurRomSetState->SpeciaMode=true; }break; default: break; } } if((Keys&KEY_RIGHT)!=0) { switch(ItemIdx) { case 0: { if(pCurRomSetState->SoftReset) pCurRomSetState->SoftReset=false; else pCurRomSetState->SoftReset=true; }break; case 1: { if(pCurRomSetState->RealtimeSave) pCurRomSetState->RealtimeSave=false; else pCurRomSetState->RealtimeSave=true; }break; case 2: { if(pCurRomSetState->GameGuide) pCurRomSetState->GameGuide=false; else pCurRomSetState->GameGuide=true; }break; case 3: { if(pCurRomSetState->CheatState) pCurRomSetState->CheatState=false; else pCurRomSetState->CheatState=true; }break; case 4: { if(pCurRomSetState->DownloadPlayState) pCurRomSetState->DownloadPlayState=false; else pCurRomSetState->DownloadPlayState=true; }break; case 5: { if(pCurRomSetState->SpeciaMode) pCurRomSetState->SpeciaMode=false; else pCurRomSetState->SpeciaMode=true; }break; default: break; } } if((Keys&KEY_DOWN)!=0) { if(ItemIdx==4) ItemIdx=5; if(ItemIdx==3) ItemIdx=4; if(ItemIdx==2) ItemIdx=3; if(ItemIdx==1) ItemIdx=2; if(ItemIdx==0) ItemIdx=1; } if((Keys&KEY_UP)!=0) { if(ItemIdx==1) ItemIdx=0; if(ItemIdx==2) ItemIdx=1; if(ItemIdx==3) ItemIdx=2; if(ItemIdx==4) ItemIdx=3; if(ItemIdx==5) ItemIdx=4; } } if((Keys&KEY_Y)!=0){ if(pCurRomSetState->CheatState) { isPressRect16=false; DSIdx=dsi(); strcpy(CheatRomInfo.FullPathAlias,RomSetInfo.FullPathAlias); memcpy(&RomSetStateTmp,&RomSetState,sizeof(TRomSetState)); SetFlag(); { strcpy(pNDSAlis,CheatRomInfo.FullPathAlias); if(isHomeBrew() == true) { //do nothing } else {//商业ROM启动代码 //打开金手指窗口 if(isUserCheatDataExits()) { NDSCheatInfo *pInfo=FindSelectNDSCheatHeadInfo(); if(pInfo) { safefree(pInfo); SetNextProc(ENP_Cheat,EPFE_CrossFade); } } } } } } }