diff --git a/Bindings.xml b/Bindings.xml deleted file mode 100644 index 05c2f77..0000000 --- a/Bindings.xml +++ /dev/null @@ -1,9 +0,0 @@ -<Bindings> - <Layer name="SI_KEYBINDINGS_LAYER_GENERAL"> - <Category name="MYCOLLECTION_TITLE"> - <Action name="MYCOLLECTION_MENU_TOGGLE"> - <Down>SLASH_COMMANDS["/mycollection"]()</Down> - </Action> - </Category> - </Layer> -</Bindings> diff --git a/Globals.lua b/Globals.lua deleted file mode 100644 index c36207b..0000000 --- a/Globals.lua +++ /dev/null @@ -1,19 +0,0 @@ -local MyCollection = MyCollection - -MyCollection.Name = "MyCollection" -MyCollection.DisplayName = "My Collection" -MyCollection.Version = "0.1.0" -MyCollection.Internals.SavedVariables = { - Inventory = { - Name = "MyCollection_Inventory", - Version = 1, - }, - Collection = { - Name = "MyCollection_Collection", - Version = 1, - }, - Settings = { - Name = "MyCollection_Settings", - Version = 1, - } -} \ No newline at end of file diff --git a/Internals/Classes/Bag.lua b/Internals/Classes/Bag.lua deleted file mode 100644 index 1225b5b..0000000 --- a/Internals/Classes/Bag.lua +++ /dev/null @@ -1,111 +0,0 @@ -local Classes = MyCollection.Internals.Classes -local Constants = MyCollection.Internals.Constants -local Logger = MyCollection.Internals.Dependencies.Logger -local Dependencies = MyCollection.Internals.Dependencies - -Classes.Bag = {} -Classes.Bag.__index = Classes.Bag - -local Bag = Classes.Bag - --- Constructor -function Bag.New(savedTable, characterId) - local instance = {} - setmetatable(instance, Bag) - - instance:Initialize(savedTable, characterId) - return instance -end - -Bag.savedTableReference = nil - --- Properties -Bag.worn = nil -Bag.backpack = nil - --- Functions -function Bag:FindAll(setId, equipType, traitType, armorType, weaponType) - local items = {} - if next(self.worn) ~= nil then - for _, item in pairs(self.worn) do - if item:Equals(setId, equipType, traitType, armorType, weaponType) then - table.insert(items, item) - end - end - end - if next(self.backpack) ~= nil then - for _, item in pairs(self.backpack) do - if item:Equals(setId, equipType, traitType, armorType, weaponType) then - table.insert(items, item) - end - end - end - - return items -end - -function Bag:AddItem(item) - local saveCopy = item:CopyForSave() - - if item.bagId == Constants.BagTypes.Worn then - self.worn[item.slotId] = item - self.savedTableReference[Constants.BagTypes.Worn][item.slotId] = saveCopy - end - if item.bagId == Constants.BagTypes.Backpack then - self.backpack[item.slotId] = item - self.savedTableReference[Constants.BagTypes.Backpack][item.slotId] = saveCopy - end -end - -function Bag:RemoveItem(bagId, slotId) - if bagId == Constants.BagTypes.Worn then - local item = self.worn[slotId] - table.remove(self.worn, slotId) - table.remove(self.savedTableReference[Constants.BagTypes.Worn], slotId) - end - if bagId == Constants.BagTypes.Backpack then - local item = self.backpack[slotId] - table.remove(self.backpack, slotId) - table.remove(self.savedTableReference[Constants.BagTypes.Backpack], slotId) - end - - return item -end - -function Bag:Clear() - self.worn = {} - self.backpack = {} - self.savedTableReference[Constants.BagTypes.Worn] = {} - self.savedTableReference[Constants.BagTypes.Backpack] = {} -end - -function Bag:Refresh() - self:Clear() - Dependencies.Officials.SharedInventory:RefreshInventory(Constants.BagTypes.Worn) - Dependencies.Officials.SharedInventory:RefreshInventory(Constants.BagTypes.Backpack) -end - -function Bag:Initialize(savedTable, characterId) - self.worn = {} - self.backpack = {} - - self.savedTableReference = savedTable - if savedTable == nil then - savedTable = {} - end - - if (savedTable[Constants.BagTypes.Worn] == nil) then savedTable[Constants.BagTypes.Worn] = {} end - if (savedTable[Constants.BagTypes.Backpack] == nil) then savedTable[Constants.BagTypes.Backpack] = {} end - - if (next(savedTable[Constants.BagTypes.Worn]) ~= nil) then - for slotId, item in pairs(savedTable[Constants.BagTypes.Worn]) do - self.worn[slotId] = Classes.Item.New(characterId, Constants.BagTypes.Worn, slotId, item.setId, item.equipType, item.traitType, item.armorType, item.weaponType, item.link) - end - end - - if (next(savedTable[Constants.BagTypes.Backpack]) ~= nil) then - for slotId, item in pairs(savedTable[Constants.BagTypes.Backpack]) do - self.backpack[slotId] = Classes.Item.New(characterId, Constants.BagTypes.Backpack, slotId, item.setId, item.equipType, item.traitType, item.armorType, item.weaponType, item.link) - end - end -end \ No newline at end of file diff --git a/Internals/Classes/Collection.lua b/Internals/Classes/Collection.lua deleted file mode 100644 index b2603aa..0000000 --- a/Internals/Classes/Collection.lua +++ /dev/null @@ -1,83 +0,0 @@ -local Classes = MyCollection.Internals.Classes -local Constants = MyCollection.Internals.Constants -local Logger = MyCollection.Internals.Dependencies.Logger -local Dependencies = MyCollection.Internals.Dependencies - -Classes.Collection = {} -Classes.Collection.__index = Classes.Collection - -local Collection = Classes.Collection - --- Constructor -function Collection.New(savedTable) - local instance = {} - setmetatable(instance, Collection) - - instance:Initialize(savedTable) - return instance -end - --- Fields -Collection.savedTableReference = nil - --- Properties -Collection.sets = {} - --- Functions -function Collection:GetSets() - return self.sets -end - -function Collection:AddItem(item) - if (next(self.sets) ~= nil) then - for key, set in pairs(self.sets) do - if set:GetSetId() == item.setId then - self.sets[key]:AddItem(item) - end - end - end -end - -function Collection:RemoveItem(item) - if (next(self.sets) ~= nil) then - for key, set in pairs(self.sets) do - if set:GetSetId() == item.setId then - self.sets[key]:RemoveItem(item) - end - end - end -end - -function Collection:AddSet(setId, armorType, orderNumber) - local newId = -1 - if (next(self.sets) ~= nil) then - for key, _ in pairs(self.sets) do - if key > newId then - newId = key - end - end - end - newId = newId + 1 - self.savedTableReference.sets[newId] = {} - self.sets[newId] = Classes.Set.New(self.savedTableReference.sets[newId], setId, nil, armorType, orderNumber) -end - -function Collection:RemoveSet(id) - table.remove(self.sets, id) - table.remove(self.savedTableReference.sets, id) -end - -function Collection:Clear() - self.sets = {} - self.savedTableReference.sets = {} -end - -function Collection:Initialize(savedTable) - self.savedTableReference = savedTable - - if (next(savedTable.sets) ~= nil) then - for id, set in pairs(savedTable.sets) do - self.sets[id] = Classes.Set.New(savedTable.sets[id], set.setId, set.setName, set.armorType, set.orderNumber) - end - end -end \ No newline at end of file diff --git a/Internals/Classes/Inventory.lua b/Internals/Classes/Inventory.lua deleted file mode 100644 index 225b963..0000000 --- a/Internals/Classes/Inventory.lua +++ /dev/null @@ -1,159 +0,0 @@ -local Classes = MyCollection.Internals.Classes -local Constants = MyCollection.Internals.Constants -local Extensions = MyCollection.Internals.Functions.Extensions -local Logger = MyCollection.Internals.Dependencies.Logger -local Dependencies = MyCollection.Internals.Dependencies -Classes.Inventory = {} -Classes.Inventory.__index = Classes.Inventory - -local Inventory = Classes.Inventory - --- Constructor -function Inventory.New(savedTable) - local instance = {} - setmetatable(instance, Inventory) - - instance:Initialize(savedTable) - return instance -end - -Inventory.savedTableReference = nil - --- Properties -Inventory.banks = { - [Constants.BagTypes.Bank] = {}, - [Constants.BagTypes.SubscriberBank] = {}, -} -Inventory.bags = {} - --- Functions -function Inventory:FindAll(setId, equipType, traitType, armorType, weaponType) - local items = {} - for bankId, bank in pairs(self.banks) do - if next(bank) ~= nil then - for slotId, item in pairs(bank) do - if item:Equals(setId, equipType, traitType, armorType, weaponType) then - table.insert(items, self.banks[bankId][slotId]) - end - end - end - end - - for _, bag in pairs(self.bags) do - for _, item in ipairs(bag:FindAll(setId, equipType, traitType, armorType, weaponType)) do - table.insert(items, item) - end - end - - return items -end - -function Inventory:AddItem(item) - local characterId = Dependencies.Officials.GetCurrentCharacterId() - if Extensions.Constants.IsCharacterBag(item.bagId) then - self:GetOrCreateBag(characterId):AddItem(item) - else - if Extensions.Constants.IsBank(item.bagId) then - self:AddItemToBank(item) - end - end - - if Logger ~= nil and item ~= nil then - local _, setName, _, _, _, _ = Dependencies.LibSets.IsSetByItemLink(item.link) - Logger:Debug("Added bagId:'".. item.bagId .. "', slotId: '".. item.slotId .. "' setName: '".. setName .."' Link: ".. item.link) - end -end - -function Inventory:RemoveItem(bagId, slotId) - local item = nil - local characterId = Dependencies.Officials.GetCurrentCharacterId() - if Extensions.Constants.IsCharacterBag(bagId) then - item = self:GetOrCreateBag(characterId):RemoveItem(bagId, slotId) - else - if Extensions.Constants.IsBank(bagId) then - if (self.banks[bagId][slotId] ~= nil) then - item = self:RemoveItemFromBank(bagId, slotId) - end - end - end - - if Logger ~= nil and item ~= nil then - local _, setName, _, _, _, _ = Dependencies.LibSets.IsSetByItemLink(item.link) - Logger:Debug("Removed bagId:'".. bagId .. "', slotId: '".. slotId .. "' setName: '".. setName .."' Link: ".. item.link) - end - - return item -end - -function Inventory:AddBag(characterId) - self.savedTableReference.bags[characterId] = {} - self.bags[characterId] = Classes.Bag.New(self.savedTableReference.bags[characterId], characterId) -end - -function Inventory:GetOrCreateBag(characterId) - if self.bags[characterId] == nil then - self:AddBag(characterId) - end - return self.bags[characterId] -end - -function Inventory:AddItemToBank(item) - self.banks[item.bagId][item.slotId] = item - self.savedTableReference.banks[item.bagId][item.slotId] = item:CopyForSave() -end - -function Inventory:RemoveItemFromBank(bagId, slotId) - local item = self.banks[bagId][slotId] - table.remove(self.banks[bagId], slotId) - table.remove(self.savedTableReference.banks[bagId], slotId) - - return item -end - -function Inventory:Clear(keepOtherCharacters) - self.banks[Constants.BagTypes.Bank] = {} - self.banks[Constants.BagTypes.SubscriberBank] = {} - self.savedTableReference.banks[Constants.BagTypes.Bank] = {} - self.savedTableReference.banks[Constants.BagTypes.SubscriberBank] = {} - if keepOtherCharacters == nil or keepOtherCharacters then - local characterId = Dependencies.Officials.GetCurrentCharacterId() - if self.bags[characterId] ~= nil then - self:GetOrCreateBag(characterId):Clear() - end - else - for characterId, _ in pairs(self.bags) do - self:GetOrCreateBag(characterId):Clear() - end - end -end - -function Inventory:Refresh() - self:Clear(true) - Dependencies.Officials.SharedInventory:RefreshInventory(Constants.BagTypes.Bank) - Dependencies.Officials.SharedInventory:RefreshInventory(Constants.BagTypes.SubscriberBank) - - local characterId = Dependencies.Officials.GetCurrentCharacterId() - self:GetOrCreateBag(characterId):Refresh() -end - -function Inventory:Initialize(savedTable) - self.savedTableReference = savedTable - - if (next(savedTable.banks[Constants.BagTypes.Bank]) ~= nil) then - for slotId, item in pairs(savedTable.banks[Constants.BagTypes.Bank]) do - self.banks[Constants.BagTypes.Bank][slotId] = Classes.Item.New(characterId, Constants.BagTypes.Bank, slotId, item.setId, item.equipType, item.traitType, item.armorType, item.weaponType, item.link) - end - end - - if (next(savedTable.banks[Constants.BagTypes.SubscriberBank]) ~= nil) then - for slotId, item in pairs(savedTable.banks[Constants.BagTypes.SubscriberBank]) do - self.banks[Constants.BagTypes.SubscriberBank][slotId] = Classes.Item.New(characterId, Constants.BagTypes.SubscriberBank, slotId, item.setId, item.equipType, item.traitType, item.armorType, item.weaponType, item.link) - end - end - - if (next(savedTable.bags) ~= nil) then - for characterId, _ in pairs(savedTable.bags) do - self.bags[characterId] = Classes.Bag.New(savedTable.bags[characterId], characterId) - end - end -end \ No newline at end of file diff --git a/Internals/Classes/Item.lua b/Internals/Classes/Item.lua deleted file mode 100644 index eb14758..0000000 --- a/Internals/Classes/Item.lua +++ /dev/null @@ -1,124 +0,0 @@ -local Classes = MyCollection.Internals.Classes -local Constants = MyCollection.Internals.Constants -local Dependencies = MyCollection.Internals.Dependencies -local Extensions = MyCollection.Internals.Functions.Extensions - -Classes.Item = {} -Classes.Item.__index = Classes.Item - -local Item = Classes.Item - --- Constructor -function Item.New(characterId, bagId, slotId, setId, equipType, traitType, armorType, weaponType, link) - local instance = {} - setmetatable(instance, Item) - - instance:Initialize(characterId, bagId, slotId, setId, equipType, traitType, armorType, weaponType, link) - - if Extensions.Constants.IsEquipment(instance.equipType) then - return instance - else - return nil - end -end - --- Properties -Item.equipType = nil -Item.armorType = nil -Item.weaponType = nil -Item.traitType = nil -Item.setId = nil -Item.bagId = nil -Item.slotId = nil -Item.characterId = nil -Item.link = nil - --- Functions -function Item:Equals(setId, equipType, traitType, armorType, weaponType) - if - setId == self.setId and - equipType == self.equipType and - (traitType == nil or traitType == 0 or traitType == self.traitType) and - (armorType == nil or armorType == 0 or armorType == self.armorType) and - (weaponType == nil or weaponType == 0 or weaponType == self.weaponType) - then - return true - end - - return false -end - -function Item:GetLink() - return self.link -end - -function Item:GetId() - if self.characterId == nil then - return "account_".. tostring(self.bagId) .. "_".. tostring(self.slotId) - else - return tostring(self.characterId) .. "_" .. tostring(self.bagId) .. "_".. tostring(self.slotId) - end -end - -function Item:Initialize(characterId, bagId, slotId, setId, equipType, traitType, armorType, weaponType, link) - self.bagId = bagId - self.slotId = slotId - self.characterId = characterId - - if link == nil then - self.link = Dependencies.Officials.GetItemLink(self.bagId, self.slotId) - else - self.link = link - end - - if setId == nil then - _, _, self.setId, _, _, _ = Dependencies.LibSets.IsSetByItemLink(self.link) - else - self.setId = setId - end - - if equipType == nil then - _, _, _, _, _, self.equipType, _, _ = Dependencies.Officials.GetItemInfo(self.bagId, self.slotId) - else - self.equipType = equipType - end - - -- Skip further read if not equipment - if not Extensions.Constants.IsEquipment(self.equipType) then - return - end - - if traitType == nil then - self.traitType = Dependencies.Officials.GetItemTrait(self.bagId, self.slotId) - else - self.traitType = traitType - end - - if Extensions.Constants.IsWeaponOrShield(self.equipType) then - if weaponType == nil then - self.weaponType = Dependencies.Officials.GetItemWeaponType(self.bagId, self.slotId) - else - self.weaponType = weaponType - end - else - if Extensions.Constants.IsArmor(self.equipType) then - if armorType == nil then - self.armorType = Dependencies.Officials.GetItemArmorType(self.bagId, self.slotId) - else - self.armorType = armorType - end - end - end -end - --- For saving purpose -function Item:CopyForSave() - return { - setId = self.setId, - equipType = self.equipType, - traitType = self.traitType, - armorType = self.armorType, - weaponType = self.weaponType, - link = self.link - } -end \ No newline at end of file diff --git a/Internals/Classes/Piece.lua b/Internals/Classes/Piece.lua deleted file mode 100644 index ab2a040..0000000 --- a/Internals/Classes/Piece.lua +++ /dev/null @@ -1,96 +0,0 @@ -local Classes = MyCollection.Internals.Classes -local Constants = MyCollection.Internals.Constants -local Dependencies = MyCollection.Internals.Dependencies -local Logger = MyCollection.Internals.Dependencies.Logger -local Data = MyCollection.Internals.Data - -Classes.Piece = {} -Classes.Piece.__index = Classes.Piece - -local Piece = Classes.Piece - --- Constructor -function Piece.New(setId, equipType, traitType, armorType, weaponType) - local instance = {} - setmetatable(instance, Piece) - - instance:Initialize(setId, equipType, traitType, armorType, weaponType) - return instance -end - -Piece.references = {} - --- Properties -Piece.setId = nil -Piece.equipType = nil -Piece.traitType = nil -Piece.armorType = nil -Piece.weaponType = nil - --- Functions -function Piece:SetTrait(traitType) - self.traitType = traitType - self:Refresh() -end - -function Piece:GetReferences() - return self.references -end - -function Piece:HasItem() - if next(self.references) ~= nil then - return true - end - - return false -end - -function Piece:AddReference(item) - self.references[item:GetId()] = item - - if Logger ~= nil and item ~= nil then - local _, setName, _, _, _, _ = Dependencies.LibSets.IsSetByItemLink(item.link) - Logger:Debug("Found setId: '".. tostring(self.setId) .."', traitType: '".. tostring(self.traitType) .."', equipType: '".. tostring(self.equipType) .."', armorType: '".. tostring(self.armorType) .."', weaponType: '".. tostring(self.weaponType) .."', hasItem:'".. tostring(self:HasItem()) .. "'.") - Logger:Debug("Added bagId:'".. item.bagId .. "', slotId: '".. item.slotId .. "' setName: '".. setName .."' Link: ".. item.link) - end -end - -function Piece:RemoveReference(item) - self.references[item:GetId()] = nil -end - -function Piece:Refresh() - self.references = {} - local items = Data.Inventory:FindAll(self.setId, self.equipType, self.traitType, self.armorType, self.weaponType) - if next(items) ~= nil then - for _, item in ipairs(items) do - self:AddReference(item) - end - end -end - -function Piece:Initialize(setId, equipType, traitType, armorType, weaponType) - self.setId = setId - self.equipType = equipType - if (traitType == nil) then - traitType = Constants.TraitTypes.None - end - self.traitType = traitType - self.armorType = armorType - self.weaponType = weaponType - - self.references = {} - - self:Refresh() -end - --- For saving purpose -function Piece:CopyForSave() - return { - setId = self.setId, - equipType = self.equipType, - traitType = self.traitType, - armorType = self.armorType, - weaponType = self.weaponType, - } -end \ No newline at end of file diff --git a/Internals/Classes/Set.lua b/Internals/Classes/Set.lua deleted file mode 100644 index 4b6167b..0000000 --- a/Internals/Classes/Set.lua +++ /dev/null @@ -1,171 +0,0 @@ -local Classes = MyCollection.Internals.Classes -local Constants = MyCollection.Internals.Constants -local Dependencies = MyCollection.Internals.Dependencies -local Extensions = MyCollection.Internals.Functions.Extensions - -Classes.Set = {} -Classes.Set.__index = Classes.Set - -local Set = Classes.Set - --- Constructor -function Set.New(savedTable, setId, setName, armorType, orderNumber) - local instance = {} - setmetatable(instance, Set) - - instance:Initialize(savedTable, setId, setName, armorType, orderNumber) - return instance -end - --- Fields -Set.savedTableReference = nil - --- Properties -Set.setId = nil -Set.setName = nil -Set.armorType = nil -Set.orderNumber = nil -Set.pieces = nil - --- Functions -function Set:GetArmorPiece(equipType) - return self.pieces.armors[equipType] -end -function Set:GetJewelleryPiece(equipType) - return self.pieces.jewelleries[equipType] -end -function Set:GetWeaponPiece(weaponType) - return self.pieces.weapons[weaponType] -end - -function Set:Completition() - local count = 0 - for category, group in pairs(self.pieces) do - for subCategory, piece in pairs(group) do - if piece:HasItem() then - count = count + 1 - end - end - end - - return count -end - -function Set:SetOrderNumber(number) - if number > 0 and number < 10001 then - self.orderNumber = number - self.savedTableReference.orderNumber = number - end - if number == 0 then - self.orderNumber = nil - self.savedTableReference.orderNumber = nil - end -end - -function Set:GetOrderNumber() - return self.orderNumber -end - -function Set:GetSetName() - return self.setName -end - -function Set:GetSetId() - return self.setId -end - -function Set:GetArmorType() - return self.armorType -end - -function Set:AddItem(item) - if Extensions.Constants.IsWeaponOrShield(item.equipType) then - self.pieces.weapons[item.weaponType]:AddReference(item) - end - - if Extensions.Constants.IsJewellery(item.equipType) then - self.pieces.jewelleries[item.equipType]:AddReference(item) - end - - if Extensions.Constants.IsArmor(item.equipType) and item.armoryType == self.armorType then - self.pieces[item.equipType]:AddReference(item) - end -end - -function Set:RemoveItem(item) - if Extensions.Constants.IsWeaponOrShield(item.equipType) then - self.pieces.weapons[item.weaponType]:RemoveReference(item) - end - - if Extensions.Constants.IsJewellery(item.equipType) then - self.pieces.jewelleries[item.equipType]:RemoveReference(item) - end - - if Extensions.Constants.IsArmor(item.equipType) and item.armoryType == self.armorType then - self.pieces[item.equipType]:RemoveReference(item) - end -end - -function Set:Initialize(savedTable, setId, setName, armorType, orderNumber) - self.pieces = { - armors = {}, - jewelleries = {}, - weapons = {}, - } - - self.savedTableReference = savedTable - - self.setId = setId - - if setName == nil then - setName = Dependencies.LibSets.GetSetName(setId) - end - - self.setName = setName - self.armorType = armorType - self.orderNumber = orderNumber - - if savedTable ~= nil and next(savedTable) ~= nil then - if (next(savedTable.armors) ~= nil) then - for equipType, item in pairs(savedTable.armors) do - self.pieces.armors[equipType] = Classes.Piece.New(item.setId, item.equipType, item.traitType, item.armorType, item.weaponType) - end - end - - if (next(savedTable.jewelleries) ~= nil) then - for equipType, item in pairs(savedTable.jewelleries) do - self.pieces.jewelleries[equipType] = Classes.Piece.New(item.setId, item.equipType, item.traitType, item.armorType, item.weaponType) - end - end - - if (next(savedTable.weapons) ~= nil) then - for equipType, item in pairs(savedTable.weapons) do - self.pieces.weapons[equipType] = Classes.Piece.New(item.setId, item.equipType, item.traitType, item.armorType, item.weaponType) - end - end - else - savedTable.setId = setId - savedTable.setName = setName - savedTable.armorType = armorType - savedTable.orderNumber = orderNumber - - savedTable.armors = {} - savedTable.jewelleries = {} - savedTable.weapons = {} - - for _, equipType in pairs(Constants.EquipTypes.Armors) do - self.pieces.armors[equipType] = Classes.Piece.New(self.setId, equipType, nil, self.armorType, nil) - savedTable.armors[equipType] = self.pieces.armors[equipType]:CopyForSave() - end - - for _, equipType in pairs(Constants.EquipTypes.Jewelleries) do - self.pieces.jewelleries[equipType] = Classes.Piece.New(self.setId, equipType, nil, nil, nil) - savedTable.jewelleries[equipType] = self.pieces.jewelleries[equipType]:CopyForSave() - end - - for _, weaponType in pairs(Constants.WeaponTypes) do - self.pieces.weapons[weaponType] = Classes.Piece.New(self.setId, equipType, nil, nil, weaponType) - savedTable.weapons[weaponType] = self.pieces.weapons[weaponType]:CopyForSave() - end - end -end \ No newline at end of file diff --git a/Internals/Constants.lua b/Internals/Constants.lua deleted file mode 100644 index e21af04..0000000 --- a/Internals/Constants.lua +++ /dev/null @@ -1,115 +0,0 @@ -local Internals = MyCollection.Internals -Internals.Constants = {} -local Constants = MyCollection.Internals.Constants - ---https://wiki.esoui.com/Constant_Values -Constants.EquipTypes = { - Armors = { - Head = 1, - Chest = 3, - Shoulders = 4, - Waist = 8, - Legs = 9, - Feet = 10, - Hand = 13, - }, - Jewelleries = { - Neck = 2, - Ring = 12, - }, - Weapons = { - OneHand = 5, - OffHand = 7, - TwoHand = 6, - MainHand = 14, - }, -} - -Constants.WeaponTypes = { - Axe = 1, - Hammer = 2, - Sword = 3, - TwoHandedSword = 4, - TwoHandedAxe = 5, - TwoHandedHammer = 6, - Bow = 8, - HealingStaff = 9, - Dagger = 11, - FireStaff = 12, - FrostStaff = 13, - LightningStaff = 15, - Shield = 14, -} - -Constants.ArmorTypes = { - None = 0, - Light = 1, - Medium = 2, - Heavy = 3, -} - -Constants.TraitTypes = { - None = 0, - Armor = { - Sturdy = 11, - Impenetrable = 12, - Reinforced = 13, - WellFitted = 14, - Training = 15, - Infused = 16, - Invigorating = 17, - --Prosperous = 17, - --Exploration = 17, - --Ornate = 19, - Divines = 18, - --Intricate = 20, - Nirnhorned = 25, - }, - Jewelleries = { - Healthy = 21, - Arcane = 22, - Robust = 23, - --Ornate = 24, - --Intricate = 27, - Swift = 28, - Harmony = 29, - Triune = 30, - Bloodthirsty = 31, - Protective = 32, - Infused = 33, - }, - Weapons = { - Powered = 1, - Charged = 2, - Precise = 3, - Infused = 4, - Defending = 5, - Training = 6, - Sharpened = 7, - Decisive = 8, - --Weighted = 8, - --Intricate = 9, - --Ornate = 10, - Nirnforned = 26, - }, -} - -Constants.BagTypes = { - Worn = 0, - Backpack = 1, - Bank = 2, - GuildBank = 3, - BuyBack = 4, - CraftBag = 5, - SubscriberBank = 6, - HouseOne = 7, - HouseTwo = 8, - HouseThree = 9, - HouseFour = 10, - HouseFive = 11, - HouseSix = 12, - HouseSeven = 13, - HouseEight = 14, - HouseNine = 15, - HouseTen = 16, -} \ No newline at end of file diff --git a/Internals/Defaults.lua b/Internals/Defaults.lua deleted file mode 100644 index 2f90bda..0000000 --- a/Internals/Defaults.lua +++ /dev/null @@ -1,26 +0,0 @@ -local Internals = MyCollection.Internals -Internals.Saved.Defaults = {} -local Defaults = Internals.Saved.Defaults -local Classes = Internals.Classes -local Constants = Internals.Constants - -Defaults.Collection = { - sets = {}, -} -Defaults.Inventory = { - banks = { - [Constants.BagTypes.Bank] = {}, - [Constants.BagTypes.SubscriberBank] = {}, - }, - bags = {}, -} -Defaults.Settings = { - Logging = false, - Window = { - Position = { - Left = 200, - Top = 200, - }, - Scale = 1, - } -} \ No newline at end of file diff --git a/Internals/Dependencies.lua b/Internals/Dependencies.lua deleted file mode 100644 index d02b528..0000000 --- a/Internals/Dependencies.lua +++ /dev/null @@ -1,33 +0,0 @@ -local Dependencies = MyCollection.Internals.Dependencies - -Dependencies.LibSavedVars = LibSavedVars -- https://www.esoui.com/downloads/info2161-LibSavedVars.html ---Dependencies.LibAddonMenu = LibAddonMenu2 -- https://www.esoui.com/downloads/info7-LibAddonMenu.html -- KEY: LibAddonMenu-2.0 -Dependencies.LibMainMenu = LibMainMenu2 -- https://cdn.esoui.com/downloads/info2118-LibMainMenu-2.0.html ---Dependencies.LibDialog = LibDialog -- https://www.esoui.com/downloads/info1931-LibDialog-Customconfirmationdialogwith2buttons.html -Dependencies.LibSets = LibSets -- https://www.esoui.com/downloads/info2241-LibSets.html -if LibDebugLogger ~= nil then - Dependencies.Logger = LibDebugLogger("MyCollection") -- https://www.esoui.com/downloads/info2275-LibDebugLogger.html -else - Dependencies.Logger = nil -end - --- Zenimax API's -Dependencies.Officials = {} -Dependencies.Officials.EventManager = EVENT_MANAGER -Dependencies.Officials.SceneManager = SCENE_MANAGER -Dependencies.Officials.SlashCommands = SLASH_COMMANDS -Dependencies.Officials.SharedInventory = SHARED_INVENTORY -- http://esodata.uesp.net/100031/src/ingame/inventory/sharedinventory.lua.html -Dependencies.Officials.GetItemArmorType = GetItemArmorType -- https://wiki.esoui.com/GetItemArmorType -Dependencies.Officials.GetItemInfo = GetItemInfo -- https://wiki.esoui.com/GetItemInfo -Dependencies.Officials.GetItemLink = GetItemLink -- https://wiki.esoui.com/GetItemLink -Dependencies.Officials.GetItemLinkIcon = GetItemLinkIcon -Dependencies.Officials.GetItemTrait = GetItemTrait -- https://wiki.esoui.com/GetItemTrait -Dependencies.Officials.GetItemWeaponType = GetItemWeaponType -- https://wiki.esoui.com/GetItemWeaponType -Dependencies.Officials.GetCurrentCharacterId = GetCurrentCharacterId -- https://wiki.esoui.com/GetCurrentCharacterId - ----- Possible Libs for future consideration --- https://www.esoui.com/downloads/info808-LibItemInfo.html --- https://www.esoui.com/downloads/info2423-111693.html --- https://www.esoui.com/downloads/info989-LibMainMenu.html --- https://www.esoui.com/downloads/info2125-LibAsync.html --- https://www.esoui.com/downloads/info1146-LibCustomMenu.html \ No newline at end of file diff --git a/Internals/Functions/Callbacks.lua b/Internals/Functions/Callbacks.lua deleted file mode 100644 index d15cbc8..0000000 --- a/Internals/Functions/Callbacks.lua +++ /dev/null @@ -1,34 +0,0 @@ -local Functions = MyCollection.Internals.Functions -local Classes = MyCollection.Internals.Classes -local Data = MyCollection.Internals.Data -local Logger = MyCollection.Internals.Dependencies.Logger -local Dependencies = MyCollection.Internals.Dependencies - -Functions.Callbacks = {} -local Callbacks = Functions.Callbacks - -function Callbacks.Added(bagId, slotId, item) - local characterId = Dependencies.Officials.GetCurrentCharacterId() - local item = Classes.Item.New(characterId, bagId, slotId) - if (item ~= nil and item.setId ~= nil and item.setId ~= 0) then - Data.Inventory:AddItem(item) - Data.Collection:AddItem(item) - end -end - -function Callbacks.Removed(bagId, slotId, item) - local item = Data.Inventory:RemoveItem(bagId, slotId) - if (item ~= nil) then - Data.Collection:RemoveItem(item) - end -end - -function Callbacks.Updated(bagId, slotId, item) - local characterId = Dependencies.Officials.GetCurrentCharacterId() - local item = Classes.Item.New(characterId, bagId, slotId) - if (item ~= nil and item.setId ~= nil and item.setId ~= 0) then - Data.Inventory:AddItem(item) - Data.Collection:AddItem(item) - end -end - diff --git a/Internals/Functions/Extensions/Constants.lua b/Internals/Functions/Extensions/Constants.lua deleted file mode 100644 index 17f2727..0000000 --- a/Internals/Functions/Extensions/Constants.lua +++ /dev/null @@ -1,84 +0,0 @@ -local Extensions = MyCollection.Internals.Functions.Extensions -local Constants = MyCollection.Internals.Constants - -Extensions.Constants = {} - -Extensions.Constants.IsEquipment = function (equipType) - return - Extensions.Constants.IsArmor(equipType) or - Extensions.Constants.IsJewellery(equipType) or - Extensions.Constants.IsWeaponOrShield(equipType) -end - -Extensions.Constants.IsArmor = function (equipType) - for key, id in pairs(Constants.EquipTypes.Armors) do - if (id == equipType) then - return true - end - end - return false -end - -Extensions.Constants.IsWeaponOrShield = function (equipType) - for key, id in pairs(Constants.EquipTypes.Weapons) do - if (id == equipType) then - return true - end - end - return false -end - -Extensions.Constants.IsJewellery = function (equipType) - for key, id in pairs(Constants.EquipTypes.Jewelleries) do - if (id == equipType) then - return true - end - end - return false -end - -Extensions.Constants.IsCharacterBag = function (bagId) - if - bagId == Constants.BagTypes.Worn - or bagId == Constants.BagTypes.Backpack - --or bagId == Constants.BagTypes.BuyBack - then - return true - end - return false -end - -Extensions.Constants.IsBank = function (bagId) - if - bagId == Constants.BagTypes.Bank or - bagId == Constants.BagTypes.SubscriberBank - then - return true - end - return false -end - -Extensions.Constants.GetTraitName = function (traitId) - if traitId == 0 or traitId == nil then - return GetString(MYCOLLECTION_TRAIT_NONE) - else - for key, trait in pairs(Constants.TraitTypes.Armor) do - if (traitId == trait) then - local traitTextId = _G["MYCOLLECTION_TRAIT_ARMOR_" .. key:upper()] - return GetString(traitTextId) - end - end - for key, trait in pairs(Constants.TraitTypes.Jewelleries) do - if (traitId == trait) then - local traitTextId = _G["MYCOLLECTION_TRAIT_JEWELLERY_" .. key:upper()] - return GetString(traitTextId) - end - end - for key, trait in pairs(Constants.TraitTypes.Weapons) do - if (traitId == trait) then - local traitTextId = _G["MYCOLLECTION_TRAIT_WEAPONS_" .. key:upper()] - return GetString(traitTextId) - end - end - end -end \ No newline at end of file diff --git a/Internals/Functions/Namespaces.lua b/Internals/Functions/Namespaces.lua deleted file mode 100644 index 4cf79f1..0000000 --- a/Internals/Functions/Namespaces.lua +++ /dev/null @@ -1,3 +0,0 @@ -local Functions = MyCollection.Internals.Functions - -Functions.Extensions = {} \ No newline at end of file diff --git a/Internals/Namespaces.lua b/Internals/Namespaces.lua deleted file mode 100644 index ea35e5a..0000000 --- a/Internals/Namespaces.lua +++ /dev/null @@ -1,9 +0,0 @@ -MyCollection.Internals.Data = {} -MyCollection.Internals.Saved = { - Settings = {}, - Inventory = {}, - Collection = {}, -} -MyCollection.Internals.Functions = {} -MyCollection.Internals.Classes = {} -MyCollection.Internals.Dependencies = {} \ No newline at end of file diff --git a/Languages/Default.lua b/Languages/Default.lua deleted file mode 100644 index 13f402b..0000000 --- a/Languages/Default.lua +++ /dev/null @@ -1,51 +0,0 @@ -ZO_CreateStringId("SI_BINDING_NAME_MYCOLLECTION_MENU_TOGGLE" , "My Collection") -ZO_CreateStringId("MYCOLLECTION_TITLE" , "|c77ee02My Collection|r") -ZO_CreateStringId("MYCOLLECTION_NAME" , "My Collection") -ZO_CreateStringId("MYCOLLECTION_SEARCH_LABEL" , "Search:") -ZO_CreateStringId("MYCOLLECTION_HEADERS_ORDER" , "No.") -ZO_CreateStringId("MYCOLLECTION_HEADERS_SET" , "Set") -ZO_CreateStringId("MYCOLLECTION_HEADERS_ITEMS" , "Completition") -ZO_CreateStringId("MYCOLLECTION_CONTEXT_REMOVE" , "Remove set") -ZO_CreateStringId("MYCOLLECTION_CONTEXT_CHANGEORDER" , "Set Order No.") -ZO_CreateStringId("MYCOLLECTION_MENU_ADD" , "Add set") -ZO_CreateStringId("MYCOLLECTION_MENU_GRID" , "List") - -ZO_CreateStringId("MYCOLLECTION_ADDMENU_SELECTOR_LABEL" , "Select set:") -ZO_CreateStringId("MYCOLLECTION_ADDMENU_ARMORTYPE_LABEL" , "Armor Type:") -ZO_CreateStringId("MYCOLLECTION_ADDMENU_ARMORTYPE_LIGHT" , "Light") -ZO_CreateStringId("MYCOLLECTION_ADDMENU_ARMORTYPE_MEDIUM" , "Medium") -ZO_CreateStringId("MYCOLLECTION_ADDMENU_ARMORTYPE_HEAVY" , "Heavy") -ZO_CreateStringId("MYCOLLECTION_ADDMENU_ADD" , "Add") -ZO_CreateStringId("MYCOLLECTION_ADDMENU_ORDERNUMBER_LABEL" , "Order Number:") - -ZO_CreateStringId("MYCOLLECTION_TRAIT_NONE" , "None") - -ZO_CreateStringId("MYCOLLECTION_TRAIT_ARMOR_STURDY" , "Sturdy") -ZO_CreateStringId("MYCOLLECTION_TRAIT_ARMOR_IMPENETRABLE" , "Impenetrable") -ZO_CreateStringId("MYCOLLECTION_TRAIT_ARMOR_REINFORCED" , "Reinforced") -ZO_CreateStringId("MYCOLLECTION_TRAIT_ARMOR_WELLFITTED" , "Well-Fitted") -ZO_CreateStringId("MYCOLLECTION_TRAIT_ARMOR_TRAINING" , "Training") -ZO_CreateStringId("MYCOLLECTION_TRAIT_ARMOR_INFUSED" , "Infused") -ZO_CreateStringId("MYCOLLECTION_TRAIT_ARMOR_INVIGORATING" , "Invigorating") -ZO_CreateStringId("MYCOLLECTION_TRAIT_ARMOR_DIVINES" , "Divines") -ZO_CreateStringId("MYCOLLECTION_TRAIT_ARMOR_NIRNHORNED" , "Nirnhorned") - -ZO_CreateStringId("MYCOLLECTION_TRAIT_JEWELLERY_HEALTHY" , "Healthy") -ZO_CreateStringId("MYCOLLECTION_TRAIT_JEWELLERY_ARCANE" , "Arcane") -ZO_CreateStringId("MYCOLLECTION_TRAIT_JEWELLERY_ROBUST" , "Robust") -ZO_CreateStringId("MYCOLLECTION_TRAIT_JEWELLERY_SWIFT" , "Swift") -ZO_CreateStringId("MYCOLLECTION_TRAIT_JEWELLERY_HARMONY" , "Harmony") -ZO_CreateStringId("MYCOLLECTION_TRAIT_JEWELLERY_TRIUNE" , "Triune") -ZO_CreateStringId("MYCOLLECTION_TRAIT_JEWELLERY_BLOODTHIRSTY" , "Bloodthirsty") -ZO_CreateStringId("MYCOLLECTION_TRAIT_JEWELLERY_PROTECTIVE" , "Protective") -ZO_CreateStringId("MYCOLLECTION_TRAIT_JEWELLERY_INFUSED" , "Infused") - -ZO_CreateStringId("MYCOLLECTION_TRAIT_WEAPON_POWERED" , "Powered") -ZO_CreateStringId("MYCOLLECTION_TRAIT_WEAPON_CHARGED" , "Charged") -ZO_CreateStringId("MYCOLLECTION_TRAIT_WEAPON_PRECISE" , "Precise") -ZO_CreateStringId("MYCOLLECTION_TRAIT_WEAPON_INFUSED" , "Infused") -ZO_CreateStringId("MYCOLLECTION_TRAIT_WEAPON_DEFENDING" , "Defending") -ZO_CreateStringId("MYCOLLECTION_TRAIT_WEAPON_TRAINING" , "Training") -ZO_CreateStringId("MYCOLLECTION_TRAIT_WEAPON_SHARPENED" , "Sharpened") -ZO_CreateStringId("MYCOLLECTION_TRAIT_WEAPON_DECISIVE" , "Decisive") -ZO_CreateStringId("MYCOLLECTION_TRAIT_WEAPON_NIRNFORNED" , "Nirnforned") \ No newline at end of file diff --git a/Main.lua b/Main.lua deleted file mode 100644 index 416595a..0000000 --- a/Main.lua +++ /dev/null @@ -1,75 +0,0 @@ -local Classes = MyCollection.Internals.Classes -local Constants = MyCollection.Internals.Constants -local Functions = MyCollection.Internals.Functions -local Data = MyCollection.Internals.Data -local Saved = MyCollection.Internals.Saved -local Defaults = MyCollection.Internals.Saved.Defaults -local Dependencies = MyCollection.Internals.Dependencies -local EventManager = MyCollection.Internals.Dependencies.Officials.EventManager -local SharedInventory = MyCollection.Internals.Dependencies.Officials.SharedInventory -local Logger = MyCollection.Internals.Dependencies.Logger -local UI = MyCollection.UI - --- Functions -function MyCollection.ResetInventory(event) - Data.Inventory:Refresh() -end - --- Initialite -function MyCollection:Initialize() - -- Saved variable load - Saved.Inventory = Dependencies.LibSavedVars:NewAccountWide(MyCollection.Internals.SavedVariables.Inventory.Name, nil, Defaults.Inventory ):Version(MyCollection.Internals.SavedVariables.Inventory.Version, function(table) end) - Saved.Collection = Dependencies.LibSavedVars:NewAccountWide(MyCollection.Internals.SavedVariables.Collection.Name, nil, Defaults.Collection ):Version(MyCollection.Internals.SavedVariables.Collection.Version, function(table) end) - Saved.Settings = Dependencies.LibSavedVars:NewAccountWide(MyCollection.Internals.SavedVariables.Settings.Name, nil, Defaults.Settings ):Version(MyCollection.Internals.SavedVariables.Settings.Version, function(table) end) - - Saved.Settings.Logging = false - Logger:SetEnabled(Saved.Settings.Logging) - - Data.Inventory = Classes.Inventory.New(Saved.Inventory) - Data.Collection = Classes.Collection.New(Saved.Collection) - - -- Register Callbacks - --SharedInventory:RegisterCallback("SingleSlotInventoryUpdate", MyCollection.Internals.Functions.Callbacks.WUT) - SharedInventory:RegisterCallback("SlotRemoved", Functions.Callbacks.Removed) - SharedInventory:RegisterCallback("SlotAdded", Functions.Callbacks.Added) - SharedInventory:RegisterCallback("SlotUpdated", Functions.Callbacks.Updated) - - -- Refresh the current caracters and banks data - Data.Inventory:Refresh() - - -- Initialize UI - UI.Frame.Initialize() -end - -function MyCollection.OnAddOnLoaded(event, addonName) - if MyCollection.Name ~= addonName then return end - - while not LibSets.AreSetsLoaded() do end - - EventManager:UnregisterForEvent(MyCollection.Name, EVENT_ADD_ON_LOADED) - MyCollection:Initialize() -end - -EventManager:RegisterForEvent(MyCollection.Name, EVENT_ADD_ON_LOADED, MyCollection.OnAddOnLoaded) - ----- Possible usefull events --- Logout ---EVENT_PLAYER_DEACTIVATED - --- Change inventory item ---EVENT_INVENTORY_SINGLE_SLOT_UPDATE ----- EVENT_INVENTORY_SINGLE_SLOT_UPDATE, REGISTER_FILTER_INVENTORY_UPDATE_REASON, INVENTORY_UPDATE_REASON_DEFAULT - --- Open Bank ---EVENT_OPEN_BANK - --- Open Guild Bank, add/remove item ---EVENT_GUILD_BANK_ITEMS_READY ---EVENT_GUILD_BANK_ITEM_ADDED ---EVENT_GUILD_BANK_ITEM_REMOVED ---EVENT_GUILD_SELF_JOINED_GUILD ---EVENT_GUILD_SELF_LEFT_GUILD - --- Entered House ---EVENT_PLAYER_ACTIVATED ---EVENT_HOUSING_EDITOR_MODE_CHANGEDw \ No newline at end of file diff --git a/MyCollection.txt b/MyCollection.txt deleted file mode 100644 index 58a213b..0000000 --- a/MyCollection.txt +++ /dev/null @@ -1,68 +0,0 @@ -## Title: |c77ee02My Collection|r || Version: 0.1.0 -## Author: |c87ddf2AlvinTheFox|r -## APIVersion: 100031 -## Version: 0.1.0 -## Description: Customizable set collection tracker. -## SavedVariables: MyCollection_Settings MyCollection_Collection MyCollection_Inventory -## DependsOn: LibSavedVars LibMainMenu-2.0 LibSets -## OptionalDependsOn: LibDebugLogger - -; This Add-on is not created by, affiliated with, or sponsored by, ZeniMax Media Inc. or its affiliates. -; The Elder Scrolls® and related logos are registered trademarks or trademarks of ZeniMax Media Inc. in the United States -; and/or other countries. All rights reserved. - -;;;; Languages ;;;; -Languages/Default.lua - -;;;; Code ;;;; -;; Namespaces ;; -Namespace.lua -Internals/Namespaces.lua -Internals/Functions/Namespaces.lua -UI/Namespaces.lua - -;; Globals ;; -Globals.lua - -;; Dependencies ;; -Internals/Dependencies.lua - -;; Constants ;; -Internals/Constants.lua - -;; Classes ;; -Internals/Classes/Item.lua -Internals/Classes/Bag.lua -Internals/Classes/Inventory.lua -Internals/Classes/Piece.lua -Internals/Classes/Set.lua -Internals/Classes/Collection.lua - -;; Functions ;; -Internals/Functions/Callbacks.lua -Internals/Functions/Extensions/Constants.lua -Internals/Functions/UI.lua - -;; Defaults ;; -Internals/Defaults.lua - -;; Settings Menu ;; -Settings.lua - -;;;; UI ;;;; -;; UI Controls ;; -UI/Controls/MenuBar.lua -UI/Controls/Grid.lua -UI/Controls/AddSet.lua - -;; UI Elements -UI/Frame.xml - -;; UI Main ;; -UI/Frame.lua - -;;;; Bindings ;;;; -Bindings.xml - -;;;; Main ;;;; -Main.lua diff --git a/MyCollection/Bindings.xml b/MyCollection/Bindings.xml new file mode 100644 index 0000000..05c2f77 --- /dev/null +++ b/MyCollection/Bindings.xml @@ -0,0 +1,9 @@ +<Bindings> + <Layer name="SI_KEYBINDINGS_LAYER_GENERAL"> + <Category name="MYCOLLECTION_TITLE"> + <Action name="MYCOLLECTION_MENU_TOGGLE"> + <Down>SLASH_COMMANDS["/mycollection"]()</Down> + </Action> + </Category> + </Layer> +</Bindings> diff --git a/MyCollection/Constants.lua b/MyCollection/Constants.lua new file mode 100644 index 0000000..e21af04 --- /dev/null +++ b/MyCollection/Constants.lua @@ -0,0 +1,115 @@ +local Internals = MyCollection.Internals +Internals.Constants = {} +local Constants = MyCollection.Internals.Constants + +--https://wiki.esoui.com/Constant_Values +Constants.EquipTypes = { + Armors = { + Head = 1, + Chest = 3, + Shoulders = 4, + Waist = 8, + Legs = 9, + Feet = 10, + Hand = 13, + }, + Jewelleries = { + Neck = 2, + Ring = 12, + }, + Weapons = { + OneHand = 5, + OffHand = 7, + TwoHand = 6, + MainHand = 14, + }, +} + +Constants.WeaponTypes = { + Axe = 1, + Hammer = 2, + Sword = 3, + TwoHandedSword = 4, + TwoHandedAxe = 5, + TwoHandedHammer = 6, + Bow = 8, + HealingStaff = 9, + Dagger = 11, + FireStaff = 12, + FrostStaff = 13, + LightningStaff = 15, + Shield = 14, +} + +Constants.ArmorTypes = { + None = 0, + Light = 1, + Medium = 2, + Heavy = 3, +} + +Constants.TraitTypes = { + None = 0, + Armor = { + Sturdy = 11, + Impenetrable = 12, + Reinforced = 13, + WellFitted = 14, + Training = 15, + Infused = 16, + Invigorating = 17, + --Prosperous = 17, + --Exploration = 17, + --Ornate = 19, + Divines = 18, + --Intricate = 20, + Nirnhorned = 25, + }, + Jewelleries = { + Healthy = 21, + Arcane = 22, + Robust = 23, + --Ornate = 24, + --Intricate = 27, + Swift = 28, + Harmony = 29, + Triune = 30, + Bloodthirsty = 31, + Protective = 32, + Infused = 33, + }, + Weapons = { + Powered = 1, + Charged = 2, + Precise = 3, + Infused = 4, + Defending = 5, + Training = 6, + Sharpened = 7, + Decisive = 8, + --Weighted = 8, + --Intricate = 9, + --Ornate = 10, + Nirnforned = 26, + }, +} + +Constants.BagTypes = { + Worn = 0, + Backpack = 1, + Bank = 2, + GuildBank = 3, + BuyBack = 4, + CraftBag = 5, + SubscriberBank = 6, + HouseOne = 7, + HouseTwo = 8, + HouseThree = 9, + HouseFour = 10, + HouseFive = 11, + HouseSix = 12, + HouseSeven = 13, + HouseEight = 14, + HouseNine = 15, + HouseTen = 16, +} \ No newline at end of file diff --git a/MyCollection/Defaults.lua b/MyCollection/Defaults.lua new file mode 100644 index 0000000..2f90bda --- /dev/null +++ b/MyCollection/Defaults.lua @@ -0,0 +1,26 @@ +local Internals = MyCollection.Internals +Internals.Saved.Defaults = {} +local Defaults = Internals.Saved.Defaults +local Classes = Internals.Classes +local Constants = Internals.Constants + +Defaults.Collection = { + sets = {}, +} +Defaults.Inventory = { + banks = { + [Constants.BagTypes.Bank] = {}, + [Constants.BagTypes.SubscriberBank] = {}, + }, + bags = {}, +} +Defaults.Settings = { + Logging = false, + Window = { + Position = { + Left = 200, + Top = 200, + }, + Scale = 1, + } +} \ No newline at end of file diff --git a/MyCollection/Dependencies.lua b/MyCollection/Dependencies.lua new file mode 100644 index 0000000..d02b528 --- /dev/null +++ b/MyCollection/Dependencies.lua @@ -0,0 +1,33 @@ +local Dependencies = MyCollection.Internals.Dependencies + +Dependencies.LibSavedVars = LibSavedVars -- https://www.esoui.com/downloads/info2161-LibSavedVars.html +--Dependencies.LibAddonMenu = LibAddonMenu2 -- https://www.esoui.com/downloads/info7-LibAddonMenu.html -- KEY: LibAddonMenu-2.0 +Dependencies.LibMainMenu = LibMainMenu2 -- https://cdn.esoui.com/downloads/info2118-LibMainMenu-2.0.html +--Dependencies.LibDialog = LibDialog -- https://www.esoui.com/downloads/info1931-LibDialog-Customconfirmationdialogwith2buttons.html +Dependencies.LibSets = LibSets -- https://www.esoui.com/downloads/info2241-LibSets.html +if LibDebugLogger ~= nil then + Dependencies.Logger = LibDebugLogger("MyCollection") -- https://www.esoui.com/downloads/info2275-LibDebugLogger.html +else + Dependencies.Logger = nil +end + +-- Zenimax API's +Dependencies.Officials = {} +Dependencies.Officials.EventManager = EVENT_MANAGER +Dependencies.Officials.SceneManager = SCENE_MANAGER +Dependencies.Officials.SlashCommands = SLASH_COMMANDS +Dependencies.Officials.SharedInventory = SHARED_INVENTORY -- http://esodata.uesp.net/100031/src/ingame/inventory/sharedinventory.lua.html +Dependencies.Officials.GetItemArmorType = GetItemArmorType -- https://wiki.esoui.com/GetItemArmorType +Dependencies.Officials.GetItemInfo = GetItemInfo -- https://wiki.esoui.com/GetItemInfo +Dependencies.Officials.GetItemLink = GetItemLink -- https://wiki.esoui.com/GetItemLink +Dependencies.Officials.GetItemLinkIcon = GetItemLinkIcon +Dependencies.Officials.GetItemTrait = GetItemTrait -- https://wiki.esoui.com/GetItemTrait +Dependencies.Officials.GetItemWeaponType = GetItemWeaponType -- https://wiki.esoui.com/GetItemWeaponType +Dependencies.Officials.GetCurrentCharacterId = GetCurrentCharacterId -- https://wiki.esoui.com/GetCurrentCharacterId + +---- Possible Libs for future consideration +-- https://www.esoui.com/downloads/info808-LibItemInfo.html +-- https://www.esoui.com/downloads/info2423-111693.html +-- https://www.esoui.com/downloads/info989-LibMainMenu.html +-- https://www.esoui.com/downloads/info2125-LibAsync.html +-- https://www.esoui.com/downloads/info1146-LibCustomMenu.html \ No newline at end of file diff --git a/MyCollection/Globals.lua b/MyCollection/Globals.lua new file mode 100644 index 0000000..c36207b --- /dev/null +++ b/MyCollection/Globals.lua @@ -0,0 +1,19 @@ +local MyCollection = MyCollection + +MyCollection.Name = "MyCollection" +MyCollection.DisplayName = "My Collection" +MyCollection.Version = "0.1.0" +MyCollection.Internals.SavedVariables = { + Inventory = { + Name = "MyCollection_Inventory", + Version = 1, + }, + Collection = { + Name = "MyCollection_Collection", + Version = 1, + }, + Settings = { + Name = "MyCollection_Settings", + Version = 1, + } +} \ No newline at end of file diff --git a/MyCollection/Internals/Classes/Bag.lua b/MyCollection/Internals/Classes/Bag.lua new file mode 100644 index 0000000..1225b5b --- /dev/null +++ b/MyCollection/Internals/Classes/Bag.lua @@ -0,0 +1,111 @@ +local Classes = MyCollection.Internals.Classes +local Constants = MyCollection.Internals.Constants +local Logger = MyCollection.Internals.Dependencies.Logger +local Dependencies = MyCollection.Internals.Dependencies + +Classes.Bag = {} +Classes.Bag.__index = Classes.Bag + +local Bag = Classes.Bag + +-- Constructor +function Bag.New(savedTable, characterId) + local instance = {} + setmetatable(instance, Bag) + + instance:Initialize(savedTable, characterId) + return instance +end + +Bag.savedTableReference = nil + +-- Properties +Bag.worn = nil +Bag.backpack = nil + +-- Functions +function Bag:FindAll(setId, equipType, traitType, armorType, weaponType) + local items = {} + if next(self.worn) ~= nil then + for _, item in pairs(self.worn) do + if item:Equals(setId, equipType, traitType, armorType, weaponType) then + table.insert(items, item) + end + end + end + if next(self.backpack) ~= nil then + for _, item in pairs(self.backpack) do + if item:Equals(setId, equipType, traitType, armorType, weaponType) then + table.insert(items, item) + end + end + end + + return items +end + +function Bag:AddItem(item) + local saveCopy = item:CopyForSave() + + if item.bagId == Constants.BagTypes.Worn then + self.worn[item.slotId] = item + self.savedTableReference[Constants.BagTypes.Worn][item.slotId] = saveCopy + end + if item.bagId == Constants.BagTypes.Backpack then + self.backpack[item.slotId] = item + self.savedTableReference[Constants.BagTypes.Backpack][item.slotId] = saveCopy + end +end + +function Bag:RemoveItem(bagId, slotId) + if bagId == Constants.BagTypes.Worn then + local item = self.worn[slotId] + table.remove(self.worn, slotId) + table.remove(self.savedTableReference[Constants.BagTypes.Worn], slotId) + end + if bagId == Constants.BagTypes.Backpack then + local item = self.backpack[slotId] + table.remove(self.backpack, slotId) + table.remove(self.savedTableReference[Constants.BagTypes.Backpack], slotId) + end + + return item +end + +function Bag:Clear() + self.worn = {} + self.backpack = {} + self.savedTableReference[Constants.BagTypes.Worn] = {} + self.savedTableReference[Constants.BagTypes.Backpack] = {} +end + +function Bag:Refresh() + self:Clear() + Dependencies.Officials.SharedInventory:RefreshInventory(Constants.BagTypes.Worn) + Dependencies.Officials.SharedInventory:RefreshInventory(Constants.BagTypes.Backpack) +end + +function Bag:Initialize(savedTable, characterId) + self.worn = {} + self.backpack = {} + + self.savedTableReference = savedTable + if savedTable == nil then + savedTable = {} + end + + if (savedTable[Constants.BagTypes.Worn] == nil) then savedTable[Constants.BagTypes.Worn] = {} end + if (savedTable[Constants.BagTypes.Backpack] == nil) then savedTable[Constants.BagTypes.Backpack] = {} end + + if (next(savedTable[Constants.BagTypes.Worn]) ~= nil) then + for slotId, item in pairs(savedTable[Constants.BagTypes.Worn]) do + self.worn[slotId] = Classes.Item.New(characterId, Constants.BagTypes.Worn, slotId, item.setId, item.equipType, item.traitType, item.armorType, item.weaponType, item.link) + end + end + + if (next(savedTable[Constants.BagTypes.Backpack]) ~= nil) then + for slotId, item in pairs(savedTable[Constants.BagTypes.Backpack]) do + self.backpack[slotId] = Classes.Item.New(characterId, Constants.BagTypes.Backpack, slotId, item.setId, item.equipType, item.traitType, item.armorType, item.weaponType, item.link) + end + end +end \ No newline at end of file diff --git a/MyCollection/Internals/Classes/Collection.lua b/MyCollection/Internals/Classes/Collection.lua new file mode 100644 index 0000000..b2603aa --- /dev/null +++ b/MyCollection/Internals/Classes/Collection.lua @@ -0,0 +1,83 @@ +local Classes = MyCollection.Internals.Classes +local Constants = MyCollection.Internals.Constants +local Logger = MyCollection.Internals.Dependencies.Logger +local Dependencies = MyCollection.Internals.Dependencies + +Classes.Collection = {} +Classes.Collection.__index = Classes.Collection + +local Collection = Classes.Collection + +-- Constructor +function Collection.New(savedTable) + local instance = {} + setmetatable(instance, Collection) + + instance:Initialize(savedTable) + return instance +end + +-- Fields +Collection.savedTableReference = nil + +-- Properties +Collection.sets = {} + +-- Functions +function Collection:GetSets() + return self.sets +end + +function Collection:AddItem(item) + if (next(self.sets) ~= nil) then + for key, set in pairs(self.sets) do + if set:GetSetId() == item.setId then + self.sets[key]:AddItem(item) + end + end + end +end + +function Collection:RemoveItem(item) + if (next(self.sets) ~= nil) then + for key, set in pairs(self.sets) do + if set:GetSetId() == item.setId then + self.sets[key]:RemoveItem(item) + end + end + end +end + +function Collection:AddSet(setId, armorType, orderNumber) + local newId = -1 + if (next(self.sets) ~= nil) then + for key, _ in pairs(self.sets) do + if key > newId then + newId = key + end + end + end + newId = newId + 1 + self.savedTableReference.sets[newId] = {} + self.sets[newId] = Classes.Set.New(self.savedTableReference.sets[newId], setId, nil, armorType, orderNumber) +end + +function Collection:RemoveSet(id) + table.remove(self.sets, id) + table.remove(self.savedTableReference.sets, id) +end + +function Collection:Clear() + self.sets = {} + self.savedTableReference.sets = {} +end + +function Collection:Initialize(savedTable) + self.savedTableReference = savedTable + + if (next(savedTable.sets) ~= nil) then + for id, set in pairs(savedTable.sets) do + self.sets[id] = Classes.Set.New(savedTable.sets[id], set.setId, set.setName, set.armorType, set.orderNumber) + end + end +end \ No newline at end of file diff --git a/MyCollection/Internals/Classes/Inventory.lua b/MyCollection/Internals/Classes/Inventory.lua new file mode 100644 index 0000000..225b963 --- /dev/null +++ b/MyCollection/Internals/Classes/Inventory.lua @@ -0,0 +1,159 @@ +local Classes = MyCollection.Internals.Classes +local Constants = MyCollection.Internals.Constants +local Extensions = MyCollection.Internals.Functions.Extensions +local Logger = MyCollection.Internals.Dependencies.Logger +local Dependencies = MyCollection.Internals.Dependencies +Classes.Inventory = {} +Classes.Inventory.__index = Classes.Inventory + +local Inventory = Classes.Inventory + +-- Constructor +function Inventory.New(savedTable) + local instance = {} + setmetatable(instance, Inventory) + + instance:Initialize(savedTable) + return instance +end + +Inventory.savedTableReference = nil + +-- Properties +Inventory.banks = { + [Constants.BagTypes.Bank] = {}, + [Constants.BagTypes.SubscriberBank] = {}, +} +Inventory.bags = {} + +-- Functions +function Inventory:FindAll(setId, equipType, traitType, armorType, weaponType) + local items = {} + for bankId, bank in pairs(self.banks) do + if next(bank) ~= nil then + for slotId, item in pairs(bank) do + if item:Equals(setId, equipType, traitType, armorType, weaponType) then + table.insert(items, self.banks[bankId][slotId]) + end + end + end + end + + for _, bag in pairs(self.bags) do + for _, item in ipairs(bag:FindAll(setId, equipType, traitType, armorType, weaponType)) do + table.insert(items, item) + end + end + + return items +end + +function Inventory:AddItem(item) + local characterId = Dependencies.Officials.GetCurrentCharacterId() + if Extensions.Constants.IsCharacterBag(item.bagId) then + self:GetOrCreateBag(characterId):AddItem(item) + else + if Extensions.Constants.IsBank(item.bagId) then + self:AddItemToBank(item) + end + end + + if Logger ~= nil and item ~= nil then + local _, setName, _, _, _, _ = Dependencies.LibSets.IsSetByItemLink(item.link) + Logger:Debug("Added bagId:'".. item.bagId .. "', slotId: '".. item.slotId .. "' setName: '".. setName .."' Link: ".. item.link) + end +end + +function Inventory:RemoveItem(bagId, slotId) + local item = nil + local characterId = Dependencies.Officials.GetCurrentCharacterId() + if Extensions.Constants.IsCharacterBag(bagId) then + item = self:GetOrCreateBag(characterId):RemoveItem(bagId, slotId) + else + if Extensions.Constants.IsBank(bagId) then + if (self.banks[bagId][slotId] ~= nil) then + item = self:RemoveItemFromBank(bagId, slotId) + end + end + end + + if Logger ~= nil and item ~= nil then + local _, setName, _, _, _, _ = Dependencies.LibSets.IsSetByItemLink(item.link) + Logger:Debug("Removed bagId:'".. bagId .. "', slotId: '".. slotId .. "' setName: '".. setName .."' Link: ".. item.link) + end + + return item +end + +function Inventory:AddBag(characterId) + self.savedTableReference.bags[characterId] = {} + self.bags[characterId] = Classes.Bag.New(self.savedTableReference.bags[characterId], characterId) +end + +function Inventory:GetOrCreateBag(characterId) + if self.bags[characterId] == nil then + self:AddBag(characterId) + end + return self.bags[characterId] +end + +function Inventory:AddItemToBank(item) + self.banks[item.bagId][item.slotId] = item + self.savedTableReference.banks[item.bagId][item.slotId] = item:CopyForSave() +end + +function Inventory:RemoveItemFromBank(bagId, slotId) + local item = self.banks[bagId][slotId] + table.remove(self.banks[bagId], slotId) + table.remove(self.savedTableReference.banks[bagId], slotId) + + return item +end + +function Inventory:Clear(keepOtherCharacters) + self.banks[Constants.BagTypes.Bank] = {} + self.banks[Constants.BagTypes.SubscriberBank] = {} + self.savedTableReference.banks[Constants.BagTypes.Bank] = {} + self.savedTableReference.banks[Constants.BagTypes.SubscriberBank] = {} + if keepOtherCharacters == nil or keepOtherCharacters then + local characterId = Dependencies.Officials.GetCurrentCharacterId() + if self.bags[characterId] ~= nil then + self:GetOrCreateBag(characterId):Clear() + end + else + for characterId, _ in pairs(self.bags) do + self:GetOrCreateBag(characterId):Clear() + end + end +end + +function Inventory:Refresh() + self:Clear(true) + Dependencies.Officials.SharedInventory:RefreshInventory(Constants.BagTypes.Bank) + Dependencies.Officials.SharedInventory:RefreshInventory(Constants.BagTypes.SubscriberBank) + + local characterId = Dependencies.Officials.GetCurrentCharacterId() + self:GetOrCreateBag(characterId):Refresh() +end + +function Inventory:Initialize(savedTable) + self.savedTableReference = savedTable + + if (next(savedTable.banks[Constants.BagTypes.Bank]) ~= nil) then + for slotId, item in pairs(savedTable.banks[Constants.BagTypes.Bank]) do + self.banks[Constants.BagTypes.Bank][slotId] = Classes.Item.New(characterId, Constants.BagTypes.Bank, slotId, item.setId, item.equipType, item.traitType, item.armorType, item.weaponType, item.link) + end + end + + if (next(savedTable.banks[Constants.BagTypes.SubscriberBank]) ~= nil) then + for slotId, item in pairs(savedTable.banks[Constants.BagTypes.SubscriberBank]) do + self.banks[Constants.BagTypes.SubscriberBank][slotId] = Classes.Item.New(characterId, Constants.BagTypes.SubscriberBank, slotId, item.setId, item.equipType, item.traitType, item.armorType, item.weaponType, item.link) + end + end + + if (next(savedTable.bags) ~= nil) then + for characterId, _ in pairs(savedTable.bags) do + self.bags[characterId] = Classes.Bag.New(savedTable.bags[characterId], characterId) + end + end +end \ No newline at end of file diff --git a/MyCollection/Internals/Classes/Item.lua b/MyCollection/Internals/Classes/Item.lua new file mode 100644 index 0000000..eb14758 --- /dev/null +++ b/MyCollection/Internals/Classes/Item.lua @@ -0,0 +1,124 @@ +local Classes = MyCollection.Internals.Classes +local Constants = MyCollection.Internals.Constants +local Dependencies = MyCollection.Internals.Dependencies +local Extensions = MyCollection.Internals.Functions.Extensions + +Classes.Item = {} +Classes.Item.__index = Classes.Item + +local Item = Classes.Item + +-- Constructor +function Item.New(characterId, bagId, slotId, setId, equipType, traitType, armorType, weaponType, link) + local instance = {} + setmetatable(instance, Item) + + instance:Initialize(characterId, bagId, slotId, setId, equipType, traitType, armorType, weaponType, link) + + if Extensions.Constants.IsEquipment(instance.equipType) then + return instance + else + return nil + end +end + +-- Properties +Item.equipType = nil +Item.armorType = nil +Item.weaponType = nil +Item.traitType = nil +Item.setId = nil +Item.bagId = nil +Item.slotId = nil +Item.characterId = nil +Item.link = nil + +-- Functions +function Item:Equals(setId, equipType, traitType, armorType, weaponType) + if + setId == self.setId and + equipType == self.equipType and + (traitType == nil or traitType == 0 or traitType == self.traitType) and + (armorType == nil or armorType == 0 or armorType == self.armorType) and + (weaponType == nil or weaponType == 0 or weaponType == self.weaponType) + then + return true + end + + return false +end + +function Item:GetLink() + return self.link +end + +function Item:GetId() + if self.characterId == nil then + return "account_".. tostring(self.bagId) .. "_".. tostring(self.slotId) + else + return tostring(self.characterId) .. "_" .. tostring(self.bagId) .. "_".. tostring(self.slotId) + end +end + +function Item:Initialize(characterId, bagId, slotId, setId, equipType, traitType, armorType, weaponType, link) + self.bagId = bagId + self.slotId = slotId + self.characterId = characterId + + if link == nil then + self.link = Dependencies.Officials.GetItemLink(self.bagId, self.slotId) + else + self.link = link + end + + if setId == nil then + _, _, self.setId, _, _, _ = Dependencies.LibSets.IsSetByItemLink(self.link) + else + self.setId = setId + end + + if equipType == nil then + _, _, _, _, _, self.equipType, _, _ = Dependencies.Officials.GetItemInfo(self.bagId, self.slotId) + else + self.equipType = equipType + end + + -- Skip further read if not equipment + if not Extensions.Constants.IsEquipment(self.equipType) then + return + end + + if traitType == nil then + self.traitType = Dependencies.Officials.GetItemTrait(self.bagId, self.slotId) + else + self.traitType = traitType + end + + if Extensions.Constants.IsWeaponOrShield(self.equipType) then + if weaponType == nil then + self.weaponType = Dependencies.Officials.GetItemWeaponType(self.bagId, self.slotId) + else + self.weaponType = weaponType + end + else + if Extensions.Constants.IsArmor(self.equipType) then + if armorType == nil then + self.armorType = Dependencies.Officials.GetItemArmorType(self.bagId, self.slotId) + else + self.armorType = armorType + end + end + end +end + +-- For saving purpose +function Item:CopyForSave() + return { + setId = self.setId, + equipType = self.equipType, + traitType = self.traitType, + armorType = self.armorType, + weaponType = self.weaponType, + link = self.link + } +end \ No newline at end of file diff --git a/MyCollection/Internals/Classes/Piece.lua b/MyCollection/Internals/Classes/Piece.lua new file mode 100644 index 0000000..ab2a040 --- /dev/null +++ b/MyCollection/Internals/Classes/Piece.lua @@ -0,0 +1,96 @@ +local Classes = MyCollection.Internals.Classes +local Constants = MyCollection.Internals.Constants +local Dependencies = MyCollection.Internals.Dependencies +local Logger = MyCollection.Internals.Dependencies.Logger +local Data = MyCollection.Internals.Data + +Classes.Piece = {} +Classes.Piece.__index = Classes.Piece + +local Piece = Classes.Piece + +-- Constructor +function Piece.New(setId, equipType, traitType, armorType, weaponType) + local instance = {} + setmetatable(instance, Piece) + + instance:Initialize(setId, equipType, traitType, armorType, weaponType) + return instance +end + +Piece.references = {} + +-- Properties +Piece.setId = nil +Piece.equipType = nil +Piece.traitType = nil +Piece.armorType = nil +Piece.weaponType = nil + +-- Functions +function Piece:SetTrait(traitType) + self.traitType = traitType + self:Refresh() +end + +function Piece:GetReferences() + return self.references +end + +function Piece:HasItem() + if next(self.references) ~= nil then + return true + end + + return false +end + +function Piece:AddReference(item) + self.references[item:GetId()] = item + + if Logger ~= nil and item ~= nil then + local _, setName, _, _, _, _ = Dependencies.LibSets.IsSetByItemLink(item.link) + Logger:Debug("Found setId: '".. tostring(self.setId) .."', traitType: '".. tostring(self.traitType) .."', equipType: '".. tostring(self.equipType) .."', armorType: '".. tostring(self.armorType) .."', weaponType: '".. tostring(self.weaponType) .."', hasItem:'".. tostring(self:HasItem()) .. "'.") + Logger:Debug("Added bagId:'".. item.bagId .. "', slotId: '".. item.slotId .. "' setName: '".. setName .."' Link: ".. item.link) + end +end + +function Piece:RemoveReference(item) + self.references[item:GetId()] = nil +end + +function Piece:Refresh() + self.references = {} + local items = Data.Inventory:FindAll(self.setId, self.equipType, self.traitType, self.armorType, self.weaponType) + if next(items) ~= nil then + for _, item in ipairs(items) do + self:AddReference(item) + end + end +end + +function Piece:Initialize(setId, equipType, traitType, armorType, weaponType) + self.setId = setId + self.equipType = equipType + if (traitType == nil) then + traitType = Constants.TraitTypes.None + end + self.traitType = traitType + self.armorType = armorType + self.weaponType = weaponType + + self.references = {} + + self:Refresh() +end + +-- For saving purpose +function Piece:CopyForSave() + return { + setId = self.setId, + equipType = self.equipType, + traitType = self.traitType, + armorType = self.armorType, + weaponType = self.weaponType, + } +end \ No newline at end of file diff --git a/MyCollection/Internals/Classes/Set.lua b/MyCollection/Internals/Classes/Set.lua new file mode 100644 index 0000000..4b6167b --- /dev/null +++ b/MyCollection/Internals/Classes/Set.lua @@ -0,0 +1,171 @@ +local Classes = MyCollection.Internals.Classes +local Constants = MyCollection.Internals.Constants +local Dependencies = MyCollection.Internals.Dependencies +local Extensions = MyCollection.Internals.Functions.Extensions + +Classes.Set = {} +Classes.Set.__index = Classes.Set + +local Set = Classes.Set + +-- Constructor +function Set.New(savedTable, setId, setName, armorType, orderNumber) + local instance = {} + setmetatable(instance, Set) + + instance:Initialize(savedTable, setId, setName, armorType, orderNumber) + return instance +end + +-- Fields +Set.savedTableReference = nil + +-- Properties +Set.setId = nil +Set.setName = nil +Set.armorType = nil +Set.orderNumber = nil +Set.pieces = nil + +-- Functions +function Set:GetArmorPiece(equipType) + return self.pieces.armors[equipType] +end +function Set:GetJewelleryPiece(equipType) + return self.pieces.jewelleries[equipType] +end +function Set:GetWeaponPiece(weaponType) + return self.pieces.weapons[weaponType] +end + +function Set:Completition() + local count = 0 + for category, group in pairs(self.pieces) do + for subCategory, piece in pairs(group) do + if piece:HasItem() then + count = count + 1 + end + end + end + + return count +end + +function Set:SetOrderNumber(number) + if number > 0 and number < 10001 then + self.orderNumber = number + self.savedTableReference.orderNumber = number + end + if number == 0 then + self.orderNumber = nil + self.savedTableReference.orderNumber = nil + end +end + +function Set:GetOrderNumber() + return self.orderNumber +end + +function Set:GetSetName() + return self.setName +end + +function Set:GetSetId() + return self.setId +end + +function Set:GetArmorType() + return self.armorType +end + +function Set:AddItem(item) + if Extensions.Constants.IsWeaponOrShield(item.equipType) then + self.pieces.weapons[item.weaponType]:AddReference(item) + end + + if Extensions.Constants.IsJewellery(item.equipType) then + self.pieces.jewelleries[item.equipType]:AddReference(item) + end + + if Extensions.Constants.IsArmor(item.equipType) and item.armoryType == self.armorType then + self.pieces[item.equipType]:AddReference(item) + end +end + +function Set:RemoveItem(item) + if Extensions.Constants.IsWeaponOrShield(item.equipType) then + self.pieces.weapons[item.weaponType]:RemoveReference(item) + end + + if Extensions.Constants.IsJewellery(item.equipType) then + self.pieces.jewelleries[item.equipType]:RemoveReference(item) + end + + if Extensions.Constants.IsArmor(item.equipType) and item.armoryType == self.armorType then + self.pieces[item.equipType]:RemoveReference(item) + end +end + +function Set:Initialize(savedTable, setId, setName, armorType, orderNumber) + self.pieces = { + armors = {}, + jewelleries = {}, + weapons = {}, + } + + self.savedTableReference = savedTable + + self.setId = setId + + if setName == nil then + setName = Dependencies.LibSets.GetSetName(setId) + end + + self.setName = setName + self.armorType = armorType + self.orderNumber = orderNumber + + if savedTable ~= nil and next(savedTable) ~= nil then + if (next(savedTable.armors) ~= nil) then + for equipType, item in pairs(savedTable.armors) do + self.pieces.armors[equipType] = Classes.Piece.New(item.setId, item.equipType, item.traitType, item.armorType, item.weaponType) + end + end + + if (next(savedTable.jewelleries) ~= nil) then + for equipType, item in pairs(savedTable.jewelleries) do + self.pieces.jewelleries[equipType] = Classes.Piece.New(item.setId, item.equipType, item.traitType, item.armorType, item.weaponType) + end + end + + if (next(savedTable.weapons) ~= nil) then + for equipType, item in pairs(savedTable.weapons) do + self.pieces.weapons[equipType] = Classes.Piece.New(item.setId, item.equipType, item.traitType, item.armorType, item.weaponType) + end + end + else + savedTable.setId = setId + savedTable.setName = setName + savedTable.armorType = armorType + savedTable.orderNumber = orderNumber + + savedTable.armors = {} + savedTable.jewelleries = {} + savedTable.weapons = {} + + for _, equipType in pairs(Constants.EquipTypes.Armors) do + self.pieces.armors[equipType] = Classes.Piece.New(self.setId, equipType, nil, self.armorType, nil) + savedTable.armors[equipType] = self.pieces.armors[equipType]:CopyForSave() + end + + for _, equipType in pairs(Constants.EquipTypes.Jewelleries) do + self.pieces.jewelleries[equipType] = Classes.Piece.New(self.setId, equipType, nil, nil, nil) + savedTable.jewelleries[equipType] = self.pieces.jewelleries[equipType]:CopyForSave() + end + + for _, weaponType in pairs(Constants.WeaponTypes) do + self.pieces.weapons[weaponType] = Classes.Piece.New(self.setId, equipType, nil, nil, weaponType) + savedTable.weapons[weaponType] = self.pieces.weapons[weaponType]:CopyForSave() + end + end +end \ No newline at end of file diff --git a/MyCollection/Internals/Functions/Callbacks.lua b/MyCollection/Internals/Functions/Callbacks.lua new file mode 100644 index 0000000..d15cbc8 --- /dev/null +++ b/MyCollection/Internals/Functions/Callbacks.lua @@ -0,0 +1,34 @@ +local Functions = MyCollection.Internals.Functions +local Classes = MyCollection.Internals.Classes +local Data = MyCollection.Internals.Data +local Logger = MyCollection.Internals.Dependencies.Logger +local Dependencies = MyCollection.Internals.Dependencies + +Functions.Callbacks = {} +local Callbacks = Functions.Callbacks + +function Callbacks.Added(bagId, slotId, item) + local characterId = Dependencies.Officials.GetCurrentCharacterId() + local item = Classes.Item.New(characterId, bagId, slotId) + if (item ~= nil and item.setId ~= nil and item.setId ~= 0) then + Data.Inventory:AddItem(item) + Data.Collection:AddItem(item) + end +end + +function Callbacks.Removed(bagId, slotId, item) + local item = Data.Inventory:RemoveItem(bagId, slotId) + if (item ~= nil) then + Data.Collection:RemoveItem(item) + end +end + +function Callbacks.Updated(bagId, slotId, item) + local characterId = Dependencies.Officials.GetCurrentCharacterId() + local item = Classes.Item.New(characterId, bagId, slotId) + if (item ~= nil and item.setId ~= nil and item.setId ~= 0) then + Data.Inventory:AddItem(item) + Data.Collection:AddItem(item) + end +end + diff --git a/MyCollection/Internals/Functions/Extensions/Constants.lua b/MyCollection/Internals/Functions/Extensions/Constants.lua new file mode 100644 index 0000000..17f2727 --- /dev/null +++ b/MyCollection/Internals/Functions/Extensions/Constants.lua @@ -0,0 +1,84 @@ +local Extensions = MyCollection.Internals.Functions.Extensions +local Constants = MyCollection.Internals.Constants + +Extensions.Constants = {} + +Extensions.Constants.IsEquipment = function (equipType) + return + Extensions.Constants.IsArmor(equipType) or + Extensions.Constants.IsJewellery(equipType) or + Extensions.Constants.IsWeaponOrShield(equipType) +end + +Extensions.Constants.IsArmor = function (equipType) + for key, id in pairs(Constants.EquipTypes.Armors) do + if (id == equipType) then + return true + end + end + return false +end + +Extensions.Constants.IsWeaponOrShield = function (equipType) + for key, id in pairs(Constants.EquipTypes.Weapons) do + if (id == equipType) then + return true + end + end + return false +end + +Extensions.Constants.IsJewellery = function (equipType) + for key, id in pairs(Constants.EquipTypes.Jewelleries) do + if (id == equipType) then + return true + end + end + return false +end + +Extensions.Constants.IsCharacterBag = function (bagId) + if + bagId == Constants.BagTypes.Worn + or bagId == Constants.BagTypes.Backpack + --or bagId == Constants.BagTypes.BuyBack + then + return true + end + return false +end + +Extensions.Constants.IsBank = function (bagId) + if + bagId == Constants.BagTypes.Bank or + bagId == Constants.BagTypes.SubscriberBank + then + return true + end + return false +end + +Extensions.Constants.GetTraitName = function (traitId) + if traitId == 0 or traitId == nil then + return GetString(MYCOLLECTION_TRAIT_NONE) + else + for key, trait in pairs(Constants.TraitTypes.Armor) do + if (traitId == trait) then + local traitTextId = _G["MYCOLLECTION_TRAIT_ARMOR_" .. key:upper()] + return GetString(traitTextId) + end + end + for key, trait in pairs(Constants.TraitTypes.Jewelleries) do + if (traitId == trait) then + local traitTextId = _G["MYCOLLECTION_TRAIT_JEWELLERY_" .. key:upper()] + return GetString(traitTextId) + end + end + for key, trait in pairs(Constants.TraitTypes.Weapons) do + if (traitId == trait) then + local traitTextId = _G["MYCOLLECTION_TRAIT_WEAPONS_" .. key:upper()] + return GetString(traitTextId) + end + end + end +end \ No newline at end of file diff --git a/MyCollection/Internals/Functions/Namespaces.lua b/MyCollection/Internals/Functions/Namespaces.lua new file mode 100644 index 0000000..4cf79f1 --- /dev/null +++ b/MyCollection/Internals/Functions/Namespaces.lua @@ -0,0 +1,3 @@ +local Functions = MyCollection.Internals.Functions + +Functions.Extensions = {} \ No newline at end of file diff --git a/MyCollection/Languages/Default.lua b/MyCollection/Languages/Default.lua new file mode 100644 index 0000000..13f402b --- /dev/null +++ b/MyCollection/Languages/Default.lua @@ -0,0 +1,51 @@ +ZO_CreateStringId("SI_BINDING_NAME_MYCOLLECTION_MENU_TOGGLE" , "My Collection") +ZO_CreateStringId("MYCOLLECTION_TITLE" , "|c77ee02My Collection|r") +ZO_CreateStringId("MYCOLLECTION_NAME" , "My Collection") +ZO_CreateStringId("MYCOLLECTION_SEARCH_LABEL" , "Search:") +ZO_CreateStringId("MYCOLLECTION_HEADERS_ORDER" , "No.") +ZO_CreateStringId("MYCOLLECTION_HEADERS_SET" , "Set") +ZO_CreateStringId("MYCOLLECTION_HEADERS_ITEMS" , "Completition") +ZO_CreateStringId("MYCOLLECTION_CONTEXT_REMOVE" , "Remove set") +ZO_CreateStringId("MYCOLLECTION_CONTEXT_CHANGEORDER" , "Set Order No.") +ZO_CreateStringId("MYCOLLECTION_MENU_ADD" , "Add set") +ZO_CreateStringId("MYCOLLECTION_MENU_GRID" , "List") + +ZO_CreateStringId("MYCOLLECTION_ADDMENU_SELECTOR_LABEL" , "Select set:") +ZO_CreateStringId("MYCOLLECTION_ADDMENU_ARMORTYPE_LABEL" , "Armor Type:") +ZO_CreateStringId("MYCOLLECTION_ADDMENU_ARMORTYPE_LIGHT" , "Light") +ZO_CreateStringId("MYCOLLECTION_ADDMENU_ARMORTYPE_MEDIUM" , "Medium") +ZO_CreateStringId("MYCOLLECTION_ADDMENU_ARMORTYPE_HEAVY" , "Heavy") +ZO_CreateStringId("MYCOLLECTION_ADDMENU_ADD" , "Add") +ZO_CreateStringId("MYCOLLECTION_ADDMENU_ORDERNUMBER_LABEL" , "Order Number:") + +ZO_CreateStringId("MYCOLLECTION_TRAIT_NONE" , "None") + +ZO_CreateStringId("MYCOLLECTION_TRAIT_ARMOR_STURDY" , "Sturdy") +ZO_CreateStringId("MYCOLLECTION_TRAIT_ARMOR_IMPENETRABLE" , "Impenetrable") +ZO_CreateStringId("MYCOLLECTION_TRAIT_ARMOR_REINFORCED" , "Reinforced") +ZO_CreateStringId("MYCOLLECTION_TRAIT_ARMOR_WELLFITTED" , "Well-Fitted") +ZO_CreateStringId("MYCOLLECTION_TRAIT_ARMOR_TRAINING" , "Training") +ZO_CreateStringId("MYCOLLECTION_TRAIT_ARMOR_INFUSED" , "Infused") +ZO_CreateStringId("MYCOLLECTION_TRAIT_ARMOR_INVIGORATING" , "Invigorating") +ZO_CreateStringId("MYCOLLECTION_TRAIT_ARMOR_DIVINES" , "Divines") +ZO_CreateStringId("MYCOLLECTION_TRAIT_ARMOR_NIRNHORNED" , "Nirnhorned") + +ZO_CreateStringId("MYCOLLECTION_TRAIT_JEWELLERY_HEALTHY" , "Healthy") +ZO_CreateStringId("MYCOLLECTION_TRAIT_JEWELLERY_ARCANE" , "Arcane") +ZO_CreateStringId("MYCOLLECTION_TRAIT_JEWELLERY_ROBUST" , "Robust") +ZO_CreateStringId("MYCOLLECTION_TRAIT_JEWELLERY_SWIFT" , "Swift") +ZO_CreateStringId("MYCOLLECTION_TRAIT_JEWELLERY_HARMONY" , "Harmony") +ZO_CreateStringId("MYCOLLECTION_TRAIT_JEWELLERY_TRIUNE" , "Triune") +ZO_CreateStringId("MYCOLLECTION_TRAIT_JEWELLERY_BLOODTHIRSTY" , "Bloodthirsty") +ZO_CreateStringId("MYCOLLECTION_TRAIT_JEWELLERY_PROTECTIVE" , "Protective") +ZO_CreateStringId("MYCOLLECTION_TRAIT_JEWELLERY_INFUSED" , "Infused") + +ZO_CreateStringId("MYCOLLECTION_TRAIT_WEAPON_POWERED" , "Powered") +ZO_CreateStringId("MYCOLLECTION_TRAIT_WEAPON_CHARGED" , "Charged") +ZO_CreateStringId("MYCOLLECTION_TRAIT_WEAPON_PRECISE" , "Precise") +ZO_CreateStringId("MYCOLLECTION_TRAIT_WEAPON_INFUSED" , "Infused") +ZO_CreateStringId("MYCOLLECTION_TRAIT_WEAPON_DEFENDING" , "Defending") +ZO_CreateStringId("MYCOLLECTION_TRAIT_WEAPON_TRAINING" , "Training") +ZO_CreateStringId("MYCOLLECTION_TRAIT_WEAPON_SHARPENED" , "Sharpened") +ZO_CreateStringId("MYCOLLECTION_TRAIT_WEAPON_DECISIVE" , "Decisive") +ZO_CreateStringId("MYCOLLECTION_TRAIT_WEAPON_NIRNFORNED" , "Nirnforned") \ No newline at end of file diff --git a/MyCollection/Main.lua b/MyCollection/Main.lua new file mode 100644 index 0000000..416595a --- /dev/null +++ b/MyCollection/Main.lua @@ -0,0 +1,75 @@ +local Classes = MyCollection.Internals.Classes +local Constants = MyCollection.Internals.Constants +local Functions = MyCollection.Internals.Functions +local Data = MyCollection.Internals.Data +local Saved = MyCollection.Internals.Saved +local Defaults = MyCollection.Internals.Saved.Defaults +local Dependencies = MyCollection.Internals.Dependencies +local EventManager = MyCollection.Internals.Dependencies.Officials.EventManager +local SharedInventory = MyCollection.Internals.Dependencies.Officials.SharedInventory +local Logger = MyCollection.Internals.Dependencies.Logger +local UI = MyCollection.UI + +-- Functions +function MyCollection.ResetInventory(event) + Data.Inventory:Refresh() +end + +-- Initialite +function MyCollection:Initialize() + -- Saved variable load + Saved.Inventory = Dependencies.LibSavedVars:NewAccountWide(MyCollection.Internals.SavedVariables.Inventory.Name, nil, Defaults.Inventory ):Version(MyCollection.Internals.SavedVariables.Inventory.Version, function(table) end) + Saved.Collection = Dependencies.LibSavedVars:NewAccountWide(MyCollection.Internals.SavedVariables.Collection.Name, nil, Defaults.Collection ):Version(MyCollection.Internals.SavedVariables.Collection.Version, function(table) end) + Saved.Settings = Dependencies.LibSavedVars:NewAccountWide(MyCollection.Internals.SavedVariables.Settings.Name, nil, Defaults.Settings ):Version(MyCollection.Internals.SavedVariables.Settings.Version, function(table) end) + + Saved.Settings.Logging = false + Logger:SetEnabled(Saved.Settings.Logging) + + Data.Inventory = Classes.Inventory.New(Saved.Inventory) + Data.Collection = Classes.Collection.New(Saved.Collection) + + -- Register Callbacks + --SharedInventory:RegisterCallback("SingleSlotInventoryUpdate", MyCollection.Internals.Functions.Callbacks.WUT) + SharedInventory:RegisterCallback("SlotRemoved", Functions.Callbacks.Removed) + SharedInventory:RegisterCallback("SlotAdded", Functions.Callbacks.Added) + SharedInventory:RegisterCallback("SlotUpdated", Functions.Callbacks.Updated) + + -- Refresh the current caracters and banks data + Data.Inventory:Refresh() + + -- Initialize UI + UI.Frame.Initialize() +end + +function MyCollection.OnAddOnLoaded(event, addonName) + if MyCollection.Name ~= addonName then return end + + while not LibSets.AreSetsLoaded() do end + + EventManager:UnregisterForEvent(MyCollection.Name, EVENT_ADD_ON_LOADED) + MyCollection:Initialize() +end + +EventManager:RegisterForEvent(MyCollection.Name, EVENT_ADD_ON_LOADED, MyCollection.OnAddOnLoaded) + +---- Possible usefull events +-- Logout +--EVENT_PLAYER_DEACTIVATED + +-- Change inventory item +--EVENT_INVENTORY_SINGLE_SLOT_UPDATE +---- EVENT_INVENTORY_SINGLE_SLOT_UPDATE, REGISTER_FILTER_INVENTORY_UPDATE_REASON, INVENTORY_UPDATE_REASON_DEFAULT + +-- Open Bank +--EVENT_OPEN_BANK + +-- Open Guild Bank, add/remove item +--EVENT_GUILD_BANK_ITEMS_READY +--EVENT_GUILD_BANK_ITEM_ADDED +--EVENT_GUILD_BANK_ITEM_REMOVED +--EVENT_GUILD_SELF_JOINED_GUILD +--EVENT_GUILD_SELF_LEFT_GUILD + +-- Entered House +--EVENT_PLAYER_ACTIVATED +--EVENT_HOUSING_EDITOR_MODE_CHANGEDw \ No newline at end of file diff --git a/MyCollection/MyCollection.txt b/MyCollection/MyCollection.txt new file mode 100644 index 0000000..58a213b --- /dev/null +++ b/MyCollection/MyCollection.txt @@ -0,0 +1,68 @@ +## Title: |c77ee02My Collection|r || Version: 0.1.0 +## Author: |c87ddf2AlvinTheFox|r +## APIVersion: 100031 +## Version: 0.1.0 +## Description: Customizable set collection tracker. +## SavedVariables: MyCollection_Settings MyCollection_Collection MyCollection_Inventory +## DependsOn: LibSavedVars LibMainMenu-2.0 LibSets +## OptionalDependsOn: LibDebugLogger + +; This Add-on is not created by, affiliated with, or sponsored by, ZeniMax Media Inc. or its affiliates. +; The Elder Scrolls® and related logos are registered trademarks or trademarks of ZeniMax Media Inc. in the United States +; and/or other countries. All rights reserved. + +;;;; Languages ;;;; +Languages/Default.lua + +;;;; Code ;;;; +;; Namespaces ;; +Namespace.lua +Internals/Namespaces.lua +Internals/Functions/Namespaces.lua +UI/Namespaces.lua + +;; Globals ;; +Globals.lua + +;; Dependencies ;; +Internals/Dependencies.lua + +;; Constants ;; +Internals/Constants.lua + +;; Classes ;; +Internals/Classes/Item.lua +Internals/Classes/Bag.lua +Internals/Classes/Inventory.lua +Internals/Classes/Piece.lua +Internals/Classes/Set.lua +Internals/Classes/Collection.lua + +;; Functions ;; +Internals/Functions/Callbacks.lua +Internals/Functions/Extensions/Constants.lua +Internals/Functions/UI.lua + +;; Defaults ;; +Internals/Defaults.lua + +;; Settings Menu ;; +Settings.lua + +;;;; UI ;;;; +;; UI Controls ;; +UI/Controls/MenuBar.lua +UI/Controls/Grid.lua +UI/Controls/AddSet.lua + +;; UI Elements +UI/Frame.xml + +;; UI Main ;; +UI/Frame.lua + +;;;; Bindings ;;;; +Bindings.xml + +;;;; Main ;;;; +Main.lua diff --git a/MyCollection/Namespace.lua b/MyCollection/Namespace.lua new file mode 100644 index 0000000..0dd8808 --- /dev/null +++ b/MyCollection/Namespace.lua @@ -0,0 +1,6 @@ +if MyCollection == nil then MyCollection = {} end + +local MyCollection = MyCollection + +MyCollection.Internals = {} +MyCollection.UI = {} \ No newline at end of file diff --git a/MyCollection/Namespaces.lua b/MyCollection/Namespaces.lua new file mode 100644 index 0000000..ea35e5a --- /dev/null +++ b/MyCollection/Namespaces.lua @@ -0,0 +1,9 @@ +MyCollection.Internals.Data = {} +MyCollection.Internals.Saved = { + Settings = {}, + Inventory = {}, + Collection = {}, +} +MyCollection.Internals.Functions = {} +MyCollection.Internals.Classes = {} +MyCollection.Internals.Dependencies = {} \ No newline at end of file diff --git a/MyCollection/Settings.lua b/MyCollection/Settings.lua new file mode 100644 index 0000000..97a8d6d --- /dev/null +++ b/MyCollection/Settings.lua @@ -0,0 +1 @@ +local Dependencies = MyCollection.Internals.Dependencies \ No newline at end of file diff --git a/MyCollection/UI/Controls/AddSet.lua b/MyCollection/UI/Controls/AddSet.lua new file mode 100644 index 0000000..6617647 --- /dev/null +++ b/MyCollection/UI/Controls/AddSet.lua @@ -0,0 +1,102 @@ +local Saved = MyCollection.Internals.Saved +local Data = MyCollection.Internals.Data +local Constants = MyCollection.Internals.Constants +local Dependencies = MyCollection.Internals.Dependencies +local Logger = MyCollection.Internals.Dependencies.Logger +local EventManager = MyCollection.Internals.Dependencies.Officials.EventManager +local UI = MyCollection.UI +local Controls = MyCollection.UI.Controls + +Controls.AddSet = {} +Controls.AddSet.__index = Controls.AddSet + +local AddSet = Controls.AddSet + +-- Constructor +function AddSet.New(element) + local instance = {} + setmetatable(instance, AddSet) + + instance:Initialize(element) + return instance +end + +-- UI containers +AddSet.Element = nil + +-- Sub Elements +AddSet.Label = nil +AddSet.OrderNumber = nil + +-- Selectors +AddSet.ArmorSelector = nil +AddSet.SetSelector = nil + +-- Functions + +function AddSet:Initialize(element) + self.Element = element + + -- Set Selector + self.SetSelector = ZO_ComboBox_ObjectFromContainer(self.Element:GetNamedChild("Selector")) + + self.SetSelector:SetSortsItems(true) + self.SetSelector:ClearItems() + + for key, _ in pairs(Dependencies.LibSets.GetAllSetIds()) do + local name = Dependencies.LibSets.GetSetName(key) + local entry = ZO_ComboBox:CreateItemEntry(name, function () end) + entry.id = key + self.SetSelector:AddItem(entry, ZO_COMBOBOX_SUPRESS_UPDATE) + end + + self.SetSelector:SetSortOrder(ZO_SORT_ORDER_UP, ZO_SORT_BY_NAME) + self.SetSelector:SetHeight(500) + + self.SetSelector:SelectFirstItem() + + -- Armor Type selector + local armorTypeSelectorElement = self.Element:GetNamedChild("ArmorType") + self.ArmorSelector = ZO_RadioButtonGroup:New() + + local lightButton = self.Element:GetNamedChild("Light") + lightButton.armorType = Constants.ArmorTypes.Light + self.ArmorSelector:Add(lightButton) + + local mediumButton = self.Element:GetNamedChild("Medium") + mediumButton.armorType = Constants.ArmorTypes.Medium + self.ArmorSelector:Add(mediumButton) + + local heavyButton = self.Element:GetNamedChild("Heavy") + heavyButton.armorType = Constants.ArmorTypes.Heavy + self.ArmorSelector:Add(heavyButton) + + self.ArmorSelector:SetClickedButton(lightButton) + + -- Order Number + self.OrderNumber = self.Element:GetNamedChild("OrderNumber"):GetNamedChild("Box") + self.OrderNumber:SetTextType(TEXT_TYPE_NUMERIC_UNSIGNED_INT) + self.OrderNumber:SetMaxInputChars(4) + self.OrderNumber:SetText(0) + + -- Add Button + local addButton = self.Element:GetNamedChild("Add") + addButton:SetHandler("OnMouseUp", AddSet.OnMouseUpItem) +end + +function AddSet.OnMouseUpItem(control, button, upInside) + local addSetMenu = UI.Frame.AddSet + + if (upInside) then + if (button == MOUSE_BUTTON_INDEX_LEFT) then + local setId = addSetMenu.SetSelector:GetSelectedItemData().id + local armorType = addSetMenu.ArmorSelector:GetClickedButton().armorType + local orderNumber = tonumber(addSetMenu.OrderNumber:GetText()) + Data.Collection:AddSet(setId, armorType, orderNumber) + UI.Frame.MenuBar:DefaultPage() + end + end +end + +-- https://esoapi.uesp.net/100031/src/libraries/zo_combobox/zo_combobox.lua.html +-- https://esodata.uesp.net/100031/src/libraries/utility/zo_radiobuttongroup.lua.html \ No newline at end of file diff --git a/MyCollection/UI/Controls/Grid.lua b/MyCollection/UI/Controls/Grid.lua new file mode 100644 index 0000000..9f719af --- /dev/null +++ b/MyCollection/UI/Controls/Grid.lua @@ -0,0 +1,312 @@ +local Saved = MyCollection.Internals.Saved +local Data = MyCollection.Internals.Data +local Constants = MyCollection.Internals.Constants +local Extensions = MyCollection.Internals.Functions.Extensions +local Dependencies = MyCollection.Internals.Dependencies +local Logger = MyCollection.Internals.Dependencies.Logger +local EventManager = MyCollection.Internals.Dependencies.Officials.EventManager +local UI = MyCollection.UI +local Controls = MyCollection.UI.Controls + +Controls.Grid = ZO_SortFilterList:Subclass() +--Controls.Grid.__index = Controls.Grid + +local Grid = Controls.Grid +local MYCOLLECTION_DATA = 1 +local MYCOLLECTION_SORTTYPE = 1 +local MYCOLLECTION_MAX_ORDER = 10001 + +-- Constructor +function Grid:New(element) + local instance = ZO_SortFilterList.New(self, element) + + instance:Setup(element) + return instance +end + +-- UI containers +Grid.Element = nil + +-- Sub Elements +Grid.SearchBox = nil + +-- Properties + +-- Functions +function Grid:Setup(element) + + self.Element = element + + ZO_ScrollList_AddDataType(self.list, MYCOLLECTION_DATA, "MyCollectionUIGridRow", 95, function(control, data) self:SetupItemRow(control, data) end, nil, nil, + function (control) + for i=1, control:GetNamedChild("Items"):GetNumChildren(), 1 do + local item = control:GetNamedChild("Items"):GetChild(i) + item.reference = nil + item.itemLink = nil + item.itemType = nil + item:SetPressedTexture() + item:SetMouseOverTexture() + end + ZO_ObjectPool_DefaultResetControl(control) + end) + ZO_ScrollList_EnableHighlight(self.list, "ZO_ThinListHighlight") + self:SetAlternateRowBackgrounds(true) + + self.masterList = {} + + local sortKeys = { + ["key"] = { isNumeric = true }, + ["order"] = { isNumeric = true, tiebreaker = "key", tieBreakerSortOrder = ZO_SORT_ORDER_UP }, + ["set"] = { caseInsensitive = true, tiebreaker = "order", tieBreakerSortOrder = ZO_SORT_ORDER_DOWN }, + ["completition"] = { isNumeric = true, tiebreaker = "order", tieBreakerSortOrder = ZO_SORT_ORDER_DOWN }, + } + + self.currentSortKey = "order" + self.currentSortOrder = ZO_SORT_ORDER_UP + self.sortHeaderGroup:SelectAndResetSortForKey(self.currentSortKey) + self.sortFunction = function( listEntry1, listEntry2 ) + return ZO_TableOrderingFunction(listEntry1.data, listEntry2.data, self.currentSortKey, sortKeys, self.currentSortOrder) + end + + -- setup searcj + self.SearchBox = self.Element:GetNamedChild("SearchBox") + self.SearchBox:SetHandler("OnTextChanged", function() self:RefreshFilters() end) + self.search = ZO_StringSearch:New() + self.search:AddProcessor(MYCOLLECTION_SORTTYPE, function(stringSearch, data, searchTerm, cache) return(self:ProcessItemEntry(stringSearch, data, searchTerm, cache)) end) +end + +function Grid:SetupItemRow( control, data ) + control.data = data + + -- For default ordering + local key = control:GetNamedChild("Key") + + local order = control:GetNamedChild("Order") + order.normalColor = ZO_DEFAULT_TEXT + if data.order < MYCOLLECTION_MAX_ORDER then + order:SetText(data.order) + else + order:SetText(nil) + end + + local set = control:GetNamedChild("Set") + set.normalColor = ZO_DEFAULT_TEXT + set:SetText(data.set) + + local items = control:GetNamedChild("Items") + + -- Set Item icons + for key, typeId in pairs(Constants.EquipTypes.Armors) do + local piece = items:GetNamedChild(key) + local setPiece = data.reference:GetArmorPiece(typeId) + piece.reference = setPiece + if setPiece:HasItem() then + local link = setPiece:GetReferences()[next(setPiece:GetReferences())]:GetLink() + piece:SetNormalTexture(Dependencies.Officials.GetItemLinkIcon(link)) + piece.itemLink = link + else + piece:SetNormalTexture("MyCollection/UI/Textures/Apparel/".. key .."_up.dds") + piece:SetPressedTexture("MyCollection/UI/Textures/Apparel/".. key .."_down.dds") + piece:SetMouseOverTexture("MyCollection/UI/Textures/Apparel/".. key .."_over.dds") + piece.itemType = key + end + piece.traitId = setPiece.traitType + piece.traitType = "ARMOR" + piece.traitOptions = Constants.TraitTypes.Armor + piece:SetHandler("OnMouseEnter", Grid.OnMouseEnterItem) + piece:SetHandler("OnMouseExit", Grid.OnMouseExitItem) + piece:SetHandler("OnMouseUp", Grid.OnMouseUpItem) + end + for key, typeId in pairs(Constants.EquipTypes.Jewelleries) do + local piece = items:GetNamedChild(key) + local setPiece = data.reference:GetJewelleryPiece(typeId) + piece.reference = setPiece + if setPiece:HasItem() then + local link = setPiece:GetReferences()[next(setPiece:GetReferences())]:GetLink() + piece:SetNormalTexture(Dependencies.Officials.GetItemLinkIcon(link)) + piece.itemLink = link + else + piece:SetNormalTexture("MyCollection/UI/Textures/Apparel/".. key .."_up.dds") + piece:SetPressedTexture("MyCollection/UI/Textures/Apparel/".. key .."_down.dds") + piece:SetMouseOverTexture("MyCollection/UI/Textures/Apparel/".. key .."_over.dds") + piece.itemType = key + end + piece.traitId = setPiece.traitType + piece.traitType = "JEWELLERY" + piece.traitOptions = Constants.TraitTypes.Jewelleries + piece:SetHandler("OnMouseEnter", Grid.OnMouseEnterItem) + piece:SetHandler("OnMouseExit", Grid.OnMouseExitItem) + piece:SetHandler("OnMouseUp", Grid.OnMouseUpItem) + end + for key, typeId in pairs(Constants.WeaponTypes) do + local piece = items:GetNamedChild(key) + local setPiece = data.reference:GetWeaponPiece(typeId) + piece.reference = setPiece + if setPiece:HasItem() then + local link = setPiece:GetReferences()[next(setPiece:GetReferences())]:GetLink() + piece:SetNormalTexture(Dependencies.Officials.GetItemLinkIcon(link)) + piece.itemLink = link + else + piece:SetNormalTexture("MyCollection/UI/Textures/Weapons/".. key .."_up.dds") + piece:SetPressedTexture("MyCollection/UI/Textures/Weapons/".. key .."_down.dds") + piece:SetMouseOverTexture("MyCollection/UI/Textures/Weapons/".. key .."_over.dds") + piece.itemType = key + end + piece.traitId = setPiece.traitType + piece.traitType = "WEAPON" + piece.traitOptions = Constants.TraitTypes.Weapons + piece:SetHandler("OnMouseEnter", Grid.OnMouseEnterItem) + piece:SetHandler("OnMouseExit", Grid.OnMouseExitItem) + piece:SetHandler("OnMouseUp", Grid.OnMouseUpItem) + end + + + ZO_SortFilterList.SetupRow(self, control, data) +end + +function Grid:ProcessItemEntry( stringSearch, data, searchTerm, cache ) + if + zo_plainstrfind(data.set:lower(), searchTerm) + then + return true + end + + return false +end + +function Grid:BuildMasterList() + self.masterList = {} + local sets = Data.Collection:GetSets() + for key, set in pairs(sets) do + local new = { + type = MYCOLLECTION_SORTTYPE, + key = key, + order = sets[key]:GetOrderNumber(), + set = sets[key]:GetSetName(), + completition = sets[key]:Completition(), + reference = sets[key], + referenceId = key, + } + if new.order == nil then + new.order = MYCOLLECTION_MAX_ORDER + end + table.insert(self.masterList, new) + end + +end + +function Grid:FilterScrollList() + local scrollData = ZO_ScrollList_GetDataList(self.list) + ZO_ClearNumericallyIndexedTable(scrollData) + + local searchInput = self.SearchBox:GetText() + + for i, data in ipairs(self.masterList) do + if + searchInput == "" or + self.search:IsMatch(searchInput, data) + then + table.insert(scrollData, ZO_ScrollList_CreateDataEntry(MYCOLLECTION_DATA, data)) + end + end +end + +function Grid:SortScrollList() + if (self.currentSortKey ~= nil and self.currentSortOrder ~= nil) then + local scrollData = ZO_ScrollList_GetDataList(self.list) + table.sort(scrollData, self.sortFunction) + end + + self:RefreshVisible() +end + +function Grid:ShowContextMenu( control ) + ClearMenu() + AddMenuItem(GetString(MYCOLLECTION_CONTEXT_REMOVE), function () + Data.Collection:RemoveSet(control.data.referenceId) + self:RefreshData() + end) + AddMenuItem(GetString(MYCOLLECTION_CONTEXT_CHANGEORDER), function () + ZO_Dialogs_ShowDialog("MyCollection_SetOrderNumber", + { + currentSet = control.data.reference, + }, + { + initialEditText = control.data.order + } + ) + end) + self:ShowMenu(control) +end + +function Grid:ShowTraitMenu( control ) + ClearMenu() + + AddMenuItem("None", function () + control.reference:SetTrait(0) + control.traitName = GetString(traitTextId) + self:RefreshData() + end) + + for key, trait in pairs(control.traitOptions) do + local traitTextId = _G["MYCOLLECTION_TRAIT_".. control.traitType .. "_" .. key:upper()] + AddMenuItem(GetString(traitTextId), function () + control.reference:SetTrait(trait) + control.traitName = GetString(traitTextId) + self:RefreshData() + end) + end + + self:ShowMenu(control) +end + +-- Event static functions +function Grid.OnMouseEnterItem(control) + if control.itemLink ~= nil then + InitializeTooltip(ItemTooltip, control, TOPRIGHT, -100, 0, TOPLEFT) + ItemTooltip:SetLink(control.itemLink) + ZO_Tooltip_AddDivider(ItemTooltip) + ItemTooltip:AddLine("Current trait filter: ".. Extensions.Constants.GetTraitName(control.traitId)) + else + ZO_Tooltips_ShowTextTooltip(control, TOP, control.itemType .. " (" .. Extensions.Constants.GetTraitName(control.traitId) .. ")") + end +end + +function Grid.OnMouseExitItem(control) + ClearTooltip(ItemTooltip) + ZO_Tooltips_HideTextTooltip() +end + +function Grid.OnMouseUpItem(control, button, upInside) + if (upInside) then + if (button == MOUSE_BUTTON_INDEX_RIGHT) then + UI.Frame.Grid:ShowTraitMenu(control) + end + end +end + +function Grid.OnMouseUp(control, button, upInside) + if (upInside) then + if (button == MOUSE_BUTTON_INDEX_RIGHT) then + UI.Frame.Grid:ShowContextMenu(control) + end + end +end + +function Grid.OnMouseEnter(control) + UI.Frame.Grid:Row_OnMouseEnter(control) +end + +function Grid.OnMouseExit(control) + UI.Frame.Grid:Row_OnMouseExit(control) + +end + + +-- https://esoapi.uesp.net/100020/src/libraries/zo_tooltip/zo_tooltip.lua.html#624 +-- https://esoapi.uesp.net/100020/src/libraries/zo_templates/tooltip.lua.html#64 +-- https://esoapi.uesp.net/current/src/libraries/zo_contextmenus/zo_contextmenus.lua.html#266 +-- https://esoapi.uesp.net/current/src/libraries/zo_sortfilterlist/zo_sortfilterlist.lua.html +-- https://esoapi.uesp.net/current/src/libraries/zo_menubar/zo_menubar.lua.html#656 +-- https://esoapi.uesp.net/100031/src/libraries/zo_templates/scrolltemplates.lua.html +-- https://esoapi.uesp.net/current/src/libraries/zo_dialog/zo_dialog.lua.html#394 \ No newline at end of file diff --git a/MyCollection/UI/Controls/MenuBar.lua b/MyCollection/UI/Controls/MenuBar.lua new file mode 100644 index 0000000..89506e7 --- /dev/null +++ b/MyCollection/UI/Controls/MenuBar.lua @@ -0,0 +1,68 @@ +local Saved = MyCollection.Internals.Saved +local Logger = MyCollection.Internals.Dependencies.Logger +local EventManager = MyCollection.Internals.Dependencies.Officials.EventManager +local UI = MyCollection.UI +local Controls = MyCollection.UI.Controls + +Controls.MenuBar = {} +Controls.MenuBar.__index = Controls.MenuBar + +local MenuBar = Controls.MenuBar + +-- Constructor +function MenuBar.New(element) + local instance = {} + setmetatable(instance, MenuBar) + + instance:Initialize(element) + return instance +end + +-- UI containers +MenuBar.Element = nil + +-- Sub Elements +MenuBar.Label = nil + +-- Properties + +-- Functions + +function MenuBar:DefaultPage() + ZO_MenuBar_SelectDescriptor(self.Element, UI.Frame.modes.grid, true) + UI.Frame:RefreshUI() +end + +function MenuBar:Initialize(element) + self.Element = element + + ZO_MenuBar_AddButton(self.Element, { + descriptor = UI.Frame.modes.grid, + categoryName = MYCOLLECTION_MENU_GRID, + normal = "EsoUI/Art/Guild/tabIcon_roster_up.dds", + pressed = "EsoUI/Art/Guild/tabIcon_roster_down.dds", + highlight = "EsoUI/Art/Guild/tabIcon_roster_over.dds", + callback = MenuBar.HandleMenuSwitch, + }) + + ZO_MenuBar_AddButton(self.Element, { + descriptor = UI.Frame.modes.new, + categoryName = MYCOLLECTION_MENU_ADD, + normal = "EsoUI/Art/Inventory/inventory_tabIcon_crafting_up.dds", + pressed = "EsoUI/Art/Inventory/inventory_tabIcon_crafting_down.dds", + highlight = "EsoUI/Art/Inventory/inventory_tabIcon_crafting_over.dds", + callback = MenuBar.HandleMenuSwitch, + }) +end + +function MenuBar.HandleMenuSwitch(button) + local label = "" + if button.descriptor ~= UI.Frame.modes.new then + label = "List" + else + label = "Add set" + end + UI.Frame.MenuBar.Element:GetNamedChild("Label"):SetText(label) + UI.Frame.Grid.Element:SetHidden(button.descriptor ~= UI.Frame.modes.grid) + UI.Frame.AddSet.Element:SetHidden(button.descriptor ~= UI.Frame.modes.new) +end \ No newline at end of file diff --git a/MyCollection/UI/Frame.lua b/MyCollection/UI/Frame.lua new file mode 100644 index 0000000..9b701ac --- /dev/null +++ b/MyCollection/UI/Frame.lua @@ -0,0 +1,152 @@ +local Saved = MyCollection.Internals.Saved +local Constants = MyCollection.Internals.Constants +local Dependencies = MyCollection.Internals.Dependencies +local Logger = MyCollection.Internals.Dependencies.Logger +local EventManager = MyCollection.Internals.Dependencies.Officials.EventManager +local SceneManager = MyCollection.Internals.Dependencies.Officials.SceneManager +local SlashCommands = MyCollection.Internals.Dependencies.Officials.SlashCommands +local UI = MyCollection.UI +local Controls = MyCollection.UI.Controls + +UI.Frame = {} +UI.Frame.__index = UI.Frame + +local Frame = UI.Frame + +-- UI containers +Frame.Element = nil + +-- Sub Elements +Frame.MenuBar = nil +Frame.Grid = nil +Frame.AddSet = nil + +-- Properties +Frame.initialized = false +Frame.scene = nil +Frame.sceneName = nil + +Frame.modes = { + grid = 1, + new = 2, +} + +-- Functions +function Frame.ShowSettings() + Frame.ToggleOpenClose() + --Dependencies.LibAddonMenu:OpenToPanel(addOnPanel) +end + +function Frame.ToggleOpenClose() + Dependencies.LibMainMenu:Refresh() + Dependencies.LibMainMenu:SelectMenuItem(MyCollection.Name) +end + +function Frame.OnReposition() + Saved.Settings.Window.Position.Left = Frame.Element:GetLeft() + Saved.Settings.Window.Position.Top = Frame.Element:GetTop() +end + +function Frame.SetPosition() + local left = Saved.Settings.Window.Position.Left + local top = Saved.Settings.Window.Position.Top + + Frame.Element:ClearAnchors() + Frame.Element:SetAnchor(TOPLEFT, GuiRoot, TOPLEFT, left, top) +end + +function Frame:RefreshUI() + if (not self.initialized) then return end + + Frame.Grid:RefreshData() +end + +function Frame.Initialize() + if Frame.initialized then return end + + Frame.initialized = true + Frame.Element = MyCollectionUIFrame + Frame.sceneName = MyCollection.Name .. "Scene" + + Frame.scene = ZO_Scene:New(Frame.sceneName, SceneManager) + Frame.scene:AddFragment(ZO_SetTitleFragment:New(MYCOLLECTION_TITLE)) + Frame.scene:AddFragment(ZO_FadeSceneFragment:New(Frame.Element)) + Frame.scene:AddFragment(TITLE_FRAGMENT) + Frame.scene:AddFragment(RIGHT_BG_FRAGMENT) + Frame.scene:AddFragment(FRAME_EMOTE_FRAGMENT_MAP) + Frame.scene:AddFragment(CODEX_WINDOW_SOUNDS) + Frame.scene:AddFragment(PLAYER_PROGRESS_BAR_FRAGMENT) + Frame.scene:AddFragmentGroup(FRAGMENT_GROUP.MOUSE_DRIVEN_UI_WINDOW) + --Frame.scene:AddFragmentGroup(FRAGMENT_GROUP.FRAME_TARGET_CENTERED) + Frame.scene:AddFragmentGroup(FRAGMENT_GROUP.PLAYER_PROGRESS_BAR_KEYBOARD_CURRENT) + + Frame.Grid = Controls.Grid:New(Frame.Element:GetNamedChild("Grid")) + Frame.AddSet = Controls.AddSet.New(Frame.Element:GetNamedChild("AddSet")) + Frame.MenuBar = Controls.MenuBar.New(Frame.Element:GetNamedChild("MenuBar")) + Frame.MenuBar:DefaultPage() + + Dependencies.LibMainMenu:Init() + + -- Add to main menu + local categoryLayoutInfo = { + binding = "MYCOLLECTION_MENU_TOGGLE", + categoryName = MYCOLLECTION_NAME, + callback = function(buttonData) + if not SceneManager:IsShowing(Frame.sceneName) then + SceneManager:Show(Frame.sceneName) + Frame:RefreshUI() + else + SceneManager:ShowBaseScene() + end + end, + visible = function(buttonData) + return true + end, + + normal = "esoui/art/collections/collections_tabicon_outfitstyles_up.dds", + pressed = "esoui/art/collections/collections_tabicon_outfitstyles_down.dds", + highlight = "esoui/art/collections/collections_tabicon_outfitstyles_over.dds", + disabled = "esoui/art/collections/collections_tabicon_outfitstyles_up.dds" + } + Dependencies.LibMainMenu:AddMenuItem(MyCollection.Name, Frame.sceneName, categoryLayoutInfo, nil) + + SlashCommands["/mycollection"] = Frame.ToggleOpenClose + + Frame.InitDialogs() +end + +function Frame.InitDialogs() + -- Dialogs + ESO_Dialogs["MyCollection_SetOrderNumber"] = { + title = { + text = "Set Ordering number", + }, + mainText = { + text = "Custom ordering number for the tracked set. This is the default ordering value.", + }, + --updateFn = function (dialog) d("uodate") d(dialog) d(self) end, + --callback = function (dialog) d("setup") d(dialog) d(self) end, + editBox = { + textType = TEXT_TYPE_NUMERIC_UNSIGNED_INT, + maxInputCharacters = 4, + defaultText = 0, + }, + buttons = { + [1] = { + text = "Set", + visible = true, + callback = function (dialog) + dialog.data.currentSet:SetOrderNumber(tonumber(ZO_Dialogs_GetEditBoxText(dialog))) + UI.Frame.Grid:RefreshData() + end, + }, + [2] = { + text = "Cancel", + visible = true, + callback = function (dialog) end, + }, + }, + } + + +end \ No newline at end of file diff --git a/MyCollection/UI/Frame.xml b/MyCollection/UI/Frame.xml new file mode 100644 index 0000000..173b886 --- /dev/null +++ b/MyCollection/UI/Frame.xml @@ -0,0 +1,259 @@ +<?xml version="1.0"?> +<GuiXml> + <Controls> + <Control name="MyCollectionUIItemsBase" virtual="true"> + <Dimensions x="600" y="95" /> + <Controls> + <Button name="$(parent)Head"> + <Anchor point="TOPLEFT" relativePoint="TOPLEFT" offsetX="10" offsetY="5" /> + <Dimensions x="40" y="40" /> + </Button> + <Button name="$(parent)Chest"> + <Anchor point="TOPLEFT" relativePoint="TOPLEFT" offsetX="45" relativeTo="$(parent)Head" /> + <Dimensions x="40" y="40" /> + </Button> + <Button name="$(parent)Shoulders"> + <Anchor point="TOPLEFT" relativePoint="TOPLEFT" offsetX="45" relativeTo="$(parent)Chest" /> + <Dimensions x="40" y="40" /> + </Button> + <Button name="$(parent)Waist"> + <Anchor point="TOPLEFT" relativePoint="TOPLEFT" offsetX="45" relativeTo="$(parent)Shoulders" /> + <Dimensions x="40" y="40" /> + </Button> + <Button name="$(parent)Legs"> + <Anchor point="TOPLEFT" relativePoint="TOPLEFT" offsetX="45" relativeTo="$(parent)Waist" /> + <Dimensions x="40" y="40" /> + </Button> + <Button name="$(parent)Feet"> + <Anchor point="TOPLEFT" relativePoint="TOPLEFT" offsetX="45" relativeTo="$(parent)Legs" /> + <Dimensions x="40" y="40" /> + </Button> + <Button name="$(parent)Hand"> + <Anchor point="TOPLEFT" relativePoint="TOPLEFT" offsetX="45" relativeTo="$(parent)Feet" /> + <Dimensions x="40" y="40" /> + </Button> + + <Button name="$(parent)Neck"> + <Anchor point="TOPLEFT" relativePoint="TOPLEFT" offsetX="90" relativeTo="$(parent)Hand" /> + <Dimensions x="40" y="40" /> + </Button> + <Button name="$(parent)Ring"> + <Anchor point="TOPLEFT" relativePoint="TOPLEFT" offsetX="45" relativeTo="$(parent)Neck" /> + <Dimensions x="40" y="40" /> + </Button> + + <Button name="$(parent)Shield"> + <Anchor point="TOPLEFT" relativePoint="TOPLEFT" offsetX="90" relativeTo="$(parent)Ring" /> + <Dimensions x="40" y="40" /> + </Button> + + <Button name="$(parent)Axe"> + <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" offsetX="10" offsetY="-5" /> + <Dimensions x="40" y="40" /> + </Button> + <Button name="$(parent)Hammer"> + <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" offsetX="45" relativeTo="$(parent)Axe" /> + <Dimensions x="40" y="40" /> + </Button> + <Button name="$(parent)Sword"> + <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" offsetX="45" relativeTo="$(parent)Hammer" /> + <Dimensions x="40" y="40" /> + </Button> + <Button name="$(parent)TwoHandedSword"> + <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" offsetX="45" relativeTo="$(parent)Sword" /> + <Dimensions x="40" y="40" /> + </Button> + <Button name="$(parent)TwoHandedAxe"> + <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" offsetX="45" relativeTo="$(parent)TwoHandedSword" /> + <Dimensions x="40" y="40" /> + </Button> + <Button name="$(parent)TwoHandedHammer"> + <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" offsetX="45" relativeTo="$(parent)TwoHandedAxe" /> + <Dimensions x="40" y="40" /> + </Button> + <Button name="$(parent)Bow"> + <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" offsetX="45" relativeTo="$(parent)TwoHandedHammer" /> + <Dimensions x="40" y="40" /> + </Button> + <Button name="$(parent)HealingStaff"> + <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" offsetX="45" relativeTo="$(parent)Bow" /> + <Dimensions x="40" y="40" /> + </Button> + <Button name="$(parent)Dagger"> + <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" offsetX="45" relativeTo="$(parent)HealingStaff" /> + <Dimensions x="40" y="40" /> + </Button> + <Button name="$(parent)FireStaff"> + <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" offsetX="45" relativeTo="$(parent)Dagger" /> + <Dimensions x="40" y="40" /> + </Button> + <Button name="$(parent)FrostStaff"> + <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" offsetX="45" relativeTo="$(parent)FireStaff" /> + <Dimensions x="40" y="40" /> + </Button> + <Button name="$(parent)LightningStaff"> + <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" offsetX="45" relativeTo="$(parent)FrostStaff" /> + <Dimensions x="40" y="40" /> + </Button> + </Controls> + </Control> + <Label name="MyCollectionUIRowLabel" font="ZoFontGame" wrapMode="ELLIPSIS" horizontalAlignment="LEFT" verticalAlignment="CENTER" virtual="true" /> + <Control name="MyCollectionUIGridRow" mouseEnabled="true" virtual="true"> + <Dimensions y="95" /> + <OnMouseUp> + MyCollection.UI.Controls.Grid.OnMouseUp(self, button, upInside) + </OnMouseUp> + <OnMouseEnter> + MyCollection.UI.Controls.Grid.OnMouseEnter(self) + </OnMouseEnter> + <OnMouseExit> + MyCollection.UI.Controls.Grid.OnMouseExit(self) + </OnMouseExit> + <Controls> + <Texture name="$(parent)BG" inherits="ZO_ThinListBgStrip" /> + <Label name="$(parent)Key" inherits="MyCollectionUIRowLabel"> + <Anchor point="LEFT" /> + <Dimensions x="0" y="95" /> + </Label> + <Label name="$(parent)Order" inherits="MyCollectionUIRowLabel"> + <Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$(parent)Key" /> + <Dimensions x="50" y="95" /> + </Label> + <Label name="$(parent)Set" inherits="MyCollectionUIRowLabel"> + <Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$(parent)Order" /> + <Dimensions x="190" y="95" /> + </Label> + <Label name="$(parent)Completition" inherits="MyCollectionUIRowLabel"> + <Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$(parent)Set" /> + <Dimensions x="0" y="95" /> + </Label> + <Control name="$(parent)Items" inherits="MyCollectionUIItemsBase"> + <Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$(parent)Completition" /> + <Dimensions x="600" y="95" /> + </Control> + </Controls> + </Control> + + <TopLevelControl name="MyCollectionUIFrame" hidden="true" inherits="ZO_RightPanelFootPrint"> + <Controls> + <Control name="$(parent)MenuBar" inherits="ZO_LabelButtonBar"> + <Anchor point="BOTTOMRIGHT" relativePoint="TOPRIGHT" offsetX="-27" offsetY="-12" /> + </Control> + + <Control name="$(parent)AddSet"> + <Anchor point="TOPLEFT" relativePoint="TOPLEFT" /> + <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" /> + <Controls> + <Backdrop name="$(parent)OrderNumber" tier="HIGH" inherits="ZO_SingleLineEditBackdrop_Keyboard"> + <Anchor point="TOPLEFT" relativePoint="TOPLEFT" offsetX="110" offsetY="40" /> + <Dimensions x="250" /> + <Controls> + <EditBox name="$(parent)Box" inherits="ZO_DefaultEditForBackdrop ZO_EditDefaultText" /> + </Controls> + </Backdrop> + <Label name="$(parent)OrderNumberLabel" text="MYCOLLECTION_ADDMENU_ORDERNUMBER_LABEL" font="ZoFontGameLargeBold" color="INTERFACE_COLOR_TYPE_TEXT_COLORS:INTERFACE_TEXT_COLOR_NORMAL"> + <Anchor point="RIGHT" relativePoint="LEFT" relativeTo="$(parent)OrderNumber" offsetX="-8" /> + </Label> + + + <Label name="$(parent)SelectorLabel" font="ZoFontGame" horizontalAlignment="LEFT" verticalAlignment="TOP" text="MYCOLLECTION_ADDMENU_SELECTOR_LABEL"> + <Dimensions x="100" y="30" /> + <Anchor point="TOPLEFT" offsetY="50" relativeTo="$(parent)OrderNumberLabel" /> + </Label> + <Control name="$(parent)Selector" inherits="ZO_ScrollableComboBox"> + <Dimensions x="400" y="30" /> + <Anchor point="TOPLEFT" relativeTo="$(parent)SelectorLabel" offsetX="110" /> + </Control> + + <Label name="$(parent)ArmorType" font="ZoFontGame" horizontalAlignment="LEFT" text="MYCOLLECTION_ADDMENU_ARMORTYPE_LABEL"> + <Dimensions x="100" y="30" /> + <Anchor point="TOPLEFT" relativePoint="TOPLEFT" offsetY="50" relativeTo="$(parent)SelectorLabel" /> + </Label> + <Button name="$(parent)Light" inherits="ZO_DefaultButton" hidden="false" text="MYCOLLECTION_ADDMENU_ARMORTYPE_LIGHT"> + <Anchor point="TOPLEFT" relativePoint="TOPLEFT" offsetX="50" offsetY="50" relativeTo="$(parent)ArmorType" /> + <Dimensions x="175" y="40" /> + </Button> + <Button name="$(parent)Medium" inherits="ZO_DefaultButton" hidden="false" text="MYCOLLECTION_ADDMENU_ARMORTYPE_MEDIUM"> + <Anchor point="TOPLEFT" relativePoint="TOPLEFT" offsetY="50" relativeTo="$(parent)Light" /> + <Dimensions x="175" y="40" /> + </Button> + <Button name="$(parent)Heavy" inherits="ZO_DefaultButton" hidden="false" text="MYCOLLECTION_ADDMENU_ARMORTYPE_HEAVY"> + <Anchor point="TOPLEFT" relativePoint="TOPLEFT" offsetY="50" relativeTo="$(parent)Medium" /> + <Dimensions x="175" y="40" /> + </Button> + + <Button name="$(parent)Add" inherits="ZO_DefaultButton" hidden="false" text="MYCOLLECTION_ADDMENU_ADD"> + <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" offsetY="50" /> + <Dimensions x="175" y="40" /> + </Button> + </Controls> + </Control> + + <Control name="$(parent)Grid"> + <Anchor point="TOPLEFT" relativePoint="TOPLEFT" /> + <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" /> + <Controls> + <Backdrop name="$(parent)Search" tier="HIGH" inherits="ZO_SingleLineEditBackdrop_Keyboard"> + <Anchor point="TOPRIGHT" relativeTo="TOPRIGHT" relativePoint="TOPRIGHT" offsetX="-38" offsetY="14" /> + <Dimensions x="250" /> + <Controls> + <EditBox name="$(parent)Box" inherits="ZO_DefaultEditForBackdrop ZO_EditDefaultText" /> + </Controls> + </Backdrop> + <Label name="$(parent)SearchLabel" text="MYCOLLECTION_SEARCH_LABEL" font="ZoFontGameLargeBold" color="INTERFACE_COLOR_TYPE_TEXT_COLORS:INTERFACE_TEXT_COLOR_NORMAL"> + <Anchor point="RIGHT" relativePoint="LEFT" relativeTo="$(parent)Search" offsetX="-8" /> + </Label> + + <Control name="$(parent)Headers"> + <Anchor point="TOPLEFT" offsetX="30" offsetY="51" /> + <Anchor point="TOPRIGHT" offsetY="51" /> + <Dimensions y="32" /> + <Controls> + <Control name="$(parent)Key" inherits="ZO_SortHeader"> + <OnInitialized> + ZO_SortHeader_Initialize(self, GetString(MYCOLLECTION_HEADERS_ORDER), "key", ZO_SORT_ORDER_UP, TEXT_ALIGN_LEFT, "ZoFontGameLargeBold") + </OnInitialized> + <Anchor point="TOPLEFT" /> + <Dimensions x="0" y="32" /> + </Control> + <Control name="$(parent)Order" inherits="ZO_SortHeader"> + <OnInitialized> + ZO_SortHeader_Initialize(self, GetString(MYCOLLECTION_HEADERS_ORDER), "order", ZO_SORT_ORDER_UP, TEXT_ALIGN_LEFT, "ZoFontGameLargeBold") + </OnInitialized> + <Anchor point="TOPLEFT" relativePoint="TOPRIGHT" relativeTo="$(parent)Key" /> + <Dimensions x="50" y="32" /> + </Control> + <Control name="$(parent)Set" inherits="ZO_SortHeader"> + <OnInitialized> + ZO_SortHeader_Initialize(self, GetString(MYCOLLECTION_HEADERS_SET), "set", ZO_SORT_ORDER_UP, TEXT_ALIGN_LEFT, "ZoFontGameLargeBold") + </OnInitialized> + <Anchor point="TOPLEFT" relativePoint="TOPRIGHT" relativeTo="$(parent)Order" /> + <Dimensions x="190" y="32" /> + </Control> + <Control name="$(parent)Completition" inherits="ZO_SortHeader"> + <OnInitialized> + ZO_SortHeader_Initialize(self, GetString(MYCOLLECTION_HEADERS_ITEMS), "completition", ZO_SORT_ORDER_DOWN, TEXT_ALIGN_LEFT, "ZoFontGameLargeBold") + </OnInitialized> + <Anchor point="TOPLEFT" relativePoint="TOPRIGHT" relativeTo="$(parent)Set" /> + <Dimensions x="600" y="32" /> + </Control> + <Control name="$(parent)Items" inherits="ZO_SortHeader"> + <OnInitialized> + ZO_SortHeader_Initialize(self, "", "items", ZO_SORT_ORDER_DOWN, TEXT_ALIGN_RIGHT, "ZoFontGameLargeBold") + </OnInitialized> + <Anchor point="TOPLEFT" relativePoint="TOPRIGHT" relativeTo="$(parent)Completition" /> + <Dimensions x="0" y="32" /> + </Control> + </Controls> + </Control> + + <Control name="$(parent)List" inherits="ZO_ScrollList"> + <Anchor point="TOPLEFT" relativeTo="$(parent)Headers" relativePoint="BOTTOMLEFT" offsetY="3" /> + <Anchor point="BOTTOMRIGHT" offsetX="-35" offsetY="-32" /> + </Control> + </Controls> + </Control> + </Controls> + </TopLevelControl> + </Controls> +</GuiXml> \ No newline at end of file diff --git a/MyCollection/UI/Internals b/MyCollection/UI/Internals new file mode 100644 index 0000000..e69de29 diff --git a/MyCollection/UI/Namespaces.lua b/MyCollection/UI/Namespaces.lua new file mode 100644 index 0000000..b89af62 --- /dev/null +++ b/MyCollection/UI/Namespaces.lua @@ -0,0 +1,3 @@ +local UI = MyCollection.UI + +UI.Controls = {} \ No newline at end of file diff --git a/MyCollection/UI/Textures/Apparel/Chest_down.dds b/MyCollection/UI/Textures/Apparel/Chest_down.dds new file mode 100644 index 0000000..682c5e3 Binary files /dev/null and b/MyCollection/UI/Textures/Apparel/Chest_down.dds differ diff --git a/MyCollection/UI/Textures/Apparel/Chest_over.dds b/MyCollection/UI/Textures/Apparel/Chest_over.dds new file mode 100644 index 0000000..53f8eba Binary files /dev/null and b/MyCollection/UI/Textures/Apparel/Chest_over.dds differ diff --git a/MyCollection/UI/Textures/Apparel/Chest_up.dds b/MyCollection/UI/Textures/Apparel/Chest_up.dds new file mode 100644 index 0000000..0607240 Binary files /dev/null and b/MyCollection/UI/Textures/Apparel/Chest_up.dds differ diff --git a/MyCollection/UI/Textures/Apparel/Feet_down.dds b/MyCollection/UI/Textures/Apparel/Feet_down.dds new file mode 100644 index 0000000..8ccad3a Binary files /dev/null and b/MyCollection/UI/Textures/Apparel/Feet_down.dds differ diff --git a/MyCollection/UI/Textures/Apparel/Feet_over.dds b/MyCollection/UI/Textures/Apparel/Feet_over.dds new file mode 100644 index 0000000..77f7383 Binary files /dev/null and b/MyCollection/UI/Textures/Apparel/Feet_over.dds differ diff --git a/MyCollection/UI/Textures/Apparel/Feet_up.dds b/MyCollection/UI/Textures/Apparel/Feet_up.dds new file mode 100644 index 0000000..e13b70c Binary files /dev/null and b/MyCollection/UI/Textures/Apparel/Feet_up.dds differ diff --git a/MyCollection/UI/Textures/Apparel/Hand_down.dds b/MyCollection/UI/Textures/Apparel/Hand_down.dds new file mode 100644 index 0000000..08e54db Binary files /dev/null and b/MyCollection/UI/Textures/Apparel/Hand_down.dds differ diff --git a/MyCollection/UI/Textures/Apparel/Hand_over.dds b/MyCollection/UI/Textures/Apparel/Hand_over.dds new file mode 100644 index 0000000..b007d36 Binary files /dev/null and b/MyCollection/UI/Textures/Apparel/Hand_over.dds differ diff --git a/MyCollection/UI/Textures/Apparel/Hand_up.dds b/MyCollection/UI/Textures/Apparel/Hand_up.dds new file mode 100644 index 0000000..1c78f68 Binary files /dev/null and b/MyCollection/UI/Textures/Apparel/Hand_up.dds differ diff --git a/MyCollection/UI/Textures/Apparel/Head_down.dds b/MyCollection/UI/Textures/Apparel/Head_down.dds new file mode 100644 index 0000000..664d78c Binary files /dev/null and b/MyCollection/UI/Textures/Apparel/Head_down.dds differ diff --git a/MyCollection/UI/Textures/Apparel/Head_over.dds b/MyCollection/UI/Textures/Apparel/Head_over.dds new file mode 100644 index 0000000..79825bf Binary files /dev/null and b/MyCollection/UI/Textures/Apparel/Head_over.dds differ diff --git a/MyCollection/UI/Textures/Apparel/Head_up.dds b/MyCollection/UI/Textures/Apparel/Head_up.dds new file mode 100644 index 0000000..a3c53e6 Binary files /dev/null and b/MyCollection/UI/Textures/Apparel/Head_up.dds differ diff --git a/MyCollection/UI/Textures/Apparel/Legs_down.dds b/MyCollection/UI/Textures/Apparel/Legs_down.dds new file mode 100644 index 0000000..fe9e668 Binary files /dev/null and b/MyCollection/UI/Textures/Apparel/Legs_down.dds differ diff --git a/MyCollection/UI/Textures/Apparel/Legs_over.dds b/MyCollection/UI/Textures/Apparel/Legs_over.dds new file mode 100644 index 0000000..f697fcf Binary files /dev/null and b/MyCollection/UI/Textures/Apparel/Legs_over.dds differ diff --git a/MyCollection/UI/Textures/Apparel/Legs_up.dds b/MyCollection/UI/Textures/Apparel/Legs_up.dds new file mode 100644 index 0000000..d582331 Binary files /dev/null and b/MyCollection/UI/Textures/Apparel/Legs_up.dds differ diff --git a/MyCollection/UI/Textures/Apparel/Neck_down.dds b/MyCollection/UI/Textures/Apparel/Neck_down.dds new file mode 100644 index 0000000..e4c4dec Binary files /dev/null and b/MyCollection/UI/Textures/Apparel/Neck_down.dds differ diff --git a/MyCollection/UI/Textures/Apparel/Neck_over.dds b/MyCollection/UI/Textures/Apparel/Neck_over.dds new file mode 100644 index 0000000..8c749cd Binary files /dev/null and b/MyCollection/UI/Textures/Apparel/Neck_over.dds differ diff --git a/MyCollection/UI/Textures/Apparel/Neck_up.dds b/MyCollection/UI/Textures/Apparel/Neck_up.dds new file mode 100644 index 0000000..91d76fb Binary files /dev/null and b/MyCollection/UI/Textures/Apparel/Neck_up.dds differ diff --git a/MyCollection/UI/Textures/Apparel/Ring_down.dds b/MyCollection/UI/Textures/Apparel/Ring_down.dds new file mode 100644 index 0000000..9708bc1 Binary files /dev/null and b/MyCollection/UI/Textures/Apparel/Ring_down.dds differ diff --git a/MyCollection/UI/Textures/Apparel/Ring_over.dds b/MyCollection/UI/Textures/Apparel/Ring_over.dds new file mode 100644 index 0000000..924e507 Binary files /dev/null and b/MyCollection/UI/Textures/Apparel/Ring_over.dds differ diff --git a/MyCollection/UI/Textures/Apparel/Ring_up.dds b/MyCollection/UI/Textures/Apparel/Ring_up.dds new file mode 100644 index 0000000..dd9c336 Binary files /dev/null and b/MyCollection/UI/Textures/Apparel/Ring_up.dds differ diff --git a/MyCollection/UI/Textures/Apparel/Shoulders_down.dds b/MyCollection/UI/Textures/Apparel/Shoulders_down.dds new file mode 100644 index 0000000..fb5c078 Binary files /dev/null and b/MyCollection/UI/Textures/Apparel/Shoulders_down.dds differ diff --git a/MyCollection/UI/Textures/Apparel/Shoulders_over.dds b/MyCollection/UI/Textures/Apparel/Shoulders_over.dds new file mode 100644 index 0000000..7786fbd Binary files /dev/null and b/MyCollection/UI/Textures/Apparel/Shoulders_over.dds differ diff --git a/MyCollection/UI/Textures/Apparel/Shoulders_up.dds b/MyCollection/UI/Textures/Apparel/Shoulders_up.dds new file mode 100644 index 0000000..58535ae Binary files /dev/null and b/MyCollection/UI/Textures/Apparel/Shoulders_up.dds differ diff --git a/MyCollection/UI/Textures/Apparel/Waist_down.dds b/MyCollection/UI/Textures/Apparel/Waist_down.dds new file mode 100644 index 0000000..6fd7cb6 Binary files /dev/null and b/MyCollection/UI/Textures/Apparel/Waist_down.dds differ diff --git a/MyCollection/UI/Textures/Apparel/Waist_over.dds b/MyCollection/UI/Textures/Apparel/Waist_over.dds new file mode 100644 index 0000000..9fdbed0 Binary files /dev/null and b/MyCollection/UI/Textures/Apparel/Waist_over.dds differ diff --git a/MyCollection/UI/Textures/Apparel/Waist_up.dds b/MyCollection/UI/Textures/Apparel/Waist_up.dds new file mode 100644 index 0000000..e5e86b9 Binary files /dev/null and b/MyCollection/UI/Textures/Apparel/Waist_up.dds differ diff --git a/MyCollection/UI/Textures/Weapons/Axe_down.dds b/MyCollection/UI/Textures/Weapons/Axe_down.dds new file mode 100644 index 0000000..4f33a4c Binary files /dev/null and b/MyCollection/UI/Textures/Weapons/Axe_down.dds differ diff --git a/MyCollection/UI/Textures/Weapons/Axe_over.dds b/MyCollection/UI/Textures/Weapons/Axe_over.dds new file mode 100644 index 0000000..aa2280c Binary files /dev/null and b/MyCollection/UI/Textures/Weapons/Axe_over.dds differ diff --git a/MyCollection/UI/Textures/Weapons/Axe_up.dds b/MyCollection/UI/Textures/Weapons/Axe_up.dds new file mode 100644 index 0000000..9318b7e Binary files /dev/null and b/MyCollection/UI/Textures/Weapons/Axe_up.dds differ diff --git a/MyCollection/UI/Textures/Weapons/Bow_down.dds b/MyCollection/UI/Textures/Weapons/Bow_down.dds new file mode 100644 index 0000000..ff74af0 Binary files /dev/null and b/MyCollection/UI/Textures/Weapons/Bow_down.dds differ diff --git a/MyCollection/UI/Textures/Weapons/Bow_over.dds b/MyCollection/UI/Textures/Weapons/Bow_over.dds new file mode 100644 index 0000000..d2b0ff9 Binary files /dev/null and b/MyCollection/UI/Textures/Weapons/Bow_over.dds differ diff --git a/MyCollection/UI/Textures/Weapons/Bow_up.dds b/MyCollection/UI/Textures/Weapons/Bow_up.dds new file mode 100644 index 0000000..71466d3 Binary files /dev/null and b/MyCollection/UI/Textures/Weapons/Bow_up.dds differ diff --git a/MyCollection/UI/Textures/Weapons/Dagger_down.dds b/MyCollection/UI/Textures/Weapons/Dagger_down.dds new file mode 100644 index 0000000..afd1ac2 Binary files /dev/null and b/MyCollection/UI/Textures/Weapons/Dagger_down.dds differ diff --git a/MyCollection/UI/Textures/Weapons/Dagger_over.dds b/MyCollection/UI/Textures/Weapons/Dagger_over.dds new file mode 100644 index 0000000..5ee6432 Binary files /dev/null and b/MyCollection/UI/Textures/Weapons/Dagger_over.dds differ diff --git a/MyCollection/UI/Textures/Weapons/Dagger_up.dds b/MyCollection/UI/Textures/Weapons/Dagger_up.dds new file mode 100644 index 0000000..1d88e99 Binary files /dev/null and b/MyCollection/UI/Textures/Weapons/Dagger_up.dds differ diff --git a/MyCollection/UI/Textures/Weapons/FireStaff_down.dds b/MyCollection/UI/Textures/Weapons/FireStaff_down.dds new file mode 100644 index 0000000..67f7b87 Binary files /dev/null and b/MyCollection/UI/Textures/Weapons/FireStaff_down.dds differ diff --git a/MyCollection/UI/Textures/Weapons/FireStaff_over.dds b/MyCollection/UI/Textures/Weapons/FireStaff_over.dds new file mode 100644 index 0000000..e54ad8a Binary files /dev/null and b/MyCollection/UI/Textures/Weapons/FireStaff_over.dds differ diff --git a/MyCollection/UI/Textures/Weapons/FireStaff_up.dds b/MyCollection/UI/Textures/Weapons/FireStaff_up.dds new file mode 100644 index 0000000..74c7f5d Binary files /dev/null and b/MyCollection/UI/Textures/Weapons/FireStaff_up.dds differ diff --git a/MyCollection/UI/Textures/Weapons/FrostStaff_down.dds b/MyCollection/UI/Textures/Weapons/FrostStaff_down.dds new file mode 100644 index 0000000..7a752ae Binary files /dev/null and b/MyCollection/UI/Textures/Weapons/FrostStaff_down.dds differ diff --git a/MyCollection/UI/Textures/Weapons/FrostStaff_over.dds b/MyCollection/UI/Textures/Weapons/FrostStaff_over.dds new file mode 100644 index 0000000..d6d657e Binary files /dev/null and b/MyCollection/UI/Textures/Weapons/FrostStaff_over.dds differ diff --git a/MyCollection/UI/Textures/Weapons/FrostStaff_up.dds b/MyCollection/UI/Textures/Weapons/FrostStaff_up.dds new file mode 100644 index 0000000..35beba9 Binary files /dev/null and b/MyCollection/UI/Textures/Weapons/FrostStaff_up.dds differ diff --git a/MyCollection/UI/Textures/Weapons/Hammer_down.dds b/MyCollection/UI/Textures/Weapons/Hammer_down.dds new file mode 100644 index 0000000..6e56f05 Binary files /dev/null and b/MyCollection/UI/Textures/Weapons/Hammer_down.dds differ diff --git a/MyCollection/UI/Textures/Weapons/Hammer_over.dds b/MyCollection/UI/Textures/Weapons/Hammer_over.dds new file mode 100644 index 0000000..0c69325 Binary files /dev/null and b/MyCollection/UI/Textures/Weapons/Hammer_over.dds differ diff --git a/MyCollection/UI/Textures/Weapons/Hammer_up.dds b/MyCollection/UI/Textures/Weapons/Hammer_up.dds new file mode 100644 index 0000000..3273e0f Binary files /dev/null and b/MyCollection/UI/Textures/Weapons/Hammer_up.dds differ diff --git a/MyCollection/UI/Textures/Weapons/HealingStaff_down.dds b/MyCollection/UI/Textures/Weapons/HealingStaff_down.dds new file mode 100644 index 0000000..d07892a Binary files /dev/null and b/MyCollection/UI/Textures/Weapons/HealingStaff_down.dds differ diff --git a/MyCollection/UI/Textures/Weapons/HealingStaff_over.dds b/MyCollection/UI/Textures/Weapons/HealingStaff_over.dds new file mode 100644 index 0000000..7409cdb Binary files /dev/null and b/MyCollection/UI/Textures/Weapons/HealingStaff_over.dds differ diff --git a/MyCollection/UI/Textures/Weapons/HealingStaff_up.dds b/MyCollection/UI/Textures/Weapons/HealingStaff_up.dds new file mode 100644 index 0000000..7c5767a Binary files /dev/null and b/MyCollection/UI/Textures/Weapons/HealingStaff_up.dds differ diff --git a/MyCollection/UI/Textures/Weapons/LightningStaff_down.dds b/MyCollection/UI/Textures/Weapons/LightningStaff_down.dds new file mode 100644 index 0000000..d863ebb Binary files /dev/null and b/MyCollection/UI/Textures/Weapons/LightningStaff_down.dds differ diff --git a/MyCollection/UI/Textures/Weapons/LightningStaff_over.dds b/MyCollection/UI/Textures/Weapons/LightningStaff_over.dds new file mode 100644 index 0000000..b22a996 Binary files /dev/null and b/MyCollection/UI/Textures/Weapons/LightningStaff_over.dds differ diff --git a/MyCollection/UI/Textures/Weapons/LightningStaff_up.dds b/MyCollection/UI/Textures/Weapons/LightningStaff_up.dds new file mode 100644 index 0000000..aa6e658 Binary files /dev/null and b/MyCollection/UI/Textures/Weapons/LightningStaff_up.dds differ diff --git a/MyCollection/UI/Textures/Weapons/Shield_down.dds b/MyCollection/UI/Textures/Weapons/Shield_down.dds new file mode 100644 index 0000000..0d14df1 Binary files /dev/null and b/MyCollection/UI/Textures/Weapons/Shield_down.dds differ diff --git a/MyCollection/UI/Textures/Weapons/Shield_over.dds b/MyCollection/UI/Textures/Weapons/Shield_over.dds new file mode 100644 index 0000000..222e9aa Binary files /dev/null and b/MyCollection/UI/Textures/Weapons/Shield_over.dds differ diff --git a/MyCollection/UI/Textures/Weapons/Shield_up.dds b/MyCollection/UI/Textures/Weapons/Shield_up.dds new file mode 100644 index 0000000..876dd7f Binary files /dev/null and b/MyCollection/UI/Textures/Weapons/Shield_up.dds differ diff --git a/MyCollection/UI/Textures/Weapons/Sword_down.dds b/MyCollection/UI/Textures/Weapons/Sword_down.dds new file mode 100644 index 0000000..8266507 Binary files /dev/null and b/MyCollection/UI/Textures/Weapons/Sword_down.dds differ diff --git a/MyCollection/UI/Textures/Weapons/Sword_over.dds b/MyCollection/UI/Textures/Weapons/Sword_over.dds new file mode 100644 index 0000000..6d1ecf7 Binary files /dev/null and b/MyCollection/UI/Textures/Weapons/Sword_over.dds differ diff --git a/MyCollection/UI/Textures/Weapons/Sword_up.dds b/MyCollection/UI/Textures/Weapons/Sword_up.dds new file mode 100644 index 0000000..d9797b5 Binary files /dev/null and b/MyCollection/UI/Textures/Weapons/Sword_up.dds differ diff --git a/MyCollection/UI/Textures/Weapons/TwoHandedAxe_down.dds b/MyCollection/UI/Textures/Weapons/TwoHandedAxe_down.dds new file mode 100644 index 0000000..df881aa Binary files /dev/null and b/MyCollection/UI/Textures/Weapons/TwoHandedAxe_down.dds differ diff --git a/MyCollection/UI/Textures/Weapons/TwoHandedAxe_over.dds b/MyCollection/UI/Textures/Weapons/TwoHandedAxe_over.dds new file mode 100644 index 0000000..fc1c255 Binary files /dev/null and b/MyCollection/UI/Textures/Weapons/TwoHandedAxe_over.dds differ diff --git a/MyCollection/UI/Textures/Weapons/TwoHandedAxe_up.dds b/MyCollection/UI/Textures/Weapons/TwoHandedAxe_up.dds new file mode 100644 index 0000000..a5c3dac Binary files /dev/null and b/MyCollection/UI/Textures/Weapons/TwoHandedAxe_up.dds differ diff --git a/MyCollection/UI/Textures/Weapons/TwoHandedHammer_down.dds b/MyCollection/UI/Textures/Weapons/TwoHandedHammer_down.dds new file mode 100644 index 0000000..6e56f05 Binary files /dev/null and b/MyCollection/UI/Textures/Weapons/TwoHandedHammer_down.dds differ diff --git a/MyCollection/UI/Textures/Weapons/TwoHandedHammer_over.dds b/MyCollection/UI/Textures/Weapons/TwoHandedHammer_over.dds new file mode 100644 index 0000000..0c69325 Binary files /dev/null and b/MyCollection/UI/Textures/Weapons/TwoHandedHammer_over.dds differ diff --git a/MyCollection/UI/Textures/Weapons/TwoHandedHammer_up.dds b/MyCollection/UI/Textures/Weapons/TwoHandedHammer_up.dds new file mode 100644 index 0000000..3273e0f Binary files /dev/null and b/MyCollection/UI/Textures/Weapons/TwoHandedHammer_up.dds differ diff --git a/MyCollection/UI/Textures/Weapons/TwoHandedSword_down.dds b/MyCollection/UI/Textures/Weapons/TwoHandedSword_down.dds new file mode 100644 index 0000000..5a61ab7 Binary files /dev/null and b/MyCollection/UI/Textures/Weapons/TwoHandedSword_down.dds differ diff --git a/MyCollection/UI/Textures/Weapons/TwoHandedSword_over.dds b/MyCollection/UI/Textures/Weapons/TwoHandedSword_over.dds new file mode 100644 index 0000000..3245d47 Binary files /dev/null and b/MyCollection/UI/Textures/Weapons/TwoHandedSword_over.dds differ diff --git a/MyCollection/UI/Textures/Weapons/TwoHandedSword_up.dds b/MyCollection/UI/Textures/Weapons/TwoHandedSword_up.dds new file mode 100644 index 0000000..f787de1 Binary files /dev/null and b/MyCollection/UI/Textures/Weapons/TwoHandedSword_up.dds differ diff --git a/Namespace.lua b/Namespace.lua deleted file mode 100644 index 0dd8808..0000000 --- a/Namespace.lua +++ /dev/null @@ -1,6 +0,0 @@ -if MyCollection == nil then MyCollection = {} end - -local MyCollection = MyCollection - -MyCollection.Internals = {} -MyCollection.UI = {} \ No newline at end of file diff --git a/Settings.lua b/Settings.lua deleted file mode 100644 index 97a8d6d..0000000 --- a/Settings.lua +++ /dev/null @@ -1 +0,0 @@ -local Dependencies = MyCollection.Internals.Dependencies \ No newline at end of file diff --git a/UI/Controls/AddSet.lua b/UI/Controls/AddSet.lua deleted file mode 100644 index 6617647..0000000 --- a/UI/Controls/AddSet.lua +++ /dev/null @@ -1,102 +0,0 @@ -local Saved = MyCollection.Internals.Saved -local Data = MyCollection.Internals.Data -local Constants = MyCollection.Internals.Constants -local Dependencies = MyCollection.Internals.Dependencies -local Logger = MyCollection.Internals.Dependencies.Logger -local EventManager = MyCollection.Internals.Dependencies.Officials.EventManager -local UI = MyCollection.UI -local Controls = MyCollection.UI.Controls - -Controls.AddSet = {} -Controls.AddSet.__index = Controls.AddSet - -local AddSet = Controls.AddSet - --- Constructor -function AddSet.New(element) - local instance = {} - setmetatable(instance, AddSet) - - instance:Initialize(element) - return instance -end - --- UI containers -AddSet.Element = nil - --- Sub Elements -AddSet.Label = nil -AddSet.OrderNumber = nil - --- Selectors -AddSet.ArmorSelector = nil -AddSet.SetSelector = nil - --- Functions - -function AddSet:Initialize(element) - self.Element = element - - -- Set Selector - self.SetSelector = ZO_ComboBox_ObjectFromContainer(self.Element:GetNamedChild("Selector")) - - self.SetSelector:SetSortsItems(true) - self.SetSelector:ClearItems() - - for key, _ in pairs(Dependencies.LibSets.GetAllSetIds()) do - local name = Dependencies.LibSets.GetSetName(key) - local entry = ZO_ComboBox:CreateItemEntry(name, function () end) - entry.id = key - self.SetSelector:AddItem(entry, ZO_COMBOBOX_SUPRESS_UPDATE) - end - - self.SetSelector:SetSortOrder(ZO_SORT_ORDER_UP, ZO_SORT_BY_NAME) - self.SetSelector:SetHeight(500) - - self.SetSelector:SelectFirstItem() - - -- Armor Type selector - local armorTypeSelectorElement = self.Element:GetNamedChild("ArmorType") - self.ArmorSelector = ZO_RadioButtonGroup:New() - - local lightButton = self.Element:GetNamedChild("Light") - lightButton.armorType = Constants.ArmorTypes.Light - self.ArmorSelector:Add(lightButton) - - local mediumButton = self.Element:GetNamedChild("Medium") - mediumButton.armorType = Constants.ArmorTypes.Medium - self.ArmorSelector:Add(mediumButton) - - local heavyButton = self.Element:GetNamedChild("Heavy") - heavyButton.armorType = Constants.ArmorTypes.Heavy - self.ArmorSelector:Add(heavyButton) - - self.ArmorSelector:SetClickedButton(lightButton) - - -- Order Number - self.OrderNumber = self.Element:GetNamedChild("OrderNumber"):GetNamedChild("Box") - self.OrderNumber:SetTextType(TEXT_TYPE_NUMERIC_UNSIGNED_INT) - self.OrderNumber:SetMaxInputChars(4) - self.OrderNumber:SetText(0) - - -- Add Button - local addButton = self.Element:GetNamedChild("Add") - addButton:SetHandler("OnMouseUp", AddSet.OnMouseUpItem) -end - -function AddSet.OnMouseUpItem(control, button, upInside) - local addSetMenu = UI.Frame.AddSet - - if (upInside) then - if (button == MOUSE_BUTTON_INDEX_LEFT) then - local setId = addSetMenu.SetSelector:GetSelectedItemData().id - local armorType = addSetMenu.ArmorSelector:GetClickedButton().armorType - local orderNumber = tonumber(addSetMenu.OrderNumber:GetText()) - Data.Collection:AddSet(setId, armorType, orderNumber) - UI.Frame.MenuBar:DefaultPage() - end - end -end - --- https://esoapi.uesp.net/100031/src/libraries/zo_combobox/zo_combobox.lua.html --- https://esodata.uesp.net/100031/src/libraries/utility/zo_radiobuttongroup.lua.html \ No newline at end of file diff --git a/UI/Controls/Grid.lua b/UI/Controls/Grid.lua deleted file mode 100644 index 9f719af..0000000 --- a/UI/Controls/Grid.lua +++ /dev/null @@ -1,312 +0,0 @@ -local Saved = MyCollection.Internals.Saved -local Data = MyCollection.Internals.Data -local Constants = MyCollection.Internals.Constants -local Extensions = MyCollection.Internals.Functions.Extensions -local Dependencies = MyCollection.Internals.Dependencies -local Logger = MyCollection.Internals.Dependencies.Logger -local EventManager = MyCollection.Internals.Dependencies.Officials.EventManager -local UI = MyCollection.UI -local Controls = MyCollection.UI.Controls - -Controls.Grid = ZO_SortFilterList:Subclass() ---Controls.Grid.__index = Controls.Grid - -local Grid = Controls.Grid -local MYCOLLECTION_DATA = 1 -local MYCOLLECTION_SORTTYPE = 1 -local MYCOLLECTION_MAX_ORDER = 10001 - --- Constructor -function Grid:New(element) - local instance = ZO_SortFilterList.New(self, element) - - instance:Setup(element) - return instance -end - --- UI containers -Grid.Element = nil - --- Sub Elements -Grid.SearchBox = nil - --- Properties - --- Functions -function Grid:Setup(element) - - self.Element = element - - ZO_ScrollList_AddDataType(self.list, MYCOLLECTION_DATA, "MyCollectionUIGridRow", 95, function(control, data) self:SetupItemRow(control, data) end, nil, nil, - function (control) - for i=1, control:GetNamedChild("Items"):GetNumChildren(), 1 do - local item = control:GetNamedChild("Items"):GetChild(i) - item.reference = nil - item.itemLink = nil - item.itemType = nil - item:SetPressedTexture() - item:SetMouseOverTexture() - end - ZO_ObjectPool_DefaultResetControl(control) - end) - ZO_ScrollList_EnableHighlight(self.list, "ZO_ThinListHighlight") - self:SetAlternateRowBackgrounds(true) - - self.masterList = {} - - local sortKeys = { - ["key"] = { isNumeric = true }, - ["order"] = { isNumeric = true, tiebreaker = "key", tieBreakerSortOrder = ZO_SORT_ORDER_UP }, - ["set"] = { caseInsensitive = true, tiebreaker = "order", tieBreakerSortOrder = ZO_SORT_ORDER_DOWN }, - ["completition"] = { isNumeric = true, tiebreaker = "order", tieBreakerSortOrder = ZO_SORT_ORDER_DOWN }, - } - - self.currentSortKey = "order" - self.currentSortOrder = ZO_SORT_ORDER_UP - self.sortHeaderGroup:SelectAndResetSortForKey(self.currentSortKey) - self.sortFunction = function( listEntry1, listEntry2 ) - return ZO_TableOrderingFunction(listEntry1.data, listEntry2.data, self.currentSortKey, sortKeys, self.currentSortOrder) - end - - -- setup searcj - self.SearchBox = self.Element:GetNamedChild("SearchBox") - self.SearchBox:SetHandler("OnTextChanged", function() self:RefreshFilters() end) - self.search = ZO_StringSearch:New() - self.search:AddProcessor(MYCOLLECTION_SORTTYPE, function(stringSearch, data, searchTerm, cache) return(self:ProcessItemEntry(stringSearch, data, searchTerm, cache)) end) -end - -function Grid:SetupItemRow( control, data ) - control.data = data - - -- For default ordering - local key = control:GetNamedChild("Key") - - local order = control:GetNamedChild("Order") - order.normalColor = ZO_DEFAULT_TEXT - if data.order < MYCOLLECTION_MAX_ORDER then - order:SetText(data.order) - else - order:SetText(nil) - end - - local set = control:GetNamedChild("Set") - set.normalColor = ZO_DEFAULT_TEXT - set:SetText(data.set) - - local items = control:GetNamedChild("Items") - - -- Set Item icons - for key, typeId in pairs(Constants.EquipTypes.Armors) do - local piece = items:GetNamedChild(key) - local setPiece = data.reference:GetArmorPiece(typeId) - piece.reference = setPiece - if setPiece:HasItem() then - local link = setPiece:GetReferences()[next(setPiece:GetReferences())]:GetLink() - piece:SetNormalTexture(Dependencies.Officials.GetItemLinkIcon(link)) - piece.itemLink = link - else - piece:SetNormalTexture("MyCollection/UI/Textures/Apparel/".. key .."_up.dds") - piece:SetPressedTexture("MyCollection/UI/Textures/Apparel/".. key .."_down.dds") - piece:SetMouseOverTexture("MyCollection/UI/Textures/Apparel/".. key .."_over.dds") - piece.itemType = key - end - piece.traitId = setPiece.traitType - piece.traitType = "ARMOR" - piece.traitOptions = Constants.TraitTypes.Armor - piece:SetHandler("OnMouseEnter", Grid.OnMouseEnterItem) - piece:SetHandler("OnMouseExit", Grid.OnMouseExitItem) - piece:SetHandler("OnMouseUp", Grid.OnMouseUpItem) - end - for key, typeId in pairs(Constants.EquipTypes.Jewelleries) do - local piece = items:GetNamedChild(key) - local setPiece = data.reference:GetJewelleryPiece(typeId) - piece.reference = setPiece - if setPiece:HasItem() then - local link = setPiece:GetReferences()[next(setPiece:GetReferences())]:GetLink() - piece:SetNormalTexture(Dependencies.Officials.GetItemLinkIcon(link)) - piece.itemLink = link - else - piece:SetNormalTexture("MyCollection/UI/Textures/Apparel/".. key .."_up.dds") - piece:SetPressedTexture("MyCollection/UI/Textures/Apparel/".. key .."_down.dds") - piece:SetMouseOverTexture("MyCollection/UI/Textures/Apparel/".. key .."_over.dds") - piece.itemType = key - end - piece.traitId = setPiece.traitType - piece.traitType = "JEWELLERY" - piece.traitOptions = Constants.TraitTypes.Jewelleries - piece:SetHandler("OnMouseEnter", Grid.OnMouseEnterItem) - piece:SetHandler("OnMouseExit", Grid.OnMouseExitItem) - piece:SetHandler("OnMouseUp", Grid.OnMouseUpItem) - end - for key, typeId in pairs(Constants.WeaponTypes) do - local piece = items:GetNamedChild(key) - local setPiece = data.reference:GetWeaponPiece(typeId) - piece.reference = setPiece - if setPiece:HasItem() then - local link = setPiece:GetReferences()[next(setPiece:GetReferences())]:GetLink() - piece:SetNormalTexture(Dependencies.Officials.GetItemLinkIcon(link)) - piece.itemLink = link - else - piece:SetNormalTexture("MyCollection/UI/Textures/Weapons/".. key .."_up.dds") - piece:SetPressedTexture("MyCollection/UI/Textures/Weapons/".. key .."_down.dds") - piece:SetMouseOverTexture("MyCollection/UI/Textures/Weapons/".. key .."_over.dds") - piece.itemType = key - end - piece.traitId = setPiece.traitType - piece.traitType = "WEAPON" - piece.traitOptions = Constants.TraitTypes.Weapons - piece:SetHandler("OnMouseEnter", Grid.OnMouseEnterItem) - piece:SetHandler("OnMouseExit", Grid.OnMouseExitItem) - piece:SetHandler("OnMouseUp", Grid.OnMouseUpItem) - end - - - ZO_SortFilterList.SetupRow(self, control, data) -end - -function Grid:ProcessItemEntry( stringSearch, data, searchTerm, cache ) - if - zo_plainstrfind(data.set:lower(), searchTerm) - then - return true - end - - return false -end - -function Grid:BuildMasterList() - self.masterList = {} - local sets = Data.Collection:GetSets() - for key, set in pairs(sets) do - local new = { - type = MYCOLLECTION_SORTTYPE, - key = key, - order = sets[key]:GetOrderNumber(), - set = sets[key]:GetSetName(), - completition = sets[key]:Completition(), - reference = sets[key], - referenceId = key, - } - if new.order == nil then - new.order = MYCOLLECTION_MAX_ORDER - end - table.insert(self.masterList, new) - end - -end - -function Grid:FilterScrollList() - local scrollData = ZO_ScrollList_GetDataList(self.list) - ZO_ClearNumericallyIndexedTable(scrollData) - - local searchInput = self.SearchBox:GetText() - - for i, data in ipairs(self.masterList) do - if - searchInput == "" or - self.search:IsMatch(searchInput, data) - then - table.insert(scrollData, ZO_ScrollList_CreateDataEntry(MYCOLLECTION_DATA, data)) - end - end -end - -function Grid:SortScrollList() - if (self.currentSortKey ~= nil and self.currentSortOrder ~= nil) then - local scrollData = ZO_ScrollList_GetDataList(self.list) - table.sort(scrollData, self.sortFunction) - end - - self:RefreshVisible() -end - -function Grid:ShowContextMenu( control ) - ClearMenu() - AddMenuItem(GetString(MYCOLLECTION_CONTEXT_REMOVE), function () - Data.Collection:RemoveSet(control.data.referenceId) - self:RefreshData() - end) - AddMenuItem(GetString(MYCOLLECTION_CONTEXT_CHANGEORDER), function () - ZO_Dialogs_ShowDialog("MyCollection_SetOrderNumber", - { - currentSet = control.data.reference, - }, - { - initialEditText = control.data.order - } - ) - end) - self:ShowMenu(control) -end - -function Grid:ShowTraitMenu( control ) - ClearMenu() - - AddMenuItem("None", function () - control.reference:SetTrait(0) - control.traitName = GetString(traitTextId) - self:RefreshData() - end) - - for key, trait in pairs(control.traitOptions) do - local traitTextId = _G["MYCOLLECTION_TRAIT_".. control.traitType .. "_" .. key:upper()] - AddMenuItem(GetString(traitTextId), function () - control.reference:SetTrait(trait) - control.traitName = GetString(traitTextId) - self:RefreshData() - end) - end - - self:ShowMenu(control) -end - --- Event static functions -function Grid.OnMouseEnterItem(control) - if control.itemLink ~= nil then - InitializeTooltip(ItemTooltip, control, TOPRIGHT, -100, 0, TOPLEFT) - ItemTooltip:SetLink(control.itemLink) - ZO_Tooltip_AddDivider(ItemTooltip) - ItemTooltip:AddLine("Current trait filter: ".. Extensions.Constants.GetTraitName(control.traitId)) - else - ZO_Tooltips_ShowTextTooltip(control, TOP, control.itemType .. " (" .. Extensions.Constants.GetTraitName(control.traitId) .. ")") - end -end - -function Grid.OnMouseExitItem(control) - ClearTooltip(ItemTooltip) - ZO_Tooltips_HideTextTooltip() -end - -function Grid.OnMouseUpItem(control, button, upInside) - if (upInside) then - if (button == MOUSE_BUTTON_INDEX_RIGHT) then - UI.Frame.Grid:ShowTraitMenu(control) - end - end -end - -function Grid.OnMouseUp(control, button, upInside) - if (upInside) then - if (button == MOUSE_BUTTON_INDEX_RIGHT) then - UI.Frame.Grid:ShowContextMenu(control) - end - end -end - -function Grid.OnMouseEnter(control) - UI.Frame.Grid:Row_OnMouseEnter(control) -end - -function Grid.OnMouseExit(control) - UI.Frame.Grid:Row_OnMouseExit(control) - -end - - --- https://esoapi.uesp.net/100020/src/libraries/zo_tooltip/zo_tooltip.lua.html#624 --- https://esoapi.uesp.net/100020/src/libraries/zo_templates/tooltip.lua.html#64 --- https://esoapi.uesp.net/current/src/libraries/zo_contextmenus/zo_contextmenus.lua.html#266 --- https://esoapi.uesp.net/current/src/libraries/zo_sortfilterlist/zo_sortfilterlist.lua.html --- https://esoapi.uesp.net/current/src/libraries/zo_menubar/zo_menubar.lua.html#656 --- https://esoapi.uesp.net/100031/src/libraries/zo_templates/scrolltemplates.lua.html --- https://esoapi.uesp.net/current/src/libraries/zo_dialog/zo_dialog.lua.html#394 \ No newline at end of file diff --git a/UI/Controls/MenuBar.lua b/UI/Controls/MenuBar.lua deleted file mode 100644 index 89506e7..0000000 --- a/UI/Controls/MenuBar.lua +++ /dev/null @@ -1,68 +0,0 @@ -local Saved = MyCollection.Internals.Saved -local Logger = MyCollection.Internals.Dependencies.Logger -local EventManager = MyCollection.Internals.Dependencies.Officials.EventManager -local UI = MyCollection.UI -local Controls = MyCollection.UI.Controls - -Controls.MenuBar = {} -Controls.MenuBar.__index = Controls.MenuBar - -local MenuBar = Controls.MenuBar - --- Constructor -function MenuBar.New(element) - local instance = {} - setmetatable(instance, MenuBar) - - instance:Initialize(element) - return instance -end - --- UI containers -MenuBar.Element = nil - --- Sub Elements -MenuBar.Label = nil - --- Properties - --- Functions - -function MenuBar:DefaultPage() - ZO_MenuBar_SelectDescriptor(self.Element, UI.Frame.modes.grid, true) - UI.Frame:RefreshUI() -end - -function MenuBar:Initialize(element) - self.Element = element - - ZO_MenuBar_AddButton(self.Element, { - descriptor = UI.Frame.modes.grid, - categoryName = MYCOLLECTION_MENU_GRID, - normal = "EsoUI/Art/Guild/tabIcon_roster_up.dds", - pressed = "EsoUI/Art/Guild/tabIcon_roster_down.dds", - highlight = "EsoUI/Art/Guild/tabIcon_roster_over.dds", - callback = MenuBar.HandleMenuSwitch, - }) - - ZO_MenuBar_AddButton(self.Element, { - descriptor = UI.Frame.modes.new, - categoryName = MYCOLLECTION_MENU_ADD, - normal = "EsoUI/Art/Inventory/inventory_tabIcon_crafting_up.dds", - pressed = "EsoUI/Art/Inventory/inventory_tabIcon_crafting_down.dds", - highlight = "EsoUI/Art/Inventory/inventory_tabIcon_crafting_over.dds", - callback = MenuBar.HandleMenuSwitch, - }) -end - -function MenuBar.HandleMenuSwitch(button) - local label = "" - if button.descriptor ~= UI.Frame.modes.new then - label = "List" - else - label = "Add set" - end - UI.Frame.MenuBar.Element:GetNamedChild("Label"):SetText(label) - UI.Frame.Grid.Element:SetHidden(button.descriptor ~= UI.Frame.modes.grid) - UI.Frame.AddSet.Element:SetHidden(button.descriptor ~= UI.Frame.modes.new) -end \ No newline at end of file diff --git a/UI/Frame.lua b/UI/Frame.lua deleted file mode 100644 index 9b701ac..0000000 --- a/UI/Frame.lua +++ /dev/null @@ -1,152 +0,0 @@ -local Saved = MyCollection.Internals.Saved -local Constants = MyCollection.Internals.Constants -local Dependencies = MyCollection.Internals.Dependencies -local Logger = MyCollection.Internals.Dependencies.Logger -local EventManager = MyCollection.Internals.Dependencies.Officials.EventManager -local SceneManager = MyCollection.Internals.Dependencies.Officials.SceneManager -local SlashCommands = MyCollection.Internals.Dependencies.Officials.SlashCommands -local UI = MyCollection.UI -local Controls = MyCollection.UI.Controls - -UI.Frame = {} -UI.Frame.__index = UI.Frame - -local Frame = UI.Frame - --- UI containers -Frame.Element = nil - --- Sub Elements -Frame.MenuBar = nil -Frame.Grid = nil -Frame.AddSet = nil - --- Properties -Frame.initialized = false -Frame.scene = nil -Frame.sceneName = nil - -Frame.modes = { - grid = 1, - new = 2, -} - --- Functions -function Frame.ShowSettings() - Frame.ToggleOpenClose() - --Dependencies.LibAddonMenu:OpenToPanel(addOnPanel) -end - -function Frame.ToggleOpenClose() - Dependencies.LibMainMenu:Refresh() - Dependencies.LibMainMenu:SelectMenuItem(MyCollection.Name) -end - -function Frame.OnReposition() - Saved.Settings.Window.Position.Left = Frame.Element:GetLeft() - Saved.Settings.Window.Position.Top = Frame.Element:GetTop() -end - -function Frame.SetPosition() - local left = Saved.Settings.Window.Position.Left - local top = Saved.Settings.Window.Position.Top - - Frame.Element:ClearAnchors() - Frame.Element:SetAnchor(TOPLEFT, GuiRoot, TOPLEFT, left, top) -end - -function Frame:RefreshUI() - if (not self.initialized) then return end - - Frame.Grid:RefreshData() -end - -function Frame.Initialize() - if Frame.initialized then return end - - Frame.initialized = true - Frame.Element = MyCollectionUIFrame - Frame.sceneName = MyCollection.Name .. "Scene" - - Frame.scene = ZO_Scene:New(Frame.sceneName, SceneManager) - Frame.scene:AddFragment(ZO_SetTitleFragment:New(MYCOLLECTION_TITLE)) - Frame.scene:AddFragment(ZO_FadeSceneFragment:New(Frame.Element)) - Frame.scene:AddFragment(TITLE_FRAGMENT) - Frame.scene:AddFragment(RIGHT_BG_FRAGMENT) - Frame.scene:AddFragment(FRAME_EMOTE_FRAGMENT_MAP) - Frame.scene:AddFragment(CODEX_WINDOW_SOUNDS) - Frame.scene:AddFragment(PLAYER_PROGRESS_BAR_FRAGMENT) - Frame.scene:AddFragmentGroup(FRAGMENT_GROUP.MOUSE_DRIVEN_UI_WINDOW) - --Frame.scene:AddFragmentGroup(FRAGMENT_GROUP.FRAME_TARGET_CENTERED) - Frame.scene:AddFragmentGroup(FRAGMENT_GROUP.PLAYER_PROGRESS_BAR_KEYBOARD_CURRENT) - - Frame.Grid = Controls.Grid:New(Frame.Element:GetNamedChild("Grid")) - Frame.AddSet = Controls.AddSet.New(Frame.Element:GetNamedChild("AddSet")) - Frame.MenuBar = Controls.MenuBar.New(Frame.Element:GetNamedChild("MenuBar")) - Frame.MenuBar:DefaultPage() - - Dependencies.LibMainMenu:Init() - - -- Add to main menu - local categoryLayoutInfo = { - binding = "MYCOLLECTION_MENU_TOGGLE", - categoryName = MYCOLLECTION_NAME, - callback = function(buttonData) - if not SceneManager:IsShowing(Frame.sceneName) then - SceneManager:Show(Frame.sceneName) - Frame:RefreshUI() - else - SceneManager:ShowBaseScene() - end - end, - visible = function(buttonData) - return true - end, - - normal = "esoui/art/collections/collections_tabicon_outfitstyles_up.dds", - pressed = "esoui/art/collections/collections_tabicon_outfitstyles_down.dds", - highlight = "esoui/art/collections/collections_tabicon_outfitstyles_over.dds", - disabled = "esoui/art/collections/collections_tabicon_outfitstyles_up.dds" - } - Dependencies.LibMainMenu:AddMenuItem(MyCollection.Name, Frame.sceneName, categoryLayoutInfo, nil) - - SlashCommands["/mycollection"] = Frame.ToggleOpenClose - - Frame.InitDialogs() -end - -function Frame.InitDialogs() - -- Dialogs - ESO_Dialogs["MyCollection_SetOrderNumber"] = { - title = { - text = "Set Ordering number", - }, - mainText = { - text = "Custom ordering number for the tracked set. This is the default ordering value.", - }, - --updateFn = function (dialog) d("uodate") d(dialog) d(self) end, - --callback = function (dialog) d("setup") d(dialog) d(self) end, - editBox = { - textType = TEXT_TYPE_NUMERIC_UNSIGNED_INT, - maxInputCharacters = 4, - defaultText = 0, - }, - buttons = { - [1] = { - text = "Set", - visible = true, - callback = function (dialog) - dialog.data.currentSet:SetOrderNumber(tonumber(ZO_Dialogs_GetEditBoxText(dialog))) - UI.Frame.Grid:RefreshData() - end, - }, - [2] = { - text = "Cancel", - visible = true, - callback = function (dialog) end, - }, - }, - } - - -end \ No newline at end of file diff --git a/UI/Frame.xml b/UI/Frame.xml deleted file mode 100644 index 173b886..0000000 --- a/UI/Frame.xml +++ /dev/null @@ -1,259 +0,0 @@ -<?xml version="1.0"?> -<GuiXml> - <Controls> - <Control name="MyCollectionUIItemsBase" virtual="true"> - <Dimensions x="600" y="95" /> - <Controls> - <Button name="$(parent)Head"> - <Anchor point="TOPLEFT" relativePoint="TOPLEFT" offsetX="10" offsetY="5" /> - <Dimensions x="40" y="40" /> - </Button> - <Button name="$(parent)Chest"> - <Anchor point="TOPLEFT" relativePoint="TOPLEFT" offsetX="45" relativeTo="$(parent)Head" /> - <Dimensions x="40" y="40" /> - </Button> - <Button name="$(parent)Shoulders"> - <Anchor point="TOPLEFT" relativePoint="TOPLEFT" offsetX="45" relativeTo="$(parent)Chest" /> - <Dimensions x="40" y="40" /> - </Button> - <Button name="$(parent)Waist"> - <Anchor point="TOPLEFT" relativePoint="TOPLEFT" offsetX="45" relativeTo="$(parent)Shoulders" /> - <Dimensions x="40" y="40" /> - </Button> - <Button name="$(parent)Legs"> - <Anchor point="TOPLEFT" relativePoint="TOPLEFT" offsetX="45" relativeTo="$(parent)Waist" /> - <Dimensions x="40" y="40" /> - </Button> - <Button name="$(parent)Feet"> - <Anchor point="TOPLEFT" relativePoint="TOPLEFT" offsetX="45" relativeTo="$(parent)Legs" /> - <Dimensions x="40" y="40" /> - </Button> - <Button name="$(parent)Hand"> - <Anchor point="TOPLEFT" relativePoint="TOPLEFT" offsetX="45" relativeTo="$(parent)Feet" /> - <Dimensions x="40" y="40" /> - </Button> - - <Button name="$(parent)Neck"> - <Anchor point="TOPLEFT" relativePoint="TOPLEFT" offsetX="90" relativeTo="$(parent)Hand" /> - <Dimensions x="40" y="40" /> - </Button> - <Button name="$(parent)Ring"> - <Anchor point="TOPLEFT" relativePoint="TOPLEFT" offsetX="45" relativeTo="$(parent)Neck" /> - <Dimensions x="40" y="40" /> - </Button> - - <Button name="$(parent)Shield"> - <Anchor point="TOPLEFT" relativePoint="TOPLEFT" offsetX="90" relativeTo="$(parent)Ring" /> - <Dimensions x="40" y="40" /> - </Button> - - <Button name="$(parent)Axe"> - <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" offsetX="10" offsetY="-5" /> - <Dimensions x="40" y="40" /> - </Button> - <Button name="$(parent)Hammer"> - <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" offsetX="45" relativeTo="$(parent)Axe" /> - <Dimensions x="40" y="40" /> - </Button> - <Button name="$(parent)Sword"> - <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" offsetX="45" relativeTo="$(parent)Hammer" /> - <Dimensions x="40" y="40" /> - </Button> - <Button name="$(parent)TwoHandedSword"> - <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" offsetX="45" relativeTo="$(parent)Sword" /> - <Dimensions x="40" y="40" /> - </Button> - <Button name="$(parent)TwoHandedAxe"> - <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" offsetX="45" relativeTo="$(parent)TwoHandedSword" /> - <Dimensions x="40" y="40" /> - </Button> - <Button name="$(parent)TwoHandedHammer"> - <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" offsetX="45" relativeTo="$(parent)TwoHandedAxe" /> - <Dimensions x="40" y="40" /> - </Button> - <Button name="$(parent)Bow"> - <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" offsetX="45" relativeTo="$(parent)TwoHandedHammer" /> - <Dimensions x="40" y="40" /> - </Button> - <Button name="$(parent)HealingStaff"> - <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" offsetX="45" relativeTo="$(parent)Bow" /> - <Dimensions x="40" y="40" /> - </Button> - <Button name="$(parent)Dagger"> - <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" offsetX="45" relativeTo="$(parent)HealingStaff" /> - <Dimensions x="40" y="40" /> - </Button> - <Button name="$(parent)FireStaff"> - <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" offsetX="45" relativeTo="$(parent)Dagger" /> - <Dimensions x="40" y="40" /> - </Button> - <Button name="$(parent)FrostStaff"> - <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" offsetX="45" relativeTo="$(parent)FireStaff" /> - <Dimensions x="40" y="40" /> - </Button> - <Button name="$(parent)LightningStaff"> - <Anchor point="BOTTOMLEFT" relativePoint="BOTTOMLEFT" offsetX="45" relativeTo="$(parent)FrostStaff" /> - <Dimensions x="40" y="40" /> - </Button> - </Controls> - </Control> - <Label name="MyCollectionUIRowLabel" font="ZoFontGame" wrapMode="ELLIPSIS" horizontalAlignment="LEFT" verticalAlignment="CENTER" virtual="true" /> - <Control name="MyCollectionUIGridRow" mouseEnabled="true" virtual="true"> - <Dimensions y="95" /> - <OnMouseUp> - MyCollection.UI.Controls.Grid.OnMouseUp(self, button, upInside) - </OnMouseUp> - <OnMouseEnter> - MyCollection.UI.Controls.Grid.OnMouseEnter(self) - </OnMouseEnter> - <OnMouseExit> - MyCollection.UI.Controls.Grid.OnMouseExit(self) - </OnMouseExit> - <Controls> - <Texture name="$(parent)BG" inherits="ZO_ThinListBgStrip" /> - <Label name="$(parent)Key" inherits="MyCollectionUIRowLabel"> - <Anchor point="LEFT" /> - <Dimensions x="0" y="95" /> - </Label> - <Label name="$(parent)Order" inherits="MyCollectionUIRowLabel"> - <Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$(parent)Key" /> - <Dimensions x="50" y="95" /> - </Label> - <Label name="$(parent)Set" inherits="MyCollectionUIRowLabel"> - <Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$(parent)Order" /> - <Dimensions x="190" y="95" /> - </Label> - <Label name="$(parent)Completition" inherits="MyCollectionUIRowLabel"> - <Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$(parent)Set" /> - <Dimensions x="0" y="95" /> - </Label> - <Control name="$(parent)Items" inherits="MyCollectionUIItemsBase"> - <Anchor point="LEFT" relativePoint="RIGHT" relativeTo="$(parent)Completition" /> - <Dimensions x="600" y="95" /> - </Control> - </Controls> - </Control> - - <TopLevelControl name="MyCollectionUIFrame" hidden="true" inherits="ZO_RightPanelFootPrint"> - <Controls> - <Control name="$(parent)MenuBar" inherits="ZO_LabelButtonBar"> - <Anchor point="BOTTOMRIGHT" relativePoint="TOPRIGHT" offsetX="-27" offsetY="-12" /> - </Control> - - <Control name="$(parent)AddSet"> - <Anchor point="TOPLEFT" relativePoint="TOPLEFT" /> - <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" /> - <Controls> - <Backdrop name="$(parent)OrderNumber" tier="HIGH" inherits="ZO_SingleLineEditBackdrop_Keyboard"> - <Anchor point="TOPLEFT" relativePoint="TOPLEFT" offsetX="110" offsetY="40" /> - <Dimensions x="250" /> - <Controls> - <EditBox name="$(parent)Box" inherits="ZO_DefaultEditForBackdrop ZO_EditDefaultText" /> - </Controls> - </Backdrop> - <Label name="$(parent)OrderNumberLabel" text="MYCOLLECTION_ADDMENU_ORDERNUMBER_LABEL" font="ZoFontGameLargeBold" color="INTERFACE_COLOR_TYPE_TEXT_COLORS:INTERFACE_TEXT_COLOR_NORMAL"> - <Anchor point="RIGHT" relativePoint="LEFT" relativeTo="$(parent)OrderNumber" offsetX="-8" /> - </Label> - - - <Label name="$(parent)SelectorLabel" font="ZoFontGame" horizontalAlignment="LEFT" verticalAlignment="TOP" text="MYCOLLECTION_ADDMENU_SELECTOR_LABEL"> - <Dimensions x="100" y="30" /> - <Anchor point="TOPLEFT" offsetY="50" relativeTo="$(parent)OrderNumberLabel" /> - </Label> - <Control name="$(parent)Selector" inherits="ZO_ScrollableComboBox"> - <Dimensions x="400" y="30" /> - <Anchor point="TOPLEFT" relativeTo="$(parent)SelectorLabel" offsetX="110" /> - </Control> - - <Label name="$(parent)ArmorType" font="ZoFontGame" horizontalAlignment="LEFT" text="MYCOLLECTION_ADDMENU_ARMORTYPE_LABEL"> - <Dimensions x="100" y="30" /> - <Anchor point="TOPLEFT" relativePoint="TOPLEFT" offsetY="50" relativeTo="$(parent)SelectorLabel" /> - </Label> - <Button name="$(parent)Light" inherits="ZO_DefaultButton" hidden="false" text="MYCOLLECTION_ADDMENU_ARMORTYPE_LIGHT"> - <Anchor point="TOPLEFT" relativePoint="TOPLEFT" offsetX="50" offsetY="50" relativeTo="$(parent)ArmorType" /> - <Dimensions x="175" y="40" /> - </Button> - <Button name="$(parent)Medium" inherits="ZO_DefaultButton" hidden="false" text="MYCOLLECTION_ADDMENU_ARMORTYPE_MEDIUM"> - <Anchor point="TOPLEFT" relativePoint="TOPLEFT" offsetY="50" relativeTo="$(parent)Light" /> - <Dimensions x="175" y="40" /> - </Button> - <Button name="$(parent)Heavy" inherits="ZO_DefaultButton" hidden="false" text="MYCOLLECTION_ADDMENU_ARMORTYPE_HEAVY"> - <Anchor point="TOPLEFT" relativePoint="TOPLEFT" offsetY="50" relativeTo="$(parent)Medium" /> - <Dimensions x="175" y="40" /> - </Button> - - <Button name="$(parent)Add" inherits="ZO_DefaultButton" hidden="false" text="MYCOLLECTION_ADDMENU_ADD"> - <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" offsetY="50" /> - <Dimensions x="175" y="40" /> - </Button> - </Controls> - </Control> - - <Control name="$(parent)Grid"> - <Anchor point="TOPLEFT" relativePoint="TOPLEFT" /> - <Anchor point="BOTTOMRIGHT" relativePoint="BOTTOMRIGHT" /> - <Controls> - <Backdrop name="$(parent)Search" tier="HIGH" inherits="ZO_SingleLineEditBackdrop_Keyboard"> - <Anchor point="TOPRIGHT" relativeTo="TOPRIGHT" relativePoint="TOPRIGHT" offsetX="-38" offsetY="14" /> - <Dimensions x="250" /> - <Controls> - <EditBox name="$(parent)Box" inherits="ZO_DefaultEditForBackdrop ZO_EditDefaultText" /> - </Controls> - </Backdrop> - <Label name="$(parent)SearchLabel" text="MYCOLLECTION_SEARCH_LABEL" font="ZoFontGameLargeBold" color="INTERFACE_COLOR_TYPE_TEXT_COLORS:INTERFACE_TEXT_COLOR_NORMAL"> - <Anchor point="RIGHT" relativePoint="LEFT" relativeTo="$(parent)Search" offsetX="-8" /> - </Label> - - <Control name="$(parent)Headers"> - <Anchor point="TOPLEFT" offsetX="30" offsetY="51" /> - <Anchor point="TOPRIGHT" offsetY="51" /> - <Dimensions y="32" /> - <Controls> - <Control name="$(parent)Key" inherits="ZO_SortHeader"> - <OnInitialized> - ZO_SortHeader_Initialize(self, GetString(MYCOLLECTION_HEADERS_ORDER), "key", ZO_SORT_ORDER_UP, TEXT_ALIGN_LEFT, "ZoFontGameLargeBold") - </OnInitialized> - <Anchor point="TOPLEFT" /> - <Dimensions x="0" y="32" /> - </Control> - <Control name="$(parent)Order" inherits="ZO_SortHeader"> - <OnInitialized> - ZO_SortHeader_Initialize(self, GetString(MYCOLLECTION_HEADERS_ORDER), "order", ZO_SORT_ORDER_UP, TEXT_ALIGN_LEFT, "ZoFontGameLargeBold") - </OnInitialized> - <Anchor point="TOPLEFT" relativePoint="TOPRIGHT" relativeTo="$(parent)Key" /> - <Dimensions x="50" y="32" /> - </Control> - <Control name="$(parent)Set" inherits="ZO_SortHeader"> - <OnInitialized> - ZO_SortHeader_Initialize(self, GetString(MYCOLLECTION_HEADERS_SET), "set", ZO_SORT_ORDER_UP, TEXT_ALIGN_LEFT, "ZoFontGameLargeBold") - </OnInitialized> - <Anchor point="TOPLEFT" relativePoint="TOPRIGHT" relativeTo="$(parent)Order" /> - <Dimensions x="190" y="32" /> - </Control> - <Control name="$(parent)Completition" inherits="ZO_SortHeader"> - <OnInitialized> - ZO_SortHeader_Initialize(self, GetString(MYCOLLECTION_HEADERS_ITEMS), "completition", ZO_SORT_ORDER_DOWN, TEXT_ALIGN_LEFT, "ZoFontGameLargeBold") - </OnInitialized> - <Anchor point="TOPLEFT" relativePoint="TOPRIGHT" relativeTo="$(parent)Set" /> - <Dimensions x="600" y="32" /> - </Control> - <Control name="$(parent)Items" inherits="ZO_SortHeader"> - <OnInitialized> - ZO_SortHeader_Initialize(self, "", "items", ZO_SORT_ORDER_DOWN, TEXT_ALIGN_RIGHT, "ZoFontGameLargeBold") - </OnInitialized> - <Anchor point="TOPLEFT" relativePoint="TOPRIGHT" relativeTo="$(parent)Completition" /> - <Dimensions x="0" y="32" /> - </Control> - </Controls> - </Control> - - <Control name="$(parent)List" inherits="ZO_ScrollList"> - <Anchor point="TOPLEFT" relativeTo="$(parent)Headers" relativePoint="BOTTOMLEFT" offsetY="3" /> - <Anchor point="BOTTOMRIGHT" offsetX="-35" offsetY="-32" /> - </Control> - </Controls> - </Control> - </Controls> - </TopLevelControl> - </Controls> -</GuiXml> \ No newline at end of file diff --git a/UI/Internals b/UI/Internals deleted file mode 100644 index e69de29..0000000 diff --git a/UI/Namespaces.lua b/UI/Namespaces.lua deleted file mode 100644 index b89af62..0000000 --- a/UI/Namespaces.lua +++ /dev/null @@ -1,3 +0,0 @@ -local UI = MyCollection.UI - -UI.Controls = {} \ No newline at end of file diff --git a/UI/Textures/Apparel/Chest_down.dds b/UI/Textures/Apparel/Chest_down.dds deleted file mode 100644 index 682c5e3..0000000 Binary files a/UI/Textures/Apparel/Chest_down.dds and /dev/null differ diff --git a/UI/Textures/Apparel/Chest_over.dds b/UI/Textures/Apparel/Chest_over.dds deleted file mode 100644 index 53f8eba..0000000 Binary files a/UI/Textures/Apparel/Chest_over.dds and /dev/null differ diff --git a/UI/Textures/Apparel/Chest_up.dds b/UI/Textures/Apparel/Chest_up.dds deleted file mode 100644 index 0607240..0000000 Binary files a/UI/Textures/Apparel/Chest_up.dds and /dev/null differ diff --git a/UI/Textures/Apparel/Feet_down.dds b/UI/Textures/Apparel/Feet_down.dds deleted file mode 100644 index 8ccad3a..0000000 Binary files a/UI/Textures/Apparel/Feet_down.dds and /dev/null differ diff --git a/UI/Textures/Apparel/Feet_over.dds b/UI/Textures/Apparel/Feet_over.dds deleted file mode 100644 index 77f7383..0000000 Binary files a/UI/Textures/Apparel/Feet_over.dds and /dev/null differ diff --git a/UI/Textures/Apparel/Feet_up.dds b/UI/Textures/Apparel/Feet_up.dds deleted file mode 100644 index e13b70c..0000000 Binary files a/UI/Textures/Apparel/Feet_up.dds and /dev/null differ diff --git a/UI/Textures/Apparel/Hand_down.dds b/UI/Textures/Apparel/Hand_down.dds deleted file mode 100644 index 08e54db..0000000 Binary files a/UI/Textures/Apparel/Hand_down.dds and /dev/null differ diff --git a/UI/Textures/Apparel/Hand_over.dds b/UI/Textures/Apparel/Hand_over.dds deleted file mode 100644 index b007d36..0000000 Binary files a/UI/Textures/Apparel/Hand_over.dds and /dev/null differ diff --git a/UI/Textures/Apparel/Hand_up.dds b/UI/Textures/Apparel/Hand_up.dds deleted file mode 100644 index 1c78f68..0000000 Binary files a/UI/Textures/Apparel/Hand_up.dds and /dev/null differ diff --git a/UI/Textures/Apparel/Head_down.dds b/UI/Textures/Apparel/Head_down.dds deleted file mode 100644 index 664d78c..0000000 Binary files a/UI/Textures/Apparel/Head_down.dds and /dev/null differ diff --git a/UI/Textures/Apparel/Head_over.dds b/UI/Textures/Apparel/Head_over.dds deleted file mode 100644 index 79825bf..0000000 Binary files a/UI/Textures/Apparel/Head_over.dds and /dev/null differ diff --git a/UI/Textures/Apparel/Head_up.dds b/UI/Textures/Apparel/Head_up.dds deleted file mode 100644 index a3c53e6..0000000 Binary files a/UI/Textures/Apparel/Head_up.dds and /dev/null differ diff --git a/UI/Textures/Apparel/Legs_down.dds b/UI/Textures/Apparel/Legs_down.dds deleted file mode 100644 index fe9e668..0000000 Binary files a/UI/Textures/Apparel/Legs_down.dds and /dev/null differ diff --git a/UI/Textures/Apparel/Legs_over.dds b/UI/Textures/Apparel/Legs_over.dds deleted file mode 100644 index f697fcf..0000000 Binary files a/UI/Textures/Apparel/Legs_over.dds and /dev/null differ diff --git a/UI/Textures/Apparel/Legs_up.dds b/UI/Textures/Apparel/Legs_up.dds deleted file mode 100644 index d582331..0000000 Binary files a/UI/Textures/Apparel/Legs_up.dds and /dev/null differ diff --git a/UI/Textures/Apparel/Neck_down.dds b/UI/Textures/Apparel/Neck_down.dds deleted file mode 100644 index e4c4dec..0000000 Binary files a/UI/Textures/Apparel/Neck_down.dds and /dev/null differ diff --git a/UI/Textures/Apparel/Neck_over.dds b/UI/Textures/Apparel/Neck_over.dds deleted file mode 100644 index 8c749cd..0000000 Binary files a/UI/Textures/Apparel/Neck_over.dds and /dev/null differ diff --git a/UI/Textures/Apparel/Neck_up.dds b/UI/Textures/Apparel/Neck_up.dds deleted file mode 100644 index 91d76fb..0000000 Binary files a/UI/Textures/Apparel/Neck_up.dds and /dev/null differ diff --git a/UI/Textures/Apparel/Ring_down.dds b/UI/Textures/Apparel/Ring_down.dds deleted file mode 100644 index 9708bc1..0000000 Binary files a/UI/Textures/Apparel/Ring_down.dds and /dev/null differ diff --git a/UI/Textures/Apparel/Ring_over.dds b/UI/Textures/Apparel/Ring_over.dds deleted file mode 100644 index 924e507..0000000 Binary files a/UI/Textures/Apparel/Ring_over.dds and /dev/null differ diff --git a/UI/Textures/Apparel/Ring_up.dds b/UI/Textures/Apparel/Ring_up.dds deleted file mode 100644 index dd9c336..0000000 Binary files a/UI/Textures/Apparel/Ring_up.dds and /dev/null differ diff --git a/UI/Textures/Apparel/Shoulders_down.dds b/UI/Textures/Apparel/Shoulders_down.dds deleted file mode 100644 index fb5c078..0000000 Binary files a/UI/Textures/Apparel/Shoulders_down.dds and /dev/null differ diff --git a/UI/Textures/Apparel/Shoulders_over.dds b/UI/Textures/Apparel/Shoulders_over.dds deleted file mode 100644 index 7786fbd..0000000 Binary files a/UI/Textures/Apparel/Shoulders_over.dds and /dev/null differ diff --git a/UI/Textures/Apparel/Shoulders_up.dds b/UI/Textures/Apparel/Shoulders_up.dds deleted file mode 100644 index 58535ae..0000000 Binary files a/UI/Textures/Apparel/Shoulders_up.dds and /dev/null differ diff --git a/UI/Textures/Apparel/Waist_down.dds b/UI/Textures/Apparel/Waist_down.dds deleted file mode 100644 index 6fd7cb6..0000000 Binary files a/UI/Textures/Apparel/Waist_down.dds and /dev/null differ diff --git a/UI/Textures/Apparel/Waist_over.dds b/UI/Textures/Apparel/Waist_over.dds deleted file mode 100644 index 9fdbed0..0000000 Binary files a/UI/Textures/Apparel/Waist_over.dds and /dev/null differ diff --git a/UI/Textures/Apparel/Waist_up.dds b/UI/Textures/Apparel/Waist_up.dds deleted file mode 100644 index e5e86b9..0000000 Binary files a/UI/Textures/Apparel/Waist_up.dds and /dev/null differ diff --git a/UI/Textures/Weapons/Axe_down.dds b/UI/Textures/Weapons/Axe_down.dds deleted file mode 100644 index 4f33a4c..0000000 Binary files a/UI/Textures/Weapons/Axe_down.dds and /dev/null differ diff --git a/UI/Textures/Weapons/Axe_over.dds b/UI/Textures/Weapons/Axe_over.dds deleted file mode 100644 index aa2280c..0000000 Binary files a/UI/Textures/Weapons/Axe_over.dds and /dev/null differ diff --git a/UI/Textures/Weapons/Axe_up.dds b/UI/Textures/Weapons/Axe_up.dds deleted file mode 100644 index 9318b7e..0000000 Binary files a/UI/Textures/Weapons/Axe_up.dds and /dev/null differ diff --git a/UI/Textures/Weapons/Bow_down.dds b/UI/Textures/Weapons/Bow_down.dds deleted file mode 100644 index ff74af0..0000000 Binary files a/UI/Textures/Weapons/Bow_down.dds and /dev/null differ diff --git a/UI/Textures/Weapons/Bow_over.dds b/UI/Textures/Weapons/Bow_over.dds deleted file mode 100644 index d2b0ff9..0000000 Binary files a/UI/Textures/Weapons/Bow_over.dds and /dev/null differ diff --git a/UI/Textures/Weapons/Bow_up.dds b/UI/Textures/Weapons/Bow_up.dds deleted file mode 100644 index 71466d3..0000000 Binary files a/UI/Textures/Weapons/Bow_up.dds and /dev/null differ diff --git a/UI/Textures/Weapons/Dagger_down.dds b/UI/Textures/Weapons/Dagger_down.dds deleted file mode 100644 index afd1ac2..0000000 Binary files a/UI/Textures/Weapons/Dagger_down.dds and /dev/null differ diff --git a/UI/Textures/Weapons/Dagger_over.dds b/UI/Textures/Weapons/Dagger_over.dds deleted file mode 100644 index 5ee6432..0000000 Binary files a/UI/Textures/Weapons/Dagger_over.dds and /dev/null differ diff --git a/UI/Textures/Weapons/Dagger_up.dds b/UI/Textures/Weapons/Dagger_up.dds deleted file mode 100644 index 1d88e99..0000000 Binary files a/UI/Textures/Weapons/Dagger_up.dds and /dev/null differ diff --git a/UI/Textures/Weapons/FireStaff_down.dds b/UI/Textures/Weapons/FireStaff_down.dds deleted file mode 100644 index 67f7b87..0000000 Binary files a/UI/Textures/Weapons/FireStaff_down.dds and /dev/null differ diff --git a/UI/Textures/Weapons/FireStaff_over.dds b/UI/Textures/Weapons/FireStaff_over.dds deleted file mode 100644 index e54ad8a..0000000 Binary files a/UI/Textures/Weapons/FireStaff_over.dds and /dev/null differ diff --git a/UI/Textures/Weapons/FireStaff_up.dds b/UI/Textures/Weapons/FireStaff_up.dds deleted file mode 100644 index 74c7f5d..0000000 Binary files a/UI/Textures/Weapons/FireStaff_up.dds and /dev/null differ diff --git a/UI/Textures/Weapons/FrostStaff_down.dds b/UI/Textures/Weapons/FrostStaff_down.dds deleted file mode 100644 index 7a752ae..0000000 Binary files a/UI/Textures/Weapons/FrostStaff_down.dds and /dev/null differ diff --git a/UI/Textures/Weapons/FrostStaff_over.dds b/UI/Textures/Weapons/FrostStaff_over.dds deleted file mode 100644 index d6d657e..0000000 Binary files a/UI/Textures/Weapons/FrostStaff_over.dds and /dev/null differ diff --git a/UI/Textures/Weapons/FrostStaff_up.dds b/UI/Textures/Weapons/FrostStaff_up.dds deleted file mode 100644 index 35beba9..0000000 Binary files a/UI/Textures/Weapons/FrostStaff_up.dds and /dev/null differ diff --git a/UI/Textures/Weapons/Hammer_down.dds b/UI/Textures/Weapons/Hammer_down.dds deleted file mode 100644 index 6e56f05..0000000 Binary files a/UI/Textures/Weapons/Hammer_down.dds and /dev/null differ diff --git a/UI/Textures/Weapons/Hammer_over.dds b/UI/Textures/Weapons/Hammer_over.dds deleted file mode 100644 index 0c69325..0000000 Binary files a/UI/Textures/Weapons/Hammer_over.dds and /dev/null differ diff --git a/UI/Textures/Weapons/Hammer_up.dds b/UI/Textures/Weapons/Hammer_up.dds deleted file mode 100644 index 3273e0f..0000000 Binary files a/UI/Textures/Weapons/Hammer_up.dds and /dev/null differ diff --git a/UI/Textures/Weapons/HealingStaff_down.dds b/UI/Textures/Weapons/HealingStaff_down.dds deleted file mode 100644 index d07892a..0000000 Binary files a/UI/Textures/Weapons/HealingStaff_down.dds and /dev/null differ diff --git a/UI/Textures/Weapons/HealingStaff_over.dds b/UI/Textures/Weapons/HealingStaff_over.dds deleted file mode 100644 index 7409cdb..0000000 Binary files a/UI/Textures/Weapons/HealingStaff_over.dds and /dev/null differ diff --git a/UI/Textures/Weapons/HealingStaff_up.dds b/UI/Textures/Weapons/HealingStaff_up.dds deleted file mode 100644 index 7c5767a..0000000 Binary files a/UI/Textures/Weapons/HealingStaff_up.dds and /dev/null differ diff --git a/UI/Textures/Weapons/LightningStaff_down.dds b/UI/Textures/Weapons/LightningStaff_down.dds deleted file mode 100644 index d863ebb..0000000 Binary files a/UI/Textures/Weapons/LightningStaff_down.dds and /dev/null differ diff --git a/UI/Textures/Weapons/LightningStaff_over.dds b/UI/Textures/Weapons/LightningStaff_over.dds deleted file mode 100644 index b22a996..0000000 Binary files a/UI/Textures/Weapons/LightningStaff_over.dds and /dev/null differ diff --git a/UI/Textures/Weapons/LightningStaff_up.dds b/UI/Textures/Weapons/LightningStaff_up.dds deleted file mode 100644 index aa6e658..0000000 Binary files a/UI/Textures/Weapons/LightningStaff_up.dds and /dev/null differ diff --git a/UI/Textures/Weapons/Shield_down.dds b/UI/Textures/Weapons/Shield_down.dds deleted file mode 100644 index 0d14df1..0000000 Binary files a/UI/Textures/Weapons/Shield_down.dds and /dev/null differ diff --git a/UI/Textures/Weapons/Shield_over.dds b/UI/Textures/Weapons/Shield_over.dds deleted file mode 100644 index 222e9aa..0000000 Binary files a/UI/Textures/Weapons/Shield_over.dds and /dev/null differ diff --git a/UI/Textures/Weapons/Shield_up.dds b/UI/Textures/Weapons/Shield_up.dds deleted file mode 100644 index 876dd7f..0000000 Binary files a/UI/Textures/Weapons/Shield_up.dds and /dev/null differ diff --git a/UI/Textures/Weapons/Sword_down.dds b/UI/Textures/Weapons/Sword_down.dds deleted file mode 100644 index 8266507..0000000 Binary files a/UI/Textures/Weapons/Sword_down.dds and /dev/null differ diff --git a/UI/Textures/Weapons/Sword_over.dds b/UI/Textures/Weapons/Sword_over.dds deleted file mode 100644 index 6d1ecf7..0000000 Binary files a/UI/Textures/Weapons/Sword_over.dds and /dev/null differ diff --git a/UI/Textures/Weapons/Sword_up.dds b/UI/Textures/Weapons/Sword_up.dds deleted file mode 100644 index d9797b5..0000000 Binary files a/UI/Textures/Weapons/Sword_up.dds and /dev/null differ diff --git a/UI/Textures/Weapons/TwoHandedAxe_down.dds b/UI/Textures/Weapons/TwoHandedAxe_down.dds deleted file mode 100644 index df881aa..0000000 Binary files a/UI/Textures/Weapons/TwoHandedAxe_down.dds and /dev/null differ diff --git a/UI/Textures/Weapons/TwoHandedAxe_over.dds b/UI/Textures/Weapons/TwoHandedAxe_over.dds deleted file mode 100644 index fc1c255..0000000 Binary files a/UI/Textures/Weapons/TwoHandedAxe_over.dds and /dev/null differ diff --git a/UI/Textures/Weapons/TwoHandedAxe_up.dds b/UI/Textures/Weapons/TwoHandedAxe_up.dds deleted file mode 100644 index a5c3dac..0000000 Binary files a/UI/Textures/Weapons/TwoHandedAxe_up.dds and /dev/null differ diff --git a/UI/Textures/Weapons/TwoHandedHammer_down.dds b/UI/Textures/Weapons/TwoHandedHammer_down.dds deleted file mode 100644 index 6e56f05..0000000 Binary files a/UI/Textures/Weapons/TwoHandedHammer_down.dds and /dev/null differ diff --git a/UI/Textures/Weapons/TwoHandedHammer_over.dds b/UI/Textures/Weapons/TwoHandedHammer_over.dds deleted file mode 100644 index 0c69325..0000000 Binary files a/UI/Textures/Weapons/TwoHandedHammer_over.dds and /dev/null differ diff --git a/UI/Textures/Weapons/TwoHandedHammer_up.dds b/UI/Textures/Weapons/TwoHandedHammer_up.dds deleted file mode 100644 index 3273e0f..0000000 Binary files a/UI/Textures/Weapons/TwoHandedHammer_up.dds and /dev/null differ diff --git a/UI/Textures/Weapons/TwoHandedSword_down.dds b/UI/Textures/Weapons/TwoHandedSword_down.dds deleted file mode 100644 index 5a61ab7..0000000 Binary files a/UI/Textures/Weapons/TwoHandedSword_down.dds and /dev/null differ diff --git a/UI/Textures/Weapons/TwoHandedSword_over.dds b/UI/Textures/Weapons/TwoHandedSword_over.dds deleted file mode 100644 index 3245d47..0000000 Binary files a/UI/Textures/Weapons/TwoHandedSword_over.dds and /dev/null differ diff --git a/UI/Textures/Weapons/TwoHandedSword_up.dds b/UI/Textures/Weapons/TwoHandedSword_up.dds deleted file mode 100644 index f787de1..0000000 Binary files a/UI/Textures/Weapons/TwoHandedSword_up.dds and /dev/null differ