Quantcast Reskin Frame problem - WoWInterface
Thread Tools Display Modes
08-16-14, 12:20 PM   #1
Mayron
A Frostmaul Preserver
 
Mayron's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 260
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"

Last edited by Mayron : 08-17-14 at 06:16 AM.
  Reply With Quote
08-16-14, 02:34 PM   #2
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
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.
  Reply With Quote
08-17-14, 04:18 AM   #3
Mayron
A Frostmaul Preserver
 
Mayron's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 260
Originally Posted by Haleth View Post
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?

Last edited by Mayron : 08-17-14 at 04:42 AM.
  Reply With Quote
08-17-14, 04:35 AM   #4
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
That's fine then. I don't mind if you use small parts as long as credit is given
  Reply With Quote
08-17-14, 06:12 AM   #5
Mayron
A Frostmaul Preserver
 
Mayron's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 260
Originally Posted by Haleth View Post
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
  Reply With Quote
08-17-14, 06:38 AM   #6
Talyrius
An Onyxian Warder
 
Talyrius's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 361
When you manually drag frames around, they'll almost always land on fractional coordinates. This will negate your attempts to make things pixel perfect.
  Reply With Quote
08-17-14, 07:45 AM   #7
Mayron
A Frostmaul Preserver
 
Mayron's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 260
Originally Posted by Talyrius View Post
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!
  Reply With Quote
08-18-14, 04:42 AM   #8
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
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)
__________________
Author/maintainer of Grid, PhanxChat, oUF_Phanx, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
  Reply With Quote
08-18-14, 05:01 AM   #9
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
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.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Reskin Frame problem

Thread Tools
Display Modes

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