From 564fb6a7233ecdf657f115cadaa1bb6a65b88380 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 13 Aug 2010 06:27:22 +0000 Subject: [PATCH] - added TheShooter7/Aroenai's patch for switch on pickup menu option. SVN r2531 (trunk) --- src/m_menu.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/m_menu.cpp b/src/m_menu.cpp index 49d5638ef3..10ba3a3362 100644 --- a/src/m_menu.cpp +++ b/src/m_menu.cpp @@ -196,6 +196,7 @@ static void M_ChangeClass (int choice); static void M_ChangeGender (int choice); static void M_ChangeSkin (int choice); static void M_ChangeAutoAim (int choice); +static void M_ChangeSwitchPickup (int choice); static void PickPlayerClass (); // EXTERNAL DATA DECLARATIONS ---------------------------------------------- @@ -203,6 +204,7 @@ static void PickPlayerClass (); EXTERN_CVAR (String, playerclass) EXTERN_CVAR (String, name) EXTERN_CVAR (Int, team) +EXTERN_CVAR(Bool, neverswitchonpickup) extern bool sendpause; extern int flagsvar; @@ -545,7 +547,8 @@ static oldmenuitem_t PlayerSetupMenu[] = { 2,0,'t',NULL,M_ChangeClass, CR_UNTRANSLATED}, { 2,0,'s',NULL,M_ChangeSkin, CR_UNTRANSLATED}, { 2,0,'e',NULL,M_ChangeGender, CR_UNTRANSLATED}, - { 2,0,'a',NULL,M_ChangeAutoAim, CR_UNTRANSLATED} + { 2,0,'a',NULL,M_ChangeAutoAim, CR_UNTRANSLATED}, + { 2,0,'p',NULL,M_ChangeSwitchPickup, CR_UNTRANSLATED} }; enum @@ -2360,6 +2363,13 @@ static void M_PlayerSetupDrawer () autoaim <= 2 ? "High" : autoaim <= 3 ? "Very High" : "Always", DTA_Clean, true, TAG_DONE); + + // Draw Switch on Pickup setting + x = SmallFont->StringWidth ("Switch on Pickup") + 8 + PSetupDef.x; + screen->DrawText (SmallFont, label, PSetupDef.x, PSetupDef.y + LINEHEIGHT*9+yo, "Switch on Pickup", DTA_Clean, true, TAG_DONE); + screen->DrawText (SmallFont, value, x, PSetupDef.y + LINEHEIGHT*9+yo, + neverswitchonpickup == false ? "Yes" : "No", + DTA_Clean, true, TAG_DONE); } // A 32x32 cloud rendered with Photoshop, plus some other filters @@ -2668,6 +2678,14 @@ static void M_ChangeAutoAim (int choice) autoaim = aim; } +static void M_ChangeSwitchPickup (int choice) +{ + if (!choice) + neverswitchonpickup = (neverswitchonpickup == 1) ? 0 : 1; + else + neverswitchonpickup = (neverswitchonpickup == 0) ? 1 : 0; +} + static void M_EditPlayerName (int choice) { // we are going to be intercepting all chars