# HG changeset patch
# User Nenue
# Date 1460593130 14400
# Node ID c3aa94bc6be2204c66824715bc6ed63c6aa5399e
# Parent d5563cae5bf19c24b7895785f0be5f336ec59c31
collating module-specific function into their own files and dropping the UI and Style scripts
diff -r d5563cae5bf1 -r c3aa94bc6be2 ObjectiveTracker/BonusObjectives.lua
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/ObjectiveTracker/BonusObjectives.lua Wed Apr 13 20:18:50 2016 -0400
@@ -0,0 +1,66 @@
+--- ${PACKAGE_NAME}
+-- @file-author@
+-- @project-revision@ @project-hash@
+-- @file-revision@ @file-hash@
+-- Created: 4/13/2016 7:48 PM
+local B = select(2,...).frame
+local T = B:RegisterModule("ObjectiveTracker", _G.VeneerObjectiveWrapper, 'BuffFrame')
+local _G, ipairs, max, min, unpack, floor, pairs, tostring, type, band = _G, ipairs, max, min, unpack, floor, pairs, tostring, type, bit.band
+local GetAutoQuestPopUp, GetQuestLogCompletionText = GetAutoQuestPopUp, GetQuestLogCompletionText
+local Default, Quest = T.DefaultHandler, T.Quest
+local format = format
+local print = B.print('Tracker')
+local lprint = B.print('Line')
+local iprint = B.print('Info')
+local Bonus = mod.Bonus
+
+
+--- Module-specific data wrangling that has to happen during UpdateBlock()
+-- Most of this is sculpting objectives data into a parsible list.
+-- Some of it is additional block manipulation that doesn't quite fit with the other modules..
+Bonus.UpdateObjectives = function(handler, block)
+ Default.UpdateObjectives(handler, block)
+end
+
+
+
+Bonus.UpdateLine = function(handler, block, line, data)
+ local info = block.info
+ local print = lprint
+
+
+ line.displayColor = 'FFFFFF'
+ line.displayText = data.text
+ line.progress = 0
+ print(' ', data.objectiveIndex,'|cFFFF0088-|r', data.objectiveType, data.text)
+ if data.objectiveType == 'progressbar' then
+ line.widgetType = 'ProgressBar'
+ print(' |cFFFF44DDpercent='..tostring(GetQuestProgressBarPercent(info.questID)))
+ data.value = GetQuestProgressBarPercent(info.questID) or 0
+ data.maxValue = 100
+ if data.value >= data.maxValue then
+ line.progress = 1
+ elseif data.value > 0 then
+ line.progress = 2
+ end
+ line.format = PERCENTAGE_STRING
+ local widget = T.SetWidget(line, data, 'ProgressBar', info.questID..'-'..data.objectiveIndex)
+ print(' |cFFFF0022** text:|r', data.text, '|cFFFF0022value:|r', data.value, '|cFFFF0022max:|r', data.maxValue)
+ widget:SetPoint('TOP', line, 'TOP', 0, 0)
+
+ line.widget = widget
+ line.height = widget.height
+ else
+ line.displayText = data.text
+ line.widget = nil
+ end
+ return line
+end
+
+Bonus.Select = function(self)
+
+ Bonus:OnTurnIn(self.info.questID)
+end
+Bonus.Remove = function(self)
+
+end
\ No newline at end of file
diff -r d5563cae5bf1 -r c3aa94bc6be2 ObjectiveTracker/ObjectiveSecure.xml
--- a/ObjectiveTracker/ObjectiveSecure.xml Wed Apr 13 11:21:38 2016 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-
-
-
-
\ No newline at end of file
diff -r d5563cae5bf1 -r c3aa94bc6be2 ObjectiveTracker/ObjectiveTracker.xml
--- a/ObjectiveTracker/ObjectiveTracker.xml Wed Apr 13 11:21:38 2016 -0400
+++ b/ObjectiveTracker/ObjectiveTracker.xml Wed Apr 13 20:18:50 2016 -0400
@@ -483,20 +483,19 @@
-
-
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
+
+
\ No newline at end of file
diff -r d5563cae5bf1 -r c3aa94bc6be2 ObjectiveTracker/ObjectiveUI.lua
--- a/ObjectiveTracker/ObjectiveUI.lua Wed Apr 13 11:21:38 2016 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,133 +0,0 @@
---- ${PACKAGE_NAME}
--- @file-author@
--- @project-revision@ @project-hash@
--- @file-revision@ @file-hash@
--- Created: 3/29/2016 7:07 PM
-local B = select(2,...).frame
-local mod = B:RegisterModule("ObjectiveTracker", _G.VeneerObjectiveWrapper, 'BuffFrame')
-local print = B.print('Objectives')
-local Default, AutoQuest, Quest, Cheevs = mod.DefaultHandler, mod.AutoQuest, mod.Quest, mod.Cheevs
-local itemButtonSize, itemButtonSpacing = 36, 1
-local tremove, tremovebyval = table.remove, table.removebyval
-
---------------------------------------------------------------------
---- Functions responsible for:
---- - UI interactions that propagate to the BlizzardUI (sending RemoveQuestWatch() on remove quest action)
---- -
---------------------------------------------------------------------
-
-Default.Select = function(self) end
-Default.Open = function(self) end
-Default.Remove = function(self) end
-Default.Report = function(self)
- print('Stats:', self.numWatched,'items tracked,', self.numBlocks,'blocks assigned.')
-end
-
-Default.OnMouseUp = function(self, button)
-
- print(self.handler.name, self.mainStyle, self.subStyle)
- if button == 'LeftButton' then
- if IsModifiedClick("CHATLINK") and ChatEdit_GetActiveWindow() then
- self:Link()
- elseif IsModifiedClick("QUESTWATCHTOGGLE") then
- self:Remove()
- else
- self:Select()
- end
- elseif button == 'RightButton' then
- self:Open()
- end
- self.initialButton = nil
- self.modChatLink = nil
- self.modQuestWatch = nil
- mod:Update(self.handler.updateReasonModule)
- print('|cFFFF8800'..tostring(self:GetName())..':MouseUp()|r')
-end
-
-Default.OnMouseDown = function(self, button)
-
- print(IsModifiedClick("CHATLINK"), IsModifiedClick("QUESTWATCHTOGGLE"))
- print(self.info.title)
-end
-
-AutoQuest.Select = function(self)
-
- if self.info.popupType == 'OFFER' then
- ShowQuestOffer(self.info.questIndex)
- else
- ShowQuestComplete(self.info.questIndex)
- end
- RemoveAutoQuestPopUp(self.info.questID)
-end
-
-Quest.Select = function(self)
-
- if self.info.isAutoComplete and self.info.isComplete then
- ShowQuestComplete(self.info.questLogIndex)
- else
- SetSuperTrackedQuestID(self.info.questID)
- end
-end
-
-Quest.Link = function(self)
-
- local questLink = GetQuestLink(self.info.questLogIndex);
- if ( questLink ) then
- ChatEdit_InsertLink(questLink);
- end
-end
-
-AutoQuest.Link = Quest.Link
-
-Quest.Open = function(self)
-
- QuestMapFrame_OpenToQuestDetails(self.info.questID)
-end
-
-Quest.Remove = function(self)
-
- print('removing', self.info.questLogIndex, 'from watcher')
- RemoveQuestWatch(self.info.questLogIndex)
-end
-
-
------------------------------
---- CHEEVS
-Cheevs.Select = function(self)
- --mod:Update(OBJECTIVE_TRACKER_UPDATE_MODULE_ACHIEVEMENT)
-end
-Cheevs.Remove = function(self)
-
- RemoveTrackedAchievement(self.info.cheevID)
-end
-Cheevs.OnMouseUp = function(self, button)
-
- Default.OnMouseUp(self, button)
-end
-Cheevs.Link = function(self)
-
- local achievementLink = GetAchievementLink(self.info.cheevID);
- if ( achievementLink ) then
- ChatEdit_InsertLink(achievementLink);
- end
-end
-
-Cheevs.Open = function(self)
-
- if ( not AchievementFrame ) then
- AchievementFrame_LoadUI();
- end
- if ( not AchievementFrame:IsShown() ) then
- AchievementFrame_ToggleAchievementFrame();
- end
- AchievementFrame_SelectAchievement(self.info.cheevID);
-end
-
-local Bonus = mod.Bonus
-Bonus.Select = function(self)
-
- Bonus:OnTurnIn(self.info.questID)
-end
-Bonus.Remove = function(self)
-
-end
\ No newline at end of file
diff -r d5563cae5bf1 -r c3aa94bc6be2 ObjectiveTracker/Scenarios.lua
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/ObjectiveTracker/Scenarios.lua Wed Apr 13 20:18:50 2016 -0400
@@ -0,0 +1,6 @@
+--- ${PACKAGE_NAME}
+-- @file-author@
+-- @project-revision@ @project-hash@
+-- @file-revision@ @file-hash@
+-- Created: 4/13/2016 8:17 PM
+
diff -r d5563cae5bf1 -r c3aa94bc6be2 ObjectiveTracker/SecureButton.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/ObjectiveTracker/SecureButton.xml Wed Apr 13 20:18:50 2016 -0400
@@ -0,0 +1,66 @@
+
+
+
+
\ No newline at end of file