Mercurial > wow > worldplan
changeset 8:802abb8a10ea
Fixed loss of mission progress data while changing zones by using `GARRISON_LANDINGPAGE_SHIPMENTS' as the trigger point for mission scoops.
* `MISSION_LIST_UPDATE' fires before all data is available, and if this is happens on a loading screen, then several landing page items may get snipped.
author | Nenue |
---|---|
date | Sun, 23 Oct 2016 07:19:53 -0400 |
parents | 34d9fbf7af20 |
children | a2b623043970 |
files | .idea/uiDesigner.xml ClassPlan.lua QuestPOI.lua WorldPlan.lua |
diffstat | 4 files changed, 172 insertions(+), 36 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.idea/uiDesigner.xml Sun Oct 23 07:19:53 2016 -0400 @@ -0,0 +1,124 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="Palette2"> + <group name="Swing"> + <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false"> + <default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" /> + </item> + <item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false"> + <default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" /> + </item> + <item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false"> + <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" /> + </item> + <item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true"> + <default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" /> + </item> + <item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" /> + <initial-values> + <property name="text" value="Button" /> + </initial-values> + </item> + <item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" /> + <initial-values> + <property name="text" value="RadioButton" /> + </initial-values> + </item> + <item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" /> + <initial-values> + <property name="text" value="CheckBox" /> + </initial-values> + </item> + <item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false"> + <default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" /> + <initial-values> + <property name="text" value="Label" /> + </initial-values> + </item> + <item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true"> + <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> + <preferred-size width="150" height="-1" /> + </default-constraints> + </item> + <item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true"> + <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> + <preferred-size width="150" height="-1" /> + </default-constraints> + </item> + <item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true"> + <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> + <preferred-size width="150" height="-1" /> + </default-constraints> + </item> + <item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true"> + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> + <preferred-size width="150" height="50" /> + </default-constraints> + </item> + <item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true"> + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> + <preferred-size width="150" height="50" /> + </default-constraints> + </item> + <item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true"> + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> + <preferred-size width="150" height="50" /> + </default-constraints> + </item> + <item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true"> + <default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" /> + </item> + <item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> + <preferred-size width="150" height="50" /> + </default-constraints> + </item> + <item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3"> + <preferred-size width="150" height="50" /> + </default-constraints> + </item> + <item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> + <preferred-size width="150" height="50" /> + </default-constraints> + </item> + <item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3"> + <preferred-size width="200" height="200" /> + </default-constraints> + </item> + <item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false"> + <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3"> + <preferred-size width="200" height="200" /> + </default-constraints> + </item> + <item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true"> + <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" /> + </item> + <item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" /> + </item> + <item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false"> + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" /> + </item> + <item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" /> + </item> + <item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false"> + <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1"> + <preferred-size width="-1" height="20" /> + </default-constraints> + </item> + <item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false"> + <default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" /> + </item> + <item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" /> + </item> + </group> + </component> +</project> \ No newline at end of file
--- a/ClassPlan.lua Sat Oct 22 15:36:25 2016 -0400 +++ b/ClassPlan.lua Sun Oct 23 07:19:53 2016 -0400 @@ -28,7 +28,7 @@ } ClassPlanMissionMixin = { templateName = 'ClassPlanMissionEntry', - events = {'GARRISON_MISSION_LIST_UPDATE', 'GARRISON_MISSION_STARTED', 'GARRISON_MISSION_FINISHED'},} + events = {'GARRISON_MISSION_LIST_UPDATE', 'GARRISON_MISSION_STARTED', 'GARRISON_MISSION_FINISHED', 'GARRISON_LANDINGPAGE_SHIPMENTS'},} ClassPlanShipmentMixin = { templateName = 'ClassPlanShipmentEntry', parent = false, @@ -56,19 +56,16 @@ if not self.profile then return end - self.items = C_Garrison.GetLandingPageItems(LE_GARRISON_TYPE_7_0) + local items = C_Garrison.GetLandingPageItems(LE_GARRISON_TYPE_7_0) + print(#items) wipe(self.profile.missions) - for index, data in ipairs(self.items) do + for index, data in ipairs(items) do print(' ',data.name, '|cFF00FF00'.. data.timeLeft .. '|r', date("%A %I:%m %p", data.missionEndTime)) tinsert(self.profile.missions, data) end print('items update pending') self.isStale = true - - if self:IsVisible() then - self:Refresh() - end end MissionsHandler.OnGetItem = function(data) @@ -131,7 +128,7 @@ if not creationTime then return end - print(shipmentType, name, shipmentCapacity, shipmentsReady, shipmentsTotal, creationTime, duration, timeleftString) + --print(shipmentType, name, shipmentCapacity, shipmentsReady, shipmentsTotal, creationTime, duration, timeleftString) tinsert(ShipmentsInfo, { shipmentType = shipmentType, @@ -203,14 +200,10 @@ end self.isStale = true - if self:IsVisible() then - self:Refresh() - end end function core:OnLoad () self:RegisterEvent('PLAYER_LOGIN') - self:RegisterEvent('PLAYER_ENTERING_WORLD') self:RegisterEvent('ADDON_LOADED') self:RegisterEvent('PLAYER_REGEN_ENABLED') self:RegisterEvent('PLAYER_REGEN_DISABLED') @@ -343,6 +336,11 @@ print('|cFF88FF00' .. tostring(ptype) .. '|r:GetPlayerData() --', numCalls) eventFunc(self, event) end + + + if self:IsVisible() then + self:Refresh() + end end end
--- a/QuestPOI.lua Sat Oct 22 15:36:25 2016 -0400 +++ b/QuestPOI.lua Sun Oct 23 07:19:53 2016 -0400 @@ -209,4 +209,36 @@ else self.MouseGlow:Hide() end +end + + +function WorldPlanFilterPinMixin:OnEnter () + local filter = WorldPlan.FilterOptions[self:GetID()] + local mapID = GetCurrentMapAreaID() + local quests = (mapID == WorldPlan.BrokenIsleID) and WorldPlan.QuestsByID or WorldPlan.QuestsByZone[mapID] + if quests then + GameTooltip:SetOwner(self, 'ANCHOR_RIGHT') + GameTooltip:AddLine(filter.label) + local filterKey = self.filterKey + local filterValue = self.filterValue + if filterKey then + for questID, pin in pairs(quests) do + if pin.used and not pin.filtered then + if pin[filterKey] == filterValue then + local style = pin.style or WorldPlan.FilterStyle + + if familiars[questID] then + GameTooltip:AddLine(pin.title,0,1,0) + else + GameTooltip:AddLine(pin.title,1,1,1) + end + + end + end + end + else + GameTooltip:AddLine('Reset all filters') + end + GameTooltip:Show() + end end \ No newline at end of file
--- a/WorldPlan.lua Sat Oct 22 15:36:25 2016 -0400 +++ b/WorldPlan.lua Sun Oct 23 07:19:53 2016 -0400 @@ -177,6 +177,10 @@ { filterKey= 'worldQuestType', filterValue = LE_QUEST_TAG_TYPE_PET_BATTLE, label = 'Pet Battle', texture = "Interface\\Icons\\PetJournalPortrait", }, { filterKey= 'worldQuestType', filterValue = LE_QUEST_TAG_TYPE_DUNGEON, label = 'Dungeon', texture = "Interface\\LFGFRAME\\UI-LFR-PORTRAIT", }, } +WorldPlanCore.BrokenIsleID = BROKEN_ISLES_ID +WorldPlanCore.FilterOptions = POI_FILTER_OPTIONS +WorldPlanCore.FilterStyle = POI_FILTER_STYLE + local numPins = 0 local QuestsByZone = {} @@ -190,6 +194,8 @@ local NotificationTypes = {} local ZoneInfo = {} local SummaryHeaders = {} +WorldPlanCore.QuestsByID = QuestsByID +WorldPlanCore.QuestsByZone = QuestsByZone local FreePins = {} local NumPinFrames = 1 @@ -1157,30 +1163,6 @@ end -function FilterPin:OnEnter () - local filter = POI_FILTER_OPTIONS[self:GetID()] - local mapID = GetCurrentMapAreaID() - local quests = (mapID == BROKEN_ISLES_ID) and QuestsByID or QuestsByZone[mapID] - if quests then - GameTooltip:SetOwner(self, 'ANCHOR_RIGHT') - GameTooltip:AddLine(filter.label) - local filterKey = self.filterKey - local filterValue = self.filterValue - if filterKey then - for questID, pin in pairs(quests) do - if pin.used and not pin.filtered then - if pin[filterKey] == filterValue then - local style = pin.style or POI_FILTER_STYLE - GameTooltip:AddLine(pin.title) - end - end - end - else - GameTooltip:AddLine('Reset all filters') - end - GameTooltip:Show() - end -end function FilterPin:OnLeave () if GameTooltip:IsOwned(self) then GameTooltip:Hide()