void ShowArticle (char *article) #endif { #ifdef JAPAN int snames[10] = { H_HELP1PIC, H_HELP2PIC, H_HELP3PIC, H_HELP4PIC, H_HELP5PIC, H_HELP6PIC, H_HELP7PIC, H_HELP8PIC, H_HELP9PIC, H_HELP10PIC}; int enames[14] = { 0,0, #ifndef JAPDEMO C_ENDGAME1APIC, C_ENDGAME1BPIC, C_ENDGAME2APIC, C_ENDGAME2BPIC, C_ENDGAME3APIC, C_ENDGAME3BPIC, C_ENDGAME4APIC, C_ENDGAME4BPIC, C_ENDGAME5APIC, C_ENDGAME5BPIC, C_ENDGAME6APIC, C_ENDGAME6BPIC #endif }; #endif unsigned oldfontnumber; unsigned temp; boolean newpage,firstpage; #ifdef JAPAN pagenum = 1; if (!which) numpages = 10; else numpages = 2; #else text = article; oldfontnumber = fontnumber; fontnumber = 0; CA_MarkGrChunk(STARTFONT); VWB_Bar (0,0,320,200,BACKCOLOR); CacheLayoutGraphics (); #endif newpage = True; firstpage = True; do { if (newpage) { newpage = False; #ifdef JAPAN if (!which) CA_CacheScreen(snames[pagenum - 1]); else CA_CacheScreen(enames[which*2 + pagenum - 1]); #else PageLayout (True); #endif VW_UpdateScreen (); if (firstpage) { VL_FadeIn(0,255,&gamepal,10); // VW_FadeIn () firstpage = False; } } LastScan = 0; while (!LastScan) ; switch (LastScan) { case sc_UpArrow: case sc_PgUp: case sc_LeftArrow: if (pagenum>1) { #ifndef JAPAN BackPage (); BackPage (); #else pagenum--; #endif newpage = True; } break; case sc_Enter: case sc_DownArrow: case sc_PgDn: case sc_RightArrow: // the text allready points at next page if (pagenum<numpages) { newpage = True; #ifdef JAPAN pagenum++; #endif } break; } #ifndef SPEAR if (Keyboard[sc_Tab] && Keyboard[sc_P] && MS_CheckParm("goobers")) PicturePause(); #endif } while (LastScan != sc_Escape); IN_ClearKeysDown (); fontnumber = oldfontnumber; }
// Helphack switches index 11 and 5 so that the keyboard/blaze pics are reversed. void ShowArticle (const char *article, bool helphack=false) { bool newpage, firstpage; ControlInfo ci; text = article; CountPages(); if(numpages == 0) { // No pages? Show S3DNA style briefing. ShowBriefing(article); return; } VWB_Clear(GPalette.BlackIndex, 0, 0, screenWidth, screenHeight); newpage = true; firstpage = true; fontcolor = 255; textcolor = CR_UNTRANSLATED; do { if (newpage) { newpage = false; PageLayout (true, helphack); VW_UpdateScreen (); if (firstpage) { VL_FadeIn(0,255,10); firstpage = false; } } SDL_Delay(5); LastScan = 0; ReadAnyControl(&ci); Direction dir = ci.dir; switch(dir) { case dir_North: case dir_South: break; default: if(ci.button0) dir = dir_South; switch(LastScan) { case sc_UpArrow: case sc_PgUp: case sc_LeftArrow: dir = dir_North; break; case sc_Enter: case sc_DownArrow: case sc_PgDn: case sc_RightArrow: dir = dir_South; break; } break; } switch(dir) { default: break; case dir_North: case dir_West: if (pagenum>1) { BackPage (); BackPage (); newpage = true; } TicDelay(20); break; case dir_South: case dir_East: if (pagenum<numpages) { newpage = true; } TicDelay(20); break; } } while (LastScan != sc_Escape && !ci.button1); IN_ClearKeysDown (); }
void ShowArticle(signed char *article) { unsigned oldfontnumber; boolean newpage, firstpage; text = article; oldfontnumber = fontnumber; fontnumber = 0; CA_CacheGrChunk(STARTFONT); VW_Bar (0,0,320,200,BACKCOLOR); CacheLayoutGraphics(); newpage = true; firstpage = true; do { if (newpage) { newpage = false; PageLayout(true); VW_UpdateScreen(); if (firstpage) { VL_FadeIn(0,255,gamepal,10); firstpage = false; } } LastScan = 0; while (!LastScan) IN_CheckAck(); /* update events */ switch (LastScan) { case sc_UpArrow: case sc_PgUp: case sc_LeftArrow: if (pagenum>1) { BackPage (); BackPage (); newpage = true; } break; case sc_Enter: case sc_DownArrow: case sc_PgDn: case sc_RightArrow: // the text already points at next page if (pagenum<numpages) { newpage = true; } break; } if (IN_KeyDown(sc_Tab) && IN_KeyDown(sc_P) && MS_CheckParm("debugmode")) PicturePause(); } while (LastScan != sc_Escape); IN_ClearKeysDown (); fontnumber = oldfontnumber; }
void ShowArticle (char *article) { // unsigned oldfontnumber; // unsigned temp; boolean newpage,firstpage; GFX_STRT = (W_GetNumForName ("TEXTSTRT"))+1; text = article; // CA_MarkGrChunk(STARTFONT); VWB_Bar (0, 0, 320, 200, BACKCOLOR); CacheLayoutGraphics (); newpage = true; firstpage = true; do { if (newpage) { newpage = false; // CA_CacheScreen(enames[which*2 + pagenum - 1]); PageLayout (true); VW_UpdateScreen (); if (firstpage) { MenuFadeIn (); firstpage = false; } } LastScan = 0; while (!LastScan) ; switch (LastScan) { case sc_UpArrow: case sc_PgUp: case sc_LeftArrow: if (pagenum>1) { BackPage (); BackPage (); newpage = true; } break; case sc_Enter: case sc_DownArrow: case sc_PgDn: case sc_RightArrow: // the text allready points at next page if (pagenum<numpages) { newpage = true; } break; } } while (LastScan != sc_Escape); IN_ClearKeysDown (); // fontnumber = oldfontnumber; }