|
|
|
@ -92,14 +92,14 @@ end |
|
|
|
-- Deletes a group with the specified path and everything (items/subGroups) below it |
|
|
|
-- Deletes a group with the specified path and everything (items/subGroups) below it |
|
|
|
local function DeleteGroup(groupPath) |
|
|
|
local function DeleteGroup(groupPath) |
|
|
|
if not TSM.db.profile.groups[groupPath] then return end |
|
|
|
if not TSM.db.profile.groups[groupPath] then return end |
|
|
|
|
|
|
|
|
|
|
|
-- delete this group and all subgroups |
|
|
|
-- delete this group and all subgroups |
|
|
|
for path in pairs(TSM.db.profile.groups) do |
|
|
|
for path in pairs(TSM.db.profile.groups) do |
|
|
|
if path == groupPath or strfind(path, "^"..TSMAPI:StrEscape(groupPath)..TSM.GROUP_SEP) then |
|
|
|
if path == groupPath or strfind(path, "^"..TSMAPI:StrEscape(groupPath)..TSM.GROUP_SEP) then |
|
|
|
TSM.db.profile.groups[path] = nil |
|
|
|
TSM.db.profile.groups[path] = nil |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
local parent = SplitGroupPath(groupPath) |
|
|
|
local parent = SplitGroupPath(groupPath) |
|
|
|
if parent and TSM.db.profile.keepInParent then |
|
|
|
if parent and TSM.db.profile.keepInParent then |
|
|
|
-- move all items in this group its subgroups to the parent |
|
|
|
-- move all items in this group its subgroups to the parent |
|
|
|
@ -126,7 +126,7 @@ end |
|
|
|
local function MoveGroup(groupPath, newPath) |
|
|
|
local function MoveGroup(groupPath, newPath) |
|
|
|
if not TSM.db.profile.groups[groupPath] then return end |
|
|
|
if not TSM.db.profile.groups[groupPath] then return end |
|
|
|
if TSM.db.profile.groups[newPath] then return end |
|
|
|
if TSM.db.profile.groups[newPath] then return end |
|
|
|
|
|
|
|
|
|
|
|
-- change the path of all subgroups |
|
|
|
-- change the path of all subgroups |
|
|
|
local changes = {} |
|
|
|
local changes = {} |
|
|
|
for path, groupData in pairs(TSM.db.profile.groups) do |
|
|
|
for path, groupData in pairs(TSM.db.profile.groups) do |
|
|
|
@ -138,7 +138,7 @@ local function MoveGroup(groupPath, newPath) |
|
|
|
TSM.db.profile.groups[newPath] = TSM.db.profile.groups[oldPath] |
|
|
|
TSM.db.profile.groups[newPath] = TSM.db.profile.groups[oldPath] |
|
|
|
TSM.db.profile.groups[oldPath] = nil |
|
|
|
TSM.db.profile.groups[oldPath] = nil |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
-- change the path for all items in this group (and subgroups) |
|
|
|
-- change the path for all items in this group (and subgroups) |
|
|
|
changes = {} |
|
|
|
changes = {} |
|
|
|
for itemString, path in pairs(TSM.db.profile.items) do |
|
|
|
for itemString, path in pairs(TSM.db.profile.items) do |
|
|
|
@ -155,7 +155,7 @@ end |
|
|
|
local function AddItem(itemString, path) |
|
|
|
local function AddItem(itemString, path) |
|
|
|
if not (strfind(path, TSM.GROUP_SEP) or not TSM.db.profile.items[itemString]) then return end |
|
|
|
if not (strfind(path, TSM.GROUP_SEP) or not TSM.db.profile.items[itemString]) then return end |
|
|
|
if not TSM.db.profile.groups[path] then return end |
|
|
|
if not TSM.db.profile.groups[path] then return end |
|
|
|
|
|
|
|
|
|
|
|
TSM.db.profile.items[itemString] = path |
|
|
|
TSM.db.profile.items[itemString] = path |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
@ -186,7 +186,7 @@ end |
|
|
|
local function SetOperation(path, module, operation, index) |
|
|
|
local function SetOperation(path, module, operation, index) |
|
|
|
if not TSM.db.profile.groups[path] then return end |
|
|
|
if not TSM.db.profile.groups[path] then return end |
|
|
|
if not TSM.db.profile.groups[path][module] then return end |
|
|
|
if not TSM.db.profile.groups[path][module] then return end |
|
|
|
|
|
|
|
|
|
|
|
TSM.db.profile.groups[path][module][index] = operation |
|
|
|
TSM.db.profile.groups[path][module][index] = operation |
|
|
|
local subGroups = GetSubGroups(path) |
|
|
|
local subGroups = GetSubGroups(path) |
|
|
|
if subGroups then |
|
|
|
if subGroups then |
|
|
|
@ -198,7 +198,7 @@ end |
|
|
|
|
|
|
|
|
|
|
|
local function AddOperation(path, module) |
|
|
|
local function AddOperation(path, module) |
|
|
|
if not TSM.db.profile.groups[path] then return end |
|
|
|
if not TSM.db.profile.groups[path] then return end |
|
|
|
|
|
|
|
|
|
|
|
tinsert(TSM.db.profile.groups[path][module], "") |
|
|
|
tinsert(TSM.db.profile.groups[path][module], "") |
|
|
|
local subGroups = GetSubGroups(path) |
|
|
|
local subGroups = GetSubGroups(path) |
|
|
|
if subGroups then |
|
|
|
if subGroups then |
|
|
|
@ -219,7 +219,7 @@ end |
|
|
|
|
|
|
|
|
|
|
|
function SetOperationOverride(path, module, override) |
|
|
|
function SetOperationOverride(path, module, override) |
|
|
|
if not TSM.db.profile.groups[path] then return end |
|
|
|
if not TSM.db.profile.groups[path] then return end |
|
|
|
|
|
|
|
|
|
|
|
-- clear all operations for this path/module |
|
|
|
-- clear all operations for this path/module |
|
|
|
TSM.db.profile.groups[path][module] = {override=(override or nil)} |
|
|
|
TSM.db.profile.groups[path][module] = {override=(override or nil)} |
|
|
|
-- set this group's (and all applicable subgroups') operation to the parent's |
|
|
|
-- set this group's (and all applicable subgroups') operation to the parent's |
|
|
|
@ -253,7 +253,7 @@ function TSM:GetGroupPathList(module) |
|
|
|
end |
|
|
|
end |
|
|
|
tinsert(list, groupPath) |
|
|
|
tinsert(list, groupPath) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
for groupPath in pairs(TSM.db.profile.groups) do |
|
|
|
for groupPath in pairs(TSM.db.profile.groups) do |
|
|
|
if not disabled[groupPath] then |
|
|
|
if not disabled[groupPath] then |
|
|
|
local pathParts = {TSM.GROUP_SEP:split(groupPath)} |
|
|
|
local pathParts = {TSM.GROUP_SEP:split(groupPath)} |
|
|
|
@ -263,14 +263,14 @@ function TSM:GetGroupPathList(module) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
sort(list, function(a,b) return strlower(gsub(a, TSM.GROUP_SEP, "\001")) < strlower(gsub(b, TSM.GROUP_SEP, "\001")) end) |
|
|
|
sort(list, function(a,b) return strlower(gsub(a, TSM.GROUP_SEP, "\001")) < strlower(gsub(b, TSM.GROUP_SEP, "\001")) end) |
|
|
|
return list, disabled |
|
|
|
return list, disabled |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
function TSM:GetGroupOperations(path, module) |
|
|
|
function TSM:GetGroupOperations(path, module) |
|
|
|
if not TSM.db.profile.groups[path] then return end |
|
|
|
if not TSM.db.profile.groups[path] then return end |
|
|
|
|
|
|
|
|
|
|
|
if module and TSM.db.profile.groups[path][module] then |
|
|
|
if module and TSM.db.profile.groups[path][module] then |
|
|
|
local operations = CopyTable(TSM.db.profile.groups[path][module]) |
|
|
|
local operations = CopyTable(TSM.db.profile.groups[path][module]) |
|
|
|
for i=#operations, 1, -1 do |
|
|
|
for i=#operations, 1, -1 do |
|
|
|
@ -304,7 +304,7 @@ function TSMAPI:CreatePresetGroups(itemList, moduleName, operationInfo) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
private:UpdateTree() |
|
|
|
private:UpdateTree() |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
@ -339,13 +339,13 @@ local function ShowExportFrame(text) |
|
|
|
f:SetTitle("TradeSkillMaster - "..L["Export Group Items"]) |
|
|
|
f:SetTitle("TradeSkillMaster - "..L["Export Group Items"]) |
|
|
|
f:SetLayout("Fill") |
|
|
|
f:SetLayout("Fill") |
|
|
|
f:SetHeight(300) |
|
|
|
f:SetHeight(300) |
|
|
|
|
|
|
|
|
|
|
|
local eb = AceGUI:Create("TSMMultiLineEditBox") |
|
|
|
local eb = AceGUI:Create("TSMMultiLineEditBox") |
|
|
|
eb:SetLabel(L["Group Item Data"]) |
|
|
|
eb:SetLabel(L["Group Item Data"]) |
|
|
|
eb:SetMaxLetters(0) |
|
|
|
eb:SetMaxLetters(0) |
|
|
|
eb:SetText(text) |
|
|
|
eb:SetText(text) |
|
|
|
f:AddChild(eb) |
|
|
|
f:AddChild(eb) |
|
|
|
|
|
|
|
|
|
|
|
f.frame:SetFrameStrata("FULLSCREEN_DIALOG") |
|
|
|
f.frame:SetFrameStrata("FULLSCREEN_DIALOG") |
|
|
|
f.frame:SetFrameLevel(100) |
|
|
|
f.frame:SetFrameLevel(100) |
|
|
|
end |
|
|
|
end |
|
|
|
@ -367,12 +367,12 @@ function TSMAPI:DrawOperationManagement(TSMObj, container, operationName) |
|
|
|
for playerName in pairs(TSM.db.realm.characters) do |
|
|
|
for playerName in pairs(TSM.db.realm.characters) do |
|
|
|
playerList[playerName.." - "..realmKey] = playerName |
|
|
|
playerList[playerName.." - "..realmKey] = playerName |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
local realmList = {} |
|
|
|
local realmList = {} |
|
|
|
for realm in pairs(TSM.db.sv.realm) do |
|
|
|
for realm in pairs(TSM.db.sv.realm) do |
|
|
|
realmList[realm] = realm |
|
|
|
realmList[realm] = realm |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
local groupList = {} |
|
|
|
local groupList = {} |
|
|
|
for path, modules in pairs(TSM.db.profile.groups) do |
|
|
|
for path, modules in pairs(TSM.db.profile.groups) do |
|
|
|
if modules[moduleName] then |
|
|
|
if modules[moduleName] then |
|
|
|
@ -384,7 +384,7 @@ function TSMAPI:DrawOperationManagement(TSMObj, container, operationName) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
sort(groupList, function(a,b) return strlower(gsub(a, TSM.GROUP_SEP, "\001")) < strlower(gsub(b, TSM.GROUP_SEP, "\001")) end) |
|
|
|
sort(groupList, function(a,b) return strlower(gsub(a, TSM.GROUP_SEP, "\001")) < strlower(gsub(b, TSM.GROUP_SEP, "\001")) end) |
|
|
|
|
|
|
|
|
|
|
|
local groupWidgets = { |
|
|
|
local groupWidgets = { |
|
|
|
{ |
|
|
|
{ |
|
|
|
type = "Label", |
|
|
|
type = "Label", |
|
|
|
@ -422,7 +422,7 @@ function TSMAPI:DrawOperationManagement(TSMObj, container, operationName) |
|
|
|
text = TSMAPI:FormatGroupPath(groupPath, true), |
|
|
|
text = TSMAPI:FormatGroupPath(groupPath, true), |
|
|
|
}) |
|
|
|
}) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
local page = { |
|
|
|
local page = { |
|
|
|
{ |
|
|
|
{ |
|
|
|
type = "ScrollFrame", |
|
|
|
type = "ScrollFrame", |
|
|
|
@ -645,7 +645,7 @@ function TSMAPI:DrawOperationManagement(TSMObj, container, operationName) |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
TSMAPI:BuildPage(container, page) |
|
|
|
TSMAPI:BuildPage(container, page) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
@ -707,7 +707,7 @@ function TSMAPI:ShowOperationRelationshipTab(obj, container, operation, settingI |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
sort(operationListOrder) |
|
|
|
sort(operationListOrder) |
|
|
|
|
|
|
|
|
|
|
|
local target = "" |
|
|
|
local target = "" |
|
|
|
local children = { |
|
|
|
local children = { |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -794,8 +794,8 @@ function TSMAPI:ShowOperationRelationshipTab(obj, container, operation, settingI |
|
|
|
} |
|
|
|
} |
|
|
|
tinsert(children, inlineGroup) |
|
|
|
tinsert(children, inlineGroup) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
local page = { |
|
|
|
local page = { |
|
|
|
{ |
|
|
|
{ |
|
|
|
type = "ScrollFrame", |
|
|
|
type = "ScrollFrame", |
|
|
|
@ -803,7 +803,7 @@ function TSMAPI:ShowOperationRelationshipTab(obj, container, operation, settingI |
|
|
|
children = children, |
|
|
|
children = children, |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
TSMAPI:BuildPage(container, page) |
|
|
|
TSMAPI:BuildPage(container, page) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
@ -843,7 +843,7 @@ function TSM:LoadOperationOptions(parent) |
|
|
|
end |
|
|
|
end |
|
|
|
end) |
|
|
|
end) |
|
|
|
parent:AddChild(tabGroup) |
|
|
|
parent:AddChild(tabGroup) |
|
|
|
|
|
|
|
|
|
|
|
tabGroup:SelectTab(TSM.loadModuleOptionsTab and TSM.loadModuleOptionsTab.module or "Help") |
|
|
|
tabGroup:SelectTab(TSM.loadModuleOptionsTab and TSM.loadModuleOptionsTab.module or "Help") |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
@ -867,7 +867,7 @@ function private:DrawOperationHelp(container) |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
TSMAPI:BuildPage(container, page) |
|
|
|
TSMAPI:BuildPage(container, page) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
@ -882,7 +882,7 @@ function TSM:LoadGroupOptions(parent) |
|
|
|
treeGroup:SetCallback("OnGroupSelected", function(...) private:SelectTree(...) end) |
|
|
|
treeGroup:SetCallback("OnGroupSelected", function(...) private:SelectTree(...) end) |
|
|
|
treeGroup:SetStatusTable(TSM.db.profile.groupTreeStatus) |
|
|
|
treeGroup:SetStatusTable(TSM.db.profile.groupTreeStatus) |
|
|
|
parent:AddChild(treeGroup) |
|
|
|
parent:AddChild(treeGroup) |
|
|
|
|
|
|
|
|
|
|
|
private:UpdateTree() |
|
|
|
private:UpdateTree() |
|
|
|
treeGroup:SelectByPath(1) |
|
|
|
treeGroup:SelectByPath(1) |
|
|
|
end |
|
|
|
end |
|
|
|
@ -908,7 +908,7 @@ local function UpdateTreeHelper(currentPath, groupPathList, index, treeGroupChil |
|
|
|
end |
|
|
|
end |
|
|
|
function private:UpdateTree() |
|
|
|
function private:UpdateTree() |
|
|
|
if not treeGroup then return end |
|
|
|
if not treeGroup then return end |
|
|
|
|
|
|
|
|
|
|
|
local groupChildren = {} |
|
|
|
local groupChildren = {} |
|
|
|
local groupPathList = TSM:GetGroupPathList() |
|
|
|
local groupPathList = TSM:GetGroupPathList() |
|
|
|
UpdateTreeHelper(nil, groupPathList, 1, groupChildren, 1) |
|
|
|
UpdateTreeHelper(nil, groupPathList, 1, groupChildren, 1) |
|
|
|
@ -929,7 +929,7 @@ end |
|
|
|
local scrollFrameStatus = {} |
|
|
|
local scrollFrameStatus = {} |
|
|
|
function private:SelectTree(treeGroup, _, selection) |
|
|
|
function private:SelectTree(treeGroup, _, selection) |
|
|
|
treeGroup:ReleaseChildren() |
|
|
|
treeGroup:ReleaseChildren() |
|
|
|
|
|
|
|
|
|
|
|
selection = {("\001"):split(selection)} |
|
|
|
selection = {("\001"):split(selection)} |
|
|
|
if #selection == 1 then |
|
|
|
if #selection == 1 then |
|
|
|
private:DrawNewGroup(treeGroup) |
|
|
|
private:DrawNewGroup(treeGroup) |
|
|
|
@ -1040,7 +1040,7 @@ function private:DrawNewGroup(container) |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
TSMAPI:BuildPage(container, page) |
|
|
|
TSMAPI:BuildPage(container, page) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
@ -1055,7 +1055,7 @@ function private:DrawGroupOperationsPage(container, groupPath) |
|
|
|
for name in pairs(TSM.operations[moduleName] or {}) do |
|
|
|
for name in pairs(TSM.operations[moduleName] or {}) do |
|
|
|
ddList[name] = name |
|
|
|
ddList[name] = name |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
TSM.db.profile.groups[groupPath][moduleName] = TSM.db.profile.groups[groupPath][moduleName] or {} |
|
|
|
TSM.db.profile.groups[groupPath][moduleName] = TSM.db.profile.groups[groupPath][moduleName] or {} |
|
|
|
local operations = TSM.db.profile.groups[groupPath][moduleName] |
|
|
|
local operations = TSM.db.profile.groups[groupPath][moduleName] |
|
|
|
for i=#operations, 1, -1 do |
|
|
|
for i=#operations, 1, -1 do |
|
|
|
@ -1074,7 +1074,7 @@ function private:DrawGroupOperationsPage(container, groupPath) |
|
|
|
title = moduleName, |
|
|
|
title = moduleName, |
|
|
|
children = {}, |
|
|
|
children = {}, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
local addOperationWidget |
|
|
|
local addOperationWidget |
|
|
|
if #operations < info.maxOperations then |
|
|
|
if #operations < info.maxOperations then |
|
|
|
addOperationWidget = { |
|
|
|
addOperationWidget = { |
|
|
|
@ -1105,7 +1105,7 @@ function private:DrawGroupOperationsPage(container, groupPath) |
|
|
|
else |
|
|
|
else |
|
|
|
tinsert(moduleInline.children, {type="Label", relativeWidth=1}) |
|
|
|
tinsert(moduleInline.children, {type="Label", relativeWidth=1}) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
for i=1, #operations do |
|
|
|
for i=1, #operations do |
|
|
|
tinsert(moduleInline.children, { |
|
|
|
tinsert(moduleInline.children, { |
|
|
|
type = "Dropdown", |
|
|
|
type = "Dropdown", |
|
|
|
@ -1149,7 +1149,7 @@ function private:DrawGroupOperationsPage(container, groupPath) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
tinsert(moduleInline.children, addOperationWidget) |
|
|
|
tinsert(moduleInline.children, addOperationWidget) |
|
|
|
|
|
|
|
|
|
|
|
local opStrs = {} |
|
|
|
local opStrs = {} |
|
|
|
for _, name in ipairs(operations) do |
|
|
|
for _, name in ipairs(operations) do |
|
|
|
if name ~= "" then |
|
|
|
if name ~= "" then |
|
|
|
@ -1163,12 +1163,12 @@ function private:DrawGroupOperationsPage(container, groupPath) |
|
|
|
text = #opStrs > 0 and table.concat(opStrs, "\n") or format(L["Select a %s operation using the dropdown above."], moduleName), |
|
|
|
text = #opStrs > 0 and table.concat(opStrs, "\n") or format(L["Select a %s operation using the dropdown above."], moduleName), |
|
|
|
relativeWidth = 1, |
|
|
|
relativeWidth = 1, |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
tinsert(moduleInlines, moduleInline) |
|
|
|
tinsert(moduleInlines, moduleInline) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
sort(moduleInlines, function(a, b) return a.title < b.title end) |
|
|
|
sort(moduleInlines, function(a, b) return a.title < b.title end) |
|
|
|
|
|
|
|
|
|
|
|
local children = {} |
|
|
|
local children = {} |
|
|
|
for i, inline in ipairs(moduleInlines) do |
|
|
|
for i, inline in ipairs(moduleInlines) do |
|
|
|
tinsert(children, inline) |
|
|
|
tinsert(children, inline) |
|
|
|
@ -1176,7 +1176,7 @@ function private:DrawGroupOperationsPage(container, groupPath) |
|
|
|
tinsert(children, {type="Spacer"}) |
|
|
|
tinsert(children, {type="Spacer"}) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
local page = { |
|
|
|
local page = { |
|
|
|
{ |
|
|
|
{ |
|
|
|
type = "ScrollFrame", |
|
|
|
type = "ScrollFrame", |
|
|
|
@ -1184,7 +1184,7 @@ function private:DrawGroupOperationsPage(container, groupPath) |
|
|
|
children = children, |
|
|
|
children = children, |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
TSMAPI:BuildPage(container, page) |
|
|
|
TSMAPI:BuildPage(container, page) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
@ -1194,7 +1194,7 @@ function private:DrawGroupItemsPage(container, groupPath) |
|
|
|
alreadyLoaded[groupPath] = true |
|
|
|
alreadyLoaded[groupPath] = true |
|
|
|
TSMAPI:CreateTimeDelay("itemsTabLoad", 0.1, function() container:ReloadTab() end) |
|
|
|
TSMAPI:CreateTimeDelay("itemsTabLoad", 0.1, function() container:ReloadTab() end) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
local parentPath, groupName = SplitGroupPath(groupPath) |
|
|
|
local parentPath, groupName = SplitGroupPath(groupPath) |
|
|
|
local function GetItemList(side) |
|
|
|
local function GetItemList(side) |
|
|
|
local list = {} |
|
|
|
local list = {} |
|
|
|
@ -1240,7 +1240,7 @@ function private:DrawGroupItemsPage(container, groupPath) |
|
|
|
end |
|
|
|
end |
|
|
|
return list |
|
|
|
return list |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
local leftTitle, rightTitle |
|
|
|
local leftTitle, rightTitle |
|
|
|
if parentPath then |
|
|
|
if parentPath then |
|
|
|
if TSM.db.profile.directSubgroupAdd then |
|
|
|
if TSM.db.profile.directSubgroupAdd then |
|
|
|
@ -1253,7 +1253,7 @@ function private:DrawGroupItemsPage(container, groupPath) |
|
|
|
leftTitle = L["Ungrouped Items:"] |
|
|
|
leftTitle = L["Ungrouped Items:"] |
|
|
|
rightTitle = L["Group Items:"] |
|
|
|
rightTitle = L["Group Items:"] |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
local page = { |
|
|
|
local page = { |
|
|
|
{ -- scroll frame to contain everything |
|
|
|
{ -- scroll frame to contain everything |
|
|
|
type = "SimpleGroup", |
|
|
|
type = "SimpleGroup", |
|
|
|
@ -1298,7 +1298,7 @@ function TSM:ImportGroup(importStr, groupPath) |
|
|
|
importStr = importStr:trim() |
|
|
|
importStr = importStr:trim() |
|
|
|
if importStr == "" then return end |
|
|
|
if importStr == "" then return end |
|
|
|
local parentPath = strfind(groupPath, TSM.GROUP_SEP) and SplitGroupPath(groupPath) |
|
|
|
local parentPath = strfind(groupPath, TSM.GROUP_SEP) and SplitGroupPath(groupPath) |
|
|
|
|
|
|
|
|
|
|
|
if strfind(importStr, "^|c") then |
|
|
|
if strfind(importStr, "^|c") then |
|
|
|
local itemString = TSMAPI:GetItemString(importStr) |
|
|
|
local itemString = TSMAPI:GetItemString(importStr) |
|
|
|
if not itemString then return end |
|
|
|
if not itemString then return end |
|
|
|
@ -1312,8 +1312,9 @@ function TSM:ImportGroup(importStr, groupPath) |
|
|
|
end |
|
|
|
end |
|
|
|
return 0 |
|
|
|
return 0 |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
local items = {} |
|
|
|
local items = {} |
|
|
|
|
|
|
|
local bulkquerybuffer = {} |
|
|
|
local currentSubPath = "" |
|
|
|
local currentSubPath = "" |
|
|
|
for _, str in ipairs(TSMAPI:SafeStrSplit(importStr, ",")) do |
|
|
|
for _, str in ipairs(TSMAPI:SafeStrSplit(importStr, ",")) do |
|
|
|
str = str:trim() |
|
|
|
str = str:trim() |
|
|
|
@ -1331,16 +1332,19 @@ function TSM:ImportGroup(importStr, groupPath) |
|
|
|
if not tonumber(itemID) or not tonumber(randomEnchant) then return end |
|
|
|
if not tonumber(itemID) or not tonumber(randomEnchant) then return end |
|
|
|
itemString = "item:"..tonumber(itemID)..":0:0:0:0:0:"..tonumber(randomEnchant) |
|
|
|
itemString = "item:"..tonumber(itemID)..":0:0:0:0:0:"..tonumber(randomEnchant) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
if subPath then |
|
|
|
if subPath then |
|
|
|
currentSubPath = subPath |
|
|
|
currentSubPath = subPath |
|
|
|
elseif itemString then |
|
|
|
elseif itemString then |
|
|
|
items[itemString] = currentSubPath |
|
|
|
items[itemString] = currentSubPath |
|
|
|
|
|
|
|
local item = Item:CreateFromID(tonumber(noSpaceStr)) |
|
|
|
|
|
|
|
if not item:IsCached() then bulkquerybuffer[#bulkquerybuffer+1] = item.itemID end |
|
|
|
else |
|
|
|
else |
|
|
|
return |
|
|
|
return |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
TSMAPI:BulkQuery(bulkquerybuffer) |
|
|
|
|
|
|
|
|
|
|
|
local num = 0 |
|
|
|
local num = 0 |
|
|
|
for itemString, subPath in pairs(items) do |
|
|
|
for itemString, subPath in pairs(items) do |
|
|
|
if not (parentPath and TSM.db.profile.moveImportedItems and TSM.db.profile.importParentOnly and TSM.db.profile.items[itemString] ~= parentPath) then |
|
|
|
if not (parentPath and TSM.db.profile.moveImportedItems and TSM.db.profile.importParentOnly and TSM.db.profile.items[itemString] ~= parentPath) then |
|
|
|
@ -1614,7 +1618,7 @@ function private:DrawGroupManagementPage(container, groupPath) |
|
|
|
if TSM.db.profile.groups[newPath] then |
|
|
|
if TSM.db.profile.groups[newPath] then |
|
|
|
return TSM:Printf(L["Error moving group. Group '%s' already exists."], TSMAPI:FormatGroupPath(newPath, true)) |
|
|
|
return TSM:Printf(L["Error moving group. Group '%s' already exists."], TSMAPI:FormatGroupPath(newPath, true)) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
TSM:Printf(L["Moved %s to %s."], TSMAPI:FormatGroupPath(groupPath, true), TSMAPI:FormatGroupPath(value, true)) |
|
|
|
TSM:Printf(L["Moved %s to %s."], TSMAPI:FormatGroupPath(groupPath, true), TSMAPI:FormatGroupPath(value, true)) |
|
|
|
MoveGroup(groupPath, newPath) |
|
|
|
MoveGroup(groupPath, newPath) |
|
|
|
TSMAPI:FireEvent("TSM:GROUPS:MOVEGROUP", {old=groupPath, new=newPath}) |
|
|
|
TSMAPI:FireEvent("TSM:GROUPS:MOVEGROUP", {old=groupPath, new=newPath}) |
|
|
|
@ -1634,7 +1638,7 @@ function private:DrawGroupManagementPage(container, groupPath) |
|
|
|
if TSM.db.profile.groups[newPath] then |
|
|
|
if TSM.db.profile.groups[newPath] then |
|
|
|
return TSM:Printf(L["Error moving group. Group '%s' already exists."], TSMAPI:FormatGroupPath(newPath, true)) |
|
|
|
return TSM:Printf(L["Error moving group. Group '%s' already exists."], TSMAPI:FormatGroupPath(newPath, true)) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
TSM:Printf(L["Moved %s to %s."], TSMAPI:FormatGroupPath(groupPath, true), TSMAPI:FormatGroupPath(newPath, true)) |
|
|
|
TSM:Printf(L["Moved %s to %s."], TSMAPI:FormatGroupPath(groupPath, true), TSMAPI:FormatGroupPath(newPath, true)) |
|
|
|
MoveGroup(groupPath, newPath) |
|
|
|
MoveGroup(groupPath, newPath) |
|
|
|
TSMAPI:FireEvent("TSM:GROUPS:MOVEGROUP", {old=groupPath, new=newPath}) |
|
|
|
TSMAPI:FireEvent("TSM:GROUPS:MOVEGROUP", {old=groupPath, new=newPath}) |
|
|
|
@ -1684,4 +1688,4 @@ function private:DrawGroupManagementPage(container, groupPath) |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
TSMAPI:BuildPage(container, page) |
|
|
|
TSMAPI:BuildPage(container, page) |
|
|
|
end |
|
|
|
end |
|
|
|
|