@@ -74,6 +74,7 @@ local DEFAULTS = {
7474 minimapButton = {
7575 hide = false ,
7676 },
77+ goalProgressMode = " shared" , -- "shared" (all show same %) or "waterfall" (fills top-to-bottom)
7778 },
7879}
7980
798799
799800-- Get all goals with progress
800801function HonorLog :GetAllGoalsProgress ()
802+ local progressMode = self .db .settings .goalProgressMode or " shared"
803+
804+ if progressMode == " waterfall" then
805+ return self :GetAllGoalsProgressWaterfall ()
806+ end
807+
808+ -- Default "shared" mode - all goals show same percentage based on current currency
801809 local results = {}
802810 for _ , goal in ipairs (self .db .char .goals .items ) do
803811 local progress = self :GetGoalProgress (goal .itemID )
@@ -810,6 +818,123 @@ function HonorLog:GetAllGoalsProgress()
810818 return results
811819end
812820
821+ -- Get all goals with waterfall-style progress (currency fills goals top-to-bottom)
822+ function HonorLog :GetAllGoalsProgressWaterfall ()
823+ local results = {}
824+ local goals = self .db .char .goals .items
825+
826+ -- Get current currency totals
827+ local remainingHonor = self :GetCurrentHonor ()
828+ local remainingArena = self :GetCurrentArenaPoints ()
829+ local remainingMarks = {
830+ AV = self :GetCurrentMarks (" AV" ),
831+ AB = self :GetCurrentMarks (" AB" ),
832+ WSG = self :GetCurrentMarks (" WSG" ),
833+ EotS = self :GetCurrentMarks (" EotS" ),
834+ }
835+
836+ -- Process goals in order, allocating currency top-to-bottom
837+ for _ , goal in ipairs (goals ) do
838+ local item = self :GetGearItem (goal .itemID )
839+ if item then
840+ local result = {
841+ itemID = goal .itemID ,
842+ name = item .name ,
843+ slot = item .slot ,
844+ addedAt = goal .addedAt ,
845+ priority = goal .priority ,
846+ honor = {
847+ needed = item .honor or 0 ,
848+ current = 0 ,
849+ remaining = 0 ,
850+ percent = 0 ,
851+ games = 0 ,
852+ },
853+ arena = {
854+ needed = item .arena or 0 ,
855+ current = 0 ,
856+ remaining = 0 ,
857+ percent = 0 ,
858+ weeks = 0 ,
859+ },
860+ marks = {},
861+ isComplete = true ,
862+ totalGamesNeeded = 0 ,
863+ }
864+
865+ -- Honor allocation (waterfall style)
866+ if item .honor > 0 then
867+ local allocated = math.min (remainingHonor , item .honor )
868+ remainingHonor = remainingHonor - allocated
869+
870+ result .honor .current = allocated
871+ result .honor .remaining = math.max (0 , item .honor - allocated )
872+ result .honor .percent = math.min (100 , (allocated / item .honor ) * 100 )
873+
874+ local avgHonor = self :GetAverageHonorPerGame ()
875+ if avgHonor > 0 and result .honor .remaining > 0 then
876+ result .honor .games = math.ceil (result .honor .remaining / avgHonor )
877+ result .totalGamesNeeded = math.max (result .totalGamesNeeded , result .honor .games )
878+ end
879+
880+ if result .honor .remaining > 0 then
881+ result .isComplete = false
882+ end
883+ end
884+
885+ -- Arena allocation (waterfall style)
886+ if item .arena > 0 then
887+ local allocated = math.min (remainingArena , item .arena )
888+ remainingArena = remainingArena - allocated
889+
890+ result .arena .current = allocated
891+ result .arena .remaining = math.max (0 , item .arena - allocated )
892+ result .arena .percent = math.min (100 , (allocated / item .arena ) * 100 )
893+
894+ if result .arena .remaining > 0 then
895+ result .isComplete = false
896+ end
897+ end
898+
899+ -- Marks allocation (waterfall style)
900+ if item .marks then
901+ for bgType , needed in pairs (item .marks ) do
902+ if needed > 0 then
903+ local allocated = math.min (remainingMarks [bgType ] or 0 , needed )
904+ remainingMarks [bgType ] = (remainingMarks [bgType ] or 0 ) - allocated
905+
906+ local remaining = math.max (0 , needed - allocated )
907+ local percent = math.min (100 , (allocated / needed ) * 100 )
908+ local games = 0
909+
910+ local avgMarks = self :GetAverageMarksPerGame (bgType )
911+ if avgMarks > 0 and remaining > 0 then
912+ games = math.ceil (remaining / avgMarks )
913+ result .totalGamesNeeded = math.max (result .totalGamesNeeded , games )
914+ end
915+
916+ result .marks [bgType ] = {
917+ needed = needed ,
918+ current = allocated ,
919+ remaining = remaining ,
920+ percent = percent ,
921+ games = games ,
922+ }
923+
924+ if remaining > 0 then
925+ result .isComplete = false
926+ end
927+ end
928+ end
929+ end
930+
931+ table.insert (results , result )
932+ end
933+ end
934+
935+ return results
936+ end
937+
813938-- Check and handle completed goals
814939function HonorLog :CheckCompletedGoals ()
815940 local completed = {}
0 commit comments