@@ -1758,10 +1758,30 @@ void textui_browse_object_knowledge(const char *name, int row) } /* =================== TERRAIN FEATURES ==================================== */ /* Many-to-one grouping */ +// Current editting type +static enum grid_light_level f_uik_lighting = FEAT_LIGHTING_LIT; + +// Display an individual tile cell +static void display_feature_current(int *col, int row, + feature_type *f_ptr, enum grid_light_level test_lighting) +{ + if (test_lighting == f_uik_lighting) + { + big_pad(*col, row,TERM_SLATE,'['); + } + *col += 1; + *col += big_pad(*col, row, f_ptr->x_attr[test_lighting], + f_ptr->x_char[test_lighting]); + if (test_lighting == f_uik_lighting) + { + big_pad(*col, row,TERM_SLATE,']'); + } +} + /* * Display the features in a group. */ static void display_feature(int col, int row, bool cursor, int oid ) { @@ -1769,18 +1789,44 @@ static void display_feature(int col, int row, bool cursor, int oid ) byte attr = curs_attrs[CURS_KNOWN][(int)cursor]; c_prt(attr, f_ptr->name, row, col); if (tile_height == 1) { - /* Display symbols */ - col = 66; - col += big_pad(col, row, f_ptr->x_attr[FEAT_LIGHTING_DARK], - f_ptr->x_char[FEAT_LIGHTING_DARK]); - col += big_pad(col, row, f_ptr->x_attr[FEAT_LIGHTING_LIT], - f_ptr->x_char[FEAT_LIGHTING_LIT]); - col += big_pad(col, row, f_ptr->x_attr[FEAT_LIGHTING_BRIGHT], - f_ptr->x_char[FEAT_LIGHTING_BRIGHT]); + if (cursor) + { + /* Display symbols */ + col = 66; + display_feature_current(&col, row, f_ptr,FEAT_LIGHTING_DARK); + display_feature_current(&col, row, f_ptr,FEAT_LIGHTING_BRIGHT); + display_feature_current(&col, row, f_ptr,FEAT_LIGHTING_LIT); + } + else + { + /* Display symbols */ + col = 67; + big_pad(col, row, f_ptr->x_attr[FEAT_LIGHTING_DARK], + f_ptr->x_char[FEAT_LIGHTING_LIT]); + col += 2; + big_pad(col, row, f_ptr->x_attr[FEAT_LIGHTING_BRIGHT], + f_ptr->x_char[FEAT_LIGHTING_BRIGHT]); + col += 2; + big_pad(col, row, f_ptr->x_attr[FEAT_LIGHTING_LIT], + f_ptr->x_char[FEAT_LIGHTING_LIT]); + } + col = 74; + } + else + { + col = 67 + } + if (cursor) + { + switch (f_uik_lighting) { + case FEAT_LIGHTING_DARK: c_prt(TERM_L_DARK, "DARK", row, col); break; + case FEAT_LIGHTING_LIT: c_prt(TERM_WHITE, "LIT", row, col); break; + default: c_prt(TERM_YELLOW, "LAMP", row, col); + } } } static int f_cmp_fkind(const void *a, const void *b) @@ -1795,12 +1841,11 @@ static int f_cmp_fkind(const void *a, const void *b) /* order by feature name */ return strcmp(fa->name, fb->name); } static const char *fkind_name(int gid) { return feature_group_text[gid]; } -/* Disgusting hack to allow 3 in 1 editting of terrain visuals */ -static enum grid_light_level f_uik_lighting = FEAT_LIGHTING_LIT; + /* XXX needs *better* retooling for multi-light terrain */ static byte *f_xattr(int oid) { return &f_info[oid].x_attr[f_uik_lighting]; } static char *f_xchar(int oid) { return &f_info[oid].x_char[f_uik_lighting]; } static void feat_lore(int oid) { (void)oid; /* noop */ } static const char *feat_prompt(int oid) @@ -1815,18 +1860,18 @@ static const char *feat_prompt(int oid) static void f_xtra_act(struct keypress ch, int oid) { /* XXX must be a better way to cycle this */ if (ch.code == 'l') { switch (f_uik_lighting) { - case FEAT_LIGHTING_LIT: f_uik_lighting = FEAT_LIGHTING_BRIGHT; break; - case FEAT_LIGHTING_BRIGHT: f_uik_lighting = FEAT_LIGHTING_DARK; break; + case FEAT_LIGHTING_DARK: f_uik_lighting = FEAT_LIGHTING_BRIGHT; break; + case FEAT_LIGHTING_LIT: f_uik_lighting = FEAT_LIGHTING_DARK; break; default: f_uik_lighting = FEAT_LIGHTING_LIT; break; } } else if (ch.code == 'L') { switch (f_uik_lighting) { - case FEAT_LIGHTING_DARK: f_uik_lighting = FEAT_LIGHTING_BRIGHT; break; - case FEAT_LIGHTING_LIT: f_uik_lighting = FEAT_LIGHTING_DARK; break; + case FEAT_LIGHTING_LIT: f_uik_lighting = FEAT_LIGHTING_BRIGHT; break; + case FEAT_LIGHTING_BRIGHT: f_uik_lighting = FEAT_LIGHTING_DARK; break; default: f_uik_lighting = FEAT_LIGHTING_LIT; break; } } } @@ -1856,11 +1901,11 @@ static void do_cmd_knowledge_features(const char *name, int row) features[f_count++] = i; /* Currently no filter for features */ } display_knowledge("features", features, f_count, fkind_f, feat_f, - " Sym"); + " Sym"); FREE(features); }