搜索
楼主: andrew01

分享装备对比Lua

  [复制链接]
发表于 2020-6-25 10:31:38 | 显示全部楼层
传奇使者 发表于 2020-6-24 22:28
记得当时装备对比做出来的时候你怪怪爹就在显摆,人家问你怪怪爹可以在英雄包裹对比么,你怪怪爹说要等引 ...

傻逼玩意劳资就这么说一句就非的怼劳资,怪怪是我儿,你是我孙子行了吧。小杂碎
 楼主| 发表于 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
发表于 2020-6-25 16:47:24 | 显示全部楼层
受教了 膜拜
发表于 2020-6-25 21:12:02 | 显示全部楼层
顶一下
比较牛b
发表于 2020-6-25 23:24:08 | 显示全部楼层
大佬请教下 为啥点击身上的装备也显示装备对比
 楼主| 发表于 2020-6-25 23:28:33 | 显示全部楼层
唯快不破 发表于 2020-6-25 23:24
大佬请教下 为啥点击身上的装备也显示装备对比

不会啊。itemform==0就是判断包裹
发表于 2020-6-25 23:32:22 | 显示全部楼层
andrew01 发表于 2020-6-25 23:28
不会啊。itemform==0就是判断包裹

在哪个文件内啊
 楼主| 发表于 2020-6-25 23:35:02 | 显示全部楼层

bindevent.lua 看我发的代码红色部分
发表于 2020-6-25 23:38:36 | 显示全部楼层
        --包裹里对比身上装备
        if itemFrom == 0 and g_var["item_duibi"] then --包裹里的物品
                --获取当前装备处于哪个位置的装备
发表于 2020-6-25 23:38:55 | 显示全部楼层
没错的 我直接全部替换你发的试试看
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|HGEM2论坛

GMT+8, 2024-5-20 05:26 , Processed in 0.479857 second(s), 13 queries .

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表