-
Notifications
You must be signed in to change notification settings - Fork 111
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
Options to Move ItemLevel text #496
base: master
Are you sure you want to change the base?
Options to Move ItemLevel text #496
Conversation
Added options to ItemLevel module to let the user define an anchor and offset for the item level text.
Fixes the trailing whitespace that cause the build check to fail https://travis-ci.org/github/AdiAddons/AdiBags/builds/736756255
Yes, this is much closer to what I had in mind after initially looking over the proposed changes in #206. I was short on time, so I didn't offer an explanation or code review as to why I wasn't accepting it. However, the biggest reason were the upgrade icon changes. I had planned to author a similar commit that also included font and size options (as implemented in the Skin and Currency menus, minus the color option) in favor of leaving it hard-coded, but I never got around to doing it. For localizations, the anchor values can do without them and the offsets can just reuse the below strings from Bartender4 as they've already been localized there. The others will need placeholders in Localization.lua as UpdateLocalization.php is no longer being maintained.
|
I tried adding font and size options, but it seems that the font options are not being preserved. The Item Level text usually uses the font NumberFontNormal which inherits NumberFont_Outline_Med which as the name implies has an outline. When setting the font from the options UI the outline option is not preserved. This is especially important since the text is on top of an image and without an outline the text becomes hard to read. I will need to investigate further to see how I can get the outline to show. I will work on those localization changes in the meantime. |
Added localized strings for "Anchor" "X Offset" "Y Offset" "Offset in X direction (horizontal) from the given anchor point." "Offset in Y direction (vertical) from the given anchor point."
Added an options control for setting the Font, Size, and Color. Color can be set when the Color Scheme is set to manual
Changed order values for the options table to avoid conflicts with other pull requests.
Can't wait to see this merged in. |
I didn't like the idea of the ItemLevel plugin being the location for the option to move the upgrade arrow. Perhaps another plugin could handle that or since it is part of the button either the button class itself or the main options should have that change. The problem I had with the pull request that added that option was that it was setting the location in the update handler. I think the position only needs to be updated when the setting is changed or when a new button is made. I haven't looked into it, but there was also some issue with showing upgrade icons for bank items. The other pull request was making a new upgradeIcon to handle that and I don't know if that is still needed or not. |
Adibags handles profile changes by calling Disable then Enable. Use OnEnable instead of using new callback handlers.
Fixed so font should now properly load. Since the fix is in OnEnable this will also fix font loading when changing profiles.
I've been testing these commits for some time, and just re-integrated them into the current version, and they seem to work flawlessly. |
I'm using this on a version of adibags that's skinned for elvui, I intigrated everything and it works, my only issue is that the text set's itself to the default location and changes after I move it using the x/y option to the right place. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All code still works with 1.9.23-3alpha, but needs to be manually integrated due to some code changes and movement.
Edit: Not a huge issue anymore since AdiBags 1.9.49 moved the itemlevel text to the bottom left instead. |
I would love to see this merged because ilvl text position conflicts with other addons and I need to manually change the position each time there is an update. |
What is 'sorting' options table for? |
Fixes #303.
This is another implementation of pull requests #178 and #206.
Changes the default location of ItemLevel text and adds options for changing text anchor and offsets.
Using the options to change the text back to the old position:
The new default location (note that the upgrade icon on the item with an item level 23 is now visible):
As noted in the bug reports and other pull requests this change mainly focuses on moving the Item Level text so that it doesn't overlap with the UpgradeIcon. I feel this change has merit on its own even for users that do not use the UpgradeIcon. The ItemLevel plugin does one thing; Display the item level of items in your bag. Having an option of where to display that text seems reasonable.
How this is different from #178
The options allow for setting the text to any location for those who do not want it in the bottom left.
This pull will require localization and #178 does not.
Adds 77 lines of code to allow users to change the behavior of 1 line of code.
How this is different from #206
This implementation does not touch UpgradeIcon and only modifies the behavior of the ItemLevel plugin.
In addition to allowing the anchor to be set the offsets can also be configured.
Implementation of the repositioning is done in a separate function that is only called when the position values change and not in the UpdateButton handler.