mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-01-02 13:12:50 +00:00
Admin Tools menu
Just a superpowered version of the Call Votekick menu, also just to make release cleanly
This commit is contained in:
parent
685e1b019f
commit
dee753d979
4 changed files with 39 additions and 3 deletions
|
|
@ -453,6 +453,7 @@ typedef enum
|
|||
mpause_discordrequests,
|
||||
#endif
|
||||
mpause_callvote,
|
||||
mpause_admin,
|
||||
|
||||
mpause_continue,
|
||||
mpause_spectate,
|
||||
|
|
@ -1088,6 +1089,7 @@ extern struct playerkickmenu_s {
|
|||
tic_t ticker;
|
||||
UINT8 player;
|
||||
UINT8 poke;
|
||||
boolean adminpowered;
|
||||
} playerkickmenu;
|
||||
|
||||
void M_KickHandler(INT32 choice);
|
||||
|
|
|
|||
|
|
@ -4636,7 +4636,9 @@ void M_DrawKickHandler(void)
|
|||
V_DrawCenteredThinString(
|
||||
BASEVIDWIDTH/2, 12,
|
||||
V_ALLOWLOWERCASE|V_6WIDTHSPACE,
|
||||
K_GetMidVoteLabel(menucallvote)
|
||||
(playerkickmenu.adminpowered)
|
||||
? "You are using ""\x85""Admin Tools""\x80"", ""\x83""(A)""\x80"" to kick and ""\x84""(C)""\x80"" to ban"
|
||||
: K_GetMidVoteLabel(menucallvote)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -43,6 +43,9 @@ menuitem_t PAUSE_Main[] =
|
|||
{IT_STRING | IT_ARROWS, "CALL VOTE", "M_ICOVOT",
|
||||
NULL, {.routine = M_HandlePauseMenuCallVote}, 0, 0},
|
||||
|
||||
{IT_STRING | IT_ARROWS, "ADMIN TOOLS", "M_ICOADM",
|
||||
NULL, {.routine = M_KickHandler}, 0, 0},
|
||||
|
||||
{IT_STRING | IT_CALL, "RESUME GAME", "M_ICOUNP",
|
||||
NULL, {.routine = M_QuitPauseMenu}, 0, 0},
|
||||
|
||||
|
|
@ -128,6 +131,7 @@ void M_OpenPauseMenu(void)
|
|||
PAUSE_Main[mpause_restartmap].status = IT_DISABLED;
|
||||
PAUSE_Main[mpause_tryagain].status = IT_DISABLED;
|
||||
PAUSE_Main[mpause_callvote].status = IT_DISABLED;
|
||||
PAUSE_Main[mpause_admin].status = IT_DISABLED;
|
||||
#ifdef HAVE_DISCORDRPC
|
||||
PAUSE_Main[mpause_discordrequests].status = IT_DISABLED;
|
||||
#endif
|
||||
|
|
@ -161,6 +165,11 @@ void M_OpenPauseMenu(void)
|
|||
{
|
||||
PAUSE_Main[mpause_addons].status = IT_STRING | IT_CALL;
|
||||
}
|
||||
|
||||
if (netgame)
|
||||
{
|
||||
PAUSE_Main[mpause_admin].status = IT_STRING | IT_CALL;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!netgame && !demo.playback)
|
||||
|
|
@ -183,7 +192,7 @@ void M_OpenPauseMenu(void)
|
|||
}
|
||||
}
|
||||
|
||||
if (netgame)
|
||||
if (netgame && (PAUSE_Main[mpause_admin].status == IT_DISABLED))
|
||||
{
|
||||
menucallvote = K_GetNextAllowedMidVote(menucallvote, true);
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ static void M_PlayerKickHandler(INT32 choice)
|
|||
{
|
||||
const UINT8 pid = 0;
|
||||
|
||||
UINT8 kicktype = UINT8_MAX;
|
||||
|
||||
(void)choice;
|
||||
|
||||
if (menucmd[pid].dpad_lr != 0) // symmetrical in this case
|
||||
|
|
@ -47,7 +49,17 @@ static void M_PlayerKickHandler(INT32 choice)
|
|||
M_SetMenuDelay(pid);
|
||||
}
|
||||
|
||||
else if (M_MenuExtraPressed(pid) && playerkickmenu.adminpowered)
|
||||
{
|
||||
kicktype = KICK_MSG_BANNED;
|
||||
}
|
||||
|
||||
else if (M_MenuConfirmPressed(pid))
|
||||
{
|
||||
kicktype = KICK_MSG_KICKED;
|
||||
}
|
||||
|
||||
if (kicktype != UINT8_MAX)
|
||||
{
|
||||
M_SetMenuDelay(pid);
|
||||
|
||||
|
|
@ -57,7 +69,16 @@ static void M_PlayerKickHandler(INT32 choice)
|
|||
&& playerkickmenu.player != serverplayer
|
||||
)
|
||||
{
|
||||
if (
|
||||
if (playerkickmenu.adminpowered)
|
||||
{
|
||||
if (consoleplayer == serverplayer || IsPlayerAdmin(consoleplayer))
|
||||
{
|
||||
playerkickmenu.poke = (kicktype == KICK_MSG_BANNED) ? 16 : 12;
|
||||
SendKick(playerkickmenu.player, kicktype);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (
|
||||
K_MinimalCheckNewMidVote(menucallvote) == true
|
||||
#ifndef DEVELOP
|
||||
&& IsPlayerAdmin(playerkickmenu.player) == false
|
||||
|
|
@ -107,6 +128,8 @@ menu_t PAUSE_KickHandlerDef = {
|
|||
|
||||
void M_KickHandler(INT32 choice)
|
||||
{
|
||||
playerkickmenu.adminpowered = (choice >= 0);
|
||||
|
||||
PAUSE_KickHandlerDef.prevMenu = currentMenu;
|
||||
M_SetupNextMenu(&PAUSE_KickHandlerDef, true);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue