尝试启用公告功能
This commit is contained in:
@@ -187,16 +187,36 @@ function NET.getAvatar(uid)
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
function NET.getNotice(lang,count)
|
|
||||||
|
function NET.launchNotice()
|
||||||
|
local lang=SETTING.locale:find('zh') and 'zh_cn' or 'en_us'
|
||||||
|
TASK.new(function()
|
||||||
|
local res=getMsg({
|
||||||
|
pool='getNotice',
|
||||||
|
path='/techmino/api/v1/notice?language='..lang..'&lastCount=1',
|
||||||
|
},6.26)
|
||||||
|
|
||||||
|
if res and res.code==200 then
|
||||||
|
local opt=res.data.contents[1]
|
||||||
|
if opt then
|
||||||
|
MES.new('info',opt.content,12.6)
|
||||||
|
else
|
||||||
|
MES.new('info',text.Techrater.NoticeManager.noticeNotFound)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
function NET.getNotice(count)
|
||||||
|
local lang=SETTING.locale:find('zh') and 'zh_cn' or 'en_us'
|
||||||
WAIT{timeout=6.26}
|
WAIT{timeout=6.26}
|
||||||
TASK.new(function()
|
TASK.new(function()
|
||||||
local res=getMsg({
|
local res=getMsg({
|
||||||
pool='getNotice',
|
pool='getNotice',
|
||||||
path='/techmino/api/v1/notice?language='..(lang or 'zh_cn')..'&lastCount='..(count or 5),
|
path='/techmino/api/v1/notice?language='..lang..'&lastCount='..(count or 5),
|
||||||
},6.26)
|
},6.26)
|
||||||
|
|
||||||
if res and res.code==200 and type(res.data)=='string' then
|
if res and res.code==200 then
|
||||||
local dataStr=""
|
local dataStr=TABLE.dump(res.data)
|
||||||
SCN.go('notice',nil,dataStr)
|
SCN.go('notice',nil,dataStr)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|||||||
@@ -193,6 +193,7 @@ function scene.enter()
|
|||||||
maxProgress=10
|
maxProgress=10
|
||||||
t1,t2=0,0-- Timer
|
t1,t2=0,0-- Timer
|
||||||
animeType={} for i=1,#SVG_TITLE_FILL do animeType[i]=math.random(#titleTransform) end-- Random animation type
|
animeType={} for i=1,#SVG_TITLE_FILL do animeType[i]=math.random(#titleTransform) end-- Random animation type
|
||||||
|
NET.launchNotice()
|
||||||
end
|
end
|
||||||
function scene.leave()
|
function scene.leave()
|
||||||
SCN.go('quit','none')
|
SCN.go('quit','none')
|
||||||
|
|||||||
@@ -104,8 +104,7 @@ function scene.keyDown(key,isRep)
|
|||||||
end
|
end
|
||||||
elseif key=='3' then
|
elseif key=='3' then
|
||||||
if _testButton(10) then
|
if _testButton(10) then
|
||||||
MES.new('warn',text.notFinished)
|
NET.getNotice()
|
||||||
-- NET.getNotice()
|
|
||||||
end
|
end
|
||||||
elseif key=='4' then
|
elseif key=='4' then
|
||||||
if _testButton(11) then
|
if _testButton(11) then
|
||||||
@@ -221,7 +220,7 @@ scene.widgetList={
|
|||||||
WIDGET.newButton{name='replays',x=2480,y=570,w=800,h=100, color='lC',font=40,align='L',edge=30,code=pressKey','},
|
WIDGET.newButton{name='replays',x=2480,y=570,w=800,h=100, color='lC',font=40,align='L',edge=30,code=pressKey','},
|
||||||
|
|
||||||
WIDGET.newButton{name='music', x=90,y=80,w=100, color='lY',code=pressKey'2',font=70,fText=CHAR.icon.music},
|
WIDGET.newButton{name='music', x=90,y=80,w=100, color='lY',code=pressKey'2',font=70,fText=CHAR.icon.music},
|
||||||
WIDGET.newButton{name='notice', x=210,y=80,w=100, color='D',code=pressKey'3',font=70,fText=CHAR.key.winMenu},
|
WIDGET.newButton{name='notice', x=210,y=80,w=100, color='lG',code=pressKey'3',font=70,fText=CHAR.key.winMenu},
|
||||||
WIDGET.newButton{name='lang', x=330,y=80,w=100, color='lN',code=pressKey'4',font=70,fText=CHAR.icon.language},
|
WIDGET.newButton{name='lang', x=330,y=80,w=100, color='lN',code=pressKey'4',font=70,fText=CHAR.icon.language},
|
||||||
WIDGET.newButton{name='about', x=-110,y=670,w=600,h=70, color='lB',align='R',edge=20,code=pressKey'x',font=50,fText=CHAR.icon.info},
|
WIDGET.newButton{name='about', x=-110,y=670,w=600,h=70, color='lB',align='R',edge=20,code=pressKey'x',font=50,fText=CHAR.icon.info},
|
||||||
WIDGET.newButton{name='manual', x=1390,y=670,w=600,h=70, color='lR',align='L',edge=20,code=pressKey'm',font=50,fText=CHAR.icon.help},
|
WIDGET.newButton{name='manual', x=1390,y=670,w=600,h=70, color='lR',align='L',edge=20,code=pressKey'm',font=50,fText=CHAR.icon.help},
|
||||||
|
|||||||
Reference in New Issue
Block a user