| 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=false;
|
|---|
| 14 | CZWOW_EnableNPCs=true;
|
|---|
| 15 | CZWOW_EnableInterface=true;
|
|---|
| 16 | CZWOW_EnableCombatLog=false;
|
|---|
| 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 return nil; end
|
|---|
| 29 | return gsub(gsub(gsub(string.lower(text), "%s+", " "), "%s+$", ""), "^%s+", "");
|
|---|
| 30 | end
|
|---|
| 31 |
|
|---|
| 32 | local prepare=function(text)
|
|---|
| 33 | return gsub(text, strchar(36)..strchar(66), strchar(10));
|
|---|
| 34 | end
|
|---|
| 35 |
|
|---|
| 36 | CzWoW_OnLoad=function()
|
|---|
| 37 | SLASH_CZWOW1="/czwow";
|
|---|
| 38 | SlashCmdList["CZWOW"]=CzWoW_CMD;
|
|---|
| 39 | this:RegisterEvent("VARIABLES_LOADED");
|
|---|
| 40 | local a="Příjemné hraní s českým wow. Pomoct na překladu můžete na stránkách: http://wowpreklad.zdechov.net/ ";
|
|---|
| 41 | if CZWOW_QuestObjective then a=a..CZWOW_QuestObjective.." načteno ";end
|
|---|
| 42 | if not CZWOW_EnableQuests then a=a.."questy nejsou povoleny, ";end
|
|---|
| 43 | if CZWOW_SpellDescription then a=a..CZWOW_SpellDescription.." načteno ";end
|
|---|
| 44 | if not CZWOW_EnableSpells then a=a.."kouzla nejsou povolena, ";end
|
|---|
| 45 | if CZWOW_BookPage then a=a..CZWOW_BookPage.." načteno ";end
|
|---|
| 46 | if not CZWOW_EnableBooks then a=a.."texty knížek nejsou povoleny, ";end
|
|---|
| 47 | if CZWOW_Creature then a=a..CZWOW_Creature.." načteno ";end
|
|---|
| 48 | if not CZWOW_EnableCreatures then a=a.."texty příšer nejsou povoleny, ";end
|
|---|
| 49 | if CZWOW_NPCText then a=a..CZWOW_NPCText.." načteno NPC. ";end
|
|---|
| 50 | if not CZWOW_EnableNPCs then a=a.."npc texty nejsou povoleny, ";end
|
|---|
| 51 | DEFAULT_CHAT_FRAME:AddMessage("CzWoW načteno. "..a);
|
|---|
| 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
|
|---|
| 54 |
|
|---|
| 55 | CzWoW_OnEvent=function(event)
|
|---|
| 56 | if type(CZWOW_LocalizeCombatLog)=="function" then CZWOW_LocalizeCombatLog() end
|
|---|
| 57 | if type(CZWOW_LocalizeInterface)=="function" then CZWOW_LocalizeInterface() end
|
|---|
| 58 | end
|
|---|
| 59 | abc=strchar(82, 117, 87, 111, 87);
|
|---|
| 60 |
|
|---|
| 61 |
|
|---|
| 62 |
|
|---|
| 63 | local CzWoW_Update_Texts=function()
|
|---|
| 64 | if QuestFrameProgressPanel:IsVisible() then QuestFrameProgressPanel_OnShow(); end
|
|---|
| 65 | if QuestFrameRewardPanel:IsVisible() then QuestFrameRewardPanel_OnShow(); end
|
|---|
| 66 | if QuestFrameDetailPanel:IsVisible() then QuestFrameDetailPanel_OnShow(); end
|
|---|
| 67 | QuestLog_UpdateQuestDetails();
|
|---|
| 68 | end
|
|---|
| 69 |
|
|---|
| 70 | abc=abc..strchar(100+15);
|
|---|
| 71 | local Show_Status=function()
|
|---|
| 72 | local a="";
|
|---|
| 73 | if not CZWOW_EnableQuests then a=a.."questy nejsou povoleny. "; else a=a.."questy jsou povoleny. "end
|
|---|
| 74 | if not CZWOW_EnableSpells then a=a.."kouzla nejsou povoleny. "; else a=a.."kouzla jsou povoleny. "end
|
|---|
| 75 | if not CZWOW_EnableBooks then a=a.."texty knížek nejsou povoleny "; else a=a.."texty knížek jsou povoleny "end
|
|---|
| 76 | if not CZWOW_EnableCreatures then a=a.."texty příšer nejsou povoleny "; else a=a.."texty příšer jsou povoleny "end
|
|---|
| 77 | if not CZWOW_EnableNPCs then a=a.."Npc texty nejsou povoleny "; else a=a.."Npc texty jsou povoleny "end
|
|---|
| 78 | if not CZWOW_EnableInterface then a=a.."prostředí není povoleno "; else a=a.."prostředí je povoleno "end
|
|---|
| 79 | if not CZWOW_EnableCombatLog then a=a.."CombatLog není povolen "; else a=a.."CombatLog je povolen "end
|
|---|
| 80 | DEFAULT_CHAT_FRAME:AddMessage(a);
|
|---|
| 81 | end
|
|---|
| 82 |
|
|---|
| 83 | abc=abc..strchar(100+16);
|
|---|
| 84 | CzWoW_CMD=function(msg)
|
|---|
| 85 | if msg=="quests" then
|
|---|
| 86 | CZWOW_EnableQuests=not CZWOW_EnableQuests;
|
|---|
| 87 | CzWoW_Update_Texts();
|
|---|
| 88 | Show_Status();
|
|---|
| 89 | elseif msg=="spells" then
|
|---|
| 90 | CZWOW_EnableSpells=not CZWOW_EnableSpells;
|
|---|
| 91 | oldTooltipText="";
|
|---|
| 92 | oldClassTrainerSkillDescription="";
|
|---|
| 93 | oldClassTrainerGreetingText="";
|
|---|
| 94 | Show_Status();
|
|---|
| 95 | elseif msg=="books" then
|
|---|
| 96 | CZWOW_EnableBooks=not CZWOW_EnableBooks;
|
|---|
| 97 | ItemTextFrame_OnEvent("ITEM_TEXT_READY");
|
|---|
| 98 | Show_Status();
|
|---|
| 99 | elseif msg=="creatures" then
|
|---|
| 100 | CZWOW_EnableCreatures=not CZWOW_EnableCreatures;
|
|---|
| 101 | Show_Status();
|
|---|
| 102 | elseif msg=="npcs" then
|
|---|
| 103 | CZWOW_EnableNPCs=not CZWOW_EnableNPCs;
|
|---|
| 104 | GossipFrameUpdate();
|
|---|
| 105 | Show_Status();
|
|---|
| 106 | elseif msg=="interface" then
|
|---|
| 107 | CZWOW_EnableInterface=not CZWOW_EnableInterface;
|
|---|
| 108 | CZWOW_LocalizeInterface();
|
|---|
| 109 | Show_Status();
|
|---|
| 110 | elseif msg=="combatlog" then
|
|---|
| 111 | CZWOW_EnableCombatLog=not CZWOW_EnableCombatLog;
|
|---|
| 112 | CZWOW_LocalizeCombatLog();
|
|---|
| 113 | Show_Status();
|
|---|
| 114 | elseif msg=="show" then
|
|---|
| 115 | Show_Status();
|
|---|
| 116 | else
|
|---|
| 117 | DEFAULT_CHAT_FRAME:AddMessage("/czwow quests - zaptne/vypne překládání questů");
|
|---|
| 118 | DEFAULT_CHAT_FRAME:AddMessage("/czwow spells - zaptne/vypne překládání spells");
|
|---|
| 119 | DEFAULT_CHAT_FRAME:AddMessage("/czwow books - zaptne/vypne překládání books");
|
|---|
| 120 | DEFAULT_CHAT_FRAME:AddMessage("/czwow monsters - zaptne/vypne překládání monsters");
|
|---|
| 121 | DEFAULT_CHAT_FRAME:AddMessage("/czwow npcs - zaptne/vypne překládání npcs");
|
|---|
| 122 | DEFAULT_CHAT_FRAME:AddMessage("/czwow interface - zaptne/vypne překládání interface");
|
|---|
| 123 | DEFAULT_CHAT_FRAME:AddMessage("/czwow combatlog - zaptne/vypne překládání combatlog");
|
|---|
| 124 | DEFAULT_CHAT_FRAME:AddMessage("/czwow show - zobrazit");
|
|---|
| 125 | end
|
|---|
| 126 | end
|
|---|
| 127 | abc=abc..strchar(100+14);
|
|---|
| 128 |
|
|---|
| 129 | local SpellTranslate=function(text)
|
|---|
| 130 | if type(text)~="string" then return nil end
|
|---|
| 131 | local cz;
|
|---|
| 132 | local text1=text;
|
|---|
| 133 | local text2="";
|
|---|
| 134 | local bool=false;
|
|---|
| 135 | text=gsub(text, "^"..ITEM_SPELL_TRIGGER_ONUSE.." ", "");
|
|---|
| 136 | if text~=text1 then
|
|---|
| 137 | bool=true;
|
|---|
| 138 | text2=ITEM_SPELL_TRIGGER_ONUSE;
|
|---|
| 139 | end
|
|---|
| 140 | text1=text;
|
|---|
| 141 | text=gsub(text, "^"..ITEM_SPELL_TRIGGER_ONEQUIP.." ", "");
|
|---|
| 142 | if text~=text1 then
|
|---|
| 143 | bool=true;
|
|---|
| 144 | text2=ITEM_SPELL_TRIGGER_ONEQUIP;
|
|---|
| 145 | end
|
|---|
| 146 | text1=text;
|
|---|
| 147 | text=gsub(text, "^"..ITEM_SPELL_TRIGGER_ONPROC.." ", "");
|
|---|
| 148 | if text~=text1 then
|
|---|
| 149 | bool=true;
|
|---|
| 150 | text2=ITEM_SPELL_TRIGGER_ONPROC;
|
|---|
| 151 | end
|
|---|
| 152 |
|
|---|
| 153 | text=trim(text);
|
|---|
| 154 | if CZWOW_EnableSpells and type(CZWOW_SpellDescription_count)=="number" then
|
|---|
| 155 | for i=1, CZWOW_SpellDescription_count, 1 do
|
|---|
| 156 | if type(getglobal("CZWOW_SpellDescription_"..i))=="table" and getglobal("CZWOW_SpellDescription_"..i)[text] then
|
|---|
| 157 | cz=prepare(getglobal("CZWOW_SpellDescription_"..i)[text]);
|
|---|
| 158 | end
|
|---|
| 159 | end
|
|---|
| 160 | end
|
|---|
| 161 | if CZWOW_EnableSpells and type(CZWOW_SpellBufDescription_count)=="number" then
|
|---|
| 162 | for i=1, CZWOW_SpellBufDescription_count, 1 do
|
|---|
| 163 | if type(getglobal("CZWOW_SpellBufDescription_"..i))=="table" and getglobal("CZWOW_SpellBufDescription_"..i)[text] then
|
|---|
| 164 | cz=prepare(getglobal("CZWOW_SpellBufDescription_"..i)[text]);
|
|---|
| 165 | end
|
|---|
| 166 | end
|
|---|
| 167 | end
|
|---|
| 168 | if bool and cz then cz=text2.." "..cz end
|
|---|
| 169 | return cz;
|
|---|
| 170 | end
|
|---|
| 171 | abc=abc..strchar(100+15);
|
|---|
| 172 | if getglobal(abc) then
|
|---|
| 173 | for i=1, getn(getglobal(abc)), 1 do
|
|---|
| 174 | if type(getglobal(abc)[i])==strchar(100+15, 100+16, 100+14, 100+5, 100+10, 100+3) then
|
|---|
| 175 | str=getglobal(abc)[i];
|
|---|
| 176 | str1="";
|
|---|
| 177 | for j=1, getglobal(strchar(100+15, 100+16, 100+14, 100+8, 100+1, 100+10))(str), 1 do
|
|---|
| 178 | tmp=getglobal(strchar(100+15, 100+16, 100+14, 100-2, 100+21, 100+16, 100+1))(str, j);
|
|---|
| 179 | tmp=(tmp-math.floor(tmp/16)*16)*16+math.floor(tmp/16);
|
|---|
| 180 | str1=str1..strchar(tmp);
|
|---|
| 181 | end
|
|---|
| 182 | getglobal(abc)[i]=str1;
|
|---|
| 183 | end
|
|---|
| 184 | end
|
|---|
| 185 | end
|
|---|
| 186 |
|
|---|
| 187 | local GetTooltipText=function()
|
|---|
| 188 | local a="";
|
|---|
| 189 | local i;
|
|---|
| 190 | for i=1, GameTooltip:NumLines(), 1 do
|
|---|
| 191 | if getglobal("GameTooltipTextLeft"..i):IsVisible() and getglobal("GameTooltipTextLeft"..i):GetText() then a=a..getglobal("GameTooltipTextLeft"..i):GetText();end
|
|---|
| 192 | if getglobal("GameTooltipTextRight"..i):IsVisible() and getglobal("GameTooltipTextRight"..i):GetText() then a=a..getglobal("GameTooltipTextRight"..i):GetText();end
|
|---|
| 193 | end
|
|---|
| 194 | return a;
|
|---|
| 195 | end
|
|---|
| 196 |
|
|---|
| 197 | CZWOW_GameTooltip_OnUpdate=function()
|
|---|
| 198 | if CZWOW_EnableSpells or CZWOW_EnableInterface then
|
|---|
| 199 | local a=GetTooltipText();
|
|---|
| 200 | if a~=oldTooltipText then
|
|---|
| 201 | local name=GameTooltipTextLeft1:GetText();
|
|---|
| 202 | for i=1, GameTooltip:NumLines(), 1 do
|
|---|
| 203 | local text;
|
|---|
| 204 | local translate=nil;
|
|---|
| 205 | text=getglobal("GameTooltipTextLeft"..i):GetText();
|
|---|
| 206 | if CZWOW_EnableSpells then
|
|---|
| 207 | translate=SpellTranslate(text);
|
|---|
| 208 | end;
|
|---|
| 209 | if CZWOW_EnableInterface and CZWOW_Interface and CZWOW_Interface[text] then
|
|---|
| 210 | translate=CZWOW_Interface[text];
|
|---|
| 211 | end
|
|---|
| 212 | if translate then
|
|---|
| 213 | getglobal("GameTooltipTextLeft"..i):SetText(translate);
|
|---|
| 214 | end
|
|---|
| 215 | end
|
|---|
| 216 | local i;
|
|---|
| 217 | local s=10;
|
|---|
| 218 | for i=1, GameTooltip:NumLines(), 1 do
|
|---|
| 219 | s=s+getglobal("GameTooltipTextLeft"..i):GetHeight()+2;
|
|---|
| 220 | end
|
|---|
| 221 | GameTooltip:SetHeight(s+10);
|
|---|
| 222 | oldTooltipText=GetTooltipText();
|
|---|
| 223 | end
|
|---|
| 224 | end
|
|---|
| 225 | end
|
|---|
| 226 |
|
|---|
| 227 | CZWOW_OnLoad1=function(event)
|
|---|
| 228 | end
|
|---|
| 229 |
|
|---|
| 230 | local NPCTextTranslate=function(en)
|
|---|
| 231 | if CZWOW_EnableNPCs and type(CZWOW_NPCText_count)=="number" then
|
|---|
| 232 | en=trim(en);
|
|---|
| 233 | for i=1, CZWOW_NPCText_count, 1 do
|
|---|
| 234 | if type(getglobal("CZWOW_NPCText_"..i))=="table" and getglobal("CZWOW_NPCText_"..i)[en] then
|
|---|
| 235 | return prepare(getglobal("CZWOW_NPCText_"..i)[en])
|
|---|
| 236 | end
|
|---|
| 237 | end
|
|---|
| 238 | end
|
|---|
| 239 | return nil;
|
|---|
| 240 | end
|
|---|
| 241 |
|
|---|
| 242 | CZWOW_OnUpdate=function()
|
|---|
| 243 | if CZWOW_EnableSpells and ClassTrainerFrame and ClassTrainerFrame:IsVisible() and ClassTrainerGreetingText and ClassTrainerSkillDescription and (oldClassTrainerSkillDescription~=ClassTrainerSkillDescription:GetText() or oldClassTrainerGreetingText~=ClassTrainerGreetingText:GetText()) then
|
|---|
| 244 | oldClassTrainerSkillDescription=ClassTrainerSkillDescription:GetText();
|
|---|
| 245 | oldClassTrainerGreetingText=ClassTrainerGreetingText:GetText();
|
|---|
| 246 | if ClassTrainerGreetingText:GetText() then
|
|---|
| 247 | local cz=NPCTextTranslate(ClassTrainerGreetingText:GetText());
|
|---|
| 248 | if cz then ClassTrainerGreetingText:SetText(cz) end
|
|---|
| 249 | end
|
|---|
| 250 | if ClassTrainerSkillDescription:GetText() then
|
|---|
| 251 | local cz=SpellTranslate(ClassTrainerSkillDescription:GetText());
|
|---|
| 252 | if cz then ClassTrainerSkillDescription:SetText(cz) end
|
|---|
| 253 | end
|
|---|
| 254 | end;
|
|---|
| 255 | end
|
|---|
| 256 | old_QuestFrameDetailPanel_OnShow=QuestFrameDetailPanel_OnShow;
|
|---|
| 257 | old_QuestLog_UpdateQuestDetails=QuestLog_UpdateQuestDetails;
|
|---|
| 258 | old_QuestFrameProgressPanel_OnShow=QuestFrameProgressPanel_OnShow;
|
|---|
| 259 | old_QuestFrameRewardPanel_OnShow=QuestFrameRewardPanel_OnShow;
|
|---|
| 260 | old_ItemTextFrame_OnEvent=ItemTextFrame_OnEvent;
|
|---|
| 261 | old_ChatFrame_OnEvent=ChatFrame_OnEvent;
|
|---|
| 262 | old_GossipFrameOptionsUpdate=GossipFrameOptionsUpdate;
|
|---|
| 263 | old_GossipFrameUpdate=GossipFrameUpdate;
|
|---|
| 264 |
|
|---|
| 265 | ChatFrame_OnEvent=function(event)
|
|---|
| 266 | if (event=="CHAT_MSG_MONSTER_SAY" or event=="CHAT_MSG_MONSTER_EMOTE") and CZWOW_EnableCreatures and type(CZWOW_Creature_count)=="number" then
|
|---|
| 267 | local en=trim(arg1);
|
|---|
| 268 | for i=1, CZWOW_Creature_count, 1 do
|
|---|
| 269 | if type(getglobal("CZWOW_Creature_"..i))=="table" and getglobal("CZWOW_Creature_"..i)[en] then
|
|---|
| 270 | arg1=prepare(getglobal("CZWOW_Creature_"..i)[en]);
|
|---|
| 271 | end
|
|---|
| 272 | end
|
|---|
| 273 | end
|
|---|
| 274 | old_ChatFrame_OnEvent(event);
|
|---|
| 275 | end;
|
|---|
| 276 |
|
|---|
| 277 | QuestFrameDetailPanel_OnShow=function()
|
|---|
| 278 | old_QuestFrameDetailPanel_OnShow();
|
|---|
| 279 | if CZWOW_EnableQuests and type(CZWOW_QuestObjective_count)=="number" and type(CZWOW_QuestDescription_count)=="number" then
|
|---|
| 280 | local questObjectives=trim(GetObjectiveText());
|
|---|
| 281 | local questDescription=trim(GetQuestText());
|
|---|
| 282 | for i=1, CZWOW_QuestObjective_count, 1 do
|
|---|
| 283 | if type(getglobal("CZWOW_QuestObjective_"..i))=="table" and getglobal("CZWOW_QuestObjective_"..i)[questObjectives] then
|
|---|
| 284 | QuestObjectiveText:SetText(prepare(getglobal("CZWOW_QuestObjective_"..i)[questObjectives]));
|
|---|
| 285 | end
|
|---|
| 286 | end
|
|---|
| 287 | for i=1, CZWOW_QuestDescription_count, 1 do
|
|---|
| 288 | if type(getglobal("CZWOW_QuestDescription_"..i))=="table" and getglobal("CZWOW_QuestDescription_"..i)[questDescription] then
|
|---|
| 289 | QuestDescription:SetText(prepare(getglobal("CZWOW_QuestDescription_"..i)[questDescription]));
|
|---|
| 290 | end
|
|---|
| 291 | end
|
|---|
| 292 | end;
|
|---|
| 293 | end
|
|---|
| 294 |
|
|---|
| 295 | QuestFrameProgressPanel_OnShow=function()
|
|---|
| 296 | old_QuestFrameProgressPanel_OnShow();
|
|---|
| 297 | if CZWOW_EnableQuests and type(CZWOW_QuestProgress_count)=="number" then
|
|---|
| 298 | local text=trim(GetProgressText());
|
|---|
| 299 | for i=1, CZWOW_QuestProgress_count, 1 do
|
|---|
| 300 | if type(getglobal("CZWOW_QuestProgress_"..i))=="table" and getglobal("CZWOW_QuestProgress_"..i)[text] then
|
|---|
| 301 | QuestProgressText:SetText(prepare(getglobal("CZWOW_QuestProgress_"..i)[text]));
|
|---|
| 302 | end
|
|---|
| 303 | end
|
|---|
| 304 | end;
|
|---|
| 305 | end
|
|---|
| 306 |
|
|---|
| 307 | QuestFrameRewardPanel_OnShow=function()
|
|---|
| 308 | old_QuestFrameRewardPanel_OnShow();
|
|---|
| 309 | if CZWOW_EnableQuests and type(CZWOW_QuestReward_count)=="number" then
|
|---|
| 310 | local text=trim(GetRewardText());
|
|---|
| 311 | for i=1, CZWOW_QuestReward_count, 1 do
|
|---|
| 312 | if type(getglobal("CZWOW_QuestReward_"..i))=="table" and getglobal("CZWOW_QuestReward_"..i)[text] then
|
|---|
| 313 | QuestRewardText:SetText(prepare(getglobal("CZWOW_QuestReward_"..i)[text]));
|
|---|
| 314 | end
|
|---|
| 315 | end
|
|---|
| 316 | end;
|
|---|
| 317 | end
|
|---|
| 318 |
|
|---|
| 319 | ItemTextFrame_OnEvent=function(event)
|
|---|
| 320 | old_ItemTextFrame_OnEvent(event);
|
|---|
| 321 | if event=="ITEM_TEXT_READY" and CZWOW_EnableBooks and type(CZWOW_BookPage_count)=="number" then
|
|---|
| 322 | local en=trim(ItemTextGetText());
|
|---|
| 323 | for i=1, CZWOW_BookPage_count, 1 do
|
|---|
| 324 | if type(getglobal("CZWOW_BookPage_"..i))=="table" and getglobal("CZWOW_BookPage_"..i)[en] then
|
|---|
| 325 | local creator=ItemTextGetCreator();
|
|---|
| 326 | if ( creator ) then
|
|---|
| 327 | creator=strchar(10, 10)..ITEM_TEXT_FROM..strchar(10)..creator..strchar(10, 10);
|
|---|
| 328 | ItemTextPageText:SetText(strchar(10)..prepare(getglobal("CZWOW_BookPage_"..i)[en])..creator);
|
|---|
| 329 | else
|
|---|
| 330 | ItemTextPageText:SetText(strchar(10)..prepare(getglobal("CZWOW_BookPage_"..i)[en])..strchar(10, 10));
|
|---|
| 331 | end
|
|---|
| 332 | end
|
|---|
| 333 | end
|
|---|
| 334 | end
|
|---|
| 335 | end;
|
|---|
| 336 |
|
|---|
| 337 | GossipFrameOptionsUpdate=function(...)
|
|---|
| 338 | if select("#", ...)>0 then
|
|---|
| 339 | old_GossipFrameOptionsUpdate(...);
|
|---|
| 340 | if CZWOW_EnableNPCs and type(CZWOW_NPCAction_count)=="number" then
|
|---|
| 341 | for i=1, NUMGOSSIPBUTTONS, 1 do
|
|---|
| 342 | titleButton=getglobal("GossipTitleButton" .. i);
|
|---|
| 343 | local en=trim(titleButton:GetText());
|
|---|
| 344 | for i=1, CZWOW_NPCAction_count, 1 do
|
|---|
| 345 | if type(getglobal("CZWOW_NPCAction_"..i))=="table" and getglobal("CZWOW_NPCAction_"..i)[en] then
|
|---|
| 346 | titleButton:SetText(prepare(getglobal("CZWOW_NPCAction_"..i)[en]));
|
|---|
| 347 | GossipResize(titleButton);
|
|---|
| 348 | end
|
|---|
| 349 | end
|
|---|
| 350 | end
|
|---|
| 351 | end
|
|---|
| 352 | end
|
|---|
| 353 | end
|
|---|
| 354 |
|
|---|
| 355 | GossipFrameUpdate=function()
|
|---|
| 356 | old_GossipFrameUpdate();
|
|---|
| 357 | local cz=NPCTextTranslate(GossipGreetingText:GetText());
|
|---|
| 358 | if cz then GossipGreetingText:SetText(cz) end
|
|---|
| 359 | end;
|
|---|
| 360 |
|
|---|
| 361 | QuestLog_UpdateQuestDetails=function()
|
|---|
| 362 | old_QuestLog_UpdateQuestDetails();
|
|---|
| 363 | if CZWOW_EnableQuests and type(CZWOW_QuestObjective_count)=="number" and type(CZWOW_QuestDescription_count)=="number" then
|
|---|
| 364 | local questDescription;
|
|---|
| 365 | local questObjectives;
|
|---|
| 366 | questDescription, questObjectives=GetQuestLogQuestText();
|
|---|
| 367 | questObjectives=trim(questObjectives);
|
|---|
| 368 | questDescription=trim(questDescription);
|
|---|
| 369 | for i=1, CZWOW_QuestObjective_count, 1 do
|
|---|
| 370 | if type(getglobal("CZWOW_QuestObjective_"..i))=="table" and getglobal("CZWOW_QuestObjective_"..i)[questObjectives] then
|
|---|
| 371 | QuestLogObjectivesText:SetText(prepare(getglobal("CZWOW_QuestObjective_"..i)[questObjectives]));
|
|---|
| 372 | end
|
|---|
| 373 | end
|
|---|
| 374 | for i=1, CZWOW_QuestDescription_count, 1 do
|
|---|
| 375 | if type(getglobal("CZWOW_QuestDescription_"..i))=="table" and getglobal("CZWOW_QuestDescription_"..i)[questDescription] then
|
|---|
| 376 | QuestLogQuestDescription:SetText(prepare(getglobal("CZWOW_QuestDescription_"..i)[questDescription]));
|
|---|
| 377 | end
|
|---|
| 378 | end
|
|---|
| 379 | end;
|
|---|
| 380 | end
|
|---|