diff --git a/.gitignore b/.gitignore index b1daf0f..8b15449 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /proofofconcept.lua .* /_build/ +/libs/ \ No newline at end of file diff --git a/OrderHallCommander.lua b/OrderHallCommander.lua index 5ea5038..3c23cee 100644 --- a/OrderHallCommander.lua +++ b/OrderHallCommander.lua @@ -83,6 +83,11 @@ dprint=function() end ddump=function() end local print=function() end --@end-non-debug@]===] + +local function GetRGB(r, g, b, whatever) + return r, g, b +end + local GARRISON_FOLLOWER_COMBAT_ALLY=GARRISON_FOLLOWER_COMBAT_ALLY local GARRISON_FOLLOWER_ON_MISSION=GARRISON_FOLLOWER_ON_MISSION local GARRISON_FOLLOWER_INACTIVE=GARRISON_FOLLOWER_INACTIVE @@ -342,9 +347,9 @@ function MixinThreats:AddIcons(mechanics,biases) th.Description=mechanic.description th.Ability=mechanic.ability and mechanic.ability.name or mechanic.name if mechanic.color then - th.Border:SetVertexColor(C[mechanic.color]()) + th.Border:SetVertexColor(GetRGB(C[mechanic.color]())) else - th.Border:SetVertexColor(addon:ColorFromBias(biases[mechanic] or mechanic.bias)) + th.Border:SetVertexColor(GetRGB(addon:ColorFromBias(biases[mechanic] or mechanic.bias))) end th:Show() else @@ -501,7 +506,7 @@ function MixinFollowerIcon:ShowTooltip() local status=G.GetFollowerStatus(self.followerID) if status then gft.Status:SetText(TOKEN_MARKET_PRICE_NOT_AVAILABLE.. ': ' .. status) - gft.Status:SetTextColor(C:Orange()) + gft.Status:SetTextColor(GetRGB(C:Orange())) gft.Status:Show() gft:SetHeight(gft:GetHeight()+10) else @@ -631,7 +636,7 @@ function MixinMembers:OnLoad() end self:SetWidth(self.Champions[1]:GetWidth()*3+30) self.NotReady.Text:SetFormattedText(RAID_MEMBER_NOT_READY,STATUS_TEXT_PARTY) - self.NotReady.Text:SetTextColor(C.Red()) + self.NotReady.Text:SetTextColor(GetRGB(C.Red())) end function MixinMembers:OnShow() self:SetNotReady() diff --git a/OrderHallCommander.xml b/OrderHallCommander.xml index 54a5417..2c3d8eb 100644 --- a/OrderHallCommander.xml +++ b/OrderHallCommander.xml @@ -79,7 +79,7 @@ - + @@ -321,7 +321,7 @@ - + diff --git a/autopilot.lua b/autopilot.lua index 5175fec..7aa3e73 100644 --- a/autopilot.lua +++ b/autopilot.lua @@ -38,8 +38,8 @@ local OHFFollowers=OrderHallMissionFrameFollowers -- Contains scroll list local OHFMissionPage=OrderHallMissionFrame.MissionTab.MissionPage -- Contains mission description and party setup local OHFMapTab=OrderHallMissionFrame.MapTab -- Contains quest map local OHFCompleteDialog=OrderHallMissionFrameMissions.CompleteDialog -local OHFMissionScroll=OrderHallMissionFrameMissionsListScrollFrame -local OHFMissionScrollChild=OrderHallMissionFrameMissionsListScrollFrameScrollChild +-- local OHFMissionScroll=OrderHallMissionFrameMissionsListScrollFrame +-- local OHFMissionScrollChild=OrderHallMissionFrameMissionsListScrollFrameScrollChild local LE_FOLLOWER_TYPE_GARRISON_6_0=Enum.GarrisonFollowerType.FollowerType_6_0 local LE_FOLLOWER_TYPE_SHIPYARD_6_2=Enum.GarrisonFollowerType.FollowerType_6_2 local LE_FOLLOWER_TYPE_GARRISON_7_0=Enum.GarrisonFollowerType.FollowerType_7_0 @@ -103,7 +103,6 @@ end --*BEGIN local wipe,pcall,pairs,IsShiftKeyDown,IsControlKeyDown=wipe,pcall,pairs,IsShiftKeyDown,IsControlKeyDown local PlaySound,SOUNDKIT=PlaySound,SOUNDKIT -local OHFButtons=OHFMissions.listScroll.buttons local safeguard={} function module:Cleanup() @@ -136,74 +135,81 @@ function module:DoRunMissions() local baseChance=addon:GetNumber('BASECHANCE') wipe(safeguard) local nothing=true - for i=1,#OHFButtons do - local frame=OHFButtons[i] - local mission=frame.info - local missionID=mission and mission.missionID - if missionID then - if not addon:IsBlacklisted(missionID) and addon:HasReservedFollowers(missionID) then - nothing=false - local key=addon:GetMissionKey(missionID) - local party=addon:GetMissionParties(missionID):GetSelectedParty(key) - local members = addon:GetMembersFrame(frame) - addon:Print(safeformat(L["Attempting %s"],C(mission.name,'orange'))) - - local info="" - for i=1,#members.Champions do - local followerID=members.Champions[i]:GetFollower() - if followerID then - safeguard[followerID]=missionID - local rc,res = pcall(G.AddFollowerToMission,missionID,followerID) - if rc then - info=info .. G.GetFollowerLink(followerID) - else - addon:Print(C(L["Unable to start mission, aborting"],"red")) - self:Cleanup() - break + + local scrollBox = OHFMissions.ScrollBox + local shouldContinue = true + + scrollBox:ForEachFrame(function(frame, elementData) + if shouldContinue then + local mission=frame.info + local missionID=mission and mission.missionID + if missionID then + if not addon:IsBlacklisted(missionID) and addon:HasReservedFollowers(missionID) then + nothing=false + local key=addon:GetMissionKey(missionID) + local party=addon:GetMissionParties(missionID):GetSelectedParty(key) + local members = addon:GetMembersFrame(frame) + addon:Print(safeformat(L["Attempting %s"],C(mission.name,'orange'))) + + local info="" + for i=1,#members.Champions do + local followerID=members.Champions[i]:GetFollower() + if followerID then + safeguard[followerID]=missionID + local rc,res = pcall(G.AddFollowerToMission,missionID,followerID) + if rc then + info=info .. G.GetFollowerLink(followerID) + else + addon:Print(C(L["Unable to start mission, aborting"],"red")) + self:Cleanup() + break + end end end - end - local timestring,timeseconds,timeImproved,chance,buffs,missionEffects,xpBonus,materials,gold=G.GetPartyMissionInfo(missionID) - - if party.perc < chance then - addon:Print(C(L["Could not fulfill mission, aborting"],"red")) - self:Cleanup() - break - end - local r,n,i=addon:GetResources(true) - if select(2,G.GetMissionCost(missionID)) > r then - addon:Print(C(GARRISON_NOT_ENOUGH_MATERIALS_TOOLTIP,"red")) - self:Cleanup() - break - end - - nothing=false - if truerun then - self:RegisterEvent("GARRISON_MISSION_STARTED") - G.StartMission(missionID) - addon:Print(C(L["Started with "],"green") ..info) - PlaySound(SOUNDKIT.UI_GARRISON_COMMAND_TABLE_MISSION_START) - --@debug@ - dprint("Calling OHF:UpdateMissions") - --@end-debug@ - OHFFollowerList.dirtyList=true - OHFFollowerList:UpdateFollowers(); - OHFMissions:UpdateMissions() - --@debug@ - if multiple then - addon:Print("Multiple is running") - self:ScheduleTimer("DoRunMissions",1) + local timestring,timeseconds,timeImproved,chance,buffs,missionEffects,xpBonus,materials,gold=G.GetPartyMissionInfo(missionID) + + if party.perc < chance then + addon:Print(C(L["Could not fulfill mission, aborting"],"red")) + self:Cleanup() + shouldContinue = false + else + local r,n,i=addon:GetResources(true) + if select(2,G.GetMissionCost(missionID)) > r then + addon:Print(C(GARRISON_NOT_ENOUGH_MATERIALS_TOOLTIP,"red")) + self:Cleanup() + shouldContinue = false + else + nothing=false + if truerun then + self:RegisterEvent("GARRISON_MISSION_STARTED") + G.StartMission(missionID) + addon:Print(C(L["Started with "],"green") ..info) + PlaySound(SOUNDKIT.UI_GARRISON_COMMAND_TABLE_MISSION_START) + --@debug@ + dprint("Calling OHF:UpdateMissions") + --@end-debug@ + OHFFollowerList.dirtyList=true + OHFFollowerList:UpdateFollowers(); + OHFMissions:UpdateMissions() + --@debug@ + if multiple then + addon:Print("Multiple is running") + self:ScheduleTimer("DoRunMissions",1) + end + --@end-debug@ + shouldContinue = false + else + addon:Print(C(L["Would start with "],"green") ..info) + addon:Print(C(safeformat(L["%s to actually start mission"],SHIFT_KEY_TEXT .. KEY_BUTTON1),"green")) + self:Cleanup() + end + end end - --@end-debug@ - break - else - addon:Print(C(L["Would start with "],"green") ..info) - addon:Print(C(safeformat(L["%s to actually start mission"],SHIFT_KEY_TEXT .. KEY_BUTTON1),"green")) - self:Cleanup() end end end - end + end) + if nothing and not multiple then addon:Print(C(L["No suitable missions. Have you reserved at least one follower?"],"red")) end diff --git a/cache.lua b/cache.lua index 1f8f6db..9ceec8b 100644 --- a/cache.lua +++ b/cache.lua @@ -72,6 +72,11 @@ dprint=function() end ddump=function() end local print=function() end --@end-non-debug@]===] + +local function GetRGB(r, g, b, whatever) + return r, g, b +end + local GARRISON_FOLLOWER_COMBAT_ALLY=GARRISON_FOLLOWER_COMBAT_ALLY local GARRISON_FOLLOWER_ON_MISSION=GARRISON_FOLLOWER_ON_MISSION local GARRISON_FOLLOWER_INACTIVE=GARRISON_FOLLOWER_INACTIVE @@ -538,7 +543,9 @@ local TroopsHeader function module:GetTroopsFrame() if not TroopsHeader then local frame=CreateFrame("Frame",nil,OrderHallMissionFrame,"TooltipBorderedFrameTemplate") - frame.Background:Hide() + if frame.Background then + frame.Background:Hide() + end frame.Top=frame:CreateTexture(nil,"BACKGROUND",nil,-1) frame.Top:SetPoint("TOPLEFT") frame.Top:SetPoint("BOTTOMRIGHT") @@ -564,10 +571,10 @@ function module:ParseFollowers() end local function paintCat(frame) if addon:GetBoolean(frame.key) then - frame.Count:SetTextColor(C.red()) + frame.Count:SetTextColor(GetRGB(C.red())) frame.Icon:SetDesaturated(true) else - frame.Count:SetTextColor(C.green()) + frame.Count:SetTextColor(GetRGB(C.green())) frame.Icon:SetDesaturated(false) end end diff --git a/followerpage.lua b/followerpage.lua index 54094c3..1c0035c 100644 --- a/followerpage.lua +++ b/followerpage.lua @@ -75,6 +75,11 @@ dprint=function() end ddump=function() end local print=function() end --@end-non-debug@]===] + +local function GetRGB(r, g, b, whatever) + return r, g, b +end + local GARRISON_FOLLOWER_COMBAT_ALLY=GARRISON_FOLLOWER_COMBAT_ALLY local GARRISON_FOLLOWER_ON_MISSION=GARRISON_FOLLOWER_ON_MISSION local GARRISON_FOLLOWER_INACTIVE=GARRISON_FOLLOWER_INACTIVE @@ -213,7 +218,7 @@ function module:CheckEquipment(this,followerInfo) local quality=addon:GetItemQuality(itemid) if type(quality)=="number" then colored=true - f.Border:SetVertexColor(GetItemQualityColor(quality)) + f.Border:SetVertexColor(GetRGB(GetItemQualityColor(quality))) end end end @@ -416,7 +421,7 @@ do local pool={} b.Quantity:SetTextColor(b.IconBorder:GetVertexColor()) else b.Icon:SetDesaturated(true) - b.Quantity:SetTextColor(C.Grey()) + b.Quantity:SetTextColor(GetRGB(C.Grey())) end b:Show() end diff --git a/missionlist.lua b/missionlist.lua index c47a0f1..65828af 100644 --- a/missionlist.lua +++ b/missionlist.lua @@ -38,8 +38,7 @@ local OHFFollowers=OrderHallMissionFrameFollowers -- Contains scroll list local OHFMissionPage=OrderHallMissionFrame.MissionTab.MissionPage -- Contains mission description and party setup local OHFMapTab=OrderHallMissionFrame.MapTab -- Contains quest map local OHFCompleteDialog=OrderHallMissionFrameMissions.CompleteDialog -local OHFMissionScroll=OrderHallMissionFrameMissionsListScrollFrame -local OHFMissionScrollChild=OrderHallMissionFrameMissionsListScrollFrameScrollChild +local OHFMissionScroll=OrderHallMissionFrameMissions.ScrollBox local LE_FOLLOWER_TYPE_GARRISON_6_0=Enum.GarrisonFollowerType.FollowerType_6_0 local LE_FOLLOWER_TYPE_SHIPYARD_6_2=Enum.GarrisonFollowerType.FollowerType_6_2 local LE_FOLLOWER_TYPE_GARRISON_7_0=Enum.GarrisonFollowerType.FollowerType_7_0 @@ -72,6 +71,11 @@ dprint=function() end ddump=function() end local print=function() end --@end-non-debug@]===] + +local function GetRGB(r, g, b, whatever) + return r, g, b +end + local GARRISON_FOLLOWER_COMBAT_ALLY=GARRISON_FOLLOWER_COMBAT_ALLY local GARRISON_FOLLOWER_ON_MISSION=GARRISON_FOLLOWER_ON_MISSION local GARRISON_FOLLOWER_INACTIVE=GARRISON_FOLLOWER_INACTIVE @@ -135,7 +139,6 @@ local Current_Sorter local Second_Sorter local sortKeys={} local MAX=999999999 -local OHFButtons=OHFMissions.listScroll.buttons local clean local displayClean local function GetPerc(mission,realvalue) @@ -267,9 +270,8 @@ function module:Events() addon:RegisterEvent("SHIPMENT_CRAFTER_CLOSED","SetDirtyFlags") end function module:LoadButtons(...) - local buttonlist=OHFMissions.listScroll.buttons - for i=1,#buttonlist do - local b=buttonlist[i] + local scrollBox = OHFMissions.ScrollBox + scrollBox:ForEachFrame(function(b, elementData) self:SecureHookScript(b,"OnEnter","AdjustMissionTooltip") self:SecureHookScript(b,"OnLeave","SafeAddMembers") self:RawHookScript(b,"OnClick","RawMissionClick") @@ -281,7 +283,7 @@ function module:LoadButtons(...) b.Summary:SetFont(f,h*scale,s) self:SecureHookScript(b.Rewards[1],"OnMouseUp","PrintLink") self:SecureHookScript(b.Rewards[1],"OnEnter","RewardWarning") - end + end) end function addon:SetDirtyFlags(event,missionType,missionID,...) if event=="GARRISON_MISSION_LIST_UPDATE" @@ -584,10 +586,11 @@ end function addon:RedrawMissions() addon:RunRefreshers() addon:SortTroop() - for i=1,#OHFButtons do - local frame=OHFButtons[i] + + local scrollBox = OHFMissions.ScrollBox + scrollBox:ForEachFrame(function(frame, elementData) module:OnSingleUpdate(frame) - end + end) return module:CheckShadow() end local function ToggleSet(this,value) @@ -620,7 +623,7 @@ function module:NoMartiniNoParty(text) if not warner then warner=CreateFrame("Frame","OHCWarner",OHFMissions,BackdropTemplateMixin and "BackdropTemplate") warner.label=warner:CreateFontString(nil,"OVERLAY","GameFontNormalHuge3Outline") - warner.label:SetTextColor(C:Orange()) + warner.label:SetTextColor(GetRGB(C:Orange())) warner:SetAllPoints() warner.label:SetHeight(100) warner.label:SetPoint("CENTER") @@ -662,7 +665,7 @@ function module:Menu(flag) -- menu:SetPoint("TOPLEFT",OHFMissionTab,"TOPRIGHT",0,30) -- menu:SetPoint("BOTTOMLEFT",OHFMissionTab,"BOTTOMRIGHT",0,0) menu.Title:SetText('OHC ' .. addon.version) - menu.Title:SetTextColor(C:Yellow()) + menu.Title:SetTextColor(GetRGB(C:Yellow())) menu.Close:SetScript("OnClick",CloseMenu) menu.Tutorial:RegisterForClicks("LeftButtonUp","RightButtonUp") addon:RawHookScript(menu.Tutorial,"OnClick",function(this,button) if button=="LeftButton" then addon:ShowTutorial() else addon:GetTutorialsModule():Home() end end) @@ -860,7 +863,7 @@ function module:AdjustPosition(frame) if mission.isRare then frame.Title:SetTextColor(frame.RareText:GetTextColor()) else - frame.Title:SetTextColor(C:White()) + frame.Title:SetTextColor(GetRGB(C:White())) end frame.RareText:Hide() -- Compacting mission time and level @@ -901,17 +904,17 @@ function module:AdjustMissionButton(frame) local aLevel,aIlevel=addon:GetAverageLevels() if mission.isMaxLevel then frame.Level:SetText(mission.iLevel) - frame.Level:SetTextColor(addon:GetDifficultyColors(math.floor((aIlevel-750)/(mission.iLevel-750)*100))) + frame.Level:SetTextColor(GetRGB(addon:GetDifficultyColors(math.floor((aIlevel-750)/(mission.iLevel-750)*100)))) else frame.Level:SetText(mission.level) - frame.Level:SetTextColor(addon:GetDifficultyColors(math.floor(aLevel/mission.level*100))) + frame.Level:SetTextColor(GetRGB(addon:GetDifficultyColors(math.floor(aLevel/mission.level*100)))) end if mission.inProgress then stats:SetPoint("LEFT",48,14) stats.Expire:Hide() else stats.Expire:SetFormattedText("%s\n%s",GARRISON_MISSION_AVAILABILITY,mission.offerTimeRemaining or _G.UNKNOWN) - stats.Expire:SetTextColor(addon:GetAgeColor(mission.offerEndTime or 0)) + stats.Expire:SetTextColor(GetRGB(addon:GetAgeColor(mission.offerEndTime or 0))) stats:SetPoint("LEFT",48,0) stats.Expire:Show() end @@ -934,11 +937,11 @@ function module:Dim(frame) frame.Title:SetTextColor(0,0,0) frame.Overlay:Show() frame.Overlay:SetFrameLevel(10) - frame.Level:SetTextColor(C.Grey()) - frame.Summary:SetTextColor(C.Grey()) + frame.Level:SetTextColor(GetRGB(C.Grey())) + frame.Summary:SetTextColor(GetRGB(C.Grey())) local stats=missionstats[frame] if stats then - stats.Chance:SetTextColor(C.Grey()) + stats.Chance:SetTextColor(GetRGB(C.Grey())) end local members=missionmembers[frame] if members then @@ -1001,7 +1004,7 @@ function module:AddMembers(frame) threats:Hide() local perc=select(4,G.GetPartyMissionInfo(missionID)) stats.Chance:SetFormattedText(PERCENTAGE_STRING,perc) - stats.Chance:SetTextColor(addon:GetDifficultyColors(perc,true)) + stats.Chance:SetTextColor(GetRGB(addon:GetDifficultyColors(perc,true))) return end local lastkey=missionKEYS[missionID] @@ -1033,14 +1036,14 @@ function module:AddMembers(frame) end local perc=party.perc or 0 stats.Chance:SetFormattedText(ps,perc) - stats.Chance:SetTextColor(addon:GetDifficultyColors(perc,true)) + stats.Chance:SetTextColor(GetRGB(addon:GetDifficultyColors(perc,true))) missionKEYS[missionID]=key local emptymarker=UNUSED for i=1,mission.numFollowers do if party:Follower(i) then missionNonFilled=false if select(2,members.Champions[i]:SetFollower(party:Follower(i),true)) then - stats.Chance:SetTextColor(C.Grey()) + stats.Chance:SetTextColor(GetRGB(C.Grey())) end else if i==1 then emptymarker = nil end @@ -1149,9 +1152,9 @@ function module:AddThreats(frame,threats,party,missionID) threats.Cost:SetFormattedText(addon.resourceFormat,cost) local color=goodColor(cost>=r) if cost>r then - threats.Cost:SetTextColor(C:Red()) + threats.Cost:SetTextColor(GetRGB(C:Red())) else - threats.Cost:SetTextColor(C:Green()) + threats.Cost:SetTextColor(GetRGB(C:Green())) end threats.Cost:ClearAllPoints() threats.Cost:SetPoint("LEFT",frame.Summary,"RIGHT",5,0) diff --git a/missionpage.lua b/missionpage.lua index e7b53a9..1efd4d1 100644 --- a/missionpage.lua +++ b/missionpage.lua @@ -72,6 +72,11 @@ dprint=function() end ddump=function() end local print=function() end --@end-non-debug@]===] + +local function GetRGB(r, g, b, whatever) + return r, g, b +end + local GARRISON_FOLLOWER_COMBAT_ALLY=GARRISON_FOLLOWER_COMBAT_ALLY local GARRISON_FOLLOWER_ON_MISSION=GARRISON_FOLLOWER_ON_MISSION local GARRISON_FOLLOWER_INACTIVE=GARRISON_FOLLOWER_INACTIVE @@ -126,7 +131,7 @@ function module:FillMissionPage(missionInfo,key) expires:SetDrawLayer(model:GetDrawLayer()) end expires:SetFormattedText(GARRISON_MISSION_AVAILABILITY2,missionInfo.offerTimeRemaining or "") - expires:SetTextColor(addon:GetAgeColor(missionInfo.offerEndTime)) + expires:SetTextColor(GetRGB(addon:GetAgeColor(missionInfo.offerEndTime))) expires:SetPoint("TOPLEFT",stage.MissionInfo,"BOTTOMLEFT",0,-2) if not button then button=addon:GetFactory():Button(OHFMissionPage,L["Analyze parties"],L["See all possible parties for this mission"]) @@ -233,7 +238,7 @@ function module:Update(scrollFrame) button.key=key button.party=party button.Perc:SetFormattedText(PERCENTAGE_STRING,party.perc) - button.Perc:SetTextColor(addon:GetDifficultyColors(party.perc,true)) + button.Perc:SetTextColor(GetRGB(addon:GetDifficultyColors(party.perc,true))) local text='' if key==parties.uncappedkey then text=text .. C(L["Uncapped"],"Blue") .. ' ' diff --git a/pkgmeta.yaml b/pkgmeta.yaml index a62f152..5605c7a 100644 --- a/pkgmeta.yaml +++ b/pkgmeta.yaml @@ -1,4 +1,4 @@ -package-as: OrderHallCommander +package-as: OrderHallCommanderRedux enable-nolib-creation: no externals: diff --git a/tutorials.lua b/tutorials.lua index ad4b783..ae1522c 100644 --- a/tutorials.lua +++ b/tutorials.lua @@ -103,7 +103,7 @@ end --*BEGIN local BFAMissionFrame=BFAMissionFrame local tutorialVersion=1 -local OHFButtons=OHFMissions.listScroll.buttons +local GetButton=OHFMissions.ScrollBox.Find local HelpPlate_TooltipHide=HelpPlate_TooltipHide local HelpPlateTooltip=HelpPlateTooltip local platestrata = HelpPlateTooltip:GetFrameStrata() @@ -193,7 +193,7 @@ tutorials={ { back=1, text=L["You can blacklist missions right clicking mission button.\nSince 1.5.1 you can start a mission witout passing from mission page shift-clicking the mission button.\nBe sure you liked the party because no confirmation is asked"], - parent=function() return OHFButtons[1] end, + parent=function() return GetButton(1) end, anchor="TOP", onmissing=missingMessage, }, @@ -201,7 +201,7 @@ tutorials={ back=2, text='Followers can be "locked" to a specific mission.\nWhen you lock a follower, he will not used for any other mission\nLocking follower around is a way to optimize your setup, you can keep locking and unlocking followers to different missions to achieve the best overall combination', anchor="TOP", - parent=function() local f=addon:GetMembersFrame(OHFButtons[1]) if f then return f.Champions[1] end end, + parent=function() local f=addon:GetMembersFrame(GetButton(1)) if f then return f.Champions[1] end end, level=-1, onmissing=missingMessage, }, @@ -209,7 +209,7 @@ tutorials={ back=3, text=L['Slots (non the follower in it but just the slot) can be banned.\nWhen you ban a slot, that slot will not be filled for that mission.\nExploiting the fact that troops are always in the leftmost slot(s) you can achieve a nice degree of custom tailoring, reducing the overall number of followers used for a mission'], anchor="TOP", - parent=function() local f=addon:GetMembersFrame(OHFButtons[1]) if f then return f.Champions[3] or f.Champions[2] or f.Champions[1] end end, + parent=function() local f=addon:GetMembersFrame(GetButton(1)) if f then return f.Champions[3] or f.Champions[2] or f.Champions[1] end end, level=-1, onmissing=missingMessage, }, @@ -238,8 +238,8 @@ tutorials={ { back=1, action=function() - if OHFButtons[1] then - addon:GetMissionlistModule():RawMissionClick(OHFButtons[1],"LeftButton") + if GetButton(1) then + addon:GetMissionlistModule():RawMissionClick(GetButton(1),"LeftButton") end end, anchor="TOP", diff --git a/widgets/MissionsList.lua b/widgets/MissionsList.lua index 79174f3..cc516d4 100644 --- a/widgets/MissionsList.lua +++ b/widgets/MissionsList.lua @@ -17,6 +17,11 @@ local GARRISON_FOLLOWER_DISBANDED=GARRISON_FOLLOWER_DISBANDED local BONUS_LOOT_LABEL=C(" (".. BONUS_LOOT_LABEL .. ")","Green") local GetItemInfo,GetItemIcon=GetItemInfo,GetItemIcon local m={} --#Widget + +local function GetRGB(r, g, b, whatever) + return r, g, b +end + function m:ScrollDown() local obj=self.scroll if (#self.missions >1 and obj.scrollbar and obj.scrollbar:IsShown()) then @@ -67,14 +72,14 @@ function m:AddMissionResult(missionID,success) else mission.Result:SetText(GARRISON_MISSION_SUCCESS) end - mission.Result:SetTextColor(C:Green()) + mission.Result:SetTextColor(GetRGB(C:Green())) for i=1,#frame.Rewards do frame.Rewards[i].Icon:SetDesaturated(false) frame.Rewards[i].Quantity:Show() end else mission.Result:SetText(GARRISON_MISSION_FAILED) - mission.Result:SetTextColor(C:Red()) + mission.Result:SetTextColor(GetRGB(C:Red())) for i=1,#frame.Rewards do frame.Rewards[i].Icon:SetDesaturated(true)