Reformat the stupid cvar
This commit is contained in:
parent
67a0d061da
commit
b937c0519c
9 changed files with 63 additions and 3 deletions
|
|
@ -175,6 +175,7 @@ static void KartItemPush_OnChange(void);
|
|||
static void KartAntiBump_OnChange(void);
|
||||
static void KartItemBreaker_OnChange(void);
|
||||
static void KartBumpSpark_OnChange(void);
|
||||
static void KartItemList_OnChange(void);
|
||||
|
||||
static void Schedule_OnChange(void);
|
||||
|
||||
|
|
@ -606,7 +607,7 @@ consvar_t cv_kartlegacyspbdist = CVAR_INIT ("kartlegacyspbdist", "2216", CV_NETV
|
|||
// SPB Rush toggle; toggles on/off the more aggressive "pressure" odds when an SPB is active
|
||||
consvar_t cv_kartspbrush = CVAR_INIT ("kartspbrush", "On", CV_NETVAR, CV_OnOff, NULL);
|
||||
|
||||
consvar_t cv_itemlist = CVAR_INIT ("kartitemlist", "On", CV_NETVAR, CV_OnOff, NULL);
|
||||
consvar_t cv_itemlist = CVAR_INIT ("kartitemlist", "On", CV_NETVAR|CV_CALL|CV_NOINIT, CV_OnOff, KartItemList_OnChange);
|
||||
|
||||
// Time limit for Alt. Shrink
|
||||
static CV_PossibleValue_t altshrinktime_cons_t[] = {{0, "MIN"}, {(INT16_MAX / TICRATE), "MAX"}, {0, NULL}};
|
||||
|
|
@ -8357,6 +8358,39 @@ static void KartBumpSpark_OnChange(void)
|
|||
}
|
||||
}
|
||||
|
||||
static void KartItemList_OnChange(void)
|
||||
{
|
||||
if (K_CanChangeRules(false) == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!K_ItemListActive() && cv_itemlist.value)
|
||||
{
|
||||
if (leveltime < starttime)
|
||||
{
|
||||
itemlistactive = true;
|
||||
CONS_Printf(M_GetText("Item rolls will be displayed.\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
CONS_Printf(M_GetText("Item rolls will be displayed next round.\n"));
|
||||
}
|
||||
}
|
||||
else if (K_ItemListActive() && !cv_itemlist.value)
|
||||
{
|
||||
if (leveltime < starttime)
|
||||
{
|
||||
itemlistactive = false;
|
||||
CONS_Printf(M_GetText("Item rolls will not be displayed.\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
CONS_Printf(M_GetText("Item rolls will not be displayed next round.\n"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void Schedule_OnChange(void)
|
||||
{
|
||||
size_t i;
|
||||
|
|
|
|||
|
|
@ -381,7 +381,7 @@ void K_AwardPlayerItem(player_t *player, kartitemtype_e type, UINT8 amount, kart
|
|||
|
||||
player->itemamount = amount;
|
||||
|
||||
if (cv_itemlist.value)
|
||||
if (itemlistactive)
|
||||
K_AddItemRollToList((INT32)(player - players), type, amount);
|
||||
}
|
||||
|
||||
|
|
|
|||
11
src/k_kart.c
11
src/k_kart.c
|
|
@ -10972,6 +10972,17 @@ boolean K_ItemLitterActive(void)
|
|||
return false;
|
||||
}
|
||||
|
||||
boolean K_ItemListActive(void)
|
||||
{
|
||||
if (itemlistactive)
|
||||
{
|
||||
// Item listing is enabled!
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean K_ItemPushingActive(void)
|
||||
{
|
||||
return itempushing;
|
||||
|
|
|
|||
|
|
@ -357,6 +357,7 @@ boolean K_DraftingActive(void);
|
|||
boolean K_AirDropActive(void);
|
||||
boolean K_AirThrustActive(void);
|
||||
boolean K_ItemLitterActive(void);
|
||||
boolean K_ItemListActive(void);
|
||||
boolean K_ItemPushingActive(void);
|
||||
INT32 K_GetBumpSpark(void);
|
||||
boolean K_BoostChain(player_t *player, INT32 timer, boolean chainsound);
|
||||
|
|
|
|||
|
|
@ -4365,6 +4365,12 @@ static int lib_kItemLitterActive(lua_State *L)
|
|||
return 1;
|
||||
}
|
||||
|
||||
static int lib_kItemListActive(lua_State *L)
|
||||
{
|
||||
lua_pushboolean(L, K_ItemListActive());
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Gets the currently active bumpspark type.
|
||||
static int lib_kGetBumpSpark(lua_State *L)
|
||||
{
|
||||
|
|
@ -5688,6 +5694,7 @@ static luaL_Reg lib[] = {
|
|||
{"K_DraftingActive",lib_kDraftingActive},
|
||||
{"K_AirDropActive",lib_kAirDropActive},
|
||||
{"K_ItemLitterActive",lib_kItemLitterActive},
|
||||
{"K_ItemListActive", lib_kItemListActive},
|
||||
{"K_GetBumpSpark",lib_kGetBumpSpark},
|
||||
{"K_UsingLegacyCheckpoints",lib_kUsingLegacyCheckpoints},
|
||||
{"K_DoBoost",lib_kDoBoost},
|
||||
|
|
|
|||
|
|
@ -622,6 +622,7 @@ extern boolean airthrustactive;
|
|||
extern boolean itemlittering;
|
||||
extern boolean itempushing;
|
||||
extern UINT8 bumpsparkactive;
|
||||
extern boolean itemlistactive;
|
||||
extern UINT16 bossdisabled;
|
||||
extern boolean stoppedclock;
|
||||
|
||||
|
|
|
|||
|
|
@ -4232,6 +4232,7 @@ static boolean P_NetSyncMisc(savebuffer_t *save, boolean resending)
|
|||
SYNCBOOLEAN(airdropactive);
|
||||
SYNCBOOLEAN(itemlittering);
|
||||
SYNCBOOLEAN(itempushing);
|
||||
SYNCBOOLEAN(itemlistactive);
|
||||
SYNC(bumpsparkactive);
|
||||
SYNC(antibumptime);
|
||||
|
||||
|
|
|
|||
|
|
@ -165,6 +165,7 @@ boolean airthrustactive;
|
|||
boolean itemlittering;
|
||||
boolean itempushing;
|
||||
UINT8 bumpsparkactive;
|
||||
boolean itemlistactive;
|
||||
UINT16 bossdisabled;
|
||||
boolean stoppedclock;
|
||||
boolean levelloading;
|
||||
|
|
@ -8178,6 +8179,7 @@ static void P_InitLevelSettings(boolean reloadinggamestate)
|
|||
airthrustactive = false;
|
||||
itemlittering = false;
|
||||
itempushing = false;
|
||||
itemlistactive = false;
|
||||
bumpsparkactive = 0;
|
||||
antibumptime = 0;
|
||||
|
||||
|
|
@ -8214,6 +8216,9 @@ static void P_InitLevelSettings(boolean reloadinggamestate)
|
|||
if (cv_kartitempush.value)
|
||||
itempushing = true;
|
||||
|
||||
if (cv_itemlist.value)
|
||||
itemlistactive = true;
|
||||
|
||||
bumpsparkactive = (UINT8)cv_kartbumpspark.value;
|
||||
|
||||
antibumptime = (tic_t)cv_kartantibump.value * TICRATE;
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ static boolean Y_ItemListActive(void)
|
|||
nump++;
|
||||
}
|
||||
|
||||
return ((cv_itemlist.value != 0) && (nump > 1));
|
||||
return ((itemlistactive) && (nump > 1));
|
||||
}
|
||||
|
||||
static y_data data;
|
||||
|
|
|
|||
Loading…
Reference in a new issue