|
楼主 |
发表于 2020-6-25 11:05:01
|
显示全部楼层
========
--鼠标单击事件
function Usr_zbdb_OnClick(sender, x, y)
local isOpen = true
if g_var["item_duibi"] then
isOpen = false
g_var["item_duibi"] = false
--sender:setChecked (false)
else
g_var["item_duibi"] = true
--sender:setChecked (true)
end
local _table ={code=2, data=isOpen}
c.event.sendNetMsg(1, serialize(_table))
--此处放置事件代码
return false --返回true代表执行内部事件
end
======================LUA后端接收==================
function msgFunc_1(actor, smsg) --统一通讯 根据code不同执行不同方法
print(smsg)
local msg = deserialize(smsg)--反序列化
if type(msg) ~= "table" then
return
end
local code =tonumber(msg["code"])
local data =msg["data"] and 1 or 0
if code ==2 then
actor:setQuest(555, data)
actor:runScript("@设置装备对比选中")
end
end
=============Qfunction.txt=================
[@设置装备对比选中]
#if
check [555] 1
#act
SetClientUIProp DWGameAssist@Usr_zbdb.ImageIndex.Up 42
SetClientUIProp DWGameAssist@Usr_zbdb.ImageIndex.Down 42
#elseact
SetClientUIProp DWGameAssist@Usr_zbdb.ImageIndex.Up 41
SetClientUIProp DWGameAssist@Usr_zbdb.ImageIndex.Down 41
break
================================
--登陆游戏时回调
function on_Actor_in_game(actor)
if actor:getRace()== 0 then --获取[555]查询是否开启装备对比功能
local QuestNum = actor:getQuest(555)
local isOpen = true
if QuestNum == 0 then
isOpen =false
end
local _table ={code=2, data=isOpen}
actor:runScript("@设置装备对比选中")
actor:sendNetMsg(2,serialize(_table))
end
end |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
|