📄 monkeyquestslash.lua
字号:
else
MonkeyQuestFrame:SetBackdropBorderColor(TOOLTIP_DEFAULT_COLOR.r, TOOLTIP_DEFAULT_COLOR.g, TOOLTIP_DEFAULT_COLOR.b, 1.0);
end
-- check for MonkeyBuddy
if (MonkeyBuddyQuestFrame_Refresh ~= nil) then
MonkeyBuddyQuestFrame_Refresh();
end
end
function MonkeyQuestSlash_CmdGrowUp(bGrowUp)
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bGrowUp = bGrowUp;
-- check for MonkeyBuddy
if (MonkeyBuddyQuestFrame_Refresh ~= nil) then
MonkeyBuddyQuestFrame_Refresh();
end
end
function MonkeyQuestSlash_CmdAlpha(iAlpha)
if (iAlpha >= 0 and iAlpha <= 255) then
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iAlpha = iAlpha / 255;
MonkeyQuest_SetAlpha(MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iAlpha);
end
-- check for MonkeyBuddy
if (MonkeyBuddyQuestFrame_Refresh ~= nil) then
MonkeyBuddyQuestFrame_Refresh();
end
end
function MonkeyQuestSlash_CmdWidth(iWidth)
if (iWidth >= 200 and iWidth <= 600) then
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iFrameWidth = iWidth;
MonkeyQuestFrame:SetWidth(MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iFrameWidth);
MonkeyQuest_Refresh();
end
-- check for MonkeyBuddy
if (MonkeyBuddyQuestFrame_Refresh ~= nil) then
MonkeyBuddyQuestFrame_Refresh();
end
end
function MonkeyQuestSlash_CmdFontHeight(iHeight)
if (iHeight >= 8 and iHeight <= 48) then
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iFontHeight = iHeight;
MonkeyQuest_Refresh();
-- little fix for when changing the font size
MonkeyQuestFrame:SetScale(2);
MonkeyQuestFrame:SetScale(UIParent:GetScale());
end
-- check for MonkeyBuddy
if (MonkeyBuddyQuestFrame_Refresh ~= nil) then
MonkeyBuddyQuestFrame_Refresh();
end
end
function MonkeyQuestSlash_CmdTipAnchor(strAnchor)
if (strAnchor == nil) then
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor = "DEFAULT";
return;
end
-- let's check that it's a valid anchor before setting it
if (string.upper(strAnchor) == "ANCHOR_TOPLEFT") then
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor = string.upper(strAnchor);
return;
end
if (string.upper(strAnchor) == "ANCHOR_TOPRIGHT") then
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor = string.upper(strAnchor);
return;
end
if (string.upper(strAnchor) == "ANCHOR_TOP") then
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor = string.upper(strAnchor);
return;
end
if (string.upper(strAnchor) == "ANCHOR_LEFT") then
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor = string.upper(strAnchor);
return;
end
if (string.upper(strAnchor) == "ANCHOR_RIGHT") then
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor = string.upper(strAnchor);
return;
end
if (string.upper(strAnchor) == "ANCHOR_BOTTOMLEFT") then
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor = string.upper(strAnchor);
return;
end
if (string.upper(strAnchor) == "ANCHOR_BOTTOMRIGHT") then
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor = string.upper(strAnchor);
return;
end
if (string.upper(strAnchor) == "ANCHOR_BOTTOM") then
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor = string.upper(strAnchor);
return;
end
if (string.upper(strAnchor) == "ANCHOR_CURSOR") then
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor = string.upper(strAnchor);
return;
end
if (string.upper(strAnchor) == "DEFAULT") then
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor = string.upper(strAnchor);
return;
end
if (string.upper(strAnchor) == "NONE") then
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor = string.upper(strAnchor);
return;
end
-- bad input or default, set it to the default position
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor = "ANCHOR_TOPLEFT";
-- check for MonkeyBuddy
if (MonkeyBuddyQuestFrame_Refresh ~= nil) then
MonkeyBuddyQuestFrame_Refresh();
end
end
function MonkeyQuestSlash_CmdShowNumQuests(bShowNumQuests)
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowNumQuests = bShowNumQuests;
MonkeyQuest_Refresh();
-- check for MonkeyBuddy
if (MonkeyBuddyQuestFrame_Refresh ~= nil) then
MonkeyBuddyQuestFrame_Refresh();
end
end
function MonkeyQuestSlash_CmdLock(bLocked)
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bLocked = bLocked;
-- check for MonkeyBuddy
if (MonkeyBuddyQuestFrame_Refresh ~= nil) then
MonkeyBuddyQuestFrame_Refresh();
end
end
function MonkeyQuestSlash_CmdColourTitleOn(bColourTitle)
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bColourTitle = bColourTitle;
MonkeyQuest_Refresh();
-- check for MonkeyBuddy
if (MonkeyBuddyQuestFrame_Refresh ~= nil) then
MonkeyBuddyQuestFrame_Refresh();
end
end
function MonkeyQuestSlash_CmdHideCompletedQuests(bHide)
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bHideCompletedQuests = bHide;
MonkeyQuest_Refresh();
-- check for MonkeyBuddy
if (MonkeyBuddyQuestFrame_Refresh ~= nil) then
MonkeyBuddyQuestFrame_Refresh();
end
end
function MonkeyQuestSlash_CmdHideCompletedObjectives(bHide)
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bHideCompletedObjectives = bHide;
MonkeyQuest_Refresh();
-- check for MonkeyBuddy
if (MonkeyBuddyQuestFrame_Refresh ~= nil) then
MonkeyBuddyQuestFrame_Refresh();
end
end
function MonkeyQuestSlash_CmdShowTooltipObjectives(bShow)
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowTooltipObjectives = bShow;
-- check for MonkeyBuddy
if (MonkeyBuddyQuestFrame_Refresh ~= nil) then
MonkeyBuddyQuestFrame_Refresh();
end
end
function MonkeyQuestSlash_CmdAllowRightClick(bAllow)
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bAllowRightClick = bAllow;
-- check for MonkeyBuddy
if (MonkeyBuddyQuestFrame_Refresh ~= nil) then
MonkeyBuddyQuestFrame_Refresh();
end
end
function MonkeyQuestSlash_CmdHideTitleButtons(bHide)
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bHideTitleButtons = bHide;
if (bHide == true) then
MonkeyQuestCloseButton:Hide();
MonkeyQuestMinimizeButton:Hide();
MonkeyQuestShowHiddenCheckButton:Hide();
else
MonkeyQuestCloseButton:Show();
MonkeyQuestMinimizeButton:Show();
MonkeyQuestShowHiddenCheckButton:Show();
end
-- check for MonkeyBuddy
if (MonkeyBuddyQuestFrame_Refresh ~= nil) then
MonkeyBuddyQuestFrame_Refresh();
end
end
function MonkeyQuestSlash_CmdHideTitle(bHide)
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bHideTitle = bHide;
MonkeyQuest_Refresh();
-- check for MonkeyBuddy
if (MonkeyBuddyQuestFrame_Refresh ~= nil) then
MonkeyBuddyQuestFrame_Refresh();
end
end
function MonkeyQuestSlash_ToggleDisplay()
-- if not loaded yet then get out
if (MonkeyQuest.m_bLoaded == false) then
return;
end
if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bDisplay) then
MonkeyQuest_Hide();
else
MonkeyQuest_Show();
end
-- check for MonkeyBuddy
if (MonkeyBuddyQuestFrame_Refresh ~= nil) then
MonkeyBuddyQuestFrame_Refresh();
end
end
function MonkeyQuestSlash_ToggleShowHidden()
-- if not loaded yet then get out
if (MonkeyQuest.m_bLoaded == false) then
return;
end
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowHidden = not MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowHidden;
MonkeyQuest_Refresh();
-- check for MonkeyBuddy
if (MonkeyBuddyQuestFrame_Refresh ~= nil) then
MonkeyBuddyQuestFrame_Refresh();
end
end
function MonkeyQuestSlash_ToggleObjectives()
-- if not loaded yet then get out
if (MonkeyQuest.m_bLoaded == false) then
return;
end
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bObjectives = not MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bObjectives;
MonkeyQuest_Refresh();
-- check for MonkeyBuddy
if (MonkeyBuddyQuestFrame_Refresh ~= nil) then
MonkeyBuddyQuestFrame_Refresh();
end
end
function MonkeyQuestSlash_ToggleAnchor()
-- if not loaded yet then get out
if (MonkeyQuest.m_bLoaded == false) then
return;
end
if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bDefaultAnchor == true) then
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bDefaultAnchor = false;
else
if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor == "ANCHOR_BOTTOMRIGHT") then
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor = "ANCHOR_BOTTOMLEFT";
elseif (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor == "ANCHOR_BOTTOMLEFT") then
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor = "ANCHOR_TOPLEFT";
elseif (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor == "ANCHOR_TOPLEFT") then
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor = "ANCHOR_LEFT";
elseif (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor == "ANCHOR_LEFT") then
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor = "ANCHOR_CURSOR";
elseif (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor == "ANCHOR_CURSOR") then
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bDefaultAnchor = true;
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_strAnchor = "ANCHOR_BOTTOMRIGHT";
end
end
-- check for MonkeyBuddy
if (MonkeyBuddyQuestFrame_Refresh ~= nil) then
MonkeyBuddyQuestFrame_Refresh();
end
end
function MonkeyQuestSlash_Alpha(msg)
-- if not loaded yet then get out
if (MonkeyQuest.m_bLoaded == false) then
return;
end
if (not(tonumber(msg, 10) == nil)) then
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iAlpha = tonumber(msg, 10);
else
-- set it to the default
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iAlpha = MONKEYQUEST_DEFAULT_ALPHA;
end
MonkeyQuest_SetAlpha(MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iAlpha);
-- check for MonkeyBuddy
if (MonkeyBuddyQuestFrame_Refresh ~= nil) then
MonkeyBuddyQuestFrame_Refresh();
end
end
function MonkeyQuestSlash_Width(msg)
-- if not loaded yet then get out
if (MonkeyQuest.m_bLoaded == false) then
return;
end
if (not(tonumber(msg, 10) == nil)) then
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iFrameWidth = tonumber(msg, 10);
else
-- set it to the default
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iFrameWidth = MONKEYQUEST_DEFAULT_WIDTH;
end
MonkeyQuest_Refresh();
-- Let the user know they might have to reload the ui
if (DEFAULT_CHAT_FRAME) then
DEFAULT_CHAT_FRAME:AddMessage(MONKEYQUEST_SET_WIDTH_MSG);
end
-- check for MonkeyBuddy
if (MonkeyBuddyQuestFrame_Refresh ~= nil) then
MonkeyBuddyQuestFrame_Refresh();
end
end
function MonkeyQuestSlash_ToggleNoHeaders()
-- if not loaded yet then get out
if (MonkeyQuest.m_bLoaded == false) then
return;
end
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bNoHeaders = not MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bNoHeaders;
MonkeyQuest_Refresh();
-- check for MonkeyBuddy
if (MonkeyBuddyQuestFrame_Refresh ~= nil) then
MonkeyBuddyQuestFrame_Refresh();
end
end
function MonkeyQuestSlash_ToggleNoBorder()
-- if not loaded yet then get out
if (MonkeyQuest.m_bLoaded == false) then
return;
end
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bNoBorder = not MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bNoBorder;
if (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bNoBorder == true) then
MonkeyQuestFrame:SetBackdropBorderColor(0.0, 0.0, 0.0, 0.0);
elseif (MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bCrashBorder == false) then
MonkeyQuestFrame:SetBackdropBorderColor(TOOLTIP_DEFAULT_COLOR.r, TOOLTIP_DEFAULT_COLOR.g, TOOLTIP_DEFAULT_COLOR.b, 1.0);
else
MonkeyQuestFrame:SetBackdropBorderColor(MONKEYQUEST_DEFAULT_CRASHCOLOUR.r, MONKEYQUEST_DEFAULT_CRASHCOLOUR.g, MONKEYQUEST_DEFAULT_CRASHCOLOUR.b, 1.0);
end
--MonkeyQuest_Refresh();
-- check for MonkeyBuddy
if (MonkeyBuddyQuestFrame_Refresh ~= nil) then
MonkeyBuddyQuestFrame_Refresh();
end
end
function MonkeyQuestSlash_ToggleGrow()
-- if not loaded yet then get out
if (MonkeyQuest.m_bLoaded == false) then
return;
end
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bGrowUp = not MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bGrowUp;
MonkeyQuest_Refresh();
-- check for MonkeyBuddy
if (MonkeyBuddyQuestFrame_Refresh ~= nil) then
MonkeyBuddyQuestFrame_Refresh();
end
end
function MonkeyQuestSlash_CmdShowNoobTips(bShowNoobTips)
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_bShowNoobTips = bShowNoobTips;
-- check for MonkeyBuddy
if (MonkeyBuddyQuestFrame_Refresh ~= nil) then
MonkeyBuddyQuestFrame_Refresh();
end
end
function MonkeyQuestSlash_CmdSetQuestPadding(iPadding)
MonkeyQuestConfig[MonkeyQuest.m_strPlayer].m_iQuestPadding = iPadding;
local i = 2;
-- loop through ALL the quest button and apply the padding
for i = 2, MONKEYQUEST_MAX_BUTTONS, 1 do
getglobal("MonkeyQuestButton" .. i):SetPoint("TOPLEFT", "MonkeyQuestButton" .. (i - 1), "BOTTOMLEFT", 0, -iPadding);
end
-- resize MonkeyQuest
MonkeyQuest_Resize();
-- check for MonkeyBuddy
if (MonkeyBuddyQuestFrame_Refresh ~= nil) then
MonkeyBuddyQuestFrame_Refresh();
end
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -