Пример #1
0
ScrollWidgetGump::ScrollWidgetGump(Configuration *cfg, Screen *s)
{
 drop_target = false; //we don't participate in drag and drop.

 font_normal = Game::get_game()->get_font_manager()->get_conv_font();

 font_garg = Game::get_game()->get_font_manager()->get_conv_garg_font();

 init(cfg, font_normal);

 font_color = 0; // black
 font_highlight = FONT_COLOR_U6_HIGHLIGHT;

 scroll_width = 40;
 scroll_height = 10;

 show_up_arrow = false;
 show_down_arrow = false;

 GUI_Widget::Init(NULL, 0, 0, SCROLLWIDGETGUMP_W, SCROLLWIDGETGUMP_H);

 add_new_line(); //MsgScroll requires a line to start.

 position = 0;
// ignore_page_breaks = true;
}
Пример #2
0
MsgScroll::MsgScroll(Configuration *cfg, Font *f) : GUI_Widget(NULL, 0, 0, 0, 0)
{
 uint16 x, y;

 init(cfg, f);

 switch(game_type)
   {
    case NUVIE_GAME_MD : scroll_width = MSGSCROLL_MD_WIDTH;
                         scroll_height = MSGSCROLL_MD_HEIGHT;
                         x = 184;
                         y = 128;
                         break;

    case NUVIE_GAME_SE : scroll_width = MSGSCROLL_SE_WIDTH;
                         scroll_height = MSGSCROLL_SE_HEIGHT;
                         x = 184;
                         y = 128;
                         break;
    case NUVIE_GAME_U6 :
	default :
						 scroll_width = MSGSCROLL_U6_WIDTH;
                         scroll_height = MSGSCROLL_U6_HEIGHT;
                         x = 176;
                         y = 112;
                         break;
   }

 if(Game::get_game()->is_original_plus())
   x += Game::get_game()->get_game_width() - 320;

 uint16 x_off = Game::get_game()->get_game_x_offset();
 uint16 y_off = Game::get_game()->get_game_y_offset();

 GUI_Widget::Init(NULL, x+x_off, y+y_off, scroll_width * 8, scroll_height * 8);

 cursor_char = 0;
 cursor_x = 0;
 cursor_y = scroll_height-1;
 line_count = 0;

 cursor_wait = 0;

 display_pos = 0;
 
 bg_color = Game::get_game()->get_palette()->get_bg_color();

 capitalise_next_letter = false;

 left_margin = 0;

 add_new_line();
}
Пример #3
0
void create_cel_file()
{


FILE *fpoG2 , *fp ;
char *token , fixed_string[32] , filename[256] ;
char cell_name[32] ;
INT ignore_line , block , offset , test , carrayG_index , is_a_cell ;


if( rowsG > 0 ) {
    sprintf( filename , "%s.scel" , cktNameG ) ;
    fp = TWOPEN( filename, "r" , ABORT ) ;
} else {
    sprintf( filename , "%s.cel" , cktNameG ) ;
    fp = TWOPEN( filename, "r" , ABORT ) ;
}
sprintf( filename , "%s.ncel" , cktNameG ) ;
fpoG2 = TWOPEN( filename, "w" , ABORT ) ;

strcpy( fixed_string , "" ) ;
carrayG_index = 0 ;
while(  load_a_lineS(fp)  ) {
    ignore_line = 0 ;
    if( (token = strtok( a_lineS , " 	" )) != NULL ) {
	if( strcmp( token , "cell" ) == 0 ) {
	    is_a_cell = 1 ;
	    fprintf(fpoG2, "%s ", token ) ;
	    token = strtok( NULL , " 	" ) ;
	    fprintf(fpoG2, "%s ", token ) ;
	    strcpy( cell_name , strtok( NULL , " 	" ) ) ;
	    fprintf(fpoG2, "%s ", cell_name ) ;
	    do {
		test = strcmp( carrayG[ ++carrayG_index ]->cname,
					cell_name ) ;
	    } while( test != 0 ) ;
	 } else if( strcmp( token , "left" ) == 0 ) {
	    if( is_a_cell ) {
		block  = carrayG[carrayG_index]->cblock ;
		offset = carrayG[carrayG_index]->cxcenter +
			 carrayG[carrayG_index]->tileptr->left -
			(barrayG[block]->bxcenter +
			 barrayG[block]->bleft) ;

		if( strcmp( fixed_string , "" ) != 0 ) {
		    add_new_line( offset , block , fixed_string , fpoG2 ) ;
		    strcpy( fixed_string , "" ) ;
		} else {
		    add_new_line( offset , block , "nonfixed" , fpoG2 ) ;
		}
	    }
	    fprintf(fpoG2, "%s ", token ) ;
	    is_a_cell = 0 ;
	} else if( strcmp( token , "initially" ) == 0 ) {
	    ignore_line = 1 ;
	    strcpy( fixed_string , strtok( NULL , " 	" ) ) ;
	} else if( strcmp( token , "\n" ) != 0 ) {
	    fprintf(fpoG2, "%s ", token ) ;
	}
	while( (token = strtok( NULL , " 	" )) != NULL ) {
	    if( !ignore_line ) {
		fprintf(fpoG2, "%s ", token ) ;
	    }
	}
    }
    if( !ignore_line ) {
	fprintf(fpoG2, "\n");
    }
}
TWCLOSE(fp) ;
TWCLOSE(fpoG2) ;
}