WoWInterface SVN Torta

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 30 to Rev 31
    Reverse comparison

Rev 30 → Rev 31

Torta/CL3.lua
179,22 → 179,39
end
 
function Checklist3:DeleteList(index)
print(Torta.db.profile.cfg.loadedList);
assert(index);
local loadedListIndex = Torta.db.profile.cfg.loadedList;
tremove(Torta.db.profile.lists, index);
-- print(index, loadedListIndex);
if loadedListIndex then
if index < loadedListIndex then
print(index, loadedListIndex, index < loadedListIndex);
self:LoadList(nil);
self:LoadList(loadedListIndex - 1);
end
end
gui:UpdateExplorerScrollBar();
if not Torta.db.profile.lists[Torta.db.profile.cfg.loadedList] then
print(Torta.db.profile.cfg.loadedList);
Torta.db.profile.cfg.loadedList = false;
self:LoadList(nil);
gui:UpdateCLScrollBar();
end
end
 
function Checklist3:RenameList(listID, newName)
print(listID, newName);
if not (type(newName) == "string") then
print(":D");
StaticPopup_Show("TORTA_CLRENAMELIST", Torta.db.profile.lists[listID].meta.listName);
else
Torta.db.profile.lists[listID].meta.listName = newName;
gui:UpdateExplorerScrollBar();
gui:UpdateCLScrollBar();
end
end
 
function Checklist3:RestoreList()
 
end
Torta/UIManager.lua
234,6 → 234,7
 
if self.data then
noLoadedListText:Hide();
cl3HeaderText:SetText(self.data.meta.listName);
FauxScrollFrame_Update(clScrollBar, #self.data.text, #self.clListButtons, 32, nil, nil, nil, nil, nil, nil, true)
if not isFromOnShow then
clScrollBar:Show();
320,7 → 321,12
-- print(offset, scrollBar:GetValue());
end
 
-- Note:
-- Add all UI management functions ABOVE!
 
-- ====================================================================
-- Dropdown menu stuff
-- ====================================================================
local clExplorerDropdownInfo = {
{
text = "Turtle Explorer",
350,7 → 356,7
},
{
text = "Rename this list",
func = function() end
func = function() Torta.cl3:RenameList(Torta.gui.selectedExplorerButton:GetID()); end
},
{
text = "Delete this list",
379,6 → 385,35
EasyMenu(clExplorerDropdownInfo, dropdown, "cursor", 0, 0, "MENU", 3);
end
 
-- ====================================================================
-- Dialogs
-- ====================================================================
StaticPopupDialogs["TORTA_CLRENAMELIST"] = {
text = "Please enter the new name for the list currently named \"|cffffd000%s|r\":",
OnAccept = function(button)
local newName = getglobal(button:GetParent():GetName() .. "EditBox"):GetText();
Torta.cl3:RenameList(Torta.gui.selectedExplorerButton:GetID(), newName);
button:GetParent():Hide();
end,
EditBoxOnEnterPressed = function(editBox)
print(editBox:GetName());
local newName = editBox:GetText();
print(newName);
Torta.cl3:RenameList(Torta.gui.selectedExplorerButton:GetID(), newName);
editBox:GetParent():Hide();
end,
button1 = ACCEPT,
button2 = CANCEL,
whileDead = 1,
timeout = 30,
hasEditBox = 1,
hideOnEscape = 1,
}
 
 
-- ====================================================================
-- Misc. UI init code
-- ====================================================================
FauxScrollFrame_SetOffset(explorerScrollBar, 0);
FauxScrollFrame_SetOffset(clScrollBar, 0);
 
Torta/Windows/DisplayWindow.xml
102,7 → 102,7
<Anchor point="RIGHT" relativeTo="$parentHeaderTexture"/>
</Anchors>
</FontString>
<FontString name="$parentHelpText" inherits="GameFontHighlight" justifyH="LEFT" text="|cffffd000Note|r: Only the first three lines of text will be displayed.">
<FontString name="$parentHelpText" inherits="GameFontHighlight" justifyH="LEFT" text="|cffffd000Hint|r: You can press Shift-ESC to save your task.">
<Anchors>
<Anchor point="BOTTOMLEFT">
<Offset x="6" y="9"/>