Changeset 269 for trunk/export/CzWoW-bymaron/CzWoW.lua
- Timestamp:
- Aug 7, 2009, 12:31:41 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/export/CzWoW-bymaron/CzWoW.lua
r267 r269 3 3 local old_GossipFrameUpdate; 4 4 local old_QuestLog_Update; 5 local old_GossipFrameAvailableQuestsUpdate; 6 local old_GossipFrameActiveQuestsUpdate; 7 old_QuestLog_UpdateQuestDetails=QuestLog_UpdateQuestDetails; 8 old_GossipFrameOptionsUpdate=GossipFrameOptionsUpdate; 9 old_GossipFrameUpdate=GossipFrameUpdate; 10 old_QuestLog_Update=QuestLog_Update; 11 old_GossipFrameAvailableQuestsUpdate=GossipFrameAvailableQuestsUpdate; 12 old_GossipFrameActiveQuestsUpdate=GossipFrameActiveQuestsUpdate; 5 13 6 14 local trim=function(text) … … 9 17 end 10 18 11 local prepare=function(text) 12 return gsub(text, strchar(36)..strchar(66), strchar(10)); 19 local Translate=function(text) 20 local en = text; 21 text = trim(text); 22 if getglobal("CZWOW_QuestTitle_1")[text] then return getglobal("CZWOW_QuestTitle_1")[text]; 23 elseif getglobal("CZWOW_QuestObjective_1")[text] then return getglobal("CZWOW_QuestObjective_1")[text]; 24 elseif getglobal("CZWOW_QuestDescription_1")[text] then return getglobal("CZWOW_QuestDescription_1")[text]; 25 elseif getglobal("CZWOW_QuestProgress_1")[text] then return getglobal("CZWOW_QuestProgress_1")[text]; 26 elseif getglobal("CZWOW_QuestReward_1")[text] then return getglobal("CZWOW_QuestReward_1")[text]; 27 elseif getglobal("CZWOW_NPCAction_1")[text] then return getglobal("CZWOW_NPCAction_1")[text]; 28 elseif getglobal("CZWOW_BookPage_1")[text] then return getglobal("CZWOW_BookPage_1")[text]; 29 else 30 for i=1, CZWOW_NPCText_count, 1 do 31 if getglobal("CZWOW_NPCText_"..i)[text] then 32 return getglobal("CZWOW_NPCText_"..i)[text]; 33 end 34 end 35 return en; 36 end 13 37 end 14 38 15 39 CzWoW_OnLoad=function() 16 DEFAULT_CHAT_FRAME:AddMessage("CzWoW načteno. Zde by měl fungovat překlad výprav, NPC textů a textů knížek");40 DEFAULT_CHAT_FRAME:AddMessage("CzWoW načteno. Díky addonu by měl fungovat překlad výprav, NPC textů, textů knížek, rozhraní klienta, tutoriál. Pomoci překladu můžete na stránkách http://wowpreklad.zdechov.net/"); 17 41 end 18 42 … … 21 45 if QuestFrameRewardPanel:IsVisible() then QuestFrameRewardPanel_OnShow(); end 22 46 if QuestFrameDetailPanel:IsVisible() then QuestFrameDetailPanel_OnShow(); end 23 --if not QuestFrameDetailPanel:IsVisible() and not QuestFrameRewardPanel:IsVisible() and not QuestFrameRewardPanel:IsVisible() then QuestLog_UpdateQuestDetails(); end 24 ItemTextFrame_OnEvent(); 47 if ItemTextFrame:IsVisible() then ItemTextFrame_OnEvent(); end 25 48 end 26 old_QuestLog_UpdateQuestDetails=QuestLog_UpdateQuestDetails;27 old_GossipFrameOptionsUpdate=GossipFrameOptionsUpdate;28 old_GossipFrameUpdate=GossipFrameUpdate;29 old_QuestLog_Update=QuestLog_Update;30 49 50 --formuláře výprav u NPC 31 51 QuestFrameDetailPanel_OnShow=function() 32 52 if getglobal("CZWOW_QuestTitle_1")[trim(GetTitleText())] then 33 QuestTitleText:SetText( prepare(getglobal("CZWOW_QuestTitle_1")[trim(GetTitleText())]));34 QuestObjectiveText:SetText( prepare(getglobal("CZWOW_QuestObjective_1")[trim(GetObjectiveText())]));35 QuestDescription:SetText( prepare(getglobal("CZWOW_QuestDescription_1")[trim(GetQuestText())]));53 QuestTitleText:SetText(Translate(GetTitleText())); 54 QuestObjectiveText:SetText(Translate(GetObjectiveText())); 55 QuestDescription:SetText(Translate(GetQuestText())); 36 56 end 37 57 end … … 40 60 QuestFrameProgressPanel_OnShow=function() 41 61 if getglobal("CZWOW_QuestTitle_1")[trim(GetTitleText())] then 42 QuestProgressTitleText:SetText( prepare(getglobal("CZWOW_QuestTitle_1")[trim(GetTitleText())]));43 QuestProgressText:SetText( prepare(getglobal("CZWOW_QuestProgress_1")[trim(GetProgressText())]));62 QuestProgressTitleText:SetText(Translate(GetTitleText())); 63 QuestProgressText:SetText(Translate(GetProgressText())); 44 64 end 45 65 end … … 47 67 QuestFrameRewardPanel_OnShow=function() 48 68 if getglobal("CZWOW_QuestTitle_1")[trim(GetTitleText())] then 49 QuestRewardTitleText:SetText( prepare(getglobal("CZWOW_QuestTitle_1")[trim(GetTitleText())]));50 QuestRewardText:SetText( prepare(getglobal("CZWOW_QuestReward_1")[trim(GetRewardText())]));69 QuestRewardTitleText:SetText(Translate(GetTitleText())); 70 QuestRewardText:SetText(Translate(GetRewardText())); 51 71 end; 52 72 end 73 --konec formuláře výprav 53 74 75 --questlog 54 76 QuestLog_UpdateQuestDetails=function(...) 55 77 … … 59 81 local questObjectives; 60 82 questDescription, questObjectives=GetQuestLogQuestText(); 61 questObjectives=trim(questObjectives);62 questDescription=trim(questDescription);63 83 64 84 questLogTitleText, _, _, _, _, _, _, _ = GetQuestLogTitle(GetQuestLogSelection()); 65 85 if getglobal("CZWOW_QuestTitle_1")[trim(questLogTitleText)] then 66 QuestLogQuestTitle:SetText( prepare(getglobal("CZWOW_QuestTitle_1")[trim(questLogTitleText)]));67 QuestLogObjectivesText:SetText( prepare(getglobal("CZWOW_QuestObjective_1")[questObjectives]));68 QuestLogQuestDescription:SetText( prepare(getglobal("CZWOW_QuestDescription_1")[questDescription]));86 QuestLogQuestTitle:SetText(Translate(questLogTitleText)); 87 QuestLogObjectivesText:SetText(Translate(questObjectives)); 88 QuestLogQuestDescription:SetText(Translate(questDescription)); 69 89 end 70 90 end … … 72 92 QuestLog_Update=function() 73 93 old_QuestLog_Update(); 74 local numEntries, numQuests = GetNumQuestLogEntries(); 75 for i=1, numQuests, 1 do 76 --questIndex = i + FauxScrollFrame_GetOffset(QuestLogListScrollFrame); 77 QuestLogTitle=getglobal("QuestLogTitle"..i); 78 if QuestLogTitle then 79 local QuestLogTitleText=QuestLogTitle:GetText(); 80 if getglobal("CZWOW_QuestTitle_1")[trim(QuestLogTitleText)] then 81 QuestLogTitle:SetText(prepare(getglobal("CZWOW_QuestTitle_1")[trim(QuestLogTitleText)])); 82 end 83 end 94 local buttons = QuestLogScrollFrame.buttons; 95 local numButtons = #buttons; 96 local scrollOffset = HybridScrollFrame_GetOffset(QuestLogScrollFrame); 97 98 local questIndex, questTitleTag, questNumGroupMates, questNormalText, questCheck; 99 local title, level, questTag, suggestedGroup, isHeader, isCollapsed, isComplete, isDaily; 100 local partyMembersOnQuest, tempWidth, textWidth; 101 for i=1, numButtons do 102 local questLogTitle = buttons[i]; 103 questIndex = i + scrollOffset; 104 questLogTitle:SetID(questIndex); 105 title, _, _, _, _, _, _, _ = GetQuestLogTitle(questIndex); 106 if questLogTitle then questLogTitle:SetText(Translate(title)); end 84 107 end 85 108 end 109 --konec questlog 86 110 111 --Formuláře NPC postav 87 112 GossipFrameOptionsUpdate=function(...) 88 113 if select("#", ...)>0 then … … 90 115 for i=1, NUMGOSSIPBUTTONS, 1 do 91 116 titleButton=getglobal("GossipTitleButton" .. i); 92 -- titleButton:SetText("fsdfasd");93 117 local en=trim(titleButton:GetText()); 94 118 if getglobal("CZWOW_NPCAction_1")[en] then 95 titleButton:SetText( prepare(getglobal("CZWOW_NPCAction_1")[en]));119 titleButton:SetText(Translate(en)); 96 120 GossipResize(titleButton); 97 121 end 122 -- TODO: kontrolovat také s bez "The" 98 123 end 99 124 end … … 103 128 old_GossipFrameUpdate(); 104 129 local en=trim(GossipGreetingText:GetText()); 105 for i=1, CZWOW_NPCText_count, 1 do 106 if getglobal("CZWOW_NPCText_"..i)[en] then 107 GossipGreetingText:SetText(prepare(getglobal("CZWOW_NPCText_"..i)[en])) 108 end 130 GossipGreetingText:SetText(Translate(en)); 131 end; 132 133 GossipFrameActiveQuestsUpdate=function(...) 134 local titleButton; 135 local titleIndex = 1; 136 old_GossipFrameActiveQuestsUpdate(...); 137 for i=1, select("#", ...), 3 do 138 titleButton = _G["GossipTitleButton" .. titleIndex]; 139 if getglobal("CZWOW_QuestTitle_1")[trim(select(i, ...))] then 140 titleButton:SetText(Translate(select(i, ...))); 141 end 142 titleIndex = titleIndex + 1; 143 end 144 end 145 146 GossipFrameAvailableQuestsUpdate=function(...) 147 local titleButton; 148 local titleIndex = 1; 149 old_GossipFrameAvailableQuestsUpdate(...); 150 for i=1, select("#", ...), 3 do 151 titleButton = _G["GossipTitleButton" .. titleIndex]; 152 if getglobal("CZWOW_QuestTitle_1")[trim(select(i, ...))] then 153 titleButton:SetText(Translate(select(i, ...))); 154 end 155 titleIndex = titleIndex + 1; 156 end 157 end 158 --konec formuláře NPC postav 159 160 --page texty 161 ItemTextFrame_OnEvent=function(self, event, ...) 162 local en=ItemTextGetText(); 163 if getglobal("CZWOW_BookPage_1")[trim(en)] then 164 ItemTextPageText:SetText(Translate(en)); 109 165 end 110 166 end; 167 --konec page texty 111 168 112 ItemTextFrame_OnEvent=function(self, event, ...) 113 --ItemTextPageText=getglobal("ItemTextPageText"); 114 local en=trim(ItemTextGetText()); 115 if getglobal("CZWOW_BookPage_1")[en] then 116 ItemTextPageText:SetText(prepare(getglobal("CZWOW_BookPage_1")[en])); 117 end 118 end; 169 170 171 --DEFAULT_CHAT_FRAME:AddMessage("NPC");
Note:
See TracChangeset
for help on using the changeset viewer.