回精華區
作者itoc, 信區: itoc
標題[功能] 整行光棒(12)-song.c 點歌
時間03/07/15
作者: itoc (綠巨人好客?) 看板: itoc
標題: [功能] 整行光棒(12)-song.c 點歌
時間: Tue Jul 15 11:11:29 2003                          Updated: 2005/10/07

: song.c:song_item_bar()  加在 song_item() 後面

#ifdef HAVE_LIGHTBAR
static int
song_item_bar(xo, mode)
  XO *xo;
  int mode;     /* 1:上光棒  0:去光棒 */
{
  HDR *hdr;
  int xmode, gtype;

  hdr = (HDR *) xo_pool + xo->pos - xo->top;
  xmode = hdr->xmode;
  gtype = (char) 0xba;

  /* 目錄用實心,不是目錄用空心 */
  if (xmode & GEM_FOLDER)               /* 文章:◇ 卷宗:◆ */
    gtype += 1;

  if (hdr->xname[0] == '@')             /* 資料:☆ 分類:★ */
    gtype -= 2;
  else if (xmode & GEM_BOARD)           /*         看板:■ */
    gtype += 2;

  prints("%s%6d%c \241%c %-.*s%s",
    mode ? "\033[44m" : "",         //這裡是光棒的顏色,可以自己改
    xo->pos + 1, xmode & GEM_RESTRICT ? ')' : ' ', gtype, d_cols + 64,
    (xmode & GEM_RESTRICT) && !(xo->key & GEM_M_BIT) ? MSG_DATA_CLOAK :
    hdr->title,
    mode ? "\033[m" : "");

  return XO_NONE;
}
#endif

: song.c:song_cb[]

static KeyFunc song_cb[] =
{
#ifdef HAVE_LIGHTBAR
  XO_ITEM, song_item_bar,
#endif
...

--
| Origin |  MapleBBS-itoc 動力核心  processor.tfcis.org 
| Author | itoc.dorm11.nctu.edu.tw
精華選讀←離開[主題上]主題下(k)上篇(j)下篇S/a搜尋 G串列 TAB精華 ↑↓捲 Pg/Space翻