tdrange.lua

来自「WOW的一款PVP插件」· LUA 代码 · 共 35 行

LUA
35
字号
local s = {}
local _, v

function tdRange_GetColor(id)
	s.Range = IsActionInRange(id) == 0 and true or nil
	s.Usable, s.Mana= IsUsableAction(id);
	s.Usable = not s.Usable
	for _, v in ipairs(tCCDB.Other.Color) do
		if s[v] then
			return tCCDB.Color[v].r, tCCDB.Color[v].g, tCCDB.Color[v].b, v
		end
	end
	return 1.0, 1.0, 1.0, ""
end

function ActionButton_UpdateUsable()
	local r, g, b, index = tdRange_GetColor(ActionButton_GetPagedID(this))
	if not (this.index and this.index == index) then
		this.index = index
		getglobal(this:GetName().."Icon"):SetVertexColor(r, g, b);
	end
end

old_ActionButton_OnUpdate = ActionButton_OnUpdate
function ActionButton_OnUpdate(elapsed)
	old_ActionButton_OnUpdate(elapsed)
	if ( this.rangeTimer and this.rangeTimer <= elapsed ) then
		hotkey = getglobal(this:GetName().."HotKey");
		if hotkey:GetText() == RANGE_INDICATOR then
			hotkey:SetText("")
		end
		ActionButton_UpdateUsable();
	end
end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?