Changeset 757 for trunk/Modules
- Timestamp:
- Jan 20, 2014, 1:23:03 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Export/files/5.4.0/CzWoW/CzWoW.lua
r756 r757 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-- … … 64 64 end 65 65 end 66 for i=1, CZWOW_ItemName_count, 1 do67 if getglobal("CZWOW_ItemName_"..i)[text] then68 return getglobal("CZWOW_ItemName_"..i)[text];69 end70 end71 for i=1, CZWOW_ItemDescription_count, 1 do72 if getglobal("CZWOW_ItemDescription_"..i)[text] then73 return getglobal("CZWOW_ItemDescription_"..i)[text];74 end75 end76 66 return en; 77 67 78 68 end 79 69 … … 118 108 self:RegisterEvent("QUEST_LOG_UPDATE"); 119 109 120 121 GameTooltip:HookScript("OnUpdate",GameObjectChange); 122 if(GameTooltip:GetScript("OnTooltipSetItem")) then 110 if(GameTooltip:GetScript("OnTooltipSetItem")) then 123 111 GameTooltip:HookScript("OnTooltipSetItem",ItemChangeName); 124 112 else 125 113 GameTooltip:SetScript("OnTooltipSetItem",ItemChangeName); 126 114 end 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 115 175 116 end 176 117 177 118 function ItemChangeName(this) 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 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 219 127 220 128 … … 337 245 questLogTitle:SetID(questIndex); 338 246 title, _, _, _, _, _, _, _ = GetQuestLogTitle(questIndex); 339 if questLogTitle then questLogTitle:SetText(Translate(title)); end 247 if questLogTitle then questLogTitle:SetText(Translate(title)); end 340 248 end 341 249 end
Note:
See TracChangeset
for help on using the changeset viewer.