Преглед изворни кода

fix: 修复 xtt.ListVar 和 xtt.ListTicker 发现的一些小问题

多数是没有给符号归类,少量则属于应当局部化而没有局部化。
dzp пре 3 година
родитељ
комит
17014957d0

+ 2 - 0
framework/log.tin

@@ -24,6 +24,7 @@ PaoTin++ © 2020~2022 的所有版权均由担子炮(dzp <danzipao@gmail.com>) 
 #function {InitLog} {
     #local path {%1};
 
+    #local output {};
     #script output {test -d var && echo true || echo false};
     #if { "$output[1]" == "true" } {
         #var gLog[PATH] {var/log};
@@ -53,6 +54,7 @@ PaoTin++ © 2020~2022 的所有版权均由担子炮(dzp <danzipao@gmail.com>) 
 #alias {dbgLog}     {log.write {$gLog[debug]}  {%0}};
 
 #alias {{[a-z]{1,10}}Log %*} {
+    #local logName {};
     #format logName {%l} {%1};
     log.write {${logName}.log} {%2};
 };

+ 5 - 0
framework/main.tin

@@ -121,6 +121,11 @@ PaoTin++ © 2020~2022 的所有版权均由担子炮(dzp <danzipao@gmail.com>) 
     load-file ids/DEFAULT;
 };
 
+#var session    {};
+#var user       {};
+#var char       {};
+#var info       {};
+
 init;
 
 #class main close;

+ 4 - 0
framework/multi-mud.tin

@@ -10,6 +10,8 @@ PaoTin++ © 2020~2022 的所有版权均由担子炮(dzp <danzipao@gmail.com>) 
 ===========
 */
 
+#class main open;
+
 #var gMUDLIB {
     {pkuxkx} {北大侠客行}
     {thuxyj} {清华西游记}
@@ -36,3 +38,5 @@ PaoTin++ © 2020~2022 的所有版权均由担子炮(dzp <danzipao@gmail.com>) 
 
     #var gCurrentMUDLIB {$id};
 };
+
+#class main close;

+ 4 - 0
framework/online.tin

@@ -10,6 +10,8 @@ PaoTin++ © 2020~2022 的所有版权均由担子炮(dzp <danzipao@gmail.com>) 
 ===========
 */
 
+#class main open;
+
 #nop 一些中文 MUD 服务器在接收到 quit 命令时会让角色从服务器上下线,;
 #nop 这往往会导致玩家丢失背包里的物品。;
 #nop 为了避免悲剧发生,这里特别映射一下,改成仅断开连接,而不退出服务器角色。;
@@ -51,3 +53,5 @@ PaoTin++ © 2020~2022 的所有版权均由担子炮(dzp <danzipao@gmail.com>) 
     #undelay KeepAlive;
     #delay KeepAlive {#zap} 180;
 };
+
+#class main close;

+ 2 - 0
mud/pkuxkx/plugins/lib/ui/chat.tin

@@ -4,6 +4,8 @@
     {AUTHOR}    {担子炮}
 };
 
+#var chat-channel {};
+
 #list chat-channel create {
     {{pattern}{求助}                        {action}{helpmeLog}     {gag}{true}}
     {{pattern}{北侠QQ群}                    {action}{qqLog}         {gag}{true}}

+ 2 - 0
plugins/lib/gmcp.tin

@@ -31,6 +31,8 @@ option.Define {GMCPDebug} {Bool} {是否显示 GMCP 原始数据} {false};
     #line sub var #event {IAC SB GMCP $key IAC SE} {$handler};
 };
 
+#var gGMCP {};
+
 #alias {gmcp.pkuxkx.Enable} {
     gmcp.Handle GMCP.Move {
         #line sub escape #var gGMCP[Move] {%%0};

+ 2 - 0
plugins/lib/option.tin

@@ -13,7 +13,9 @@ PaoTin++ © 2020~2022 的所有版权均由担子炮(dzp <danzipao@gmail.com>) 
 };
 
 #function {lib_option.Init} {
+    #class lib/option open;
     #var gOptions {};
+    #class lib/option close;
     #return {true};
 };
 

+ 4 - 0
plugins/lib/ui/prompt.tin

@@ -100,6 +100,7 @@ tt++ table 由一组选项和与之对应的选项值来组成,用来说明想
    倒计时结束后,如果 cooldown 时间比倒计时时间还要长,则还会继续显示一段时间之
    后才会被隐藏。
 */
+#var prompt-fields {};
 #list prompt-fields create {};
 
 #nop 配色主题,注意这里不要直接嵌入 SGR(ansi codes),否则计算宽度时会有问题。;
@@ -122,6 +123,7 @@ tt++ table 由一组选项和与之对应的选项值来组成,用来说明想
 };
 
 #nop 热键绑定;
+#var global-key-bindings {};
 #list global-key-bindings create {
     {{key}{\cos}    {action}{prompt.ToggleSwitch}}
 };
@@ -335,6 +337,7 @@ tt++ table 由一组选项和与之对应的选项值来组成,用来说明想
             #local fields {$botLines[$line]};
             #local text {@__prompt_build_line__{{$fields}}};
             #if { $text[width] > 0 } {
+                #local realLine {};
                 #math realLine {$line - $botMaxLine - 1};
                 #list content {add} {{{line}{$realLine}{text}{$text[text]}}};
             };
@@ -356,6 +359,7 @@ tt++ table 由一组选项和与之对应的选项值来组成,用来说明想
     #if { "${prompt-top-max-line}" != "$topMaxLine" || "${prompt-bot-max-line}" != "$botMaxLine" } {
         #local lineWidth {};
         #screen get COLS lineWidth;
+        #local spaceLine {};
         #format spaceLine {%-${lineWidth}s} {};
 
         #local newMax {$topMaxLine};