WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Reskin Frame problem (https://www.wowinterface.com/forums/showthread.php?t=49654)

Mayron 08-16-14 12:20 PM

Reskin Frame problem
 
Hi all,

I wanted to try adding a skinning module and almost finished. I am just finishing some bugs and wanted help with one of them. I know there is Aurora but wanted to make it integrated with my UI so that I am able to control the settings better.

I cannot seem to change the text color of the following text for quest titles (It is the one that shows up black when I am trying to make it white):



This is the code I am using:

Lua Code:
  1. local function ChangeTextColor(str, color)
  2.     if (color == "white") then
  3.         str:SetTextColor(1,1,1)
  4.     elseif (color == "red") then
  5.         str:SetTextColor(RED_FONT_COLOR.r, RED_FONT_COLOR.g, RED_FONT_COLOR.b)
  6.    
  7.     elseif (color == "yellow") then
  8.         str:SetTextColor(YELLOW_FONT_COLOR.r, YELLOW_FONT_COLOR.g, YELLOW_FONT_COLOR.b)
  9.     elseif (color == "orange") then
  10.         str:SetTextColor(ORANGE_FONT_COLOR.r, ORANGE_FONT_COLOR.g, ORANGE_FONT_COLOR.b)
  11.     end
  12.     str:SetShadowColor(0, 0, 0, 0.6)
  13.     str:SetShadowOffset(1, -1)
  14. end
  15.  
  16. for i = 1, 31 do
  17.     if (_G["GossipTitleButton"..i]) then
  18.         ChangeTextColor(_G["GossipTitleButton"..i]:GetFontString(), "white")
  19.     end
  20. end

The function is pretty basic.

Thanks for reading!
EDIT: I also tried "_G["GossipTitleButton"..i]:SetNormalFontObject(GameFontNormal) " but that does not work either.

EDIT: Fixed but got anther issue.
I found out I had to edit this global which I found in the GossipFrame.lua file:

Lua Code:
  1. NORMAL_QUEST_DISPLAY = "|cffffffff%s|r"

Haleth 08-16-14 02:34 PM

If you are going to take any code from Aurora (which it looks like you are) then I'd rather you ask for permission first before doing so.

Mayron 08-17-14 04:18 AM

Quote:

Originally Posted by Haleth (Post 295429)
If you are going to take any code from Aurora (which it looks like you are) then I'd rather you ask for permission first before doing so.

Sure! But I haven't used any code. Which part looks like I have?
I am trying to Reskin the Blizzard UI all by myself while putting my own spin on it.

I honestly have tried doing everything all by myself as I like to see how well I can do it (more of an achievement and learning experience). I wanted my AddOn to skin less than what yours does so your mod is larger. Also I wanted to skin things slightly different :)

I took a look at your code only a few times when I got stuck to see how you handled certain parts but then used my own functions to skin it in a completely different way. I mostly have been studying the Blizzard AddOn files to do this. I hope this is okay? It is not published yet and while I am asking, am I allowed to use small snippets of your code in future? I will give credit where credit is due!

So far 100% of my code I have wrote by myself but I suppose there is a chance that some parts work in similar ways if there is only one way to do it. Really sorry if I crossed the line by mistake Haleth, I just thought the AddOn Skinner does reskinning as well so why can't I make my own?

Haleth 08-17-14 04:35 AM

That's fine then. I don't mind if you use small parts as long as credit is given :)

Mayron 08-17-14 06:12 AM

Quote:

Originally Posted by Haleth (Post 295521)
That's fine then. I don't mind if you use small parts as long as credit is given :)

Thank you Haleth :)

I am trying to keep some of the UI more "Blizzard-like" while trying to clean up other parts. I have also made the frames move-able however because of pixel perfect borders, the Icons some times look wrong if the frame has been moved in certain areas of the screen. I heard this is a very common problem where the game client does not handle pixel perfect borders by default.

Here is what I mean:



So it looks slightly different to yours but I still have a few issues with those icon borders. I read somewhere that this code helps but I am using that in a "PLAYER_ENTERING_WORLD" Event but it did not fix anything:

Lua Code:
  1. SetCVar("uiScale", 768/string.match(({GetScreenResolutions()})[GetCurrentResolution()], "%d+x(%d+)"))

I would love some help from anyone but probably should have posted this in a new thread? hehe ah well its not urgent I guess :)

Talyrius 08-17-14 06:38 AM

When you manually drag frames around, they'll almost always land on fractional coordinates. This will negate your attempts to make things pixel perfect.

Mayron 08-17-14 07:45 AM

Quote:

Originally Posted by Talyrius (Post 295536)
When you manually drag frames around, they'll almost always land on fractional coordinates. This will negate your attempts to make things pixel perfect.

Ah ok, well then I just won't worry about it. ty!

Phanx 08-18-14 04:42 AM

Rather than using an overlay to create your border, use a background. This way you can make sure it's always outside of the object you're bordering, and always exactly 1px wide:

Code:

local bg = object:CreateTexture(nil, "BACKGROUND")
bg:SetPoint("TOPLEFT", -1, 1)
bg:SetPoint("BOTTOMRIGHT", 1, -1)
bg:SetTexture(0, 0, 0)


Haleth 08-18-14 05:01 AM

Scroll frames have always been good at giving me headaches when dealing with pixel-precision stuff. Sometimes certain buttons/icons are 1px higher or further offset to the left/right. The mount/pet journal and guild reward overview come to mind. Thankfully WoD fixes some of those issues.


All times are GMT -6. The time now is 09:40 PM.

vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI