[Addon] GatherButton

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
Golaz
Posts: 5

Re: [Addon] GatherButton

Post#11 » Fri Jul 26, 2019 4:18 am

Thanks for a fantastic addon. No lag from this one like Miracle Grow Remix that made your game stutter more and more for each time you had harvest the seeds. So not only better but easier. Just click one button to harvest and replant. Fantastic :D

Ads
Taz83
Posts: 46

Re: [Addon] GatherButton

Post#12 » Thu Oct 03, 2019 4:50 pm

very laggy and alot of game crush this addon need some rework and fixes

User avatar
wdesu
Posts: 48

Re: [Addon] GatherButton

Post#13 » Thu Oct 17, 2019 12:47 am

Hello everyone.

Sorry, I see that some people experience troubles with the addon while other people seem to have it working okay. I am not sure why this is happening. There may be a conflict with another addon (I don't know what would result in the conflict though). Or, uh. I dunno, maybe my code is just wrong somewhere and I just don't see it. (I will always welcome a patch/pull request or a fork, especially since I don't currently play the game.) Maybe I should add a poll to actually see how many people have problems.

Anyways, I can't reproduce the lags/crashes. Works on my machine ;)

I updated the OP and posted 1.0.1 version with mostly code refactoring/formatting changes. If you had troubles, it probably won't fix these.
repo with some addons i created/modified
Spoiler:
5*: Masonna, Rozhdestvensky, Bordin
4*: Ethica, Mayqueen, Krita, Gwestiel

Akalukz
Posts: 596

Re: [Addon] GatherButton

Post#14 » Thu Oct 31, 2019 2:38 pm

the problem i have is that it takes over control of all my macros. It doesn't change any, but at the same time I can't go in and add or change any myself.
-= Agony =-

User avatar
wdesu
Posts: 48

Re: [Addon] GatherButton

Post#15 » Wed Nov 06, 2019 1:18 am

Akalukz wrote:
Thu Oct 31, 2019 2:38 pm
the problem i have is that it takes over control of all my macros. It doesn't change any, but at the same time I can't go in and add or change any myself.
Oh, that's the strangest one yet. I played a bit on my profile, and on a new profile with only my addon enabled, but I didn't encounter any problems with the macro window. Does the addon break the 'Save' button? Can you press 'Save' and it just doesn't save the new name/text values? Or does it break the text/name fields? Or something I didn't think of?

Here's the related macro code:

Code: Select all

function GatherButton.GetMacroId(text)
	local macros = DataUtils.GetMacros()

	for slot = 1, EA_Window_Macro.NUM_MACROS do
		if macros[slot].text == text then
			return slot
		end
	end

	return nil
end

function GatherButton.SetMacro(slot, name, text, iconId)
	SetMacroData(name, text, iconId, slot)
	EA_Window_Macro.UpdateDetails(slot)
end

function GatherButton.CreateMacro(name, text, iconId)
	--[[find macro by text and return it (and also reset its icon and name). 
		or make a new one.
	--]]

	local slot = GatherButton.GetMacroId(text)
	if (slot) then
		GatherButton.SetMacro(slot, name, text, iconId) -- set icon and name
		return slot
	end

	local macros = DataUtils.GetMacros()
	for slot = 1, EA_Window_Macro.NUM_MACROS do
		if (macros[slot].text == L"") then
			GatherButton.SetMacro(slot, name, text, iconId)
			return slot
		end
	end

	return nil
end

function GatherButton.SetMacroName(newname)
	GatherButton.SetMacro(MACRO_ID, newname, MACRO_TEXT, ICON)
end
(newer revision (the only new thing is status messages): https://gitlab.com/cupnoodles14/gatherb ... n.lua#L377 )

There are 4 places where I interact with the macro system:
  • call and read the result of DataUtils.GetMacros()
  • read EA_Window_Macro.NUM_MACROS
  • call SetMacroData(name, text, iconId, slot)
  • call EA_Window_Macro.UpdateDetails(slot)
None of it should result in the described behavior. I could just comment out parts of code and hope that it fixes the problem but I can't do it because I can't reproduce the issue, sorry.

By the way, the standard macro window has a bug in .xml with two rows of macros overlapping (see weird inconsistent borders on the picture). If you don't see a macro created by the addon, it's possible that it was created in these cells.
Spoiler:
Image
repo with some addons i created/modified
Spoiler:
5*: Masonna, Rozhdestvensky, Bordin
4*: Ethica, Mayqueen, Krita, Gwestiel

Akalukz
Posts: 596

Re: [Addon] GatherButton

Post#16 » Wed Nov 06, 2019 1:52 pm

wdesu wrote:
Wed Nov 06, 2019 1:18 am
Akalukz wrote:
Thu Oct 31, 2019 2:38 pm
the problem i have is that it takes over control of all my macros. It doesn't change any, but at the same time I can't go in and add or change any myself.
Oh, that's the strangest one yet. I played a bit on my profile, and on a new profile with only my addon enabled, but I didn't encounter any problems with the macro window. Does the addon break the 'Save' button? Can you press 'Save' and it just doesn't save the new name/text values? Or does it break the text/name fields? Or something I didn't think of?

Here's the related macro code:

Code: Select all

function GatherButton.GetMacroId(text)
	local macros = DataUtils.GetMacros()

	for slot = 1, EA_Window_Macro.NUM_MACROS do
		if macros[slot].text == text then
			return slot
		end
	end

	return nil
end

function GatherButton.SetMacro(slot, name, text, iconId)
	SetMacroData(name, text, iconId, slot)
	EA_Window_Macro.UpdateDetails(slot)
end

function GatherButton.CreateMacro(name, text, iconId)
	--[[find macro by text and return it (and also reset its icon and name). 
		or make a new one.
	--]]

	local slot = GatherButton.GetMacroId(text)
	if (slot) then
		GatherButton.SetMacro(slot, name, text, iconId) -- set icon and name
		return slot
	end

	local macros = DataUtils.GetMacros()
	for slot = 1, EA_Window_Macro.NUM_MACROS do
		if (macros[slot].text == L"") then
			GatherButton.SetMacro(slot, name, text, iconId)
			return slot
		end
	end

	return nil
end

function GatherButton.SetMacroName(newname)
	GatherButton.SetMacro(MACRO_ID, newname, MACRO_TEXT, ICON)
end
(newer revision (the only new thing is status messages): https://gitlab.com/cupnoodles14/gatherb ... n.lua#L377 )

There are 4 places where I interact with the macro system:
  • call and read the result of DataUtils.GetMacros()
  • read EA_Window_Macro.NUM_MACROS
  • call SetMacroData(name, text, iconId, slot)
  • call EA_Window_Macro.UpdateDetails(slot)
None of it should result in the described behavior. I could just comment out parts of code and hope that it fixes the problem but I can't do it because I can't reproduce the issue, sorry.

By the way, the standard macro window has a bug in .xml with two rows of macros overlapping (see weird inconsistent borders on the picture). If you don't see a macro created by the addon, it's possible that it was created in these cells.
Spoiler:
Image

I appreciate the response, I run a lot of addons so it could just be a conflict somewhere. I will try to get a video and share a link to it. It doesn't break any existing macros, but i can't create or change any either. I will try to do tonight. If you don't want to mess with it, no worries. Just thought it a weird occurence.
-= Agony =-

User avatar
sullemunk
Addon Developer
Posts: 826

Re: [Addon] GatherButton

Post#17 » Wed Nov 06, 2019 2:44 pm

I suggest cheking your user folder and make sure the files and folders there are not write protected
Image
Image Ethreal   Image Corque   Image Urgiz   Image Loxley   Image Chilli   Image Maduza

Who is online

Users browsing this forum: No registered users and 3 guests