+ case 0:
+ Cvar_SetValueQuick (&r_modellights, bound(0, r_modellights.value + dir, 8));
+ break;
+ case 1:
+ Cvar_SetValueQuick (&r_dlightmap, !r_dlightmap.integer);
+ break;
+ case 2:
+ Cvar_SetValueQuick (&r_coronas, !r_coronas.integer);
+ break;
+ case 3:
+ Cvar_SetValueQuick (&gl_flashblend, !gl_flashblend.integer);
+ break;
+ case 4:
+ Cvar_SetValueQuick (&cl_particles, !cl_particles.integer);
+ break;
+ case 5:
+ Cvar_SetValueQuick (&cl_explosions, !cl_explosions.integer);
+ break;
+ case 6:
+ Cvar_SetValueQuick (&r_explosionclip, !r_explosionclip.integer);
+ break;
+ case 7:
+ Cvar_SetValueQuick (&cl_stainmaps, !cl_stainmaps.integer);
+ break;
+ case 8:
+ Cvar_SetValueQuick (&r_detailtextures, !r_detailtextures.integer);
+ break;
+ case 9:
+ Cvar_SetValueQuick (&cl_particles_bulletimpacts, !cl_particles_bulletimpacts.integer);
+ break;
+ case 10:
+ Cvar_SetValueQuick (&cl_particles_smoke, !cl_particles_smoke.integer);
+ break;
+ case 11:
+ Cvar_SetValueQuick (&cl_particles_sparks, !cl_particles_sparks.integer);
+ break;
+ case 12:
+ Cvar_SetValueQuick (&cl_particles_bubbles, !cl_particles_bubbles.integer);
+ break;
+ case 13:
+ Cvar_SetValueQuick (&cl_particles_blood, !cl_particles_blood.integer);
+ break;
+ case 14:
+ Cvar_SetValueQuick (&cl_particles_blood_size, bound(2, cl_particles_blood_size.value + dir * 1, 20));
+ break;
+ case 15:
+ Cvar_SetValueQuick (&cl_particles_blood_alpha, bound(0.2, cl_particles_blood_alpha.value + dir * 0.1, 1));
+ break;
+ }
+}
+
+void M_Options_Effects_Draw (void)
+{
+ float y;
+ cachepic_t *p;
+
+ M_DrawPic(16, 4, "gfx/qplaque.lmp");
+ p = Draw_CachePic("gfx/p_option.lmp");
+ M_DrawPic((320-p->width)/2, 4, "gfx/p_option.lmp");
+
+ y = 32;
+ M_Print(16, y, " Lights Per Model");M_DrawSlider(220, y, r_modellights.value / 8);y += 8;
+ M_Print(16, y, " Fast Dynamic Lighting");M_DrawCheckbox(220, y, !r_dlightmap.integer);y += 8;
+ M_Print(16, y, " Coronas");M_DrawCheckbox(220, y, r_coronas.integer);y += 8;
+ M_Print(16, y, " Use Only Coronas");M_DrawCheckbox(220, y, gl_flashblend.integer);y += 8;
+ M_Print(16, y, " Particles");M_DrawCheckbox(220, y, cl_particles.integer);y += 8;
+ M_Print(16, y, " Explosions");M_DrawCheckbox(220, y, cl_explosions.integer);y += 8;
+ M_Print(16, y, " Explosion Clipping");M_DrawCheckbox(220, y, r_explosionclip.integer);y += 8;
+ M_Print(16, y, " Stainmaps");M_DrawCheckbox(220, y, cl_stainmaps.integer);y += 8;
+ M_Print(16, y, " Detail Texturing");M_DrawCheckbox(220, y, r_detailtextures.integer);y += 8;
+ M_Print(16, y, " Bullet Impacts");M_DrawCheckbox(220, y, cl_particles_bulletimpacts.integer);y += 8;
+ M_Print(16, y, " Smoke");M_DrawCheckbox(220, y, cl_particles_smoke.integer);y += 8;
+ M_Print(16, y, " Sparks");M_DrawCheckbox(220, y, cl_particles_sparks.integer);y += 8;
+ M_Print(16, y, " Bubbles");M_DrawCheckbox(220, y, cl_particles_bubbles.integer);y += 8;
+ M_Print(16, y, " Blood");M_DrawCheckbox(220, y, cl_particles_blood.integer);y += 8;
+ M_Print(16, y, " Blood Size");M_DrawSlider(220, y, (cl_particles_blood_size.value - 2) / 18);y += 8;
+ M_Print(16, y, " Blood Opacity");M_DrawSlider(220, y, (cl_particles_blood_alpha.value - 0.2) / 0.8);y += 8;
+
+ // cursor
+ M_DrawCharacter(200, 32 + options_effects_cursor*8, 12+((int)(realtime*4)&1));
+}
+
+
+void M_Options_Effects_Key (int k)
+{
+ switch (k)
+ {
+ case K_ESCAPE:
+ M_Menu_Options_f ();
+ break;
+
+ case K_ENTER:
+ M_Menu_Options_Effects_AdjustSliders (1);
+ break;
+
+ case K_UPARROW:
+ S_LocalSound ("misc/menu1.wav");
+ options_effects_cursor--;
+ if (options_effects_cursor < 0)
+ options_effects_cursor = OPTIONS_EFFECTS_ITEMS-1;
+ break;
+
+ case K_DOWNARROW:
+ S_LocalSound ("misc/menu1.wav");
+ options_effects_cursor++;
+ if (options_effects_cursor >= OPTIONS_EFFECTS_ITEMS)
+ options_effects_cursor = 0;
+ break;
+
+ case K_LEFTARROW:
+ M_Menu_Options_Effects_AdjustSliders (-1);
+ break;
+
+ case K_RIGHTARROW:
+ M_Menu_Options_Effects_AdjustSliders (1);
+ break;
+ }
+}
+
+//=============================================================================
+/* KEYS MENU */
+
+char *quakebindnames[][2] =
+{
+{"+attack", "attack"},
+{"impulse 10", "next weapon"},
+{"impulse 12", "previous weapon"},
+{"+jump", "jump / swim up"},
+{"+forward", "walk forward"},
+{"+back", "backpedal"},
+{"+left", "turn left"},
+{"+right", "turn right"},
+{"+speed", "run"},
+{"+moveleft", "step left"},
+{"+moveright", "step right"},
+{"+strafe", "sidestep"},
+{"+lookup", "look up"},
+{"+lookdown", "look down"},
+{"centerview", "center view"},
+{"+mlook", "mouse look"},
+{"+klook", "keyboard look"},
+{"+moveup", "swim up"},
+{"+movedown", "swim down"}
+};
+
+char *transfusionbindnames[][2] =
+{
+{"+forward", "walk forward"},
+{"+back", "backpedal"},
+{"+left", "turn left"},
+{"+right", "turn right"},
+{"+moveleft", "step left"},
+{"+moveright", "step right"},
+{"+jump", "jump / swim up"},
+{"+movedown", "swim down"},
+{"+attack", "attack"},
+{"+button3", "altfire"},
+{"impulse 1", "Pitch Fork"},
+{"impulse 2", "Flare Gun"},
+{"impulse 3", "Shotgun"},
+{"impulse 4", "Machine Gun"},
+{"impulse 5", "Incinerator"},
+{"impulse 6", "Bombs"},
+{"impulse 7", "Aerosol Can"},
+{"impulse 8", "Tesla Cannon"},
+{"impulse 9", "Life Leech"},
+{"impulse 17", "Voodoo Doll"},
+{"impulse 11", "previous weapon"},
+{"impulse 10", "next weapon"},
+{"impulse 14", "previous item"},
+{"impulse 15", "next item"},
+{"impulse 13", "use item"},
+{"impulse 100", "add bot (red)"},
+{"impulse 101", "add bot (blue)"},
+{"impulse 102", "kick a bot"},
+{"impulse 50", "voting menu"},
+{"impulse 141", "identify player"},
+{"impulse 16", "next armor type"},
+{"impulse 20", "observer mode"}
+};
+
+int numcommands;
+char *(*bindnames)[2];
+
+/*
+typedef struct binditem_s
+{
+ char *command, *description;
+ struct binditem_s *next;
+}
+binditem_t;
+
+typedef struct bindcategory_s
+{
+ char *name;
+ binditem_t *binds;
+ struct bindcategory_s *next;
+}
+bindcategory_t;
+
+bindcategory_t *bindcategories = NULL;
+
+void M_ClearBinds (void)
+{
+ for (c = bindcategories;c;c = cnext)
+ {
+ cnext = c->next;
+ for (b = c->binds;b;b = bnext)
+ {
+ bnext = b->next;
+ Z_Free(b);
+ }
+ Z_Free(c);
+ }
+ bindcategories = NULL;
+}
+
+void M_AddBindToCategory(bindcategory_t *c, char *command, char *description)
+{
+ for (b = &c->binds;*b;*b = &(*b)->next);
+ *b = Z_Alloc(sizeof(binditem_t) + strlen(command) + 1 + strlen(description) + 1);
+ *b->command = (char *)((*b) + 1);
+ *b->description = *b->command + strlen(command) + 1;
+ strcpy(*b->command, command);
+ strcpy(*b->description, description);
+}
+
+void M_AddBind (char *category, char *command, char *description)
+{
+ for (c = &bindcategories;*c;c = &(*c)->next)
+ {
+ if (!strcmp(category, (*c)->name))
+ {
+ M_AddBindToCategory(*c, command, description);
+ return;
+ }
+ }
+ *c = Z_Alloc(sizeof(bindcategory_t));
+ M_AddBindToCategory(*c, command, description);
+}
+
+void M_DefaultBinds (void)
+{
+ M_ClearBinds();
+ M_AddBind("movement", "+jump", "jump / swim up");
+ M_AddBind("movement", "+forward", "walk forward");
+ M_AddBind("movement", "+back", "backpedal");
+ M_AddBind("movement", "+left", "turn left");
+ M_AddBind("movement", "+right", "turn right");
+ M_AddBind("movement", "+speed", "run");
+ M_AddBind("movement", "+moveleft", "step left");
+ M_AddBind("movement", "+moveright", "step right");
+ M_AddBind("movement", "+strafe", "sidestep");
+ M_AddBind("movement", "+lookup", "look up");
+ M_AddBind("movement", "+lookdown", "look down");
+ M_AddBind("movement", "centerview", "center view");
+ M_AddBind("movement", "+mlook", "mouse look");
+ M_AddBind("movement", "+klook", "keyboard look");
+ M_AddBind("movement", "+moveup", "swim up");
+ M_AddBind("movement", "+movedown", "swim down");
+ M_AddBind("weapons", "+attack", "attack");
+ M_AddBind("weapons", "impulse 10", "next weapon");
+ M_AddBind("weapons", "impulse 12", "previous weapon");
+ M_AddBind("weapons", "impulse 1", "select weapon 1 (axe)");
+ M_AddBind("weapons", "impulse 2", "select weapon 2 (shotgun)");
+ M_AddBind("weapons", "impulse 3", "select weapon 3 (super )");
+ M_AddBind("weapons", "impulse 4", "select weapon 4 (nailgun)");
+ M_AddBind("weapons", "impulse 5", "select weapon 5 (super nailgun)");
+ M_AddBind("weapons", "impulse 6", "select weapon 6 (grenade launcher)");
+ M_AddBind("weapons", "impulse 7", "select weapon 7 (rocket launcher)");
+ M_AddBind("weapons", "impulse 8", "select weapon 8 (lightning gun)");
+}
+*/
+
+
+int keys_cursor;
+int bind_grab;
+
+void M_Menu_Keys_f (void)
+{
+ key_dest = key_menu;
+ m_state = m_keys;
+ m_entersound = true;
+}
+
+#define NUMKEYS 5
+
+void M_FindKeysForCommand (char *command, int *keys)
+{
+ int count;
+ int j;
+ char *b;
+
+ for (j = 0;j < NUMKEYS;j++)
+ keys[j] = -1;
+
+ count = 0;
+
+ for (j=0 ; j<256 ; j++)
+ {
+ b = keybindings[j];
+ if (!b)
+ continue;
+ if (!strcmp (b, command) )
+ {
+ keys[count++] = j;
+ if (count == NUMKEYS)
+ break;
+ }
+ }
+}
+
+void M_UnbindCommand (char *command)
+{
+ int j;
+ char *b;
+
+ for (j=0 ; j<256 ; j++)
+ {
+ b = keybindings[j];
+ if (!b)