From 0884d0b5460829bbf526f952c89b2dfa72e5094c Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 28 Sep 2020 14:57:07 -0700 Subject: [PATCH] Update bird menu Also made some options dynamic. --- src/g_game.c | 2 +- src/m_menu.c | 72 ++++++++++++++++++++++++++++++++++++++++++++++------ src/m_menu.h | 3 +++ src/p_user.c | 3 ++- 4 files changed, 70 insertions(+), 10 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 61cc965a6..4d4ca0c7c 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -537,7 +537,7 @@ consvar_t cv_respawnfademusicback = {"respawnfademusicback", "500", CV_SAVE, CV_ consvar_t cv_resetspecialmusic = {"resetspecialmusic", "Yes", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_resume = {"resume", "Yes", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_fading = {"fading", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_fading = {"fading", "On", CV_SAVE|CV_CALL, CV_OnOff, Bird_menu_Onchange, 0, NULL, NULL, 0, 0, NULL}; #if MAXPLAYERS > 16 #error "please update player_name table using the new value for MAXPLAYERS" diff --git a/src/m_menu.c b/src/m_menu.c index 4fb98fc73..803c4f1c4 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1654,20 +1654,44 @@ static menuitem_t OP_BirdMenu[] = static menuitem_t OP_TiltMenu[] = { {IT_STRING | IT_CVAR, NULL, "Camera Tilting", &cv_tilting, 0}, - {IT_STRING | IT_CVAR, NULL, "Also Tilt During Quakes", &cv_actionmovie, 10}, + {IT_STRING | IT_CVAR, NULL, "Tilt While Turning", &cv_quaketilt, 10}, + {IT_STRING | IT_CVAR, NULL, "Smoothing Divisor", &cv_tiltsmoothing, 20}, - {IT_STRING | IT_CVAR, NULL, "\x85" "Window Shaking During Quakes", &cv_windowquake, 30}, + {IT_STRING | IT_CVAR, NULL, "Also Tilt During Quakes", &cv_actionmovie, 40}, + + {IT_STRING | IT_CVAR, NULL, "\x85" "Window Shaking During Quakes", &cv_windowquake, 60}, +}; + +enum +{ + tilting, + tiltwturning, + smoothening, + tiltwquakes, + windowshake, }; static menuitem_t OP_AdvancedBirdMenu[] = { - {IT_STRING | IT_CVAR, NULL, "Resync Threshold", &cv_music_resync_threshold, 0}, - {IT_STRING | IT_CVAR, NULL, "Resync Special Music Only", &cv_music_resync_powerups_only, 10}, + {IT_STRING | IT_CVAR, NULL, "Fading", &cv_fading, 0}, + {IT_STRING | IT_CVAR, NULL, "Fade Back from Invincibility", &cv_invincmusicfade, 10}, + {IT_STRING | IT_CVAR, NULL, "Fade Back from Grow", &cv_growmusicfade, 20}, + {IT_STRING | IT_CVAR, NULL, "Fade Out Before Respawning", &cv_respawnfademusicout, 30}, + {IT_STRING | IT_CVAR, NULL, "Fade Back In While Respawning", &cv_respawnfademusicback, 40}, - {IT_STRING | IT_CVAR, NULL, "Fade Back from Invincibility", &cv_invincmusicfade, 30}, - {IT_STRING | IT_CVAR, NULL, "Fade Back from Grow", &cv_growmusicfade, 40}, - {IT_STRING | IT_CVAR, NULL, "Fade Out Before Respawning", &cv_respawnfademusicout, 50}, - {IT_STRING | IT_CVAR, NULL, "Fade Back In While Respawning", &cv_respawnfademusicback, 60}, + {IT_STRING | IT_CVAR, NULL, "Resync Threshold", &cv_music_resync_threshold, 60}, + {IT_STRING | IT_CVAR, NULL, "Resync Special Music Only", &cv_music_resync_powerups_only, 70}, +}; + +enum +{ + fading, + fadeinvinc, + fadegrow, + respawnfadeout, + respawnfadein, + syncthreshold, + syncspecialonly, }; // ========================================================================== @@ -2426,6 +2450,38 @@ void Addons_option_Onchange(void) (cv_addons_option.value == 3 ? IT_CVAR|IT_STRING|IT_CV_STRING : IT_DISABLED); } +void Bird_menu_Onchange(void) +{ + UINT16 status; + + if (cv_tilting.value) + { + status = IT_STRING | IT_CVAR; + } + else + { + status = IT_GRAYEDOUT; + } + + OP_TiltMenu[tiltwturning].status = status; + OP_TiltMenu[smoothening].status = status; + OP_TiltMenu[tiltwquakes].status = status; + + if (cv_fading.value) + { + status = IT_STRING | IT_CVAR; + } + else + { + status = IT_GRAYEDOUT; + } + + OP_AdvancedBirdMenu[fadeinvinc].status = status; + OP_AdvancedBirdMenu[fadegrow].status = status; + OP_AdvancedBirdMenu[respawnfadeout].status = status; + OP_AdvancedBirdMenu[respawnfadein].status = status; +} + // ========================================================================== // END ORGANIZATION STUFF. // ========================================================================== diff --git a/src/m_menu.h b/src/m_menu.h index 986a0ba66..9bdfec17c 100644 --- a/src/m_menu.h +++ b/src/m_menu.h @@ -260,6 +260,9 @@ void Screenshot_option_Onchange(void); // Addons menu updating void Addons_option_Onchange(void); +// Bird menu updating +void Bird_menu_Onchange(void); + void M_ReplayHut(INT32 choice); void M_SetPlaybackMenuPointer(void); diff --git a/src/p_user.c b/src/p_user.c index 12afcc74b..27a51f9b7 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -48,6 +48,7 @@ #include "m_cond.h" // M_UpdateUnlockablesAndExtraEmblems #include "k_kart.h" #include "console.h" // CON_LogMessage +#include "m_menu.h" #ifdef HW3SOUND #include "hardware/hw3sound.h" @@ -7116,7 +7117,7 @@ consvar_t cv_cam4_speed = {"cam4_speed", "0.4", CV_FLOAT|CV_SAVE, CV_CamSpeed, N consvar_t cv_cam4_rotate = {"cam4_rotate", "0", CV_CALL|CV_NOINIT, CV_CamRotate, CV_CamRotate4_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_cam4_rotspeed = {"cam4_rotspeed", "10", CV_SAVE, rotation_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_tilting = {"tilting", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_tilting = {"tilting", "On", CV_SAVE|CV_CALL, CV_OnOff, Bird_menu_Onchange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_quaketilt = {"quaketilt", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_tiltsmoothing = {"tiltsmoothing", "32", CV_SAVE, CV_Natural, NULL, 0, NULL, NULL, 0, 0, NULL};