-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GM Notes Header Button #27
Comments
No, no reason - it is was just made this way when I took over the project. |
If I make a pull request can we update it? |
Of course, I happily accept pull request. Can you detail what the advantages are? |
Using the getHeadersButtons hook is the Standard Foundry API method used for registering buttons in the header. This method also makes it so other modules who are getting and interaction with header buttons knows the button exists. For example, my module WindowTabs, groups windows together and only shows buttons for the currently active tab. So if the button hasn't been registered as a header button, my module has no way to know it exists. Basically, its the proper way to do it, and should only be circumvented if absolutely needed. |
Sounds good - looking forward to the PR :) |
I've been looking at the hook - but I can't see how I change the indicator on the button upon changes. So I would still need to listen to the render hook to do the update? |
Sorry I dont use this module, could you tell me what is changing about the button on the render hook? I can test it out later today to figure it out myself, but I sadly have been swamped all week and haven't gotten around to this. |
I'm suspecting that this is the reason other modules are also doing it in the render hook. If the button depends on the underlying data, then using the button header seems quite involved, compared to just adding it in the render hook. |
Well, changing the icon, is easily enough, but the color is a littler tricker, but I can do it via css. I try and work on it later. Impossible probably not, being tricky, probably so. haha |
The big issue is that the header button hook only triggers once (when the sheet is opened), so there is no possible way to change the icon/text if the underlying data changes. I have another module which has a header button but this one does not change, where I will move over to use the button header hook. |
Made the pull request, which because also happens to appear to also add support for #1 because I am attaching to any application that has a Though I don't use this module, so I may have missed something, I did basically zero testing, Just mostly made sure the button showed up and changed icon/color |
You should be able to close this issue and #1 |
Resolved by #29 |
Is there any particular reason you append the header button in the
renderXYZ
hook instead of registering it as a header button in thegetXYZHeaderButtons
hooks?The text was updated successfully, but these errors were encountered: