Bagnon

Bagnon

122M Downloads

Gap in bank between reagents and bags

vtcifer opened this issue ยท 2 comments

commented

I'd love for there to be a gap in the bank window between the reagent bank, and the rest of my bags, when not using bag break, so I can have that visual separation.

commented

For the current version, this is a patch that can accomplish this. This is a patch file that modifies both Bagnon and Bagnon_Config. Few notes:

  1. I have not done any localization - only EN is supported. Translations and additions to the localization files in Bagnon_Config would be necessary to have this work fully.
  2. I actually create a small 1/2 box split between the Reagent bag and the rest of the bags when it is active - this is a style choice for my needs. Replace the two instances of "y = y + 1.5" to "y = y + 1" if you don't want the extra spacing.
  3. I'm sure the code could be better optimized - I debugged best I could, but I wanted to post this for anyone else looking for something like this.
commented
diff -Naur AddOns.original/Bagnon/common/components/itemFrame.lua AddOns/Bagnon/common/components/itemFrame.lua
--- AddOns.original/Bagnon/common/components/itemFrame.lua	2017-01-27 23:57:30.000000000 -0500
+++ AddOns/Bagnon/common/components/itemFrame.lua	2017-02-01 00:14:59.000000000 -0500
@@ -134,6 +134,11 @@
 				last = self:NumSlots(bag)
 			end
 
+			if self:BagBreak() ~= true and self:ReagentBagBreak() and x > 0 and self:NumSlots(bag) == 98 and reverseBags == false then
+				y = y + 1.5
+				x = 0
+			end
+
 			for slot = first, last, step do
 				if x == columns then
 					y = y + 1
@@ -161,7 +166,10 @@
 			if self:BagBreak() and x > 0 then
 				y = y + 1
 				x = 0
-			end
+			elseif self:ReagentBagBreak() and x > 0 and self:NumSlots(bag) == 98 and reverseBags then
+				y = y + 1.5
+				x = 0
+			end 
 		end
 	end
 
@@ -216,6 +224,10 @@
 	return self:GetProfile().bagBreak
 end
 
+function ItemFrame:ReagentBagBreak()
+	return self:GetProfile().ReagentBagBreak
+end
+
 function ItemFrame:LayoutTraits()
 	local profile = self:GetProfile()
 	return profile.columns, (37 + profile.spacing), profile.itemScale
diff -Naur AddOns.original/Bagnon_Config/localization/en.lua AddOns/Bagnon_Config/localization/en.lua
--- AddOns.original/Bagnon_Config/localization/en.lua	2017-01-29 22:15:42.000000000 -0500
+++ AddOns/Bagnon_Config/localization/en.lua	2017-01-29 22:06:34.000000000 -0500
@@ -22,6 +22,7 @@
 L.Enabled = 'Enable Frame'
 L.CharacterSpecific = 'Character Specific Settings'
 L.ExclusiveReagent = 'Separate Reagent Bank'
+L.ReagentBagBreak = 'Reagent Bag Break'
 
 L.BagFrame = 'Bag List'
 L.Money = 'Money'
diff -Naur AddOns.original/Bagnon_Config/panels.lua AddOns/Bagnon_Config/panels.lua
--- AddOns.original/Bagnon_Config/panels.lua	2017-01-27 23:40:03.000000000 -0500
+++ AddOns/Bagnon_Config/panels.lua	2017-02-01 00:52:45.000000000 -0500
@@ -73,7 +73,12 @@
 
 	if self.sets.enabled then
 		if self.frameID == 'bank' then
-			self:CreateCheck('exclusiveReagent')
+			self:CreateRow(35, function(row)
+				row:CreateCheck('exclusiveReagent')
+				if (not self.sets.exclusiveReagent) then
+					row:CreateCheck('ReagentBagBreak')
+				end
+			end)
 		end
 
 		-- Display