Thread: GameFontBlack
View Single Post
02-27-11, 01:52 PM   #17
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
It appears the text is set up for "Parchment" material by default and makes a call to GetMaterialTextColors() to get new colors if a different material is to be used.

Here are the related XML objects and Lua code you should look at for making that specific modification.



QuestInfo.xml:282
xml Code:
  1. <Frame name="QuestInfoFrame" hidden="true">
  2.     <Size>
  3.         <AbsDimension x="300" y="100"/>
  4.     </Size>
  5.     <Layers>
  6.         <Layer level="BACKGROUND">
  7.             <FontString name="QuestInfoTitleHeader" inherits="QuestTitleFont" justifyH="LEFT" text="Quest title">
  8.                 <Size>
  9.                     <AbsDimension x="285" y="0"/>
  10.                 </Size>
  11.             </FontString>
  12.             <FontString name="QuestInfoObjectivesText" inherits="QuestFont" justifyH="LEFT">
  13.                 <Size>
  14.                     <AbsDimension x="285" y="0"/>
  15.                 </Size>
  16.             </FontString>
  17.             <FontString name="QuestInfoRewardText" inherits="QuestFont" justifyH="LEFT">
  18.                 <Size>
  19.                     <AbsDimension x="285" y="0"/>
  20.                 </Size>
  21.             </FontString>
  22.             <FontString name="QuestInfoRequiredMoneyText" inherits="QuestFontNormalSmall" text="REQUIRED_MONEY" />
  23.             <FontString name="QuestInfoGroupSize" inherits="QuestFont" />
  24.             <FontString name="QuestInfoAnchor" inherits="QuestFont" />
  25.             <FontString name="QuestInfoDescriptionHeader" inherits="QuestTitleFont" justifyH="LEFT" text="QUEST_DESCRIPTION">
  26.                 <Size>
  27.                     <AbsDimension x="285" y="0"/>
  28.                 </Size>
  29.             </FontString>
  30.             <FontString name="QuestInfoObjectivesHeader" inherits="QuestTitleFont" text="QUEST_OBJECTIVES"  justifyH="LEFT">
  31.                 <Size>
  32.                     <AbsDimension x="285" y="0"/>
  33.                 </Size>
  34.             </FontString>
  35.             <FontString name="QuestInfoDescriptionText" inherits="QuestFont" justifyH="LEFT">
  36.                 <Size>
  37.                     <AbsDimension x="285" y="0"/>
  38.                 </Size>
  39.             </FontString>
  40.         </Layer>
  41.     </Layers>
  42.     <Frames>
  43.         <Frame name="QuestInfoFadingFrame">                            
  44.             <Size>
  45.                 <AbsDimension x="1" y="1"/>
  46.             </Size>
  47.             <Scripts>
  48.                 <OnUpdate function="QuestInfoFadingFrame_OnUpdate"/>
  49.             </Scripts>
  50.         </Frame>
  51.         <Frame name="QuestInfoSpacerFrame">
  52.             <Size>
  53.                 <AbsDimension x="5" y="5"/>
  54.             </Size>
  55.         </Frame>           
  56.     </Frames>
  57.     <Scripts>
  58.         <OnLoad>
  59.             self.material = "Parchment";
  60.         </OnLoad>
  61.     </Scripts>
  62. </Frame>



QuestInfo.lua:29
lua Code:
  1. function QuestInfo_Display(template, parentFrame, acceptButton, material)
  2.     local lastFrame, shownFrame, bottomShownFrame; 
  3.     local elementsTable = template.elements;
  4.     local bottomShownFrame;
  5.    
  6.     QuestInfoFrame.questLog = template.questLog;
  7.     QuestInfoFrame.chooseItems = template.chooseItems;
  8.     QuestInfoFrame.tooltip = template.tooltip; 
  9.     QuestInfoFrame.acceptButton = acceptButton;
  10.    
  11.     if ( QuestInfoFrame.material ~= material ) then
  12.         QuestInfoFrame.material = material;
  13.         local textColor, titleTextColor = GetMaterialTextColors(material); 
  14.         -- headers
  15.         QuestInfoTitleHeader:SetTextColor(titleTextColor[1], titleTextColor[2], titleTextColor[3]);
  16.         QuestInfoDescriptionHeader:SetTextColor(titleTextColor[1], titleTextColor[2], titleTextColor[3]);
  17.         QuestInfoObjectivesHeader:SetTextColor(titleTextColor[1], titleTextColor[2], titleTextColor[3]);
  18.         QuestInfoRewardsHeader:SetTextColor(titleTextColor[1], titleTextColor[2], titleTextColor[3]);
  19.         -- other text
  20.         QuestInfoDescriptionText:SetTextColor(textColor[1], textColor[2], textColor[3]);
  21.         QuestInfoObjectivesText:SetTextColor(textColor[1], textColor[2], textColor[3]);
  22.         QuestInfoGroupSize:SetTextColor(textColor[1], textColor[2], textColor[3]);
  23.         QuestInfoRewardText:SetTextColor(textColor[1], textColor[2], textColor[3]);
  24.         -- reward frame text
  25.         QuestInfoItemChooseText:SetTextColor(textColor[1], textColor[2], textColor[3]);
  26.         QuestInfoItemReceiveText:SetTextColor(textColor[1], textColor[2], textColor[3]);
  27.         QuestInfoSpellLearnText:SetTextColor(textColor[1], textColor[2], textColor[3]);    
  28.         QuestInfoXPFrameReceiveText:SetTextColor(textColor[1], textColor[2], textColor[3]);
  29.     end
  30.    
  31.     for i = 1, #elementsTable, 3 do
  32.         shownFrame, bottomShownFrame = elementsTable[i]();
  33.         if ( shownFrame ) then
  34.             shownFrame:SetParent(parentFrame);
  35.             if ( lastFrame ) then
  36.                 shownFrame:SetPoint("TOPLEFT", lastFrame, "BOTTOMLEFT", elementsTable[i+1], elementsTable[i+2]);
  37.             else
  38.                 shownFrame:SetPoint("TOPLEFT", parentFrame, "TOPLEFT", elementsTable[i+1], elementsTable[i+2]);        
  39.             end
  40.             lastFrame = bottomShownFrame or shownFrame;
  41.         end
  42.     end
  43. end
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote