Changeset 756 for trunk/Modules/Export/files/5.4.0
- Timestamp:
- Jan 16, 2014, 7:07:32 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Export/files/5.4.0/CzWoW/CzWoW.lua
r694 r756 5 5 6 6 Debug = false; --turn this when you want to compare trim english text with text database 7 7 8 8 ------------------- 9 9 --global function-- … … 62 62 if getglobal("CZWOW_NPCText_"..i)[text] then 63 63 return getglobal("CZWOW_NPCText_"..i)[text]; 64 end 65 end 66 for i=1, CZWOW_ItemName_count, 1 do 67 if getglobal("CZWOW_ItemName_"..i)[text] then 68 return getglobal("CZWOW_ItemName_"..i)[text]; 69 end 70 end 71 for i=1, CZWOW_ItemDescription_count, 1 do 72 if getglobal("CZWOW_ItemDescription_"..i)[text] then 73 return getglobal("CZWOW_ItemDescription_"..i)[text]; 64 74 end 65 75 end … … 108 118 self:RegisterEvent("QUEST_LOG_UPDATE"); 109 119 110 if(GameTooltip:GetScript("OnTooltipSetItem")) then 120 121 GameTooltip:HookScript("OnUpdate",GameObjectChange); 122 if(GameTooltip:GetScript("OnTooltipSetItem")) then 111 123 GameTooltip:HookScript("OnTooltipSetItem",ItemChangeName); 112 124 else 113 125 GameTooltip:SetScript("OnTooltipSetItem",ItemChangeName); 114 126 end 115 127 for nn, tooltip in ipairs(TooltipList) do 128 if tooltip then 129 for _, methodName in ipairs(MethodList) do 130 hooksecurefunc(tooltip, methodName, ItemChangeName); 131 end 132 end 133 end 134 135 end 136 137 --------Translate item------------------ 138 TooltipList = { 139 ItemRefTooltip, 140 GameTooltip, 141 ShoppingTooltip1, 142 ShoppingTooltip2, 143 ComparisonTooltip1, 144 ComparisonTooltip2, 145 } 146 147 MethodList = { 148 "SetLootItem", 149 "SetHyperlink", 150 "SetBagItem", 151 "SetInventoryItem", 152 "SetAuctionItem", 153 "SetAuctionSellItem", 154 "SetLootRollItem", 155 "SetTradeSkillItem", 156 "SetTrainerService", 157 "SetInboxItem", 158 "SetSendMailItem", 159 "SetQuestItem", 160 "SetQuestLogItem", 161 "SetTradePlayerItem", 162 "SetTradeTargetItem", 163 "SetMerchantItem", 164 "SetHyperlinkCompareItem", 165 "SetBuybackItem", 166 } 167 168 function TranslateTooltip(this) 169 if this then 170 local text = this:GetText(); 171 text = Translate(text); 172 -- text = "bleble"; 173 this:SetText(text); 174 end 116 175 end 117 176 118 177 function ItemChangeName(this) 119 local name,link = this:GetItem(); 120 -- this:SetText("Fs"); 121 -- this:UpdateTooltip(this); 122 -- this:SetText("Fa"); 123 124 -- this:AddLine("Item name: "..name); 125 -- this:Show(); 126 end 178 local name = "test ěščřžýáíéůú fsd fa"; 179 if CZWOW_ItemName_count > 0 then 180 TranslateTooltip(GameTooltipTextLeft1); 181 TranslateTooltip(ItemRefTooltipTextLeft1); 182 TranslateTooltip(ShoppingTooltip1TextLeft2); 183 TranslateTooltip(ShoppingTooltip2TextLeft2); 184 TranslateTooltip(ComparisonTooltip1TextLeft4); 185 TranslateTooltip(ComparisonTooltip2TextLeft6); 186 --/run 187 end 188 if CZWOW_ItemDescription_count > 0 then 189 for i=1,GameTooltip:NumLines()do 190 local mytext=_G["GameTooltipTextLeft"..i]; 191 if "\"" == strsub(mytext:GetText(), 0,1) then 192 local text = strsub(mytext:GetText(), 2,strlen(mytext:GetText())-2); 193 text = Translate(text.."."); 194 mytext:SetText("\""..text.."\""); 195 end 196 end 197 end 198 199 this:Show(); 200 end 201 202 ---------translate gameobject---------- 203 function GameObjectChange(this) 204 if 1 == GameTooltip:NumLines() then 205 if CZWOW_ObjectName_count > 0 then 206 if GameTooltipTextLeft1 then 207 for i=1, CZWOW_ObjectName_count, 1 do 208 local text = trim(GameTooltipTextLeft1:GetText()); 209 if getglobal("CZWOW_ObjectName_"..i)[text] then 210 GameTooltipTextLeft1:SetText(getglobal("CZWOW_ObjectName_"..i)[text]); 211 end 212 end 213 GameTooltip:Show(); 214 end; 215 end 216 end 217 end 218 127 219 128 220 … … 245 337 questLogTitle:SetID(questIndex); 246 338 title, _, _, _, _, _, _, _ = GetQuestLogTitle(questIndex); 247 if questLogTitle then questLogTitle:SetText(Translate(title)); end 339 if questLogTitle then questLogTitle:SetText(Translate(title)); end 248 340 end 249 341 end
Note:
See TracChangeset
for help on using the changeset viewer.