Пример #1
0
char *cibyl_select_game(char *base_dir)
{
        NOPH_Display_t display = NOPH_Display_getDisplay(NOPH_MIDlet_get());
        NOPH_Displayable_t cur = NOPH_Display_getCurrent(display);
        NOPH_CommandMgr_t cm = NOPH_CommandMgr_getInstance();
        char **p;

        all_games = read_directory(get_current_directory());
        if (!all_games)
                return NULL;

        game_list = NOPH_List_new("Select game", NOPH_Choice_IMPLICIT);

        for (p = all_games; *p; p++)
        {
                NOPH_List_append(game_list, *p, 0);
        }
        NOPH_Display_setCurrent(display, game_list);

        printf("Setting list\n");

        NOPH_CommandMgr_setList(cm, game_list, select_game_callback, NULL);

        while(selected_game == NULL)
        {
                NOPH_Thread_sleep(250);
        }
        free(all_games);

        NOPH_Display_setCurrent(display, cur);
        NOPH_delete(game_list);
        game_list = 0;

        return get_game_directory(selected_game);
}
Пример #2
0
/**
 * \brief Get the path of a file in the user's game directory.
 * \param name The name of the file.
 */
std::string bear::engine::default_game_filesystem::get_custom_game_file
( std::string name ) const
{
  std::string result = get_game_directory();

  if ( !result.empty() )
    {
      boost::filesystem::path path( result );
      path /= name;
      result = path.string();
    }
  else
    result = name;

  return result;
} // default_game_filesystem::get_custom_game_file()