Merge pull request 'Unhardcode Menus' (#32) from socmenus into blankart-dev
Reviewed-on: https://codeberg.org/NepDisk/blankart/pulls/32
This commit is contained in:
commit
6d4e165fe0
33 changed files with 1822 additions and 4245 deletions
40
extras/testms.py
Normal file
40
extras/testms.py
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
# connection menu testing script
|
||||
# "masterserver http://localhost:12345" in console
|
||||
# i know nothing about HTTP
|
||||
|
||||
import http.server
|
||||
|
||||
# just enough for two pages...
|
||||
fakeserverlist = """\
|
||||
localhost 5029 Discord: Jeffma Balls#6942
|
||||
localhost 5030 Discord: Jeffma Balls#6942
|
||||
localhost 5031 Discord: Jeffma Balls#6942
|
||||
localhost 5032 Discord: Jeffma Balls#6942
|
||||
localhost 5033 Discord: Jeffma Balls#6942
|
||||
localhost 5034 Discord: Jeffma Balls#6942
|
||||
localhost 5035 Discord: Jeffma Balls#6942
|
||||
localhost 5036 Discord: Jeffma Balls#6942
|
||||
localhost 5037 Discord: Jeffma Balls#6942
|
||||
localhost 5038 Discord: Jeffma Balls#6942
|
||||
localhost 5039 Discord: Jeffma Balls#6942
|
||||
localhost 5040 Discord: Jeffma Balls#6942
|
||||
"""
|
||||
|
||||
class jart(http.server.BaseHTTPRequestHandler):
|
||||
def do_GET(self):
|
||||
response = ""
|
||||
if self.path.startswith("/games/SRB2Kart/version"):
|
||||
response = "11 the best version\n"
|
||||
elif self.path.startswith("/games/SRB2Kart/11/servers") or self.path.startswith("/games/SRB2Kart/10/servers"):
|
||||
response = fakeserverlist
|
||||
elif self.path.startswith("/rules"):
|
||||
response = "Do whatever lol\n\n"
|
||||
|
||||
self.send_response(200)
|
||||
self.end_headers()
|
||||
if not response:
|
||||
print("No response!?")
|
||||
self.wfile.write(bytes(response, "utf-8"))
|
||||
|
||||
server = http.server.HTTPServer(("localhost", 12345), jart)
|
||||
server.serve_forever()
|
||||
|
|
@ -1624,7 +1624,19 @@ static void Setvalue(consvar_t *var, const char *valstr, boolean stealth)
|
|||
|
||||
const char *overridestr = valstr;
|
||||
|
||||
if (CV_CompleteValue(var, &overridestr, &overrideval))
|
||||
if (mainwads == 0 && var->PossibleValue == Color_cons_t)
|
||||
{
|
||||
override = true;
|
||||
if (!strcmp(valstr, "Blue"))
|
||||
overrideval = SKINCOLOR_BLUE;
|
||||
else if (!strcmp(valstr, "Orange"))
|
||||
overrideval = SKINCOLOR_ORANGE;
|
||||
else if (!strcmp(valstr, "Red"))
|
||||
overrideval = SKINCOLOR_RED;
|
||||
else
|
||||
I_Error("Sorry, you need to add %s to the list of skincolors in Setvalue", valstr);
|
||||
}
|
||||
else if (CV_CompleteValue(var, &overridestr, &overrideval))
|
||||
{
|
||||
if (overridestr)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ static CV_PossibleValue_t backcolor_cons_t[] = {{0, "White"}, {1, "Black"}, {
|
|||
{15,"Periwinkle"}, {16,"Blue"}, {17,"Purple"},
|
||||
{18,"Lavender"},
|
||||
{0, NULL}};
|
||||
consvar_t cons_backcolor = CVAR_INIT ("con_backcolor", "Black", CV_CALL|CV_SAVE, backcolor_cons_t, CONS_backcolor_Change);
|
||||
consvar_t cons_backcolor = CVAR_INIT ("con_backcolor", "Black", CV_CALL|CV_NOINIT|CV_SAVE, backcolor_cons_t, CONS_backcolor_Change);
|
||||
|
||||
static CV_PossibleValue_t menuhighlight_cons_t[] =
|
||||
{
|
||||
|
|
@ -254,7 +254,7 @@ static void CONS_Bind_f(void)
|
|||
CONS_Printf("\x82%s", M_GetText("Bind table :\n"));
|
||||
na = 0;
|
||||
for (key = 0; key < NUMINPUTS; key++)
|
||||
if (!menuactive && bindtable[key])
|
||||
if (!menustack[0] && bindtable[key])
|
||||
{
|
||||
CONS_Printf("%s : \"%s\"\n", G_KeynumToString(key), bindtable[key]);
|
||||
na = 1;
|
||||
|
|
@ -461,38 +461,38 @@ void CON_Init(void)
|
|||
con_destlines = vid.height;
|
||||
con_curlines = vid.height;
|
||||
|
||||
Unlock_state();
|
||||
|
||||
if (!dedicated)
|
||||
{
|
||||
Lock_state();
|
||||
|
||||
con_started = true;
|
||||
con_startup = true;
|
||||
consoletoggle = false;
|
||||
|
||||
Unlock_state();
|
||||
|
||||
CV_RegisterVar(&cons_msgtimeout);
|
||||
CV_RegisterVar(&cons_hudlines);
|
||||
CV_RegisterVar(&cons_speed);
|
||||
CV_RegisterVar(&cons_height);
|
||||
CV_RegisterVar(&cons_backpic);
|
||||
CV_RegisterVar(&cons_backcolor);
|
||||
CV_RegisterVar(&cons_menuhighlight);
|
||||
COM_AddCommand("bind", CONS_Bind_f);
|
||||
}
|
||||
else
|
||||
{
|
||||
Lock_state();
|
||||
|
||||
con_started = true;
|
||||
con_startup = false;
|
||||
consoletoggle = true;
|
||||
|
||||
Unlock_state();
|
||||
}
|
||||
|
||||
Unlock_state();
|
||||
}
|
||||
|
||||
void CON_Register(void)
|
||||
{
|
||||
if (dedicated)
|
||||
return;
|
||||
|
||||
CV_RegisterVar(&cons_msgtimeout);
|
||||
CV_RegisterVar(&cons_hudlines);
|
||||
CV_RegisterVar(&cons_speed);
|
||||
CV_RegisterVar(&cons_height);
|
||||
CV_RegisterVar(&cons_backpic);
|
||||
CV_RegisterVar(&cons_backcolor);
|
||||
CV_RegisterVar(&cons_menuhighlight);
|
||||
COM_AddCommand("bind", CONS_Bind_f);
|
||||
}
|
||||
|
||||
// Console input initialization
|
||||
//
|
||||
static void CON_InputInit(void)
|
||||
|
|
@ -978,7 +978,7 @@ boolean CON_Responder(event_t *ev)
|
|||
// check other keys only if console prompt is active
|
||||
if (!consoleready && key < NUMINPUTS) // metzgermeister: boundary check!!
|
||||
{
|
||||
if (! menuactive && bindtable[key])
|
||||
if (!menustack[0] && bindtable[key])
|
||||
{
|
||||
COM_BufAddText(bindtable[key]);
|
||||
COM_BufAddText("\n");
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
void CON_Init(void);
|
||||
void CON_Register(void);
|
||||
|
||||
boolean CON_Responder(event_t *ev);
|
||||
|
||||
|
|
|
|||
|
|
@ -577,7 +577,7 @@ static inline void CL_DrawConnectionStatus(void)
|
|||
INT32 ccstime = I_GetTime();
|
||||
|
||||
// Draw background fade
|
||||
if (!menuactive) // menu already draws its own fade
|
||||
if (!menustack[0]) // menu already draws its own fade
|
||||
V_DrawFadeScreen(0xFF00, 16); // force default
|
||||
|
||||
if (cl_mode != CL_DOWNLOADFILES && cl_mode != CL_LOADFILES && cl_mode != CL_CHECKFILES
|
||||
|
|
@ -1590,7 +1590,7 @@ static boolean CL_FinishedFileList(void)
|
|||
"You may load server addons (if any), and wait for a slot.\n"
|
||||
"\n"
|
||||
"Press ACCEL to continue or BRAKE to cancel.\n\n"
|
||||
), FUNCPTRCAST (M_ConfirmConnect), MM_EVENTHANDLER);
|
||||
), M_ConfirmConnect, MM_EVENTHANDLER);
|
||||
cl_mode = CL_CONFIRMCONNECT;
|
||||
}
|
||||
else
|
||||
|
|
@ -1651,13 +1651,13 @@ static boolean CL_FinishedFileList(void)
|
|||
"You may download, load server addons, and wait for a slot.\n"
|
||||
"\n"
|
||||
"Press ACCEL to continue or BRAKE to cancel.\n\n"
|
||||
), downloadsize), FUNCPTRCAST(M_ConfirmConnect), MM_EVENTHANDLER);
|
||||
), downloadsize), M_ConfirmConnect, MM_EVENTHANDLER);
|
||||
else
|
||||
M_StartMessage(va(M_GetText(
|
||||
"Download of %s additional content is required to join.\n"
|
||||
"\n"
|
||||
"Press ACCEL to continue or BRAKE to cancel.\n\n"
|
||||
), downloadsize), FUNCPTRCAST(M_ConfirmConnect), MM_EVENTHANDLER);
|
||||
), downloadsize), M_ConfirmConnect, MM_EVENTHANDLER);
|
||||
|
||||
Z_Free(downloadsize);
|
||||
cl_mode = CL_CONFIRMCONNECT;
|
||||
|
|
|
|||
|
|
@ -1062,8 +1062,6 @@ void D_StartTitle(void)
|
|||
|
||||
F_StartTitleScreen();
|
||||
|
||||
currentMenu = &MainDef; // reset the current menu ID
|
||||
|
||||
// Reset the palette
|
||||
if (rendermode != render_none)
|
||||
V_SetPaletteLump("PLAYPAL");
|
||||
|
|
@ -1451,6 +1449,27 @@ void D_SRB2Main(void)
|
|||
// Have to be done here before files are loaded
|
||||
M_InitCharacterTables();
|
||||
|
||||
D_RegisterServerCommands();
|
||||
D_RegisterClientCommands(); // be sure that this is called before D_CheckNetGame
|
||||
R_RegisterEngineStuff();
|
||||
S_RegisterSoundStuff();
|
||||
CON_Register();
|
||||
M_Init();
|
||||
if (!dedicated)
|
||||
{
|
||||
CV_RegisterVar(&cv_ticrate);
|
||||
CV_RegisterVar(&cv_constextsize);
|
||||
}
|
||||
|
||||
I_RegisterSysCommands();
|
||||
|
||||
#ifdef HWRENDER
|
||||
// Lactozilla: Add every hardware mode CVAR and CCMD.
|
||||
// Has to be done before the configuration file loads,
|
||||
// ~~but after the OpenGL library loads.~~ G: no lol
|
||||
HWR_AddCommands();
|
||||
#endif
|
||||
|
||||
// load wad, including the main wad file
|
||||
CONS_Printf("W_InitMultipleFiles(): Adding IWAD and main PWADs.\n");
|
||||
W_InitMultipleFiles(startupiwads, false);
|
||||
|
|
@ -1512,13 +1531,6 @@ void D_SRB2Main(void)
|
|||
CONS_Printf("I_StartupGraphics()...\n");
|
||||
I_StartupGraphics();
|
||||
|
||||
#ifdef HWRENDER
|
||||
// Lactozilla: Add every hardware mode CVAR and CCMD.
|
||||
// Has to be done before the configuration file loads,
|
||||
// but after the OpenGL library loads.
|
||||
HWR_AddCommands();
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------- CONSOLE
|
||||
// setup loading screen
|
||||
SCR_Startup();
|
||||
|
|
@ -1538,13 +1550,6 @@ void D_SRB2Main(void)
|
|||
|
||||
timelimits[GT_BATTLE] = 2;
|
||||
|
||||
D_RegisterServerCommands();
|
||||
D_RegisterClientCommands(); // be sure that this is called before D_CheckNetGame
|
||||
R_RegisterEngineStuff();
|
||||
S_RegisterSoundStuff();
|
||||
|
||||
I_RegisterSysCommands();
|
||||
|
||||
CON_SetLoadingProgress(LOADED_HUINIT);
|
||||
|
||||
CONS_Printf("W_InitMultipleFiles(): Adding external PWADs.\n");
|
||||
|
|
@ -1571,8 +1576,6 @@ void D_SRB2Main(void)
|
|||
//--------------------------------------------------------- CONFIG.CFG
|
||||
M_FirstLoadConfig(); // WARNING : this do a "COM_BufExecute()"
|
||||
|
||||
M_Init();
|
||||
|
||||
#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL)
|
||||
VID_PrepareModeList(); // Regenerate Modelist according to cv_fullscreen
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -3314,7 +3314,7 @@ static void Got_Pause(UINT8 **cp, INT32 playernum)
|
|||
|
||||
if (paused)
|
||||
{
|
||||
if (!menuactive || netgame)
|
||||
if (!menustack[0] || netgame)
|
||||
S_PauseAudio();
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -197,6 +197,21 @@ static inline int lib_freeslot(lua_State *L)
|
|||
CONS_Alert(CONS_WARNING, "Ran out of free PRECIP slots!\n");
|
||||
}
|
||||
}
|
||||
else if (fastcmp(type, "MN"))
|
||||
{
|
||||
menutype_t i;
|
||||
for (i = 0; i < NUMMENUFREESLOTS; i++)
|
||||
if (!FREE_MENUS[i]) {
|
||||
CONS_Printf("Menu MN_%s allocated.\n",word);
|
||||
FREE_MENUS[i] = Z_Malloc(strlen(word)+1, PU_STATIC, NULL);
|
||||
strcpy(FREE_MENUS[i],word);
|
||||
lua_pushinteger(L, MN_FIRSTFREESLOT + i);
|
||||
r++;
|
||||
break;
|
||||
}
|
||||
if (i == NUMMENUFREESLOTS)
|
||||
CONS_Alert(CONS_WARNING, "Ran out of free menu slots!\n");
|
||||
}
|
||||
Z_Free(s);
|
||||
lua_remove(L, 1);
|
||||
continue;
|
||||
|
|
@ -608,7 +623,15 @@ static int ScanConstants(lua_State *L, boolean mathlib, const char *word)
|
|||
}
|
||||
else if (fastncmp("MN_",word,3)) {
|
||||
p = word+3;
|
||||
for (i = 0; i < NUMMENUTYPES; i++)
|
||||
for (i = 0; i < NUMMENUFREESLOTS; i++) {
|
||||
if (!FREE_MENUS[i])
|
||||
break;
|
||||
if (fastcmp(p, FREE_MENUS[i])) {
|
||||
CacheAndPushConstant(L, word, MN_FIRSTFREESLOT+i);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
for (i = 0; i < MN_FIRSTFREESLOT; i++)
|
||||
if (fastcmp(p, MENUTYPES_LIST[i])) {
|
||||
CacheAndPushConstant(L, word, i);
|
||||
return 1;
|
||||
|
|
|
|||
329
src/deh_soc.c
329
src/deh_soc.c
|
|
@ -534,6 +534,16 @@ void readfreeslots(MYFILE *f)
|
|||
} else
|
||||
deh_warning("Ran out of free PRECIP slots!\n");
|
||||
}
|
||||
else if (fastcmp(type, "MN"))
|
||||
{
|
||||
for (i = 0; i < NUMMENUFREESLOTS; i++)
|
||||
if (!FREE_MENUS[i]) {
|
||||
CONS_Printf("Menu MN_%s allocated.\n",word);
|
||||
FREE_MENUS[i] = Z_Malloc(strlen(word)+1, PU_STATIC, NULL);
|
||||
strcpy(FREE_MENUS[i],word);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
deh_warning("Freeslots: unknown enum class '%s' for '%s_%s'", type, type, word);
|
||||
}
|
||||
|
|
@ -2135,6 +2145,220 @@ void readtextprompt(MYFILE *f, INT32 num)
|
|||
Z_Free(s);
|
||||
}
|
||||
|
||||
static menu_t *allocmenu(INT32 num)
|
||||
{
|
||||
if (num < 0 || num >= NUMMENUTYPES)
|
||||
I_Error("Tried to allocate out-of-range menu number");
|
||||
|
||||
menu_t *menu = menudefs[num];
|
||||
if (menu == NULL)
|
||||
{
|
||||
menudefs[num] = menu = Z_Calloc(sizeof(menu_t), PU_STATIC, NULL);
|
||||
menu->drawroutine = M_DrawGenericMenu;
|
||||
}
|
||||
|
||||
return menu;
|
||||
}
|
||||
|
||||
// super secret menu cvars... :shushing_face:
|
||||
static struct { const char *name; consvar_t *var; } HIDDENVARS[] = {
|
||||
{ "CHOOSESKIN", &cv_chooseskin },
|
||||
{ "DUMMYGPDIFFICULTY", &cv_dummygpdifficulty },
|
||||
{ "DUMMYGPENCORE", &cv_dummygpencore },
|
||||
{ "DUMMYGPCUP", &cv_dummygpcup },
|
||||
{ "NEXTMAP", &cv_nextmap },
|
||||
{ "NEWGAMETYPE", &cv_newgametype },
|
||||
{ "DUMMYRINGS", &cv_dummyrings },
|
||||
{ "DUMMYLIVES", &cv_dummylives },
|
||||
{ "DUMMYMENUPLAYER", &cv_dummymenuplayer },
|
||||
{ "DUMMYTEAM", &cv_dummyteam },
|
||||
{ "DUMMYSPECTATE", &cv_dummyspectate },
|
||||
{ "DUMMYSCRAMBLE", &cv_dummyscramble },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
#define WARN(str, ...) deh_warning("MenuItem " ITEMNAMEFMT ": " str, menuitem->itemname, __VA_ARGS__)
|
||||
#define WARN0(str) deh_warning("MenuItem " ITEMNAMEFMT ": " str, menuitem->itemname)
|
||||
static void readmenuitem(MYFILE *f, menuitem_t *menuitem)
|
||||
{
|
||||
char *s = Z_Malloc(MAXLINELEN, PU_STATIC, NULL);
|
||||
char *word = s;
|
||||
char *word2;
|
||||
char *tmp;
|
||||
|
||||
UINT16 status = 0;
|
||||
boolean actionset = false;
|
||||
boolean textset = false;
|
||||
|
||||
// taking quite possibly the only opportunity i'll ever get
|
||||
// to avoid three tabs of indentation...
|
||||
do if (myfgets(s, MAXLINELEN, f))
|
||||
{
|
||||
if (s[0] == '\n')
|
||||
break;
|
||||
|
||||
// First remove trailing newline, if there is one
|
||||
tmp = strchr(s, '\n');
|
||||
if (tmp)
|
||||
*tmp = '\0';
|
||||
|
||||
tmp = strchr(s, '#');
|
||||
if (tmp)
|
||||
*tmp = '\0';
|
||||
if (s == tmp)
|
||||
continue; // Skip comment lines, but don't break.
|
||||
|
||||
// Get the part before the " = "
|
||||
tmp = strchr(s, '=');
|
||||
if (tmp)
|
||||
*(tmp-1) = '\0';
|
||||
else
|
||||
break;
|
||||
strupr(word);
|
||||
|
||||
// Now get the part after
|
||||
word2 = tmp += 2;
|
||||
//strupr(word2);
|
||||
|
||||
if (fastcmp(word, "PATCH"))
|
||||
{
|
||||
menuitem->patch = Z_StrDup(word2);
|
||||
}
|
||||
else if (fastncmp(word, "TEXT", 4))
|
||||
{
|
||||
UINT16 flags = IT_STRING;
|
||||
if (fastcmp(word+4, "HEADER"))
|
||||
flags = IT_HEADER;
|
||||
else if (fastcmp(word+4, "SECRET"))
|
||||
flags = IT_SECRET;
|
||||
else if (fastcmp(word+4, "WHITE"))
|
||||
flags = IT_WHITESTRING;
|
||||
else if (fastcmp(word+4, "DISABLED"))
|
||||
flags = IT_DISABLED;
|
||||
else if (fastcmp(word+4, "2"))
|
||||
flags = IT_STRING2;
|
||||
else if (word[4])
|
||||
{
|
||||
WARN("unknown word '%s'", word);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (textset)
|
||||
{
|
||||
WARN0("text already set!");
|
||||
continue;
|
||||
}
|
||||
textset = true;
|
||||
status |= flags;
|
||||
menuitem->text = Z_StrDup(word2);
|
||||
}
|
||||
else if (fastncmp(word, "CVAR", 4))
|
||||
{
|
||||
UINT16 flags = IT_CVAR;
|
||||
if (fastcmp(word+4, "SLIDER"))
|
||||
flags |= IT_CV_SLIDER;
|
||||
else if (fastcmp(word+4, "STRING"))
|
||||
flags |= IT_CV_STRING;
|
||||
else if (fastcmp(word+4, "INTEGER"))
|
||||
flags |= IT_CV_INTEGERSTEP;
|
||||
else if (word[4])
|
||||
{
|
||||
WARN("unknown word '%s'", word);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (actionset)
|
||||
{
|
||||
WARN0("action already set!");
|
||||
continue;
|
||||
}
|
||||
consvar_t *cvar = CV_FindVar(word2);
|
||||
if (!cvar)
|
||||
for (size_t i = 0; HIDDENVARS[i].name; i++)
|
||||
if (fasticmp(word2, HIDDENVARS[i].name))
|
||||
{
|
||||
cvar = HIDDENVARS[i].var;
|
||||
break;
|
||||
}
|
||||
if (!cvar)
|
||||
{
|
||||
WARN("unable to find cvar '%s'", word2);
|
||||
continue;
|
||||
}
|
||||
actionset = true;
|
||||
status |= flags;
|
||||
menuitem->itemaction.cvar = cvar;
|
||||
}
|
||||
else if (fastcmp(word, "SUBMENU"))
|
||||
{
|
||||
if (actionset)
|
||||
{
|
||||
WARN0("action already set!");
|
||||
continue;
|
||||
}
|
||||
menutype_t mn = get_menutype(word2);
|
||||
if (mn == MN_NONE)
|
||||
{
|
||||
WARN("unknown menu '%s'", word2);
|
||||
continue;
|
||||
}
|
||||
actionset = true;
|
||||
status |= IT_SUBMENU;
|
||||
allocmenu(mn);
|
||||
menuitem->itemaction.submenu = mn;
|
||||
}
|
||||
else if (fastncmp(word, "CALL", 4) || fastcmp(word, "KEYHANDLER") || fastcmp(word, "ARROWS"))
|
||||
{
|
||||
UINT16 flags;
|
||||
if (word[0] == 'C')
|
||||
{
|
||||
flags = IT_CALL;
|
||||
if (fastcmp(word+4, "NOTMODIFIED"))
|
||||
flags |= IT_CALL_NOTMODIFIED;
|
||||
else if (word[4])
|
||||
{
|
||||
WARN("unknown word '%s'", word);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else if (word[0] == 'K')
|
||||
flags = IT_KEYHANDLER;
|
||||
else if (word[0] == 'A')
|
||||
flags = IT_ARROWS;
|
||||
else
|
||||
I_Error("bruh"); // i should probably just make "CALL" the stem for all of these
|
||||
|
||||
if (actionset)
|
||||
{
|
||||
WARN0("action already set!");
|
||||
continue;
|
||||
}
|
||||
void (*routine)(INT32) = get_menuroutine(word2);
|
||||
if (!routine)
|
||||
{
|
||||
WARN("unknown call routine '%s'", word2);
|
||||
continue;
|
||||
}
|
||||
actionset = true;
|
||||
status |= flags;
|
||||
menuitem->itemaction.routine = routine;
|
||||
}
|
||||
else if (fastcmp(word, "ALPHAKEY") || fastcmp(word, "Y"))
|
||||
{
|
||||
menuitem->alphaKey = get_number(word2);
|
||||
}
|
||||
else
|
||||
WARN("unknown word '%s'", word);
|
||||
}
|
||||
while (!myfeof(f)); // finish when the line is empty
|
||||
|
||||
menuitem->status = status;
|
||||
Z_Free(s);
|
||||
}
|
||||
#undef WARN
|
||||
#undef WARN0
|
||||
|
||||
#define WARN(str, ...) deh_warning("Menu %s: " str, num < MN_FIRSTFREESLOT ? MENUTYPES_LIST[num] : FREE_MENUS[num - MN_FIRSTFREESLOT], __VA_ARGS__)
|
||||
void readmenu(MYFILE *f, INT32 num)
|
||||
{
|
||||
char *s = Z_Malloc(MAXLINELEN, PU_STATIC, NULL);
|
||||
|
|
@ -2143,6 +2367,8 @@ void readmenu(MYFILE *f, INT32 num)
|
|||
char *tmp;
|
||||
INT32 value;
|
||||
|
||||
menu_t *menudef = allocmenu(num);
|
||||
|
||||
do
|
||||
{
|
||||
if (myfgets(s, MAXLINELEN, f))
|
||||
|
|
@ -2166,7 +2392,40 @@ void readmenu(MYFILE *f, INT32 num)
|
|||
if (tmp)
|
||||
*(tmp-1) = '\0';
|
||||
else
|
||||
break;
|
||||
{
|
||||
// ...or get the word after the space. yay special syntax!
|
||||
word2 = strchr(s, ' ');
|
||||
if (word2)
|
||||
{
|
||||
*word2++ = '\0';
|
||||
if (*word2 == '\0' || *word2 == ' ') // trailing space(s) after MenuItem doesn't count
|
||||
word2 = NULL;
|
||||
else
|
||||
strupr(word2);
|
||||
}
|
||||
strupr(word);
|
||||
|
||||
if (fastcmp(word, "MENUITEM"))
|
||||
{
|
||||
if (word2 && strlen(word2) > ITEMNAMELEN)
|
||||
{
|
||||
WARN("item name %s is too long (max %d characters)", word2, ITEMNAMELEN);
|
||||
continue;
|
||||
}
|
||||
menuitem_t *item = word2 ? M_CheckMenuItem(num, word2) : NULL;
|
||||
if (item == NULL)
|
||||
{
|
||||
menudef->menuitems = Z_Realloc(menudef->menuitems, sizeof(menuitem_t)*(menudef->numitems+1), PU_STATIC, NULL);
|
||||
item = menudef->menuitems + menudef->numitems++;
|
||||
strncpy(item->itemname, word2 ? word2 : "", ITEMNAMELEN);
|
||||
item->text = "";
|
||||
}
|
||||
readmenuitem(f, item);
|
||||
}
|
||||
else
|
||||
WARN("unknown word '%s'", word);
|
||||
continue;
|
||||
}
|
||||
strupr(word);
|
||||
|
||||
// Now get the part after
|
||||
|
|
@ -2315,11 +2574,47 @@ void readmenu(MYFILE *f, INT32 num)
|
|||
menupres[num].exitwipe = get_number(word2);
|
||||
titlechanged = true;
|
||||
}
|
||||
// MENUDEF STARTS HERE
|
||||
else if (fastcmp(word, "HEADERPIC"))
|
||||
{
|
||||
menudef->headerpic = Z_StrDup(word2);
|
||||
}
|
||||
else if (fastcmp(word, "DRAWROUTINE"))
|
||||
{
|
||||
void (*drawer)(void) = get_menudrawer(word2);
|
||||
if (drawer == NULL)
|
||||
{
|
||||
WARN("unknown draw routine '%s'", word2);
|
||||
continue;
|
||||
}
|
||||
menudef->drawroutine = drawer;
|
||||
}
|
||||
else if (fastcmp(word, "X"))
|
||||
{
|
||||
menudef->x = value;
|
||||
}
|
||||
else if (fastcmp(word, "Y"))
|
||||
{
|
||||
menudef->y = value;
|
||||
}
|
||||
else if (fastcmp(word, "QUITROUTINE"))
|
||||
{
|
||||
void (*routine)(INT32) = get_menuroutine(word2);
|
||||
if (!routine)
|
||||
{
|
||||
WARN("unknown quit routine '%s'", word2);
|
||||
continue;
|
||||
}
|
||||
menudef->quitroutine = routine;
|
||||
}
|
||||
else
|
||||
WARN("unknown word '%s'", word);
|
||||
}
|
||||
} while (!myfeof(f)); // finish when the line is empty
|
||||
|
||||
Z_Free(s);
|
||||
}
|
||||
#undef WARN
|
||||
|
||||
void readframe(MYFILE *f, INT32 num)
|
||||
{
|
||||
|
|
@ -4061,13 +4356,43 @@ menutype_t get_menutype(const char *word)
|
|||
return atoi(word);
|
||||
if (fastncmp("MN_",word,3))
|
||||
word += 3; // take off the MN_
|
||||
for (i = 0; i < NUMMENUTYPES; i++)
|
||||
for (i = 0; i < NUMMENUFREESLOTS; i++) {
|
||||
if (!FREE_MENUS[i])
|
||||
break;
|
||||
if (fastcmp(word, FREE_MENUS[i]))
|
||||
return MN_FIRSTFREESLOT+i;
|
||||
}
|
||||
for (i = 0; i < MN_FIRSTFREESLOT; i++)
|
||||
if (fastcmp(word, MENUTYPES_LIST[i]))
|
||||
return i;
|
||||
deh_warning("Couldn't find menutype named 'MN_%s'",word);
|
||||
return MN_NONE;
|
||||
}
|
||||
|
||||
void (*get_menuroutine(const char *word))(INT32)
|
||||
{ // Returns the value of MR_ enumerations
|
||||
size_t i;
|
||||
if (fastncmp("MR_",word,3))
|
||||
word += 3; // take off the MR_
|
||||
for (i = 0; MENU_ROUTINES[i].name; i++)
|
||||
if (fasticmp(word, MENU_ROUTINES[i].name))
|
||||
return MENU_ROUTINES[i].routine;
|
||||
deh_warning("Couldn't find menu routine named 'MR_%s'",word);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void (*get_menudrawer(const char *word))(void)
|
||||
{ // Returns the value of MD_ enumerations
|
||||
size_t i;
|
||||
if (fastncmp("MD_",word,3))
|
||||
word += 3; // take off the MD_
|
||||
for (i = 0; MENU_DRAWERS[i].name; i++)
|
||||
if (fasticmp(word, MENU_DRAWERS[i].name))
|
||||
return MENU_DRAWERS[i].drawer;
|
||||
deh_warning("Couldn't find menu drawer named 'MD_%s'",word);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*static INT16 get_gametype(const char *word)
|
||||
{ // Returns the value of GT_ enumerations
|
||||
INT16 i;
|
||||
|
|
|
|||
|
|
@ -57,6 +57,8 @@ spritenum_t get_sprite(const char *word);
|
|||
playersprite_t get_sprite2(const char *word);
|
||||
sfxenum_t get_sfx(const char *word);
|
||||
menutype_t get_menutype(const char *word);
|
||||
void (*get_menuroutine(const char *word))(INT32);
|
||||
void (*get_menudrawer(const char *word))(void);
|
||||
//INT16 get_gametype(const char *word);
|
||||
//powertype_t get_power(const char *word);
|
||||
skincolornum_t get_skincolor(const char *word);
|
||||
|
|
|
|||
260
src/deh_tables.c
260
src/deh_tables.c
|
|
@ -27,12 +27,14 @@
|
|||
#include "r_data.h" // patchalphastyle_t
|
||||
#include "k_boss.h" // spottype_t (for lua)
|
||||
#include "k_follower.h" // followermode_t (for lua)
|
||||
#include "g_input.h" // Game controls (for lua)
|
||||
|
||||
#include "deh_tables.h"
|
||||
|
||||
char *FREE_STATES[NUMSTATEFREESLOTS];
|
||||
char *FREE_MOBJS[NUMMOBJFREESLOTS];
|
||||
char *FREE_SKINCOLORS[NUMCOLORFREESLOTS];
|
||||
char *FREE_MENUS[NUMMENUFREESLOTS];
|
||||
UINT8 used_spr[(NUMSPRITEFREESLOTS / 8) + 1]; // Bitwise flag for sprite freeslot in use! I would use ceil() here if I could, but it only saves 1 byte of memory anyway.
|
||||
|
||||
struct flickytypes_s FLICKYTYPES[] = {
|
||||
|
|
@ -606,98 +608,136 @@ const char *const HUDITEMS_LIST[] = {
|
|||
};
|
||||
|
||||
const char *const MENUTYPES_LIST[] = {
|
||||
"NONE",
|
||||
#define _(name, ...) #name,
|
||||
#include "info/menus.h"
|
||||
#undef _
|
||||
};
|
||||
|
||||
"MAIN",
|
||||
struct menu_routine_s const MENU_ROUTINES[] = {
|
||||
{ "SINGLEPLAYERMENU", &M_SinglePlayerMenu },
|
||||
{ "OPTIONS", &M_Options },
|
||||
{ "ADDONS", &M_Addons },
|
||||
{ "QUITSRB2", &M_QuitSRB2 },
|
||||
{ "STATISTICS", &M_Statistics },
|
||||
{ "HANDLELEVELSTATS", &M_HandleLevelStats },
|
||||
{ "REPLAYHUT", &M_ReplayHut },
|
||||
{ "QUITREPLAYHUT", &M_QuitReplayHut },
|
||||
{ "HANDLEREPLAYHUTLIST", &M_HandleReplayHutList },
|
||||
{ "GRANDPRIXTEMP", &M_GrandPrixTemp },
|
||||
{ "TIMEATTACK", &M_TimeAttack },
|
||||
{ "ITEMBREAKER", &M_ItemBreaker },
|
||||
{ "STARTGRANDPRIX", &M_StartGrandPrix },
|
||||
{ "QUITTIMEATTACKMENU", &M_QuitTimeAttackMenu },
|
||||
{ "CHOOSETIMEATTACK", &M_ChooseTimeAttack },
|
||||
{ "SETGUESTREPLAY", &M_SetGuestReplay },
|
||||
{ "REPLAYTIMEATTACK", &M_ReplayTimeAttack },
|
||||
{ "HANDLESTAFFREPLAY", &M_HandleStaffReplay },
|
||||
{ "SETUPMULTIHANDLER", &M_SetupMultiHandler },
|
||||
{ "HANDLESETUPMULTIPLAYER", &M_HandleSetupMultiPlayer },
|
||||
{ "QUITMULTIPLAYERMENU", &M_QuitMultiPlayerMenu },
|
||||
{ "STARTSERVERMENU", &M_StartServerMenu },
|
||||
{ "STARTOFFLINESERVERMENU", &M_StartOfflineServerMenu },
|
||||
{ "STARTSERVER", &M_StartServer },
|
||||
{ "CONNECTMENUMODCHECKS", &M_ConnectMenuModChecks },
|
||||
{ "HANDLECONNECTIP", &M_HandleConnectIP },
|
||||
{ "CANCELCONNECT", &M_CancelConnect },
|
||||
{ "SETUP1PCONTROLSMENU", &M_Setup1PControlsMenu },
|
||||
{ "SETUP2PCONTROLSMENU", &M_Setup2PControlsMenu },
|
||||
{ "SETUP3PCONTROLSMENU", &M_Setup3PControlsMenu },
|
||||
{ "SETUP4PCONTROLSMENU", &M_Setup4PControlsMenu },
|
||||
{ "HANDLESERVERPAGE", &M_HandleServerPage },
|
||||
{ "REFRESH", &M_Refresh },
|
||||
{ "CONNECT", &M_Connect },
|
||||
{ "VIDEOMODEMENU", &M_VideoModeMenu },
|
||||
#ifdef HWRENDER
|
||||
{ "OPENGLOPTIONSMENU", &M_OpenGLOptionsMenu },
|
||||
#endif
|
||||
{ "HANDLEVIDEOMODE", &M_HandleVideoMode },
|
||||
{ "HANDLESOUNDTEST", &M_HandleSoundTest },
|
||||
{ "MUSICTEST", &M_MusicTest },
|
||||
{ "SCREENSHOTOPTIONS", &M_ScreenshotOptions },
|
||||
{ "ADDONSOPTIONS", &M_AddonsOptions },
|
||||
{ "ERASEDATA", &M_EraseData },
|
||||
{ "MANUAL", &M_Manual },
|
||||
{ "CREDITS", &M_Credits },
|
||||
{ "BLANCREDITS", &M_BlanCredits },
|
||||
{ "HANDLEADDONS", &M_HandleAddons },
|
||||
{ "SELECTABLECLEARMENUS", &M_SelectableClearMenus },
|
||||
{ "MODEATTACKRETRY", &M_ModeAttackRetry },
|
||||
{ "MODEATTACKENDGAME", &M_ModeAttackEndGame },
|
||||
{ "PANDORASBOX", &M_PandorasBox },
|
||||
{ "EMBLEMHINTS", &M_EmblemHints },
|
||||
{ "RETRY", &M_Retry },
|
||||
{ "ENDGAME", &M_EndGame },
|
||||
{ "MAPCHANGE", &M_MapChange },
|
||||
{ "SETUPMULTIPLAYER", &M_SetupMultiPlayer },
|
||||
{ "SETUPMULTIPLAYER2", &M_SetupMultiPlayer2 },
|
||||
{ "SETUPMULTIPLAYER3", &M_SetupMultiPlayer3 },
|
||||
{ "SETUPMULTIPLAYER4", &M_SetupMultiPlayer4 },
|
||||
{ "CONFIRMSPECTATE", &M_ConfirmSpectate },
|
||||
{ "CONFIRMENTERGAME", &M_ConfirmEnterGame },
|
||||
{ "EXITPANDORASBOX", &M_ExitPandorasBox },
|
||||
{ "GETALLEMERALDS", &M_GetAllEmeralds },
|
||||
{ "DESTROYROBOTS", &M_DestroyRobots },
|
||||
{ "ULTIMATECHEAT", &M_UltimateCheat },
|
||||
{ "CONFIRMTEAMSCRAMBLE", &M_ConfirmTeamScramble },
|
||||
{ "CONFIRMTEAMCHANGE", &M_ConfirmTeamChange },
|
||||
{ "CONFIRMSPECTATECHANGE", &M_ConfirmSpectateChange },
|
||||
{ "CHANGELEVEL", &M_ChangeLevel },
|
||||
{ "HUTSTARTREPLAY", &M_HutStartReplay },
|
||||
{ "PLAYBACKREWIND", &M_PlaybackRewind },
|
||||
{ "PLAYBACKPAUSE", &M_PlaybackPause },
|
||||
{ "PLAYBACKFASTFORWARD", &M_PlaybackFastForward },
|
||||
{ "PLAYBACKADVANCE", &M_PlaybackAdvance },
|
||||
{ "PLAYBACKSETVIEWS", &M_PlaybackSetViews },
|
||||
{ "PLAYBACKADJUSTVIEW", &M_PlaybackAdjustView },
|
||||
{ "PLAYBACKTOGGLEFREECAM", &M_PlaybackToggleFreecam },
|
||||
{ "PLAYBACKQUIT", &M_PlaybackQuit },
|
||||
{ "HANDLEIMAGEDEF", &M_HandleImageDef },
|
||||
{ "HANDLEMUSICTEST", &M_HandleMusicTest },
|
||||
{ "SETUP1PJOYSTICKMENU", &M_Setup1PJoystickMenu },
|
||||
{ "SETUP2PJOYSTICKMENU", &M_Setup2PJoystickMenu },
|
||||
{ "SETUP3PJOYSTICKMENU", &M_Setup3PJoystickMenu },
|
||||
{ "SETUP4PJOYSTICKMENU", &M_Setup4PJoystickMenu },
|
||||
{ "RESETCONTROLS", &M_ResetControls },
|
||||
{ "CHANGECONTROL", &M_ChangeControl },
|
||||
{ "ASSIGNJOYSTICK", &M_AssignJoystick },
|
||||
{ "HANDLEMONITORTOGGLES", &M_HandleMonitorToggles },
|
||||
#ifdef HAVE_DISCORDRPC
|
||||
{ "HANDLEDISCORDREQUESTS", &M_HandleDiscordRequests },
|
||||
#endif
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
// Single Player
|
||||
"SP_MAIN",
|
||||
|
||||
"SP_LOAD",
|
||||
"SP_PLAYER",
|
||||
|
||||
"SP_LEVELSELECT",
|
||||
"SP_LEVELSTATS",
|
||||
|
||||
"SP_TIMEATTACK",
|
||||
"SP_TIMEATTACK_LEVELSELECT",
|
||||
"SP_GUESTREPLAY",
|
||||
"SP_REPLAY",
|
||||
"SP_GHOST",
|
||||
|
||||
"SP_NIGHTSATTACK",
|
||||
"SP_NIGHTS_LEVELSELECT",
|
||||
"SP_NIGHTS_GUESTREPLAY",
|
||||
"SP_NIGHTS_REPLAY",
|
||||
"SP_NIGHTS_GHOST",
|
||||
|
||||
// Multiplayer
|
||||
"MP_MAIN",
|
||||
"MP_SPLITSCREEN", // SplitServer
|
||||
"MP_SERVER",
|
||||
"MP_CONNECT",
|
||||
"MP_ROOM",
|
||||
"MP_PLAYERSETUP", // MP_PlayerSetupDef shared with SPLITSCREEN if #defined NONET
|
||||
"MP_SERVER_OPTIONS",
|
||||
|
||||
// Options
|
||||
"OP_MAIN",
|
||||
|
||||
"OP_P1CONTROLS",
|
||||
"OP_CHANGECONTROLS", // OP_ChangeControlsDef shared with P2
|
||||
"OP_P1MOUSE",
|
||||
"OP_P1JOYSTICK",
|
||||
"OP_JOYSTICKSET", // OP_JoystickSetDef shared with P2
|
||||
"OP_P1CAMERA",
|
||||
|
||||
"OP_P2CONTROLS",
|
||||
"OP_P2MOUSE",
|
||||
"OP_P2JOYSTICK",
|
||||
"OP_P2CAMERA",
|
||||
|
||||
"OP_PLAYSTYLE",
|
||||
|
||||
"OP_VIDEO",
|
||||
"OP_VIDEOMODE",
|
||||
"OP_COLOR",
|
||||
"OP_OPENGL",
|
||||
"OP_OPENGL_LIGHTING",
|
||||
|
||||
"OP_SOUND",
|
||||
|
||||
"OP_SERVER",
|
||||
"OP_MONITORTOGGLE",
|
||||
|
||||
"OP_DATA",
|
||||
"OP_ADDONS",
|
||||
"OP_SCREENSHOTS",
|
||||
"OP_ERASEDATA",
|
||||
|
||||
// Extras
|
||||
"SR_MAIN",
|
||||
"SR_PANDORA",
|
||||
"SR_LEVELSELECT",
|
||||
"SR_UNLOCKCHECKLIST",
|
||||
"SR_EMBLEMHINT",
|
||||
"SR_PLAYER",
|
||||
"SR_SOUNDTEST",
|
||||
|
||||
// Addons (Part of MISC, but let's make it our own)
|
||||
"AD_MAIN",
|
||||
|
||||
// MISC
|
||||
// "MESSAGE",
|
||||
// "SPAUSE",
|
||||
|
||||
// "MPAUSE",
|
||||
// "SCRAMBLETEAM",
|
||||
// "CHANGETEAM",
|
||||
// "CHANGELEVEL",
|
||||
|
||||
// "MAPAUSE",
|
||||
// "HELP",
|
||||
|
||||
"SPECIAL"
|
||||
struct menu_drawer_s const MENU_DRAWERS[] = {
|
||||
{ "DRAWGENERICMENU", &M_DrawGenericMenu },
|
||||
{ "DRAWCENTEREDMENU", &M_DrawCenteredMenu },
|
||||
{ "DRAWPAUSEMENU", &M_DrawPauseMenu },
|
||||
{ "DRAWCHECKLIST", &M_DrawChecklist },
|
||||
{ "DRAWLEVELSTATS", &M_DrawLevelStats },
|
||||
{ "DRAWREPLAYHUT", &M_DrawReplayHut },
|
||||
{ "DRAWTIMEATTACKMENU", &M_DrawTimeAttackMenu },
|
||||
{ "DRAWMPMAINMENU", &M_DrawMPMainMenu },
|
||||
{ "DRAWSETUPMULTIPLAYERMENU", &M_DrawSetupMultiPlayerMenu },
|
||||
{ "DRAWSERVERMENU", &M_DrawServerMenu },
|
||||
{ "DRAWVIDEOMENU", &M_DrawVideoMenu },
|
||||
{ "DRAWVIDEOMODE", &M_DrawVideoMode },
|
||||
{ "DRAWSKYROOM", &M_DrawSkyRoom },
|
||||
{ "DRAWHUDOPTIONS", &M_DrawHUDOptions },
|
||||
{ "DRAWADDONS", &M_DrawAddons },
|
||||
{ "DRAWEMBLEMHINTS", &M_DrawEmblemHints },
|
||||
{ "DRAWREPLAYSTARTMENU", &M_DrawReplayStartMenu },
|
||||
{ "DRAWPLAYBACKMENU", &M_DrawPlaybackMenu },
|
||||
{ "DRAWIMAGEDEF", &M_DrawImageDef },
|
||||
{ "DRAWMUSICTEST", &M_DrawMusicTest },
|
||||
{ "DRAWCONTROL", &M_DrawControl },
|
||||
{ "DRAWJOYSTICK", &M_DrawJoystick },
|
||||
{ "DRAWMONITORTOGGLES", &M_DrawMonitorToggles },
|
||||
{ "DRAWCONNECTMENU", &M_DrawConnectMenu },
|
||||
#ifdef HAVE_DISCORDRPC
|
||||
{ "DRAWDISCORDREQUESTS", &M_DrawDiscordRequests },
|
||||
#endif
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
struct int_const_s const INT_CONST[] = {
|
||||
|
|
@ -1334,6 +1374,42 @@ struct int_const_s const INT_CONST[] = {
|
|||
{"GS_WAITINGPLAYERS",GS_WAITINGPLAYERS},
|
||||
{"GS_BLANCREDITS",GS_BLANCREDITS},
|
||||
|
||||
// Game controls
|
||||
{"GC_NULL",gc_null},
|
||||
{"GC_AIMFORWARD",gc_aimforward},
|
||||
{"GC_AIMBACKWARD",gc_aimbackward},
|
||||
{"GC_TURNLEFT",gc_turnleft},
|
||||
{"GC_TURNRIGHT",gc_turnright},
|
||||
{"GC_ACCELERATE",gc_accelerate},
|
||||
{"GC_DRIFT",gc_drift},
|
||||
{"GC_BRAKE",gc_brake},
|
||||
{"GC_FIRE",gc_fire},
|
||||
{"GC_LOOKBACK",gc_lookback},
|
||||
{"GC_CAMRESET",gc_camreset},
|
||||
{"GC_CAMTOGGLE",gc_camtoggle},
|
||||
{"GC_SPECTATE",gc_spectate},
|
||||
{"GC_LOOKUP",gc_lookup},
|
||||
{"GC_LOOKDOWN",gc_lookdown},
|
||||
{"GC_CENTERVIEW",gc_centerview},
|
||||
{"GC_TALKKEY",gc_talkkey},
|
||||
{"GC_TEAMKEY",gc_teamkey},
|
||||
{"GC_SCORES",gc_scores},
|
||||
{"GC_CONSOLE",gc_console},
|
||||
{"GC_PAUSE",gc_pause},
|
||||
{"GC_SYSTEMMENU",gc_systemmenu},
|
||||
{"GC_SCREENSHOT",gc_screenshot},
|
||||
{"GC_RECORDGIF",gc_recordgif},
|
||||
{"GC_VIEWPOINT",gc_viewpoint},
|
||||
{"GC_CUSTOM1",gc_custom1},
|
||||
{"GC_CUSTOM2",gc_custom2},
|
||||
{"GC_CUSTOM3",gc_custom3},
|
||||
{"GC_RESPAWN",gc_respawn},
|
||||
{"NUM_GAMECONTROLS",num_gamecontrols},
|
||||
|
||||
// screen.h constants
|
||||
{"BASEVIDWIDTH", BASEVIDWIDTH},
|
||||
{"BASEVIDHEIGHT", BASEVIDHEIGHT},
|
||||
|
||||
// SRB2Kart
|
||||
// kartitems_t
|
||||
#define FOREACH( name, n ) { TOSTR (KITEM_ ## name), KITEM_ ## name }
|
||||
|
|
@ -1390,10 +1466,6 @@ struct int_const_s const INT_CONST[] = {
|
|||
{"KARTSPEED_EASY", KARTSPEED_EASY},
|
||||
{"KARTSPEED_NORMAL", KARTSPEED_NORMAL},
|
||||
{"KARTSPEED_HARD", KARTSPEED_HARD},
|
||||
|
||||
// screen.h constants
|
||||
{"BASEVIDWIDTH", BASEVIDWIDTH},
|
||||
{"BASEVIDHEIGHT", BASEVIDHEIGHT},
|
||||
|
||||
// Custom client features exposed to lua
|
||||
{"FEATURE_INTERMISSIONHUD",1}, // This is to trick kart luas that look for this since its already here.
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
#include "doomdef.h" // Constants
|
||||
#include "d_think.h" // actionf_t
|
||||
#include "info.h" // Mobj, state, sprite, etc constants
|
||||
#include "m_menu.h" // NUMMENUFREESLOTS
|
||||
#include "lua_script.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
@ -27,6 +28,7 @@ extern "C" {
|
|||
extern char *FREE_STATES[NUMSTATEFREESLOTS];
|
||||
extern char *FREE_MOBJS[NUMMOBJFREESLOTS];
|
||||
extern char *FREE_SKINCOLORS[NUMCOLORFREESLOTS];
|
||||
extern char *FREE_MENUS[NUMMENUFREESLOTS];
|
||||
extern UINT8 used_spr[(NUMSPRITEFREESLOTS / 8) + 1]; // Bitwise flag for sprite freeslot in use! I would use ceil() here if I could, but it only saves 1 byte of memory anyway.
|
||||
|
||||
#define initfreeslots() {\
|
||||
|
|
@ -51,6 +53,16 @@ struct actionpointer_t
|
|||
const char *name; ///< Name of the action in ALL CAPS.
|
||||
};
|
||||
|
||||
struct menu_routine_s {
|
||||
const char *name;
|
||||
void (*routine)(INT32);
|
||||
};
|
||||
|
||||
struct menu_drawer_s {
|
||||
const char *name;
|
||||
void (*drawer)(void);
|
||||
};
|
||||
|
||||
struct int_const_s {
|
||||
const char *n;
|
||||
// has to be able to hold both fixed_t and angle_t, so drastic measure!!
|
||||
|
|
@ -81,6 +93,8 @@ extern const char *const KARTSTUFF_LIST[];
|
|||
extern const char *const KARTHUD_LIST[];
|
||||
extern const char *const HUDITEMS_LIST[];
|
||||
extern const char *const MENUTYPES_LIST[];
|
||||
extern struct menu_routine_s const MENU_ROUTINES[];
|
||||
extern struct menu_drawer_s const MENU_DRAWERS[];
|
||||
|
||||
extern struct int_const_s const INT_CONST[];
|
||||
|
||||
|
|
|
|||
|
|
@ -234,6 +234,15 @@ static void DEH_LoadDehackedFile(MYFILE *f, boolean mainfile)
|
|||
readfollower(f);
|
||||
continue;
|
||||
}
|
||||
// sigh... menu hack
|
||||
else if (fastcmp(word, "DISCORDONLY"))
|
||||
{
|
||||
#ifdef HAVE_DISCORDRPC
|
||||
continue;
|
||||
#else
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
word2 = strtok(NULL, " ");
|
||||
if (word2) {
|
||||
|
|
@ -462,6 +471,9 @@ static void DEH_LoadDehackedFile(MYFILE *f, boolean mainfile)
|
|||
}
|
||||
else if (fastcmp(word, "MENU"))
|
||||
{
|
||||
if (dedicated)
|
||||
continue; // dedis don't need menus, silly!
|
||||
|
||||
if (i == 0 && word2[0] != '0') // If word2 isn't a number
|
||||
i = get_menutype(word2); // find a huditem by name
|
||||
if (i >= 1 && i < NUMMENUTYPES)
|
||||
|
|
@ -650,13 +662,13 @@ static void DEH_LoadDehackedFile(MYFILE *f, boolean mainfile)
|
|||
{
|
||||
if (introchanged)
|
||||
{
|
||||
menuactive = false;
|
||||
M_ClearMenus(true);
|
||||
I_UpdateMouseGrab();
|
||||
COM_BufAddText("playintro");
|
||||
}
|
||||
else if (titlechanged)
|
||||
{
|
||||
menuactive = false;
|
||||
M_ClearMenus(true);
|
||||
I_UpdateMouseGrab();
|
||||
COM_BufAddText("exitgame"); // Command_ExitGame_f() but delayed
|
||||
}
|
||||
|
|
|
|||
|
|
@ -312,6 +312,20 @@ void DRPC_RemoveRequest(discordRequest_t *removeRequest)
|
|||
Z_Free(removeRequest);
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
static boolean comregistered = false;
|
||||
static void COM_DiscordTest_f(void)
|
||||
{
|
||||
DiscordUser test = {
|
||||
.username = "Jeffma Balls",
|
||||
.discriminator = "6942",
|
||||
.userId = "69420694206942069",
|
||||
.avatar = NULL, // doesn't matter
|
||||
};
|
||||
DRPC_HandleJoinRequest(&test);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*--------------------------------------------------
|
||||
void DRPC_Init(void)
|
||||
|
||||
|
|
@ -334,6 +348,14 @@ void DRPC_Init(void)
|
|||
Discord_Initialize(DISCORD_APPID, &handlers, 1, NULL);
|
||||
I_AddExitFunc(DRPC_Shutdown);
|
||||
DRPC_UpdatePresence();
|
||||
|
||||
#ifdef _DEBUG
|
||||
if (!comregistered)
|
||||
{
|
||||
COM_AddCommand("discordtest", COM_DiscordTest_f);
|
||||
comregistered = true;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void DRPC_Shutdown(void)
|
||||
|
|
|
|||
|
|
@ -172,7 +172,6 @@ extern boolean digital_disabled;
|
|||
// =========================
|
||||
//
|
||||
|
||||
extern boolean menuactive; // Menu overlaid?
|
||||
extern UINT8 paused; // Game paused?
|
||||
extern UINT8 window_notinfocus; // are we in focus? (backend independant -- handles auto pausing and display of "focus lost" message)
|
||||
extern INT32 window_x;
|
||||
|
|
|
|||
|
|
@ -1171,8 +1171,6 @@ void F_GameEndTicker(void)
|
|||
void F_InitMenuPresValues(void)
|
||||
{
|
||||
menuanimtimer = 0;
|
||||
prevMenuId = 0;
|
||||
activeMenuId = MainDef.menuid;
|
||||
|
||||
// Set defaults for presentation values
|
||||
strncpy(curbgname, "TITLESKY", 9);
|
||||
|
|
@ -1614,7 +1612,7 @@ void F_TitleScreenTicker(boolean run)
|
|||
}
|
||||
|
||||
// Hold up for a bit if menu or console active
|
||||
if (menuactive || CON_Ready())
|
||||
if (menustack[0] || CON_Ready())
|
||||
{
|
||||
demoIdleLeft = demoIdleTime;
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -310,7 +310,7 @@ static CV_PossibleValue_t addons_cons_t[] = {{0, "Default"},
|
|||
#endif
|
||||
{3, "CUSTOM"}, {0, NULL}};
|
||||
|
||||
consvar_t cv_addons_option = CVAR_INIT ("addons_option", "Default", CV_SAVE|CV_CALL, addons_cons_t, Addons_option_Onchange);
|
||||
consvar_t cv_addons_option = CVAR_INIT ("addons_option", "Default", CV_SAVE|CV_CALL|CV_NOINIT, addons_cons_t, Addons_option_Onchange);
|
||||
consvar_t cv_addons_folder = CVAR_INIT ("addons_folder", "", CV_SAVE, NULL, NULL);
|
||||
|
||||
static CV_PossibleValue_t addons_md5_cons_t[] = {{0, "Name"}, {1, "Contents"}, {0, NULL}};
|
||||
|
|
|
|||
25
src/g_demo.c
25
src/g_demo.c
|
|
@ -1663,13 +1663,11 @@ void G_ConfirmRewind(tic_t rewindtime)
|
|||
{
|
||||
SINT8 i;
|
||||
tic_t j;
|
||||
boolean oldmenuactive = menuactive, oldsounddisabled = sound_disabled;
|
||||
boolean oldsounddisabled = sound_disabled;
|
||||
|
||||
INT32 olddp1 = displayplayers[0], olddp2 = displayplayers[1], olddp3 = displayplayers[2], olddp4 = displayplayers[3];
|
||||
UINT8 oldss = splitscreen;
|
||||
|
||||
menuactive = false; // Prevent loops
|
||||
|
||||
CV_StealthSetValue(&cv_renderview, 0);
|
||||
|
||||
if (rewindtime <= starttime)
|
||||
|
|
@ -1705,7 +1703,6 @@ void G_ConfirmRewind(tic_t rewindtime)
|
|||
}
|
||||
|
||||
demo.rewinding = false;
|
||||
menuactive = oldmenuactive; // Bring the menu back up
|
||||
sound_disabled = oldsounddisabled; // Re-enable SFX
|
||||
|
||||
wipegamestate = gamestate; // No fading back in!
|
||||
|
|
@ -3007,11 +3004,11 @@ void G_DoPlayDemo(char *defdemoname)
|
|||
{
|
||||
snprintf(msg, 1024, M_GetText("%s is not a SRB2Kart replay file.\n"), pdemoname);
|
||||
CONS_Alert(CONS_ERROR, "%s", msg);
|
||||
M_StartMessage(msg, NULL, MM_NOTHING);
|
||||
Z_Free(pdemoname);
|
||||
P_SaveBufferFree(&demobuf);
|
||||
demo.playback = false;
|
||||
demo.title = false;
|
||||
M_StartMessage(msg, NULL, MM_NOTHING);
|
||||
return;
|
||||
}
|
||||
demobuf.p += 12; // DEMOHEADER
|
||||
|
|
@ -3027,11 +3024,11 @@ void G_DoPlayDemo(char *defdemoname)
|
|||
default:
|
||||
snprintf(msg, 1024, M_GetText("%s is an incompatible replay format and cannot be played.\n"), pdemoname);
|
||||
CONS_Alert(CONS_ERROR, "%s", msg);
|
||||
M_StartMessage(msg, NULL, MM_NOTHING);
|
||||
Z_Free(pdemoname);
|
||||
P_SaveBufferFree(&demobuf);
|
||||
demo.playback = false;
|
||||
demo.title = false;
|
||||
M_StartMessage(msg, NULL, MM_NOTHING);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -3045,11 +3042,11 @@ void G_DoPlayDemo(char *defdemoname)
|
|||
{
|
||||
snprintf(msg, 1024, M_GetText("%s is the wrong type of recording and cannot be played.\n"), pdemoname);
|
||||
CONS_Alert(CONS_ERROR, "%s", msg);
|
||||
M_StartMessage(msg, NULL, MM_NOTHING);
|
||||
Z_Free(pdemoname);
|
||||
P_SaveBufferFree(&demobuf);
|
||||
demo.playback = false;
|
||||
demo.title = false;
|
||||
M_StartMessage(msg, NULL, MM_NOTHING);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -3109,12 +3106,12 @@ void G_DoPlayDemo(char *defdemoname)
|
|||
}
|
||||
|
||||
CONS_Alert(CONS_ERROR, "%s", msg);
|
||||
if (!CON_Ready()) // In the console they'll just see the notice there! No point pulling them out.
|
||||
M_StartMessage(msg, NULL, MM_NOTHING);
|
||||
Z_Free(pdemoname);
|
||||
P_SaveBufferFree(&demobuf);
|
||||
demo.playback = false;
|
||||
demo.title = false;
|
||||
if (!CON_Ready()) // In the console they'll just see the notice there! No point pulling them out.
|
||||
M_StartMessage(msg, NULL, MM_NOTHING);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -3153,11 +3150,11 @@ void G_DoPlayDemo(char *defdemoname)
|
|||
{
|
||||
snprintf(msg, 1024, M_GetText("%s features a course that is not currently loaded.\n"), pdemoname);
|
||||
CONS_Alert(CONS_ERROR, "%s", msg);
|
||||
M_StartMessage(msg, NULL, MM_NOTHING);
|
||||
Z_Free(pdemoname);
|
||||
P_SaveBufferFree(&demobuf);
|
||||
demo.playback = false;
|
||||
demo.title = false;
|
||||
M_StartMessage(msg, NULL, MM_NOTHING);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -3181,11 +3178,11 @@ void G_DoPlayDemo(char *defdemoname)
|
|||
{
|
||||
snprintf(msg, 1024, M_GetText("%s contains no data to be played.\n"), pdemoname);
|
||||
CONS_Alert(CONS_ERROR, "%s", msg);
|
||||
M_StartMessage(msg, NULL, MM_NOTHING);
|
||||
Z_Free(pdemoname);
|
||||
P_SaveBufferFree(&demobuf);
|
||||
demo.playback = false;
|
||||
demo.title = false;
|
||||
M_StartMessage(msg, NULL, MM_NOTHING);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -3232,11 +3229,11 @@ void G_DoPlayDemo(char *defdemoname)
|
|||
{
|
||||
snprintf(msg, 1024, M_GetText("%s is a Record Attack replay with %s, and is thus invalid.\n"), pdemoname, (bot ? "bots" : "spectators"));
|
||||
CONS_Alert(CONS_ERROR, "%s", msg);
|
||||
M_StartMessage(msg, NULL, MM_NOTHING);
|
||||
Z_Free(pdemoname);
|
||||
P_SaveBufferFree(&demobuf);
|
||||
demo.playback = false;
|
||||
demo.title = false;
|
||||
M_StartMessage(msg, NULL, MM_NOTHING);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -3248,11 +3245,11 @@ void G_DoPlayDemo(char *defdemoname)
|
|||
{
|
||||
snprintf(msg, 1024, M_GetText("%s is a Record Attack replay with multiple players, and is thus invalid.\n"), pdemoname);
|
||||
CONS_Alert(CONS_ERROR, "%s", msg);
|
||||
M_StartMessage(msg, NULL, MM_NOTHING);
|
||||
Z_Free(pdemoname);
|
||||
P_SaveBufferFree(&demobuf);
|
||||
demo.playback = false;
|
||||
demo.title = false;
|
||||
M_StartMessage(msg, NULL, MM_NOTHING);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -4039,7 +4036,7 @@ boolean G_CheckDemoStatus(void)
|
|||
if (timedemo_quit)
|
||||
COM_ImmedExecute("quit");
|
||||
else if (modeattacking)
|
||||
M_EndModeAttackRun();
|
||||
M_ModeAttackEndGame(0);
|
||||
else
|
||||
D_StartTitle();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -651,7 +651,7 @@ void G_SetGameModified(boolean silent, boolean major)
|
|||
|
||||
// If in record attack recording, cancel it.
|
||||
if (modeattacking)
|
||||
M_EndModeAttackRun();
|
||||
M_ModeAttackEndGame(0);
|
||||
else if (marathonmode)
|
||||
Command_ExitGame_f();
|
||||
}
|
||||
|
|
@ -1645,7 +1645,7 @@ boolean G_Responder(event_t *ev)
|
|||
if (modeattacking && !demo.playback && (gamestate == GS_LEVEL))
|
||||
{
|
||||
pausebreakkey = (ev->data1 == KEY_PAUSE);
|
||||
if (menuactive || pausedelay < 0 || leveltime < 2)
|
||||
if (menustack[0] || pausedelay < 0 || leveltime < 2)
|
||||
return true;
|
||||
|
||||
if (pausedelay < 1+(NEWTICRATE/2))
|
||||
|
|
@ -4172,7 +4172,7 @@ void G_AfterIntermission(void)
|
|||
|
||||
if (modeattacking) // End the run.
|
||||
{
|
||||
M_EndModeAttackRun();
|
||||
M_ModeAttackEndGame(0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
#include "d_net.h"
|
||||
#include "console.h"
|
||||
#include "i_joy.h" // JOYAXISRANGE
|
||||
#include "m_menu.h" // menustack
|
||||
|
||||
#define MAXMOUSESENSITIVITY 100 // sensitivity steps
|
||||
|
||||
|
|
@ -176,7 +177,7 @@ void G_MapEventsToControls(event_t *ev)
|
|||
break;
|
||||
|
||||
case ev_mouse: // buttons are virtual keys
|
||||
if (menuactive)
|
||||
if (menustack[0])
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
|
@ -211,7 +212,7 @@ void G_MapEventsToControls(event_t *ev)
|
|||
break;
|
||||
|
||||
case ev_joystick: // buttons are virtual keys
|
||||
if (menuactive)
|
||||
if (menustack[0])
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6367,13 +6367,14 @@ void HWR_AddCommands(void)
|
|||
CV_RegisterVar(&cv_glsolvetjoin);
|
||||
|
||||
CV_RegisterVar(&cv_glbatching);
|
||||
|
||||
CV_RegisterVar(&cv_glanisotropicmode);
|
||||
}
|
||||
|
||||
void HWR_AddSessionCommands(void)
|
||||
{
|
||||
if (gl_sessioncommandsadded)
|
||||
return;
|
||||
CV_RegisterVar(&cv_glanisotropicmode);
|
||||
gl_sessioncommandsadded = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
87
src/info/menus.h
Normal file
87
src/info/menus.h
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
_(NONE)
|
||||
|
||||
_(MAIN)
|
||||
_(PLAYBACK)
|
||||
|
||||
// Single Player
|
||||
_(SP_MAIN)
|
||||
_(SP_GRANDPRIX)
|
||||
_(SP_TIMEATTACK)
|
||||
_(SP_GUESTREPLAY)
|
||||
_(SP_REPLAY)
|
||||
_(SP_GHOST)
|
||||
|
||||
// Multiplayer
|
||||
_(MP_MAIN)
|
||||
_(MP_SPLITSCREEN) // SplitServer
|
||||
_(MP_SERVER)
|
||||
_(MP_CONNECT)
|
||||
_(MP_PLAYERSETUP)
|
||||
|
||||
// Options
|
||||
_(OP_MAIN)
|
||||
|
||||
_(OP_CONTROLSETUP)
|
||||
_(OP_CHANGECONTROLS)
|
||||
_(OP_JOYSTICKSET)
|
||||
|
||||
_(OP_VIDEO)
|
||||
_(OP_VIDEOMODE)
|
||||
_(OP_VISUAL)
|
||||
_(OP_OPENGL)
|
||||
|
||||
_(OP_SOUND)
|
||||
_(SR_SOUNDTEST)
|
||||
|
||||
_(OP_HUD)
|
||||
_(OP_CHAT)
|
||||
_(OP_GAMEHUD)
|
||||
|
||||
_(OP_CAMERA)
|
||||
_(OP_P1CAMERA)
|
||||
_(OP_P2CAMERA)
|
||||
_(OP_P3CAMERA)
|
||||
_(OP_P4CAMERA)
|
||||
|
||||
_(OP_GAME)
|
||||
_(OP_BLANKARTGAME)
|
||||
|
||||
_(OP_SERVER)
|
||||
_(OP_MONITORTOGGLE)
|
||||
_(OP_ADVANCEDSERVER)
|
||||
|
||||
_(OP_DATA)
|
||||
_(OP_SCREENSHOTS)
|
||||
_(OP_ADDONS)
|
||||
_(MISC_REPLAYOPTIONS)
|
||||
_(OP_ERASEDATA)
|
||||
#ifdef HAVE_DISCORDRPC
|
||||
_(OP_DISCORD)
|
||||
#endif
|
||||
|
||||
_(OP_CUSTOM)
|
||||
|
||||
// Extras
|
||||
_(SR_MAIN)
|
||||
_(SP_LEVELSTATS)
|
||||
_(SR_UNLOCKCHECKLIST)
|
||||
_(MISC_REPLAYHUT)
|
||||
_(MISC_REPLAYSTART)
|
||||
_(SR_PANDORA)
|
||||
_(SR_EMBLEMHINT)
|
||||
|
||||
// Addons (Part of MISC, but let's make it our own)
|
||||
_(AD_MAIN)
|
||||
|
||||
// MISC
|
||||
_(HELP)
|
||||
_(SPAUSE)
|
||||
_(MPAUSE)
|
||||
_(MAPAUSE)
|
||||
_(SCRAMBLETEAM)
|
||||
_(CHANGETEAM)
|
||||
_(CHANGELEVEL)
|
||||
_(CHANGESPECTATE)
|
||||
#ifdef HAVE_DISCORDRPC
|
||||
_(MISC_DISCORDREQUESTS)
|
||||
#endif
|
||||
|
|
@ -196,7 +196,7 @@ int LUA_PushGlobals(lua_State *L, const char *word)
|
|||
lua_pushboolean(L, modifiedgame && !savemoddata);
|
||||
return 1;
|
||||
} else if (fastcmp(word,"menuactive")) {
|
||||
lua_pushboolean(L, menuactive);
|
||||
lua_pushboolean(L, menustack[0]);
|
||||
return 1;
|
||||
} else if (fastcmp(word,"paused")) {
|
||||
lua_pushboolean(L, paused);
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ typedef struct
|
|||
// Cheat responders
|
||||
/*static UINT8 cheatf_ultimate(void)
|
||||
{
|
||||
if (menuactive && (currentMenu != &MainDef && currentMenu != &SP_LoadDef))
|
||||
if (menustack[0] != MN_MAIN && menustack[0] != MN_SP_LOAD))
|
||||
return 0; // Only on the main menu, or the save select!
|
||||
|
||||
BwehHehHe();
|
||||
|
|
@ -82,7 +82,7 @@ static UINT8 cheatf_warp(void)
|
|||
/*if (modifiedgame)
|
||||
* return 0;*/
|
||||
|
||||
if (menuactive && currentMenu != &MainDef)
|
||||
if (menustack[0] != MN_MAIN)
|
||||
return 0; // Only on the main menu!
|
||||
|
||||
// Temporarily unlock EVERYTHING.
|
||||
|
|
@ -117,7 +117,7 @@ static UINT8 cheatf_devmode(void)
|
|||
if (modifiedgame)
|
||||
return 0;
|
||||
|
||||
if (menuactive && currentMenu != &MainDef)
|
||||
if (menustack[0] != MN_MAIN)
|
||||
return 0; // Only on the main menu!
|
||||
|
||||
S_StartSound(0, sfx_itemup);
|
||||
|
|
|
|||
4671
src/m_menu.c
4671
src/m_menu.c
File diff suppressed because it is too large
Load diff
352
src/m_menu.h
352
src/m_menu.h
|
|
@ -34,116 +34,24 @@ extern "C" {
|
|||
// MENUS
|
||||
//
|
||||
|
||||
// If menu hierarchies go deeper, change this up to 5.
|
||||
// Zero-based, inclusive.
|
||||
#define NUMMENULEVELS 3
|
||||
#define MENUBITS 6
|
||||
// max size of menu stack
|
||||
#define NUMMENULEVELS 8
|
||||
|
||||
// Menu IDs sectioned by numeric places to signify hierarchy
|
||||
/**
|
||||
* IF YOU MODIFY THIS, MODIFY MENUTYPES_LIST[] IN dehacked.c TO MATCH.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
MN_NONE,
|
||||
#define _(name, ...) MN_##name,
|
||||
#include "info/menus.h"
|
||||
#undef _
|
||||
|
||||
MN_MAIN,
|
||||
|
||||
// Single Player
|
||||
MN_SP_MAIN,
|
||||
|
||||
MN_SP_LOAD,
|
||||
MN_SP_PLAYER,
|
||||
|
||||
MN_SP_LEVELSELECT,
|
||||
MN_SP_LEVELSTATS,
|
||||
|
||||
MN_SP_TIMEATTACK,
|
||||
MN_SP_TIMEATTACK_LEVELSELECT,
|
||||
MN_SP_GUESTREPLAY,
|
||||
MN_SP_REPLAY,
|
||||
MN_SP_GHOST,
|
||||
|
||||
MN_SP_NIGHTSATTACK,
|
||||
MN_SP_NIGHTS_LEVELSELECT,
|
||||
MN_SP_NIGHTS_GUESTREPLAY,
|
||||
MN_SP_NIGHTS_REPLAY,
|
||||
MN_SP_NIGHTS_GHOST,
|
||||
|
||||
MN_SP_MARATHON,
|
||||
|
||||
// Multiplayer
|
||||
MN_MP_MAIN,
|
||||
MN_MP_SPLITSCREEN, // SplitServer
|
||||
MN_MP_SERVER,
|
||||
MN_MP_CONNECT,
|
||||
MN_MP_ROOM,
|
||||
MN_MP_PLAYERSETUP, // MP_PlayerSetupDef shared with SPLITSCREEN if #defined NONET
|
||||
MN_MP_SERVER_OPTIONS,
|
||||
|
||||
// Options
|
||||
MN_OP_MAIN,
|
||||
|
||||
MN_OP_P1CONTROLS,
|
||||
MN_OP_CHANGECONTROLS, // OP_ChangeControlsDef shared with P2
|
||||
MN_OP_P1MOUSE,
|
||||
MN_OP_P1JOYSTICK,
|
||||
MN_OP_JOYSTICKSET, // OP_JoystickSetDef shared with P2
|
||||
MN_OP_P1CAMERA,
|
||||
|
||||
MN_OP_P2CONTROLS,
|
||||
MN_OP_P2MOUSE,
|
||||
MN_OP_P2JOYSTICK,
|
||||
MN_OP_P2CAMERA,
|
||||
|
||||
MN_OP_PLAYSTYLE,
|
||||
|
||||
MN_OP_VIDEO,
|
||||
MN_OP_VIDEOMODE,
|
||||
MN_OP_COLOR,
|
||||
MN_OP_OPENGL,
|
||||
MN_OP_OPENGL_LIGHTING,
|
||||
|
||||
MN_OP_SOUND,
|
||||
|
||||
MN_OP_SERVER,
|
||||
MN_OP_MONITORTOGGLE,
|
||||
|
||||
MN_OP_DATA,
|
||||
MN_OP_ADDONS,
|
||||
MN_OP_SCREENSHOTS,
|
||||
MN_OP_ERASEDATA,
|
||||
|
||||
// Extras
|
||||
MN_SR_MAIN,
|
||||
MN_SR_PANDORA,
|
||||
MN_SR_LEVELSELECT,
|
||||
MN_SR_UNLOCKCHECKLIST,
|
||||
MN_SR_EMBLEMHINT,
|
||||
MN_SR_PLAYER,
|
||||
MN_SR_SOUNDTEST,
|
||||
|
||||
// Addons (Part of MISC, but let's make it our own)
|
||||
MN_AD_MAIN,
|
||||
|
||||
// MISC
|
||||
// MN_MESSAGE,
|
||||
// MN_SPAUSE,
|
||||
|
||||
// MN_MPAUSE,
|
||||
// MN_SCRAMBLETEAM,
|
||||
// MN_CHANGETEAM,
|
||||
// MN_CHANGELEVEL,
|
||||
|
||||
// MN_MAPAUSE,
|
||||
// MN_HELP,
|
||||
|
||||
MN_SPECIAL,
|
||||
MN_FIRSTFREESLOT,
|
||||
MN_LASTFREESLOT = MN_FIRSTFREESLOT + 128,
|
||||
NUMMENUTYPES,
|
||||
} menutype_t; // up to 63; MN_SPECIAL = 53
|
||||
#define MTREE2(a,b) (a | (b<<MENUBITS))
|
||||
#define MTREE3(a,b,c) MTREE2(a, MTREE2(b,c))
|
||||
#define MTREE4(a,b,c,d) MTREE2(a, MTREE3(b,c,d))
|
||||
} menutype_t;
|
||||
#define NUMMENUFREESLOTS (NUMMENUTYPES - MN_FIRSTFREESLOT)
|
||||
|
||||
extern menu_t *menudefs[NUMMENUTYPES];
|
||||
extern menutype_t menustack[NUMMENULEVELS];
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
|
@ -178,8 +86,6 @@ typedef struct
|
|||
} menupres_t;
|
||||
|
||||
extern menupres_t menupres[NUMMENUTYPES];
|
||||
extern UINT32 prevMenuId;
|
||||
extern UINT32 activeMenuId;
|
||||
|
||||
void M_InitMenuPresTables(void);
|
||||
//UINT8 M_GetYoungestChildMenu(void);
|
||||
|
|
@ -214,9 +120,6 @@ void M_InitCharacterTables(void);
|
|||
// does nothing if menu is already up.
|
||||
void M_StartControlPanel(void);
|
||||
|
||||
// Called upon end of a mode attack run
|
||||
void M_EndModeAttackRun(void);
|
||||
|
||||
// Called on new server add, or other reasons
|
||||
void M_SortServerList(void);
|
||||
|
||||
|
|
@ -236,7 +139,9 @@ typedef enum
|
|||
MM_EVENTHANDLER // the same of above but without 'y' or 'n' restriction
|
||||
// and routine is void routine(event_t *) (ex: set control)
|
||||
} menumessagetype_t;
|
||||
void M_StartMessage(const char *string, void *routine, menumessagetype_t itemtype);
|
||||
|
||||
#define M_StartMessage(string, routine, itemtype) M_StartMessage2(string, (void (*)(void))routine, itemtype)
|
||||
void M_StartMessage2(const char *string, void (*routine)(void), menumessagetype_t itemtype);
|
||||
|
||||
typedef enum
|
||||
{
|
||||
|
|
@ -265,7 +170,6 @@ boolean M_CanShowLevelInList(INT32 mapnum, INT32 gt);
|
|||
#define IT_SUBMENU 6 // go to sub menu
|
||||
#define IT_CVAR 8 // handle as a cvar
|
||||
#define IT_PAIR 11 // no handling, define both sides of text
|
||||
#define IT_MSGHANDLER 12 // same as key but with event and sometime can handle y/n key (special for message)
|
||||
|
||||
#define IT_DISPLAY (48+64+128) // 16+32+64+128
|
||||
#define IT_NOTHING 0 // space
|
||||
|
|
@ -314,12 +218,14 @@ boolean M_CanShowLevelInList(INT32 mapnum, INT32 gt);
|
|||
|
||||
#define MAXSTRINGLENGTH 32
|
||||
|
||||
#define ITEMNAMELEN 6
|
||||
#define ITEMNAMEFMT "%.6s"
|
||||
|
||||
typedef union
|
||||
{
|
||||
menu_t *submenu; // IT_SUBMENU
|
||||
menutype_t submenu; // IT_SUBMENU
|
||||
consvar_t *cvar; // IT_CVAR
|
||||
void (*routine)(INT32 choice); // IT_CALL, IT_KEYHANDLER, IT_ARROWS
|
||||
void (*eventhandler)(event_t *ev); // MM_EVENTHANDLER
|
||||
} itemaction_t;
|
||||
|
||||
//
|
||||
|
|
@ -327,6 +233,8 @@ typedef union
|
|||
//
|
||||
struct menuitem_t
|
||||
{
|
||||
char itemname[ITEMNAMELEN];
|
||||
|
||||
// show IT_xxx
|
||||
UINT16 status;
|
||||
|
||||
|
|
@ -341,19 +249,139 @@ struct menuitem_t
|
|||
|
||||
struct menu_t
|
||||
{
|
||||
UINT32 menuid; // ID to encode menu type and hierarchy
|
||||
const char *menutitlepic;
|
||||
const char *headerpic;
|
||||
INT16 numitems; // # of menu items
|
||||
menu_t *prevMenu; // previous menu
|
||||
menuitem_t *menuitems; // menu items
|
||||
void (*drawroutine)(void); // draw routine
|
||||
INT16 x, y; // x, y of menu
|
||||
INT16 lastOn; // last item user was on in menu
|
||||
boolean (*quitroutine)(void); // called before quit a menu return true if we can
|
||||
void (*quitroutine)(INT32 choice); // called before quit a menu
|
||||
};
|
||||
|
||||
void M_SetupNextMenu(menu_t *menudef);
|
||||
void M_EnterMenu(menutype_t menu, boolean callexit);
|
||||
void M_ExitMenu(void);
|
||||
void M_ClearMenus(boolean callexitmenufunc);
|
||||
menuitem_t *M_CheckMenuItem(menutype_t type, const char *name);
|
||||
menuitem_t *M_GetMenuItem(menutype_t type, const char *name);
|
||||
|
||||
void M_SinglePlayerMenu(INT32 choice);
|
||||
void M_Options(INT32 choice);
|
||||
void M_Addons(INT32 choice);
|
||||
void M_QuitSRB2(INT32 choice);
|
||||
void M_Statistics(INT32 choice);
|
||||
void M_HandleLevelStats(INT32 choice);
|
||||
void M_QuitReplayHut(INT32 choice);
|
||||
void M_HandleReplayHutList(INT32 choice);
|
||||
void M_GrandPrixTemp(INT32 choice);
|
||||
void M_TimeAttack(INT32 choice);
|
||||
void M_ItemBreaker(INT32 choice);
|
||||
void M_StartGrandPrix(INT32 choice);
|
||||
void M_QuitTimeAttackMenu(INT32 choice);
|
||||
void M_ChooseTimeAttack(INT32 choice);
|
||||
void M_SetGuestReplay(INT32 choice);
|
||||
void M_ReplayTimeAttack(INT32 choice);
|
||||
void M_HandleStaffReplay(INT32 choice);
|
||||
void M_SetupMultiHandler(INT32 choice);
|
||||
void M_HandleSetupMultiPlayer(INT32 choice);
|
||||
void M_QuitMultiPlayerMenu(INT32 choice);
|
||||
void M_StartServerMenu(INT32 choice);
|
||||
void M_StartOfflineServerMenu(INT32 choice);
|
||||
void M_StartServer(INT32 choice);
|
||||
void M_ConnectMenuModChecks(INT32 choice);
|
||||
void M_HandleConnectIP(INT32 choice);
|
||||
void M_CancelConnect(INT32 choice);
|
||||
void M_Setup1PControlsMenu(INT32 choice);
|
||||
void M_Setup2PControlsMenu(INT32 choice);
|
||||
void M_Setup3PControlsMenu(INT32 choice);
|
||||
void M_Setup4PControlsMenu(INT32 choice);
|
||||
void M_HandleServerPage(INT32 choice);
|
||||
void M_Refresh(INT32 choice);
|
||||
void M_Connect(INT32 choice);
|
||||
void M_VideoModeMenu(INT32 choice);
|
||||
#ifdef HWRENDER
|
||||
void M_OpenGLOptionsMenu(INT32 choice);
|
||||
#endif
|
||||
void M_HandleVideoMode(INT32 ch);
|
||||
void M_HandleSoundTest(INT32 choice);
|
||||
void M_MusicTest(INT32 choice);
|
||||
void M_ScreenshotOptions(INT32 choice);
|
||||
void M_AddonsOptions(INT32 choice);
|
||||
void M_EraseData(INT32 choice);
|
||||
void M_Manual(INT32 choice);
|
||||
void M_Credits(INT32 choice);
|
||||
void M_BlanCredits(INT32 choice);
|
||||
void M_HandleAddons(INT32 choice);
|
||||
void M_SelectableClearMenus(INT32 choice);
|
||||
void M_ModeAttackEndGame(INT32 choice);
|
||||
void M_PandorasBox(INT32 choice);
|
||||
void M_EmblemHints(INT32 choice);
|
||||
void M_Retry(INT32 choice);
|
||||
void M_EndGame(INT32 choice);
|
||||
void M_MapChange(INT32 choice);
|
||||
void M_SetupMultiPlayer(INT32 choice);
|
||||
void M_SetupMultiPlayer2(INT32 choice);
|
||||
void M_SetupMultiPlayer3(INT32 choice);
|
||||
void M_SetupMultiPlayer4(INT32 choice);
|
||||
void M_ConfirmSpectate(INT32 choice);
|
||||
void M_ConfirmEnterGame(INT32 choice);
|
||||
void M_ExitPandorasBox(INT32 choice);
|
||||
void M_GetAllEmeralds(INT32 choice);
|
||||
void M_DestroyRobots(INT32 choice);
|
||||
ATTRNORETURN void FUNCNORETURN M_UltimateCheat(INT32 choice);
|
||||
void M_ConfirmTeamScramble(INT32 choice);
|
||||
void M_ConfirmTeamChange(INT32 choice);
|
||||
void M_ConfirmSpectateChange(INT32 choice);
|
||||
void M_ChangeLevel(INT32 choice);
|
||||
void M_HutStartReplay(INT32 choice);
|
||||
void M_PlaybackRewind(INT32 choice);
|
||||
void M_PlaybackPause(INT32 choice);
|
||||
void M_PlaybackFastForward(INT32 choice);
|
||||
void M_PlaybackAdvance(INT32 choice);
|
||||
void M_PlaybackSetViews(INT32 choice);
|
||||
void M_PlaybackAdjustView(INT32 choice);
|
||||
void M_PlaybackToggleFreecam(INT32 choice);
|
||||
void M_PlaybackQuit(INT32 choice);
|
||||
void M_HandleImageDef(INT32 choice);
|
||||
void M_HandleMusicTest(INT32 choice);
|
||||
void M_Setup1PJoystickMenu(INT32 choice);
|
||||
void M_Setup2PJoystickMenu(INT32 choice);
|
||||
void M_Setup3PJoystickMenu(INT32 choice);
|
||||
void M_Setup4PJoystickMenu(INT32 choice);
|
||||
void M_ResetControls(INT32 choice);
|
||||
void M_ChangeControl(INT32 choice);
|
||||
void M_AssignJoystick(INT32 choice);
|
||||
void M_HandleMonitorToggles(INT32 choice);
|
||||
#ifdef HAVE_DISCORDRPC
|
||||
void M_HandleDiscordRequests(INT32 choice);
|
||||
#endif
|
||||
|
||||
void M_DrawGenericMenu(void);
|
||||
void M_DrawCenteredMenu(void);
|
||||
void M_DrawPauseMenu(void);
|
||||
void M_DrawChecklist(void);
|
||||
void M_DrawLevelStats(void);
|
||||
void M_DrawReplayHut(void);
|
||||
void M_DrawTimeAttackMenu(void);
|
||||
void M_DrawMPMainMenu(void);
|
||||
void M_DrawSetupMultiPlayerMenu(void);
|
||||
void M_DrawServerMenu(void);
|
||||
void M_DrawConnectMenu(void);
|
||||
void M_DrawVideoMenu(void);
|
||||
void M_DrawVideoMode(void);
|
||||
void M_DrawSkyRoom(void);
|
||||
void M_DrawHUDOptions(void);
|
||||
void M_DrawAddons(void);
|
||||
void M_DrawEmblemHints(void);
|
||||
void M_DrawReplayStartMenu(void);
|
||||
void M_DrawPlaybackMenu(void);
|
||||
void M_DrawImageDef(void);
|
||||
void M_DrawMusicTest(void);
|
||||
void M_DrawControl(void);
|
||||
void M_DrawJoystick(void);
|
||||
void M_DrawMonitorToggles(void);
|
||||
#ifdef HAVE_DISCORDRPC
|
||||
void M_DrawDiscordRequests(void);
|
||||
#endif
|
||||
|
||||
// Maybe this goes here????? Who knows.
|
||||
boolean M_MouseNeeded(void);
|
||||
|
|
@ -362,14 +390,8 @@ boolean M_MouseNeeded(void);
|
|||
extern I_mutex m_menu_mutex;
|
||||
#endif
|
||||
|
||||
extern menu_t *currentMenu;
|
||||
|
||||
extern menu_t MainDef;
|
||||
extern menu_t SP_LoadDef;
|
||||
|
||||
// Call upon joystick hotplug
|
||||
void M_SetupJoystickMenu(INT32 choice);
|
||||
extern menu_t OP_JoystickSetDef;
|
||||
|
||||
// Stuff for customizing the player select screen
|
||||
typedef struct
|
||||
|
|
@ -440,6 +462,9 @@ extern description_t description[MAXSKINS];
|
|||
|
||||
extern consvar_t cv_showfocuslost;
|
||||
extern consvar_t cv_newgametype, cv_nextmap, cv_chooseskin, cv_serversort;
|
||||
extern consvar_t cv_dummygpdifficulty, cv_dummygpencore, cv_dummygpcup;
|
||||
extern consvar_t cv_dummyrings, cv_dummylives;
|
||||
extern consvar_t cv_dummymenuplayer, cv_dummyteam, cv_dummyspectate, cv_dummyscramble;
|
||||
extern CV_PossibleValue_t gametype_cons_t[];
|
||||
|
||||
extern char dummystaffname[22];
|
||||
|
|
@ -501,85 +526,6 @@ UINT16 M_GetColorAfter(UINT16 color);
|
|||
void M_InitPlayerSetupColors(void);
|
||||
void M_FreePlayerSetupColors(void);
|
||||
|
||||
// These defines make it a little easier to make menus
|
||||
#define DEFAULTMENUSTYLE(id, header, source, prev, x, y)\
|
||||
{\
|
||||
id,\
|
||||
header,\
|
||||
sizeof(source)/sizeof(menuitem_t),\
|
||||
prev,\
|
||||
source,\
|
||||
M_DrawGenericMenu,\
|
||||
x, y,\
|
||||
0,\
|
||||
NULL\
|
||||
}
|
||||
|
||||
#define DEFAULTSCROLLMENUSTYLE(id, header, source, prev, x, y)\
|
||||
{\
|
||||
id,\
|
||||
header,\
|
||||
sizeof(source)/sizeof(menuitem_t),\
|
||||
prev,\
|
||||
source,\
|
||||
M_DrawGenericScrollMenu,\
|
||||
x, y,\
|
||||
0,\
|
||||
NULL\
|
||||
}
|
||||
|
||||
#define PAUSEMENUSTYLE(source, x, y)\
|
||||
{\
|
||||
MN_SPECIAL,\
|
||||
NULL,\
|
||||
sizeof(source)/sizeof(menuitem_t),\
|
||||
NULL,\
|
||||
source,\
|
||||
M_DrawPauseMenu,\
|
||||
x, y,\
|
||||
0,\
|
||||
NULL\
|
||||
}
|
||||
|
||||
#define CENTERMENUSTYLE(id, header, source, prev, y)\
|
||||
{\
|
||||
id,\
|
||||
header,\
|
||||
sizeof(source)/sizeof(menuitem_t),\
|
||||
prev,\
|
||||
source,\
|
||||
M_DrawCenteredMenu,\
|
||||
BASEVIDWIDTH/2, y,\
|
||||
0,\
|
||||
NULL\
|
||||
}
|
||||
|
||||
#define MAPICONMENUSTYLE(header, source, prev)\
|
||||
{\
|
||||
MN_NONE,\
|
||||
header,\
|
||||
sizeof (source)/sizeof (menuitem_t),\
|
||||
prev,\
|
||||
source,\
|
||||
M_DrawServerMenu,\
|
||||
24,40,\
|
||||
0,\
|
||||
NULL\
|
||||
}
|
||||
|
||||
#define IMAGEDEF(source)\
|
||||
{\
|
||||
MN_SPECIAL,\
|
||||
NULL,\
|
||||
sizeof (source)/sizeof (menuitem_t),\
|
||||
NULL,\
|
||||
source,\
|
||||
M_DrawImageDef,\
|
||||
0, 0,\
|
||||
0,\
|
||||
NULL\
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -109,13 +109,13 @@ typedef off_t off64_t;
|
|||
#endif
|
||||
|
||||
static CV_PossibleValue_t screenshot_cons_t[] = {{0, "Default"}, {1, "HOME"}, {2, "SRB2"}, {3, "CUSTOM"}, {0, NULL}};
|
||||
consvar_t cv_screenshot_option = CVAR_INIT ("screenshot_option", "Default", CV_SAVE|CV_CALL, screenshot_cons_t, Screenshot_option_Onchange);
|
||||
consvar_t cv_screenshot_option = CVAR_INIT ("screenshot_option", "Default", CV_SAVE|CV_CALL|CV_NOINIT, screenshot_cons_t, Screenshot_option_Onchange);
|
||||
consvar_t cv_screenshot_folder = CVAR_INIT ("screenshot_folder", "", CV_SAVE, NULL, NULL);
|
||||
|
||||
consvar_t cv_screenshot_colorprofile = CVAR_INIT ("screenshot_colorprofile", "Yes", CV_SAVE, CV_YesNo, NULL);
|
||||
|
||||
static CV_PossibleValue_t moviemode_cons_t[] = {{MM_GIF, "GIF"}, {MM_APNG, "aPNG"}, {MM_SCREENSHOT, "Screenshots"}, {0, NULL}};
|
||||
consvar_t cv_moviemode = CVAR_INIT ("moviemode_mode", "GIF", CV_SAVE|CV_CALL, moviemode_cons_t, Moviemode_mode_Onchange);
|
||||
consvar_t cv_moviemode = CVAR_INIT ("moviemode_mode", "GIF", CV_SAVE|CV_CALL|CV_NOINIT, moviemode_cons_t, Moviemode_mode_Onchange);
|
||||
|
||||
consvar_t cv_movie_option = CVAR_INIT ("movie_option", "Default", CV_SAVE|CV_CALL, screenshot_cons_t, Moviemode_option_Onchange);
|
||||
consvar_t cv_movie_folder = CVAR_INIT ("movie_folder", "", CV_SAVE, NULL, NULL);
|
||||
|
|
@ -1611,7 +1611,7 @@ boolean M_ScreenshotResponder(event_t *ev)
|
|||
|
||||
ch = ev->data1;
|
||||
|
||||
if (ch >= NUMKEYS && menuactive) // If it's not a keyboard key, then don't allow it in the menus!
|
||||
if (ch >= NUMKEYS && menustack[0]) // If it's not a keyboard key, then don't allow it in the menus!
|
||||
return false;
|
||||
|
||||
if (G_ControlBoundToKey(0, gc_screenshot, ch, true))
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@
|
|||
#include "m_cheat.h"
|
||||
// Thok camera snap (ctrl-f "chalupa")
|
||||
#include "g_input.h"
|
||||
#include "m_menu.h" // menustack
|
||||
|
||||
// SRB2kart
|
||||
#include "m_cond.h" // M_UpdateUnlockablesAndExtraEmblems
|
||||
|
|
@ -192,7 +193,7 @@ boolean P_AutoPause(void)
|
|||
if (netgame || modeattacking || gamestate == GS_TITLESCREEN)
|
||||
return false;
|
||||
|
||||
return ((menuactive && !demo.playback) || ( window_notinfocus && cv_pauseifunfocused.value ));
|
||||
return ((menustack[0] && !demo.playback) || ( window_notinfocus && cv_pauseifunfocused.value ));
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
|||
|
|
@ -345,9 +345,6 @@ void SCR_Startup(void)
|
|||
V_Init();
|
||||
V_Recalc();
|
||||
|
||||
CV_RegisterVar(&cv_ticrate);
|
||||
CV_RegisterVar(&cv_constextsize);
|
||||
|
||||
V_SetPalette(0);
|
||||
}
|
||||
|
||||
|
|
@ -477,13 +474,13 @@ void SCR_ChangeRenderer(void)
|
|||
if (M_CheckParm("-nogl"))
|
||||
{
|
||||
CONS_Alert(CONS_ERROR, "OpenGL rendering was disabled!\n");
|
||||
if (menuactive)
|
||||
if (menustack[0])
|
||||
M_StartMessage(M_GetText("OpenGL rendering was disabled!\n\n(Press a key)\n"), NULL, MM_NOTHING);
|
||||
}
|
||||
else
|
||||
{
|
||||
CONS_Alert(CONS_ERROR, "OpenGL never loaded\n");
|
||||
if (menuactive)
|
||||
if (menustack[0])
|
||||
M_StartMessage(M_GetText("OpenGL never loaded\n\n(Press a key)\n"), NULL, MM_NOTHING);
|
||||
}
|
||||
CV_SetValue(&cv_renderer, render_soft);
|
||||
|
|
|
|||
|
|
@ -2688,6 +2688,6 @@ UINT32 I_GetFreeMem(UINT32 *total)
|
|||
}
|
||||
|
||||
// note CPUAFFINITY code used to reside here
|
||||
void I_RegisterSysCommands(void) {}
|
||||
//void I_RegisterSysCommands(void) {}
|
||||
|
||||
#endif // HAVE_SDL
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ static SDL_bool disable_fullscreen = SDL_FALSE;
|
|||
#define USE_FULLSCREEN (disable_fullscreen||!allow_fullscreen)?0:cv_fullscreen.value
|
||||
static SDL_bool disable_mouse = SDL_FALSE;
|
||||
#define USE_MOUSEINPUT (!disable_mouse && cv_usemouse.value && havefocus)
|
||||
#define MOUSE_MENU false //(!disable_mouse && cv_usemouse.value && menuactive && !USE_FULLSCREEN)
|
||||
#define MOUSE_MENU false //(!disable_mouse && cv_usemouse.value && menustack[0] && !USE_FULLSCREEN)
|
||||
#define MOUSEBUTTONS_MAX MOUSEBUTTONS
|
||||
|
||||
// first entry in the modelist which is not bigger than MAXVIDWIDTHxMAXVIDHEIGHT
|
||||
|
|
@ -386,7 +386,7 @@ static boolean IgnoreMouse(void)
|
|||
{
|
||||
if (cv_alwaysgrabmouse.value)
|
||||
return false;
|
||||
if (menuactive)
|
||||
if (menustack[0])
|
||||
return !M_MouseNeeded();
|
||||
if (paused || con_destlines || chat_on)
|
||||
return true;
|
||||
|
|
@ -1005,7 +1005,7 @@ void I_GetEvent(void)
|
|||
CONS_Debug(DBG_GAMELOGIC, "Joystick%d device index: %d\n", i+1, JoyInfo[i].oldjoy);
|
||||
|
||||
// update the menu
|
||||
if (currentMenu == &OP_JoystickSetDef)
|
||||
if (menustack[0] == MN_OP_JOYSTICKSET)
|
||||
M_SetupJoystickMenu(0);
|
||||
|
||||
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
||||
|
|
@ -1065,7 +1065,7 @@ void I_GetEvent(void)
|
|||
CONS_Debug(DBG_GAMELOGIC, "Joystick%d device index: %d\n", i+1, JoyInfo[i].oldjoy);
|
||||
|
||||
// update the menu
|
||||
if (currentMenu == &OP_JoystickSetDef)
|
||||
if (menustack[0] == MN_OP_JOYSTICKSET)
|
||||
M_SetupJoystickMenu(0);
|
||||
break;
|
||||
case SDL_DROPFILE:
|
||||
|
|
@ -1779,6 +1779,20 @@ static void Impl_VideoSetupBuffer(void)
|
|||
}
|
||||
}
|
||||
|
||||
void I_RegisterSysCommands(void)
|
||||
{
|
||||
if (dedicated || graphics_started)
|
||||
return;
|
||||
|
||||
COM_AddCommand ("vid_nummodes", VID_Command_NumModes_f);
|
||||
COM_AddCommand ("vid_info", VID_Command_Info_f);
|
||||
COM_AddCommand ("vid_modelist", VID_Command_ModeList_f);
|
||||
COM_AddCommand ("vid_mode", VID_Command_Mode_f);
|
||||
CV_RegisterVar (&cv_vidwait);
|
||||
CV_RegisterVar (&cv_stretch);
|
||||
CV_RegisterVar (&cv_alwaysgrabmouse);
|
||||
}
|
||||
|
||||
void I_StartupGraphics(void)
|
||||
{
|
||||
if (dedicated)
|
||||
|
|
@ -1789,13 +1803,6 @@ void I_StartupGraphics(void)
|
|||
if (graphics_started)
|
||||
return;
|
||||
|
||||
COM_AddCommand ("vid_nummodes", VID_Command_NumModes_f);
|
||||
COM_AddCommand ("vid_info", VID_Command_Info_f);
|
||||
COM_AddCommand ("vid_modelist", VID_Command_ModeList_f);
|
||||
COM_AddCommand ("vid_mode", VID_Command_Mode_f);
|
||||
CV_RegisterVar (&cv_vidwait);
|
||||
CV_RegisterVar (&cv_stretch);
|
||||
CV_RegisterVar (&cv_alwaysgrabmouse);
|
||||
disable_mouse = static_cast<SDL_bool>(M_CheckParm("-nomouse"));
|
||||
disable_fullscreen = M_CheckParm("-win") ? SDL_TRUE : SDL_FALSE;
|
||||
|
||||
|
|
|
|||
|
|
@ -858,7 +858,7 @@ void ST_AskToJoinEnvelope(void)
|
|||
{
|
||||
const tic_t freq = TICRATE/2;
|
||||
|
||||
if (menuactive)
|
||||
if (menustack[0])
|
||||
return;
|
||||
|
||||
if ((leveltime % freq) < freq/2)
|
||||
|
|
|
|||
|
|
@ -54,34 +54,34 @@ consvar_t cv_ticrate = CVAR_INIT ("showfps", "No", CV_SAVE, CV_YesNo, NULL);
|
|||
static void CV_palette_OnChange(void);
|
||||
|
||||
static CV_PossibleValue_t gamma_cons_t[] = {{-15, "MIN"}, {5, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_globalgamma = CVAR_INIT ("gamma", "0", CV_SAVE|CV_CALL, gamma_cons_t, CV_palette_OnChange);
|
||||
consvar_t cv_globalgamma = CVAR_INIT ("gamma", "0", CV_SAVE|CV_CALL|CV_NOINIT, gamma_cons_t, CV_palette_OnChange);
|
||||
|
||||
static CV_PossibleValue_t saturation_cons_t[] = {{0, "MIN"}, {10, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_globalsaturation = CVAR_INIT ("saturation", "10", CV_SAVE|CV_CALL, saturation_cons_t, CV_palette_OnChange);
|
||||
consvar_t cv_globalsaturation = CVAR_INIT ("saturation", "10", CV_SAVE|CV_CALL|CV_NOINIT, saturation_cons_t, CV_palette_OnChange);
|
||||
|
||||
#define huecoloursteps 4
|
||||
|
||||
static CV_PossibleValue_t hue_cons_t[] = {{0, "MIN"}, {(huecoloursteps*6)-1, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_rhue = CVAR_INIT ("rhue", "0", CV_SAVE|CV_CALL, hue_cons_t, CV_palette_OnChange);
|
||||
consvar_t cv_yhue = CVAR_INIT ("yhue", "4", CV_SAVE|CV_CALL, hue_cons_t, CV_palette_OnChange);
|
||||
consvar_t cv_ghue = CVAR_INIT ("ghue", "8", CV_SAVE|CV_CALL, hue_cons_t, CV_palette_OnChange);
|
||||
consvar_t cv_chue = CVAR_INIT ("chue", "12", CV_SAVE|CV_CALL, hue_cons_t, CV_palette_OnChange);
|
||||
consvar_t cv_bhue = CVAR_INIT ("bhue", "16", CV_SAVE|CV_CALL, hue_cons_t, CV_palette_OnChange);
|
||||
consvar_t cv_mhue = CVAR_INIT ("mhue", "20", CV_SAVE|CV_CALL, hue_cons_t, CV_palette_OnChange);
|
||||
consvar_t cv_rhue = CVAR_INIT ("rhue", "0", CV_SAVE|CV_CALL|CV_NOINIT, hue_cons_t, CV_palette_OnChange);
|
||||
consvar_t cv_yhue = CVAR_INIT ("yhue", "4", CV_SAVE|CV_CALL|CV_NOINIT, hue_cons_t, CV_palette_OnChange);
|
||||
consvar_t cv_ghue = CVAR_INIT ("ghue", "8", CV_SAVE|CV_CALL|CV_NOINIT, hue_cons_t, CV_palette_OnChange);
|
||||
consvar_t cv_chue = CVAR_INIT ("chue", "12", CV_SAVE|CV_CALL|CV_NOINIT, hue_cons_t, CV_palette_OnChange);
|
||||
consvar_t cv_bhue = CVAR_INIT ("bhue", "16", CV_SAVE|CV_CALL|CV_NOINIT, hue_cons_t, CV_palette_OnChange);
|
||||
consvar_t cv_mhue = CVAR_INIT ("mhue", "20", CV_SAVE|CV_CALL|CV_NOINIT, hue_cons_t, CV_palette_OnChange);
|
||||
|
||||
consvar_t cv_rgamma = CVAR_INIT ("rgamma", "0", CV_SAVE|CV_CALL, gamma_cons_t, CV_palette_OnChange);
|
||||
consvar_t cv_ygamma = CVAR_INIT ("ygamma", "0", CV_SAVE|CV_CALL, gamma_cons_t, CV_palette_OnChange);
|
||||
consvar_t cv_ggamma = CVAR_INIT ("ggamma", "0", CV_SAVE|CV_CALL, gamma_cons_t, CV_palette_OnChange);
|
||||
consvar_t cv_cgamma = CVAR_INIT ("cgamma", "0", CV_SAVE|CV_CALL, gamma_cons_t, CV_palette_OnChange);
|
||||
consvar_t cv_bgamma = CVAR_INIT ("bgamma", "0", CV_SAVE|CV_CALL, gamma_cons_t, CV_palette_OnChange);
|
||||
consvar_t cv_mgamma = CVAR_INIT ("mgamma", "0", CV_SAVE|CV_CALL, gamma_cons_t, CV_palette_OnChange);
|
||||
consvar_t cv_rgamma = CVAR_INIT ("rgamma", "0", CV_SAVE|CV_CALL|CV_NOINIT, gamma_cons_t, CV_palette_OnChange);
|
||||
consvar_t cv_ygamma = CVAR_INIT ("ygamma", "0", CV_SAVE|CV_CALL|CV_NOINIT, gamma_cons_t, CV_palette_OnChange);
|
||||
consvar_t cv_ggamma = CVAR_INIT ("ggamma", "0", CV_SAVE|CV_CALL|CV_NOINIT, gamma_cons_t, CV_palette_OnChange);
|
||||
consvar_t cv_cgamma = CVAR_INIT ("cgamma", "0", CV_SAVE|CV_CALL|CV_NOINIT, gamma_cons_t, CV_palette_OnChange);
|
||||
consvar_t cv_bgamma = CVAR_INIT ("bgamma", "0", CV_SAVE|CV_CALL|CV_NOINIT, gamma_cons_t, CV_palette_OnChange);
|
||||
consvar_t cv_mgamma = CVAR_INIT ("mgamma", "0", CV_SAVE|CV_CALL|CV_NOINIT, gamma_cons_t, CV_palette_OnChange);
|
||||
|
||||
consvar_t cv_rsaturation = CVAR_INIT ("rsaturation", "10", CV_SAVE|CV_CALL, saturation_cons_t, CV_palette_OnChange);
|
||||
consvar_t cv_ysaturation = CVAR_INIT ("ysaturation", "10", CV_SAVE|CV_CALL, saturation_cons_t, CV_palette_OnChange);
|
||||
consvar_t cv_gsaturation = CVAR_INIT ("gsaturation", "10", CV_SAVE|CV_CALL, saturation_cons_t, CV_palette_OnChange);
|
||||
consvar_t cv_csaturation = CVAR_INIT ("csaturation", "10", CV_SAVE|CV_CALL, saturation_cons_t, CV_palette_OnChange);
|
||||
consvar_t cv_bsaturation = CVAR_INIT ("bsaturation", "10", CV_SAVE|CV_CALL, saturation_cons_t, CV_palette_OnChange);
|
||||
consvar_t cv_msaturation = CVAR_INIT ("msaturation", "10", CV_SAVE|CV_CALL, saturation_cons_t, CV_palette_OnChange);
|
||||
consvar_t cv_rsaturation = CVAR_INIT ("rsaturation", "10", CV_SAVE|CV_CALL|CV_NOINIT, saturation_cons_t, CV_palette_OnChange);
|
||||
consvar_t cv_ysaturation = CVAR_INIT ("ysaturation", "10", CV_SAVE|CV_CALL|CV_NOINIT, saturation_cons_t, CV_palette_OnChange);
|
||||
consvar_t cv_gsaturation = CVAR_INIT ("gsaturation", "10", CV_SAVE|CV_CALL|CV_NOINIT, saturation_cons_t, CV_palette_OnChange);
|
||||
consvar_t cv_csaturation = CVAR_INIT ("csaturation", "10", CV_SAVE|CV_CALL|CV_NOINIT, saturation_cons_t, CV_palette_OnChange);
|
||||
consvar_t cv_bsaturation = CVAR_INIT ("bsaturation", "10", CV_SAVE|CV_CALL|CV_NOINIT, saturation_cons_t, CV_palette_OnChange);
|
||||
consvar_t cv_msaturation = CVAR_INIT ("msaturation", "10", CV_SAVE|CV_CALL|CV_NOINIT, saturation_cons_t, CV_palette_OnChange);
|
||||
|
||||
static CV_PossibleValue_t constextsize_cons_t[] = {
|
||||
{V_NOSCALEPATCH, "Small"}, {V_SMALLSCALEPATCH, "Medium"}, {V_MEDSCALEPATCH, "Large"}, {0, "Huge"},
|
||||
|
|
|
|||
Loading…
Reference in a new issue