Changeset 756 for trunk/Modules/Export/files/2.4.3/CzWoW/CzWoW.lua
- Timestamp:
- Jan 16, 2014, 7:07:32 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Export/files/2.4.3/CzWoW/CzWoW.lua
r755 r756 51 51 DEFAULT_CHAT_FRAME:AddMessage("CzWoW načteno. "..a); 52 52 if CZWOW_disableforthischar then DEFAULT_CHAT_FRAME:AddMessage("|c00ff0000 Příjemné hraní s českým wow. Pomoct na překladu můžete na stránkách: http://wowpreklad.zdechov.net/|r");end 53 end 53 54 GameTooltip:HookScript("OnUpdate",GameObjectChange); 55 if(GameTooltip:GetScript("OnTooltipSetItem")) then 56 GameTooltip:HookScript("OnTooltipSetItem",ItemChangeName); 57 else 58 GameTooltip:SetScript("OnTooltipSetItem",ItemChangeName); 59 end 60 for nn, tooltip in ipairs(TooltipList) do 61 if tooltip then 62 for _, methodName in ipairs(MethodList) do 63 hooksecurefunc(tooltip, methodName, ItemChangeName); 64 end 65 end 66 end 67 68 end 69 70 --------Translate item------------------ 71 TooltipList = { 72 ItemRefTooltip, 73 GameTooltip, 74 ShoppingTooltip1, 75 ShoppingTooltip2, 76 ComparisonTooltip1, 77 ComparisonTooltip2, 78 } 79 80 MethodList = { 81 "SetLootItem", 82 "SetHyperlink", 83 "SetBagItem", 84 "SetInventoryItem", 85 "SetAuctionItem", 86 "SetAuctionSellItem", 87 "SetLootRollItem", 88 "SetTradeSkillItem", 89 "SetTrainerService", 90 "SetInboxItem", 91 "SetSendMailItem", 92 "SetQuestItem", 93 "SetQuestLogItem", 94 "SetTradePlayerItem", 95 "SetTradeTargetItem", 96 "SetMerchantItem", 97 "SetHyperlinkCompareItem", 98 "SetBuybackItem", 99 } 100 101 function TranslateTooltip(this) 102 if this then 103 local text = this:GetText(); 104 for i=1, CZWOW_ItemName_count, 1 do 105 if getglobal("CZWOW_ItemName_"..i)[trim(text)] then 106 text = getglobal("CZWOW_ItemName_"..i)[trim(text)]; 107 end 108 end 109 -- text = "bleble"; 110 -- DEFAULT_CHAT_FRAME:AddMessage(text); 111 this:SetText(text); 112 end 113 end 114 115 function ItemChangeName(this) 116 local name = "test ěščřžýáíéůú fsd fa"; 117 if CZWOW_ItemName_count > 0 then 118 TranslateTooltip(GameTooltipTextLeft1); 119 TranslateTooltip(ItemRefTooltipTextLeft1); 120 TranslateTooltip(ShoppingTooltip1TextLeft2); 121 TranslateTooltip(ShoppingTooltip2TextLeft2); 122 TranslateTooltip(ComparisonTooltip1TextLeft4); 123 TranslateTooltip(ComparisonTooltip2TextLeft6); 124 --/run 125 end 126 if CZWOW_ItemDescription_count > 0 then 127 for i=1,GameTooltip:NumLines()do 128 local mytext=_G["GameTooltipTextLeft"..i]; 129 if "\"" == strsub(mytext:GetText(), 0,1) then 130 local text = strsub(mytext:GetText(), 2,strlen(mytext:GetText())-2); 131 text = text.."."; 132 for i=1, CZWOW_ItemDescription_count, 1 do 133 if getglobal("CZWOW_ItemDescription_"..i)[trim(text)] then 134 text = getglobal("CZWOW_ItemDescription_"..i)[trim(text)]; 135 end 136 end 137 mytext:SetText("\""..text.."\""); 138 end 139 end 140 end 141 142 this:Show(); 143 end 144 ---------item at vendor------ 145 local old_MerchantFrame_UpdateMerchantInfo = MerchantFrame_UpdateMerchantInfo; 146 function MerchantFrame_UpdateMerchantInfo() 147 old_MerchantFrame_UpdateMerchantInfo(); 148 local numMerchantItems = GetMerchantNumItems(); 149 for i=1, MERCHANT_ITEMS_PER_PAGE, 1 do 150 local index = (((MerchantFrame.page - 1) * MERCHANT_ITEMS_PER_PAGE) + i); 151 if ( index <= numMerchantItems ) then 152 name, texture, price, quantity, numAvailable, isUsable, extendedCost = GetMerchantItemInfo(index); 153 local text = name; 154 for i=1, CZWOW_ItemName_count, 1 do 155 if getglobal("CZWOW_ItemName_"..i)[trim(text)] then 156 text = getglobal("CZWOW_ItemName_"..i)[trim(text)]; 157 end 158 end 159 getglobal("MerchantItem"..i.."Name"):SetText(text); 160 end 161 end 162 end 163 164 -------item at loot-------------------- 165 local old_LootFrame_Update = LootFrame_Update; 166 function LootFrame_Update() 167 old_LootFrame_Update(); 168 local numLootItems = LootFrame.numLootItems; 169 --Logic to determine how many items to show per page 170 local numLootToShow = LOOTFRAME_NUMBUTTONS; 171 if ( numLootItems > LOOTFRAME_NUMBUTTONS ) then 172 numLootToShow = numLootToShow - 1; 173 end 174 local texture, item, quantity, quality; 175 local button, countString, color; 176 for index = 1, LOOTFRAME_NUMBUTTONS do 177 local slot = (numLootToShow * (LootFrame.page - 1)) + index; 178 texture, item, quantity, quality = GetLootSlotInfo(slot); 179 180 local text = item; 181 for i=1, CZWOW_ItemName_count, 1 do 182 if getglobal("CZWOW_ItemName_"..i)[trim(text)] then 183 text = getglobal("CZWOW_ItemName_"..i)[trim(text)]; 184 end 185 end 186 187 getglobal("LootButton"..index.."Text"):SetText(text); 188 end 189 end 190 191 ---------translate gameobject---------- 192 function GameObjectChange(this) 193 if 1 == GameTooltip:NumLines() then 194 if CZWOW_ObjectName_count > 0 then 195 if GameTooltipTextLeft1 then 196 for i=1, CZWOW_ObjectName_count, 1 do 197 local text = GameTooltipTextLeft1:GetText(); 198 if getglobal("CZWOW_ObjectName_"..i)[trim(text)] then 199 GameTooltipTextLeft1:SetText(getglobal("CZWOW_ObjectName_"..i)[trim(text)]); 200 end 201 end 202 GameTooltip:Show(); 203 end; 204 end 205 end 206 end 207 54 208 55 209 CzWoW_OnEvent=function(event)
Note:
See TracChangeset
for help on using the changeset viewer.