1.0.6 支持模块热重载
This commit is contained in:
parent
a8a29f6430
commit
b2662f14fe
|
@ -0,0 +1,31 @@
|
|||
# 更新日志
|
||||
|
||||
## 1.0.6
|
||||
|
||||
**Loader**
|
||||
|
||||
同时按左右花括号键可热重载所有模块
|
||||
|
||||
**Keypad**
|
||||
|
||||
支持传入 table 类型以实现组合键判断
|
||||
|
||||
**新增**
|
||||
|
||||
引入 utils/Utils.lua 通用工具类
|
||||
|
||||
## 1.0.4
|
||||
|
||||
**新增**
|
||||
|
||||
引入 utils/Macro.lua 宏工具包,支持 Macro 定义简单宏功能进行循环控制
|
||||
|
||||
## 1.0.3
|
||||
|
||||
**修订**
|
||||
|
||||
Ctx 在 Loader 中进行全局变量化以减少潜在的 nil 引用问题
|
||||
|
||||
## 1.0.2
|
||||
|
||||
首次上传框架
|
|
@ -1,3 +1,5 @@
|
|||
# EigeenLoader
|
||||
|
||||
猫猫虫的 LuaEngine 插件管理框架 for MHW
|
||||
|
||||
![更新日志](Changelogs.md)
|
|
@ -1,15 +1,14 @@
|
|||
-- 猫猫虫的 LuaEngine 工具模块:Keypad
|
||||
-- @version: 1.0.0
|
||||
|
||||
-- @version: 1.0.1
|
||||
local Keypad = {}
|
||||
|
||||
--- 带计时器的按键触发操作(注:暂不支持组合键)
|
||||
---@param keypadID number|string
|
||||
--- 带计时器的按键触发操作
|
||||
---@param keypadID number|string|table
|
||||
---@param chrono number
|
||||
---@param func fun()
|
||||
---@param handler fun()
|
||||
---@param xbox boolean|nil
|
||||
function Keypad.UseChronoscope(keypadID, chrono, func, xbox)
|
||||
if keypadID == nil or chrono == nil or func == nil then
|
||||
function Keypad.UseChronoscope(keypadID, chrono, handler, xbox)
|
||||
if not keypadID or not chrono or not handler then
|
||||
return
|
||||
end
|
||||
if chrono < 0 then
|
||||
|
@ -19,22 +18,19 @@ function Keypad.UseChronoscope(keypadID, chrono, func, xbox)
|
|||
xbox = nil
|
||||
end
|
||||
|
||||
-- TODO: 暂不支持组合键
|
||||
if type(keypadID) == "table" then
|
||||
return
|
||||
end
|
||||
|
||||
local keypadIDStr = keypadID
|
||||
if type(keypadID) == "number" then
|
||||
keypadIDStr = tostring(keypadID)
|
||||
elseif type(keypadID) == "table" then
|
||||
keypadIDStr = table.concat(keypadID, ",")
|
||||
end
|
||||
local keypadShortcut = "keypad_keyCD_"..keypadIDStr
|
||||
local keypadShortcut = "keypad_keyCD_" .. keypadIDStr
|
||||
|
||||
if engine.keypad(keypadID, xbox) and (CheckChronoscope(keypadShortcut) or
|
||||
not CheckPresenceChronoscope(keypadShortcut)) then
|
||||
if engine.keypad(keypadID, xbox) and
|
||||
(CheckChronoscope(keypadShortcut) or not CheckPresenceChronoscope(keypadShortcut)) then
|
||||
|
||||
AddChronoscope(chrono, keypadShortcut)
|
||||
func()
|
||||
handler()
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
local Utils = {}
|
||||
|
||||
function Utils:IsIn(table, element)
|
||||
for key, value in pairs(table) do
|
||||
if element == value then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
return Utils
|
Loading…
Reference in New Issue