初中道德与法治七年级下册在集体中成长道德与法治-憧憬美好集体-周欣媛_第1页
初中道德与法治七年级下册在集体中成长道德与法治-憧憬美好集体-周欣媛_第2页
初中道德与法治七年级下册在集体中成长道德与法治-憧憬美好集体-周欣媛_第3页
初中道德与法治七年级下册在集体中成长道德与法治-憧憬美好集体-周欣媛_第4页
初中道德与法治七年级下册在集体中成长道德与法治-憧憬美好集体-周欣媛_第5页
已阅读5页,还剩12页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

this,widgetTable.Button_close:addTouchEventListener(close_Clicked)

end

this・widgetTable.Image_ytime=

tolua.cast(UIHelper:seekWidgetByName(this・widgetTable.工mage_bg,

nImage_ytime"),f,ImageView11)

this.widgetTable.Image_ytime:loadTexture(imagePath..Hpic_yy.png'*)

this.widgetTable.Image_cuel=

tolua.cast(UIHelper:seekWidgetByName(this.widgetTable.工mage_bg,

nImage_cueln),HImageViewH)

this.widgetTable.Image_cuel:loadTexture(imagePath..nbox_yyy.png")

this,widgetTable.Image_cue2=

tolua.cast(UIHelper:seekWidgetByName(this.widgetTable.Image_bgz

nImage_cue2n),nImageViewn)

this.widgetTable.Image_cue2:loadTexture(imagePath..nbox_ts.pngH)

this.widgetTable.Button_shake=

tolua.cast(UIHelper:seekWidgetByName(this.widgetTable.Image_bgz

nButton_shake")「Button”)

this.widgetTable.Button_shake:loadTextures(imagePath..Hbtn_kscj.pngn

“n)A

localfunctionshake_Clicked(sender,eventType)

ifeventType==2then

Log.d(nshake_Clicked")

this.sendMsgToCtrl(9,11)

this・shakeshake()

end

end

ifthis.widgetTable.Button_shakethen

this.widgetTable.Button_shake:addTouchEventListener(shake_Clicked)

end

this.widgetTable.Button_gift=

tolua.cast(UIHelper:seekWidgetByName(this.widgetTable.Image_bg,

nButton_giftn),HButtonH)

localfunctiongift_Clicked(sender,eventType)

ifeventType==2then

Log.d(Hgift_Clickedn)

this.sendMsgToCtrl(9,14)

this.giftPanelshow()

end

end

ifthis.widgetTable.Button_giftthen

this.widgetTable.Button_gift:addTouchEventListener(gift_Clieked)

end

--Image_ytimeChildren

this.widgetTable.Label_timel=

tolua.cast(UIHelper:seekWidgetByName(this.widgetTable.Image_ytime,

HLabel_timel"),T,Label")

UITools.setGameFont(this.widgetTable.Label_timel,nFZCuYuan-M03SH,

Hfzcyt.ttfn)

——Button_shakeChildren

this・widgetTable•Label_shake=

tolua.cast(UIHelper:seekWidgetByName(this.widgetTable.Button_shake,

HLabel_shaken)/Label”)

this.accelerate=Accelerate.new(layerColor)

this.hbShow()

HH

UITools.setGameFont(this.widgetTable.mainWidgetzFZCuYuan-M03S,

nfzcyt.ttf*)

this.canupdate=true

——test

--this.rockcount=0

end

functionthis.removeLayer()

Log.i(nPokerShakePanelremoveLayer'*)

ifthis.widgetTablethen

this.widgetTable={}

end

ifthis.dataTablethen

this.dataTable={}

end

ifthis.mainLayerthen

this.mainLayer=nil

end

end

functionthis.updateWithShowData(showdata)

Log.i(nPokerShakePanelupdateWithShowData11)

ifnotthis.mainLayerthen

Log.w(nPokerShakePanelmainLayerisnotready1')

return

end

ifnotshowdatathen

Log.w(nPokerShakePanelshowdataisnotready")

return

else

this.dataTable.showData=showdata

ifthis.canupdatethen

this.setShakePanel(1)

end

PLTable.print(showdata,nPokerShakePanelshowdata”)

end

end

functionthis.show(showdata)

Log.i(nPokerShakePanelshow”)

ifnotthis.mainLayerthen

this,initLayer()

end

ifshowdataandthis.mainLayerthen

this.updateWithShowData(showdata)

end

ifthis.mainLayerthen

pushNewLayer(this.mainLayer)

end

end

functionthis.close()

Log.i(nPokerShakePanelclose”)

ifthis.mainLayerthen

popLayer(this.mainLayer)

end

this,closeCountdown()

this.removeLayer()

this:dispose()

end

functionthis.sendMsgToCtrl(msgtype,msgdata,msgflag)

Log.i(nPokerShakePanel.sendMsgToCtrlmsgtype==n..msgtype)

PokerShakeCtrl.getMsgFromPanel(msgtype,msgdata,msgflag)

end

functionthis.getMsgFromCtrl(msgtype,msgdata,msgflag)

ifmsgtype==5then

—eOc3…口招a廷一6%、、和o

else

Log.i(nPokerShakePanel.getMsgFromCtrlmsgtype==n..msgtype)

end

ifmsgtype==1then

this,initLayer()

elseifmsgtype==2then

ifthis.mainLayerthen

Log.w("PokerShakePanelmainLayerisindontneed

createnewlayer")

return

end

this,initLayer()

this.show(msgdata)

elseifmsgtype==3then

this,updateWithShowData(msgdata)

elseifmsgtype==4then

this,close()

elseifmsgtype==5then

ifnotthis.mainLayerthen

Log.w(HPokerShakePanelmainLayerisnotready")

return

end

ifthis.widgetTable.Label_shakethen

Hn

localtimestr=os.date(!%H:%M:%Szmsgdata.counttime)

this.timetype=msgdata.timetype

ifmsgdata.timetype==1then

this.widgetTable.Label_shake:setText("e,□(?|»a,<ae-ij幺6□皿之〜当幺©

"・,timestr)

this.widgetTable.Label_shake:setPosition(CCPointMake(7,0))

this.widgetTable.Button_shake:setTouchEnabled(false)

this.widgetTable.Button_shake:loadTextures(imagePath..Hbtn_kscj1.png”,nn

1111)

elseifmsgdata.timetype==2then

this.widgetTable.Label_shake:setText("«oe-iee-ijq°C3(E…ae2太60^&*©a的“关一与自一‘亘,°

"・,timestr)

this.widgetTable.Label_shake:setPosition(CCPointMake(7,-15))

this.widgetTable.Button_shake:loadTextures(imagePath.・nbtn_kscj.png",

ftif)

ifthis.panelType==2orthis.panelType==3then

this.widgetTable.Button_shake:setTouchEnabled(false)

else

this・widgetTable.Button_shake:setTouchEnabled(true)

end

elseifmsgdata.timetype==3then

this,widgetTable.Label_shake:setText(naez»aS'a'2。》''在口丫")

this.widgetTable.Label_shake:setPosition(CCPointMake(7,0))

this.widgetTable.Button_shake:setTouchEnabled(false)

this.widgetTable.Button_shake:loadTextures(imagePath.."btn_kscj1.png",

ii)

elseifinsgciata.timetype==5then

this.widgetTable.Label_shake:setText("宫口,a,ZQZ©a®SIea«si^CEe--etUe->")

this.widgetTable.Label_shake:setPosition(CCPointMake(7,0))

this.widgetTable.Button_shake:setTouchEnabled(false)

this.widgetTable.Button_shake:loadTextures(imagePath..nbtn_kscj1.png",““

iiif)

else

——todo

end

end

elseifmsgtype==6then

this.dataTable.giftlist=msgdata

一一this.shortGiftlistByLevel(this.dataTable.giftlist)

elseifmsgtype==7then

--a^1at°eZ-a¥-Q*(Eee^

localshorttable=this.shortGiftlistByLevel(msgdata)

PLTable.print(shorttable)

this.getGiftPanelshow(shorttable)

else

Log.w(nPokerShakePanel.getMsgFromPanelmsgtypeisoutn)

end

end

--eD''a...a°D

functionthis.shortGiftlistByLevel(giftlist)

Log.i(nPokerShakePanelshortGiftlistByLevel'*)

localshorttable={}

shorttable.itemlist={}

--aoe0a4»Q:口

localdzTable={[”30050015”]=1,[”30050016”]=1,「30050017”]=1,

「30050018”]=1,「30050019”]=1,[”30050020”]=1}

一^tce«o;点

localnmTable={[”30050013]=1,[H30050014H]=1}

shorttable.isbig=0

ifgiftlistandtype(giftlist)==ntablenthen

forkey,valueinpairs(this.dataTable.giftlist)do

forkzvinpairs(giftlist)do

ifdzTable[tostring(v.iltemCode)]==1then

v.iltemCode=n30050015n

end

ifnmTable[tostring(v.iltemCode)]==1then

v.iltemCode="30050013”

end

print(k,v.iltemCode,v.iltemCountAv.sltemName)

iftostring(value.giftid)==

tostring(v.iltemCode)andtonumber(value.num)==tonumber(v.iItemCount)then

shorttable.itemlist[#shorttable.itemlist+1]=value

ifvalue.share==1then

shorttable.isbig=1

end

if#shorttable.itemlist==

#giftlistthen

returnshorttable

end

else

——todo

end

end

end

else

Log.w(ngiftlistisnottable")

end

returnshorttable

end

一eZ-a¥-e®°a^*aeZza0•

functionthis.shorthasCollectltems(itemslist)

Log.i(nPokerShakePanelshorthasCollectIterns,*)

localshorttable={}

ifitemslistandtype(itemslist)==ntablenthen

fork,vinpairs(itemslist)do

print(k,v.dtGetPackageTime,v.sPackageName,v.iPackage工d)

ifnotshorttable[v.dtGetPackageTime]then

shorttable[v.dtGetPackageTime]=

v,sPackageName

else

shorttable[v.dtGetPackageTime]=

shorttable[v.dtGetPackageTime]....v.sPackageName

end

--ifnotshorttable[#shorttable]then

-shorttable[#shorttable]={name=

v.sPackageName,time=v.dtGetPackageTime}

——else

——ifshorttable[#shorttable].time==

v.dtGetPackageTimethen

-shorttable[#shorttable].name=

shorttable[#shorttable].name..HiMCEH..v.sPackageName

——else

--shorttable[#shorttable+l]={name=

v.sPackageName,time=v.dtGetPackageTime}

——end

——end

shorttable[v.dtGetPackageTime][#shorttable[v.dtGetPackageTime]+1]={name=

v.sPackageName,packageid=v.iPackageld}

end

else

Log.w(nitemslistisnottable*')

returnfalse

end

returnshorttable

end

--«'+a¥-a°<a»SI

functionthis.shakeshake()

Log・i(uPokerShakePanelshakeshake”)

this•setTipsButtonEnble(false)

this,setShakePanel(2)

counttime=0

this.shaketype=1

this,closecountdown()

this.shaketime=os.time()

this.canupdate=false

cdTimer=this:setInterval(1000,this.countdown)

this・widgetTable.Label_time:setText(5-counttime)

end

functionthis.hbShow()

Log.i(nPokerShakePanelhbShow")

localImage_panel=ImageView:create()

Image_panel:ignoreContentAdaptWithSize(false)

Image_panel:setsize(CCSizeMake(this.widgetTable.Image_box:getSize().width,t

his.widgetTable.Image_box:getSize().height))

Image_panel:setPosition(CCPointMake(this.widgetTable.Image_box:getSize().wi

dth/2,this.widgetTable.Image_box:getSize().height/2))

this・widgetTable.Image_box:addChild(Image_panel)

this,widgetTable.shakehbbg=Image_panel

this.widgetTable.shakehbtable={}

fori=l,12do

localgiftimage=ImageView:create()

giftimage:loadTexture(imagePath.."icon_hb.png")

giftimage:setPosition(CCPointMake((i-1)%4*107-159,113-

(math.floor((i-1)/4)*101)))

this.widgetTable.Image_box:addChild(giftimage)

this.widgetTable.shakehbtable[#this.widgetTable.shakehbtable+1]

=giftlmage

end

end

--ae'^a¥-aS"QA,»

functionthis.startShakeAction()

Log.i(nPokerShakePanelstartShakeActionn)

fork,vinpairs(this.widgetTable.shakehbtable)do

localshake=

CCSequence:createWithTwoActions(CCRotateTo:create(0.2,-6),

CCRotateTo:create(0.2,6))

localback=

CCSequence:createWithTwoActions(CCRepeat:create(shake,22),

CCRotateTo:create(0.1,0))

——localrepeatshake=CCRepeatForever:create(shake)

v:runAction(back)

end

end

-aDoeae-^aS,Q,,»

functionthis.stopShakeAction()

Log•i(nPokerShakePanelstopShakeActionH)

fork,vinpairs(this.widgetTable.shakehbtable)do

——v:stopAHActions()

localturnback=CCRotateTo:create(0.2,0)

v:runAction(turnback)

v:stopAHActions()

end

end

--«'ta¥-QQS5[ae€n

functionthis.setShakePanel(panelType)

this.panelType=panelType

--ae(E既自,0ae〜%quOqSSlaeE•

ifpanelType==1then

this.widgetTable.Button_shake:setTouchEnabled(true)

this,widgetTable.Button_shake:setVisible(true)

this.widgetTable.Image_ytime:setVisible(true)

this.widgetTable.Image_box:setVisible(false)

this.widgetTable.Image_cuel:setVisible(false)

this.widgetTable.Image_cue2:setVisible(true)

ifthis.timetype==1then

this.widgetTable.Button_shake:setTouchEnabled(false)

elseifthis.timetype==2then

this.widgetTable.Button_shake:setTouchEnabled(true)

elseifthis.timetype==3then

this.widgetTable.Label_shake:setText(»a§"a,2q»''壬口丫”)

this.widgetTable.Label_shake:setPosition(CCPointMake(7,0))

this・widgetTable.Button_shake:setTouchEnabled(false)

this.widgetTable.Button_shake:loadTextures(imagePath..Hbtn_kscj1.png",

nn)

elseifthis.timetype==5then

this,widgetTable.Label_shake:setText(“W口,a,Z(pZ©a®3[e^taasiMCEe—•巨生口6—•”)

this.widgetTable.Label_shake:setPosition(CCPointMake(7,0))

this.widgetTable•Button_shake:setTouchEnabled(false)

this.widgetTable.Button_shake:loadTextures(imagePath..nbtn_kscj1.pngn,""

Htf)

else

——todo

end

一一q-ka^...ae'+•

elseifpanelType==2then

this.widgetTable.Button_shake:setTouchEnabled(false)

this,widgetTable.Button_shake:setVisible(false)

this.widgetTable.Image_ytime:setVisible(false)

this,widgetTable.Image_box:setVisible(true)

this.widgetTable.Image_cuel:setVisible(true)

this.widgetTable.Image_cue2:setVisible(false)

―ae'

elseifpanelType==3then

this.widgetTable.Button_shake:setTouchEnabled(false)

this.widgetTable.Button_shake:setVisible(false)

this.widgetTable.Image_ytime:setVisible(true)

this.widgetTable.Image_box:setVisible(true)

this.widgetTable.Image_cuel:setVisible(true)

this,widgetTable.Image_cue2:setVisible(false)

else

——todo

end

end

__a...3e――a€ze@jae-SI

functionthis.closeCountdown()

this.canupdate=true

ifcdTimerthencdTimer:dispose()end

end

--ze®iae-Sl

functionthis.countdown()

——print(nPokerShakeCtrlcountdown”)

counttime=os.time()-this.shaketime

ifcounttime<0orcounttime>14then

Log.w("counttimeisout")

this.closecountdown()

this.setShakePanel(1)

this.setTipsButtonEnble(true)

this.shaketype=1

elseifcounttime==0then

一一todo

elseifcounttime>=5andcounttime<13then

ifthis.shaketype==1then

this,setShakePanel(3)

this.accelerate:startRock()

this.widgetTable.Label_timel:setText(13-counttime)

this,startShakeAction()

this.shaketype=2

end

elseifcounttime>=13then

ifthis.shaketype==2then

this.closeCountdown()

this.accelerate:stopRock()

--test

-this.rocktable={0,9,10,11,25,26,40,41,42}

--ifthis.rockcount>#this.rocktablethen

--this.rockcount=1

——else

--this.rockcount=this.rockcount+1

——end

--this.accelerate.rock=this.rocktable[this.rockcount]

ifthis.accelerate.rock>=1then

this.accelerate.rock=this.accelerate.rock-1

end

Log.i(Hae'+aS"as->jae*°msH..tostring(this.accelerate.rock))

this.stopShakeAction()

this.dataTable.shakenum=this.accelerate.rock

this.sendMsgToCtrl(3,this.accelerate.rock)

-一test

——localshorttable=

this,shortGiftlistByLevel(json.decode(this.testgiftdata))

-PLTable.print(shorttable)

--this.getGiftPanelshow(shorttable)

--this.setShakePanel(1)

this.setTipsButtonEnble(true)

this.shaketype=1

end

end

this.widgetTable.Label_time:setText(5-counttime)

localx=13-counttime

ifx<0then

x=0

end

this.widgetTable.Label_timel:setText(x)

end

—W土口巨",&。砍。§自口,*灭的彩,®

functionthis.setTipsButtonEnble(isEnabled)

Log.i(nPokerShakePanelsetTipsButtonEnblen)

this.widgetTable.Button_info:setTouchEnabled(isEnabled)

this.widgetTable.Button_record:setTouchEnabled(isEnabled)

this.widgetTable.Button_gift:setTouchEnabled(isEnabled)

this.widgetTable.Button_close:setTouchEnabled(isEnabled)

end

,,e

--»aSe§z,a"™e

functionthis.infoPanelshow()

Log.i(nPokerShakePanelinfoPanelshow")

ifthis•widgetTable.tipsTouchBgthen

Log.w(nPokerShakePaneltipsTouchBgisexist,pleasecloseold

tipsTouchBgn)

return

end

localmainWidget=

GUIReader:shareReader():widgetFromJsonFile(jsonPath.."tipsbg.json")

ifnotmainWidgetthen

Log.e(nPokerShakePanelReadtipsbgWidgetFromJsonFileFail”)

return

end

—自〜2史一2©注€.匕9

localwinSize=CCDirector:sharedDirector():getWinSize()

this.widgetTable.tipsTouchBg=

tolua.cast(UIHelper:seekWidgetByName(mainWidget,HScrollViewbgf,),“ScrollView")

this.widgetTable.tipsTouchBg:setSize(winSize)

this.widgetTable.tipsTouchBg:setPosition(CCPointMake(0,0))

this,widgetTable.tipsTouchBg:setAnchorPoint(CCPointMake(0,0))

this・widgetTable.tipsTouchBg:setTouchEnabled(true)

this.widgetTable.tipsTouchBg:removeFromParent()

this.widgetTable.mainWidget:addChild(this.widgetTable.tipsTouchBg)

--this.widgetTable.tipsTouchBg=touchBg

this.widgetTable.Image_infoPanel=ImageView:create()

this.widgetTable.Image_infoPanel:loadTexture(imagePath..Hbg_popup02.pngn)

this.widgetTable•Image_infoPanel:setPosition(CCPointMake(winSize.width/2f

winSize.height/2))

this・widgetTable.tipsTouchBg:addChild(this.widgetTable.Image_infoPanel)

this.widgetTable.Button_infoPanelclose=Button:create()

this・widgetTable.Button_infoPanelclose:loadTextures(imagePath..

Hbtn_close.pngn,

this.widgetTable.Button_infoPanelclose:setPosition(CCPointMake(315,197))

localfunctioninfoPanelclose_Clicked(sender,eventType)

ifeventType==2then

Log,d(ninfoPanelclose_Clickedn)

this.tipsPanelclose()

end

end

ifthis.widgetTable.Button_infoPanelclosethen

this.widgetTable.Button_infoPanelclose:addTouchEventListener(infoPanelclose

_Clicked)

end

this.widgetTable.Image_infoPanel:addChild(this.widgetTable.Button_infoP

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论