y3-editor / y3-lualib

MIT License
141 stars 42 forks source link

鼠标-按下单位 事件BUG #484

Closed kneesbuster closed 2 months ago

kneesbuster commented 3 months ago

实测 Unit Item Destructible 都会触发此事件 选中另外两个类型实例时返回一个<无效单位> meta/event.lua 6238

---@class EventParam.MOUSE_KEY_DOWN_UNIT_EVENT
---@field player Player # 触发按键的玩家
---@field current_key py.MouseKey # 当前鼠标按键
---@field unit Unit # 当前操作的单位

--鼠标按键按下单位
event.MOUSE_KEY_DOWN_UNIT_EVENT = {
    [1] = {
        name = "__role_id",
        type = "py.RoleID",
        lua_name = "player",
        lua_type = "Player",
        desc = "触发按键的玩家ID",
        lua_desc = "触发按键的玩家",
    },
    [2] = {
        name = "__current_key",
        type = "py.MouseKey",
        lua_name = "current_key",
        lua_type = "py.MouseKey",
        desc = "当前鼠标按键",
        lua_desc = "当前鼠标按键",
    },
    [3] = {
        name = "__unit_id",
        type = "py.UnitID",
        lua_name = "unit",
        lua_type = "Unit",
        desc = "当前操作的单位ID",
        lua_desc = "当前操作的单位",
    },
}
sumneko commented 2 months ago

已修复