mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-27 08:24:44 +00:00
update Tutorials in core
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
local E, L, V, P, G = unpack(ElvUI);
|
local E, L, V, P, G = unpack(ElvUI);
|
||||||
|
|
||||||
local _G = getfenv();
|
local _G = _G;
|
||||||
local pairs, type, unpack, assert = pairs, type, unpack, assert;
|
local pairs, type, unpack, assert = pairs, type, unpack, assert;
|
||||||
local tremove, tContains, tinsert, wipe = tremove, tContains, tinsert, table.wipe;
|
local tremove, tContains, tinsert, wipe = tremove, tContains, tinsert, table.wipe;
|
||||||
local lower = string.lower;
|
local lower = string.lower;
|
||||||
@@ -462,7 +462,7 @@ end
|
|||||||
|
|
||||||
function E:StaticPopup_CollapseTable()
|
function E:StaticPopup_CollapseTable()
|
||||||
local displayedFrames = E.StaticPopup_DisplayedFrames;
|
local displayedFrames = E.StaticPopup_DisplayedFrames;
|
||||||
local index = gent(displayedFrames);
|
local index = getn(displayedFrames);
|
||||||
while((index >= 1) and (not displayedFrames[index]:IsShown())) do
|
while((index >= 1) and (not displayedFrames[index]:IsShown())) do
|
||||||
tremove(displayedFrames, index);
|
tremove(displayedFrames, index);
|
||||||
index = index - 1;
|
index = index - 1;
|
||||||
@@ -471,7 +471,7 @@ end
|
|||||||
|
|
||||||
function E:StaticPopup_SetUpPosition(dialog)
|
function E:StaticPopup_SetUpPosition(dialog)
|
||||||
if(not tContains(E.StaticPopup_DisplayedFrames, dialog)) then
|
if(not tContains(E.StaticPopup_DisplayedFrames, dialog)) then
|
||||||
local lastFrame = E.StaticPopup_DisplayedFrames[gent(E.StaticPopup_DisplayedFrames)];
|
local lastFrame = E.StaticPopup_DisplayedFrames[getn(E.StaticPopup_DisplayedFrames)];
|
||||||
if(lastFrame) then
|
if(lastFrame) then
|
||||||
dialog:SetPoint("TOP", lastFrame, "BOTTOM", 0, -4);
|
dialog:SetPoint("TOP", lastFrame, "BOTTOM", 0, -4);
|
||||||
else
|
else
|
||||||
@@ -495,7 +495,7 @@ function E:StaticPopupSpecial_Hide(frame)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function E:StaticPopup_IsLastDisplayedFrame(frame)
|
function E:StaticPopup_IsLastDisplayedFrame(frame)
|
||||||
for i = gent(E.StaticPopup_DisplayedFrames), 1, -1 do
|
for i = getn(E.StaticPopup_DisplayedFrames), 1, -1 do
|
||||||
local popup = E.StaticPopup_DisplayedFrames[i];
|
local popup = E.StaticPopup_DisplayedFrames[i];
|
||||||
if(popup:IsShown()) then
|
if(popup:IsShown()) then
|
||||||
return frame == popup;
|
return frame == popup;
|
||||||
@@ -886,13 +886,13 @@ function E:StaticPopup_Show(which, text_arg1, text_arg2, data)
|
|||||||
local button3 = _G[name .. "Button3"];
|
local button3 = _G[name .. "Button3"];
|
||||||
|
|
||||||
do
|
do
|
||||||
assert(gent(tempButtonLocs) == 0);
|
assert(getn(tempButtonLocs) == 0);
|
||||||
|
|
||||||
tinsert(tempButtonLocs, button1);
|
tinsert(tempButtonLocs, button1);
|
||||||
tinsert(tempButtonLocs, button2);
|
tinsert(tempButtonLocs, button2);
|
||||||
tinsert(tempButtonLocs, button3);
|
tinsert(tempButtonLocs, button3);
|
||||||
|
|
||||||
for i = gent(tempButtonLocs), 1, -1 do
|
for i = getn(tempButtonLocs), 1, -1 do
|
||||||
tempButtonLocs[i]:SetText(info["button"..i]);
|
tempButtonLocs[i]:SetText(info["button"..i]);
|
||||||
tempButtonLocs[i]:Hide();
|
tempButtonLocs[i]:Hide();
|
||||||
tempButtonLocs[i]:ClearAllPoints();
|
tempButtonLocs[i]:ClearAllPoints();
|
||||||
@@ -901,7 +901,7 @@ function E:StaticPopup_Show(which, text_arg1, text_arg2, data)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local numButtons = gent(tempButtonLocs);
|
local numButtons = getn(tempButtonLocs);
|
||||||
dialog.numButtons = numButtons;
|
dialog.numButtons = numButtons;
|
||||||
if(numButtons == 3) then
|
if(numButtons == 3) then
|
||||||
tempButtonLocs[1]:SetPoint("BOTTOMRIGHT", dialog, "BOTTOM", -72, 16);
|
tempButtonLocs[1]:SetPoint("BOTTOMRIGHT", dialog, "BOTTOM", -72, 16);
|
||||||
@@ -988,7 +988,7 @@ end
|
|||||||
|
|
||||||
function E:StaticPopup_CombineTables()
|
function E:StaticPopup_CombineTables()
|
||||||
if(not tContains(E.StaticPopup_DisplayedFrames, dialog)) then
|
if(not tContains(E.StaticPopup_DisplayedFrames, dialog)) then
|
||||||
local lastFrame = E.StaticPopup_DisplayedFrames[gent(StaticPopup_DisplayedFrames)];
|
local lastFrame = E.StaticPopup_DisplayedFrames[getn(StaticPopup_DisplayedFrames)];
|
||||||
if(lastFrame) then
|
if(lastFrame) then
|
||||||
dialog:SetPoint("TOP", lastFrame, "BOTTOM", 0, -4);
|
dialog:SetPoint("TOP", lastFrame, "BOTTOM", 0, -4);
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
local E, L, V, P, G = unpack(ElvUI); --Inport: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
|
||||||
|
|
||||||
local _G = getfenv();
|
local _G = _G
|
||||||
|
|
||||||
local CreateFrame = CreateFrame;
|
local CreateFrame = CreateFrame
|
||||||
local DISABLE = DISABLE;
|
local DISABLE = DISABLE
|
||||||
local HIDE = HIDE;
|
local HIDE = HIDE
|
||||||
|
|
||||||
E.TutorialList = {
|
E.TutorialList = {
|
||||||
L["For technical support visit us at https://github.com/ElvUI-WotLK/ElvUI"],
|
L["For technical support visit us at https://github.com/ElvUI-Vanilla/ElvUI"],
|
||||||
L["You can toggle the microbar by using your middle mouse button on the minimap you can also accomplish this by enabling the actual microbar located in the actionbar settings."],
|
L["You can toggle the microbar by using your middle mouse button on the minimap you can also accomplish this by enabling the actual microbar located in the actionbar settings."],
|
||||||
L["A raid marker feature is available by pressing Escape -> Keybinds scroll to the bottom under ElvUI and setting a keybind for the raid marker."],
|
L["A raid marker feature is available by pressing Escape -> Keybinds scroll to the bottom under ElvUI and setting a keybind for the raid marker."],
|
||||||
L["You can set your keybinds quickly by typing /kb."],
|
L["You can set your keybinds quickly by typing /kb."],
|
||||||
@@ -26,7 +26,7 @@ function E:SetNextTutorial()
|
|||||||
self.db.currentTutorial = self.db.currentTutorial or 0
|
self.db.currentTutorial = self.db.currentTutorial or 0
|
||||||
self.db.currentTutorial = self.db.currentTutorial + 1
|
self.db.currentTutorial = self.db.currentTutorial + 1
|
||||||
|
|
||||||
if self.db.currentTutorial > gent(E.TutorialList) then
|
if self.db.currentTutorial > getn(E.TutorialList) then
|
||||||
self.db.currentTutorial = 1
|
self.db.currentTutorial = 1
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ function E:SetPrevTutorial()
|
|||||||
self.db.currentTutorial = self.db.currentTutorial - 1
|
self.db.currentTutorial = self.db.currentTutorial - 1
|
||||||
|
|
||||||
if self.db.currentTutorial <= 0 then
|
if self.db.currentTutorial <= 0 then
|
||||||
self.db.currentTutorial = gent(E.TutorialList)
|
self.db.currentTutorial = getn(E.TutorialList)
|
||||||
end
|
end
|
||||||
|
|
||||||
ElvUITutorialWindow.desc:SetText(E.TutorialList[self.db.currentTutorial])
|
ElvUITutorialWindow.desc:SetText(E.TutorialList[self.db.currentTutorial])
|
||||||
@@ -63,7 +63,7 @@ function E:SpawnTutorialFrame()
|
|||||||
header:SetFrameLevel(header:GetFrameLevel() + 2)
|
header:SetFrameLevel(header:GetFrameLevel() + 2)
|
||||||
|
|
||||||
local title = header:CreateFontString("OVERLAY")
|
local title = header:CreateFontString("OVERLAY")
|
||||||
title:FontTemplate()
|
E:FontTemplate(title)
|
||||||
title:SetPoint("CENTER", header, "CENTER")
|
title:SetPoint("CENTER", header, "CENTER")
|
||||||
title:SetText("ElvUI")
|
title:SetText("ElvUI")
|
||||||
|
|
||||||
@@ -77,28 +77,28 @@ function E:SpawnTutorialFrame()
|
|||||||
|
|
||||||
f.disableButton = CreateFrame("CheckButton", f:GetName().."DisableButton", f, "OptionsCheckButtonTemplate")
|
f.disableButton = CreateFrame("CheckButton", f:GetName().."DisableButton", f, "OptionsCheckButtonTemplate")
|
||||||
_G[f.disableButton:GetName() .. "Text"]:SetText(DISABLE)
|
_G[f.disableButton:GetName() .. "Text"]:SetText(DISABLE)
|
||||||
f.disableButton:SetPoint("BOTTOMLEFT")
|
f.disableButton:SetPoint("BOTTOMLEFT", -5, 5)
|
||||||
S:HandleCheckBox(f.disableButton)
|
S:HandleCheckBox(f.disableButton)
|
||||||
f.disableButton:SetScript("OnShow", function(self) self:SetChecked(E.db.hideTutorial) end)
|
f.disableButton:SetScript("OnShow", function() this:SetChecked(E.db.hideTutorial) end)
|
||||||
|
|
||||||
f.disableButton:SetScript("OnClick", function(self) E.db.hideTutorial = self:GetChecked() end)
|
f.disableButton:SetScript("OnClick", function() E.db.hideTutorial = this:GetChecked() end)
|
||||||
|
|
||||||
f.hideButton = CreateFrame("Button", f:GetName().."HideButton", f, "OptionsButtonTemplate")
|
f.hideButton = CreateFrame("Button", f:GetName().."HideButton", f, "OptionsButtonTemplate")
|
||||||
f.hideButton:SetPoint("BOTTOMRIGHT", -5, 5)
|
f.hideButton:SetPoint("BOTTOMRIGHT", -5, 5)
|
||||||
S:HandleButton(f.hideButton)
|
S:HandleButton(f.hideButton)
|
||||||
_G[f.hideButton:GetName() .. "Text"]:SetText(HIDE)
|
_G[f.hideButton:GetName() .. "Text"]:SetText(HIDE)
|
||||||
f.hideButton:SetScript("OnClick", function(self) E:StaticPopupSpecial_Hide(self:GetParent()) end)
|
f.hideButton:SetScript("OnClick", function() E:StaticPopupSpecial_Hide(this:GetParent()) end)
|
||||||
|
|
||||||
f.nextButton = CreateFrame("Button", f:GetName().."NextButton", f, "OptionsButtonTemplate")
|
f.nextButton = CreateFrame("Button", f:GetName().."NextButton", f, "OptionsButtonTemplate")
|
||||||
f.nextButton:SetPoint("RIGHT", f.hideButton, "LEFT", -4, 0)
|
f.nextButton:SetPoint("RIGHT", f.hideButton, "LEFT", -4, 0)
|
||||||
f.nextButton:Width(20)
|
f.nextButton:SetWidth(20)
|
||||||
S:HandleButton(f.nextButton)
|
S:HandleButton(f.nextButton)
|
||||||
_G[f.nextButton:GetName() .. "Text"]:SetText(">")
|
_G[f.nextButton:GetName() .. "Text"]:SetText(">")
|
||||||
f.nextButton:SetScript("OnClick", function() E:SetNextTutorial() end)
|
f.nextButton:SetScript("OnClick", function() E:SetNextTutorial() end)
|
||||||
|
|
||||||
f.prevButton = CreateFrame("Button", f:GetName().."PrevButton", f, "OptionsButtonTemplate")
|
f.prevButton = CreateFrame("Button", f:GetName().."PrevButton", f, "OptionsButtonTemplate")
|
||||||
f.prevButton:SetPoint("RIGHT", f.nextButton, "LEFT", -4, 0)
|
f.prevButton:SetPoint("RIGHT", f.nextButton, "LEFT", -4, 0)
|
||||||
f.prevButton:Width(20)
|
f.prevButton:SetWidth(20)
|
||||||
S:HandleButton(f.prevButton)
|
S:HandleButton(f.prevButton)
|
||||||
_G[f.prevButton:GetName() .. "Text"]:SetText("<")
|
_G[f.prevButton:GetName() .. "Text"]:SetText("<")
|
||||||
f.prevButton:SetScript("OnClick", function() E:SetPrevTutorial() end)
|
f.prevButton:SetScript("OnClick", function() E:SetPrevTutorial() end)
|
||||||
@@ -107,7 +107,7 @@ function E:SpawnTutorialFrame()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function E:Tutorials(forceShow)
|
function E:Tutorials(forceShow)
|
||||||
if (not forceShow and self.db.hideTutorial) or (not forceShow and not self.private.install_complete) then return; end
|
if (not forceShow and self.db.hideTutorial) or (not forceShow and not self.private.install_complete) then return end
|
||||||
local f = ElvUITutorialWindow
|
local f = ElvUITutorialWindow
|
||||||
if not f then
|
if not f then
|
||||||
f = E:SpawnTutorialFrame()
|
f = E:SpawnTutorialFrame()
|
||||||
|
|||||||
Reference in New Issue
Block a user