Ignore:
Timestamp:
Jan 20, 2014, 1:23:03 PM (11 years ago)
Author:
maron
Message:
  • Fixed: come back to old version addon for 5.4.x
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Export/files/5.4.0/CzWoW/CzWoW.lua

    r756 r757  
    55
    66Debug = false;    --turn this when you want to compare trim english text with text database
    7  
     7
    88-------------------
    99--global function--
     
    6464                end
    6565        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];
    74                 end
    75         end
    7666     return en;
    77  
     67     
    7868end   
    7969
     
    118108  self:RegisterEvent("QUEST_LOG_UPDATE");
    119109 
    120  
    121   GameTooltip:HookScript("OnUpdate",GameObjectChange);
    122   if(GameTooltip:GetScript("OnTooltipSetItem")) then
     110        if(GameTooltip:GetScript("OnTooltipSetItem")) then
    123111                GameTooltip:HookScript("OnTooltipSetItem",ItemChangeName);
    124112        else
    125113                GameTooltip:SetScript("OnTooltipSetItem",ItemChangeName);
    126114        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 
    175116end
    176117
    177118function 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();
     126end
    219127
    220128
     
    337245                questLogTitle:SetID(questIndex);
    338246                        title, _, _, _, _, _, _, _ = GetQuestLogTitle(questIndex);
    339                         if questLogTitle then questLogTitle:SetText(Translate(title));  end 
     247                        if questLogTitle then questLogTitle:SetText(Translate(title));  end
    340248        end
    341249end
Note: See TracChangeset for help on using the changeset viewer.