⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 a_common.pl

📁 AndyChat 是一种用Perl 来编写的多协议的控制台聊天程序。它的目的在于提供一种共同的控制台界面
💻 PL
📖 第 1 页 / 共 3 页
字号:
        elsif ($acrns eq 4)        {          LordWrite($userboxwin, "n");        }        elsif ($acrns eq 16)        {          LordWrite($userboxwin, "!");        }        elsif ($acrns eq 2)        {          LordWrite($userboxwin, "d");        }        elsif ($acrns eq 32)        {          LordWrite($userboxwin, "f");        }        textcolor($userboxwin, 15);      }      else      {        addstr($userboxwin, " "); textcolor($userboxwin, 15);      }      if (reallength(DoubleQuote($usr[$thiswin][$ac_j]{name})) > 12)      {        LordWrite($userboxwin, substr(DoubleQuote($usr[$thiswin][$ac_j]{name}), 0, 12));        textcolor($userboxwin, 12); addstr($userboxwin, ">");      }      else      {        LordWrite($userboxwin, DoubleQuote($usr[$thiswin]->[$ac_j]->{name}));        addstr($userboxwin, strpadd("", 13 - reallength(DoubleQuote($usr[$thiswin][$ac_j]{name})), " "));      }    }  }#  if ($lusers > $ac_i)#  {#    clrtobot($userboxwin);##    for ($ac_j = 1; $ac_j <= $lusers - $ac_i; $ac_j++)##    {##      addstr($ac_i + $ac_j + 1, $maxx - 15, SPACEs(14));##    }#  }  RestoreModes();  refresh($userboxwin);#  $lusers = $ac_i;}sub RedrawLines {  my ($acrlj) = @_;  my ($_line, @_lines);  if ($leftwindow ne 4) { return; }  SaveModes($channelwin);  my $acrli;  erase($channelwin);#  refresh($channelwin);  for ($acrli = 0; $acrli <= $maxy - 6; $acrli++)  {    if ($window[$thiswin]{scrollback})    {      $_line = $chline[$thiswin]->[$maxy - 6 - $acrli + $window[$thiswin]{scrollback}];    }    else    {      $_line = $chline[$thiswin][$maxy - 6 - $acrli];    }    if ($_line)    {      gotoxy($channelwin, 0, $acrli);      LordWrite($channelwin, $_line);    }  }  RestoreModes($channelwin);  refresh($channelwin);}sub RedrawLines_old {  my ($acrlj) = @_;  my ($_line, @_lines);  if ($leftwindow ne 4) { return; }  SaveModes();  my $acrli;  clear($channelwin);  textcolor(7);  gotoxy($channelwin, 0, $maxy - 5); addstr($channelwin, "\n");  for ($acrli = $maxy - 5; $acrli >= 1; $acrli--)  {#    refresh($channelwin);#    gotoxy(1, $maxy - 3 - $acrli);#    if ($chsline[$thiswin]->[$acrli - 1] && $chsline[$thiswin]->[$acrli] && length($chsline[$thiswin]->[$acrli - 1]) < length($chsline[$thiswin]->[$acrli]) && $acrlj)#    {#      LordWrite($channelwin, $chline[$thiswin]->[$acrli - 1]);#      addstr($channelwin, strpadd("", length($chsline[$thiswin]->[$acrli]) - length($chsline[$thiswin]->[$acrli - 1]), " "));#    }#    elsif ($chsline[$thiswin]->[$acrli - 1])#    {#    }#      addstr($channelwin, ".");      if ($window[$thiswin]{scrollback})      {        if ($chline[$thiswin][$acrli - 1 + $window[$thiswin]{scrollback}])        {#          unshift @_lines, $chline[$thiswin]->[$acrli - 1 + $window[$thiswin]{scrollback}];          $_line = $chline[$thiswin]->[$acrli - 1 + $window[$thiswin]{scrollback}];        }      }      else      {        if ($chline[$thiswin][$acrli - 1])        {#          unshift @_lines, $chline[$thiswin]->[$acrli - 1];          $_line = $chline[$thiswin]->[$acrli - 1];        }      }#      if ($acrli < $maxy - 5)#      {#        addstr($channelwin, "\n");#      }    if ($_line)    {      gotoxy(0, $maxy - 3 - $acrli);      addstr($channelwin, $_line);      $_line = "";    }  }  RestoreModes();  refresh($channelwin);}sub ReLabel {  SaveModes();  gotoxy($maxx - 15, $maxy - 2);  addstr(strpadd("", 14 - length($progname), " "));  LordWrite($progname);  RestoreModes();}sub ReTitle {  my ($z1, $z2) = @_;  if ($leftwindow eq 4 || $z2)  {    SaveModes();    gotoxy(1, 1); textcolor($colour{topic});    if (length($z1) > $maxx - 24)    {      addstr(substr($z1, 0, $maxx - 24));#      textcolor(9);      addstr(">");    }    else    {      addstr($z1);      textcolor($colour{'border'}); hline(Lang(6), $maxx - 23 - length($z1));    }#    gotoxy($rla, $rlb); attrset($mainwin, $rlc);    RestoreModes();  }}sub RedrawActivity {  my ($acraz) = @_;  if (! $config{show_activity}) { return; }  SaveModes();  gotoxy(1, $maxy - 1);  if ($acraz)  {    textcolor($colour{border});    hline(Lang(6), $windowcount + 1);  }  else  {    my $acr_i; for ($acr_i = 1; $acr_i <= $windowcount; $acr_i++)    {      if (! $window[$acr_i]{protocol})      {        addstr(" ");      }      elsif ($acr_i eq $thiswin)      {        if ($window[$thiswin]{unseen} && ! $window[$thiswin]{scrollback} && $leftwindow eq 4) { $window[$thiswin]{unseen} = ""; }        textcolor(15);        addstr(substr($acr_i, -1, 1));      }      elsif ($window[$acr_i]{unseen})      {        textcolor($window[$acr_i]{protocol} + 8);        addstr(substr($acr_i, -1, 1));      }      else      {        textcolor($window[$acr_i]{protocol});        addstr(substr($acr_i, -1, 1));      }    }    if ($lastwincount && $windowcount < $lastwincount)    {      textcolor($colour{border});      hline(Lang(6), $lastwincount - $windowcount);    }    $lastwincount = $windowcount;  }  RestoreModes();}sub RedrawChanInfo {  my ($srv);  if (! $window[$thiswin]{protocol} || $window[$thiswin]{protocol} ne 2)  {    SaveModes();    gotoxy(1, $maxy - 3); textcolor($colour{'border'}); hline(Lang(6), $maxx - 17);    RestoreModes();  }  elsif ($window[$thiswin]{protocol} && $window[$thiswin]{protocol} eq 2 && $config{show_ircinfo})  {    $srv = irc__whichServer($window[$thiswin]{control});    SaveModes();    gotoxy(1, $maxy - 3);    LordWrite("`1[");    if ($my[$thiswin]{op})    {      LordWrite("`#@");    }    elsif ($my[$thiswin]{voice})    {      LordWrite("`#+");    }    LordWrite("`9$irc__server[$srv]{name}");    if ($irc__server[$srv]{modes})    {      LordWrite("`1(+`9$irc__server[$srv]{modes}`1)");    }    LordWrite("`1]");    addch(Lang(6));    LordWrite("[");    if ($window[$thiswin]{channel})    {      LordWrite("`9$window[$thiswin]{channel}");      if ($window[$thiswin]{modes})      {        LordWrite("`1(+`9$window[$thiswin]{modes}");        if ($window[$thiswin]{limit})        {          LordWrite(" $window[$thiswin]{limit}");        }        if ($window[$thiswin]{key})        {          LordWrite(" $window[$thiswin]{key}");        }        LordWrite("`1)");      }    }    LordWrite("`1]");    if ($window[$thiswin]{query})    {      addch(Lang(6));      LordWrite("[Query: `9" . DoubleQuote($window[$thiswin]{query}) . "`1]");    }    if ($window[$thiswin]{scrollback})    {      addch(Lang(6));      LordWrite("[--`9more`1--");      if ($window[$thiswin]{unseen})      {        LordWrite("(`9$window[$thiswin]{unseen}`1)");      }      LordWrite("]");    }#   textcolor(9); addstr(">");    textcolor($colour{'border'}); hline(Lang(6), $maxx - 16 - wherex());    RestoreModes();  }#  elsif ($window[$thiswin]{protocol})#  {#    gotoxy(1, $maxy - 3); textcolor($colour{'border'}); hline(Lang(6), $maxx - 17);#  }}sub DrawMainScreen {  my ($mode) = @_;  SaveModes();  if (! $mode || $mode eq 1)  {    textcolor($colour{'border'});    addch(1, 0, Lang(5));    hline(Lang(6), $maxx - 22);    textcolor($colour{'time'});#    addstr(1, $maxx - 21, "00:00");    addstr(1, $maxx - 21, substr(qbTIME, 0, 5));    textcolor($colour{'border'});    addch(1, $maxx - 16, Lang(7));    hline(Lang(6), 3);    textcolor($colour{date});#    addstr(1, $maxx - 12, "12/12/12");    addstr(1, $maxx - 12, substr(qbDATE, 0, 2) . "/" . substr(qbDATE, 3, 2) . "/" . substr(qbDATE, -2, 2));    textcolor($colour{border});    gotoxy($maxx - 4, 1);    hline(Lang(6), 3);    addch(1, $maxx - 1, Lang(8));    gotoxy(0, 2);    vline(Lang(9), $maxy - 5);    gotoxy($maxx - 16, 2);    vline(Lang(9), $maxy - 5);    gotoxy($maxx - 1, 2);    vline(Lang(9), $maxy - 5);#    gotoxy(0, $maxy - 3);    addch($maxy - 3, 0, Lang(10));    hline(Lang(6), $maxx - 17);    addch($maxy - 3, $maxx - 16, Lang(11));    hline(Lang(6), 14);    addch($maxy - 3, $maxx - 1, Lang(12));    gotoxy(0, $maxy - 2);    vline(Lang(9), 1);    gotoxy($maxx - 16, $maxy - 2);    vline(Lang(9), 1);    gotoxy($maxx - 1, $maxy - 2);    vline(Lang(9), 1);    addch($maxy - 1, 0, Lang(13));    hline(Lang(6), $maxx - 17);    addch($maxy - 1, $maxx - 16, Lang(14));    hline(Lang(6), 14);    addch($maxy - 1, $maxx - 1, Lang(15));    textcolor(8);    addstr($maxy - 1, $maxx - 15, "M:00");    addstr($maxy - 1, $maxx - 5, "P:00");#    gotoxy(3, $maxy - 2); LordWrite("`2A`0ndy`2C`0hat`9!");#    textcolor($colour{game});#    addstr(5, $maxx - 16, "0");#    addstr(9, $maxx - 16, "0");#    addstr(13, $maxx - 16, "0");#    addstr(17, $maxx - 16, "0");    ReLabel();  }  if (! $mode || $mode eq 2)  {    RedrawNicks;    RedrawActivity;    RedrawChanInfo();    if ($window[$thiswin]{channel})    {      if ($window[$thiswin]{topic})      {        ReTitle("[" . $window[$thiswin]{channel} . "] " . $window[$thiswin]{topic}, 1);      }      else      {        ReTitle("[" . $window[$thiswin]{channel} . "]", 1);      }    }    else    {      ReTitle("[New Window]", 1);    }  }  if (! $mode || $mode eq 3)  {    ClearChatWindow();    RedrawLines();  }  if (! $mode)  {    textcolor($colour{'topline'});       addstr(0, 0, " AndyChat v3.00

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -