Example #1
0
static void LeaveDirectory( void ) {
    char *s;
    int i;

    s = strrchr( m_demos.browse, '/' );
    if( !s ) {
        return;
    }
    *s = 0;

    // rebuild list
    FreeList();
    BuildList();
    MenuList_Init( &m_demos.list );

    // move cursor to the previous directory
    for( i = 0; i < m_demos.numDirs; i++ ) {
        demoEntry_t *e = m_demos.list.items[i];
        if( !strcmp( e->name, s + 1 ) ) {
            MenuList_SetValue( &m_demos.list, i );
            break;
        }
    }

    if( s == m_demos.browse ) {
        m_demos.browse[0] = '/';
        m_demos.browse[1] = 0;
    }
}
Example #2
0
static menuSound_t LeaveDirectory(void)
{
    char    *s;
    int     i;

    s = strrchr(m_demos.browse, '/');
    if (!s) {
        return QMS_BEEP;
    }

    if (s == m_demos.browse) {
        strcpy(m_demos.browse, "/");
    } else {
        *s = 0;
    }

    // rebuild list
    FreeList();
    BuildList();
    MenuList_Init(&m_demos.list);

    // move cursor to the previous directory
    for (i = 0; i < m_demos.numDirs; i++) {
        demoEntry_t *e = m_demos.list.items[i];
        if (!strcmp(e->name, s + 1)) {
            MenuList_SetValue(&m_demos.list, i);
            break;
        }
    }

    return QMS_OUT;
}
Example #3
0
static void Expose( menuFrameWork_t *self ) {
    time_t now = time( NULL );
    struct tm *tm = localtime( &now );

    if( tm ) {
        m_demos.year = tm->tm_year;
    }

    BuildList();
    // move cursor to previous position
    MenuList_SetValue( &m_demos.list, m_demos.selection );
}
Example #4
0
static void Expose(menuFrameWork_t *self)
{
    time_t now = time(NULL);
    struct tm *tm = localtime(&now);

    if (tm) {
        m_demos.year = tm->tm_year;
    }

    // check that target directory exists
    if (strcmp(m_demos.browse, "/")
        && ui_listalldemos->integer == 0
        && os_access(va("%s%s", fs_gamedir, m_demos.browse), F_OK)) {
        strcpy(m_demos.browse, "/");
    }

    BuildList();

    // move cursor to previous position
    MenuList_SetValue(&m_demos.list, m_demos.selection);
}