mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-31 12:13:16 +00:00
Cleanup & bug-fixin
This commit is contained in:
parent
cf8a77cfd6
commit
64a3d133b4
14 changed files with 383 additions and 366 deletions
|
|
@ -1352,8 +1352,7 @@ finish:
|
|||
// landing point for possiblevalue failures
|
||||
badinput:
|
||||
|
||||
if (var != &cv_nextmap) // Suppress errors for cv_nextmap
|
||||
CONS_Printf(M_GetText("\"%s\" is not a possible value for \"%s\"\n"), valstr, var->name);
|
||||
CONS_Printf(M_GetText("\"%s\" is not a possible value for \"%s\"\n"), valstr, var->name);
|
||||
|
||||
// default value not valid... ?!
|
||||
if (var->defaultvalue == valstr)
|
||||
|
|
@ -1628,44 +1627,6 @@ void CV_AddValue(consvar_t *var, INT32 increment)
|
|||
|
||||
if (var->PossibleValue)
|
||||
{
|
||||
#if 0
|
||||
if (var == &cv_nextmap)
|
||||
{
|
||||
// Special case for the nextmap variable, used only directly from the menu
|
||||
INT32 oldvalue = var->value - 1, gt;
|
||||
gt = cv_newgametype.value;
|
||||
if (increment != 0) // Going up!
|
||||
{
|
||||
newvalue = var->value - 1;
|
||||
do
|
||||
{
|
||||
if(increment > 0) // Going up!
|
||||
{
|
||||
if (++newvalue == NUMMAPS)
|
||||
newvalue = -1;
|
||||
}
|
||||
else // Going down!
|
||||
{
|
||||
if (--newvalue == -2)
|
||||
newvalue = NUMMAPS-1;
|
||||
}
|
||||
|
||||
if (newvalue == oldvalue)
|
||||
break; // don't loop forever if there's none of a certain gametype
|
||||
|
||||
if(!mapheaderinfo[newvalue])
|
||||
continue; // Don't allocate the header. That just makes memory usage skyrocket.
|
||||
|
||||
} while (!M_CanShowLevelInList(newvalue, gt));
|
||||
|
||||
var->value = newvalue + 1;
|
||||
var->func();
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
||||
#define MINVAL 0
|
||||
#define MAXVAL 1
|
||||
if (var->PossibleValue[MINVAL].strvalue && !strcmp(var->PossibleValue[MINVAL].strvalue, "MIN"))
|
||||
|
|
|
|||
|
|
@ -493,10 +493,7 @@ static void D_Display(void)
|
|||
if (lastdraw)
|
||||
{
|
||||
if (rendermode == render_soft)
|
||||
{
|
||||
VID_BlitLinearScreen(screens[0], screens[1], vid.width*vid.bpp, vid.height, vid.width*vid.bpp, vid.rowbytes);
|
||||
usebuffer = true;
|
||||
}
|
||||
lastdraw = false;
|
||||
}
|
||||
|
||||
|
|
@ -1335,7 +1332,7 @@ void D_SRB2Main(void)
|
|||
if (M_CheckParm("-noupload"))
|
||||
COM_BufAddText("downloading 0\n");
|
||||
|
||||
CONS_Printf("M_Init(): Init miscellaneous info.\n");
|
||||
CONS_Printf("M_Init(): Init menus.\n");
|
||||
M_Init();
|
||||
|
||||
CONS_Printf("R_Init(): Init SRB2 refresh daemon.\n");
|
||||
|
|
|
|||
|
|
@ -518,23 +518,17 @@ const char *netxcmdnames[MAXNETXCMD - 1] =
|
|||
void D_RegisterServerCommands(void)
|
||||
{
|
||||
INT32 i;
|
||||
|
||||
Forceskin_cons_t[0].value = -1;
|
||||
Forceskin_cons_t[0].strvalue = "Off";
|
||||
|
||||
for (i = 0; i < NUMGAMETYPES; i++)
|
||||
{
|
||||
gametype_cons_t[i].value = i;
|
||||
gametype_cons_t[i].strvalue = Gametype_Names[i];
|
||||
}
|
||||
gametype_cons_t[NUMGAMETYPES].value = 0;
|
||||
gametype_cons_t[NUMGAMETYPES].strvalue = NULL;
|
||||
|
||||
// Set the values to 0/NULL, it will be overwritten later when a skin is assigned to the slot.
|
||||
for (i = 1; i < MAXSKINS; i++)
|
||||
{
|
||||
Forceskin_cons_t[i].value = 0;
|
||||
Forceskin_cons_t[i].strvalue = NULL;
|
||||
}
|
||||
|
||||
RegisterNetXCmd(XD_NAMEANDCOLOR, Got_NameAndColor);
|
||||
RegisterNetXCmd(XD_WEAPONPREF, Got_WeaponPref);
|
||||
RegisterNetXCmd(XD_MAP, Got_Mapcmd);
|
||||
|
|
@ -4786,6 +4780,7 @@ void D_GameTypeChanged(INT32 lastgametype)
|
|||
if (oldgt && newgt)
|
||||
CONS_Printf(M_GetText("Gametype was changed from %s to %s\n"), oldgt, newgt);
|
||||
}
|
||||
|
||||
// Only do the following as the server, not as remote admin.
|
||||
// There will always be a server, and this only needs to be done once.
|
||||
if (server && (multiplayer || netgame))
|
||||
|
|
@ -4859,9 +4854,10 @@ void D_GameTypeChanged(INT32 lastgametype)
|
|||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
// When swapping to a gametype that supports spectators,
|
||||
// make everyone a spectator initially.
|
||||
/*if (G_GametypeHasSpectators())
|
||||
if (G_GametypeHasSpectators())
|
||||
{
|
||||
INT32 i;
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
|
|
@ -4870,7 +4866,8 @@ void D_GameTypeChanged(INT32 lastgametype)
|
|||
players[i].ctfteam = 0;
|
||||
players[i].spectator = true;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
#endif
|
||||
|
||||
// don't retain teams in other modes or between changes from ctf to team match.
|
||||
// also, stop any and all forms of team scrambling that might otherwise take place.
|
||||
|
|
|
|||
|
|
@ -1459,9 +1459,12 @@ static void readcupheader(MYFILE *f, cupheader_t *cup)
|
|||
break;
|
||||
|
||||
if (cup->numlevels >= MAXLEVELLIST)
|
||||
{
|
||||
deh_warning("%s Cup: reached max levellist (%d)\n", cup->name, MAXLEVELLIST);
|
||||
break;
|
||||
}
|
||||
|
||||
cup->levellist[cup->numlevels] = map;
|
||||
cup->levellist[cup->numlevels] = map - 1;
|
||||
cup->numlevels++;
|
||||
} while((tmp = strtok(NULL,",")) != NULL);
|
||||
}
|
||||
|
|
@ -1470,14 +1473,14 @@ static void readcupheader(MYFILE *f, cupheader_t *cup)
|
|||
// Convert to map number
|
||||
if (word2[0] >= 'A' && word2[0] <= 'Z' && word2[2] == '\0')
|
||||
i = M_MapNumber(word2[0], word2[1]);
|
||||
cup->bonusgame = (INT16)i;
|
||||
cup->bonusgame = (INT16)i - 1;
|
||||
}
|
||||
else if (fastcmp(word, "SPECIALSTAGE"))
|
||||
{
|
||||
// Convert to map number
|
||||
if (word2[0] >= 'A' && word2[0] <= 'Z' && word2[2] == '\0')
|
||||
i = M_MapNumber(word2[0], word2[1]);
|
||||
cup->specialstage = (INT16)i;
|
||||
cup->specialstage = (INT16)i - 1;
|
||||
}
|
||||
else if (fastcmp(word, "EMERALDNUM"))
|
||||
{
|
||||
|
|
@ -1486,6 +1489,13 @@ static void readcupheader(MYFILE *f, cupheader_t *cup)
|
|||
else
|
||||
deh_warning("%s Cup: invalid emerald number %d", cup->name, i);
|
||||
}
|
||||
else if (fastcmp(word, "UNLOCKABLE"))
|
||||
{
|
||||
if (i >= 0 && i <= MAXUNLOCKABLES) // 0 for no unlock required, anything else requires something
|
||||
cup->unlockrequired = (SINT8)i - 1;
|
||||
else
|
||||
deh_warning("%s Cup: invalid unlockable number %d", cup->name, i);
|
||||
}
|
||||
else
|
||||
deh_warning("%s Cup: unknown word '%s'", cup->name, word);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -291,6 +291,8 @@ typedef struct
|
|||
|
||||
extern mapheader_t* mapheaderinfo[NUMMAPS];
|
||||
|
||||
// This could support more, but is that a good idea?
|
||||
// Keep in mind that it may encourage people making overly long cups just because they "can", and would be a waste of memory.
|
||||
#define MAXLEVELLIST 5
|
||||
|
||||
typedef struct cupheader_s
|
||||
|
|
@ -303,6 +305,7 @@ typedef struct cupheader_s
|
|||
INT16 bonusgame; ///< Map number to use for bonus game
|
||||
INT16 specialstage; ///< Map number to use for special stage
|
||||
UINT8 emeraldnum; ///< ID of Emerald to use for special stage (1-7 for Chaos Emeralds, 8-14 for Super Emeralds, 0 for no emerald)
|
||||
SINT8 unlockrequired; ///< An unlockable is required to select this cup. -1 for no unlocking required.
|
||||
struct cupheader_s *next; ///< Next cup in linked list
|
||||
} cupheader_t;
|
||||
|
||||
|
|
|
|||
|
|
@ -808,9 +808,10 @@ const char *G_BuildMapName(INT32 map)
|
|||
{
|
||||
static char mapname[10] = "MAPXX"; // internal map name (wad resource name)
|
||||
|
||||
I_Assert(map >= 0);
|
||||
I_Assert(map > 0);
|
||||
I_Assert(map <= NUMMAPS);
|
||||
|
||||
#if 0
|
||||
if (map == 0) // hack???
|
||||
{
|
||||
if (gamestate == GS_TITLESCREEN)
|
||||
|
|
@ -821,6 +822,7 @@ const char *G_BuildMapName(INT32 map)
|
|||
map = prevmap;
|
||||
map = G_RandMap(G_TOLFlag(cv_newgametype.value), map, false, 0, false, NULL)+1;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (map < 100)
|
||||
sprintf(&mapname[3], "%.2d", map);
|
||||
|
|
|
|||
|
|
@ -2978,7 +2978,7 @@ static void HU_DrawRankings(void)
|
|||
if (modeattacking)
|
||||
V_DrawString(4, 188, hilicol|V_SNAPTOBOTTOM|V_SNAPTOLEFT, "Record Attack");
|
||||
else
|
||||
V_DrawString(4, 188, hilicol|V_SNAPTOBOTTOM|V_SNAPTOLEFT, gametype_cons_t[gametype].strvalue);
|
||||
V_DrawString(4, 188, hilicol|V_SNAPTOBOTTOM|V_SNAPTOLEFT, Gametype_Names[gametype]);
|
||||
|
||||
if (G_GametypeHasTeams())
|
||||
{
|
||||
|
|
|
|||
35
src/k_menu.h
35
src/k_menu.h
|
|
@ -202,8 +202,7 @@ extern struct menutransition_s {
|
|||
extern boolean menuwipe;
|
||||
|
||||
extern consvar_t cv_showfocuslost;
|
||||
extern consvar_t cv_newgametype, cv_nextmap, cv_chooseskin, cv_serversort;
|
||||
extern CV_PossibleValue_t gametype_cons_t[];
|
||||
extern consvar_t cv_chooseskin, cv_serversort;
|
||||
|
||||
void Moviemode_mode_Onchange(void);
|
||||
void Screenshot_option_Onchange(void);
|
||||
|
|
@ -286,35 +285,31 @@ void M_CharacterSelectHandler(INT32 choice);
|
|||
void M_CharacterSelectTick(void);
|
||||
boolean M_CharacterSelectQuit(void);
|
||||
|
||||
#define CUPS_COLUMNS 7
|
||||
#define CUPS_ROWS 2
|
||||
#define CUPS_MAPSPERCUP 5
|
||||
#define CUPS_MAX (NUMMAPS / CUPS_MAPSPERCUP)
|
||||
#define CUPS_PAGES (CUPS_MAX / (CUPS_COLUMNS * CUPS_ROWS))
|
||||
#define CUPMENU_COLUMNS 7
|
||||
#define CUPMENU_ROWS 2
|
||||
#define CUPMENU_CURSORID (cupgrid.x + (cupgrid.y * CUPMENU_COLUMNS) + (cupgrid.pageno * (CUPMENU_COLUMNS * CUPMENU_ROWS)))
|
||||
|
||||
#define CUPID (levellist_cupgrid.x + (levellist_cupgrid.y * CUPS_COLUMNS))
|
||||
|
||||
extern cupheader_t *selectedcup;
|
||||
extern INT16 selectedcupnum;
|
||||
|
||||
extern struct levellist_cupgrid_s {
|
||||
UINT8 numcups;
|
||||
extern struct cupgrid_s {
|
||||
SINT8 x, y;
|
||||
SINT8 pageno;
|
||||
UINT8 numpages;
|
||||
tic_t previewanim;
|
||||
boolean grandprix; // Setup grand prix server after picking
|
||||
} levellist_cupgrid;
|
||||
} cupgrid;
|
||||
|
||||
extern struct levellist_scroll_s {
|
||||
extern struct levellist_s {
|
||||
SINT8 cursor;
|
||||
UINT16 y;
|
||||
UINT16 dest;
|
||||
cupheader_t *selectedcup;
|
||||
INT16 choosemap;
|
||||
UINT8 newgametype;
|
||||
boolean timeattack; // Setup time attack menu after picking
|
||||
} levellist_scroll;
|
||||
} levellist;
|
||||
|
||||
boolean M_CanShowLevelInList(INT32 mapnum, INT32 gt);
|
||||
INT32 M_CountLevelsToShowInList(INT32 gt);
|
||||
INT32 M_GetFirstLevelInList(INT32 gt);
|
||||
boolean M_CanShowLevelInList(INT16 mapnum, UINT8 gt);
|
||||
INT16 M_CountLevelsToShowInList(UINT8 gt);
|
||||
INT16 M_GetFirstLevelInList(UINT8 gt);
|
||||
|
||||
void M_LevelSelectInit(INT32 choice);
|
||||
void M_CupSelectHandler(INT32 choice);
|
||||
|
|
|
|||
159
src/k_menudraw.c
159
src/k_menudraw.c
|
|
@ -102,13 +102,13 @@ void M_Drawer(void)
|
|||
if (gamestate == GS_MENU) // draw BG
|
||||
V_DrawFixedPatch(0, 0, FRACUNIT, 0, W_CachePatchName("MENUBG", PU_CACHE), NULL);
|
||||
else if (!WipeInAction && currentMenu != &PAUSE_PlaybackMenuDef)
|
||||
V_DrawFadeScreen(0xFF00, 16); // now that's more readable with a faded background (yeah like Quake...)
|
||||
V_DrawCustomFadeScreen("FADEMAP0", 4); // now that's more readable with a faded background (yeah like Quake...)
|
||||
|
||||
if (currentMenu->drawroutine)
|
||||
currentMenu->drawroutine(); // call current menu Draw routine
|
||||
|
||||
// draw non-green resolution border
|
||||
if ((gamestate == GS_MENU) && ((vid.width % BASEVIDWIDTH != 0) || (vid.height % BASEVIDHEIGHT != 0)))
|
||||
if ((vid.width % BASEVIDWIDTH != 0) || (vid.height % BASEVIDHEIGHT != 0))
|
||||
V_DrawFixedPatch(0, 0, FRACUNIT, 0, W_CachePatchName("WEIRDRES", PU_CACHE), NULL);
|
||||
|
||||
// Draw version down in corner
|
||||
|
|
@ -878,21 +878,62 @@ void M_DrawCharacterSelect(void)
|
|||
static void M_DrawCupPreview(INT16 y, cupheader_t *cup)
|
||||
{
|
||||
UINT8 i;
|
||||
INT16 x = -(levellist_cupgrid.previewanim % 82);
|
||||
INT16 x = -(cupgrid.previewanim % 82);
|
||||
|
||||
for (i = 0; i < cup->numlevels; i++)
|
||||
V_DrawFill(0, y, BASEVIDWIDTH, 54, 31);
|
||||
|
||||
if (cup && (cup->unlockrequired == -1 || unlockables[cup->unlockrequired].unlocked))
|
||||
{
|
||||
lumpnum_t lumpnum;
|
||||
patch_t *PictureOfLevel;
|
||||
UINT8 lvloff = (i + (levellist_cupgrid.previewanim / 82)) % cup->numlevels;
|
||||
for (i = 0; i < cup->numlevels; i++)
|
||||
{
|
||||
lumpnum_t lumpnum;
|
||||
patch_t *PictureOfLevel;
|
||||
UINT8 lvloff = (i + (cupgrid.previewanim / 82)) % cup->numlevels;
|
||||
|
||||
lumpnum = W_CheckNumForName(va("%sP", G_BuildMapName(cup->levellist[lvloff] )));
|
||||
if (lumpnum != LUMPERROR)
|
||||
PictureOfLevel = W_CachePatchNum(lumpnum, PU_CACHE);
|
||||
else
|
||||
PictureOfLevel = W_CachePatchName("BLANKLVL", PU_CACHE);
|
||||
lumpnum = W_CheckNumForName(va("%sP", G_BuildMapName(cup->levellist[lvloff]+1)));
|
||||
if (lumpnum != LUMPERROR)
|
||||
PictureOfLevel = W_CachePatchNum(lumpnum, PU_CACHE);
|
||||
else
|
||||
PictureOfLevel = W_CachePatchName("BLANKLVL", PU_CACHE);
|
||||
|
||||
V_DrawSmallScaledPatch(x + 1 + (i*82), y+2, 0, PictureOfLevel);
|
||||
V_DrawSmallScaledPatch(x + 1 + (i*82), y+2, 0, PictureOfLevel);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
patch_t *st = W_CachePatchName(va("PREVST0%d", (cupgrid.previewanim % 4) + 1), PU_CACHE);
|
||||
while (x < BASEVIDWIDTH)
|
||||
{
|
||||
V_DrawScaledPatch(x+1, y+2, 0, st);
|
||||
x += 82;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void M_DrawCupTitle(INT16 y, cupheader_t *cup)
|
||||
{
|
||||
V_DrawScaledPatch(0, y, 0, W_CachePatchName("MENUHINT", PU_CACHE));
|
||||
|
||||
if (cup)
|
||||
{
|
||||
boolean unlocked = (cup->unlockrequired == -1 || unlockables[cup->unlockrequired].unlocked);
|
||||
UINT8 *colormap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_GREY, GTC_MENUCACHE);
|
||||
patch_t *icon = W_CachePatchName(cup->icon, PU_CACHE);
|
||||
const char *str = (unlocked ? va("%s Cup", cup->name) : "???");
|
||||
INT16 offset = V_LSTitleLowStringWidth(str, 0) / 2;
|
||||
|
||||
V_DrawLSTitleLowString(BASEVIDWIDTH/2 - offset, y+6, 0, str);
|
||||
|
||||
if (unlocked)
|
||||
{
|
||||
V_DrawMappedPatch(BASEVIDWIDTH/2 - offset - 24, y+5, 0, icon, colormap);
|
||||
V_DrawMappedPatch(BASEVIDWIDTH/2 + offset + 3, y+5, 0, icon, colormap);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (currentMenu == &PLAY_LevelSelectDef)
|
||||
V_DrawCenteredLSTitleLowString(BASEVIDWIDTH/2, y+6, 0, va("%s Mode", Gametype_Names[levellist.newgametype]));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -903,16 +944,16 @@ void M_DrawCupSelect(void)
|
|||
|
||||
while (cup)
|
||||
{
|
||||
if (cup->id == CUPID)
|
||||
if (cup->id == CUPMENU_CURSORID)
|
||||
break;
|
||||
cup = cup->next;
|
||||
}
|
||||
|
||||
for (i = 0; i < CUPS_COLUMNS; i++)
|
||||
for (i = 0; i < CUPMENU_COLUMNS; i++)
|
||||
{
|
||||
for (j = 0; j < CUPS_ROWS; j++)
|
||||
for (j = 0; j < CUPMENU_ROWS; j++)
|
||||
{
|
||||
UINT8 id = (i + (j * CUPS_COLUMNS));
|
||||
UINT8 id = (i + (j * CUPMENU_COLUMNS)) + (cupgrid.pageno * (CUPMENU_COLUMNS * CUPMENU_ROWS));
|
||||
cupheader_t *iconcup = kartcupheaders;
|
||||
patch_t *patch = NULL;
|
||||
INT16 x, y;
|
||||
|
|
@ -943,24 +984,26 @@ void M_DrawCupSelect(void)
|
|||
|
||||
V_DrawScaledPatch(x, y, 0, patch);
|
||||
|
||||
V_DrawScaledPatch(x + 8, y + icony, 0, W_CachePatchName(iconcup->icon, PU_CACHE));
|
||||
V_DrawScaledPatch(x + 8, y + icony, 0, W_CachePatchName("CUPBOX", PU_CACHE));
|
||||
if (iconcup->unlockrequired != -1 && !unlockables[iconcup->unlockrequired].unlocked)
|
||||
{
|
||||
patch_t *st = W_CachePatchName(va("ICONST0%d", (cupgrid.previewanim % 4) + 1), PU_CACHE);
|
||||
V_DrawScaledPatch(x + 8, y + icony, 0, st);
|
||||
}
|
||||
else
|
||||
{
|
||||
V_DrawScaledPatch(x + 8, y + icony, 0, W_CachePatchName(iconcup->icon, PU_CACHE));
|
||||
V_DrawScaledPatch(x + 8, y + icony, 0, W_CachePatchName("CUPBOX", PU_CACHE));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
V_DrawScaledPatch(14 + (levellist_cupgrid.x*42) - 4,
|
||||
20 + (levellist_cupgrid.y*44) - 1 - (12*menutransition.tics),
|
||||
V_DrawScaledPatch(14 + (cupgrid.x*42) - 4,
|
||||
20 + (cupgrid.y*44) - 1 - (12*menutransition.tics),
|
||||
0, W_CachePatchName("CUPCURS", PU_CACHE)
|
||||
);
|
||||
|
||||
V_DrawFill(0, 146 + (12*menutransition.tics), BASEVIDWIDTH, 54, 31);
|
||||
V_DrawScaledPatch(0, 120 - (12*menutransition.tics), 0, W_CachePatchName("MENUHINT", PU_CACHE));
|
||||
|
||||
if (cup)
|
||||
{
|
||||
M_DrawCupPreview(146 + (12*menutransition.tics), cup);
|
||||
V_DrawCenteredLSTitleLowString(BASEVIDWIDTH/2, 126 - (12*menutransition.tics), 0, va("%s Cup", cup->name));
|
||||
}
|
||||
M_DrawCupPreview(146 + (12*menutransition.tics), cup);
|
||||
M_DrawCupTitle(120 - (12*menutransition.tics), cup);
|
||||
}
|
||||
|
||||
static void M_DrawHighLowLevelTitle(INT16 x, INT16 y, INT16 map)
|
||||
|
|
@ -1033,16 +1076,37 @@ static void M_DrawHighLowLevelTitle(INT16 x, INT16 y, INT16 map)
|
|||
}
|
||||
}
|
||||
|
||||
if (mapheaderinfo[map]->actnum[0])
|
||||
{
|
||||
word2[word2len] = ' ';
|
||||
word2len++;
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
if (!mapheaderinfo[map]->actnum[i])
|
||||
break;
|
||||
|
||||
word2[word2len] = mapheaderinfo[map]->actnum[i];
|
||||
word2len++;
|
||||
}
|
||||
}
|
||||
|
||||
word1[word1len] = '\0';
|
||||
word2[word2len] = '\0';
|
||||
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
INT32 c;
|
||||
|
||||
if (i >= word1len)
|
||||
break;
|
||||
|
||||
c = toupper(word1[i]) - LT_FONTSTART;
|
||||
x2 += SHORT(title_font_high[c]->width) - 4;
|
||||
|
||||
if (!title_font_high[c])
|
||||
x2 += 16;
|
||||
else
|
||||
x2 += SHORT(title_font_high[c]->width) - 4;
|
||||
}
|
||||
|
||||
if (word1len)
|
||||
|
|
@ -1060,7 +1124,7 @@ static void M_DrawLevelSelectBlock(INT16 x, INT16 y, INT16 map, boolean redblink
|
|||
if (greyscale)
|
||||
colormap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_GREY, GTC_MENUCACHE);
|
||||
|
||||
lumpnum = W_CheckNumForName(va("%sP", G_BuildMapName(map)));
|
||||
lumpnum = W_CheckNumForName(va("%sP", G_BuildMapName(map+1)));
|
||||
if (lumpnum != LUMPERROR)
|
||||
PictureOfLevel = W_CachePatchNum(lumpnum, PU_CACHE);
|
||||
else
|
||||
|
|
@ -1072,16 +1136,17 @@ static void M_DrawLevelSelectBlock(INT16 x, INT16 y, INT16 map, boolean redblink
|
|||
V_DrawScaledPatch(3+x, y, 0, W_CachePatchName("LVLSEL", PU_CACHE));
|
||||
|
||||
V_DrawSmallMappedPatch(9+x, y+6, 0, PictureOfLevel, colormap);
|
||||
M_DrawHighLowLevelTitle(98+x, y+8, map-1);
|
||||
M_DrawHighLowLevelTitle(98+x, y+8, map);
|
||||
}
|
||||
|
||||
void M_DrawLevelSelect(void)
|
||||
{
|
||||
INT16 i;
|
||||
INT16 start = M_GetFirstLevelInList(cv_newgametype.value)-1;
|
||||
INT16 start = M_GetFirstLevelInList(levellist.newgametype);
|
||||
INT16 map = start;
|
||||
INT16 t = (32*menutransition.tics), tay = 0;
|
||||
INT16 y = 80 - (12 * levellist_scroll.y);
|
||||
boolean tatransition = (menutransition.startmenu == &PLAY_TimeAttackDef || menutransition.endmenu == &PLAY_TimeAttackDef);
|
||||
INT16 y = 80 - (12 * levellist.y);
|
||||
boolean tatransition = ((menutransition.startmenu == &PLAY_TimeAttackDef || menutransition.endmenu == &PLAY_TimeAttackDef) && menutransition.tics);
|
||||
|
||||
if (tatransition)
|
||||
{
|
||||
|
|
@ -1089,41 +1154,37 @@ void M_DrawLevelSelect(void)
|
|||
tay = t/2;
|
||||
}
|
||||
|
||||
for (i = 0; i < M_CountLevelsToShowInList(cv_newgametype.value); i++)
|
||||
for (i = 0; i < M_CountLevelsToShowInList(levellist.newgametype); i++)
|
||||
{
|
||||
INT16 lvlx = t, lvly = y;
|
||||
INT16 map = start + i;
|
||||
|
||||
while (!M_CanShowLevelInList(map, cv_newgametype.value) && map < NUMMAPS)
|
||||
while (!M_CanShowLevelInList(map, levellist.newgametype) && map < NUMMAPS)
|
||||
map++;
|
||||
|
||||
if (map >= NUMMAPS)
|
||||
break;
|
||||
|
||||
if (i == levellist_scroll.cursor && tatransition)
|
||||
if (i == levellist.cursor && tatransition)
|
||||
{
|
||||
lvlx = 0;
|
||||
lvly = max(2, y+tay);
|
||||
}
|
||||
|
||||
M_DrawLevelSelectBlock(lvlx, lvly, map,
|
||||
(i == levellist_scroll.cursor && ((skullAnimCounter / 4) & 1)),
|
||||
(i != levellist_scroll.cursor)
|
||||
(i == levellist.cursor && (((skullAnimCounter / 4) & 1) || tatransition)),
|
||||
(i != levellist.cursor)
|
||||
);
|
||||
|
||||
y += 72;
|
||||
map++;
|
||||
}
|
||||
|
||||
V_DrawScaledPatch(0, tay, 0, W_CachePatchName("MENUHINT", PU_CACHE));
|
||||
if (selectedcup)
|
||||
V_DrawCenteredLSTitleLowString(BASEVIDWIDTH/2, 6+tay, 0, va("%s Cup", selectedcup->name));
|
||||
else
|
||||
V_DrawCenteredLSTitleLowString(BASEVIDWIDTH/2, 6+tay, 0, va("%s Mode", Gametype_Names[cv_newgametype.value]));
|
||||
M_DrawCupTitle(tay, levellist.selectedcup);
|
||||
}
|
||||
|
||||
void M_DrawTimeAttack(void)
|
||||
{
|
||||
INT16 map = cv_nextmap.value;
|
||||
INT16 map = levellist.choosemap;
|
||||
INT16 t = (24*menutransition.tics);
|
||||
INT16 leftedge = 149+t+16;
|
||||
INT16 rightedge = 149+t+155;
|
||||
|
|
@ -1131,11 +1192,11 @@ void M_DrawTimeAttack(void)
|
|||
lumpnum_t lumpnum;
|
||||
UINT8 i;
|
||||
|
||||
M_DrawLevelSelectBlock(0, 2, map, false, false);
|
||||
M_DrawLevelSelectBlock(0, 2, map, true, false);
|
||||
|
||||
//V_DrawFill(24-t, 82, 100, 100, 36); // size test
|
||||
|
||||
lumpnum = W_CheckNumForName(va("%sR", G_BuildMapName(map)));
|
||||
lumpnum = W_CheckNumForName(va("%sR", G_BuildMapName(map+1)));
|
||||
if (lumpnum != LUMPERROR)
|
||||
V_DrawScaledPatch(24-t, 82, 0, W_CachePatchNum(lumpnum, PU_CACHE));
|
||||
|
||||
|
|
|
|||
416
src/k_menufunc.c
416
src/k_menufunc.c
|
|
@ -83,7 +83,7 @@ menu_t *currentMenu = &MainDef;
|
|||
char dummystaffname[22];
|
||||
|
||||
INT16 itemOn = 0; // menu item skull is on, Hack by Tails 09-18-2002
|
||||
INT16 skullAnimCounter = 10; // skull animation counter
|
||||
INT16 skullAnimCounter = 8; // skull animation counter
|
||||
struct menutransition_s menutransition; // Menu transition properties
|
||||
|
||||
// finish wipes between screens
|
||||
|
|
@ -98,10 +98,7 @@ static boolean noFurtherInput = false;
|
|||
// ==========================================================================
|
||||
|
||||
// Consvar onchange functions
|
||||
static void Nextmap_OnChange(void);
|
||||
static void Newgametype_OnChange(void);
|
||||
static void Dummymenuplayer_OnChange(void);
|
||||
//static void Dummymares_OnChange(void);
|
||||
static void Dummystaff_OnChange(void);
|
||||
|
||||
consvar_t cv_showfocuslost = {"showfocuslost", "Yes", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL };
|
||||
|
|
@ -136,20 +133,8 @@ consvar_t cv_splitplayers = {"splitplayers", "One", CV_CALL, splitplayers_cons_t
|
|||
//Console variables used solely in the menu system.
|
||||
//todo: add a way to use non-console variables in the menu
|
||||
// or make these consvars legitimate like color or skin.
|
||||
static CV_PossibleValue_t map_cons_t[] = {
|
||||
{0,"MIN"},
|
||||
{NUMMAPS, "MAX"},
|
||||
{0, NULL}
|
||||
};
|
||||
consvar_t cv_nextmap = {"nextmap", "1", CV_HIDDEN|CV_CALL, map_cons_t, Nextmap_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
static CV_PossibleValue_t skins_cons_t[MAXSKINS+1] = {{1, DEFAULTSKIN}};
|
||||
consvar_t cv_chooseskin = {"chooseskin", DEFAULTSKIN, CV_HIDDEN|CV_CALL, skins_cons_t, Nextmap_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
// This gametype list is integral for many different reasons.
|
||||
// When you add gametypes here, don't forget to update them in dehacked.c and doomstat.h!
|
||||
CV_PossibleValue_t gametype_cons_t[NUMGAMETYPES+1];
|
||||
consvar_t cv_newgametype = {"newgametype", "Race", CV_HIDDEN|CV_CALL, gametype_cons_t, Newgametype_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_chooseskin = {"chooseskin", DEFAULTSKIN, CV_HIDDEN, skins_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
static CV_PossibleValue_t dummymenuplayer_cons_t[] = {{0, "NOPE"}, {1, "P1"}, {2, "P2"}, {3, "P3"}, {4, "P4"}, {0, NULL}};
|
||||
static consvar_t cv_dummymenuplayer = {"dummymenuplayer", "P1", CV_HIDDEN|CV_CALL, dummymenuplayer_cons_t, Dummymenuplayer_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
|
@ -172,15 +157,9 @@ static consvar_t cv_dummystaff = {"dummystaff", "0", CV_HIDDEN|CV_CALL, dummysta
|
|||
// (there's only a couple anyway)
|
||||
|
||||
#if 0
|
||||
// Prototypes
|
||||
static INT32 M_FindFirstMap(INT32 gtype);
|
||||
static INT32 M_GetFirstLevelInList(void);
|
||||
#endif
|
||||
|
||||
// Nextmap. Used for Time Attack.
|
||||
static void Nextmap_OnChange(void)
|
||||
{
|
||||
#if 0
|
||||
char *leveltitle;
|
||||
|
||||
// Update the string in the consvar.
|
||||
|
|
@ -188,7 +167,6 @@ static void Nextmap_OnChange(void)
|
|||
leveltitle = G_BuildMapTitle(cv_nextmap.value);
|
||||
cv_nextmap.string = cv_nextmap.zstring = leveltitle ? leveltitle : Z_StrDup(G_BuildMapName(cv_nextmap.value));
|
||||
|
||||
|
||||
if (currentMenu == &SP_TimeAttackDef)
|
||||
{
|
||||
// see also p_setup.c's P_LoadRecordGhosts
|
||||
|
|
@ -270,9 +248,8 @@ static void Nextmap_OnChange(void)
|
|||
|
||||
free(gpath);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static void Dummymenuplayer_OnChange(void)
|
||||
{
|
||||
|
|
@ -284,6 +261,7 @@ static void Dummymenuplayer_OnChange(void)
|
|||
|
||||
static void Dummystaff_OnChange(void)
|
||||
{
|
||||
#if 0
|
||||
lumpnum_t l;
|
||||
|
||||
dummystaffname[0] = '\0';
|
||||
|
|
@ -315,40 +293,9 @@ static void Dummystaff_OnChange(void)
|
|||
|
||||
sprintf(temp, " - %d", cv_dummystaff.value);
|
||||
}
|
||||
}
|
||||
|
||||
// Newgametype. Used for gametype changes.
|
||||
static void Newgametype_OnChange(void)
|
||||
{
|
||||
#if 0
|
||||
if (cv_nextmap.value && menuactive)
|
||||
{
|
||||
if (!mapheaderinfo[cv_nextmap.value-1])
|
||||
P_AllocMapHeader((INT16)(cv_nextmap.value-1));
|
||||
|
||||
if ((cv_newgametype.value == GT_RACE && !(mapheaderinfo[cv_nextmap.value-1]->typeoflevel & TOL_RACE))
|
||||
|| (cv_newgametype.value == GT_MATCH && !(mapheaderinfo[cv_nextmap.value-1]->typeoflevel & TOL_MATCH)))
|
||||
{
|
||||
INT32 value = 0;
|
||||
|
||||
switch (cv_newgametype.value)
|
||||
{
|
||||
default:
|
||||
case GT_RACE:
|
||||
value = TOL_RACE;
|
||||
break;
|
||||
case GT_MATCH:
|
||||
value = TOL_MATCH;
|
||||
break;
|
||||
}
|
||||
|
||||
CV_SetValue(&cv_nextmap, M_FindFirstMap(value));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void Screenshot_option_Onchange(void)
|
||||
{
|
||||
#if 0
|
||||
|
|
@ -427,32 +374,37 @@ static void M_ChangeCvar(INT32 choice)
|
|||
{
|
||||
consvar_t *cv = (consvar_t *)currentMenu->menuitems[itemOn].itemaction;
|
||||
|
||||
// Backspace sets values to default value
|
||||
if (choice == -1)
|
||||
{
|
||||
// There's a default color technically, but it's not ideal. Use your skin's prefcolor instead!
|
||||
if (cv == &cv_playercolor)
|
||||
{
|
||||
SINT8 skinno = R_SkinAvailable(cv_chooseskin.string);
|
||||
|
||||
if (skinno != -1)
|
||||
CV_SetValue(cv,skins[skinno].prefcolor);
|
||||
CV_SetValue(cv, skins[skinno].prefcolor);
|
||||
|
||||
return;
|
||||
}
|
||||
CV_Set(cv,cv->defaultvalue);
|
||||
|
||||
CV_Set(cv, cv->defaultvalue);
|
||||
return;
|
||||
}
|
||||
|
||||
choice = (choice<<1) - 1;
|
||||
|
||||
if (((currentMenu->menuitems[itemOn].status & IT_CVARTYPE) == IT_CV_SLIDER)
|
||||
||((currentMenu->menuitems[itemOn].status & IT_CVARTYPE) == IT_CV_INVISSLIDER)
|
||||
||((currentMenu->menuitems[itemOn].status & IT_CVARTYPE) == IT_CV_NOMOD))
|
||||
|| ((currentMenu->menuitems[itemOn].status & IT_CVARTYPE) == IT_CV_INVISSLIDER)
|
||||
|| ((currentMenu->menuitems[itemOn].status & IT_CVARTYPE) == IT_CV_NOMOD))
|
||||
{
|
||||
CV_SetValue(cv,cv->value+choice);
|
||||
CV_SetValue(cv, cv->value+choice);
|
||||
}
|
||||
else if (cv->flags & CV_FLOAT)
|
||||
{
|
||||
char s[20];
|
||||
sprintf(s,"%f",FIXED_TO_FLOAT(cv->value)+(choice)*(1.0f/16.0f));
|
||||
CV_Set(cv,s);
|
||||
sprintf(s, "%f", FIXED_TO_FLOAT(cv->value) + (choice) * (1.0f / 16.0f));
|
||||
CV_Set(cv, s);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -464,7 +416,8 @@ static void M_ChangeCvar(INT32 choice)
|
|||
else if (cv == &cv_maxping)
|
||||
choice *= 50;
|
||||
#endif
|
||||
CV_AddValue(cv,choice);
|
||||
|
||||
CV_AddValue(cv, choice);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -579,15 +532,15 @@ boolean M_Responder(event_t *ev)
|
|||
switch (ch)
|
||||
{
|
||||
case KEY_MOUSE1:
|
||||
//case KEY_JOY1:
|
||||
//case KEY_JOY1 + 2:
|
||||
//case KEY_JOY1:
|
||||
//case KEY_JOY1 + 2:
|
||||
ch = KEY_ENTER;
|
||||
break;
|
||||
/*case KEY_JOY1 + 3: // Brake can function as 'n' for message boxes now.
|
||||
ch = 'n';
|
||||
break;*/
|
||||
/*case KEY_JOY1 + 3: // Brake can function as 'n' for message boxes now.
|
||||
ch = 'n';
|
||||
break;*/
|
||||
case KEY_MOUSE1 + 1:
|
||||
//case KEY_JOY1 + 1:
|
||||
//case KEY_JOY1 + 1:
|
||||
ch = KEY_BACKSPACE;
|
||||
break;
|
||||
case KEY_HAT1:
|
||||
|
|
@ -744,8 +697,8 @@ boolean M_Responder(event_t *ev)
|
|||
M_QuitSRB2(0);
|
||||
return true;
|
||||
|
||||
case KEY_F11: // Gamma Level
|
||||
CV_AddValue(&cv_usegamma, 1);
|
||||
case KEY_F11: // Empty (used to be Gamma)
|
||||
//CV_AddValue(&cv_usegamma, 1);
|
||||
return true;
|
||||
|
||||
// Spymode on F12 handled in game logic
|
||||
|
|
@ -948,8 +901,8 @@ boolean M_Responder(event_t *ev)
|
|||
|
||||
if (cv == &cv_chooseskin
|
||||
|| cv == &cv_dummystaff
|
||||
|| cv == &cv_nextmap
|
||||
|| cv == &cv_newgametype)
|
||||
/*|| cv == &cv_nextmap
|
||||
|| cv == &cv_newgametype*/)
|
||||
return true;
|
||||
|
||||
#if 0
|
||||
|
|
@ -1344,8 +1297,6 @@ void M_Init(void)
|
|||
{
|
||||
//COM_AddCommand("manual", Command_Manual_f);
|
||||
|
||||
CV_RegisterVar(&cv_nextmap);
|
||||
CV_RegisterVar(&cv_newgametype);
|
||||
CV_RegisterVar(&cv_chooseskin);
|
||||
CV_RegisterVar(&cv_autorecord);
|
||||
|
||||
|
|
@ -2023,7 +1974,7 @@ boolean M_CharacterSelectQuit(void)
|
|||
// Determines whether to show a given map in the various level-select lists.
|
||||
// Set gt = -1 to ignore gametype.
|
||||
//
|
||||
boolean M_CanShowLevelInList(INT32 mapnum, INT32 gt)
|
||||
boolean M_CanShowLevelInList(INT16 mapnum, UINT8 gt)
|
||||
{
|
||||
// Does the map exist?
|
||||
if (!mapheaderinfo[mapnum])
|
||||
|
|
@ -2037,7 +1988,7 @@ boolean M_CanShowLevelInList(INT32 mapnum, INT32 gt)
|
|||
return false; // not unlocked
|
||||
|
||||
// Should the map be hidden?
|
||||
if (mapheaderinfo[mapnum]->menuflags & LF2_HIDEINMENU && mapnum+1 != gamemap)
|
||||
if (mapheaderinfo[mapnum]->menuflags & LF2_HIDEINMENU /*&& mapnum+1 != gamemap*/)
|
||||
return false;
|
||||
|
||||
if (gt == GT_MATCH && (mapheaderinfo[mapnum]->typeoflevel & TOL_MATCH))
|
||||
|
|
@ -2045,17 +1996,17 @@ boolean M_CanShowLevelInList(INT32 mapnum, INT32 gt)
|
|||
|
||||
if (gt == GT_RACE && (mapheaderinfo[mapnum]->typeoflevel & TOL_RACE))
|
||||
{
|
||||
if (selectedcup && selectedcup->numlevels)
|
||||
if (levellist.selectedcup && levellist.selectedcup->numlevels)
|
||||
{
|
||||
UINT8 i;
|
||||
|
||||
for (i = 0; i < selectedcup->numlevels; i++)
|
||||
for (i = 0; i < levellist.selectedcup->numlevels; i++)
|
||||
{
|
||||
if (mapnum == selectedcup->levellist[i])
|
||||
if (mapnum == levellist.selectedcup->levellist[i])
|
||||
break;
|
||||
}
|
||||
|
||||
if (i == selectedcup->numlevels)
|
||||
if (i == levellist.selectedcup->numlevels)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -2066,9 +2017,9 @@ boolean M_CanShowLevelInList(INT32 mapnum, INT32 gt)
|
|||
return false;
|
||||
}
|
||||
|
||||
INT32 M_CountLevelsToShowInList(INT32 gt)
|
||||
INT16 M_CountLevelsToShowInList(UINT8 gt)
|
||||
{
|
||||
INT32 mapnum, count = 0;
|
||||
INT16 mapnum, count = 0;
|
||||
|
||||
for (mapnum = 0; mapnum < NUMMAPS; mapnum++)
|
||||
if (M_CanShowLevelInList(mapnum, gt))
|
||||
|
|
@ -2077,32 +2028,31 @@ INT32 M_CountLevelsToShowInList(INT32 gt)
|
|||
return count;
|
||||
}
|
||||
|
||||
INT32 M_GetFirstLevelInList(INT32 gt)
|
||||
INT16 M_GetFirstLevelInList(UINT8 gt)
|
||||
{
|
||||
INT32 mapnum;
|
||||
INT16 mapnum;
|
||||
|
||||
for (mapnum = 0; mapnum < NUMMAPS; mapnum++)
|
||||
if (M_CanShowLevelInList(mapnum, gt))
|
||||
return mapnum + 1;
|
||||
return mapnum;
|
||||
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
cupheader_t *selectedcup = NULL;
|
||||
struct levellist_cupgrid_s levellist_cupgrid;
|
||||
struct levellist_scroll_s levellist_scroll;
|
||||
struct cupgrid_s cupgrid;
|
||||
struct levellist_s levellist;
|
||||
|
||||
static void M_LevelSelectScrollDest(void)
|
||||
{
|
||||
UINT16 m = M_CountLevelsToShowInList(cv_newgametype.value)-1;
|
||||
UINT16 m = M_CountLevelsToShowInList(levellist.newgametype)-1;
|
||||
|
||||
levellist_scroll.dest = (6*levellist_scroll.cursor);
|
||||
levellist.dest = (6*levellist.cursor);
|
||||
|
||||
if (levellist_scroll.dest < 3)
|
||||
levellist_scroll.dest = 3;
|
||||
if (levellist.dest < 3)
|
||||
levellist.dest = 3;
|
||||
|
||||
if (levellist_scroll.dest > (6*m)-3)
|
||||
levellist_scroll.dest = (6*m)-3;
|
||||
if (levellist.dest > (6*m)-3)
|
||||
levellist.dest = (6*m)-3;
|
||||
}
|
||||
|
||||
void M_LevelSelectInit(INT32 choice)
|
||||
|
|
@ -2112,36 +2062,64 @@ void M_LevelSelectInit(INT32 choice)
|
|||
switch (currentMenu->menuitems[itemOn].mvar1)
|
||||
{
|
||||
case 0:
|
||||
levellist_cupgrid.grandprix = false;
|
||||
levellist_scroll.timeattack = false;
|
||||
cupgrid.grandprix = false;
|
||||
levellist.timeattack = false;
|
||||
break;
|
||||
case 1:
|
||||
levellist_cupgrid.grandprix = false;
|
||||
levellist_scroll.timeattack = true;
|
||||
break;
|
||||
case 2:
|
||||
levellist_cupgrid.grandprix = true;
|
||||
levellist_scroll.timeattack = false;
|
||||
cupgrid.grandprix = false;
|
||||
levellist.timeattack = true;
|
||||
break;
|
||||
/*case 2:
|
||||
cupgrid.grandprix = true;
|
||||
levellist.timeattack = false;
|
||||
break;*/
|
||||
default:
|
||||
CONS_Alert(CONS_WARNING, "Bad level select init\n");
|
||||
return;
|
||||
}
|
||||
|
||||
CV_StealthSetValue(&cv_newgametype, currentMenu->menuitems[itemOn].mvar2);
|
||||
levellist.newgametype = currentMenu->menuitems[itemOn].mvar2;
|
||||
PLAY_CupSelectDef.prevMenu = currentMenu;
|
||||
|
||||
if (cv_newgametype.value == GT_RACE)
|
||||
// Obviously go to Cup Select in gametypes that have cups.
|
||||
// Use a really long level select in gametypes that don't use cups.
|
||||
|
||||
if (levellist.newgametype == GT_RACE)
|
||||
{
|
||||
cupheader_t *cup = kartcupheaders;
|
||||
UINT8 highestid = 0;
|
||||
|
||||
// Make sure there's valid cups before going to this menu.
|
||||
if (cup == NULL)
|
||||
I_Error("Can you really call this a racing game, I didn't recieve any Cups on my pillow or anything");
|
||||
|
||||
while (cup)
|
||||
{
|
||||
if (cup->unlockrequired == -1 || unlockables[cup->unlockrequired].unlocked)
|
||||
highestid = cup->id;
|
||||
cup = cup->next;
|
||||
}
|
||||
|
||||
cupgrid.numpages = (highestid / (CUPMENU_COLUMNS * CUPMENU_ROWS)) + 1;
|
||||
|
||||
PLAY_LevelSelectDef.prevMenu = &PLAY_CupSelectDef;
|
||||
M_SetupNextMenu(&PLAY_CupSelectDef, false);
|
||||
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
||||
// Reset position properly if you go back & forth between gametypes
|
||||
if (levellist.selectedcup)
|
||||
{
|
||||
selectedcup = NULL;
|
||||
PLAY_LevelSelectDef.prevMenu = currentMenu;
|
||||
M_SetupNextMenu(&PLAY_LevelSelectDef, false);
|
||||
levellist.cursor = 0;
|
||||
levellist.selectedcup = NULL;
|
||||
}
|
||||
|
||||
M_LevelSelectScrollDest();
|
||||
levellist.y = levellist.dest;
|
||||
|
||||
PLAY_LevelSelectDef.prevMenu = currentMenu;
|
||||
M_SetupNextMenu(&PLAY_LevelSelectDef, false);
|
||||
}
|
||||
|
||||
void M_CupSelectHandler(INT32 choice)
|
||||
|
|
@ -2150,7 +2128,7 @@ void M_CupSelectHandler(INT32 choice)
|
|||
|
||||
while (newcup)
|
||||
{
|
||||
if (newcup->id == CUPID)
|
||||
if (newcup->id == CUPMENU_CURSORID)
|
||||
break;
|
||||
newcup = newcup->next;
|
||||
}
|
||||
|
|
@ -2158,53 +2136,55 @@ void M_CupSelectHandler(INT32 choice)
|
|||
switch (choice)
|
||||
{
|
||||
case KEY_RIGHTARROW:
|
||||
levellist_cupgrid.x++;
|
||||
if (levellist_cupgrid.x >= CUPS_COLUMNS)
|
||||
cupgrid.x++;
|
||||
if (cupgrid.x >= CUPMENU_COLUMNS)
|
||||
{
|
||||
levellist_cupgrid.x = 0;
|
||||
//levellist_cupgrid.pageno++;
|
||||
cupgrid.x = 0;
|
||||
cupgrid.pageno++;
|
||||
if (cupgrid.pageno >= cupgrid.numpages)
|
||||
cupgrid.pageno = 0;
|
||||
}
|
||||
S_StartSound(NULL, sfx_s3k5b);
|
||||
break;
|
||||
case KEY_LEFTARROW:
|
||||
levellist_cupgrid.x--;
|
||||
if (levellist_cupgrid.x < 0)
|
||||
cupgrid.x--;
|
||||
if (cupgrid.x < 0)
|
||||
{
|
||||
levellist_cupgrid.x = CUPS_COLUMNS-1;
|
||||
//levellist_cupgrid.pageno--;
|
||||
cupgrid.x = CUPMENU_COLUMNS-1;
|
||||
cupgrid.pageno--;
|
||||
if (cupgrid.pageno < 0)
|
||||
cupgrid.pageno = cupgrid.numpages-1;
|
||||
}
|
||||
S_StartSound(NULL, sfx_s3k5b);
|
||||
break;
|
||||
case KEY_UPARROW:
|
||||
levellist_cupgrid.y++;
|
||||
if (levellist_cupgrid.y >= CUPS_ROWS)
|
||||
{
|
||||
levellist_cupgrid.y = 0;
|
||||
//levellist_cupgrid.pageno++;
|
||||
}
|
||||
cupgrid.y++;
|
||||
if (cupgrid.y >= CUPMENU_ROWS)
|
||||
cupgrid.y = 0;
|
||||
S_StartSound(NULL, sfx_s3k5b);
|
||||
break;
|
||||
case KEY_DOWNARROW:
|
||||
levellist_cupgrid.y--;
|
||||
if (levellist_cupgrid.y < 0)
|
||||
{
|
||||
levellist_cupgrid.y = CUPS_ROWS-1;
|
||||
//levellist_cupgrid.pageno--;
|
||||
}
|
||||
cupgrid.y--;
|
||||
if (cupgrid.y < 0)
|
||||
cupgrid.y = CUPMENU_ROWS-1;
|
||||
S_StartSound(NULL, sfx_s3k5b);
|
||||
break;
|
||||
case KEY_ENTER:
|
||||
if (!newcup)
|
||||
break;
|
||||
|
||||
if (!selectedcup || newcup->id != selectedcup->id) // Keep cursor position if you select the same cup again
|
||||
if ((!newcup) || (newcup && newcup->unlockrequired != -1 && !unlockables[newcup->unlockrequired].unlocked))
|
||||
{
|
||||
levellist_scroll.cursor = 0;
|
||||
selectedcup = newcup;
|
||||
S_StartSound(NULL, sfx_s3kb2);
|
||||
break;
|
||||
}
|
||||
|
||||
// Keep cursor position if you select the same cup again, reset if it's a different cup
|
||||
if (!levellist.selectedcup || newcup->id != levellist.selectedcup->id)
|
||||
{
|
||||
levellist.cursor = 0;
|
||||
levellist.selectedcup = newcup;
|
||||
}
|
||||
|
||||
M_LevelSelectScrollDest();
|
||||
levellist_scroll.y = levellist_scroll.dest;
|
||||
levellist.y = levellist.dest;
|
||||
|
||||
M_SetupNextMenu(&PLAY_LevelSelectDef, false);
|
||||
S_StartSound(NULL, sfx_s3k63);
|
||||
|
|
@ -2222,87 +2202,109 @@ void M_CupSelectHandler(INT32 choice)
|
|||
|
||||
void M_CupSelectTick(void)
|
||||
{
|
||||
levellist_cupgrid.previewanim++;
|
||||
cupgrid.previewanim++;
|
||||
}
|
||||
|
||||
void M_LevelSelectHandler(INT32 choice)
|
||||
{
|
||||
INT16 start = M_GetFirstLevelInList(cv_newgametype.value)-1;
|
||||
INT16 maxlevels = M_CountLevelsToShowInList(cv_newgametype.value);
|
||||
INT16 map = start;
|
||||
INT16 start = M_GetFirstLevelInList(levellist.newgametype);
|
||||
INT16 maxlevels = M_CountLevelsToShowInList(levellist.newgametype);
|
||||
|
||||
if (levellist_scroll.y != levellist_scroll.dest)
|
||||
if (levellist.y != levellist.dest)
|
||||
return;
|
||||
|
||||
switch (choice)
|
||||
{
|
||||
case KEY_UPARROW:
|
||||
levellist_scroll.cursor--;
|
||||
if (levellist_scroll.cursor < 0)
|
||||
levellist_scroll.cursor = maxlevels-1;
|
||||
levellist.cursor--;
|
||||
if (levellist.cursor < 0)
|
||||
levellist.cursor = maxlevels-1;
|
||||
S_StartSound(NULL, sfx_s3k5b);
|
||||
break;
|
||||
case KEY_DOWNARROW:
|
||||
levellist_scroll.cursor++;
|
||||
if (levellist_scroll.cursor >= maxlevels)
|
||||
levellist_scroll.cursor = 0;
|
||||
levellist.cursor++;
|
||||
if (levellist.cursor >= maxlevels)
|
||||
levellist.cursor = 0;
|
||||
S_StartSound(NULL, sfx_s3k5b);
|
||||
break;
|
||||
case KEY_ENTER:
|
||||
map = start + levellist_scroll.cursor;
|
||||
|
||||
while (!M_CanShowLevelInList(map, cv_newgametype.value) && map < NUMMAPS)
|
||||
map++;
|
||||
|
||||
if (map >= NUMMAPS)
|
||||
break;
|
||||
|
||||
CV_SetValue(&cv_nextmap, map);
|
||||
|
||||
if (levellist_scroll.timeattack)
|
||||
M_SetupNextMenu(&PLAY_TimeAttackDef, false);
|
||||
else
|
||||
{
|
||||
UINT8 ssplayers = cv_splitplayers.value-1;
|
||||
INT16 map = start;
|
||||
INT16 add = levellist.cursor;
|
||||
|
||||
netgame = false;
|
||||
multiplayer = true;
|
||||
|
||||
strncpy(connectedservername, cv_servername.string, MAXSERVERNAME);
|
||||
|
||||
// Still need to reset devmode
|
||||
cv_debug = 0;
|
||||
|
||||
if (strlen(cv_dummyjoinpassword.string) > 0)
|
||||
D_SetJoinPassword(cv_dummyjoinpassword.string);
|
||||
else
|
||||
joinpasswordset = false;
|
||||
|
||||
if (demo.playback)
|
||||
G_StopDemo();
|
||||
if (metalrecording)
|
||||
G_StopMetalDemo();
|
||||
|
||||
if (!cv_nextmap.value)
|
||||
CV_SetValue(&cv_nextmap, G_RandMap(G_TOLFlag(cv_newgametype.value), -1, false, 0, false, NULL)+1);
|
||||
|
||||
if (cv_maxplayers.value < ssplayers+1)
|
||||
CV_SetValue(&cv_maxplayers, ssplayers+1);
|
||||
|
||||
if (splitscreen != ssplayers)
|
||||
while (add > 0)
|
||||
{
|
||||
splitscreen = ssplayers;
|
||||
SplitScreen_OnChange();
|
||||
map++;
|
||||
|
||||
while (!M_CanShowLevelInList(map, levellist.newgametype) && map < NUMMAPS)
|
||||
map++;
|
||||
|
||||
if (map >= NUMMAPS)
|
||||
break;
|
||||
|
||||
add--;
|
||||
}
|
||||
|
||||
paused = false;
|
||||
SV_StartSinglePlayerServer();
|
||||
multiplayer = true; // yeah, SV_StartSinglePlayerServer clobbers this...
|
||||
D_MapChange(cv_nextmap.value, cv_newgametype.value, (cv_kartencore.value == 1), 1, 1, false, false);
|
||||
if (map >= NUMMAPS)
|
||||
break;
|
||||
|
||||
M_ClearMenus(true);
|
||||
levellist.choosemap = map;
|
||||
|
||||
if (levellist.timeattack)
|
||||
{
|
||||
M_SetupNextMenu(&PLAY_TimeAttackDef, false);
|
||||
S_StartSound(NULL, sfx_s3k63);
|
||||
}
|
||||
else
|
||||
{
|
||||
UINT8 ssplayers = cv_splitplayers.value-1;
|
||||
|
||||
netgame = false;
|
||||
multiplayer = true;
|
||||
|
||||
strncpy(connectedservername, cv_servername.string, MAXSERVERNAME);
|
||||
|
||||
// Still need to reset devmode
|
||||
cv_debug = 0;
|
||||
|
||||
if (strlen(cv_dummyjoinpassword.string) > 0)
|
||||
D_SetJoinPassword(cv_dummyjoinpassword.string);
|
||||
else
|
||||
joinpasswordset = false;
|
||||
|
||||
if (demo.playback)
|
||||
G_StopDemo();
|
||||
if (metalrecording)
|
||||
G_StopMetalDemo();
|
||||
|
||||
/*if (levellist.choosemap == 0)
|
||||
levellist.choosemap = G_RandMap(G_TOLFlag(levellist.newgametype), -1, false, 0, false, NULL);*/
|
||||
|
||||
if (cv_maxplayers.value < ssplayers+1)
|
||||
CV_SetValue(&cv_maxplayers, ssplayers+1);
|
||||
|
||||
if (splitscreen != ssplayers)
|
||||
{
|
||||
splitscreen = ssplayers;
|
||||
SplitScreen_OnChange();
|
||||
}
|
||||
|
||||
S_StartSound(NULL, sfx_s3k63);
|
||||
|
||||
// Early fadeout to let the sound finish playing
|
||||
F_WipeStartScreen();
|
||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
|
||||
F_WipeEndScreen();
|
||||
F_RunWipe(wipedefs[wipe_level_toblack], false, "FADEMAP0", false, false);
|
||||
|
||||
paused = false;
|
||||
SV_StartSinglePlayerServer();
|
||||
multiplayer = true; // yeah, SV_StartSinglePlayerServer clobbers this...
|
||||
D_MapChange(levellist.choosemap+1, levellist.newgametype, (cv_kartencore.value == 1), 1, 1, false, false);
|
||||
|
||||
M_ClearMenus(true);
|
||||
}
|
||||
}
|
||||
S_StartSound(NULL, sfx_s3k63);
|
||||
break;
|
||||
case KEY_ESCAPE:
|
||||
if (currentMenu->prevMenu)
|
||||
|
|
@ -2319,10 +2321,20 @@ void M_LevelSelectHandler(INT32 choice)
|
|||
|
||||
void M_LevelSelectTick(void)
|
||||
{
|
||||
if (levellist_scroll.y > levellist_scroll.dest)
|
||||
levellist_scroll.y--;
|
||||
else if (levellist_scroll.y < levellist_scroll.dest)
|
||||
levellist_scroll.y++;
|
||||
UINT8 times = 1 + (abs(levellist.dest - levellist.y) / 21);
|
||||
|
||||
while (times) // increase speed as you're farther away
|
||||
{
|
||||
if (levellist.y > levellist.dest)
|
||||
levellist.y--;
|
||||
else if (levellist.y < levellist.dest)
|
||||
levellist.y++;
|
||||
|
||||
if (levellist.y == levellist.dest)
|
||||
break;
|
||||
|
||||
times--;
|
||||
}
|
||||
}
|
||||
|
||||
// =====================
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ static UINT8 cheatf_warp(void)
|
|||
if (menuactive && currentMenu != &MainDef)
|
||||
return 0; // Only on the main menu!
|
||||
|
||||
// Temporarily unlock EVERYTHING.
|
||||
// Unlock EVERYTHING.
|
||||
for (i = 0; i < MAXUNLOCKABLES; i++)
|
||||
{
|
||||
if (!unlockables[i].conditionset)
|
||||
|
|
@ -120,30 +120,13 @@ static UINT8 cheatf_devmode(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
/*static cheatseq_t cheat_ultimate = {
|
||||
0, cheatf_ultimate,
|
||||
{ SCRAMBLE('u'), SCRAMBLE('l'), SCRAMBLE('t'), SCRAMBLE('i'), SCRAMBLE('m'), SCRAMBLE('a'), SCRAMBLE('t'), SCRAMBLE('e'), 0xff }
|
||||
};*/
|
||||
|
||||
/*static cheatseq_t cheat_ultimate_joy = {
|
||||
0, cheatf_ultimate,
|
||||
{ SCRAMBLE(KEY_UPARROW), SCRAMBLE(KEY_UPARROW), SCRAMBLE(KEY_DOWNARROW), SCRAMBLE(KEY_DOWNARROW),
|
||||
SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_RIGHTARROW), SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_RIGHTARROW),
|
||||
SCRAMBLE(KEY_ENTER), 0xff }
|
||||
};*/
|
||||
|
||||
static cheatseq_t cheat_warp = {
|
||||
0, cheatf_warp,
|
||||
//{ SCRAMBLE('r'), SCRAMBLE('e'), SCRAMBLE('d'), SCRAMBLE('x'), SCRAMBLE('v'), SCRAMBLE('i'), 0xff }
|
||||
{ SCRAMBLE('b'), SCRAMBLE('a'), SCRAMBLE('n'), SCRAMBLE('a'), SCRAMBLE('n'), SCRAMBLE('a'), 0xff }
|
||||
};
|
||||
|
||||
static cheatseq_t cheat_warp_joy = {
|
||||
0, cheatf_warp,
|
||||
/*{ SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_UPARROW),
|
||||
SCRAMBLE(KEY_RIGHTARROW), SCRAMBLE(KEY_RIGHTARROW), SCRAMBLE(KEY_UPARROW),
|
||||
SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_UPARROW),
|
||||
SCRAMBLE(KEY_ENTER), 0xff }*/
|
||||
{ SCRAMBLE(KEY_LEFTARROW), SCRAMBLE(KEY_UPARROW), SCRAMBLE(KEY_RIGHTARROW),
|
||||
SCRAMBLE(KEY_RIGHTARROW), SCRAMBLE(KEY_UPARROW), SCRAMBLE(KEY_LEFTARROW),
|
||||
SCRAMBLE(KEY_DOWNARROW), SCRAMBLE(KEY_RIGHTARROW),
|
||||
|
|
@ -239,8 +222,6 @@ boolean cht_Responder(event_t *ev)
|
|||
else
|
||||
ch = (UINT8)ev->data1;
|
||||
|
||||
//ret += cht_CheckCheat(&cheat_ultimate, (char)ch);
|
||||
//ret += cht_CheckCheat(&cheat_ultimate_joy, (char)ch);
|
||||
ret += cht_CheckCheat(&cheat_warp, (char)ch);
|
||||
ret += cht_CheckCheat(&cheat_warp_joy, (char)ch);
|
||||
#ifdef DEVELOP
|
||||
|
|
|
|||
|
|
@ -803,7 +803,7 @@ static void ST_drawLevelTitle(void)
|
|||
if (subttl[0])
|
||||
V_DrawRightAlignedString(sub + zonexpos - 8, bary+1, V_ALLOWLOWERCASE, subttl);
|
||||
//else
|
||||
//V_DrawRightAlignedString(sub + zonexpos - 8, bary+1, V_ALLOWLOWERCASE, va("%s Mode", gametype_cons_t[gametype].strvalue));
|
||||
//V_DrawRightAlignedString(sub + zonexpos - 8, bary+1, V_ALLOWLOWERCASE, va("%s Mode", Gametype_Names[gametype]));
|
||||
}
|
||||
|
||||
ttlnumxpos += sub;
|
||||
|
|
|
|||
|
|
@ -347,10 +347,11 @@ void Y_IntermissionDrawer(void)
|
|||
#endif
|
||||
else
|
||||
{
|
||||
if (widebgpatch && rendermode == render_soft && vid.width / vid.dupx == 400)
|
||||
V_DrawScaledPatch(0, 0, V_SNAPTOLEFT, widebgpatch);
|
||||
else
|
||||
V_DrawScaledPatch(0, 0, 0, bgpatch);
|
||||
V_DrawFixedPatch(0, 0, FRACUNIT, 0, bgpatch, NULL);
|
||||
|
||||
// draw non-green resolution border
|
||||
if (widebgpatch && ((vid.width % BASEVIDWIDTH != 0) || (vid.height % BASEVIDHEIGHT != 0)))
|
||||
V_DrawFixedPatch(0, 0, FRACUNIT, 0, widebgpatch, NULL);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -775,8 +776,8 @@ static void Y_UpdateRecordReplays(void)
|
|||
G_SaveGameData(false);
|
||||
|
||||
// Update timeattack menu's replay availability.
|
||||
CV_AddValue(&cv_nextmap, 1);
|
||||
CV_AddValue(&cv_nextmap, -1);
|
||||
//CV_AddValue(&cv_nextmap, 1);
|
||||
//CV_AddValue(&cv_nextmap, -1);
|
||||
}
|
||||
|
||||
//
|
||||
|
|
@ -869,12 +870,11 @@ void Y_StartIntermission(void)
|
|||
break;
|
||||
}
|
||||
|
||||
//if (intertype == int_race || intertype == int_match)
|
||||
{
|
||||
//bgtile = W_CachePatchName("SRB2BACK", PU_STATIC);
|
||||
usetile = useinterpic = false;
|
||||
usebuffer = true;
|
||||
}
|
||||
|
||||
bgpatch = W_CachePatchName("MENUBG", PU_STATIC);
|
||||
widebgpatch = W_CachePatchName("WEIRDRES", PU_STATIC);
|
||||
|
||||
useinterpic = usetile = usebuffer = false;
|
||||
}
|
||||
|
||||
// ======
|
||||
|
|
@ -1519,7 +1519,7 @@ void Y_StartVote(void)
|
|||
// set up the gtc and gts
|
||||
levelinfo[i].gtc = G_GetGametypeColor(votelevels[i][1]);
|
||||
if (i == 2 && votelevels[i][1] != votelevels[0][1])
|
||||
levelinfo[i].gts = gametype_cons_t[votelevels[i][1]].strvalue;
|
||||
levelinfo[i].gts = Gametype_Names[votelevels[i][1]];
|
||||
else
|
||||
levelinfo[i].gts = NULL;
|
||||
|
||||
|
|
|
|||
|
|
@ -9,8 +9,6 @@
|
|||
/// \file y_inter.h
|
||||
/// \brief Tally screens, or "Intermissions" as they were formally called in Doom
|
||||
|
||||
extern boolean usebuffer;
|
||||
|
||||
void Y_IntermissionDrawer(void);
|
||||
void Y_Ticker(void);
|
||||
void Y_StartIntermission(void);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue