Changeset 867

Show
Ignore:
Timestamp:
04/29/08 21:48:03 (3 months ago)
Author:
takkaria
Message:

A little further tweaking:

  • Move curs_attrs[][] into ui-menu.c, and merely extern it in ui-menu.h
  • Remove two curious and undocumented variables from ui-menu.c
  • Remove a misleading extern in ui-menu.h
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/ui-menu.c

    r865 r867  
    2020#include "ui-menu.h" 
    2121 
     22/* Cursor colours */ 
     23const byte curs_attrs[2][2] = 
     24{ 
     25        { TERM_SLATE, TERM_BLUE },      /* Greyed row */ 
     26        { TERM_WHITE, TERM_L_BLUE }     /* Valid row */ 
     27}; 
     28 
    2229/* Some useful constants */ 
    2330const char lower_case[] = "abcdefghijklmnopqrstuvwxyz"; 
    2431const char upper_case[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; 
    25  
    26 int jumpscroll = 0; 
    27 int menu_width = 23; 
    2832 
    2933/* forward declarations */ 
     
    208212        /* Keep a certain distance from the top when possible */ 
    209213        if ((cursor <= *top) && (*top > 0)) 
    210                 *top = cursor - jumpscroll - 1; 
     214                *top = cursor - 1; 
    211215 
    212216        /* Keep a certain distance from the bottom when possible */ 
    213217        if (cursor >= *top + (rows_per_page - 1)) 
    214                 *top = cursor - (rows_per_page - 1) + 1 + jumpscroll
     218                *top = cursor - (rows_per_page - 1) + 1
    215219 
    216220        /* Limit the top to legal places */ 
     
    270274        int rows_per_page = loc->page_rows; 
    271275        int cols = (n + rows_per_page - 1) / rows_per_page; 
    272         int colw = menu_width
     276        int colw = 23
    273277 
    274278        Term_get_size(&w, &h); 
  • trunk/src/ui-menu.h

    r865 r867  
    1313 
    1414/* Colors for interactive menus */ 
    15 enum { 
     15enum 
     16
    1617        CURS_UNKNOWN = 0,               /* Use gray; dark blue for cursor */ 
    1718        CURS_KNOWN = 1                  /* Use white; light blue for cursor */ 
    1819}; 
    19 static const byte curs_attrs[2][2] = 
    20 
    21         {TERM_SLATE, TERM_BLUE},                /* Greyed row */ 
    22         {TERM_WHITE, TERM_L_BLUE}               /* Valid row */ 
    23 }; 
     20 
     21/* Cursor colours for different states */ 
     22extern const byte curs_attrs[2][2]; 
    2423 
    2524/* Standard menu orderings */ 
    26 extern const char default_choice[];             /* 1234567890A-Za-z */ 
    2725extern const char lower_case[];                 /* abc..z */ 
    2826extern const char upper_case[];                 /* ABC..Z */