Recent Topics

Ads

Shinies keeps resetting Priorities

Here you can post addons, or anything related to addons.

Moderators: Management, Web Developer

Forum rules
Before posting on this forum, be sure to read the Terms of Use
User avatar
xruptor
Posts: 111

Shinies keeps resetting Priorities

Post#1 » Sun Sep 20, 2020 7:07 pm

So I have this issue with Shinies where, no matter what I do, it keeps resetting the priorities I configure in the addons config menu. (Yes I do press "Apply" to save it). So if I visit an Auction House, Re-order and edit my priorities and press "Apply" it's supposed to save it. Yet, when I go to post an item, it uses a default priority no matter what I do. It seems to like to place the Price-Multiplier always in the second priority. The really weird part is that in the coding of the Shinies, the default priority for Price-Multiplier is 3, but it still puts it at 2.

If you leave the Auction House and then check Shinies the priorities should be as I saved it. HOWEVER, if I do a /reload or logout and login again. My priorities have been reset yet again.

SO I decided just to force the darn thing. If anyone else wants to do the same just do the following.

OPEN: Shinies-Aggregator-Price.lua

Find

Code: Select all

function mod:GetItemPrice( item, results )
	if( item == nil or item.uniqueID == nil or results == nil ) then
		Shinies:Debug( "GetItemPrice - Invalid arguments" ) 
		return 0, L"" 
	end
	
	local price 		= 0
	local name 			= L""
	local displayName 	= L""
	
	for priority, module in self:IterateConfiguredPriceModules()
	do
		price = module:GetItemPrice( item, results )
		
		if( price > 0 ) then
			name = module:GetName()
			displayName = module:GetDisplayName() 
			break 
		end
	end
	
	return price, name, displayName 
end
replace it with the following.

Code: Select all

function mod:GetItemPrice( item, results )
	if( item == nil or item.uniqueID == nil or results == nil ) then
		Shinies:Debug( "GetItemPrice - Invalid arguments" ) 
		return 0, L"" 
	end
	
	local price 		= 0
	local name 			= L""
	local displayName 	= L""
	
	local modulesOverride = 
	{
		[1] =
		{
			name = "Shinies-Price-Match",
			enabled = true,
		},
		[2] =
		{
			name = "Shinies-Price-Percent",
			enabled = true,
		},
		[3] =
		{
			name = "Shinies-Price-Flat",
			enabled = true,
		},
		[4] =
		{
			name = "Shinies-Price-Multiplier",
			enabled = true,
		},
	}
	
	for id = 1, 4
	do
		if modulesOverride[id] and modulesOverride[id].enabled then
			local module = Shinies:GetModule( modulesOverride[id].name, true)
			
			if module ~= nil then
				price = module:GetItemPrice( item, results )
				if( price > 0 ) then
					name = module:GetName()
					displayName = module:GetDisplayName() 
					break 
				end
			end
		end
	end
	
	return price, name, displayName 
end
It's not perfect but it works. To change your priorities just reorder the numbers found in modulesOverride above. Make sure you have them as 1 to 4. If you want to disable one just set the enabled to false.

Ads

Who is online

Users browsing this forum: No registered users and 1 guest