Thread Tools Display Modes
04/29/15, 03:44 PM   #1
blakbird
 
blakbird's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2015
Posts: 30
I need to move part of the contents of the Improvement Window

I have been working on a UI reskin for a while. I have run into a snag with the improvement window. Because the "Improve" text and the weapon or armor icon below it are not centered, my background looks off.
Can someone either write an addon to move "Improve" and the icon below it to the right so that it is centered with the text on the right side? Or, can someone give me that code to put into my UI reskin addon? My reskin is only texture swaps, and that is about the extent of my skills. I have found the code in the smithingimprovement.xml file for the placement of "Improve", but I just don't have the skills to figure out how to move those 2 things.

http://i.imgur.com/CfPVLgE.jpg

Lua Code:
  1. <Label name="$(parent)ImprovementLabel" font="ZoFontWinH2" color="INTERFACE_COLOR_TYPE_TEXT_COLORS:INTERFACE_TEXT_COLOR_SELECTED" text="SI_SMITHING_IMPROVE_ITEM_TO_IMPROVE_HEADER" modifyTextType="UPPERCASE">
  2.                             <Anchor point="TOP" relativePoint="TOPLEFT" offsetX="110" offsetY="64" />

Any help would be greatly appreciated!
  Reply With Quote
04/30/15, 03:06 PM   #2
votan
 
votan's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 577
The code you are looking for is:
Lua Code:
  1. local function OnAddonLoaded(event, name)
  2.   if name:find("^ZO_") then return end -- Wait for ZOS code loaded
  3.   EVENT_MANAGER:UnregisterForEvent("YourAddonNameHere", EVENT_ADD_ON_LOADED)
  4.  
  5.   ZO_SmithingTopLevelImprovementPanelSlotContainerImprovementLabel:ClearAnchors() -- Remove existing
  6.   ZO_SmithingTopLevelImprovementPanelSlotContainerImprovementLabel:SetAnchor(TOPRIGHT, nil, TOP, -32, 64) -- Set new anchor relative to nil (=parent)
  7.   ZO_SmithingTopLevelImprovementPanelSlotContainerImprovementSlot:ClearAnchors()
  8.   ZO_SmithingTopLevelImprovementPanelSlotContainerImprovementSlot:SetAnchor(TOPRIGHT, nil, TOP, -32 - 32, 64 + 56)
  9.  
  10.   ZO_SmithingTopLevelImprovementPanelSlotContainerChanceLabel:ClearAnchors()
  11.   ZO_SmithingTopLevelImprovementPanelSlotContainerChanceLabel:SetAnchor(TOPLEFT, nil, TOP, 32, 64)
  12.   ZO_SmithingTopLevelImprovementPanelSlotContainerBoosterSlot:ClearAnchors()
  13.   ZO_SmithingTopLevelImprovementPanelSlotContainerBoosterSlot:SetAnchor(TOPLEFT, nil, TOP, 32 + 32, 64 + 56)
  14. end
  15. EVENT_MANAGER:RegisterForEvent("YourAddonNameHere", EVENT_ADD_ON_LOADED, OnAddonLoaded)
But remember that the label's text length is different in different languages. Choose your anchors wise
  Reply With Quote
04/30/15, 11:32 PM   #3
blakbird
 
blakbird's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2015
Posts: 30
Thank you for the code! I was unable to get it to work inside my addon, but I was able to get it to work as its own addon. I was able to get that window to look better.



But, I now have a new issue that I didn't realize was there before. As soon as you add an item, it shows the chance you have to get a successful upgrade. This expands the "CHANCE" text and makes the window off center again.



Is it possible to put the number that appears next to "CHANCE" on a separate line below it that I will be able to move around like the code you gave me? That way I could make it stay centered no matter what the number is? I want it to look like this:




Also, where can I put the code you gave me into my code so that I can have it all in one addon. Here is a condensed version of my addon code(I cut out hundreds of texture swaps):

Lua Code:
  1. local function Addon_Loaded(eventCode, addOnName)
  2.     if (addOnName == "CleanUI") then
  3.         RedirectTexture("/esoui/art/actionbar/ability_ultimate_framedecobg.dds", 0)  
  4.     end
  5. end
  6.  
  7. EVENT_MANAGER:RegisterForEvent("CleanUI", EVENT_ADD_ON_LOADED, Addon_Loaded)

Edit: Also, what code can I add to the code you gave me to make the spinner (- 5 +) movable?

Last edited by blakbird : 05/01/15 at 12:00 AM.
  Reply With Quote
05/01/15, 02:22 AM   #4
votan
 
votan's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 577
Originally Posted by blakbird View Post
Thank you for the code!
You are welcome.

Originally Posted by blakbird View Post
I was unable to get it to work inside my addon, but I was able to get it to work as its own addon. I was able to get that window to look better.

But, I now have a new issue that I didn't realize was there before. As soon as you add an item, it shows the chance you have to get a successful upgrade. This expands the "CHANCE" text and makes the window off center again.
I warned you.
Originally Posted by blakbird View Post
Is it possible to put the number that appears next to "CHANCE" on a separate line below it that I will be able to move around like the code you gave me? That way I could make it stay centered no matter what the number is? I want it to look like this:
Yes it is. But the path you have chosen will be dark. At least for you
You can change the string to insert a line-feed. But than you have to add multi-language support.
Originally Posted by blakbird View Post
Also, where can I put the code you gave me into my code so that I can have it all in one addon. Here is a condensed version of my addon code(I cut out hundreds of texture swaps):
Changing the anchors belongs into the same section as the redirects.
Lua Code:
  1. local function Addon_Loaded(eventCode, addOnName)
  2.     if (addOnName == "CleanUI") then
  3.         RedirectTexture("/esoui/art/actionbar/ability_ultimate_framedecobg.dds", 0)  
  4.         -- ...
  5. ZO_SmithingTopLevelImprovementPanelSlotContainerImprovementLabel:ClearAnchors() -- Remove existing
  6.   ZO_SmithingTopLevelImprovementPanelSlotContainerImprovementLabel:SetAnchor(TOPRIGHT, nil, TOP, -32, 64) -- Set new anchor relative to nil (=parent)
  7.   ZO_SmithingTopLevelImprovementPanelSlotContainerImprovementSlot:ClearAnchors()
  8.   ZO_SmithingTopLevelImprovementPanelSlotContainerImprovementSlot:SetAnchor(TOPRIGHT, nil, TOP, -32 - 32, 64 + 56)
  9.  
  10.   ZO_SmithingTopLevelImprovementPanelSlotContainerChanceLabel:ClearAnchors()
  11.   ZO_SmithingTopLevelImprovementPanelSlotContainerChanceLabel:SetAnchor(TOPLEFT, nil, TOP, 0, 64)
  12.   ZO_SmithingTopLevelImprovementPanelSlotContainerChanceLabel:SetDimensions(256, 64)
  13.   ZO_SmithingTopLevelImprovementPanelSlotContainerChanceLabel:SetHorizontalAlignment(TEXT_ALIGN_CENTER)
  14.  
  15.   ZO_SmithingTopLevelImprovementPanelSlotContainerBoosterSlot:ClearAnchors()
  16.   ZO_SmithingTopLevelImprovementPanelSlotContainerBoosterSlot:SetAnchor(TOPLEFT, nil, TOP, 32 + 32, 64 + 56)
  17.  
  18.   ZO_SmithingTopLevelImprovementPanelSlotContainerSpinner:ClearAnchors()
  19.   ZO_SmithingTopLevelImprovementPanelSlotContainerSpinner:SetAnchor(TOPLEFT, nil, TOP, 32 + 32, 64 + 56 + 64)
  20.  
  21.   SafeAddString(SI_SMITHING_IMPROVE_CHANCE_FORMAT, "Chance\r\n <<1>>%", 1)
  22.  
  23.     end
  24. end
  25.  
  26. EVENT_MANAGER:RegisterForEvent("CleanUI", EVENT_ADD_ON_LOADED, Addon_Loaded)

Originally Posted by blakbird View Post
Edit: Also, what code can I add to the code you gave me to make the spinner (- 5 +) movable?
See above.

If you can not code, you may ask someone in your neighborhood to create a github project or similar for you. And show you how to share with others.
Helping you this way here is painful. It will not be the last issue. So you have to find a better way.
And/or a coder with a lot spare time.
  Reply With Quote
05/01/15, 03:26 PM   #5
blakbird
 
blakbird's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2015
Posts: 30
Thanks for giving me the code I needed and for telling me how it add it to my addon! I have everything centered and not moving just like I wanted it.


Here is the stock, off-centered Improvement window that I changed for my CleanUi reskin:




Here is my CleanUI centered one:




I know the change in placement for those items is subtle, but it makes a huge difference to me, especially moving the numbers below the "CHANCE" text.

Where did you find the code for moving those items so easily? Even after you gave me the original code, I searched for the spinner and couldn't find it. I must be looking in the wrong place.

Thanks again Votan!!! I really appreciate you taking the time to help me with my project.

Last edited by blakbird : 05/01/15 at 03:28 PM.
  Reply With Quote
05/01/15, 04:03 PM   #6
votan
 
votan's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 577
Originally Posted by blakbird View Post
Where did you find the code for moving those items so easily? Even after you gave me the original code, I searched for the spinner and couldn't find it. I must be looking in the wrong place.
I traced back the inheritance from virtual controls to their final instance.
For example in you first post:
$(parent)ImprovementLabel
-> parent is $(parent)SlotContainer
-> parent is ZO_SmithingImprovementPanel but marked as virtual
ZO_SmithingImprovementPanel is used as base class for $(parent)ImprovementPanel
-> parent is ZO_SmithingTopLevel
=>
ZO_SmithingTopLevelImprovementPanelSlotContainerImprovementLabel

But you can also try to install the addon zgoo
Move you mouse over the target control and type in chat:
/zgoo mouse

Then look for GetName() and copy the name

Sometimes you don't get all child elements, because they are currently not visible.
When you have to understand which xml created the control, again.
Real tricky are controls like the chat tabs, which are created dynamically.

Originally Posted by blakbird View Post
Thanks again Votan!!! I really appreciate you taking the time to help me with my project.
You are welcome.

CU
  Reply With Quote

ESOUI » AddOns » AddOn Search/Requests » I need to move part of the contents of the Improvement Window


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off