Bagnon

Bagnon

122M Downloads

Add separation between reagent bag/bank and other bags

Centias opened this issue ยท 11 comments

commented

Is your feature request related to a problem? Please describe.
Not really a problem, but it can get pretty annoying telling where the reagent bag starts and the previous bag ends, since the reagent storage has special rules on what can go in it.

Describe the solution you'd like
Create an empty row between the reagent bag / bank and the rest of the inventory to create some visible separation.

Describe alternatives you've considered
I actually made the modification in my version that works with the settings I use, but it could use some adjustments to work with alternative settings where it might look weird.

Additional context
I would make a pull request for this, but I haven't really made sure it works with all variations of settings.

How I have it looking on my end :
image

My modified Layout function in itemGroup.lua to get this appearance :

function Items:Layout()
	self:ForAll('Release')
	wipe(self.buttons)
	wipe(self.order)

	-- Acquire slots
	for i, frame in ipairs(self.bags) do
		local bag = frame.id
		if self.frame:IsShowingBag(bag) then
			local numSlots = self:NumSlots(bag)
			for slot = 1, numSlots do
				if self.frame:IsShowingItem(bag, slot) then
					local button = self.Button(frame, bag, slot)
					self.buttons[bag] = self.buttons[bag] or {}
					self.buttons[bag][slot] = button
					tinsert(self.order, button)
				end
			end
		end
	end

	-- Position slots
	local profile = self:GetProfile()
	local columns, scale, size = self:LayoutTraits()

	local revBags, revSlots = profile.reverseBags, profile.reverseSlots
	local x, y = 0,0

	for k = revBags and #self.bags or 1, revBags and 1 or #self.bags, revBags and -1 or 1 do
		local bag = self.bags[k].id
		local slots = self.buttons[bag]

		if not (k == 6 and Addon:IsBackpackBag(bag))and slots then

			if Addon:IsReagents(bag) then
				y = y + 2
				x = 0
			end
			local numSlots = self:NumSlots(bag)
			for slot = revSlots and numSlots or 1, revSlots and 1 or numSlots, revSlots and -1 or 1 do
				local button = slots[slot]
				if button then
					if x == columns then
						y = y + 1
						x = 0
					end

					button:ClearAllPoints()
					button:SetPoint('TOPLEFT', self, 'TOPLEFT', size * (self.Transposed and y or x), -size * (self.Transposed and x or y))
					button:SetScale(scale)

					x = x + 1
				end
			end

			if self:GetProfile().bagBreak and x > 0 then
				y = y + 1
				x = 0
			end
		end
	end

	local bag = self.bags[6].id
	local bag = self.bags[6].id
	local slots = self.buttons[bag]

	if slots and Addon:IsBackpackBag(bag) then
		y = y + 2
		x = 0

		local numSlots = self:NumSlots(bag)
		for slot = revSlots and numSlots or 1, revSlots and 1 or numSlots, revSlots and -1 or 1 do
			local button = slots[slot]
			if button then
				if x == columns then
					y = y + 1
					x = 0
				end

				button:ClearAllPoints()
				button:SetPoint('TOPLEFT', self, 'TOPLEFT', size * (self.Transposed and y or x), -size * (self.Transposed and x or y))
				button:SetScale(scale)

				x = x + 1
			end
		end
	end

	-- Resize frame
	if x > 0 then
		y = y + 1
	end

	local width, height = max(columns * size * scale, 1), max(y * size * scale, 1)
	self:SetSize(self.Transposed and height or width, self.Transposed and width or height)
	self:SendFrameSignal('ELEMENT_RESIZED')
end

commented

Hi! For what it's worth, I've apparently implemented roughly the same thing as you here. Just so you know there's now a PR for it too.

commented

Personally like the way blizzard does it with a seperate container for reagents. They do not have that function for bank though which would also be nice. Either way options to clearly seperate them are welcome whichever form they come.

commented

Personally like the way blizzard does it with a seperate container for reagents. They do not have that function for bank though which would also be nice. Either way options to clearly seperate them are welcome whichever form they come.

I second this opinion. I find it much more convenient that way. Although I prefer bagnon I've actually switched to inventorian for now for this very reason.

commented

I agree it's very useful visually to have this small separation between bags and reagents.

commented

It would seem like this request has fallen on deaf ears. Personally I would like to see the reagent bag seperated entirely from the main backpack window. Could this be done via a plugin addon?

commented

Is this still working? would love to have the space between main bags and reagent bags

commented

@waltonsza I edited my code so it works again with the most recent version.

commented

@waltonsza I edited my code so it works again with the most recent version.

Was there a secondary part to this? I replaced the code in Interface\Addons\BagBrother\addons\core\classes\ItemGroup.lua and got the below error:

1x BagBrother/addons/core/classes/itemGroup.lua:161: attempt to perform arithmetic on local 'size' (a nil value)
[string "@BagBrother/addons/core/classes/itemGroup.lua"]:161: in function `func'
[string "@BagBrother/libs/MutexDelay-1.0-2/MutexDelay-1.0.lua"]:36: in function <...ns/BagBrother/libs/MutexDelay-1.0/MutexDelay-1.0.lua:30>
commented

@Thrayl Nope, nothing else that I changed. I've never gotten that error, so I'm not sure how much I can help.

commented

@Thrayl Nope, nothing else that I changed. I've never gotten that error, so I'm not sure how much I can help.

just did it again and it worked.. weird

nice change, thanks :)

commented

Can anyone please explain to me how to implement this, and please explain like I'm 5. Where do I copy this, what folders/files?

Is this all in bagbrother?
Where is the current frames.lua?
How do I know what to paste where?!

Please explain, thanks!