📄 nicebufftimer.lua
字号:
BuffTime_CONFIG_ONOFF = "显示魔法增益时间";
BuffTime_CONFIG_ONOFF_INFO = "选中则显示魔法增益的剩余时间";
BuffTimefor_CONFIG_ONOFF = "精确时间";
BuffTimefor_CONFIG_ONOFF_INFO = "选中则显示魔法增益的精确剩余时间";
BuffTime_CONFIG_HEADER = "魔法增益";
BuffTime_CONFIG_HEADER_INFO = "设置魔法增时间是否显示";
--SHOW_BUFF_DURATIONS = "1";
--gLim_openBuffTime = "1";
gLim_BuffTimetime = 0;
function NiceBuffTimer_OnEvent(event)
if event == "VARIABLES_LOADED" then
lo_SecondsToTimeAbbrev = SecondsToTimeAbbrev;
if (gLim_openBuffTime == nil) then
gLim_openBuffTime = "1";
end
SHOW_BUFF_DURATIONS = gLim_openBuffTime;
-- GLIM的核心我里面没有写好.认为1就是1 实际上WOW系统认为1是"1"
if (SHOW_BUFF_DURATIONS == "1") then
gLim_BuffTimetime = 1;
else
gLim_BuffTimetime = 0;
end
if (gLim_BuffTimeformat == nil) then
gLim_BuffTimeformat = 0;
end
if (gLim_BuffTimeformat == 1) then
SecondsToTimeAbbrev = NBT_SecondsToTimeAbbrev;
else
SecondsToTimeAbbrev = lo_SecondsToTimeAbbrev;
end;
BuffTimer_Register();
end
end
function BuffTimer_Register()
gLim_RegisterButton (
"bufftimer",
"魔法剩余时间设置",
"Interface\\AddOns\\NiceBuffTimer\\Icon",
function()
gLimModSecBookShowConfig("gLimbufftimer")
end,
2,
5
);
gLim_RegisterConfigClass(
"gLimbufftimer",
"显示增益减益魔法的剩余时间",
"gLim"
);
gLim_RegisterConfigSection(
"gLimbufftimer",
"魔法时间显示",
"显示增益减益魔法的剩余时间",
"gLim",
"gLimbufftimer"
);
gLim_RegisterConfigCheckBox(
"gLim_openBuffTime",
BuffTime_CONFIG_ONOFF,
BuffTime_CONFIG_ONOFF_INFO,
gLim_BuffTimetime,
BuffTime_ONOff,
"gLimbufftimer"
);
gLim_RegisterConfigCheckBox(
"gLim_BuffTimeformat",
BuffTimefor_CONFIG_ONOFF,
BuffTimefor_CONFIG_ONOFF_INFO,
gLim_BuffTimeformat,
BuffTimeformat_ONOff,
"gLimbufftimer"
);
end
function BuffTime_ONOff(toggle)
if (toggle == 1) then
gLim_openBuffTime = "1";
SHOW_BUFF_DURATIONS = "1";
--SecondsToTimeAbbrev = NBT_SecondsToTimeAbbrev;
else
gLim_openBuffTime = "0";
SHOW_BUFF_DURATIONS = "0";
--SecondsToTimeAbbrev = ordNBT_SecondsToTimeAbbrev;
end;
end
function BuffTimeformat_ONOff(toggle)
if (toggle == 1) then
gLim_BuffTimeformat = 1;
SecondsToTimeAbbrev = NBT_SecondsToTimeAbbrev;
else
gLim_BuffTimeformat = 0;
SecondsToTimeAbbrev = lo_SecondsToTimeAbbrev;
end;
end
function NBT_SecondsToTimeAbbrev(seconds)
local time = "";
local tempTime;
local tempTime2;
if ( seconds > 86400 ) then
tempTime = ceil(seconds / 86400);
time = tempTime.." "..DAY_ONELETTER_ABBR;
return time;
end
if ( seconds > 3600 ) then
tempTime = ceil(seconds / 3600);
time = tempTime.." "..HOUR_ONELETTER_ABBR;
return time;
end
if ( seconds > 60 ) then
tempTime = floor(seconds / 60);
tempTime2 = floor(seconds-(tempTime)*60);
time = format("%02d:%02d", tempTime, tempTime2);
return time;
end
time = format("00:%02d", seconds);
return time;
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -