Advertisement
Guest User

questmarkerfixr10-⛄-.ipf

a guest
Sep 6th, 2018
416
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.33 KB | None | 0 0
  1. function UPDATE_QUEST_DETAIL(frame, questID)    
  2.     local questframe2 = ui.GetFrame("questinfoset_2");
  3.  
  4.     frame = frame:GetTopParentFrame();
  5.     local groupbox          = frame:GetChild('questGbox');
  6.  
  7.     local updated = false;
  8.     local i = 0;
  9.     while 1 do 
  10.         if i >= quest.GetCheckQuestCount() then
  11.             break;
  12.         end
  13.  
  14.         local questID = quest.GetCheckQuest(i);
  15.         if questID == -1 then
  16.             local qctrl = frame:GetChild("gquest");
  17.             if qctrl == nil then                
  18.                 quest.RemoveCheckQuestByIndex(i);
  19.             else
  20.                 local checkBox = qctrl:GetChild("save");
  21.                 tolua.cast(checkBox, "ui::CCheckBox");
  22.                 checkBox:SetCheck(1);
  23.                 i = i + 1;
  24.             end
  25.         else
  26.             local ctrlname = "_Q_" .. questID;
  27.             local questexist = 1;
  28.             local Quest_Ctrl = nil;            
  29.             local qctrl = groupbox:GetChild(ctrlname);
  30.            
  31.             if qctrl ~= nil then
  32.                 Quest_Ctrl = qctrl;
  33.             end
  34.            
  35.             if Quest_Ctrl ~= nil then
  36.                 tolua.cast(Quest_Ctrl, "ui::CControlSet");
  37.                 if Quest_Ctrl:IsEnable() == 0 then
  38.                     questexist = 0;
  39.                 end
  40.             else
  41.                 questexist = 0;
  42.             end
  43.            
  44.             if questexist == 1 then
  45.                 local checkBox = GET_CHILD(Quest_Ctrl, "save", "ui::CCheckBox");
  46.                 checkBox:SetCheck(1);
  47.  
  48.                 UPDATE_QUESTINFOSET_2(questframe2, nil, 1, questID);
  49.                 i = i + 1;
  50.             else
  51.                 quest.RemoveCheckQuestByIndex(i);
  52.             end
  53.         end
  54.     end
  55. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement