Example #1
0
int main(){
	int new_level[500], new_id[500];
	List ** lists = malloc(sizeof(List *) * CAT);
	for (int x=0;x<CAT;x++)
		lists[x] = createList();
	char ** itemFile = readItemsFile();
	parseFile(lists);
	read_new_attr(lists, new_id, new_level);
	update_items(itemFile, new_id, new_level);
	write_file(itemFile);
	return 0;
}
Example #2
0
static void main_window_load(Window *window) {
  Layer *window_layer = window_get_root_layer(window);
  GRect bounds = layer_get_frame(window_layer);

  update_items();
  
  s_menu_layer = menu_layer_create(bounds);
  menu_layer_set_callbacks(s_menu_layer, NULL, (MenuLayerCallbacks){
    .get_num_sections = menu_get_num_sections_callback,
    .get_num_rows = menu_get_num_rows_callback,
    .get_header_height = menu_get_header_height_callback,
    .draw_header = menu_draw_header_callback,
    .draw_row = menu_draw_row_callback,
    .select_click = menu_select_callback,
  });
Example #3
0
static void	 do_events(s_game	*game,
			   s_perso	**persos,
			   s_sound	*sounds)
{
  SDL_Event	 event;
  int		 t1 = 0;

  while (1)
    {
      handle_time(game, &t1, 1, persos);

      update_grid(game, persos);

      update_board(game, persos, sounds);
      update_info(game, persos);
      update_items(game, persos);
      SDL_PollEvent(&event);
      input_actions(game, event, persos, sounds);
      SDL_BlitSurface(game->help_s, NULL, game->screen, &game->help_r);
      SDL_Flip(game->screen);
      game->trigger = 0;
    }
}
Example #4
0
static void menu_select_callback(MenuLayer *menu_layer, MenuIndex *cell_index, void *data) {
  config_show(s_screen, cell_index->row);
  window_stack_remove(s_main_window, true);
  update_items();
}