Subversion Repositories eduke32

Rev

Rev 4976 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4976 Rev 4977
Line 1235... Line 1235...
1235
    MEL_EPISODE[g_numVolumes] = &ME_Space4;
1235
    MEL_EPISODE[g_numVolumes] = &ME_Space4;
1236
    MEL_EPISODE[g_numVolumes+1] = &ME_EPISODE_USERMAP;
1236
    MEL_EPISODE[g_numVolumes+1] = &ME_EPISODE_USERMAP;
1237
    MEOS_NETOPTIONS_EPISODE.numOptions = g_numVolumes + 1; // k+1;
1237
    MEOS_NETOPTIONS_EPISODE.numOptions = g_numVolumes + 1; // k+1;
1238
    MEOSN_NetEpisodes[g_numVolumes] = MenuUserMap;
1238
    MEOSN_NetEpisodes[g_numVolumes] = MenuUserMap;
1239
    MMF_Top_Episode.pos.y = (48-(g_numVolumes*2))<<16;
1239
    MMF_Top_Episode.pos.y = (48-(g_numVolumes*2))<<16;
-
 
1240
    if (g_numSkills == 0)
-
 
1241
        MEO_EPISODE.linkID = MENU_NULL;
1240
1242
1241
    // prepare skills
1243
    // prepare skills
1242
    k = -1;
1244
    k = -1;
1243
    for (i = 0; i < g_numSkills && SkillNames[i][0]; ++i)
1245
    for (i = 0; i < g_numSkills && SkillNames[i][0]; ++i)
1244
    {
1246
    {
Line 2216... Line 2218...
2216
    default:
2218
    default:
2217
        break;
2219
        break;
2218
    }
2220
    }
2219
}
2221
}
2220
2222
-
 
2223
static void M_StartGameWithoutSkill(void)
-
 
2224
{
-
 
2225
    ud.m_player_skill = M_SKILL.currentEntry+1;
-
 
2226
-
 
2227
    g_skillSoundVoice = S_PlaySound(PISTOL_BODYHIT);
-
 
2228
-
 
2229
    ud.m_respawn_monsters = 0;
-
 
2230
-
 
2231
    ud.m_monsters_off = ud.monsters_off = 0;
-
 
2232
-
 
2233
    ud.m_respawn_items = 0;
-
 
2234
    ud.m_respawn_inventory = 0;
-
 
2235
-
 
2236
    ud.multimode = 1;
-
 
2237
-
 
2238
    G_NewGame_EnterLevel();
-
 
2239
}
-
 
2240
2221
/*
2241
/*
2222
Functions where a "newValue" or similar is passed are run *before* the linked variable is actually changed.
2242
Functions where a "newValue" or similar is passed are run *before* the linked variable is actually changed.
2223
That way you can compare the new and old values and potentially block the change.
2243
That way you can compare the new and old values and potentially block the change.
2224
*/
2244
*/
2225
static void M_MenuEntryLinkActivate(MenuEntry_t *entry)
2245
static void M_MenuEntryLinkActivate(MenuEntry_t *entry)
Line 2229... Line 2249...
2229
    case MENU_EPISODE:
2249
    case MENU_EPISODE:
2230
        if (entry != &ME_EPISODE_USERMAP)
2250
        if (entry != &ME_EPISODE_USERMAP)
2231
        {
2251
        {
2232
            ud.m_volume_number = M_EPISODE.currentEntry;
2252
            ud.m_volume_number = M_EPISODE.currentEntry;
2233
            ud.m_level_number = 0;
2253
            ud.m_level_number = 0;
-
 
2254
-
 
2255
            if (g_numSkills == 0)
-
 
2256
                M_StartGameWithoutSkill();
2234
        }
2257
        }
2235
        break;
2258
        break;
2236
2259
2237
    case MENU_SKILL:
2260
    case MENU_SKILL:
2238
    {
2261
    {
2239
        int32_t skillsound = 0;
2262
        int32_t skillsound = PISTOL_BODYHIT;
2240
2263
2241
        switch (M_SKILL.currentEntry)
2264
        switch (M_SKILL.currentEntry)
2242
        {
2265
        {
2243
        case 0:
2266
        case 0:
2244
            skillsound = JIBBED_ACTOR6;
2267
            skillsound = JIBBED_ACTOR6;
Line 2252... Line 2275...
2252
        case 3:
2275
        case 3:
2253
            skillsound = JIBBED_ACTOR5;
2276
            skillsound = JIBBED_ACTOR5;
2254
            break;
2277
            break;
2255
        }
2278
        }
2256
2279
-
 
2280
        ud.m_player_skill = M_SKILL.currentEntry+1;
-
 
2281
2257
        g_skillSoundVoice = S_PlaySound(skillsound);
2282
        g_skillSoundVoice = S_PlaySound(skillsound);
2258
2283
2259
        ud.m_player_skill = M_SKILL.currentEntry+1;
-
 
2260
        if (M_SKILL.currentEntry == 3) ud.m_respawn_monsters = 1;
2284
        if (M_SKILL.currentEntry == 3) ud.m_respawn_monsters = 1;
2261
        else ud.m_respawn_monsters = 0;
2285
        else ud.m_respawn_monsters = 0;
2262
2286
2263
        ud.m_monsters_off = ud.monsters_off = 0;
2287
        ud.m_monsters_off = ud.monsters_off = 0;
2264
2288
Line 2879... Line 2903...
2879
    case MENU_USERMAP:
2903
    case MENU_USERMAP:
2880
        if (input)
2904
        if (input)
2881
        {
2905
        {
2882
            ud.m_volume_number = 0;
2906
            ud.m_volume_number = 0;
2883
            ud.m_level_number = 7;
2907
            ud.m_level_number = 7;
-
 
2908
-
 
2909
            if (g_numSkills > 0)
2884
            M_ChangeMenuAnimate(MENU_SKILL, MA_Advance);
2910
                M_ChangeMenuAnimate(MENU_SKILL, MA_Advance);
-
 
2911
            else
-
 
2912
                M_StartGameWithoutSkill();
2885
        }
2913
        }
2886
        break;
2914
        break;
2887
2915
2888
    default:
2916
    default:
2889
        break;
2917
        break;
Line 3075... Line 3103...
3075
    }
3103
    }
3076
    else if (m_currentMenu->type == FileSelect)
3104
    else if (m_currentMenu->type == FileSelect)
3077
        M_MenuFileSelectInit((MenuFileSelect_t*)m_currentMenu->object);
3105
        M_MenuFileSelectInit((MenuFileSelect_t*)m_currentMenu->object);
3078
    else if (m_currentMenu->type == Menu)
3106
    else if (m_currentMenu->type == Menu)
3079
    {
3107
    {
3080
        // MenuMenu_t *menu = (MenuMenu_t*)m_currentMenu->object;
3108
        MenuMenu_t *menu = (MenuMenu_t*)m_currentMenu->object;
3081
        // MenuEntry_t* currentry = menu->entrylist[menu->currentEntry];
3109
        // MenuEntry_t* currentry = menu->entrylist[menu->currentEntry];
3082
3110
-
 
3111
        // need this for MENU_SKILL
-
 
3112
        if (menu->currentEntry >= menu->numEntries)
-
 
3113
            menu->currentEntry = 0;
-
 
3114
-
 
3115
        i = menu->currentEntry;
-
 
3116
        while (!menu->entrylist[menu->currentEntry] || ((MenuEntry_t*)menu->entrylist[menu->currentEntry])->type == Spacer)
-
 
3117
        {
-
 
3118
            menu->currentEntry++;
-
 
3119
            if (menu->currentEntry >= menu->numEntries)
-
 
3120
                menu->currentEntry = 0;
-
 
3121
            if (menu->currentEntry == i)
-
 
3122
                G_GameExit("M_ChangeMenu: Attempted to change to a menu with no entries.");
-
 
3123
        }
-
 
3124
3083
        M_MenuEntryFocus(/*currentry*/);
3125
        M_MenuEntryFocus(/*currentry*/);
3084
    }
3126
    }
3085
}
3127
}
3086
3128
3087
3129