• 注册
    • 总打赏排行
    • 今日收益排行
  • 小黄人
    小黄人
    如有问题,请发帖交流,私聊我可能看不到。
  • 兵者-设计
    兵者-设计
    他太懒了,什么都没有写
  • bmwz8
    bmwz8
    他太懒了,什么都没有写
  • 雪舞
    雪舞
    他太懒了,什么都没有写
  • 乐疯玩-雨轩(GM手游渠
    乐疯玩-雨轩(GM手游渠
    他太懒了,什么都没有写
  • ╭花落丶惜﹎
    ╭花落丶惜﹎
    他太懒了,什么都没有写
  • Lyn
    Lyn
    他太懒了,什么都没有写
    • 今日签到
    • 累计签到
  • ╭花落丶惜﹎
    ╭花落丶惜﹎
    今天00:18
  • mstscexe
    mstscexe
    今天00:42
  • bmwz8
    bmwz8
    今天03:45
  • tianshi777
    tianshi777
    今天07:27
  • 小黄人
    小黄人
    如有问题,请发帖交流,私聊我可能看不到。
  • tianshi777
  • 冰龙
    冰龙
    冰龙
  • 隔壁老王
  • zxc583700871
  • mstscexe
  • 挽弦暮笙
  • zhangxhc
  • xiang262
  • zhyy7112
  • 查看作者
  • 白日门手游添加打野刀功能图文教程

    算是自己的教程备份吧,方便以后自己修改。白日门手游添加打野刀功能图文教程,此功能比较繁琐,更改地方较多,建议备份文件,需要一定的功底,如果操作失败,请联系阿柳。

    服务器部分修改教程

    1在文件\long\script\gui\init.lua中引入

    --QQ648861400
    require "gui.PanelDayedao"

    2、long\script\gui\moduleRedPoint.lua 文件中添加红点监测

    付费或者VIP可见内容

    3,新建PanelDayedao.lua 文件

    long\script\gui\PanelDayedao.lua 

    具体代码如下

    module(... ,package.seeall)
    
    local QGL_MAX_LEVEL = 12-- 切割率最高阶
    
    local QglTable = {
        --QQ648861400 等级,当前切割率,当前概率,需要金钱,需要元宝
    	[0]={qiegelv=0,gl=0,money=5000,con=5000},
    	[1]={qiegelv=3,gl=5,money=8000,con=8000},
    	[2]={qiegelv=6,gl=10,money=10000,con=10000},
    	[3]={qiegelv=9,gl=15,money=12000,con=12000},
    	[4]={qiegelv=12,gl=20,money=15000,con=15000},
    	[5]={qiegelv=15,gl=25,money=20000,con=20000},
    	[6]={qiegelv=18,gl=30,money=25000,con=25000},
    	[7]={qiegelv=21,gl=35,money=35000,con=35000},
    	[8]={qiegelv=24,gl=40,money=45000,con=45000},
    	[9]={qiegelv=27,gl=45,money=55000,con=55000},
    	[10]={qiegelv=30,gl=50,money=65000,con=65000},
    	[11]={qiegelv=33,gl=55,money=75000,con=75000},
    	[12]={qiegelv=36,gl=60,money="MAX",con="MAX"},		
    	[13]={qiegelv="MAX",gl="MAX",money="MAX",con="MAX"},	
    }
    
    function handlePanelData(player,commond)
    	local data = util.decode(commond)
        if data.actionid=="reqDayedaoData" then
    		updateDayedaoClient(player,false)
    	elseif data.actionid=="shengJiDayedao" then
    		startUpDayedao(player)
    	end
    end
    ckpanel.add_listener("gui.PanelDayedao.handlePanelData",gui.PanelDayedao.handlePanelData)
    
    function updateDayedaoClient(player,isSucceed)
        curLevel = player:get_qgl_value()
    
    	local QGLData = QglTable[curLevel]
    	local NQGLData = QglTable[curLevel+1]
    	local result = {
    		cmd="updateDayedaoData",
    		curLevel=curLevel,
    		ownmoney=QGLData.money,
    		qiegelv=QGLData.qiegelv,
    		owncon=QGLData.con,
    		qiegl=QGLData.gl,
    		nqiegelv=NQGLData.qiegelv,
    		nqiegegl=NQGLData.gl,
    		gamemoneybind = player:get_gamemoney_bind(),
    		gamemoney = player:get_gamemoney(),
    		itemqgl = player:get_itemqgl_value(),
    		itemqggl = player:get_itemqggl_value(),
    		upSucceed=isSucceed,
    		
    	}
    	player:push_lua_table("PanelDayedao",util.encode(result))
    end
    
    
    function startUpDayedao(player)
    	local curLevel= player:get_qgl_value()
    	local QGLData = QglTable[curLevel]
    	if curLevel>=QGL_MAX_LEVEL then
    		return player:alert(1,0,"打野刀已进阶为最高阶!")
    	end
    	local mygamemoneybind = player:get_gamemoney_bind()
    	local mygamemoney = player:get_gamemoney()
    	if mygamemoney < QGLData.money then
    			return player:alert(1,0,"金钱不够!")
    	end
    	if mygamemoneybind < QGLData.con then
    			return player:alert(1,0,"绑元不够!")
    	end
    	player:sub_gamemoney(QGLData.money)
    	player:sub_vcoin_bind(QGLData.con)
    	local NEWLevel = player:set_qgl_value(curLevel)
    	updateDayedaoClient(player,true)
    	gui.moduleRedPoint.checkLianHunUsable(player)
    end
    
    
    ----------------------------------------------打野刀------------------------------------------------
    --红点检测
    function checkRedPointDayedao(player)
    	local curLevel= player:get_qgl_value()
    	if curLevel>=QGL_MAX_LEVEL then
    		return false
    	end
    	return false
    end
    
    
    
    
    
    
    
    
    
    
    
    

    以下为客户端部分

    1、res\uipic文件夹中准备界面素材

    添加打野刀面板代码PanelDayedao.lua,文件位置res\uilayout

    具体代码如下

    LUA_RET={
    {n="Image_53",id=3,parent=2,w=419,h=52,ax=0.5,ay=0.5,x=465,y=577,px=0.5000,py=0.9646,res="img_biaoti",type=1,tag=425,v=true,},
    {n="panel_title",id=4,parent=2,w=175,h=41,ax=0.5,ay=0.5,x=465,y=580,px=0.5000,py=0.9683,res="img_bosspic_title",type=1,tag=217,v=true,},
    {n="panel_bg",id=2,parent=1,w=931,h=599,res="img_waibiankuang",type=1,tag=215,ss=true,sx=66,sy=66,sw=68,sh=68,v=true,},
    {n="box_tab",id=5,parent=1,w=80,h=400,ax=1.0,x=5,y=147,px=0.0064,py=0.2457,type=0,tag=216,t=true,v=true,solid=1,ud="tabv(打野刀)",},
    {n="Image_1",id=6,parent=1,w=41,h=40,ax=0.5,ay=0.5,x=25,y=20,px=0.0276,py=0.0340,res="img_waikuangjiantou_you",type=1,tag=532,v=true,},
    {n="Image_2",id=7,parent=1,w=41,h=40,ax=0.5,ay=0.5,x=904,y=20,px=0.9719,py=0.0340,res="img_waikuangjiantou_zuo",type=1,tag=533,v=true,},
    {n="PanelDayedao",id=1,type=0,parent=0,w=931,h=599,},
    }
    --QQ648861400 DAYEDAO

    LUA_RET={
    {n="Image_21",id=3,parent=2,w=585,h=380,ax=0.5,ay=0.5,x=292,y=369,res="img_daojukuang_ditu",type=1,tag=615,ss=true,sx=26,sy=26,sw=28,sh=28,v=true,},
    {n="panel_bg",id=4,parent=2,w=567,h=362,ax=0.5,ay=0.5,x=292,y=369,res="img_zbdt",type=1,tag=215,v=true,},
    {n="Image_6_1_0",id=5,parent=2,w=572,h=174,ax=0.5,ay=0.5,x=292,y=94,res="img_dibukuangjia_ditu",type=1,tag=676,ss=true,sx=16,sy=16,sw=18,sh=18,v=true,},
    {n="btnShengJi",id=6,parent=2,w=120,h=45,ax=0.5,ay=0.5,x=292,y=63,tcolor="255|224|139",sel="btn_green",res="btn_green",type=2,tag=165,t=true,v=true,fs=20,text="进阶",ud="outline(076900,1);zoomscale(-0.12)",},
    {n="Image_60",id=7,parent=2,w=224,h=42,ax=0.5,ay=0.5,x=283,y=500,res="img_wenzilan",type=1,tag=679,v=true,},
    {n="Image_19",id=8,parent=2,w=114,h=24,ax=0.5,ay=0.5,x=268,y=499,res="img_lh_level",type=1,tag=287,v=true,},
    {n="Text_71_4",id=9,parent=2,ax=0.5,ay=0.5,x=105,y=51,color="24|189|4",fr="DFYuan.ttf",olc="0,0,0,255",type=3,tag=285,v=true,fs=15,text="打野刀说明",ols=1,},
    {n="Image_240_18",id=10,parent=2,w=38,h=38,ax=0.5,ay=0.5,x=46,y=51,res="img_mark",type=1,tag=286,v=true,},
    --{n="Image_20",id=11,parent=2,w=372,h=27,ax=0.5,ay=0.5,x=288,y=118,res="progress_yinyantiao",type=1,tag=288,ss=true,sx=30,sy=8,sw=23,sh=9,v=true,},
    --{n="linHunBar",id=12,parent=2,w=322,h=17,ax=0.5,ay=0.5,x=288,y=118,res="progressbar_yinyantiao",type=1,tag=289,ss=true,sx=10,sy=4,sw=11,sh=7,v=true,ud="UILoadingBar",},
    {n="imgLoadLeft",id=2,parent=1,w=484,h=548,ax=0.5,ay=0.5,x=250,y=278,type=1,tag=109,v=true,},
    {n="Image_3_0_0",id=14,parent=13,w=25,h=27,ax=0.5,ay=0.5,x=43,y=81,res="img_dian_dian",type=1,tag=113,v=true,},
    {n="Text_1",id=15,parent=13,w=260,h=25,ay=0.5,x=57,y=83,color="253|223|174",fr="DFYuan.ttf",olc="0,0,0,255",type=3,tag=114,v=true,fs=20,text="攻击概率触发,直接切割怪物",vt=1,ols=1,},
    --{n="btnBuyTu",id=17,parent=13,w=260,h=48,ax=0.5,ay=0.5,x=161,y=23,tcolor="255|211|140",sel="btn_gm",res="btn_gm",type=2,tag=167,t=true,v=true,fs=20,text="充值元宝",ud="outline(000000,1);zoomscale(-0.12)",},
    {n="Text_1_0",id=19,parent=18,w=130,h=25,ay=0.5,x=27,y=204,color="253|223|174",fr="DFYuan.ttf",olc="0,0,0,255",type=3,tag=169,v=true,fs=20,text="当前阶数:",ht=2,vt=1,ols=1,},
    {n="Text_1_0_0",id=20,parent=18,w=130,h=25,ay=0.5,x=27,y=170,color="253|223|174",fr="DFYuan.ttf",olc="0,0,0,255",type=3,tag=170,v=true,fs=20,text="当前切割:",ht=2,vt=1,ols=1,},
    {n="Text_1_0_1",id=21,parent=18,w=130,h=25,ay=0.5,x=27,y=136,color="253|223|174",fr="DFYuan.ttf",olc="0,0,0,255",type=3,tag=171,v=true,fs=20,text="需要金钱:",ht=2,vt=1,ols=1,},
    {n="Text_1_0_2",id=22,parent=18,w=130,h=25,ay=0.5,x=27,y=102,color="253|223|174",fr="DFYuan.ttf",olc="0,0,0,255",type=3,tag=172,v=true,fs=20,text="需要元宝:",ht=2,vt=1,ols=1,},
    {n="Text_1_0_4",id=24,parent=18,w=130,h=25,ay=0.5,x=27,y=68,color="253|223|174",fr="DFYuan.ttf",olc="0,0,0,255",type=3,tag=172,v=true,fs=20,text="切割概率:",ht=2,vt=1,ols=1,},
    {n="Text_1_0_3",id=23,parent=18,w=130,h=25,ay=0.5,x=-30,y=-58,color="253|223|174",fr="DFYuan.ttf",olc="0,0,0,255",type=3,tag=173,v=true,fs=20,text="下阶切割:",ht=2,vt=1,ols=1,},
    {n="Text_1_0_3",id=57,parent=18,w=130,h=25,ay=0.5,x=-30,y=-88,color="253|223|174",fr="DFYuan.ttf",olc="0,0,0,255",type=3,tag=173,v=true,fs=20,text="下阶概率:",ht=2,vt=1,ols=1,},
    {n="labWg",id=25,parent=18,w=130,h=25,ay=0.5,x=168,y=204,color="24|209|41",fr="DFYuan.ttf",olc="0,0,0,255",type=3,tag=175,v=true,fs=20,text="0",vt=1,ols=1,},
    {n="labMg",id=26,parent=18,w=130,h=25,ay=0.5,x=168,y=170,color="24|209|41",fr="DFYuan.ttf",olc="0,0,0,255",type=3,tag=176,v=true,fs=20,text="0",vt=1,ols=1,},
    {n="labDg",id=27,parent=18,w=130,h=25,ay=0.5,x=168,y=136,color="24|209|41",fr="DFYuan.ttf",olc="0,0,0,255",type=3,tag=177,v=true,fs=20,text="0",vt=1,ols=1,},
    {n="labWf",id=28,parent=18,w=130,h=25,ay=0.5,x=168,y=102,color="24|209|41",fr="DFYuan.ttf",olc="0,0,0,255",type=3,tag=178,v=true,fs=20,text="0",vt=1,ols=1,},
    {n="labGL",id=30,parent=18,w=130,h=25,ay=0.5,x=168,y=68,color="24|209|41",fr="DFYuan.ttf",olc="0,0,0,255",type=3,tag=179,v=true,fs=20,text="0",vt=1,ols=1,},
    {n="labMf",id=29,parent=18,w=160,h=25,ay=0.5,x=118,y=-58,color="24|209|41",fr="DFYuan.ttf",olc="0,0,0,255",type=3,tag=179,v=true,fs=20,text="0",vt=1,ols=1,},
    {n="labNf",id=58,parent=18,w=160,h=25,ay=0.5,x=118,y=-88,color="24|209|41",fr="DFYuan.ttf",olc="0,0,0,255",type=3,tag=179,v=true,fs=20,text="0",vt=1,ols=1,},
    {n="box_value",id=18,parent=13,w=300,h=240,ax=0.5,ay=0.5,x=157,y=385,type=0,tag=168,t=true,v=true,},
    {n="imgLoadRight",id=13,parent=1,w=323,h=548,ax=0.5,ay=0.5,x=752,y=286,res="img_youditu",type=1,tag=110,ss=true,sx=16,sy=16,sw=18,sh=18,v=true,},
    {n="Text_1",id=32,parent=31,ax=0.5,ay=0.5,x=159,y=15,color="255|180|0",fr="DFYuan.ttf",olc="0,0,0,255",type=3,tag=775,v=true,fs=18,text="进阶需求",ols=1,},
    {n="Image_11",id=31,parent=1,w=320,h=35,ax=0.5,ay=0.5,x=752,y=541,res="img_youcefengelan",type=1,tag=774,v=true,},
    {n="Text_1",id=34,parent=33,ax=0.5,ay=0.5,x=159,y=15,color="255|180|0",fr="DFYuan.ttf",olc="0,0,0,255",type=3,tag=777,v=true,fs=18,text="进阶属性",ols=1,},
    {n="Image_11_0",id=33,parent=1,w=320,h=35,ax=0.5,ay=0.5,x=752,y=257,res="img_youcefengelan",type=1,tag=776,v=true,},
    {n="Text_1",id=35,parent=36,ax=0.5,ay=0.5,x=159,y=15,color="255|180|0",fr="DFYuan.ttf",olc="0,0,0,255",type=3,tag=778,v=true,fs=18,text="切割功能",ols=1,},
    {n="Image_11_0",id=36,parent=1,w=320,h=35,ax=0.5,ay=0.5,x=752,y=157,res="img_youcefengelan",type=1,tag=779,v=true,},
    --{n="lblVcoin",id=37,parent=1,w=110,h=23,ay=0.5,x=75,y=41,color="214|190|169",type=3,tag=105,v=true,fs=17,text="0",vt=1,},
    --{n="lblMoney",id=38,parent=1,w=110,h=23,ay=0.5,x=75,y=74,color="214|190|169",type=3,tag=106,v=true,fs=17,text="0",vt=1,},
    {n="lblcoin",id=40,parent=39,ax=0.5,ay=0.5,x=80,y=18,color="234|183|82",fr="DFYuan.ttf",olc="0,0,0,255",type=3,tag=356,v=true,fs=20,text="1",ols=1,},
    {n="imglblcoinbg",id=39,parent=1,w=160,h=36,ax=0.5,ay=0.5,x=433,y=123,res="img_shujulan_ditu",type=1,tag=355,ss=true,sx=11,sy=7,sw=14,sh=22,v=true,},
    {n="lblbindcoin",id=42,parent=41,ax=0.5,ay=0.5,x=80,y=18,color="234|183|82",fr="DFYuan.ttf",olc="0,0,0,255",type=3,tag=358,v=true,fs=20,text="2",ols=1,},
    {n="imglblbindcoinbg",id=41,parent=1,w=160,h=36,ax=0.5,ay=0.5,x=183,y=123,res="img_shujulan_ditu",type=1,tag=357,ss=true,sx=11,sy=7,sw=14,sh=22,v=true,},
    {n="modelcoin_0",id=43,parent=1,w=41,h=31,ax=0.5,ay=0.5,x=356,y=122,res="vcoin",type=1,tag=359,v=true,},
    {n="modelcoin_0_0",id=44,parent=1,w=43,h=31,ax=0.5,ay=0.5,x=108,y=122,res="vcoin_bind",type=1,tag=360,v=true,},
    {n="dayedaolv1",id=45,parent=1,ax=0.5,ay=0.5,x=290,y=350,px=0.3244,py=0.5906,type=3,tag=303,v=true,fs=20,text="",},
    {n="dayedaolv2",id=46,parent=1,ax=0.5,ay=0.5,x=290,y=350,px=0.3244,py=0.5906,type=3,tag=303,v=true,fs=20,text="",},
    {n="dayedaolv3",id=47,parent=1,ax=0.5,ay=0.5,x=290,y=350,px=0.3244,py=0.5906,type=3,tag=303,v=true,fs=20,text="",},
    {n="dayedaolv4",id=48,parent=1,ax=0.5,ay=0.5,x=290,y=350,px=0.3244,py=0.5906,type=3,tag=303,v=true,fs=20,text="",},
    {n="dayedaolv5",id=49,parent=1,ax=0.5,ay=0.5,x=290,y=350,px=0.3244,py=0.5906,type=3,tag=303,v=true,fs=20,text="",},
    {n="dayedaolv6",id=50,parent=1,ax=0.5,ay=0.5,x=290,y=350,px=0.3244,py=0.5906,type=3,tag=303,v=true,fs=20,text="",},
    {n="dayedaolv7",id=51,parent=1,ax=0.5,ay=0.5,x=290,y=350,px=0.3244,py=0.5906,type=3,tag=303,v=true,fs=20,text="",},
    {n="dayedaolv8",id=52,parent=1,ax=0.5,ay=0.5,x=290,y=350,px=0.3244,py=0.5906,type=3,tag=303,v=true,fs=20,text="",},
    {n="dayedaolv9",id=53,parent=1,ax=0.5,ay=0.5,x=290,y=350,px=0.3244,py=0.5906,type=3,tag=303,v=true,fs=20,text="",},
    {n="dayedaolv10",id=54,parent=1,ax=0.5,ay=0.5,x=290,y=350,px=0.3244,py=0.5906,type=3,tag=303,v=true,fs=20,text="",},
    {n="dayedaolv11",id=55,parent=1,ax=0.5,ay=0.5,x=290,y=350,px=0.3244,py=0.5906,type=3,tag=303,v=true,fs=20,text="",},
    {n="dayedaolv12",id=56,parent=1,ax=0.5,ay=0.5,x=290,y=350,px=0.3244,py=0.5906,type=3,tag=303,v=true,fs=20,text="",},
    {n="PanelDayedao_ui",id=1,type=0,parent=0,w=931,h=599,},
    }
    --QQ648861400 DAYEDAO

    2、src\app\layers\LayerPanel.lua添加功能

    	--QQ372168 DAYEDAO
    	["main_dayedao"]       	= 	{name = "PanelDayedao", res=1,noBoader=1,closeCall=1,btnClose = 1},

    3、src\app\panels\PanelAvatar.lua 添加角色面板的显示

    Dayedao_qiegelv = 0;
    Dayedao_qiegegv = 0

    在function PanelAvatar.initView块中添加

        NetClient:PushLuaTable("gui.PanelDayedao.handlePanelData",util.encode({actionid = "reqDayedaoData",params={}}))

    在updateAvatarAttr()函数中添加

    
    			{key="lbl_qglvalue",    name="切 割 值:", value = Dayedao_qiegelv .. "%/"..Dayedao_qiegegv.."%"},

    在cc.EventProxy.new(NetClient, var.xmlPageRole)后面添加

    
    			:addEventListener(Notify.EVENT_PUSH_PANEL_DATA, handlePanelDatafu)

    在后面添加

    
    function handlePanelDatafu(event)
    	local data = util.decode(event.data)
    	if data.cmd=="updateDayedaoData" then
    		Dayedao_qiegelv = data.qiegelv + data.itemqgl
    		Dayedao_qiegegv = data.qiegl
    		updateAvatarAttr()
    	end
    end
    

    4、在src\app\panels\目录下新建文件 PanelDayedao.lua

    具体代码如下

    --QQ648861400 DAYEDAO
    local PanelDayedao={}
    local var = {}
    local Dayeid = 0
    local despTable ={
    	[1]="<font color=#E7BA52 size=18>打野刀说明:</font>",
    	[2]="<font color=#f1e8d0>1、打野刀等级一共12级,每一级按3%切割增加,切割几率以幸运值作为概率。</font>",
    }
    function PanelDayedao.initView()
    	var = {
    		xmlPanel,
    		xmlLinHun,
    		curTab,
    		lianHunLev,
    		lianHunBar,
    		curVcion,
    		curBVcion,
    		curMoney,
    		buyData,
    		curPicIndex=1,
    		fireworks,
    		fireworks2,
    		fireworks3,
    		fireworks4,
    		bagData={},
    		huiShouData={},
    		pictrueIds={0,0,0,0,0,0,0,0,0},
    		redsTable={},
    		curTabIndex=1,
    
    	}
    	var.xmlPanel = UILuaLoader.load("uilayout/PanelDayedao.uif");
    	if var.xmlPanel then
    		cc.EventProxy.new(NetClient,var.xmlPanel)
    			:addEventListener(Notify.EVENT_PUSH_PANEL_DATA, PanelDayedao.handlePanelData)
    			:addEventListener(Notify.EVENT_GAME_MONEY_CHANGE, PanelDayedao.updateGameMoney)
    		PanelDayedao.initTabs()
    	end
    		local mainrole = NetClient.mCharacter
    		var.curVcion=mainrole.mVCoin or 0
    		var.curBVcion=mainrole.mVCoinBind or 0
    		var.curMoney=mainrole.mGameMoney or 0
    		var.xmlPanel:getWidgetByName("lblbindcoin"):setString(var.curBVcion)
    		var.xmlPanel:getWidgetByName("lblcoin"):setString(var.curMoney)
    	return var.xmlPanel
    end
    
    --初始化页签
    function PanelDayedao.initTabs()
    	local function pressTabH(sender)
    		local tag = sender:getTag()
    		if var.curTab then var.curTab:hide() end
    		if tag==1 then
    			var.curTab = PanelDayedao.initLinHun()
    		end
    		var.curTabIndex=tag
    	end
    	var.tablisth = var.xmlPanel:getWidgetByName("box_tab")
    	var.tablisth:addTabEventListener(pressTabH)
    	var.tablisth:setSelectedTab(1)
    end
    
    
    
    ----------------------------------通讯---------------------------------------
    function PanelDayedao.handlePanelData(event)
        print("DAYEDAOevent.data:"..event.data)
    	if event.type ~= "PanelDayedao" then return end
    	local data = util.decode(event.data)
    	if data.cmd=="updateDayedaoData" then
    		PanelDayedao.updateLianHun(data)
    	end
    	PanelDayedao.update()
    end
    
    --刷新的界面数据
    function PanelDayedao.updateLianHun(data)
    	local job = MainRole._mainAvatar:NetAttr(Const.net_job)
    	if data then
    		var.xmlLinHun:getWidgetByName("labWg"):setString(data.curLevel)
    		var.xmlLinHun:getWidgetByName("labMg"):setString(data.qiegelv.."%")
    		var.xmlLinHun:getWidgetByName("labDg"):setString(data.ownmoney)
    		var.xmlLinHun:getWidgetByName("labWf"):setString(data.owncon)
    		var.xmlLinHun:getWidgetByName("labGL"):setString(data.qiegl.."%")
    		if data.curLevel < 12 then
    		var.xmlLinHun:getWidgetByName("labMf"):setString(data.qiegelv.."%  →  "..data.nqiegelv.."%")
    		var.xmlLinHun:getWidgetByName("labNf"):setString(data.qiegl.."%  →  "..data.nqiegegl.."%")
    		else
    		var.xmlLinHun:getWidgetByName("labMf"):setString(data.qiegelv.."%(已满)")
    		var.xmlLinHun:getWidgetByName("labNf"):setString(data.qiegl.."%(已满)")
    		end
    	    var.lianHunLev:setString(data.curLevel)
    	if data.upSucceed then
    		PanelDayedao.lianHunAnimate2()
    	end
    	if data.curLevel == 0 then
    	Dayeid = 85009
    	else
    	Dayeid = 99900 + data.curLevel
    	end
        end
    end
    
    function PanelDayedao.getqiege()
    end
    
    function PanelDayedao.update()
    	local progressBar = var.xmlLinHun:getWidgetByName("dayedaolv1")
    	 PanelDayedao.runAmination({target = progressBar, animateId = Dayeid, times = 1 })
    end
    
    function PanelDayedao.runAmination(params)
    		local target = params.target
    		local animateId = params.animateId
    		local times = checknumber(params.times)
    		local callBack = params.callBack
    		local pos = params.pos or cc.p(0,0)
    		local scale = params.scale or 1
    		local anchor = params.anchor or cc.p(0.5,0.5)
    
    		local sprite = target:getChildByName(animateId)
    		if not sprite then
    			sprite = cc.Sprite:create():addTo(target)
    			:setName(animateId)
    		end
    		sprite:setPosition(pos):setScale(scale):setAnchorPoint(anchor)
    		sprite:stopAllActions()
    		local animate = cc.AnimManager:getInstance():getPlistAnimate(4,animateId,4)
    		if times ==0 then
    			sprite:runAction(cca.repeatForever(animate))
    		else
    			sprite:runAction(cca.seq({
    				cca.rep(animate,times),
    				cca.cb(function()
    					if type(callBack) == "function" then callBack() end
    				end),
    				cca.removeSelf()
    			}))
    		end
    	end
    
    function PanelDayedao.runAmination(params)
    
    		local target = params.target
    		local animateId = params.animateId
    		local times = checknumber(params.times)
    		local callBack = params.callBack
    		local pos = params.pos or cc.p(0,0)
    		local scale = params.scale or 1
    		local anchor = params.anchor or cc.p(0.5,0.5)
    
    		local sprite = target:getChildByName("dayetexiao")
    		if sprite then
    		sprite:stopAllActions()
    		sprite:removeFromParent()
    		sprite = nil
    		end
    		if not sprite then
    			sprite = cc.Sprite:create():addTo(target)
    			:setName("dayetexiao")
    		end
    		sprite:setPosition(pos):setScale(scale):setAnchorPoint(anchor)
    		local animate = cc.AnimManager:getInstance():getPlistAnimate(4,animateId,4)
            sprite:runAction(cca.repeatForever(animate))
    	end
    --------------------------------------------------------炼魂------------------------------------------------------------
    function PanelDayedao.initLinHun()
    	if not var.xmlLinHun then
    		var.xmlLinHun=UILuaLoader.load("uilayout/PanelDayedao_ui.uif")
    							:addTo(var.xmlPanel:getWidgetByName("panel_bg"))
       							:show()
       		local btnDesp = var.xmlLinHun:getWidgetByName("Image_240_18"):setTouchEnabled(true)
    		btnDesp:addTouchEventListener(function (pSender, touchType)
    			if touchType == ccui.TouchEventType.began then
    				PanelDayedao.huiShouDesp(despTable)
    			elseif touchType == ccui.TouchEventType.ended or touchType == ccui.TouchEventType.canceled then
    				LayerAlert.handleAlertClose()
    			end
    		end)
       		--PanelDayedao.initPinTuBtns()
       		--var.lianHunBar=var.xmlPanel:getWidgetByName("linHunBar"):setPercent(12,30):setFontSize(18):enableOutline(game.getColor(0x000000),1)
       		var.lianHunLev = ccui.TextAtlas:create("0123456789", "fonts/lianHunNum.png", 20, 25, "0")
    			:addTo(var.xmlLinHun)
    			:align(display.CENTER, 350,503)
    			:setString(12)
    		PanelDayedao.initLinHunBtns()
    		--PanelDayedao.lianHunAnimate()
    	else
    		var.xmlLinHun:show()
    	end
    	NetClient:PushLuaTable("gui.PanelDayedao.handlePanelData",util.encode({actionid = "reqDayedaoData",params={}}))
    	return var.xmlLinHun
    end
    
    ----------------------------------------说明提示TIP----------------------
    function PanelDayedao.huiShouDesp(desptable)
    	local mParam = {
    	name = Notify.EVENT_PANEL_ON_ALERT,
    	panel = "tips",
    	infoTable = desptable,
    	visible = true,
    	}
    	NetClient:dispatchEvent(mParam)
    
    end
    
    --升级特效
    function PanelDayedao.lianHunAnimate2()
    	var.fireworks2 = cc.Sprite:create():addTo(var.xmlLinHun):pos(300,400)
    	local animate = cc.AnimManager:getInstance():getPlistAnimate(4,50022,4,4)
    	if animate then
    		var.fireworks2:stopAllActions()
    		var.fireworks2:runAction(cca.seq({
    			cca.rep(animate,1),
    			cca.removeSelf(),
    		}))
    	end
    end
    
    local btnArrs2 = {"btnShengJi"}
    function PanelDayedao.initLinHunBtns()
    	local function prsBtnClick(sender)
    		local senderName = sender:getName()
            if senderName=="btnShengJi" then
    			NetClient:PushLuaTable("gui.PanelDayedao.handlePanelData",util.encode({actionid = "shengJiDayedao",params={}}))
    		end
    	end
    	for i=1,#btnArrs2 do
    		local btn = var.xmlLinHun:getWidgetByName(btnArrs2[i])
    		UIRedPoint.addUIPoint(btn,prsBtnClick)
    	end
    end
    
    
    
    
    
    --更新元宝和绑元变化
    function PanelDayedao.updateGameMoney(event)
    	if var.xmlPanel then
    		local mainrole = NetClient.mCharacter
    		var.curVcion=mainrole.mVCoin or 0
    		var.curBVcion=mainrole.mVCoinBind or 0
    		var.curMoney=mainrole.mGameMoney or 0
    		var.xmlPanel:getWidgetByName("lblbindcoin"):setString(var.curBVcion)
    		var.xmlPanel:getWidgetByName("lblcoin"):setString(var.curMoney)
    	end
    end
    
    
    
    
    
    
    
    
    
    
    
    
    return PanelDayedao

    5、在文件src\app\scenes\SceneRequire.lua中添加

    
    --QQ648861400 dayedao
    PanelDayedao = reload("app.panels.PanelDayedao", true)

    6、在文件src\app\ui\UIRedDot.lua 中修改

    
    		--打野刀
    	--QQ648861400 DAYEDAO
    	[3014]={
    		[1]={root = "m_cbPartUI", node = {"btnBoss"}, guideType = GUIDE_TYPE.DOT},
    		[2]={root = "LayerPanel", panel = "main_dayedao", node = {"tab3"},guideType = GUIDE_TYPE.DOT},
    			},

    7、在local function pushShortButton(sender)中添加

    
    	elseif btnName == "btn_short_activity" then--打野刀
    		--QQ648861400 DAYEDAO
    		NetClient:dispatchEvent({name = Notify.EVENT_OPEN_PANEL, str = "main_dayedao"})

    这样基本功能就做完了,欢迎留言交流。


    22.73% (5) 次Baidu访问
    36.36% (8) 次Google访问
    4.55% (1) 次Sogou访问
    36.36% (8) 次sm访问
    • 蜘蛛:Baidu,5次,更新时间:2020-10-07 14:41:51
    • 蜘蛛:Google,8次,更新时间:2020-10-28 19:28:50
    • 蜘蛛:Sogou,1次,更新时间:2020-05-03 19:25:13
    • 蜘蛛:sm,8次,更新时间:2020-10-25 14:44:26
  • 0
  • 0
  • 0
  • 139
  • 请登录之后再进行评论

    登录
  • 做任务
  • 实时动态
  • 偏好设置
  • 返回顶部
  • 单栏布局 侧栏位置: