1616from EsportsHelper .Stats import stats
1717from EsportsHelper .Utils import colorFlicker , getWebhookInfo , \
1818 getConfigInfo , getLiveRegionsInfo , getNextMatchTimeInfo , \
19- getDropInfo , getSleepBalloonsInfo , cleanBriefInfo , \
19+ getSessionDropInfo , getSleepBalloonsInfo , cleanBriefInfo , \
2020 getLiveInfo , getInfo , getWarningInfo , formatExc , getSleepPeriodInfo
2121
2222_ = i18n .getText
@@ -87,7 +87,7 @@ def run(self):
8787 )
8888
8989 is_dockerized = config .isDockerized
90- dropInfo = getDropInfo ()
90+ sessionDropInfo = getSessionDropInfo ()
9191 configInfo = getConfigInfo ()
9292 webhookInfo = getWebhookInfo ()
9393 sleepPeriodInfo = getSleepPeriodInfo ()
@@ -97,7 +97,7 @@ def run(self):
9797 style = "bold yellow" , title_align = "left" ,
9898 title = _ ('电竞助手' , color = "bold blue" ) + str (config .version ) + " " + sleepPeriodInfo ,
9999 subtitle_align = "right" , subtitle = configInfo )),
100- Layout (name = "drop" , renderable = Panel (dropInfo ,
100+ Layout (name = "drop" , renderable = Panel (sessionDropInfo ,
101101 title = _ ('运行期间掉宝' , color = "bold yellow" ),
102102 title_align = "left" , style = "bold yellow" , subtitle = webhookInfo + " 一 " + todayDropsInfo , subtitle_align = "right" ))
103103 )
@@ -133,16 +133,14 @@ def run(self):
133133 frameCount = 0
134134 with Live (layout , auto_refresh = False , console = console ) as live :
135135 while True :
136- drops = ""
137- if stats .sessionDropsDict :
138- for key in stats .sessionDropsDict :
139- drops += f"{ key } : { stats .sessionDropsDict .get (key )} \t "
140- dropInfo = drops if drops else _ ("暂无掉落" , "bold yellow" )
136+ sessionDropInfo = getSessionDropInfo ()
141137 webhookInfo = getWebhookInfo ()
142138 sessionDropNumber = len (stats .currentDropsList ) - len (stats .initDropsList )
143- Layout (name = "drop" , renderable = Panel (dropInfo ,
144- title = _ ('运行期间掉宝' , color = "bold yellow" ),
145- title_align = "left" , style = "bold yellow" , subtitle = webhookInfo + " " + todayDropsInfo , subtitle_align = "right" ))
139+ todayDropsInfo = _ ("今日掉宝" , "bold yellow" ) + f":{ stats .todayDrops } "
140+ layout ["upper" ]["banner" ]["drop" ].update (Panel (sessionDropInfo ,
141+ title = _ ('运行期间掉宝' , color = "bold yellow" ),
142+ title_align = "left" , style = "bold yellow" ,
143+ subtitle = webhookInfo + " 一 " + todayDropsInfo , subtitle_align = "right" ))
146144 layout ["upper" ]["table" ].update (setAccountTable (frameCount ))
147145
148146 cleanBriefInfo ()
@@ -167,7 +165,9 @@ def run(self):
167165 title_align = "left" , style = "bold yellow" ))
168166 layout ["lower" ]["live2" ].update (Panel ("\n " .join (liveInfo2 ), style = "bold yellow" , title_align = "left" , title = modeInfo ,
169167 subtitle = _ ("请我喝一杯咖啡" , "bold cyan" ) + ":https://github.com/Yudaotor" , subtitle_align = "right" ))
170- layout ["lower" ]["info1" ].update (Panel ("\n " .join (info1 ), subtitle = _ ("观看属地" , "bold yellow" ) + ":" + watchRegion , subtitle_align = "right" , title = _ ("简略日志" , "bold yellow" ), title_align = "left" , style = "bold yellow" ))
168+ layout ["lower" ]["info1" ].update (
169+ Panel ("\n " .join (info1 ), subtitle = _ ("观看属地" , "bold yellow" ) + ":" + watchRegion , subtitle_align = "right" , title = _ ("简略日志" , "bold yellow" ),
170+ title_align = "left" , style = "bold yellow" ))
171171 layout ["lower" ]["info2" ].update (
172172 Panel ("\n " .join (info2 ), subtitle = _ ("(详细请见log文件)" , "bold yellow" ), subtitle_align = "right" , style = "bold yellow" , title_align = "right" ,
173173 title = _ ("代挂:闲鱼店铺搜Khalilc" , "bold yellow" )))
0 commit comments