void ScorePanel::Draw(SDL_Surface* pdest) { for (int i = 0; i < 4; i++) { Shared::DrawSurface(bannerList[i].x, bannerList[i].y, banner, pdest); ScoreIO::ScoreData temp = ScoreIO::SaveScore::GetScores(GameScore::GetModeEquivalent(modeSelection), i+1); DrawMsg(bannerList[i].scoreX(), bannerList[i].scoreY(), temp.value); DrawMsg(bannerList[i].rankX(), bannerList[i].rankY(), temp.rank); DrawMsg(bannerList[i].nameX(), bannerList[i].nameY(), temp.name); DrawMsg(bannerList[i].stageX(), bannerList[i].stageY(), temp.stage); } }
void SetMessages(void){ char M; DrawTxtMenu(M_Msg); DrawMsg("...Esc"); DrawMessages(); while (MB) SDL_PollEvent(&event); do{ SDL_PollEvent(&event); if (M=OperTxtMenu(M_Msg)){ InputScr("Enter message:"); GetString(Lvl[Level].Text[M-1],50,1,195); DrawGame(); DrawMessages(); } } while (!Quit); DrawGame(); DrawTxtMenu(M_Txt); DrawMsg(""); }
void OperMenu(T_E_Sel *Mnu){ int Y; if ((MX>=Mnu->X)&&(MX<Mnu->X+20)){ Y=MY/20; if ((!MBlock)&&(MB)&&(Y==0)&&(Mnu->Top)) {Mnu->Top--;DrawMenu(*Mnu);MBlock=1;} if ((!MBlock)&&(MB)&&(Y==19)&&(Mnu->Top<Mnu->L-1)) {Mnu->Top++;DrawMenu(*Mnu);MBlock=1;} if ((Y>0)&&(Y<19)&&(Mnu->Top+Y-1<Mnu->L)){ if ((!MBlock)&&(MB)){Mnu->Akt=Mnu->Top+Y-1;DrawMenu(*Mnu);MBlock=1;} else DrawMsg(Mnu->E[Mnu->Top+Y-1].Desc); } } }
//--------------------------------------------------------------------------- void __fastcall TClockAdjDlg::PCTResize(TObject *Sender) { BOOL f = m_pBitmapT->Width != PBoxT->Width; m_pBitmapT->Width = PBoxT->Width; m_pBitmapT->Height = PBoxT->Height; if( f ){ TCanvas *pCanvas = m_pBitmapT->Canvas; pCanvas->Brush->Color = clBlack; TRect rc; rc.Left = 0; rc.Top = 0; rc.Right = m_pBitmapT->Width; rc.Bottom = m_pBitmapT->Height; pCanvas->FillRect(rc); m_Clock.Create(PBoxT->Width); DrawMsg(); m_PointRX = 0; } }
void CPropPageFrame::Draw(CDC *pDc) { if (GetShowCaption()) DrawCaption(pDc, CalcCaptionArea(), m_strCaption, m_hCaptionIcon); DrawMsg(pDc, CalcMsgArea(), m_strMsg, m_dwMsgFormat); }
// -------------------- void Edit(void){ char M,Str[256]; int I,LX,LY; SetLevel(0); DrawGame(); DrawMenu(M_Fg); DrawMenu(M_Bg); DrawTxtMenu(M_Txt); DrawMsg(""); while (1){ LX=MX; LY=MY; UC=0; if (!MB) SDL_Delay(200); else SDL_Delay(50); SDL_PollEvent(&event); OperMenu(&M_Fg); OperMenu(&M_Bg); if ((UC>='0')&&(UC<='9')){ Lvl[Level].M[MX/20][MY/20].txt=UC-'0'; DrawGame(); } if (Shift){ Lvl[Level].M[MX/20][MY/20].txt=-1; DrawGame(); } if ((MB==1)&&(MX<400)&&(MY<400)){ if ((LX/20!=MX/20)||(LY/2!=MY/20)) MBlock=0; if (!MBlock){ Lvl[Level].M[MX/20][MY/20].FSpr=M_Fg.E[M_Fg.Akt].Spr; Lvl[Level].M[MX/20][MY/20].FTyp=M_Fg.E[M_Fg.Akt].Typ; Lvl[Level].M[MX/20][MY/20].BSpr=M_Bg.E[M_Bg.Akt].Spr; Lvl[Level].M[MX/20][MY/20].BTyp=M_Bg.E[M_Bg.Akt].Typ; MBlock=1; DrawGame(); } } if ((MB==2)&&(MX<400)&&(MY<400)){ for (I=0;I<M_Fg.L;I++) if ((Lvl[Level].M[MX/20][MY/20].FSpr==M_Fg.E[I].Spr)&&(Lvl[Level].M[MX/20][MY/20].FTyp==M_Fg.E[I].Typ)){ M_Fg.Top=M_Fg.Akt=I; DrawMenu(M_Fg); } for (I=0;I<M_Bg.L;I++) if ((Lvl[Level].M[MX/20][MY/20].BSpr==M_Bg.E[I].Spr)&&(Lvl[Level].M[MX/20][MY/20].BTyp==M_Bg.E[I].Typ)){ M_Bg.Top=M_Bg.Akt=I; DrawMenu(M_Bg); } MBlock=1; DrawGame(); } if (M=OperTxtMenu(M_Txt)){ if (M==1){ //name InputScr("Enter level name:"); GetString(Lvl[Level].Name,50,1,195); SetCaption(); DrawGame(); } else if (M==2){ //password InputScr("Enter level password:"******"Enter time limit (0-999 secs):"); sprintf(Str,"%d",Lvl[Level].DL); GetString(Str,3,1,195); Lvl[Level].DL=atoi(Str); DrawGame(); } else if (M==4) //bgimg SelectBgImg(); else if (M==5) //txt SetMessages(); else if (M==6){ //go to InputScr("Enter level no. (0-99):"); sprintf(Str,"%d",Level); GetString(Str,2,1,195); Level=atoi(Str); SetLevel(Level); DrawGame(); } else if (M==7){ //save InputScr("Enter filename:"); if (GetString(LFile,255,1,195)){ if (Save(LFile)) DrawMsg("Saved..."); else DrawMsg("Can't save!"); }else DrawMsg("Aborted..."); DrawGame(); } } if (Up&&(Level<99)){ SetLevel(Level+1); DrawGame(); SDL_Delay(200); } if ((Down)&&(Level>0)){ SetLevel(Level-1); DrawGame(); SDL_Delay(200); } if (Quit==2) return; } }