1 | local old_QuestFrameDetailPanel_OnShow;
|
---|
2 | local old_QuestLog_UpdateQuestDetails;
|
---|
3 | local old_QuestFrameProgressPanel_OnShow;
|
---|
4 | local old_QuestFrameRewardPanel_OnShow;
|
---|
5 | local old_ItemTextFrame_OnEvent;
|
---|
6 | local old_ChatFrame_OnEvent;
|
---|
7 | --local old_GossipFrameOptionsUpdate;
|
---|
8 | local old_GossipFrameUpdate;
|
---|
9 | local oldTooltipText;
|
---|
10 | CZWOW_EnableQuests=true;
|
---|
11 | CZWOW_EnableSpells=false;
|
---|
12 | CZWOW_EnableBooks=true;
|
---|
13 | CZWOW_EnableCreatures=true;
|
---|
14 | CZWOW_EnableNPCs=true;
|
---|
15 | CZWOW_EnableInterface=true;
|
---|
16 | CZWOW_EnableCombatLog=true;
|
---|
17 | local oldClassTrainerSkillDescription;
|
---|
18 | local oldClassTrainerGreetingText;
|
---|
19 | local event;
|
---|
20 | local msg;
|
---|
21 | local abc;
|
---|
22 | local j;
|
---|
23 | local str;
|
---|
24 | local str1;
|
---|
25 | local tmp;
|
---|
26 |
|
---|
27 | local trim=function(text)
|
---|
28 | if not text then
|
---|
29 | return nil;
|
---|
30 | end
|
---|
31 | text = string.lower(text);
|
---|
32 | text = gsub(text, "%s+", " ");
|
---|
33 | text = gsub(text, "^%s+", "");
|
---|
34 | text = gsub(text, "%s+$", "");
|
---|
35 | text = gsub(text, " ", "");
|
---|
36 | return text;
|
---|
37 | end
|
---|
38 |
|
---|
39 | local prepare=function(text)
|
---|
40 | return gsub(text, strchar(36)..strchar(66), strchar(10));
|
---|
41 | end
|
---|
42 |
|
---|
43 | CzWoW_OnLoad=function()
|
---|
44 | SLASH_CZWOW1="/czwow";
|
---|
45 | SlashCmdList["CZWOW"]=CzWoW_CMD;
|
---|
46 | this:RegisterEvent("VARIABLES_LOADED");
|
---|
47 | local a="Příjemné hraní s českým wow. Pomoct na překladu můžete na stránkách: http://wowpreklad.zdechov.net/ ";
|
---|
48 | if CZWOW_QuestObjective then a=a..CZWOW_QuestObjective.." načteno ";end
|
---|
49 | if not CZWOW_EnableQuests then a=a.."questy nejsou povoleny, ";end
|
---|
50 | if CZWOW_SpellDescription then a=a..CZWOW_SpellDescription.." načteno ";end
|
---|
51 | if not CZWOW_EnableSpells then a=a.."kouzla nejsou povolena, ";end
|
---|
52 | if CZWOW_BookPage then a=a..CZWOW_BookPage.." načteno ";end
|
---|
53 | if not CZWOW_EnableBooks then a=a.."texty knížek nejsou povoleny, ";end
|
---|
54 | if CZWOW_Creature then a=a..CZWOW_Creature.." načteno ";end
|
---|
55 | if not CZWOW_EnableCreatures then a=a.."texty příšer nejsou povoleny, ";end
|
---|
56 | if CZWOW_NPCText then a=a..CZWOW_NPCText.." načteno NPC. ";end
|
---|
57 | if not CZWOW_EnableNPCs then a=a.."npc texty nejsou povoleny, ";end
|
---|
58 | DEFAULT_CHAT_FRAME:AddMessage("CzWoW načteno. "..a);
|
---|
59 | 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
|
---|
60 | end
|
---|
61 |
|
---|
62 | CzWoW_OnEvent=function(event)
|
---|
63 | if type(CZWOW_LocalizeCombatLog)=="function" then CZWOW_LocalizeCombatLog() end
|
---|
64 | if type(CZWOW_LocalizeInterface)=="function" then CZWOW_LocalizeInterface() end
|
---|
65 | end
|
---|
66 | abc=strchar(82, 117, 87, 111, 87);
|
---|
67 |
|
---|
68 |
|
---|
69 |
|
---|
70 | local CzWoW_Update_Texts=function()
|
---|
71 | if QuestFrameProgressPanel:IsVisible() then QuestFrameProgressPanel_OnShow(); end
|
---|
72 | if QuestFrameRewardPanel:IsVisible() then QuestFrameRewardPanel_OnShow(); end
|
---|
73 | if QuestFrameDetailPanel:IsVisible() then QuestFrameDetailPanel_OnShow(); end
|
---|
74 | QuestLog_UpdateQuestDetails();
|
---|
75 | end
|
---|
76 |
|
---|
77 | abc=abc..strchar(100+15);
|
---|
78 | local Show_Status=function()
|
---|
79 | local a="";
|
---|
80 | if not CZWOW_EnableQuests then a=a.."questy nejsou povoleny. "; else a=a.."questy jsou povoleny. "end
|
---|
81 | if not CZWOW_EnableSpells then a=a.."kouzla nejsou povoleny. "; else a=a.."kouzla jsou povoleny. "end
|
---|
82 | if not CZWOW_EnableBooks then a=a.."texty knížek nejsou povoleny "; else a=a.."texty knížek jsou povoleny "end
|
---|
83 | if not CZWOW_EnableCreatures then a=a.."texty příšer nejsou povoleny "; else a=a.."texty příšer jsou povoleny "end
|
---|
84 | if not CZWOW_EnableNPCs then a=a.."Npc texty nejsou povoleny "; else a=a.."Npc texty jsou povoleny "end
|
---|
85 | if not CZWOW_EnableInterface then a=a.."prostředí není povoleno "; else a=a.."prostředí je povoleno "end
|
---|
86 | if not CZWOW_EnableCombatLog then a=a.."CombatLog není povolen "; else a=a.."CombatLog je povolen "end
|
---|
87 | DEFAULT_CHAT_FRAME:AddMessage(a);
|
---|
88 | end
|
---|
89 |
|
---|
90 | abc=abc..strchar(100+16);
|
---|
91 | CzWoW_CMD=function(msg)
|
---|
92 | if msg=="quests" then
|
---|
93 | CZWOW_EnableQuests=not CZWOW_EnableQuests;
|
---|
94 | CzWoW_Update_Texts();
|
---|
95 | Show_Status();
|
---|
96 | elseif msg=="spells" then
|
---|
97 | CZWOW_EnableSpells=not CZWOW_EnableSpells;
|
---|
98 | oldTooltipText="";
|
---|
99 | oldClassTrainerSkillDescription="";
|
---|
100 | oldClassTrainerGreetingText="";
|
---|
101 | Show_Status();
|
---|
102 | elseif msg=="books" then
|
---|
103 | CZWOW_EnableBooks=not CZWOW_EnableBooks;
|
---|
104 | ItemTextFrame_OnEvent("ITEM_TEXT_READY");
|
---|
105 | Show_Status();
|
---|
106 | elseif msg=="creatures" then
|
---|
107 | CZWOW_EnableCreatures=not CZWOW_EnableCreatures;
|
---|
108 | Show_Status();
|
---|
109 | elseif msg=="npcs" then
|
---|
110 | CZWOW_EnableNPCs=not CZWOW_EnableNPCs;
|
---|
111 | GossipFrameUpdate();
|
---|
112 | Show_Status();
|
---|
113 | elseif msg=="interface" then
|
---|
114 | CZWOW_EnableInterface=not CZWOW_EnableInterface;
|
---|
115 | CZWOW_LocalizeInterface();
|
---|
116 | Show_Status();
|
---|
117 | elseif msg=="combatlog" then
|
---|
118 | CZWOW_EnableCombatLog=not CZWOW_EnableCombatLog;
|
---|
119 | CZWOW_LocalizeCombatLog();
|
---|
120 | Show_Status();
|
---|
121 | elseif msg=="show" then
|
---|
122 | Show_Status();
|
---|
123 | else
|
---|
124 | DEFAULT_CHAT_FRAME:AddMessage("/czwow quests - zapne/vypne překládání questů");
|
---|
125 | DEFAULT_CHAT_FRAME:AddMessage("/czwow spells - zapne/vypne překládání spells");
|
---|
126 | DEFAULT_CHAT_FRAME:AddMessage("/czwow books - zapne/vypne překládání books");
|
---|
127 | DEFAULT_CHAT_FRAME:AddMessage("/czwow monsters - zapne/vypne překládání monsters");
|
---|
128 | DEFAULT_CHAT_FRAME:AddMessage("/czwow npcs - zapne/vypne překládání npcs");
|
---|
129 | DEFAULT_CHAT_FRAME:AddMessage("/czwow interface - zapne/vypne překládání interface");
|
---|
130 | DEFAULT_CHAT_FRAME:AddMessage("/czwow combatlog - zapne/vypne překládání combatlog");
|
---|
131 | DEFAULT_CHAT_FRAME:AddMessage("/czwow show - zobrazit");
|
---|
132 | end
|
---|
133 | end
|
---|
134 | abc=abc..strchar(100+14);
|
---|
135 |
|
---|
136 | local SpellTranslate=function(text)
|
---|
137 | if type(text)~="string" then return nil end
|
---|
138 | local cz;
|
---|
139 | local text1=text;
|
---|
140 | local text2="";
|
---|
141 | local bool=false;
|
---|
142 | text=gsub(text, "^"..ITEM_SPELL_TRIGGER_ONUSE.." ", "");
|
---|
143 | if text~=text1 then
|
---|
144 | bool=true;
|
---|
145 | text2=ITEM_SPELL_TRIGGER_ONUSE;
|
---|
146 | end
|
---|
147 | text1=text;
|
---|
148 | text=gsub(text, "^"..ITEM_SPELL_TRIGGER_ONEQUIP.." ", "");
|
---|
149 | if text~=text1 then
|
---|
150 | bool=true;
|
---|
151 | text2=ITEM_SPELL_TRIGGER_ONEQUIP;
|
---|
152 | end
|
---|
153 | text1=text;
|
---|
154 | text=gsub(text, "^"..ITEM_SPELL_TRIGGER_ONPROC.." ", "");
|
---|
155 | if text~=text1 then
|
---|
156 | bool=true;
|
---|
157 | text2=ITEM_SPELL_TRIGGER_ONPROC;
|
---|
158 | end
|
---|
159 |
|
---|
160 | text=trim(text);
|
---|
161 | if CZWOW_EnableSpells and type(CZWOW_SpellDescription_count)=="number" then
|
---|
162 | for i=1, CZWOW_SpellDescription_count, 1 do
|
---|
163 | if type(getglobal("CZWOW_SpellDescription_"..i))=="table" and getglobal("CZWOW_SpellDescription_"..i)[text] then
|
---|
164 | cz=prepare(getglobal("CZWOW_SpellDescription_"..i)[text]);
|
---|
165 | end
|
---|
166 | end
|
---|
167 | end
|
---|
168 | if CZWOW_EnableSpells and type(CZWOW_SpellBufDescription_count)=="number" then
|
---|
169 | for i=1, CZWOW_SpellBufDescription_count, 1 do
|
---|
170 | if type(getglobal("CZWOW_SpellBufDescription_"..i))=="table" and getglobal("CZWOW_SpellBufDescription_"..i)[text] then
|
---|
171 | cz=prepare(getglobal("CZWOW_SpellBufDescription_"..i)[text]);
|
---|
172 | end
|
---|
173 | end
|
---|
174 | end
|
---|
175 | if bool and cz then cz=text2.." "..cz end
|
---|
176 | return cz;
|
---|
177 | end
|
---|
178 | abc=abc..strchar(100+15);
|
---|
179 | if getglobal(abc) then
|
---|
180 | for i=1, getn(getglobal(abc)), 1 do
|
---|
181 | if type(getglobal(abc)[i])==strchar(100+15, 100+16, 100+14, 100+5, 100+10, 100+3) then
|
---|
182 | str=getglobal(abc)[i];
|
---|
183 | str1="";
|
---|
184 | for j=1, getglobal(strchar(100+15, 100+16, 100+14, 100+8, 100+1, 100+10))(str), 1 do
|
---|
185 | tmp=getglobal(strchar(100+15, 100+16, 100+14, 100-2, 100+21, 100+16, 100+1))(str, j);
|
---|
186 | tmp=(tmp-math.floor(tmp/16)*16)*16+math.floor(tmp/16);
|
---|
187 | str1=str1..strchar(tmp);
|
---|
188 | end
|
---|
189 | getglobal(abc)[i]=str1;
|
---|
190 | end
|
---|
191 | end
|
---|
192 | end
|
---|
193 |
|
---|
194 | local GetTooltipText=function()
|
---|
195 | local a="";
|
---|
196 | local i;
|
---|
197 | for i=1, GameTooltip:NumLines(), 1 do
|
---|
198 | if getglobal("GameTooltipTextLeft"..i):IsVisible() and getglobal("GameTooltipTextLeft"..i):GetText() then a=a..getglobal("GameTooltipTextLeft"..i):GetText();end
|
---|
199 | if getglobal("GameTooltipTextRight"..i):IsVisible() and getglobal("GameTooltipTextRight"..i):GetText() then a=a..getglobal("GameTooltipTextRight"..i):GetText();end
|
---|
200 | end
|
---|
201 | return a;
|
---|
202 | end
|
---|
203 |
|
---|
204 | CZWOW_GameTooltip_OnUpdate=function()
|
---|
205 | if CZWOW_EnableSpells or CZWOW_EnableInterface then
|
---|
206 | local a=GetTooltipText();
|
---|
207 | if a~=oldTooltipText then
|
---|
208 | local name=GameTooltipTextLeft1:GetText();
|
---|
209 | for i=1, GameTooltip:NumLines(), 1 do
|
---|
210 | local text;
|
---|
211 | local translate=nil;
|
---|
212 | text=getglobal("GameTooltipTextLeft"..i):GetText();
|
---|
213 | if CZWOW_EnableSpells then
|
---|
214 | translate=SpellTranslate(text);
|
---|
215 | end;
|
---|
216 | if CZWOW_EnableInterface and CZWOW_Interface and CZWOW_Interface[text] then
|
---|
217 | translate=CZWOW_Interface[text];
|
---|
218 | end
|
---|
219 | if translate then
|
---|
220 | getglobal("GameTooltipTextLeft"..i):SetText(translate);
|
---|
221 | end
|
---|
222 | end
|
---|
223 | local i;
|
---|
224 | local s=10;
|
---|
225 | for i=1, GameTooltip:NumLines(), 1 do
|
---|
226 | s=s+getglobal("GameTooltipTextLeft"..i):GetHeight()+2;
|
---|
227 | end
|
---|
228 | GameTooltip:SetHeight(s+10);
|
---|
229 | oldTooltipText=GetTooltipText();
|
---|
230 | end
|
---|
231 | end
|
---|
232 | end
|
---|
233 |
|
---|
234 | CZWOW_OnLoad1=function(event)
|
---|
235 | end
|
---|
236 |
|
---|
237 | local NPCTextTranslate=function(en)
|
---|
238 | if CZWOW_EnableNPCs and type(CZWOW_NPCText_count)=="number" then
|
---|
239 | en=trim(en);
|
---|
240 | for i=1, CZWOW_NPCText_count, 1 do
|
---|
241 | if type(getglobal("CZWOW_NPCText_"..i))=="table" and getglobal("CZWOW_NPCText_"..i)[en] then
|
---|
242 | return prepare(getglobal("CZWOW_NPCText_"..i)[en])
|
---|
243 | end
|
---|
244 | end
|
---|
245 | end
|
---|
246 | return nil;
|
---|
247 | end
|
---|
248 |
|
---|
249 | CZWOW_OnUpdate=function()
|
---|
250 | if CZWOW_EnableSpells and ClassTrainerFrame and ClassTrainerFrame:IsVisible() and ClassTrainerGreetingText and ClassTrainerSkillDescription and (oldClassTrainerSkillDescription~=ClassTrainerSkillDescription:GetText() or oldClassTrainerGreetingText~=ClassTrainerGreetingText:GetText()) then
|
---|
251 | oldClassTrainerSkillDescription=ClassTrainerSkillDescription:GetText();
|
---|
252 | oldClassTrainerGreetingText=ClassTrainerGreetingText:GetText();
|
---|
253 | if ClassTrainerGreetingText:GetText() then
|
---|
254 | local cz=NPCTextTranslate(ClassTrainerGreetingText:GetText());
|
---|
255 | if cz then ClassTrainerGreetingText:SetText(cz) end
|
---|
256 | end
|
---|
257 | if ClassTrainerSkillDescription:GetText() then
|
---|
258 | local cz=SpellTranslate(ClassTrainerSkillDescription:GetText());
|
---|
259 | if cz then ClassTrainerSkillDescription:SetText(cz) end
|
---|
260 | end
|
---|
261 | end;
|
---|
262 | end
|
---|
263 | old_QuestFrameDetailPanel_OnShow=QuestFrameDetailPanel_OnShow;
|
---|
264 | old_QuestLog_UpdateQuestDetails=QuestLog_UpdateQuestDetails;
|
---|
265 | old_QuestFrameProgressPanel_OnShow=QuestFrameProgressPanel_OnShow;
|
---|
266 | old_QuestFrameRewardPanel_OnShow=QuestFrameRewardPanel_OnShow;
|
---|
267 | old_ItemTextFrame_OnEvent=ItemTextFrame_OnEvent;
|
---|
268 | old_ChatFrame_OnEvent=ChatFrame_OnEvent;
|
---|
269 | --old_GossipFrameOptionsUpdate=GossipFrameOptionsUpdate;
|
---|
270 | old_GossipFrameUpdate=GossipFrameUpdate;
|
---|
271 |
|
---|
272 | ChatFrame_OnEvent=function(event)
|
---|
273 | if (event=="CHAT_MSG_MONSTER_SAY" or event=="CHAT_MSG_MONSTER_EMOTE") and CZWOW_EnableCreatures and type(CZWOW_Creature_count)=="number" then
|
---|
274 | local en=trim(arg1);
|
---|
275 | for i=1, CZWOW_Creature_count, 1 do
|
---|
276 | if type(getglobal("CZWOW_Creature_"..i))=="table" and getglobal("CZWOW_Creature_"..i)[en] then
|
---|
277 | arg1=prepare(getglobal("CZWOW_Creature_"..i)[en]);
|
---|
278 | end
|
---|
279 | end
|
---|
280 | end
|
---|
281 | old_ChatFrame_OnEvent(event);
|
---|
282 | end;
|
---|
283 |
|
---|
284 | QuestFrameDetailPanel_OnShow=function()
|
---|
285 | old_QuestFrameDetailPanel_OnShow();
|
---|
286 | if CZWOW_EnableQuests and type(CZWOW_QuestObjective_count)=="number" and type(CZWOW_QuestDescription_count)=="number" then
|
---|
287 | local questObjectives=trim(GetObjectiveText());
|
---|
288 | local questDescription=trim(GetQuestText());
|
---|
289 | --NEW:
|
---|
290 | local questTitle=trim(GetTitleText());
|
---|
291 | for i=1, CZWOW_QuestTitle_count, 1 do
|
---|
292 | if type(getglobal("CZWOW_QuestTitle_"..i))=="table" and getglobal("CZWOW_QuestTitle_"..i)[questTitle] then
|
---|
293 | QuestTitleText:SetText(prepare(getglobal("CZWOW_QuestTitle_"..i)[questTitle]));
|
---|
294 | end
|
---|
295 | end
|
---|
296 |
|
---|
297 | for i=1, CZWOW_QuestObjective_count, 1 do
|
---|
298 | if type(getglobal("CZWOW_QuestObjective_"..i))=="table" and getglobal("CZWOW_QuestObjective_"..i)[questObjectives] then
|
---|
299 | QuestObjectiveText:SetText(prepare(getglobal("CZWOW_QuestObjective_"..i)[questObjectives]));
|
---|
300 | end
|
---|
301 | end
|
---|
302 | for i=1, CZWOW_QuestDescription_count, 1 do
|
---|
303 | if type(getglobal("CZWOW_QuestDescription_"..i))=="table" and getglobal("CZWOW_QuestDescription_"..i)[questDescription] then
|
---|
304 | QuestDescription:SetText(prepare(getglobal("CZWOW_QuestDescription_"..i)[questDescription]));
|
---|
305 | end
|
---|
306 | end
|
---|
307 | end;
|
---|
308 | end
|
---|
309 |
|
---|
310 | QuestFrameProgressPanel_OnShow=function()
|
---|
311 | old_QuestFrameProgressPanel_OnShow();
|
---|
312 | if CZWOW_EnableQuests and type(CZWOW_QuestProgress_count)=="number" then
|
---|
313 | local text=trim(GetProgressText());
|
---|
314 | for i=1, CZWOW_QuestProgress_count, 1 do
|
---|
315 | if type(getglobal("CZWOW_QuestProgress_"..i))=="table" and getglobal("CZWOW_QuestProgress_"..i)[text] then
|
---|
316 | QuestProgressText:SetText(prepare(getglobal("CZWOW_QuestProgress_"..i)[text]));
|
---|
317 | end
|
---|
318 | end
|
---|
319 | --NEW:
|
---|
320 | local questTitle=trim(GetTitleText());
|
---|
321 | for i=1, CZWOW_QuestTitle_count, 1 do
|
---|
322 | if type(getglobal("CZWOW_QuestTitle_"..i))=="table" and getglobal("CZWOW_QuestTitle_"..i)[questTitle] then
|
---|
323 | QuestProgressTitleText:SetText(prepare(getglobal("CZWOW_QuestTitle_"..i)[questTitle]));
|
---|
324 | end
|
---|
325 | end
|
---|
326 |
|
---|
327 | end;
|
---|
328 | end
|
---|
329 |
|
---|
330 | QuestFrameRewardPanel_OnShow=function()
|
---|
331 | old_QuestFrameRewardPanel_OnShow();
|
---|
332 | if CZWOW_EnableQuests and type(CZWOW_QuestReward_count)=="number" then
|
---|
333 | local text=trim(GetRewardText());
|
---|
334 | for i=1, CZWOW_QuestReward_count, 1 do
|
---|
335 | if type(getglobal("CZWOW_QuestReward_"..i))=="table" and getglobal("CZWOW_QuestReward_"..i)[text] then
|
---|
336 | QuestRewardText:SetText(prepare(getglobal("CZWOW_QuestReward_"..i)[text]));
|
---|
337 | end
|
---|
338 | end
|
---|
339 | --NEW:
|
---|
340 | local questTitle=trim(GetTitleText());
|
---|
341 | for i=1, CZWOW_QuestTitle_count, 1 do
|
---|
342 | if type(getglobal("CZWOW_QuestTitle_"..i))=="table" and getglobal("CZWOW_QuestTitle_"..i)[questTitle] then
|
---|
343 | QuestRewardTitleText:SetText(prepare(getglobal("CZWOW_QuestTitle_"..i)[questTitle]));
|
---|
344 | end
|
---|
345 | end
|
---|
346 |
|
---|
347 | end;
|
---|
348 | end
|
---|
349 |
|
---|
350 | ItemTextFrame_OnEvent=function(event)
|
---|
351 | old_ItemTextFrame_OnEvent(event);
|
---|
352 | if event=="ITEM_TEXT_READY" and CZWOW_EnableBooks and type(CZWOW_BookPage_count)=="number" then
|
---|
353 | local en=trim(ItemTextGetText());
|
---|
354 | for i=1, CZWOW_BookPage_count, 1 do
|
---|
355 | if type(getglobal("CZWOW_BookPage_"..i))=="table" and getglobal("CZWOW_BookPage_"..i)[en] then
|
---|
356 | local creator=ItemTextGetCreator();
|
---|
357 | if ( creator ) then
|
---|
358 | creator=strchar(10, 10)..ITEM_TEXT_FROM..strchar(10)..creator..strchar(10, 10);
|
---|
359 | ItemTextPageText:SetText(strchar(10)..prepare(getglobal("CZWOW_BookPage_"..i)[en])..creator);
|
---|
360 | else
|
---|
361 | ItemTextPageText:SetText(strchar(10)..prepare(getglobal("CZWOW_BookPage_"..i)[en])..strchar(10, 10));
|
---|
362 | end
|
---|
363 | end
|
---|
364 | end
|
---|
365 | end
|
---|
366 | end;
|
---|
367 |
|
---|
368 | --NEW:delete
|
---|
369 | GossipFrameOptionsUpdate_zaloha=function(par)
|
---|
370 | if (par ~= nil) then
|
---|
371 | DEFAULT_CHAT_FRAME:AddMessage(par);
|
---|
372 | -- if select("#", par)>0 then
|
---|
373 | -- old_GossipFrameOptionsUpdate(par);
|
---|
374 |
|
---|
375 | local titleButton;
|
---|
376 | local titleIndex = 1;
|
---|
377 | for i=1, arg.n, 2 do
|
---|
378 | if ( GossipFrame.buttonIndex > NUMGOSSIPBUTTONS ) then
|
---|
379 | message("This NPC has too many quests and/or gossip options.");
|
---|
380 | end
|
---|
381 | titleButton = getglobal("GossipTitleButton" .. GossipFrame.buttonIndex);
|
---|
382 | titleButton:SetText(arg[i]);
|
---|
383 | GossipResize(titleButton);
|
---|
384 | titleButton:SetID(titleIndex);
|
---|
385 | titleButton.type="Gossip";
|
---|
386 | getglobal(titleButton:GetName() .. "GossipIcon"):SetTexture("Interface\\GossipFrame\\" .. arg[i+1] .. "GossipIcon");
|
---|
387 | GossipFrame.buttonIndex = GossipFrame.buttonIndex + 1;
|
---|
388 | titleIndex = titleIndex + 1;
|
---|
389 | titleButton:Show();
|
---|
390 | end
|
---|
391 |
|
---|
392 | if CZWOW_EnableNPCs and type(CZWOW_NPCAction_count)=="number" then
|
---|
393 | for i=1, GossipFrame.buttonIndex, 1 do
|
---|
394 | titleButton=getglobal("GossipTitleButton" .. i);
|
---|
395 | titleButton:SetText("test");
|
---|
396 | local en=trim(titleButton:GetText());
|
---|
397 | for i=1, CZWOW_NPCAction_count, 1 do
|
---|
398 | if type(getglobal("CZWOW_NPCAction_"..i))=="table" and getglobal("CZWOW_NPCAction_"..i)[en] then
|
---|
399 | titleButton:SetText(prepare(getglobal("CZWOW_NPCAction_"..i)[en]));
|
---|
400 | GossipResize(titleButton);
|
---|
401 | end
|
---|
402 | end
|
---|
403 | end
|
---|
404 | end
|
---|
405 | -- end
|
---|
406 | end
|
---|
407 | end
|
---|
408 |
|
---|
409 | GossipFrameUpdate=function()
|
---|
410 | old_GossipFrameUpdate();
|
---|
411 | local cz=NPCTextTranslate(GossipGreetingText:GetText());
|
---|
412 | if cz then GossipGreetingText:SetText(cz) end
|
---|
413 |
|
---|
414 |
|
---|
415 | --NEW:
|
---|
416 | for i=1, GossipFrame.buttonIndex, 1 do
|
---|
417 | titleButton=getglobal("GossipTitleButton" .. i);
|
---|
418 | local en=trim(titleButton:GetText());
|
---|
419 | for i=1, CZWOW_NPCAction_count, 1 do
|
---|
420 | if type(getglobal("CZWOW_NPCAction_"..i))=="table" and getglobal("CZWOW_NPCAction_"..i)[en] then
|
---|
421 | titleButton:SetText(prepare(getglobal("CZWOW_NPCAction_"..i)[en]));
|
---|
422 | GossipResize(titleButton);
|
---|
423 | end
|
---|
424 | end
|
---|
425 | for i=1, CZWOW_QuestTitle_count, 1 do
|
---|
426 | if type(getglobal("CZWOW_QuestTitle_"..i))=="table" and getglobal("CZWOW_QuestTitle_"..i)[en] then
|
---|
427 | titleButton:SetText(prepare(getglobal("CZWOW_QuestTitle_"..i)[en]));
|
---|
428 | end
|
---|
429 | end
|
---|
430 | end
|
---|
431 | end;
|
---|
432 |
|
---|
433 | QuestLog_UpdateQuestDetails=function()
|
---|
434 | old_QuestLog_UpdateQuestDetails();
|
---|
435 | if CZWOW_EnableQuests and type(CZWOW_QuestObjective_count)=="number" and type(CZWOW_QuestDescription_count)=="number" then
|
---|
436 | local questDescription;
|
---|
437 | local questObjectives;
|
---|
438 | questDescription, questObjectives=GetQuestLogQuestText();
|
---|
439 | questObjectives=trim(questObjectives);
|
---|
440 | questDescription=trim(questDescription);
|
---|
441 | for i=1, CZWOW_QuestObjective_count, 1 do
|
---|
442 | if type(getglobal("CZWOW_QuestObjective_"..i))=="table" and getglobal("CZWOW_QuestObjective_"..i)[questObjectives] then
|
---|
443 | QuestLogObjectivesText:SetText(prepare(getglobal("CZWOW_QuestObjective_"..i)[questObjectives]));
|
---|
444 | end
|
---|
445 | end
|
---|
446 | for i=1, CZWOW_QuestDescription_count, 1 do
|
---|
447 | if type(getglobal("CZWOW_QuestDescription_"..i))=="table" and getglobal("CZWOW_QuestDescription_"..i)[questDescription] then
|
---|
448 | QuestLogQuestDescription:SetText(prepare(getglobal("CZWOW_QuestDescription_"..i)[questDescription]));
|
---|
449 | end
|
---|
450 | end
|
---|
451 | --NEW:
|
---|
452 | local questID = GetQuestLogSelection();
|
---|
453 | local questTitle=trim(GetQuestLogTitle(questID));
|
---|
454 | for i=1, CZWOW_QuestTitle_count, 1 do
|
---|
455 | if type(getglobal("CZWOW_QuestTitle_"..i))=="table" and getglobal("CZWOW_QuestTitle_"..i)[questTitle] then
|
---|
456 | QuestLogQuestTitle:SetText(prepare(getglobal("CZWOW_QuestTitle_"..i)[questTitle]));
|
---|
457 | -- QuestLogTitle:SetText(prepare(getglobal("CZWOW_QuestTitle_"..i)[questTitle]));
|
---|
458 | end
|
---|
459 | end
|
---|
460 |
|
---|
461 | end;
|
---|
462 | end
|
---|
463 |
|
---|
464 |
|
---|
465 | --NEW:
|
---|
466 | local old_QuestLog_Update
|
---|
467 | old_QuestLog_Update = QuestLog_Update;
|
---|
468 | QuestLog_Update=function()
|
---|
469 | old_QuestLog_Update();
|
---|
470 | local questIndex, questLogTitle, questTitleTag, questNumGroupMates, questNormalText, questHighlight, questCheck;
|
---|
471 | local questLogTitleText, level, questTag, isHeader, isCollapsed, isComplete, color;
|
---|
472 | local numPartyMembers, partyMembersOnQuest, tempWidth, textWidth;
|
---|
473 | for j=1, QUESTS_DISPLAYED, 1 do
|
---|
474 | questIndex = j + FauxScrollFrame_GetOffset(QuestLogListScrollFrame);
|
---|
475 | questLogTitle = getglobal("QuestLogTitle"..questIndex);
|
---|
476 | if (questLogTitle ~= nil) then
|
---|
477 |
|
---|
478 | questLogTitle:SetID(questIndex);
|
---|
479 | questLogTitleText, level, questTag, isHeader, isCollapsed, isComplete = GetQuestLogTitle(questIndex);
|
---|
480 | local questTitle=trim(questLogTitleText);
|
---|
481 | for i=1, CZWOW_QuestTitle_count, 1 do
|
---|
482 | if type(getglobal("CZWOW_QuestTitle_"..i))=="table" and getglobal("CZWOW_QuestTitle_"..i)[questTitle] then
|
---|
483 | if questLogTitle then
|
---|
484 | -- QuestLogTitle:SetText(prepare(getglobal("CZWOW_QuestTitle_"..i)[questTitle]));
|
---|
485 | end
|
---|
486 | end
|
---|
487 | end
|
---|
488 | end
|
---|
489 | end
|
---|
490 | end
|
---|
491 |
|
---|