Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if not SECURE_ACTION_BUTTON then
- local button_name = "Archy_SurveyButton"
- local button = _G.CreateFrame("Button", button_name, _G.UIParent, "SecureActionButtonTemplate")
- button:SetPoint("LEFT", _G.UIParent, "RIGHT", 10000, 0)
- button:Hide()
- button:SetFrameStrata("LOW")
- button:EnableMouse(true)
- button:RegisterForClicks("RightButtonDown")
- button.name = button_name
- button:SetAttribute("type", "spell")
- button:SetAttribute("spell", SURVEY_SPELL_ID)
- button:SetAttribute("action", nil)
- button:SetScript("PostClick", function(self, mouse_button, is_down)
- if private.override_binding_on and not IsTaintable() then
- _G.ClearOverrideBindings(self)
- private.override_binding_on = nil
- _G.MouselookStart()
- else
- private.override_binding_on = true
- end
- end)
- SECURE_ACTION_BUTTON = button
- end
- do
- local clicked_time
- local ACTION_DOUBLE_WAIT = 0.2
- local MIN_ACTION_DOUBLECLICK = 0.04
- _G.WorldFrame:HookScript("OnMouseDown", function(frame, button, down)
- if button == "RightButton" and profileSettings.general.easyCast and _G.ArchaeologyMapUpdateAll() > 0 and not IsTaintable() and not _G.IsEquippedItemType(FISHING_POLE_NAME) and _G.CanScanResearchSite() and GetSpellCooldown(80451) == 0 then
- local perform_survey = false
- local num_loot_items = _G.GetNumLootItems()
- if (num_loot_items == 0 or not num_loot_items) and clicked_time then
- local pressTime = _G.GetTime()
- local doubleTime = pressTime - clicked_time
- if doubleTime < ACTION_DOUBLE_WAIT and doubleTime > MIN_ACTION_DOUBLECLICK then
- clicked_time = nil
- perform_survey = true
- end
- end
- clicked_time = _G.GetTime()
- if perform_survey and not IsTaintable() then
- _G.SetOverrideBindingClick(SECURE_ACTION_BUTTON, true, "BUTTON2", SECURE_ACTION_BUTTON.name)
- private.override_binding_on = true
- end
- end
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement