/
local WoWISVNRevision = GetAddOnMetadata("Torta", "X-WoWISVNRevision"); |
local version = GetAddOnMetadata("Torta", "Version"); |
if tonumber(WoWISVNRevision) then |
vLabel:SetFormattedText("Torta v%s.%s", version, WoWISVN_Revision); |
vLabel:SetFormattedText("Torta v%s.%s (|cffffff00Beta|r)", version, WoWISVNRevision); |
else |
vLabel:SetFormattedText("Checklist Project Version %s WoWInterface SVN Working Copy (|cffff0000unstable alpha|r)", version); |
end |
vLabel:SetJustifyH("LEFT"); |
vLabel:SetAlpha(0.7); |
-- stand-in data for the scrollbars to scroll through while the data storage |
-- stuff is being worked on |
self.data = {}; |
for i = 1, 100 do |
self.data[i] = "Item " .. i; |
end |
Torta.gui:Initialize(); |
Torta.cl3:InitializeChecklist(); |
local clTopButton = TortaParentFrameMainPageDisplaySubWindowTaskButton1; |
local taskEditor = TortaParentFrameMainPageTaskEditorSubWindow; |
local taskBar = TortaParentFrameMainPageTaskbar; |
local editTaskEB = TortaParentFrameMainPageTaskEditorSubWindowEditBox; |
local cl3HeaderText = TortaParentFrameMainPageDisplaySubWindowHeaderText; |
e.cl3HeaderText = cl3HeaderText; |
e.taskEditor = taskEditor; |
e.taskBar = taskBar; |
e.editTaskEB = editTaskEB; |
e = nil; |
---------------------------------------------------------------------------------------- |
function Torta.gui.scalingFinishedFunc(frame) |
<Anchors> |
<Anchor point="BOTTOMLEFT" relativeTo="$parentExplorerSubWindow" relativePoint="BOTTOMRIGHT"/> |
<Anchor point="TOPRIGHT" relativeTo="$parentTaskbar" relativePoint="BOTTOMRIGHT"> |
<Offset y="125"/> |
<Offset y="150"/> |
</Anchor> |
</Anchors> |
<Layers> |
</FontString> |
</Layer> |
</Layers> |
<Frames> |
<Button name="$parentEnterButton" inherits="UIPanelButtonTemplate" text="Enter"> |
<Size x="100" y="23"/> |
<Anchors> |
<Anchor point="BOTTOMRIGHT"> |
<Offset x="-3" y="3"/> |
</Anchor> |
</Anchors> |
<Scripts> |
<OnClick> |
Torta.cl3:ModifyOpenTask(getglobal(self:GetParent():GetName() .. "EditBox"):GetText()); |
getglobal(self:GetParent():GetName() .. "EditBox"):ClearFocus(); |
Torta.gui:UpdateCLScrollBar(); |
</OnClick> |
</Scripts> |
</Button> |
<EditBox name="$parentEditBox" multiLine="true" autoFocus="false"> |
<Anchors> |
<Anchor point="TOPLEFT" relativeTo="$parentHeaderText" relativePoint="BOTTOMLEFT"/> |
<Anchor point="BOTTOMRIGHT" relativeTo="$parentEnterButton" relativePoint="TOPRIGHT"/> |
</Anchors> |
<Scripts> |
<OnEscapePressed> |
self:ClearFocus(); |
</OnEscapePressed> |
<OnEnterPressed> |
self:ClearFocus(); |
print("Moo!"); |
</OnEnterPressed> |
</Scripts> |
<FontString inherits="GameFontHighlight" setAllPoints="true"/> |
</EditBox> |
</Frames> |
</Frame> |
</Ui> |
</Scripts> |
</Button> |
<FontString name="TortaCLFontStringTemplate" inherits="GameFontHighlight" maxLines="3" virtual="true"/> |
<Button name="TortaChecklistTaskButton" inherits="TortaListboxButtonTemplate" virtual="true"> |
<Size y="32"/> |
<!-- LISTBUTTON SCRIPTS --> |
<!-- CHECKBUTTON SCRIPTS --> |
<Scripts> |
<OnLoad> |
local fs = self:CreateFontString(nil, "ARTWORK", "GameFontHighlight"); |
local fs = self:CreateFontString(nil, "ARTWORK", "TortaCLFontStringTemplate"); |
fs:SetPoint("LEFT", self, "RIGHT", 3); |
fs:SetPoint("RIGHT", self:GetParent(), "RIGHT", -3); |
fs:SetText("Hello, World!"); |
</Scripts> |
</CheckButton> |
</Frames> |
</Button> |
</Ui> |
widgets.cl3HeaderText:SetText("Torta Checklist"); |
gui:UpdateCLScrollBar(); |
Torta.db.profile.cfg.loadedList = false; |
else |
-- Do the opposite! |
Torta.gui.data = lists[listID]; |
FauxScrollFrame_SetOffset(Torta.gui.elements.clScrollBar, 0); |
getglobal(widgets.clScrollBar:GetName() .. "ScrollBar"):SetValue(0); |
widgets.cl3HeaderText:SetText(lists[listID].meta.listName); |
Torta.db.profile.cfg.loadedList = listID; |
gui:UpdateCLScrollBar(); |
end |
end |
function Checklist3:EditTask(taskID) |
print(taskID) |
if self.openTask and self.openTask == taskID then |
-- close the task editor |
self.openTask = nil; |
-- open the task editor |
self:ShowTaskEditor(taskID); |
self.openTask = taskID; |
widgets.editTaskEB:SetText(Torta.db.profile.lists[Torta.db.profile.cfg.loadedList].text[taskID]); |
end |
end |
function Checklist3:ModifyOpenTask(newText) |
assert(type(self.openTask) == "number"); |
local profile = Torta.db.profile; |
profile.lists[profile.cfg.loadedList].text[self.openTask] = newText; |
end |
function Checklist3:HideTaskEditor() |
dispWnd:ClearAllPoints(); |
dispWnd:SetPoint(unpack(displayWindowPoints)); |
tEditor:Hide(); |
end |
function Checklist3:ShowTaskEditor(taskID) |
tEditor:Show(); |
dispWnd:ClearAllPoints(); |
dispWnd:SetPoint("BOTTOMRIGHT", tEditor, "TOPRIGHT"); |
getglobal(tEditor:GetName() .. "HeaderText"):SetText("Task Editor: " .. (taskID or "|cffff0000No task ID|r")) |
end |
local Notebook = Torta.nb2; |
function Notebook:InitializeNotebook() |
PanelTemplates_DisableTab(TortaParentFrame, 3); |
end |