diff --git a/.project b/.project index a928868..c89c49c 100644 --- a/.project +++ b/.project @@ -19,15 +19,4 @@ <natures> <nature>org.eclipse.koneki.ldt.nature</nature> </natures> - <filteredResources> - <filter> - <id>1485246518169</id> - <name></name> - <type>26</type> - <matcher> - <id>org.eclipse.ui.ide.multiFilter</id> - <arguments>1.0-name-matches-false-false-OrderHallCommander</arguments> - </matcher> - </filter> - </filteredResources> </projectDescription> diff --git a/OrderHallCommander/OrderHallCommander.lua b/OrderHallCommander/OrderHallCommander.lua deleted file mode 100644 index eca96e8..0000000 --- a/OrderHallCommander/OrderHallCommander.lua +++ /dev/null @@ -1,376 +0,0 @@ -local __FILE__=tostring(debugstack(1,2,0):match("(.*):1:")) -- Always check line number in regexp and file, must be 1 -local function pp(...) print(GetTime(),"|cff009900",__FILE__:sub(-15),strjoin(",",tostringall(...)),"|r") end ---*TYPE addon ---*CONFIG noswitch=false,profile=true,enhancedProfile=true ---*MIXINS "AceHook-3.0","AceEvent-3.0","AceTimer-3.0" ---*MINOR 35 --- Generated on 20/01/2017 08:15:04 -local me,ns=... -local LibInit,minor=LibStub("LibInit",true) -assert(LibInit,me .. ": Missing LibInit, please reinstall") -assert(minor>=35,me ..': Need at least Libinit version 35') -local addon=LibInit:NewAddon(ns,me,{noswitch=false,profile=true,enhancedProfile=true},"AceHook-3.0","AceEvent-3.0","AceTimer-3.0") --#Addon --- Template -local G=C_Garrison -local _ -local AceGUI=LibStub("AceGUI-3.0") -local C=addon:GetColorTable() -local L=addon:GetLocale() -local new=addon.NewTable -local del=addon.DelTable -local kpairs=addon:GetKpairs() ---local empty=addon:GetEmpty() -local OHF=OrderHallMissionFrame -local OHFMissionTab=OrderHallMissionFrame.MissionTab --Container for mission list and single mission -local OHFMissions=OrderHallMissionFrame.MissionTab.MissionList -- same as OrderHallMissionFrameMissions Call Update on this to refresh Mission Listing -local OHFFollowerTab=OrderHallMissionFrame.FollowerTab -- Contains model view -local OHFFollowerList=OrderHallMissionFrame.FollowerList -- Contains follower list (visible in both follower and mission mode) -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 followerType=LE_FOLLOWER_TYPE_GARRISON_7_0 -local garrisonType=LE_GARRISON_TYPE_7_0 -local FAKE_FOLLOWERID="0x0000000000000000" -local MAXLEVEL=110 -local dprint=print -local ddump ---@debug@ -LoadAddOn("Blizzard_DebugTools") -ddump=DevTools_Dump -LoadAddOn("LibDebug") --- Addon Build, we need to create globals the easy way -local function encapsulate() -if LibDebug then LibDebug() dprint=print end -end -encapsulate() -local pcall=pcall -local function parse(default,rc,...) - if rc then return default else return ... end -end -addon.safeG=setmetatable({},{ - __index=function(table,key) - rawset(table,key, - function(default,...) - return parse(default,pcall(G[key],...)) - end - ) - return table[key] - end -}) - ---@end-debug@ ---[===[@non-debug@ -dprint=function() end -ddump=function() end -local print=function() end ---@end-non-debug@]===] - --- End Template - DO NOT MODIFY ANYTHING BEFORE THIS LINE ---*BEGIN -local MISSING=ITEM_MISSING:format('|cff'..C.Red.c)..'|r' -local ctr=0 --- Sometimes matchmakimng starts before these are defined, so I put here a sensible default (actually, this values are constans) -addon.MAXLEVEL=110 -addon.MAXQUALITY=4 -addon.MAXQLEVEL=addon.MAXLEVEL+addon.MAXQUALITY -function addon.resolve(frame) - local name - if type(frame)=="table" and frame.GetName then - name=frame:GetName() - if not name then - local parent=frame:GetParent() - if not parent then return "UIParent" end - for k,v in pairs(parent) do - if v==frame then - name=resolve(parent) .. '.'..k - return name - end - end - else - return name - end - _G['UNK_'..ctr]=frame - return 'UNK_'..ctr - end - return "unk" -end -function addon.colors(c1,c2) - return C[c1].r,C[c1].g,C[c1].b,C[c2].r,C[c2].g,C[c2].b -end -function addon:ColorFromBias(followerBias) - if ( followerBias == -1 ) then - --return 1, 0.1, 0.1 - return C:Red() - elseif ( followerBias < 0 ) then - --return 1, 0.5, 0.25 - return C:Orange() - else - --return 1, 1, 1 - return C:Green() - end -end -local colors=addon.colors -_G.OrderHallCommanderMixin={} -_G.OrderHallCommanderMixinThreats={} -_G.OrderHallCommanderMixinFollowerIcon={} -_G.OrderHallCommanderMixinMenu={} -local Mixin=OrderHallCommanderMixin --#Mixin -local MixinThreats=OrderHallCommanderMixinThreats --#MixinThreats -local MixinMenu=OrderHallCommanderMixinMenu --#MixinMenu -local MixinFollowerIcon= OrderHallCommanderMixinFollowerIcon --#MixinFollowerIcon - -function Mixin:CounterTooltip() - local tip=self:AnchorTT() - tip:AddLine(self.Ability) - tip:AddLine(self.Description) - tip:Show() - -end -function Mixin:DebugOnLoad() - self:RegisterForDrag("LeftButton") -end -function Mixin:Bump(tipo,value) - value = value or 1 - local riga=tipo..'Refresh' - self[tipo]=self[tipo]+value - self[riga]:SetFormattedText("%s: %d",tipo,self[tipo]) -end -function Mixin:Set(tipo,value) - value = value or 0 - local riga=tipo..'Refresh' - self[tipo]=value - self[riga]:SetFormattedText("%s: %d",tipo,self[tipo]) -end -function Mixin:DragStart() - self:StartMoving() -end -function Mixin:DragStop() - self:StopMovingOrSizing() -end -function Mixin:AnchorTT(anchor) - anchor=anchor or "ANCHOR_TOPRIGHT" - GameTooltip:SetOwner(self,anchor) - return GameTooltip -end -function Mixin:ShowTT() - if not self.tooltip then return end - local tip=Mixin.AnchorTT(self) - tip:SetText(self.tooltip) - tip:Show() -end -function Mixin:HideTT() - GameTooltip:Hide() -end -function Mixin:Dump(data) - local tip=self:AnchorTT("ANCHOR_CURSOR") - if type(data)~="table" then - data=self - end - tip:AddLine(data:GetName(),C:Green()) - self.DumpData(tip,data) - tip:Show() -end -function Mixin.DumpData(tip,data) - for k,v in kpairs(data) do - local color="Silver" - if type(v)=="number" then color="Cyan" - elseif type(v)=="string" then color="Yellow" v=v:sub(1,30) - elseif type(v)=="boolean" then v=v and 'True' or 'False' color="White" - elseif type(v)=="table" then color="Green" if v.GetObjectType then v=v:GetObjectType() else v=tostring(v) end - else v=type(v) color="Blue" - end - if k=="description" then v =v:sub(1,10) end - tip:AddDoubleLine(k,v,colors("Orange",color)) - end -end -local threatPool -function Mixin:ThreatsOnLoad() - if not threatPool then threatPool=CreateFramePool("Frame",UIParent,"OHCThreatsCounters") end - self.usedPool={} -end - -function MixinThreats:AddIconsAndCost(mechanics,biases,cost,color,notEnoughResources) - local icons=OHF.abilityCountersForMechanicTypes - if not icons then - --@debug@ - print("Empty icons") - --@end-debug@ - return false - end - for i=1,#self.usedPool do - threatPool:Release(self.usedPool[i]) - end - self.mechanics=mechanics - wipe(self.usedPool) - local previous - for index,mechanic in pairs(mechanics) do - local th=threatPool:Acquire() - tinsert(self.usedPool,th) - th.Icon:SetTexture(icons[mechanic.id].icon) - th.Name=mechanic.name - th.Description=mechanic.description - th.Ability=mechanic.ability.name - th:SetParent(self) - th:SetFrameStrata(self:GetFrameStrata()) - th:SetFrameLevel(self:GetFrameLevel()+1) - if not previous then - th:SetPoint("BOTTOMLEFT",0,0) - previous=th - else - th:SetPoint("BOTTOMLEFT",previous,"BOTTOMRIGHT",5,0) - previous=th - end - th.Border:SetVertexColor(addon:ColorFromBias(biases[mechanic] or mechanic.bias)) - th:Show() - end - if cost >=0 then - self.Cost:Show() - self.Cost:SetFormattedText(addon.resourceFormat,cost) - self.Cost:SetTextColor(C[color]()) - self.Cost:ClearAllPoints() - self.Cost:SetPoint("BOTTOMLEFT",previous,"BOTTOMRIGHT",5,0) - self.HighCost:SetTextColor(C.Orange()) - self.HighCost:ClearAllPoints() - self.HighCost:SetPoint("BOTTOMLEFT",previous,"BOTTOMRIGHT",5,0) - if notEnoughResources then - self.HighCost:Show() - else - self.HighCost:Hide() - end - else - self.Cost:Hide() - self.HighCost:Hide() - end - return true -end - -function MixinFollowerIcon:SetFollower(followerID,checkStatus) - local info=addon:GetFollowerData(followerID) - if not info or not info.followerID then - local rc - rc,info=pcall(G.GetFollowerInfo,followerID) - if not rc or not info then - return self:SetEmpty(LFG_LIST_APP_TIMED_OUT) - end - end - self.followerID=followerID - self:SetupPortrait(info) - local status=(followerID and checkStatus) and G.GetFollowerStatus(followerID) or nil - if status then - self:SetILevel(0) --CHAT_FLAG_DND - self.Level:SetText(status); - self.Portrait:SetDesaturated(true) - self:SetQuality(1) - self:GetParent():SetNotReady(true) - else - self.Portrait:SetDesaturated(false) - if info.isMaxLevel then - self:SetILevel(info.iLevel) - else - self:SetLevel(info.level) - end - end -end -function MixinFollowerIcon:SetEmpty(message) - self.followerID=false - self:SetLevel(message or MISSING) - self:SetPortraitIcon() - self:SetQuality(1) - self:GetParent():SetNotReady(true) -end -function MixinFollowerIcon:ShowTooltip() - if not self.followerID then ---@debug@ - return self:Dump() ---@end-debug@ ---[===[@non-debug@ - return ---@end-non-debug@]===] - end - local link = C_Garrison.GetFollowerLink(self.followerID); - if link then - local levelXP=G.GetFollowerLevelXP(self.followerID) - local xp=G.GetFollowerXP(self.followerID) - GarrisonFollowerTooltip:ClearAllPoints() - GarrisonFollowerTooltip:SetPoint("BOTTOM", self, "TOP") - local _, garrisonFollowerID, quality, level, itemLevel, ability1, ability2, ability3, ability4, trait1, trait2, trait3, trait4, spec1 = strsplit(":", link) - GarrisonFollowerTooltip_Show(tonumber(garrisonFollowerID), true, tonumber(quality), tonumber(level), xp,levelXP, tonumber(itemLevel), tonumber(spec1), tonumber(ability1), tonumber(ability2), tonumber(ability3), tonumber(ability4), tonumber(trait1), tonumber(trait2), tonumber(trait3), tonumber(trait4)) - if not GarrisonFollowerTooltip.Status then - GarrisonFollowerTooltip.Status=GarrisonFollowerTooltip:CreateFontString(nil, "ARTWORK", "GameFontHighlight") - GarrisonFollowerTooltip.Status:SetPoint("BOTTOM",0,5) - end - local status=G.GetFollowerStatus(self.followerID) - if status then - GarrisonFollowerTooltip.Status:SetText(TOKEN_MARKET_PRICE_NOT_AVAILABLE.. ': ' .. status) - GarrisonFollowerTooltip.Status:SetTextColor(C:Orange()) - GarrisonFollowerTooltip.Status:Show() - GarrisonFollowerTooltip:SetHeight(GarrisonFollowerTooltip:GetHeight()+10) - else - GarrisonFollowerTooltip.Status:Hide() - end - end -end -function MixinFollowerIcon:HideTooltip() - GarrisonFollowerTooltip:Hide() -end -function Mixin:MembersOnLoad() - for i=1,3 do - if self.Champions[i] then - self.Champions[1]:SetPoint("RIGHT") - else - self.Champions[i]=CreateFrame("Frame",nil,self,"OHCFollowerIcon") - self.Champions[i]:SetPoint("RIGHT",self.Champions[i-1],"LEFT",-15,0) - end - self.Champions[i]:SetFrameLevel(self:GetFrameLevel()+1) - self.Champions[i]:Show() - self.Champions[i]:SetEmpty() - 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.Orange()) -end -function Mixin:MembersOnShow() - self:SetNotReady() -end -function Mixin:SetNotReady(show) - if show then - self.NotReady:Show() - else - self.NotReady:Hide() - end -end -function MixinMenu:OnLoad() - self.Top:SetAtlas("_StoneFrameTile-Top", true); - self.Bottom:SetAtlas("_StoneFrameTile-Bottom", true); - self.Left:SetAtlas("!StoneFrameTile-Left", true); - self.Right:SetAtlas("!StoneFrameTile-Left", true); - self.GarrCorners.TopLeftGarrCorner:SetAtlas("StoneFrameCorner-TopLeft", true); - self.GarrCorners.TopRightGarrCorner:SetAtlas("StoneFrameCorner-TopLeft", true); - self.GarrCorners.BottomLeftGarrCorner:SetAtlas("StoneFrameCorner-TopLeft", true); - self.GarrCorners.BottomRightGarrCorner:SetAtlas("StoneFrameCorner-TopLeft", true); - self.CloseButton:SetScript("OnClick",function() MixinMenu.OnClick(self) end) -end -if not addon.GetEmpty then -- Will be moved into LibInit ---@debug@ - print("Used internal GetEmpty") ---@end-debug@ - local type=type - local function empty(obj) - if not obj then return true end -- Simplest case, obj evaluates to false in boolean context - local t=type(obj) - if t=="number" then - return obj==0 - elseif t=="bool" then - return true - elseif t=="string" then - return obj=='' or obj==tostring(nil) - elseif t=="table" then - return not next(obj) - end - return false -- Userdata and threads can never be empty - end - function addon:GetEmpty() - return empty - end -end - diff --git a/OrderHallCommander/OrderHallCommander.toc b/OrderHallCommander/OrderHallCommander.toc deleted file mode 100644 index c2b9edf..0000000 --- a/OrderHallCommander/OrderHallCommander.toc +++ /dev/null @@ -1,48 +0,0 @@ -## Interface: 70100 -## Title: OrderHallCommander -## Notes: Sending all follower to missions with just one click and more -## Notes-itIT: Invia tutti i seguaci in missione con un click e molto altro -## Notes-frFR: Vous aide au moment de choisir le droit utilisateur pour la bonne mission -## Notes-esES: Enviar todos los seguidores en una misión con un clic y más -## Notes-esMX: Enviar todos los seguidores en una misión con un clic y más -## Notes-ptBR: Enviar todos os seguidores em uma missão com um clique e mais -## Notes-koKR: 클릭 등을 통해 임무에 모든 추종자 보내기 -## Notes-deDE: Senden Sie alle Anhänger auf einer Mission mit einem Klick und mehr -## Notes-ruRU: Отправить всех последователей на миссии со щелчком и более -## Notes-zhTW: 发送所有的追随者与点击多任务 -## Notes-zhCN: 發送所有的追隨者與點擊多任務 -## Author: Alar of Runetotem -## Version: 1.0.0 7.1.0 -## X-Revision: GC -## eMail: alar@aspide.it -## URL: http://wow.aspide.it -## OptionalDeps: Ace3,LibInit -## Dependencies: Blizzard_OrderHallUI -## DefaultState: Enabled -## LoadOnDemand: 1 -## LoadWith: Blizzard_OrderHallUI -## SavedVariables: dbOHC -## SavedVariablesPerCharacter: dbOHCperChar -## X-ID: OHC -## X-Database:dbOHC -## X-Category: Garrison -## X-License: GPL v3 -## X-eMail: alar@aspide.it -## X-Date: 2017-01-21T5:43:38Z -## X-Embeds: LibInit -## X-GotWith: GarrisonCommander -embeds.xml -localization.lua -OrderHallCommander.xml -core.lua -autocomplete.lua -autopilot.lua -cache.lua -followerpage.lua -matchmaker.lua -missionlist.lua -missionpage.lua -widgets.xml -RelNotes.lua -data.lua -wowhead.lua diff --git a/OrderHallCommander/OrderHallCommander.xml b/OrderHallCommander/OrderHallCommander.xml deleted file mode 100644 index 2bbaa08..0000000 --- a/OrderHallCommander/OrderHallCommander.xml +++ /dev/null @@ -1,293 +0,0 @@ -<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ -..\FrameXML\UI.xsd"> - <Script file="OrderHallCommander.lua"/> - <Button name="OHCMissionButton" inherits="OrderHallMissionListButtonTemplate" virtual="true"> - <Size x="832" y="75"/> - <KeyValues> - <KeyValue name="IsCustom" value="true" type="boolean"/> - </KeyValues> - </Button> - <Button name="OHCMiniMissionButton" inherits="GarrisonLandingPageReportMissionTemplate" virtual="true"> - <Size x="400" y="47"/> - </Button> - <Frame parentKey="Stats" name="OHCStats" virtual="true" enableMouse="true" mixin="OrderHallCommanderMixin"> - <Size x="110" y="75"/> - <Layers> - <Layer level="OVERLAY"> - <FontString parentKey="Expire" justifyV="TOP" justifyH="CENTER" inherits="GameFontHighlightSmallOutline"> - <Size x="95" y="30"/> - <Anchors> - <Anchor point="TOPLEFT" x="5" y="-10"/> - <Anchor point="TOPRIGHT" x="5" y="-10"/> - </Anchors> - </FontString> - <FontString parentKey="Chance" justifyV="BOTTOM" justifyH="CENTER" inherits="NumberFontNormalHuge"> - <Size x="95" y="30"/> - <Anchors> - <Anchor point="BOTTOMLEFT" x="5" y="10"/> - <Anchor point="BOTTOMRIGHT" x="5" y="10"/> - </Anchors> - </FontString> - </Layer> - </Layers> - <Scripts> -<!--@debug@--> - <OnEnter method="Dump"/> -<!--@end-debug@--> - <OnLeave method="HideTT"/> - </Scripts> - </Frame> - <Frame name="OHCThreatsCounters" virtual="true" mixin="OrderHallCommanderMixin" enableMouse="true" inherits="GarrisonAbilityCounterTemplate"> - <Scripts> - <OnEnter method="CounterTooltip"/> - <OnLeave method="HideTT"/> - </Scripts> - </Frame> - <Frame parentKey="Threats" name="OHCThreats" virtual="true" mixin="OrderHallCommanderMixin,OrderHallCommanderMixinThreats" enableMouse="true"> - <Size x="128" y="24"/> - <Layers> - <Layer level="OVERLAY"> - <FontString parentKey="Cost" justifyV="TOP" justifyH="LEFT" inherits="GameFontHighlightSmallOutline"> - <Size x="250" y="20"/> - </FontString> - <FontString parentKey="HighCost" text="GARRISON_NOT_ENOUGH_MATERIALS_TOOLTIP" justifyV="BOTTOM" justifyH="LEFT" inherits="GameFontHighlightSmallOutline"> - <Size x="350" y="20"/> - </FontString> - </Layer> - </Layers> - <Scripts> - <OnLoad method="ThreatsOnLoad"/> -<!--@debug@--> - <OnEnter> - self:Dump(self:GetParent()) - </OnEnter> -<!--@end-debug@--> - <OnLeave method="HideTT"/> - </Scripts> - </Frame> - <Frame name="OHCMembers" mixin="OrderHallCommanderMixin" virtual="true" enableMouse="false"> - <Size x="1" y="70"/> - <Frames> - <Frame parentKey="NotReady" strata="HIGH"> - <Anchors> - <Anchor point="TOPLEFT" x="-5" y="0"/> - <Anchor point="BOTTOMRIGHT" x="5" y="0"/> - </Anchors> - <Layers> - <Layer level="OVERLAY"> - <FontString parentKey="Text" justifyV="TOP" justifyH="CENTER" inherits="GameFontNormalOutline" text="GARRISON_PARTY_NOT_ENOUGH_CHAMPIONS"> - <Anchors> - <Anchor point="TOPLEFT" x="5" y="0"/> - <Anchor point="BOTTOMRIGHT" x="-5" y="0"/> - </Anchors> - </FontString> - </Layer> - </Layers> - </Frame> - <Frame parentArray="Champions" inherits="OHCFollowerIcon" /> - </Frames> - <Scripts> - <OnLoad method="MembersOnLoad"/> - <OnLeave method="HideTT"/> - <OnShow methot="MembersOnShow"/> - </Scripts> - </Frame> - <Frame name="OHCFollowerIcon" mixin="OrderHallCommanderMixin,OrderHallCommanderMixinFollowerIcon" enableMouse="true" inherits="GarrisonFollowerPortraitTemplate" virtual="true" > - <Size x="52" y="60"/> - <Scripts> - <OnEnter method="ShowTooltip"/> - <OnLeave method="HideTooltip"/> - </Scripts> - </Frame> - <Frame name="OHCFollowerPortrait" enableMouse="true" inherits="GarrisonMissionPageFollowerTemplate" virtual="true" > - <Size x="161" y="58"/> - </Frame> - <Button name="OHCFollowerButton" inherits="GarrisonFollowerButtonTemplate" virtual="true"> - <Size x="260" y="56"/> - </Button> - <Button name="OHCUpgradeButton" enableMouse="true" virtual="true" inherits="GarrisonMissionListButtonRewardTemplate"> - <Size x="32" y="32"/> - </Button> - <Button name="OHCPin" virtual="true" enableMouse="true" hidden="true"> - <Size x="64" y="64" /> - <Anchors> - <Anchor point="TOPLEFT" relativeTo="OrderHallMissionFrame" relativePoint="TOPRIGHT" x="-15" y="13"/> - </Anchors> - <NormalTexture file="Interface\CHATFRAME\UI-ChatIcon-ScrollUp-Up"> - <Size x="66" y="66" /> - </NormalTexture> - <HighlightTexture file="Interface\CHATFRAME/UI-ChatIcon-BlinkHilight" alphaMode="ADD"> - <Size x="60" y="60" /> - </HighlightTexture> - <Scripts> - <OnLeave> - GameTooltip:Hide() - </OnLeave> - <OnEnter> - GameTooltip:SetOwner(self,"ANCHOR_TOPRIGHE") - if not self.tooltip then return end - GameTooltip:SetText(self.tooltip) - GameTooltip:Show() - </OnEnter> - </Scripts> - </Button> - - <Frame name="OHCMenu" mixin="OrderHallCommanderMixin,OrderHallCommanderMixinMenu" inherits="GarrisonUITemplate" virtual="true"> - <Size x="220" y="30"/> - <KeyValues> - <KeyValue key="PinOpen" value="true" type="boolean"/> - <KeyValue key="DefaultWidth" value="220" type="number"/> - </KeyValues> - <Anchors> - <Anchor point="TOPLEFT" relativeKey="$parent" relativePoint="TOPRIGHT" x="0" y="0"/> - <Anchor point="BOTTOMLEFT" relativeKey="$parent" relativePoint="BOTTOMRIGHT" x="0" y="0"/> - </Anchors> - <Layers> - <Layer level="OVERLAY"> - <FontString parentKey="Title" justifyV="TOP" justifyH="CENTER" inherits="GameFontHighlightSmallOutline" text="OrderHallCommander"> - <Size x="95" y="30"/> - <Anchors> - <Anchor point="TOPLEFT" x="0" y="-5"/> - <Anchor point="TOPRIGHT" x="-32" y="-5"/> - </Anchors> - </FontString> - </Layer> - </Layers> - <Scripts> - <OnLoad method="OnLoad"/> - <OnLeave>GameTooltip:Hide()</OnLeave> - </Scripts> - </Frame> - <CheckButton name="OHCTab" mouseEnable="true" virtual="true" inherits="SpellBookSkillLineTabTemplate"> - <Size x="100" y="50" /> - <KeyValues> - <KeyValue key="flag" value="" type="string"/> - <KeyValue key="tipo" value="" type="string"/> - </KeyValues> - <Layers> - <Layer level="ARTWORK"> - <Texture parentKey="Icon" file="Interface\ACHIEVEMENTFRAME\UI-ACHIEVEMENT-SHIELDS-NOPOINTS"> - <Size x="48" y="48"/> - <Anchors> - <Anchor point="TOPLEFT" x="0" y="0"/> - </Anchors> - <TexCoords left="0" right="0.5" top="0.5" bottom="1"/> - </Texture> - </Layer> - <Layer level="OVERLAY"> - <FontString parentKey="Name" text="Example" justifyV="CENTER" justifyH="LEFT" inherits="GameFontHighlightSmallOutline"> - <Size x="95" y="30"/> - <Anchors> - <Anchor point="LEFT" x="40" y="10"/> - <Anchor point="RIGHT" x="40" y="10"/> - </Anchors> - </FontString> - </Layer> - </Layers> - </CheckButton> - <Frame parentKey="Spinner" name="OHCSpinner" virtual="true" inherits="LoadingSpinnerTemplate"> - <Scripts> - <OnLoad> - self.Start=function(self) self:Show() self.Anim:Play() end - self.Stop=function(self) self.Anim:Stop() self:Hide() end - </OnLoad> - </Scripts> - </Frame> - <Frame name="OHCAlertFrameTemplate" inherits="GarrisonStandardFollowerAlertFrameTemplate" virtual="true"/> -<!--@debug@--> - <Frame name="OHCDebug" mixin="OrderHallCommanderMixin" visible="true" enableMouse="true" movable="true"> - <Size x="240" y="160"/> - <KeyValues> - <KeyValue key="Missions" value="0" type="number"/> - <KeyValue key="Followers" value="0" type="number"/> - <KeyValue key="Coroutines" value="0" type="number"/> - <KeyValue key="Parties" value="0" type="number"/> - <KeyValue key="NumParties" value="0" type="number"/> - </KeyValues> - <Anchors> - <Anchor point="BOTTOMLEFT" x="0" y="20"/> - </Anchors> - <Backdrop bgFile="Interface\DialogFrame\UI-DialogBox-Background" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" tile="true"> - <BackgroundInsets> - <AbsInset left="11" right="12" top="12" bottom="11"/> - </BackgroundInsets> - <TileSize> - <AbsValue val="32"/> - </TileSize> - <EdgeSize> - <AbsValue val="32"/> - </EdgeSize> - </Backdrop> - <Layers> - <Layer level="ARTWORK"> - <Texture name="$parentGameMenuFrameHeader" file="Interface\DialogFrame\UI-DialogBox-Header"> - <Size x="256" y="64"/> - <Anchors> - <Anchor point="TOP" x="0" y="12"/> - </Anchors> - </Texture> - <FontString inherits="GameFontNormal" text="OHC Debug"> - <Anchors> - <Anchor point="TOP" relativeTo="$parentGameMenuFrameHeader" x="0" y="-14"/> - </Anchors> - </FontString> - </Layer> - <Layer level="OVERLAY"> - <FontString parentKey="MissionsRefresh" text="Missions" justifyV="CENTER" justifyH="LEFT" inherits="GameFontHighlightSmallOutline"> - <Size x="95" y="30"/> - <Anchors> - <Anchor point="TOPLEFT" x="10" y="-20"/> - <Anchor point="TOPRIGHT" x="-10" y="-20"/> - </Anchors> - </FontString> - <FontString parentKey="FollowersRefresh" text="Followers" justifyV="CENTER" justifyH="LEFT" inherits="GameFontHighlightSmallOutline"> - <Size x="95" y="30"/> - <Anchors> - <Anchor point="TOPLEFT" x="10" y="-40"/> - <Anchor point="TOPRIGHT" x="-10" y="-40"/> - </Anchors> - </FontString> - <FontString parentKey="CoroutinesRefresh" text="Coroutines" justifyV="CENTER" justifyH="LEFT" inherits="GameFontHighlightSmallOutline"> - <Size x="95" y="30"/> - <Anchors> - <Anchor point="TOPLEFT" x="10" y="-60"/> - <Anchor point="TOPRIGHT" x="-10" y="-60"/> - </Anchors> - </FontString> - <FontString parentKey="PartiesRefresh" text="Parties" justifyV="CENTER" justifyH="LEFT" inherits="GameFontHighlightSmallOutline"> - <Size x="95" y="30"/> - <Anchors> - <Anchor point="TOPLEFT" x="10" y="-80"/> - <Anchor point="TOPRIGHT" x="-10" y="-80"/> - </Anchors> - </FontString> - <FontString parentKey="NumPartiesRefresh" text="Num Parties" justifyV="CENTER" justifyH="LEFT" inherits="GameFontHighlightSmallOutline"> - <Size x="95" y="30"/> - <Anchors> - <Anchor point="TOPLEFT" x="10" y="-100"/> - <Anchor point="TOPRIGHT" x="-10" y="-100"/> - </Anchors> - </FontString> - <FontString parentKey="CacheRefresh" text="Cache Refresh" justifyV="CENTER" justifyH="LEFT" inherits="GameFontHighlightSmallOutline"> - <Size x="95" y="30"/> - <Anchors> - <Anchor point="TOPLEFT" x="10" y="-120"/> - <Anchor point="TOPRIGHT" x="-10" y="-120"/> - </Anchors> - </FontString> - </Layer> - </Layers> - <Scripts> - <OnLoad method="DebugOnLoad"/> - <OnDragStart method="DragStart"/> - <OnDragStop method="DragStop"/> - </Scripts> - </Frame> -<!--@end-debug@--> - <!-- - GarrisonFollowerXPGainTemplate - GarrisonFollowerXPBarTemplate - GarrisonFollowerLevelUpTemplate - --> - -</Ui> diff --git a/OrderHallCommander/RelNotes.lua b/OrderHallCommander/RelNotes.lua deleted file mode 100644 index 297d31c..0000000 --- a/OrderHallCommander/RelNotes.lua +++ /dev/null @@ -1,33 +0,0 @@ -local me,ns=... -local hlp=LibStub("LibInit"):GetAddon(me) -local L=hlp:GetLocale() -function hlp:loadHelp() -self:HF_Title(me,"RELNOTES") -self:HF_Paragraph("Description") -self:Wiki([[ -= OrderHallCommander helps you when choosing the right follower for the right mission = -== General enhancements == -* Mission panel is movable (position not saved, it's jus to see things, panel is so huge...) -* Success chance extimation shown in mission list (optionally considering only available followers) -* Proposed party buttons and mission autofill -* "What if" switches to change party composition based on criteria -== Silent mode == -typing /ohc silent in chat will eliminate every chat message from GarrisonCommander -]]) -self:RelNotes(0,2,4,[[ -Fix: lua errors in matchmaker.lua -]]) -self:RelNotes(0,2,0,[[ -Fix: sometimes cache was not refresh after completing missions,leaving al missions unpopulated -]]) -self:RelNotes(0,1,1,[[ -Fix: Checks we actually cached a follower before removing it from cache -Fix: one follower missions where not supported -Fix: Countered spells are now always marked -Feature: new options for party selection -]]) -self:RelNotes(0,1,0,[[ -Feature: First release -]]) -end - diff --git a/OrderHallCommander/autocomplete.lua b/OrderHallCommander/autocomplete.lua deleted file mode 100644 index 89b4dc7..0000000 --- a/OrderHallCommander/autocomplete.lua +++ /dev/null @@ -1,537 +0,0 @@ -local __FILE__=tostring(debugstack(1,2,0):match("(.*):1:")) -- Always check line number in regexp and file, must be 1 -local function pp(...) print(GetTime(),"|cff009900",__FILE__:sub(-15),strjoin(",",tostringall(...)),"|r") end ---*TYPE module ---*CONFIG noswitch=false,profile=true,enhancedProfile=true ---*MIXINS "AceHook-3.0","AceEvent-3.0","AceTimer-3.0" ---*MINOR 35 --- Generated on 20/01/2017 08:15:04 -local me,ns=... -local addon=ns --#Addon (to keep eclipse happy) -ns=nil -local module=addon:NewSubModule('Autocomplete',"AceHook-3.0","AceEvent-3.0","AceTimer-3.0") --#Module -function addon:GetAutocompleteModule() return module end --- Template -local G=C_Garrison -local _ -local AceGUI=LibStub("AceGUI-3.0") -local C=addon:GetColorTable() -local L=addon:GetLocale() -local new=addon.NewTable -local del=addon.DelTable -local kpairs=addon:GetKpairs() -local empty=addon:GetEmpty() -local OHF=OrderHallMissionFrame -local OHFMissionTab=OrderHallMissionFrame.MissionTab --Container for mission list and single mission -local OHFMissions=OrderHallMissionFrame.MissionTab.MissionList -- same as OrderHallMissionFrameMissions Call Update on this to refresh Mission Listing -local OHFFollowerTab=OrderHallMissionFrame.FollowerTab -- Contains model view -local OHFFollowerList=OrderHallMissionFrame.FollowerList -- Contains follower list (visible in both follower and mission mode) -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 followerType=LE_FOLLOWER_TYPE_GARRISON_7_0 -local garrisonType=LE_GARRISON_TYPE_7_0 -local FAKE_FOLLOWERID="0x0000000000000000" -local MAXLEVEL=110 - -local ShowTT=OrderHallCommanderMixin.ShowTT -local HideTT=OrderHallCommanderMixin.HideTT - -local dprint=print -local ddump ---@debug@ -LoadAddOn("Blizzard_DebugTools") -ddump=DevTools_Dump -LoadAddOn("LibDebug") - -if LibDebug then LibDebug() dprint=print end -local safeG=addon.safeG - ---@end-debug@ ---[===[@non-debug@ -dprint=function() end -ddump=function() end -local print=function() end ---@end-non-debug@]===] - --- End Template - DO NOT MODIFY ANYTHING BEFORE THIS LINE ---*BEGIN -local CompleteButton=OHFMissions.CompleteDialog.BorderFrame.ViewButton -local followerType=LE_FOLLOWER_TYPE_GARRISON_7_0 -local pairs=pairs -local format=format -local strsplit=strsplit -local mebefore={level=0,xp=0,xpMax=0} -local meafter={level=0,xp=0,xpMax=0} ---------------------------------------------------------------------------- -function module:OnInitialized() - local ref=OHFMissions.CompleteDialog.BorderFrame.ViewButton - local bt = CreateFrame('BUTTON',nil, ref, 'UIPanelButtonTemplate') - bt:SetText(L["HallComander Quick Mission Completion"]) - bt:SetWidth(bt:GetTextWidth()+10) - bt:SetPoint("CENTER",0,-50) - addon:ActivateButton(bt,"MissionComplete",L["Complete all missions without confirmation"]) -end - -function module:GenerateMissionCompleteList(title,anchor) - local w=AceGUI:Create("OHCMissionsList") ---@debug@ - title=format("%s %s %s",title,w.frame:GetName(),GetTime()*1000) ---@end-debug@ - w:SetTitle(title) - w:SetCallback("OnClose",function(widget) return module:MissionsCleanup() end) - --report:SetPoint("TOPLEFT",GMFMissions.CompleteDialog.BorderFrame) - --report:SetPoint("BOTTOMRIGHT",GMFMissions.CompleteDialog.BorderFrame) - w:ClearAllPoints() - w:SetPoint("TOP",anchor) - w:SetPoint("BOTTOM",anchor) - w:SetWidth(700) - w:SetParent(anchor) - w.frame:SetFrameStrata("HIGH") - return w -end ---@debug@ -function addon:ShowRewards() - return module:GenerateMissionCompleteList("Test",UIParent) -end ---@end-debug@ -local cappedCurrencies={ - GARRISON_CURRENCY, - GARRISON_SHIP_OIL_CURRENCY -} - -local missions={} -local states={} -local rewards={ - items={}, - followerQLevel=setmetatable({},{__index=function() return 0 end}), - followerXP=setmetatable({},{__index=function() return 0 end}), - followerPortrait={}, - followerName={}, - currencies=setmetatable({},{__index=function(t,k) rawset(t,k,{icon="",qt=0}) return t[k] end}), - bonuses={} -} -local scroller -local report -local timer -local function stopTimer() - if (timer) then - module:CancelTimer(timer) - timer=nil - end -end -local function startTimer(delay,event,...) - delay=delay or 0.2 - event=event or "LOOP" - stopTimer() - timer=module:ScheduleRepeatingTimer("MissionAutoComplete",delay,event,...) - --@debug@ - print("Timer rearmed for",event,delay) - --@end-debug@ -end -function module:MissionsCleanup() - local f=OHF - self:Events(false) - stopTimer() - f.MissionTab.MissionList.CompleteDialog:Hide() - f.MissionComplete:Hide() - f.MissionCompleteBackground:Hide() - f.MissionComplete.currentIndex = nil - f.MissionTab:Show() - -- Re-enable "view" button - CompleteButton:SetEnabled(true) - f:UpdateMissions() - f:CheckCompleteMissions() -end ---[[ -Eventi correlati al completamento missione -GARRISON_MISSION_COMPLETE_RESPONSE,missionID,true,true -GARRISON_FOLLOWER_DURABILITY_CHANGED,4(followertype?),followerID,0 -GARRISON_FOLLOWER_XP_CHANGED,4(followertype?)followerID,240,42,104,1 -GARRISON_MISSION_BONUS_ROLL_COMPLETE,missionID,true (standard loot) -GARRISON_MISSION_LIST_UPDATE,4(followwertype) -GARRISON_MISSION_BONUS_ROLL_LOOT,139611(itemid) (bonus loot) ---]] -function module:Events(on) - if (on) then - self:RegisterEvent("GARRISON_MISSION_BONUS_ROLL_LOOT","MissionAutoComplete") - self:RegisterEvent("GARRISON_MISSION_BONUS_ROLL_COMPLETE","MissionAutoComplete") - self:RegisterEvent("GARRISON_MISSION_COMPLETE_RESPONSE","MissionAutoComplete") - self:RegisterEvent("GARRISON_FOLLOWER_XP_CHANGED","MissionAutoComplete") - self:RegisterEvent("GARRISON_FOLLOWER_REMOVED","MissionAutoComplete") - self:RegisterEvent("GARRISON_FOLLOWER_DURABILITY_CHANGED","MissionAutoComplete") - else - self:UnregisterAllEvents() - end -end -function module:CloseReport() - addon:ResetParties() - addon:ScheduleTimer("HardRefreshMissions",0.1) - if report then pcall(report.Close,report) report=nil end - print(pcall(OHF.CloseMissionComplete(OHF))) -end -local function fillMyStatus(tab) - tab.level,tab.xp,tab.xpMax=UnitLevel("player") or 0,UnitXP('player') or 0,UnitXPMax('player') or 0 -end -local function printMyStatus(tab) - pp(tab.level,tab.xp,tab.xpMax) -end -function module:MissionComplete(this,button,skiprescheck) - missions=G.GetCompleteMissions(followerType) - fillMyStatus(mebefore) ---@debug@ - addon:PushEvent("Starting autocomplete") ---@end-debug@ - - if (missions and #missions > 0) then - this:SetEnabled(false) - OHFMissions.CompleteDialog.BorderFrame.ViewButton:SetEnabled(false) -- Disabling standard Blizzard Completion - for k,v in pairs(rewards) do - if type(v)=="table" then - wipe(rewards[k]) - end - end - local message=C("WARNING",'red') - local wasted={} - for i=1,#missions do - for _,v in pairs(missions[i].followers) do - rewards.followerQLevel[v]=addon:GetFollowerData(v,'qLevel',0) - rewards.followerPortrait[v]=addon:GetFollowerData(v,'portraitIconID') - rewards.followerName[v]=G.GetFollowerLink(v) - end - for k,v in pairs(missions[i].rewards) do - if v.itemID then GetItemInfo(v.itemID) end -- tickling server - if v.currencyID and tContains(cappedCurrencies,v.currencyID) then - wasted[v.currencyID]=(wasted[v.currencyID] or 0) + v.quantity - end - end - for k,v in pairs(missions[i].overmaxRewards) do - if v.itemID then GetItemInfo(v.itemID) end -- tickling server - if v.currencyID and tContains(cappedCurrencies,v.currencyID) then - wasted[v.currencyID]=(wasted[v.currencyID] or 0) + v.quantity - end - end - local m=missions[i] ---totalTimeString, totalTimeSeconds, isMissionTimeImproved, successChance, partyBuffs, isEnvMechanicCountered, xpBonus, materialMultiplier, goldMultiplier = C_Garrison.GetPartyMissionInfo(MISSION_PAGE_FRAME.missionInfo.missionID); - _,_,m.isMissionTimeImproved,m.successChance,_,_,m.xpBonus,m.resourceMultiplier,m.goldMultiplier=G.GetPartyMissionInfo(m.missionID) - addon:GetCacheModule():SetMissionStatus(m.missionID,'completed') - end - local stop - for id,qt in pairs(wasted) do - local name,current,_,_,_,cap=GetCurrencyInfo(id) - --@debug@ - print(name,current,qt,cap) - --@end-debug@ - current=current+qt - if current+qt > cap then - message=message.."\n"..format(L["Capped %1$s. Spend at least %2$d of them"],name,current+qt-cap) - stop =true - end - end - if stop and not skiprescheck then - self:Popup(message.."\n" ..format(L["If you %s, you will lose them\nClick on %s to abort"],ACCEPT,CANCEL),0, - function() - StaticPopup_Hide("LIBINIT_POPUP") - module:MissionComplete(this,button,true) - end, - function() - StaticPopup_Hide("LIBINIT_POPUP") - this:SetEnabled(true) - CompleteButton:SetEnabled(true) - OHF:Hide() - addon.quick=false - - end - ) - return - end - report=self:GenerateMissionCompleteList("Missions' results",OHF) - report:SetUserData('missions',missions) - report:SetUserData('current',1) - self:Events(true) - self:MissionAutoComplete("INIT") - this:SetEnabled(true) - end -end -function module:GetMission(missionID) - if not report then - return - end - local missions=report:GetUserData('missions') - if missions then - for i=1,#missions do - if missions[i].missionID==missionID then - return missions[i] - end - end - end -end ---[[ -GARRISON_MISSION_COMPLETE_RESPONSE,missionID,canComplete,success,bool(?),table(?) -GARRISON_FOLLOWER_DURABILITY_CHANGED,followerType,followerID,number(Durability left?) -GARRISON_FOLLOWER_XP_CHANGED,followerType,followerID,gainedxp,oldxp,oldlevel,oldquality (gained is 0 for maxed) -GARRISON_MISSION_BONUS_ROLL_COMPLETE,missionID,bool(Success?) -If succeeded then -GARRISON_MISSION_BONUS_ROLL_LOOT,itemId -GARRISON_MISSION_LIST_UPDATE,missionType -GARRISON_FOLLOWER_XP_CHANGED,followerType,followerID,gainedxp,oldxp,oldlevel,oldquality (gained is 0 for maxed) -If troops lost: -GARRISON_FOLLOWER_REMOVED,followerType -GARRISON_FOLLOWER_LIST_UPDATE,followerType ---]] -function module:MissionAutoComplete(event,...) --- C_Garrison.MarkMissionComplete Mark mission as complete and prepare it for bonus roll, da chiamare solo in caso di successo --- C_Garrison.MissionBonusRoll - if event=="LOOT" then - return self:MissionsPrintResults() - end - local current=report:GetUserData('current') - local currentMission=report:GetUserData('missions')[current] - local missionID=currentMission and currentMission.missionID or 0 ---@debug@ - print("evt",missionID,event,...) ---@end-debug@ - -- GARRISON_FOLLOWER_XP_CHANGED: followerType,followerID, xpGained, oldXp, oldLevel, oldQuality - if (event=="GARRISON_FOLLOWER_XP_CHANGED") then - local followerType,followerID, xpGained, oldXp, oldLevel, oldQuality=... - xpGained=addon:tonumber(xpGained,0) - if xpGained>0 then - rewards.followerXP[followerID]=rewards.followerXP[followerID]+xpGained - end - return - -- GARRISON_MISSION_BONUS_ROLL_LOOT: itemID - elseif (event=="GARRISON_MISSION_BONUS_ROLL_LOOT") then - local itemID=... - local key=format("%d:%s",missionID,itemID) - --if not rewards.items[key] then - --rewards.bonuses[key]=1 - --end - startTimer(0.1) - return - -- GARRISON_FOLLOWER_DURABILITY_CHANGED,followerType,followerID,number(Durability left?) - elseif event=="GARRISON_FOLLOWER_DURABILITY_CHANGED" then - local followerType,followerID,durabilityLeft=... - durabilityLeft=addon:tonumber(durabilityLeft) - if durabilityLeft<1 then - rewards.followerXP[followerID]=-1 - end - -- GARRISON_FOLLOWER_REMOVED - elseif (event=="GARRISON_FOLLOWER_REMOVED") then - -- gestire la distruzione di un follower... senza il follower - -- Should be managed on GARRISON_FOLLOWER_DURABILITY_CHANGED event - -- GARRISON_MISSION_COMPLETE_RESPONSE,missionID,canComplete,success,unknown_bool,unknown_table - elseif (event=="GARRISON_MISSION_COMPLETE_RESPONSE") then - local missionID,canComplete,success,overMaxSucceeded,follower_deaths=... - if currentMission.completed or select('#',...) == 1 then - canComplete=true - success=true - else - currentMission.overSuccess=overMaxSucceeded - end - if (not canComplete) then - -- We need to call server again - currentMission.state=0 - elseif (success) then -- success, we need to roll - currentMission.state=1 - else -- failure, just print results - currentMission.state=2 - end - startTimer(0.1) - return - -- GARRISON_MISSION_BONUS_ROLL_COMPLETE: missionID, requestCompleted; happens after calling C_Garrison.MissionBonusRoll - elseif (event=="GARRISON_MISSION_BONUS_ROLL_COMPLETE") then - currentMission.state=currentMission.overSuccess and 4 or 3 - startTimer(0.2) - return - else -- event == LOOP or INIT - if (currentMission) then - local step=currentMission.state or -1 - if (step<1) then - step=0 - currentMission.state=0 - currentMission.goldMultiplier=currentMission.goldMultiplier or 1 - currentMission.xp=select(2,G.GetMissionInfo(currentMission.missionID)) - report:AddMissionButton(currentMission,currentMission.followers,currentMission.successChance,"report") - end - if (step==0) then ---@debug@ - print("Fired MarkMissionCompleter",currentMission.missionID) - addon:PushEvent("MarkMissionComplete",currentMission.missionID) ---@end-debug@ - - G.MarkMissionComplete(currentMission.missionID) - startTimer(2) - elseif (step==1) then ---@debug@ - print("Fired MissionBonusRoll",currentMission.missionID) - addon:PushEvent("MissionBonusRoll",currentMission.missionID) ---@end-debug@ - - G.MissionBonusRoll(currentMission.missionID) - startTimer(2) - elseif (step>=2) then ---@debug@ - print("Advanced to next mission last:",currentMission.missionID,step) - addon:PushEvent("Next mission last:",currentMission.missionID) ---@end-debug@ - - self:GetMissionResults(step,currentMission) - --addon:RefreshFollowerStatus() - --shipyard:RefreshFollowerStatus() - local current=report:GetUserData('current') - report:SetUserData('current',current+1) - startTimer() - return - end - currentMission.state=step - else ---@debug@ - addon:PushEvent("Building final report") ---@end-debug@ - - report:AddButton(L["Building Final report"]) - startTimer(1,"LOOT") - end - end -end -function module:GetMissionResults(finalStatus,currentMission) - stopTimer() --- PlaySound("UI_Garrison_CommandTable_MissionSuccess_Stinger"); --- PlaySound("UI_Garrison_Mission_Complete_MissionFail_Stinger"); - if (finalStatus>=3) then - report:AddMissionResult(currentMission.missionID,finalStatus) - PlaySound("UI_Garrison_CommandTable_MissionSuccess_Stinger") - else - report:AddMissionResult(currentMission.missionID,false) - PlaySound("UI_Garrison_Mission_Complete_MissionFail_Stinger") - end - local resourceMultiplier=currentMission.resourceMultiplier or {} - local goldMultiplier=currentMission.goldMultiplier or 1 - if finalStatus>2 then - for k,v in pairs(currentMission.rewards) do - v.quantity=v.quantity or 0 - if v.currencyID then - rewards.currencies[v.currencyID].icon=v.icon - local multi=resourceMultiplier[v.currencyID] - if v.currencyID == 0 then - rewards.currencies[v.currencyID].qt=rewards.currencies[v.currencyID].qt+v.quantity * goldMultiplier - elseif resourceMultiplier[v.currencyID] then - rewards.currencies[v.currencyID].qt=rewards.currencies[v.currencyID].qt+v.quantity * multi - else - rewards.currencies[v.currencyID].qt=rewards.currencies[v.currencyID].qt+v.quantity - end - elseif v.itemID then - rewards.items[format("%d:%s",currentMission.missionID,v.itemID)]=1 - end - end - end - if finalStatus>3 then - for k,v in pairs(currentMission.overmaxRewards) do - v.quantity=v.quantity or 0 - if v.currencyID then - rewards.currencies[v.currencyID].icon=v.icon - local multi=resourceMultiplier[v.currencyID] - if v.currencyID == 0 then - rewards.currencies[v.currencyID].qt=rewards.currencies[v.currencyID].qt+v.quantity * goldMultiplier - elseif resourceMultiplier[v.currencyID] then - rewards.currencies[v.currencyID].qt=rewards.currencies[v.currencyID].qt+v.quantity * multi - else - rewards.currencies[v.currencyID].qt=rewards.currencies[v.currencyID].qt+v.quantity - end - elseif v.itemID then - rewards.bonuses[format("%d:%s",currentMission.missionID,v.itemID)]=1 - end - end - end -end -function module:MissionsPrintResults(success) - stopTimer() - local reported - local followers - --@debug@ - _G["testrewards"]=rewards - --@end-debug@ - for k,v in pairs(rewards.currencies) do - reported=true - if k == 0 then - -- Money reward - report:AddIconText(v.icon,GetMoneyString(v.qt)) - else - -- Other currency reward - report:AddIconText(v.icon,GetCurrencyLink(k),v.qt) - end - end - local items=new() - for k,v in pairs(rewards.items) do - local missionid,itemid=strsplit(":",k) - if (not items[itemid]) then - items[itemid]=1 - else - items[itemid]=items[itemid]+1 - end - end - for itemid,qt in pairs(items) do - reported=true - report:AddItem(itemid,qt) - end - wipe(items) - for k,v in pairs(rewards.bonuses) do - local missionid,itemid=strsplit(":",k) - if (not items[itemid]) then - items[itemid]=1 - else - items[itemid]=items[itemid]+1 - end - end - for itemid,qt in pairs(items) do - reported=true - report:AddItem(itemid,qt,true) - end - del(items) - for k,v in pairs(rewards.followerXP) do - reported=true - followers=true - if v~=0 then - if v>0 then - local b=addon:GetFollowerData(k,'qLevel',0) or 0 - local c=rewards.followerQLevel[k] or 0 - report:AddFollower(k,v, b>c,rewards.followerPortrait[k], rewards.followerName[k]) - else - report:AddFollower(k,v, false,rewards.followerPortrait[k], rewards.followerName[k]) - end - end - end - if not reported then - report:AddRow(L["Nothing to report"]) - end - if not followers then - report:AddRow(L["No follower gained xp"]) - end - if mebefore.level < 110 then - fillMyStatus(meafter) - --@debug@ - --printMyStatus(mebefore) - --printMyStatus(meafter) - --@end-debug@ - local xpgain=0 - if meafter.level>mebefore.level then - xpgain=mebefore.xpMax-mebefore.xp + meafter.xp - else - xpgain=meafter.xp-mebefore.xp - end - if xpgain > 0 then - report:AddPlayerXP(xpgain) - end - end - report:AddRow(DONE) - if addon.quick then - self:ScheduleTimer("CloseReport",0.1) - local qm=addon:GetModule("Quick",true) - addon.ScheduleTimer(qm,"RunQuick",0.2) - end -end -function addon:MissionComplete(...) - return module:MissionComplete(...) -end -function addon:CloseMissionComplete() - return module:CloseReport() -end \ No newline at end of file diff --git a/OrderHallCommander/autopilot.lua b/OrderHallCommander/autopilot.lua deleted file mode 100644 index e345ce6..0000000 --- a/OrderHallCommander/autopilot.lua +++ /dev/null @@ -1,57 +0,0 @@ -local __FILE__=tostring(debugstack(1,2,0):match("(.*):1:")) -- Always check line number in regexp and file, must be 1 -local function pp(...) print(GetTime(),"|cff009900",__FILE__:sub(-15),strjoin(",",tostringall(...)),"|r") end ---*TYPE module ---*CONFIG noswitch=false,profile=true,enhancedProfile=true ---*MIXINS "AceHook-3.0","AceEvent-3.0","AceTimer-3.0" ---*MINOR 35 --- Generated on 20/01/2017 08:15:04 -local me,ns=... -local addon=ns --#Addon (to keep eclipse happy) -ns=nil -local module=addon:NewSubModule('Autopilot',"AceHook-3.0","AceEvent-3.0","AceTimer-3.0") --#Module -function addon:GetAutopilotModule() return module end --- Template -local G=C_Garrison -local _ -local AceGUI=LibStub("AceGUI-3.0") -local C=addon:GetColorTable() -local L=addon:GetLocale() -local new=addon.NewTable -local del=addon.DelTable -local kpairs=addon:GetKpairs() -local empty=addon:GetEmpty() -local OHF=OrderHallMissionFrame -local OHFMissionTab=OrderHallMissionFrame.MissionTab --Container for mission list and single mission -local OHFMissions=OrderHallMissionFrame.MissionTab.MissionList -- same as OrderHallMissionFrameMissions Call Update on this to refresh Mission Listing -local OHFFollowerTab=OrderHallMissionFrame.FollowerTab -- Contains model view -local OHFFollowerList=OrderHallMissionFrame.FollowerList -- Contains follower list (visible in both follower and mission mode) -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 followerType=LE_FOLLOWER_TYPE_GARRISON_7_0 -local garrisonType=LE_GARRISON_TYPE_7_0 -local FAKE_FOLLOWERID="0x0000000000000000" -local MAXLEVEL=110 - -local ShowTT=OrderHallCommanderMixin.ShowTT -local HideTT=OrderHallCommanderMixin.HideTT - -local dprint=print -local ddump ---@debug@ -LoadAddOn("Blizzard_DebugTools") -ddump=DevTools_Dump -LoadAddOn("LibDebug") - -if LibDebug then LibDebug() dprint=print end -local safeG=addon.safeG - ---@end-debug@ ---[===[@non-debug@ -dprint=function() end -ddump=function() end -local print=function() end ---@end-non-debug@]===] - --- End Template - DO NOT MODIFY ANYTHING BEFORE THIS LINE ---*BEGIN \ No newline at end of file diff --git a/OrderHallCommander/cache.lua b/OrderHallCommander/cache.lua deleted file mode 100644 index 37e2cf7..0000000 --- a/OrderHallCommander/cache.lua +++ /dev/null @@ -1,624 +0,0 @@ -local __FILE__=tostring(debugstack(1,2,0):match("(.*):1:")) -- Always check line number in regexp and file, must be 1 -local function pp(...) print(GetTime(),"|cff009900",__FILE__:sub(-15),strjoin(",",tostringall(...)),"|r") end ---*TYPE module ---*CONFIG noswitch=false,profile=true,enhancedProfile=true ---*MIXINS "AceHook-3.0","AceEvent-3.0","AceTimer-3.0" ---*MINOR 35 --- Generated on 20/01/2017 08:15:04 -local me,ns=... -local addon=ns --#Addon (to keep eclipse happy) -ns=nil -local module=addon:NewSubModule('Cache',"AceHook-3.0","AceEvent-3.0","AceTimer-3.0") --#Module -function addon:GetCacheModule() return module end --- Template -local G=C_Garrison -local _ -local AceGUI=LibStub("AceGUI-3.0") -local C=addon:GetColorTable() -local L=addon:GetLocale() -local new=addon.NewTable -local del=addon.DelTable -local kpairs=addon:GetKpairs() -local empty=addon:GetEmpty() -local OHF=OrderHallMissionFrame -local OHFMissionTab=OrderHallMissionFrame.MissionTab --Container for mission list and single mission -local OHFMissions=OrderHallMissionFrame.MissionTab.MissionList -- same as OrderHallMissionFrameMissions Call Update on this to refresh Mission Listing -local OHFFollowerTab=OrderHallMissionFrame.FollowerTab -- Contains model view -local OHFFollowerList=OrderHallMissionFrame.FollowerList -- Contains follower list (visible in both follower and mission mode) -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 followerType=LE_FOLLOWER_TYPE_GARRISON_7_0 -local garrisonType=LE_GARRISON_TYPE_7_0 -local FAKE_FOLLOWERID="0x0000000000000000" -local MAXLEVEL=110 - -local ShowTT=OrderHallCommanderMixin.ShowTT -local HideTT=OrderHallCommanderMixin.HideTT - -local dprint=print -local ddump ---@debug@ -LoadAddOn("Blizzard_DebugTools") -ddump=DevTools_Dump -LoadAddOn("LibDebug") - -if LibDebug then LibDebug() dprint=print end -local safeG=addon.safeG - ---@end-debug@ ---[===[@non-debug@ -dprint=function() end -ddump=function() end -local print=function() end ---@end-non-debug@]===] - --- End Template - DO NOT MODIFY ANYTHING BEFORE THIS LINE ---*BEGIN -local GARRISON_LANDING_COMPLETED=GARRISON_LANDING_COMPLETED:match( "(.-)%s*$") -local CATEGORY_INFO_FORMAT=ORDER_HALL_COMMANDBAR_CATEGORY_COUNT .. ' (' .. GARRISON_LANDING_COMPLETED ..')' -local pairs,math,wipe,tinsert,GetTime,next,ipairs,type,OHCDebug= - pairs,math,wipe,tinsert,GetTime,next,ipairs,type,OHCDebug -local GARRISON_FOLLOWER_INACTIVE=GARRISON_FOLLOWER_INACTIVE -local missionsRefresh,followersRefresh=0,0 -local volatile={ -followers={ -xp=G.GetFollowerXP, -levelXP=G.GetFollowerLevelXP, -quality=G.GetFollowerQuality, -level=G.GetFollowerLevel, -isMaxLevel=function(followerID) return G.GetFollowerLevelXP(followerID)==0 end, -prettyName=G.GetFollowerLink, -iLevel=G.GetFollowerItemLevelAverage, -status=G.GetFollowerStatus, -busyUntil=function(followerID) return GetTime() + (G.GetFollowerMissionTimeLeftSeconds(followerID) or 0) end -}, -missions={ -} -}--- Caches --- -local currency -local currencyName -local currencyTexture -local resources=0 -local id2index={f={},m={}} -local avgLevel,avgIlevel=0,0 -local cachedFollowers={} -local cachedMissions={} -local categoryInfo -local shipmentInfo={} -local emptyTable={} -local permutations={ - {}, - {}, - {} -} -local methods={available='GetAvailableMissions',inProgress='GetInProgressMissions',completed='GetCompleteMissions'} -local catPool={} -local troopTypes={} -local function fillCachedMission(mission,time) - if not time then time=GetTime() end - local _,baseXP,_,_,_,_,exhausting,enemies=G.GetMissionInfo(mission.missionID) - mission.exhausting=exhausting - mission.baseXP=baseXP - mission.enemies=enemies - mission.lastUpdate=time - mission.available=not mission.inProgress - addon:Reward2Class(mission) -end -local function getCachedMissions() - if not next(cachedMissions) then ---@debug@ - OHCDebug:Bump("Missions") ---@end-debug@ - local time=GetTime() - for property,method in pairs(methods) do - local missions=G[method](followerType) - for _,mission in ipairs(missions) do - mission[property]=true - fillCachedMission(mission,time) - cachedMissions[mission.missionID]=mission - end - end - end - return cachedMissions -end -local function getCachedFollowers() - - if empty(cachedFollowers) then ---@debug@ - OHCDebug:Bump("Followers") ---@end-debug@ - local followers=G.GetFollowers(followerType) - if type(followers)=="table" then - local time=GetTime() - for _,follower in ipairs(followers) do - if follower.isCollected and follower.status ~= GARRISON_FOLLOWER_INACTIVE then - cachedFollowers[follower.followerID]=follower - cachedFollowers[follower.followerID].lastUpdate=time - cachedFollowers[follower.followerID].busyUntil=volatile.followers.busyUntil(follower.followerID) - end - end - end - end - return cachedFollowers -end -function module:GetAverageLevels(cached) - if avgLevel==0 or not cached then - local level,ilevel,tot=0,0,0 - local f=getCachedFollowers() - for i,d in pairs(f) do - if d.isCollected and not d.isTroop then - tot=tot+1 - level=level+self:GetKey(d,'level',0) - ilevel=ilevel+self:GetKey(d,'iLevel',0) - end - end - avgLevel,avgIlevel=math.floor(level/tot),math.floor(ilevel/tot) - end - return avgLevel,avgIlevel -end -function addon:GetPermutations() - local champs=new() - addon:GetAllChampions(champs) - local k=#champs - local refresh=false - for i=1,k do - if permutations[1][i]~=champs[i] then refresh=true end - end - if refresh then - wipe(permutations[1]) - wipe(permutations[2]) - wipe(permutations[3]) - for i=1,k do - tinsert(permutations[1],champs[i].followerID) - for j=i+1,k do - tinsert(permutations[2],strjoin(',',tostringall(champs[i].followerID,champs[j].followerID))) - for z=j+1,k do - tinsert(permutations[3],strjoin(',',tostringall(champs[i].followerID,champs[j].followerID,champs[z].followerID))) - end - end - end - end - del(champs) - return permutations -end -function module:DeleteFollower(followerID) - if followerID and cachedFollowers[followerID] then - del(cachedFollowers[followerID]) - end -end -function module:BuildFollower(followerID) - local f=getCachedFollowers() - if f[followerID] then - f[followerID].busyUntil=volatile.followers.busyUntil(followerID) - return - end - local rc,data=pcall(G.GetFollowerInfo,followerID) - if rc then - if data and data.isCollected then - data.lastUpdate=GetTime() - data.busyUntil=volatile.followers.busyUntil(data.followerID) - cachedFollowers[followerID]=data - elseif data then - del(data,true) - end - end -end -function module:BuildMission(missionIDfollowerID) - local rc,data=pcall(G.GetFollowerInfo,followerID) - if rc then - if data and data.isCollected then - data.lastUpdate=GetTime() - data.busyUntil=volatile.followers.busyUntil(data.followerID) - cachedFollowers[followerID]=data - elseif data then - del(data,true) - end - end -end -function module:refreshMission(data) - --local runtime,runtimesec,inProgress,duration,durationsec,bool1,string1=G.GetMissionTimes(data.missionID) -end -function module:refreshFollower(data) - if (data.lastUpdate or 0) < followersRefresh then - -- stale data, refresh volatile fields - local id=data.followerID - local rc,name=pcall(G.GetFollowerName,id) - if rc and name then - for field,func in pairs(volatile.followers) do - data[field]=func(id) - end - data.lastUpdate=followersRefresh - else - del(data,true) - data=nil - end - end -end ---@debug@ -function module:GetFollower(key) - if (key:sub(1,2)=='0x') then - key="0x" .. ("0000000000000000" ..key:sub(3)):sub(-16) - return self:GetFollowerData(key) - end - for _,data in pairs(getCachedFollowers()) do - if data.name:find(key)==1 then - return data - end - end -end ---@end-debug@ -function module:GetFollowerData(...) - local id,key,defaultvalue=... - local f=getCachedFollowers() - if not id then - for _,data in pairs(f) do - self:refreshFollower(data) - end - return f - end - local data=f[id] - if data then - self:refreshFollower(data) - end - if data then - if key then - return self:GetKey(data,key,defaultvalue) - else - return data - end - else - if select('#',...) > 2 then - return defaultvalue - else - return emptyTable - end - end -end -function module:SetMissionStatus(missionID,status) - local mission=getCachedMissions()[missionID] - if mission then - mission.inProgress=nil - mission.available=nil - mission.completed=nil - end - mission[status]=true -end -function module:GetMissionData(...) - local id,key,defaultvalue=... - local f=getCachedMissions() - if not id then - return f - end - local data=f[id] - if data and not data.numFollowers then - del(data) - data=nil - end - if not data then - local rc,data=pcall(G.GetBasicMissionInfo,id) - if rc and data then - self:refreshMission(data) - fillCachedMission(data,GetTime(time)) - f[id]=data - else - if select('#',...) > 2 then - return defaultvalue - else - return emptyTable - end - end - end - if data then - if key then - return self:GetKey(data,key,defaultvalue) - else - return data - end - end -end - - -function module:GetKey(data,key,defaultvalue) --- some keys need to be fresh only if champions is not maxed - - if volatile[key] and not data[key] then - data[key]=volatile[key](data.followerID) - end - if key=='status' and data.status=="refresh" then - data.status=G.GetFollowerStatus(data.followerID) - end - if data[key] then return data[key] end - -- pseudokeys - if key=="qLevel" then - return data.isMaxLevel and data.quality+data.level or data.level - end - assert("Invalid pseudo key " .. tostring(key)) - return defaultvalue -end -function module:Clear() - wipe(cachedFollowers) - wipe(cachedMissions) -end -local function alertSetup(frame,name,...) - GarrisonFollowerAlertFrame_SetUp(frame,FAKE_FOLLOWERID,...) - frame.Title:SetText(name) - return frame -end -function module:RefreshTroopTypes() - wipe(troopTypes) - local t=new() - for i,v in pairs(getCachedFollowers()) do - if v.isTroop then - t[v.classSpec]=true - end - end - for i,_ in pairs(t) do - tinsert(troopTypes,i) - end -end -local TroopsHeader -function module:GetTroopsFrame() - if not TroopsHeader then - local frame=CreateFrame("Frame",nil,OrderHallMissionFrame,"TooltipBorderedFrameTemplate") - frame.Background:Hide() - frame.Top=frame:CreateTexture(nil,"BACKGROUND",nil,-1) - frame.Top:SetPoint("TOPLEFT") - frame.Top:SetPoint("BOTTOMRIGHT") - frame.Top:SetAtlas("_StoneFrameTile-Top") - frame:SetHeight(35) - frame:ClearAllPoints() - frame:SetPoint("BOTTOMLEFT",OrderHallMissionFrame,"TOPLEFT",0,-2) - frame:SetPoint("BOTTOMRIGHT",OrderHallMissionFrame,"TOPRIGHT",2,-2) - frame:SetFrameLevel(OrderHallMissionFrame:GetFrameLevel()-1) - frame:Show() - TroopsHeader=frame - end - return TroopsHeader -end - -function module:ParseFollowers() - self:RefreshTroopTypes() - categoryInfo = G.GetClassSpecCategoryInfo(followerType) - if empty(categoryInfo) then - G.RequestClassSpecCategoryInfo(followerType) - self:ScheduleTimer("ParseFollowers",1) - return - end - G.RequestLandingPageShipmentInfo(); - if not OHF:IsVisible() then return end - local main=self:GetTroopsFrame() - local numCategories = #categoryInfo; - local prevCategory, firstCategory; - local xSpacing = 20; -- space between categories - for i, category in ipairs(categoryInfo) do - local index=category.classSpec - if not catPool[index] then - catPool[index]=CreateFrame("Frame","FollowerIcon",main,"OrderHallClassSpecCategoryTemplate") - end - local categoryInfoFrame = catPool[index]; - if not shipmentInfo[category.icon] then - shipmentInfo[category.icon]={0,0} - end - categoryInfoFrame.Icon:SetTexture(category.icon); - categoryInfoFrame.Icon:SetTexCoord(0, 1, 0.25, 0.75) - categoryInfoFrame.TroopPortraitCover:Hide() - categoryInfoFrame.Icon:SetHeight(15) - categoryInfoFrame.Icon:SetWidth(35) - categoryInfoFrame.name = category.name; - categoryInfoFrame.description = category.description; - categoryInfoFrame.Count:SetFormattedText( - CATEGORY_INFO_FORMAT, - category.count, category.limit,unpack(shipmentInfo[category.icon])); - categoryInfoFrame.Count:SetWidth(categoryInfoFrame.Count:GetStringWidth()+10) - categoryInfoFrame:ClearAllPoints(); - local w=35 + categoryInfoFrame.Count:GetWidth() - categoryInfoFrame:SetWidth(w) - categoryInfoFrame:SetPoint("TOPLEFT",60 +(w+10) *(i-1), 0); - categoryInfoFrame:Show(); - end -end -function addon:ParseFollowers() - return module:ParseFollowers() -end -local OrderHallCommanderAlertSystem=AlertFrame:AddSimpleAlertFrameSubSystem("OHCAlertFrameTemplate", alertSetup) -local shownAlerts={} -function module:GARRISON_LANDINGPAGE_SHIPMENTS(...) - if not addon:GetBoolean('TROOPALERT') then return end - if (not G.IsPlayerInGarrison(garrisonType)) then return end - local followerShipments = C_Garrison.GetFollowerShipments(garrisonType); - for _,t in pairs(shipmentInfo) do - t[1]=0 - t[2]=0 - end - for i = 1, #followerShipments do - local name, texture, shipmentCapacity, shipmentsReady, shipmentsTotal, creationTime, duration, timeleftString, _, _, _, _, followerID = C_Garrison.GetLandingPageShipmentInfoByContainerID(followerShipments[i]); - if name and shipmentCapacity > 0 then - shipmentInfo[texture]=shipmentInfo[texture] or {} - shipmentInfo[texture][1]=shipmentsReady - shipmentInfo[texture][2]=shipmentsTotal - local signature=strjoin(':',name,shipmentsReady) - if not shownAlerts[signature] then shownAlerts[signature]=GetTime()+15 end - if shipmentsReady > 0 then - if GetTime()>shownAlerts[signature] then - shownAlerts[signature]=GetTime()+60 - OrderHallCommanderAlertSystem:AddAlert(name, GARRISON_LANDING_COMPLETED:format(shipmentsReady,shipmentsTotal), 110, 0, false, - {isTroop=true,followerTypeID=4,portraitIconID=texture,quality=1} - ) - end - end - end - end - -end - -function module:Refresh(event,...) ---@debug@ - OHCDebug.CacheRefresh:SetText(event:sub(10)) ---@end-debug@ - addon:RefreshFollowerStatus() - if (event == "CURRENCY_DISPLAY_UPDATE") then - resources = select(2,GetCurrencyInfo(currency)) - return - end - if event=="GARRISON_FOLLOWER_REMOVED" then - local currentType=... -- alas, we dont have followerId here - if currentType==followerType then - followersRefresh=GetTime() - return self:ParseFollowers() - end - elseif event=="GARRISON_FOLLOWER_CATEGORIES_UPDATED" then - return self:ParseFollowers() - elseif event=="GARRISON_FOLLOWER_ADDED" then - local followerID, name, class, level, quality, isUpgraded, texPrefix, currentType = ... - if currentType==followerType then - self:BuildFollower(followerID) -- kicks rebuild - return self:ParseFollowers() - end - elseif event=="GARRISON_FOLLOWER_XP_CHANGED" then - local currentType,followerID,xp=... - if currentType==followerType and xp > 0 then - local data=cachedFollowers[followerID] - if data then - data.lastUpdate=0 - self:refreshFollower(data) ---@debug@ - addon:PushEvent("CURRENT_FOLLOWER_XP",4,followerID,0,data.xp,data.level,data.quality) ---@end-debug@ - - end - end - elseif event=="GARRISON_FOLLOWER_UPGRADED"then - local followerID=... - local follower=cachedFollowers[followerID] - if follower and follower.followerTypeID==followerType then - self:refreshFollower(follower) - end - elseif event=="GARRISON_FOLLOWER_DURABILITY_CHANGED" then - local currentType,followerID,durability=... - if currentType==followerType then - if durability==0 then - self:DeleteFollower(followerID) - else - local follower=cachedFollowers[followerID] - if follower then - follower.durability=durability - follower.lastUpdate=GetTime() - else - self:BuildFollower(followerID) -- kicks rebuild - end - end - end - elseif event=="GARRISON_FOLLOWER_LIST_UPDATE" or event=="GARRISON_MISSION_STARTED" or event=="GARRISON_MISSION_FINISHED" or event=="GARRISON_MISSION_LIST_UPDATE" then - local currentType=... - if currentType==followerType then - followersRefresh=GetTime() - end - elseif event=="GARRISON_MISSION_COMPLETE_RESPONSE" then - -- alas, no followerType here - followersRefresh=GetTime() - end -end -function module:OnInitialized() - self:RegisterEvent("CURRENCY_DISPLAY_UPDATE","Refresh") - self:RegisterEvent("GARRISON_FOLLOWER_REMOVED","Refresh") - self:RegisterEvent("GARRISON_FOLLOWER_LIST_UPDATE","Refresh") - self:RegisterEvent("GARRISON_FOLLOWER_ADDED","Refresh") - self:RegisterEvent("GARRISON_FOLLOWER_LIST_UPDATE","Refresh") - self:RegisterEvent("GARRISON_FOLLOWER_CATEGORIES_UPDATED","Refresh") - self:RegisterEvent("GARRISON_FOLLOWER_XP_CHANGED","Refresh") - self:RegisterEvent("GARRISON_FOLLOWER_DURABILITY_CHANGED","Refresh") - self:RegisterEvent("GARRISON_MISSION_STARTED","Refresh") - self:RegisterEvent("GARRISON_MISSION_FINISHED","Refresh") - self:RegisterEvent("GARRISON_MISSION_COMPLETE_RESPONSE","Refresh") - self:RegisterEvent("GARRISON_MISSION_LIST_UPDATE","Refresh") - self:RegisterEvent("GARRISON_LANDINGPAGE_SHIPMENTS") - currency, _ = C_Garrison.GetCurrencyTypes(garrisonType); - currencyName, resources, currencyTexture = GetCurrencyInfo(currency); - addon.resourceFormat=COSTS_LABEL .." %d " .. currencyName - self:ParseFollowers() - -end ----- Public Interface --- -function addon:GetResources() - return resources,currencyName -end -function addon:GetMissionData(...) - return module:GetMissionData(...) -end -function addon:GetFollowerData(...) - return module:GetFollowerData(...) -end -function addon:GetFollower(...) - return module:GetFollower(...) -end -function addon:GetFollowerCounts() - local t,c=0,0 - for _,follower in pairs(getCachedFollowers()) do - if follower.isTroop then - t=t+1 - else - c=c+1 - end - end - return c,t -end -function addon:GetAllChampions(table) - for _,follower in pairs(getCachedFollowers()) do - if not follower.isTroop then - tinsert(table,follower) - end - end - return table -end -function addon:GetAllTroops(table) - for _,follower in pairs(getCachedFollowers()) do - if follower.isTroop then - tinsert(table,follower) - end - end - return table -end -local function isInParty(followerID) - return G.GetFollowerStatus(followerID)==GARRISON_FOLLOWER_IN_PARTY -end -local troops={} -function addon:GetTroop(troopType,qt,skipBusy) - if type(qt)=="boolean" then skipBusy=qt qt=1 end - qt=self:tonumber(qt,1) - local found=0 - wipe(troops) - for _,follower in pairs(getCachedFollowers()) do - if follower.isTroop and follower.classSpec==troopType and (not skipBusy or not follower.status) then - tinsert(troops,follower) - found=found+1 - if found>=qt then - break - end - end - end - return unpack(troops) -end -function addon:GetTroopTypes() - return troopTypes -end - -function addon:RebuildMissionCache() - wipe(cachedMissions) - getCachedMissions() -end -function addon:RebuildFollowerCache() - wipe(cachedFollowers) - getCachedFollowers() - module:RefreshTroopTypes() -end -function addon:RebuildAllCaches() - self:RebuildFollowerCache() - self:RebuildMissionCache() -end - -function addon:GetAverageLevels(...) - return module:GetAverageLevels(...) -end \ No newline at end of file diff --git a/OrderHallCommander/core.lua b/OrderHallCommander/core.lua deleted file mode 100644 index 22f7b21..0000000 --- a/OrderHallCommander/core.lua +++ /dev/null @@ -1,310 +0,0 @@ -local __FILE__=tostring(debugstack(1,2,0):match("(.*):1:")) -- Always check line number in regexp and file, must be 1 -local function pp(...) print(GetTime(),"|cff009900",__FILE__:sub(-15),strjoin(",",tostringall(...)),"|r") end ---*TYPE module ---*CONFIG noswitch=false,profile=true,enhancedProfile=true ---*MIXINS "AceHook-3.0","AceEvent-3.0","AceTimer-3.0" ---*MINOR 35 --- Generated on 20/01/2017 08:15:04 -local me,ns=... -local addon=ns --#Addon (to keep eclipse happy) -ns=nil -local module=addon:NewSubModule('Core',"AceHook-3.0","AceEvent-3.0","AceTimer-3.0") --#Module -function addon:GetCoreModule() return module end --- Template -local G=C_Garrison -local _ -local AceGUI=LibStub("AceGUI-3.0") -local C=addon:GetColorTable() -local L=addon:GetLocale() -local new=addon.NewTable -local del=addon.DelTable -local kpairs=addon:GetKpairs() -local empty=addon:GetEmpty() -local OHF=OrderHallMissionFrame -local OHFMissionTab=OrderHallMissionFrame.MissionTab --Container for mission list and single mission -local OHFMissions=OrderHallMissionFrame.MissionTab.MissionList -- same as OrderHallMissionFrameMissions Call Update on this to refresh Mission Listing -local OHFFollowerTab=OrderHallMissionFrame.FollowerTab -- Contains model view -local OHFFollowerList=OrderHallMissionFrame.FollowerList -- Contains follower list (visible in both follower and mission mode) -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 followerType=LE_FOLLOWER_TYPE_GARRISON_7_0 -local garrisonType=LE_GARRISON_TYPE_7_0 -local FAKE_FOLLOWERID="0x0000000000000000" -local MAXLEVEL=110 - -local ShowTT=OrderHallCommanderMixin.ShowTT -local HideTT=OrderHallCommanderMixin.HideTT - -local dprint=print -local ddump ---@debug@ -LoadAddOn("Blizzard_DebugTools") -ddump=DevTools_Dump -LoadAddOn("LibDebug") - -if LibDebug then LibDebug() dprint=print end -local safeG=addon.safeG - ---@end-debug@ ---[===[@non-debug@ -dprint=function() end -ddump=function() end -local print=function() end ---@end-non-debug@]===] - --- End Template - DO NOT MODIFY ANYTHING BEFORE THIS LINE ---*BEGIN ---local missionPanelMissionList=OrderHallMissionFrameMissions ---[[ -Su OrderHallMissionFrameMissions viene chiamato Update() per aggiornare le missioni -.listScroll = padre della scrolllist delle missioni -<code> - local scrollFrame = self.listScroll; - local offset = HybridScrollFrame_GetOffset(scrollFrame); -</code> ---]] ---[[ -OHC- OrderHallMissionFrame.FollowerTab.DurabilityFrame : OnShow : table: 0000000033557BD0 -OHC- OrderHallMissionFrame.FollowerTab.QualityFrame : OnShow : table: 0000000033557C20 -OHC- OrderHallMissionFrame.FollowerTab.PortraitFrame : OnShow : table: 0000000033557D60 -OHC- OrderHallMissionFrame.FollowerTab.ModelCluster : OnShow : table: 0000000033557F40 -OHC- OrderHallMissionFrame.FollowerTab.XPBar : OnShow : table: 00000000335585D0 ---]] --- Upvalued functions ---local I=LibStub("LibItemUpgradeInfo-1.0",true) -local GetItemInfo=GetItemInfo ---if I then GetItemInfo=I:GetCachingGetItemInfo() end -local select,CreateFrame,pairs,type,tonumber,math=select,CreateFrame,pairs,type,tonumber,math -local QuestDifficultyColors,GameTooltip=QuestDifficultyColors,GameTooltip -local tinsert,tremove,tContains=tinsert,tremove,tContains -local format=format -local resolve=addon.resolve -local colors=addon.colors -local menu -local menuType="OHCMenu" -local menuOptions={mission={},follower={}} -function addon:ApplyMOVEPANEL(value) - OHF:EnableMouse(value) - OHF:SetMovable(value) -end -function addon:OnInitialized() - _G.dbOHCperChar=_G.dbOHCperChar or {} - menu=CreateFrame("Frame") ---@debug@ - local f=menu - f:RegisterAllEvents() - self:RawHookScript(f,"OnEvent","ShowGarrisonEvents") ---@end-debug@ - self:AddLabel(L["General"]) - self:AddBoolean("MOVEPANEL",true,L["Make Order Hall Mission Panel movable"],L["Position is not saved on logout"]) - self:AddBoolean("TROOPALERT",true,L["Troop ready alert"],L["Notifies you when you have troops ready to be collected"]) - OHF:RegisterForDrag("LeftButton") - OHF:SetScript("OnDragStart",function(frame) if self:GetBoolean('MOVEPANEL') then frame:StartMoving() end end) - OHF:SetScript("OnDragStop",function(frame) frame:StopMovingOrSizing() end) - self:ApplyMOVEPANEL(self:GetBoolean('MOVEPANEL')) -end -function addon:ClearMenu() - if menu.widget then - pcall(AceGUI.Release,AceGUI,menu.widget) - menu.widget=nil - end - menu:Hide() -end -function addon:RegisterForMenu(menu,...) - for i=1,select('#',...) do - local value=(select(i,...)) - if not tContains(menuOptions[menu],value) then - tinsert(menuOptions[menu],value) - end - end -end -function addon:GetRegisteredForMenu(menu) - return menuOptions[menu] -end -do - -end --- my implementation of tonumber which accounts for nan and inf -function addon:tonumber(value,default) - if value~=value then return default - elseif value==math.huge then return default - else return tonumber(value) or default - end -end --- my implementation of type which accounts for nan and inf -function addon:type(value) - if value~=value then return nil - elseif value==math.huge then return nil - else return type(value) - end -end - -function addon:ActivateButton(button,OnClick,Tooltiptext,persistent) - button:SetScript("OnClick",function(...) self[OnClick](self,...) end ) - if (Tooltiptext) then - button.tooltip=Tooltiptext - button:SetScript("OnEnter",ShowTT) - button:SetScript("OnLeave",HideTT) - else - button:SetScript("OnEnter",nil) - button:SetScript("OnLeave",nil) - end -end ---- Helpers --- -function addon:SetBackdrop(frame,r,g,b,a) - r=r or 1 - g=g or 0 - b=b or 0 - a=a or 1 - frame:SetBackdrop({ - bgFile = "Interface/Tooltips/UI-Tooltip-Background", - xedgeFile = "Interface/Tooltips/UI-Tooltip-Border", - tile = true, tileSize = 16, edgeSize = 16, - insets = { left = 4, right = 4, top = 4, bottom = 4} - } - ) - frame:SetBackdropColor(r,g,b,a) -end -function addon:GetDifficultyColors(...) - local q=self:GetDifficultyColor(...) - return q.r,q.g,q.b -end -function addon:GetDifficultyColor(perc,usePurple) - if perc>=100 then - return C.Green - elseif(perc >90) then - return QuestDifficultyColors['standard'] - elseif (perc >74) then - return QuestDifficultyColors['difficult'] - elseif(perc>49) then - return QuestDifficultyColors['verydifficult'] - elseif(perc >20) then - return QuestDifficultyColors['impossible'] - else - return not usePurple and C.Silver or C.Fuchsia - end -end -function addon:GetAgeColor(age) - age=tonumber(age) or 0 - if age>GetTime() then age=age-GetTime() end - if age < 0 then age=0 end - local hours=floor(age/3600) - local q=self:GetDifficultyColor(hours+20,true) - return q.r,q.g,q.b -end -local function tContains(table, item) - local index = 1; - while table[index] do - if ( item == table[index] ) then - return index; - end - index = index + 1; - end - return nil; -end -local emptyTable={} -local function Reward2Class(self,mission) - local overReward=mission.overmaxRewards - if not overReward then overReward=mission.OverRewards end - local reward=mission.rewards - if not reward then reward=mission.Rewards end - if not overReward or not reward then - return "Generic",0 - end - overReward=overReward[1] - reward=reward[1] - if not reward then return "Generic",0 end - if not overReward then overReward = emptyTable end - if reward.currencyID then - local name=GetCurrencyInfo(reward.currencyID) - if name=="" then name = MONEY end - return name,reward.quantity/10000 - elseif reward.followerXP then - return "FollowerXp",reward.followerXP - elseif type(reward.itemID) == "number" then - if tContains(self:GetData('ArtifactPower'),reward.itemID) then - return "Artifact",0 - elseif overReward.itemID==1447868 then - return "PlayerXP",0 - elseif overReward.itemID==141344 then - return "Reputation",0 - elseif tContains(self:GetData('Equipment'),reward.itemID) then - return "Equipment",0 - elseif tContains(self:GetData("Upgrades"),reward.itemID) then - return "Upgrades",0 - else - local class,subclass=select(12,GetItemInfo(reward.itemID)) - class=class or -1 - if class==12 then - return "Quest",0 - elseif class==7 then - return "Reagent",reward.quantity or 1 - end - end - end - return "Generic",reward.quantity or 1 -end -local classSort={ - [MONEY]=11, - Artifact=12, - Equipment=13, - Quest=14, - Upgrades=15, - Reputation=16, - PlayerXP=17, - FollowerXP=18, - Generic=19 -} -function addon:Reward2Class(mission) - if not mission.missionClass then - mission.missionClass,mission.missionValue=Reward2Class(self,mission) - mission.missionSort=classSort[mission.missionClass] - end - return mission.missionSort -end ---@debug@ -local events={} -function addon:Trace(frame, method) - if true then return end - method=method or "OnShow" - if type(frame)=="string" then frame=_G[frame] end - if not frame then return end - if not self:IsHooked(frame,method) and frame:GetObjectType()~="GameTooltip" then - self:HookScript(frame,method,function(...) - local name=resolve(frame) - tinsert(dbOHCperChar,resolve(frame:GetParent())..'/'..name) - print(("OHC [%s] %s:%s %s %d"):format(frame:GetObjectType(),name,method,frame:GetFrameStrata(),frame:GetFrameLevel())) - end - ) - end -end -local lastevent="" -function addon:ShowGarrisonEvents(this,event,...) - if event:find("GARRISON") then - if event=="GARRISON_MISSION_LIST_UPDATE" and event==lastevent then - return - end - if event=="GARRISON_MISSION_COMPLETE_RESPONSE" then - local _,_,_,followers=... - if type(followers)=="table" then - tinsert(dbOHCperChar,followers) - end - end - lastevent=event - tinsert(events,{event,...}) - return self:PushEvent(event,...) - end -end -function addon:PushEvent(event,...) - if not AlarLog then AlarLog={} end - if not AlarLog[me] then AlarLog[me]={} end - tinsert(AlarLog[me],event.. " : '" .. strjoin(tostringall("' '",...)) .. "'") -end -function addon:DumpEvents() - return events -end -addon:PushEvent("ADDON_LOADED") -_G.OHC=addon ---@end-debug@ diff --git a/OrderHallCommander/data.lua b/OrderHallCommander/data.lua deleted file mode 100644 index b64ba5b..0000000 --- a/OrderHallCommander/data.lua +++ /dev/null @@ -1,451 +0,0 @@ -local __FILE__=tostring(debugstack(1,2,0):match("(.*):1:")) -- Always check line number in regexp and file, must be 1 -local function pp(...) print(GetTime(),"|cff009900",__FILE__:sub(-15),strjoin(",",tostringall(...)),"|r") end ---*TYPE module ---*CONFIG profile=true,enhancedProfile=true --- Generated on 20/01/2017 08:15:04 -local me,ns=... -local addon=ns --#Addon (to keep eclipse happy) -ns=nil -local module=addon:NewSubModule('Data') --#Module -function addon:GetDataModule() return module end --- Template -local G=C_Garrison -local _ -local AceGUI=LibStub("AceGUI-3.0") -local C=addon:GetColorTable() -local L=addon:GetLocale() -local new=addon.NewTable -local del=addon.DelTable -local kpairs=addon:GetKpairs() -local empty=addon:GetEmpty() -local OHF=OrderHallMissionFrame -local OHFMissionTab=OrderHallMissionFrame.MissionTab --Container for mission list and single mission -local OHFMissions=OrderHallMissionFrame.MissionTab.MissionList -- same as OrderHallMissionFrameMissions Call Update on this to refresh Mission Listing -local OHFFollowerTab=OrderHallMissionFrame.FollowerTab -- Contains model view -local OHFFollowerList=OrderHallMissionFrame.FollowerList -- Contains follower list (visible in both follower and mission mode) -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 followerType=LE_FOLLOWER_TYPE_GARRISON_7_0 -local garrisonType=LE_GARRISON_TYPE_7_0 -local FAKE_FOLLOWERID="0x0000000000000000" -local MAXLEVEL=110 - -local ShowTT=OrderHallCommanderMixin.ShowTT -local HideTT=OrderHallCommanderMixin.HideTT - -local dprint=print -local ddump ---@debug@ -LoadAddOn("Blizzard_DebugTools") -ddump=DevTools_Dump -LoadAddOn("LibDebug") - -if LibDebug then LibDebug() dprint=print end -local safeG=addon.safeG - ---@end-debug@ ---[===[@non-debug@ -dprint=function() end -ddump=function() end -local print=function() end ---@end-non-debug@]===] - --- End Template - DO NOT MODIFY ANYTHING BEFORE THIS LINE ---*BEGIN -local fake={} -local data={ - Upgrades={ - 136412, - 137207, - 137208, - - }, - Xp={ - 141028 - }, - Equipment={ - 'Success Chance Increase', - 139816, - 139801, - 139802, - 140572, - 140571, - 140573, - 140581, - 140582, - 140583, - 'Mission Time Reduction', - 139813, - 139814, - 139799, - 'Combat Ally Bonus', - 139792, - 139808, - 139809, - 139795, - 139811, - 139812, - 'Troop Affinity', - 139875, - 139876, - 139877, - 139878, - 139835, - 139836, - 139837, - 139838, - 139863, - 139864, - 139865, - 139866, - 139847, - 139848, - 139849, - 139850, - 139843, - 139844, - 139845, - 139846, - 139859, - 139860, - 139861, - 139862, - 139867, - 139868, - 139869, - 139870, - 139871, - 139872, - 139873, - 139874, - 139831, - 139832, - 139833, - 139834, - 139839, - 139840, - 139841, - 139842, - 139855, - 139856, - 139857, - 139858, - 139851, - 139852, - 139853, - 139854, - 'Legendary Equipment', - 139830, - 139828, - 139829, - 139827, - 139825, - 139826, - 139821, - 139804, - 139819, - 139824, - 139823, - 139822, - 'Consumables', - 140749, - 139419, - 140760, - 139428, - 139177, - 139420, - 138883, - 139376, - 138418, - 138412, - 139670 - }, - ArtifactPower={130152,131751,131753,131763,131795,131802,131808,132897,132950,136356,136655,136656,136657,136658,136659,136660,136661,136662,136663,136664,138480,138487,138732,138781,138782,138783,138785,138786,138812,138813,138814,138816,138839,138864,138865,138880,138881,138885,138886,139390,139506,139507,139508,139509,139510,139511,139512,139591,139608,139609,139610,139611,139612,139613,139614,139615,139616,139617,140176,140237,140238,140241,140244,140247,140250,140251,140252,140254,140255,140304,140305,140306,140307,140310,140322,140349,140357,140358,140359,140361,140364,140365,140366,140367,140368,140369,140370,140371,140372,140373,140374,140377,140379,140380,140381,140382,140383,140384,140385,140386,140387,140388,140389,140391,140392,140393,140396,140409,140410,140421,140422,140444,140445,140459,140460,140461,140462,140463,140466,140467,140468,140469,140470,140471,140473,140474,140475,140476,140477,140478,140479,140480,140481,140482,140484,140485,140486,140487,140488,140489,140490,140491,140492,140494,140497,140498,140503,140504,140505,140507,140508,140509,140510,140511,140512,140513,140515,140516,140517,140518,140519,140520,140521,140522,140523,140524,140525,140528,140529,140530,140531,140532,140685,140847,141023,141024,141310,141313,141314,141335,141383,141384,141385,141386,141387,141388,141389,141390,141391,141392,141393,141394,141395,141396,141397,141398,141399,141400,141401,141402,141403,141404,141405,141638,141639,141667,141668,141669,141670,141671,141672,141673,141674,141675,141676,141677,141678,141679,141680,141681,141682,141683,141684,141685,141689,141690,141699,141701,141702,141703,141704,141705,141706,141707,141708,141709,141710,141711,141852,141853,141854,141855,141856,141857,141858,141859,141863,141872,141876,141877,141883,141886,141887,141888,141889,141890,141891,141892,141896,141921,141922,141923,141924,141925,141926,141927,141928,141929,141930,141931,141932,141933,141934,141935,141936,141937,141940,141941,141942,141943,141944,141945,141946,141947,141948,141949,141950,141951,141952,141953,141954,141955,141956,142001,142002,142003,142004,142005,142006,142007,142054,142449,142450,142451,142454,142455,142533,142534,142535,142555,143333,143486,143487,143488,143498,143499,143533,143536,143538,143540,143677,143680,143713,143714,143715,143716,143738,143739,143740,143741,143742,143743,143744,143745,143746,143747,143749,143757,143844,143868,143869,143870,143871} -} -function addon:GetData(key) - key=key or "none" - return data[key] or fake -end -function module:OnInitialized() - -- - addon.coroutineExecute(module,0,"TickleServer") -end -function module:AddItem(itemID) - -end -function module:TickleServer() - addon:Print("Precaching items") - local i=0 - for _,categories in pairs(data) do - for _,itemid in pairs(categories) do - if type(itemid)=="number" then - pcall(GetItemInfo,itemid) - i=i+1 - coroutine.yield() - end - end - end - addon:Print("Precached ",i," items") -end ---@do-not-package@ ---[[ - -dbOHCperChar = { - "GameTooltip/GarrisonMissionListTooltipThreatsFrame", -- [299] - "GameTooltip/GarrisonMissionListTooltipThreatsFrame", -- [301] - "GameTooltip/GarrisonMissionListTooltipThreatsFrame", -- [303] - "GameTooltip/GarrisonMissionListTooltipThreatsFrame", -- [367] - "GameTooltip/GarrisonMissionListTooltipThreatsFrame", -- [369] - "GameTooltip/GarrisonMissionListTooltipThreatsFrame", -- [371] - "GarrisonFollowerTooltip/GarrisonFollowerTooltip.PortraitFrame", -- [421] - "GarrisonFollowerTooltip/GarrisonFollowerTooltip.PortraitFrame", -- [425] - "GarrisonFollowerTooltip/UNK_0", -- [422] - "GarrisonFollowerTooltip/UNK_0", -- [426] - "GarrisonFollowerTooltip/UNK_0", -- [427] - "GarrisonMissionListTooltipThreatsFrame/UNK_0", -- [298] - "GarrisonMissionListTooltipThreatsFrame/UNK_0", -- [300] - "GarrisonMissionListTooltipThreatsFrame/UNK_0", -- [302] - "GarrisonMissionListTooltipThreatsFrame/UNK_0", -- [366] - "GarrisonMissionListTooltipThreatsFrame/UNK_0", -- [368] - "GarrisonMissionListTooltipThreatsFrame/UNK_0", -- [370] - "OrderHallCommandBar/OrderHallCommandBar.CurrencyHitTest", -- [173] - "OrderHallCommandBar/OrderHallCommandBar.CurrencyHitTest", -- [1] - "OrderHallCommandBar/OrderHallCommandBar.CurrencyHitTest", -- [87] - "OrderHallCommandBar/OrderHallCommandBar.WorldMapButton", -- [13] - "OrderHallCommandBar/OrderHallCommandBar.WorldMapButton", -- [174] - "OrderHallCommandBar/OrderHallCommandBar.WorldMapButton", -- [88] - "OrderHallFollowerOptionDropDown/OrderHallFollowerOptionDropDownButton", -- [324] - "OrderHallFollowerOptionDropDown/OrderHallFollowerOptionDropDownButton", -- [411] - "OrderHallMissionFrame.FollowerTab.AbilitiesFrame/OrderHallMissionFrame.FollowerTab.AbilitiesFrame.CombatAllySpell1", -- [311] - "OrderHallMissionFrame.FollowerTab.AbilitiesFrame/OrderHallMissionFrame.FollowerTab.AbilitiesFrame.CombatAllySpell2", -- [312] - "OrderHallMissionFrame.FollowerTab.ModelCluster.Child/OrderHallMissionFrame.FollowerTab.ModelCluster.Child.Model1", -- [327] - "OrderHallMissionFrame.FollowerTab.ModelCluster.Child/OrderHallMissionFrame.FollowerTab.ModelCluster.Child.Shadows", -- [307] - "OrderHallMissionFrame.FollowerTab.ModelCluster/OrderHallMissionFrame.FollowerTab.ModelCluster.Child", -- [308] - "OrderHallMissionFrame.FollowerTab/OrderHallMissionFrame.FollowerTab.AbilitiesFrame", -- [313] - "OrderHallMissionFrame.FollowerTab/OrderHallMissionFrame.FollowerTab.DurabilityFrame", -- [304] - "OrderHallMissionFrame.FollowerTab/OrderHallMissionFrame.FollowerTab.ItemAverageLevel", -- [315] - "OrderHallMissionFrame.FollowerTab/OrderHallMissionFrame.FollowerTab.ModelCluster", -- [309] - "OrderHallMissionFrame.FollowerTab/OrderHallMissionFrame.FollowerTab.PortraitFrame", -- [306] - "OrderHallMissionFrame.FollowerTab/OrderHallMissionFrame.FollowerTab.QualityFrame", -- [305] - "OrderHallMissionFrame.FollowerTab/OrderHallMissionFrame.FollowerTab.Source", -- [314] - "OrderHallMissionFrame.FollowerTab/OrderHallMissionFrame.FollowerTab.XPBar", -- [310] - "OrderHallMissionFrame.MissionTab.MissionPage.BuffsFrame/UNK_0", -- [418] - "OrderHallMissionFrame.MissionTab.MissionPage.Enemy1/OrderHallMissionFrame.MissionTab.MissionPage.Enemy1.MechanicEffect", -- [386] - "OrderHallMissionFrame.MissionTab.MissionPage.Enemy1/OrderHallMissionFrame.MissionTab.MissionPage.Enemy1.PortraitFrame", -- [384] - "OrderHallMissionFrame.MissionTab.MissionPage.Enemy1/UNK_0", -- [385] - "OrderHallMissionFrame.MissionTab.MissionPage.Enemy2/OrderHallMissionFrame.MissionTab.MissionPage.Enemy2.MechanicEffect", -- [390] - "OrderHallMissionFrame.MissionTab.MissionPage.Enemy2/OrderHallMissionFrame.MissionTab.MissionPage.Enemy2.PortraitFrame", -- [388] - "OrderHallMissionFrame.MissionTab.MissionPage.Enemy2/UNK_0", -- [389] - "OrderHallMissionFrame.MissionTab.MissionPage.Enemy3/OrderHallMissionFrame.MissionTab.MissionPage.Enemy3.MechanicEffect", -- [394] - "OrderHallMissionFrame.MissionTab.MissionPage.Enemy3/OrderHallMissionFrame.MissionTab.MissionPage.Enemy3.PortraitFrame", -- [392] - "OrderHallMissionFrame.MissionTab.MissionPage.Enemy3/UNK_0", -- [393] - "OrderHallMissionFrame.MissionTab.MissionPage.Follower1/OrderHallMissionFrame.MissionTab.MissionPage.Follower1.PortraitFrame", -- [396] - "OrderHallMissionFrame.MissionTab.MissionPage.Follower2/OrderHallMissionFrame.MissionTab.MissionPage.Follower2.Durability", -- [416] - "OrderHallMissionFrame.MissionTab.MissionPage.Follower2/OrderHallMissionFrame.MissionTab.MissionPage.Follower2.PortraitFrame", -- [398] - "OrderHallMissionFrame.MissionTab.MissionPage.Follower3/OrderHallMissionFrame.MissionTab.MissionPage.Follower3.Durability", -- [417] - "OrderHallMissionFrame.MissionTab.MissionPage.Follower3/OrderHallMissionFrame.MissionTab.MissionPage.Follower3.PortraitFrame", -- [400] - "OrderHallMissionFrame.MissionTab.MissionPage.RewardsFrame/OrderHallMissionFrame.MissionTab.MissionPage.RewardsFrame.MissionXPTooltipHitBox", -- [381] - "OrderHallMissionFrame.MissionTab.MissionPage.RewardsFrame/OrderHallMissionFrame.MissionTab.MissionPage.RewardsFrame.OvermaxItem", -- [378] - "OrderHallMissionFrame.MissionTab.MissionPage.RewardsFrame/OrderHallMissionFrame.MissionTab.MissionPage.RewardsFrame.OvermaxItem", -- [415] - "OrderHallMissionFrame.MissionTab.MissionPage.RewardsFrame/OrderHallMissionFrame.MissionTab.MissionPage.RewardsFrame.OvermaxItem", -- [420] - "OrderHallMissionFrame.MissionTab.MissionPage.RewardsFrame/OrderHallMissionFrame.MissionTab.MissionPage.RewardsFrame.Reward1", -- [379] - "OrderHallMissionFrame.MissionTab.MissionPage.RewardsFrame/OrderHallMissionFrame.MissionTab.MissionPage.RewardsFrame.Reward2", -- [380] - "OrderHallMissionFrame.MissionTab.MissionPage.RewardsFrame/OrderHallMissionFrame.MissionTab.MissionPage.RewardsFrame.TooltipHitBox", -- [382] - "OrderHallMissionFrame.MissionTab.MissionPage.Stage/OrderHallMissionFrame.MissionTab.MissionPage.Stage.MissionEnvIcon", -- [374] - "OrderHallMissionFrame.MissionTab.MissionPage.Stage/OrderHallMissionFrame.MissionTab.MissionPage.Stage.MissionInfo", -- [373] - "OrderHallMissionFrame.MissionTab.MissionPage/OrderHallMissionFrame.MissionTab.MissionPage.BuffsFrame", -- [419] - "OrderHallMissionFrame.MissionTab.MissionPage/OrderHallMissionFrame.MissionTab.MissionPage.CloseButton", -- [372] - "OrderHallMissionFrame.MissionTab.MissionPage/OrderHallMissionFrame.MissionTab.MissionPage.CostFrame", -- [377] - "OrderHallMissionFrame.MissionTab.MissionPage/OrderHallMissionFrame.MissionTab.MissionPage.EmptyFollowerModel", -- [402] - "OrderHallMissionFrame.MissionTab.MissionPage/OrderHallMissionFrame.MissionTab.MissionPage.Enemy1", -- [387] - "OrderHallMissionFrame.MissionTab.MissionPage/OrderHallMissionFrame.MissionTab.MissionPage.Enemy2", -- [391] - "OrderHallMissionFrame.MissionTab.MissionPage/OrderHallMissionFrame.MissionTab.MissionPage.Enemy3", -- [395] - "OrderHallMissionFrame.MissionTab.MissionPage/OrderHallMissionFrame.MissionTab.MissionPage.Follower1", -- [397] - "OrderHallMissionFrame.MissionTab.MissionPage/OrderHallMissionFrame.MissionTab.MissionPage.Follower2", -- [399] - "OrderHallMissionFrame.MissionTab.MissionPage/OrderHallMissionFrame.MissionTab.MissionPage.Follower3", -- [401] - "OrderHallMissionFrame.MissionTab.MissionPage/OrderHallMissionFrame.MissionTab.MissionPage.ItemLevelHitboxFrame", -- [414] - "OrderHallMissionFrame.MissionTab.MissionPage/OrderHallMissionFrame.MissionTab.MissionPage.RewardsFrame", -- [383] - "OrderHallMissionFrame.MissionTab.MissionPage/OrderHallMissionFrame.MissionTab.MissionPage.Stage", -- [375] - "OrderHallMissionFrame.MissionTab.MissionPage/OrderHallMissionFrame.MissionTab.MissionPage.StartMissionButton", -- [376] - "OrderHallMissionFrame.MissionTab/OrderHallMissionFrame.MissionTab.MissionPage", -- [403] - "OrderHallMissionFrame.MissionTab/OrderHallMissionFrameMissions", -- [280] - "OrderHallMissionFrame.MissionTab/OrderHallMissionFrameMissions", -- [351] - "OrderHallMissionFrame.MissionTab/UNK_0", -- [281] - "OrderHallMissionFrame.MissionTab/UNK_0", -- [282] - "OrderHallMissionFrame.MissionTab/UNK_0", -- [283] - "OrderHallMissionFrame.MissionTab/UNK_0", -- [284] - "OrderHallMissionFrame.MissionTab/UNK_0", -- [285] - "OrderHallMissionFrame.MissionTab/UNK_0", -- [286] - "OrderHallMissionFrame.MissionTab/UNK_0", -- [287] - "OrderHallMissionFrame.MissionTab/UNK_0", -- [288] - "OrderHallMissionFrame.MissionTab/UNK_0", -- [289] - "OrderHallMissionFrame.MissionTab/UNK_0", -- [290] - "OrderHallMissionFrame.MissionTab/UNK_0", -- [291] - "OrderHallMissionFrame.MissionTab/UNK_0", -- [292] - "OrderHallMissionFrame.MissionTab/UNK_0", -- [293] - "OrderHallMissionFrame.MissionTab/UNK_0", -- [352] - "OrderHallMissionFrame.MissionTab/UNK_0", -- [353] - "OrderHallMissionFrame.MissionTab/UNK_0", -- [354] - "OrderHallMissionFrame.MissionTab/UNK_0", -- [355] - "OrderHallMissionFrame.MissionTab/UNK_0", -- [356] - "OrderHallMissionFrame.MissionTab/UNK_0", -- [357] - "OrderHallMissionFrame.MissionTab/UNK_0", -- [358] - "OrderHallMissionFrame.MissionTab/UNK_0", -- [359] - "OrderHallMissionFrame.MissionTab/UNK_0", -- [360] - "OrderHallMissionFrame.MissionTab/UNK_0", -- [361] - "OrderHallMissionFrame.MissionTab/UNK_0", -- [362] - "OrderHallMissionFrame.MissionTab/UNK_0", -- [363] - "OrderHallMissionFrame.MissionTab/UNK_0", -- [364] - "OrderHallMissionFrame/OrderHallMissionFrame.ClassHallIcon", -- [253] - "OrderHallMissionFrame/OrderHallMissionFrame.CloseButton", -- [251] - "OrderHallMissionFrame/OrderHallMissionFrame.FollowerTab", -- [316] - "OrderHallMissionFrame/OrderHallMissionFrame.GarrCorners", -- [252] - "OrderHallMissionFrame/OrderHallMissionFrame.MissionTab", -- [294] - "OrderHallMissionFrame/OrderHallMissionFrame.MissionTab", -- [365] - "OrderHallMissionFrame/OrderHallMissionFrameFollowers", -- [326] - "OrderHallMissionFrame/OrderHallMissionFrameFollowers", -- [413] - "OrderHallMissionFrame/OrderHallMissionFrameTab1", -- [254] - "OrderHallMissionFrame/OrderHallMissionFrameTab1", -- [296] - "OrderHallMissionFrame/OrderHallMissionFrameTab2", -- [255] - "OrderHallMissionFrame/OrderHallMissionFrameTab2", -- [297] - "OrderHallMissionFrame/OrderHallMissionFrameTab3", -- [256] - "OrderHallMissionFrameFollowers/OrderHallFollowerOptionDropDown", -- [325] - "OrderHallMissionFrameFollowers/OrderHallFollowerOptionDropDown", -- [412] - "OrderHallMissionFrameFollowers/OrderHallMissionFrameFollowers.MaterialFrame", -- [322] - "OrderHallMissionFrameFollowers/OrderHallMissionFrameFollowers.MaterialFrame", -- [409] - "OrderHallMissionFrameFollowers/OrderHallMissionFrameFollowers.SearchBox", -- [323] - "OrderHallMissionFrameFollowers/OrderHallMissionFrameFollowers.SearchBox", -- [410] - "OrderHallMissionFrameFollowers/OrderHallMissionFrameFollowersListScrollFrame", -- [321] - "OrderHallMissionFrameFollowers/OrderHallMissionFrameFollowersListScrollFrame", -- [408] - "OrderHallMissionFrameFollowersListScrollFrame/OrderHallMissionFrameFollowersListScrollFrameScrollBar", -- [320] - "OrderHallMissionFrameFollowersListScrollFrame/OrderHallMissionFrameFollowersListScrollFrameScrollBar", -- [407] - "OrderHallMissionFrameFollowersListScrollFrame/OrderHallMissionFrameFollowersListScrollFrameScrollChild", -- [317] - "OrderHallMissionFrameFollowersListScrollFrame/OrderHallMissionFrameFollowersListScrollFrameScrollChild", -- [404] - "OrderHallMissionFrameFollowersListScrollFrameScrollBar/OrderHallMissionFrameFollowersListScrollFrameScrollBarScrollDownButton", -- [319] - "OrderHallMissionFrameFollowersListScrollFrameScrollBar/OrderHallMissionFrameFollowersListScrollFrameScrollBarScrollDownButton", -- [406] - "OrderHallMissionFrameFollowersListScrollFrameScrollBar/OrderHallMissionFrameFollowersListScrollFrameScrollBarScrollUpButton", -- [318] - "OrderHallMissionFrameFollowersListScrollFrameScrollBar/OrderHallMissionFrameFollowersListScrollFrameScrollBarScrollUpButton", -- [405] - "OrderHallMissionFrameMissions.CombatAllyUI.Available/OrderHallMissionFrameMissions.CombatAllyUI.Available.AddFollowerButton", -- [277] - "OrderHallMissionFrameMissions.CombatAllyUI.Available/OrderHallMissionFrameMissions.CombatAllyUI.Available.AddFollowerButton", -- [348] - "OrderHallMissionFrameMissions.CombatAllyUI/OrderHallMissionFrameMissions.CombatAllyUI.Available", -- [278] - "OrderHallMissionFrameMissions.CombatAllyUI/OrderHallMissionFrameMissions.CombatAllyUI.Available", -- [349] - "OrderHallMissionFrameMissions/OrderHallMissionFrameMissions.CombatAllyUI", -- [279] - "OrderHallMissionFrameMissions/OrderHallMissionFrameMissions.CombatAllyUI", -- [350] - "OrderHallMissionFrameMissions/OrderHallMissionFrameMissions.MaterialFrame", -- [276] - "OrderHallMissionFrameMissions/OrderHallMissionFrameMissions.MaterialFrame", -- [347] - "OrderHallMissionFrameMissions/OrderHallMissionFrameMissionsListScrollFrame", -- [273] - "OrderHallMissionFrameMissions/OrderHallMissionFrameMissionsListScrollFrame", -- [344] - "OrderHallMissionFrameMissions/OrderHallMissionFrameMissionsTab1", -- [274] - "OrderHallMissionFrameMissions/OrderHallMissionFrameMissionsTab1", -- [345] - "OrderHallMissionFrameMissions/OrderHallMissionFrameMissionsTab2", -- [275] - "OrderHallMissionFrameMissions/OrderHallMissionFrameMissionsTab2", -- [346] - "OrderHallMissionFrameMissionsListScrollFrame/OrderHallMissionFrameMissionsListScrollFrameScrollBar", -- [272] - "OrderHallMissionFrameMissionsListScrollFrame/OrderHallMissionFrameMissionsListScrollFrameScrollBar", -- [343] - "OrderHallMissionFrameMissionsListScrollFrame/OrderHallMissionFrameMissionsListScrollFrameScrollChild", -- [269] - "OrderHallMissionFrameMissionsListScrollFrame/OrderHallMissionFrameMissionsListScrollFrameScrollChild", -- [340] - "OrderHallMissionFrameMissionsListScrollFrameButton1/UNK_0", -- [257] - "OrderHallMissionFrameMissionsListScrollFrameButton1/UNK_0", -- [328] - "OrderHallMissionFrameMissionsListScrollFrameButton2/UNK_0", -- [259] - "OrderHallMissionFrameMissionsListScrollFrameButton2/UNK_0", -- [330] - "OrderHallMissionFrameMissionsListScrollFrameButton3/UNK_0", -- [261] - "OrderHallMissionFrameMissionsListScrollFrameButton3/UNK_0", -- [332] - "OrderHallMissionFrameMissionsListScrollFrameButton4/UNK_0", -- [263] - "OrderHallMissionFrameMissionsListScrollFrameButton4/UNK_0", -- [334] - "OrderHallMissionFrameMissionsListScrollFrameButton5/UNK_0", -- [265] - "OrderHallMissionFrameMissionsListScrollFrameButton5/UNK_0", -- [336] - "OrderHallMissionFrameMissionsListScrollFrameButton6/UNK_0", -- [267] - "OrderHallMissionFrameMissionsListScrollFrameButton6/UNK_0", -- [338] - "OrderHallMissionFrameMissionsListScrollFrameScrollBar/OrderHallMissionFrameMissionsListScrollFrameScrollBarScrollDownButton", -- [271] - "OrderHallMissionFrameMissionsListScrollFrameScrollBar/OrderHallMissionFrameMissionsListScrollFrameScrollBarScrollDownButton", -- [342] - "OrderHallMissionFrameMissionsListScrollFrameScrollBar/OrderHallMissionFrameMissionsListScrollFrameScrollBarScrollUpButton", -- [270] - "OrderHallMissionFrameMissionsListScrollFrameScrollBar/OrderHallMissionFrameMissionsListScrollFrameScrollBarScrollUpButton", -- [341] - "OrderHallMissionFrameMissionsListScrollFrameScrollChild/OrderHallMissionFrameMissionsListScrollFrameButton1", -- [258] - "OrderHallMissionFrameMissionsListScrollFrameScrollChild/OrderHallMissionFrameMissionsListScrollFrameButton1", -- [329] - "OrderHallMissionFrameMissionsListScrollFrameScrollChild/OrderHallMissionFrameMissionsListScrollFrameButton2", -- [260] - "OrderHallMissionFrameMissionsListScrollFrameScrollChild/OrderHallMissionFrameMissionsListScrollFrameButton2", -- [331] - "OrderHallMissionFrameMissionsListScrollFrameScrollChild/OrderHallMissionFrameMissionsListScrollFrameButton3", -- [262] - "OrderHallMissionFrameMissionsListScrollFrameScrollChild/OrderHallMissionFrameMissionsListScrollFrameButton3", -- [333] - "OrderHallMissionFrameMissionsListScrollFrameScrollChild/OrderHallMissionFrameMissionsListScrollFrameButton4", -- [264] - "OrderHallMissionFrameMissionsListScrollFrameScrollChild/OrderHallMissionFrameMissionsListScrollFrameButton4", -- [335] - "OrderHallMissionFrameMissionsListScrollFrameScrollChild/OrderHallMissionFrameMissionsListScrollFrameButton5", -- [266] - "OrderHallMissionFrameMissionsListScrollFrameScrollChild/OrderHallMissionFrameMissionsListScrollFrameButton5", -- [337] - "OrderHallMissionFrameMissionsListScrollFrameScrollChild/OrderHallMissionFrameMissionsListScrollFrameButton6", -- [268] - "OrderHallMissionFrameMissionsListScrollFrameScrollChild/OrderHallMissionFrameMissionsListScrollFrameButton6", -- [339] - "UIParent/GameMenuFrame", -- [440] - "UIParent/GarrisonFollowerMissionAbilityWithoutCountersTooltip", -- [424] - "UIParent/GarrisonFollowerTooltip", -- [423] - "UIParent/GarrisonFollowerTooltip", -- [428] - "UIParent/OrderHallCommandBar", -- [14] - "UIParent/OrderHallCommandBar", -- [175] - "UIParent/OrderHallCommandBar", -- [89] - "UIParent/OrderHallMissionFrame", -- [295] -} -GarrisonFollowerOptions[followerid].strings= -RETURN_TO_START = "Return to your Class Hall to start this mission" -FOLLOWER_ADDED_TOAST = "Follower Gained" -TROOP_ADDED_UPGRADED_TOAST = "Upgraded Troop Gained" -TRAITS_LABEL = "Equipment Slots" -FOLLOWER_COUNT_LABEL = "Champions" -FOLLOWER_ADDED_UPGRADED_TOAST = "Upgraded Follower Gained" -FOLLOWER_COUNT_STRING = "Champions: %s%d/%d%s" -CONFIRM_EQUIPMENT = "Are you sure you want to equip your follower with %s?" -TROOP_ADDED_TOAST = "Troop Gained" -LANDING_COMPLETE = "Complete - Return to your Class Hall" - -followerListCounterInnerSpacing = 4 -minQualityLevelToShowLevel = 0 -showSpikyBordersOnSpecializationAbilities = true -hideMissionTypeInLandingPage = true -missionCompleteUseNeutralChest = true -followerPageShowGear = false -followerListCounterScale = 1.15 -isPrimaryFollowerType = true -garrisonType = 3 -missionPageMaxCountersInFollowerFrame = 3 -missionPageMaxCountersInFollowerFrameBeforeScaling = 2 -hideCountersInAbilityFrame = true -usesOvermaxMechanic = true -showCategoriesInFollowerList = true -missionFrame = "OrderHallMissionFrame" -missionTooltipShowPartialCountersAsFull = true -showCautionSignOnMissionFollowersSmallBias = false -displayCounterAbilityInPlaceOfMechanic = true -showSingleMissionCompleteAnimation = true -followerPageShowSourceText = false -missionPageAssignTroopSound = "UI_Mission_SlotTroop" -minFollowersForThreatCountersFrame = 1.#INF -partyNotFullText = "You do not have enough Champions to start this mission." -followerListCounterOuterSpacingX = 8 -missionAbilityTooltipFrame = "GarrisonFollowerMissionAbilityWithoutCountersTooltip" -abilityTooltipFrame = "GarrisonFollowerAbilityWithoutCountersTooltip" -missionPageMechanicYOffset = -32 -followerListCounterNumPerRow = 2 -traitAbilitiesAreEquipment = true -missionFollowerSortFunc = function: 000000003F78CD70 -followerListCounterOuterSpacingY = 4 -useAbilityTooltipStyleWithoutCounters = true -missionFollowerInitSortFunc = function: 00007FF788B90998 -missionPageAssignFollowerSound = "UI_Mission_SlotChampion" -showSingleMissionCompleteFollower = false -showILevelOnFollower = false -showILevelInFollowerList = true -missionPageShowXPInMissionInfo = true -} - -GARRISON_MISSION_NPC_OPEN,followerType -GARRISON_MISSION_COMPLETE_RESPONSE,missionID,canComplete,success,bool(?),table(?) -GARRISON_FOLLOWER_DURABILITY_CHANGED,followerType,followerID,number(Durability left?) -GARRISON_FOLLOWER_XP_CHANGED,followerType,followerID,gainedxp,oldxp,oldlevel,oldquality (gained is 0 for maxed) -GARRISON_MISSION_BONUS_ROLL_COMPLETE,missionID,bool(Success?) -If succeeded then -GARRISON_MISSION_BONUS_ROLL_LOOT,itemId -GARRISON_MISSION_LIST_UPDATE,missionType -GARRISON_FOLLOWER_XP_CHANGED,followerType,followerID,gainedxp,oldxp,oldlevel,oldquality (gained is 0 for maxed) -If troops lost: -GARRISON_FOLLOWER_REMOVED,followerType -GARRISON_FOLLOWER_LIST_UPDATE,followerType - - ---]] ---@end-do-not-package@ diff --git a/OrderHallCommander/embeds.xml b/OrderHallCommander/embeds.xml deleted file mode 100644 index e1cf200..0000000 --- a/OrderHallCommander/embeds.xml +++ /dev/null @@ -1,3 +0,0 @@ -<Ui xmlns="http://www.blizzard.com/wow/ui/"> - <Include file="..\GarrisonCommander\embeds.xml"/> -</Ui> diff --git a/OrderHallCommander/followerpage.lua b/OrderHallCommander/followerpage.lua deleted file mode 100644 index 82c5470..0000000 --- a/OrderHallCommander/followerpage.lua +++ /dev/null @@ -1,210 +0,0 @@ -local __FILE__=tostring(debugstack(1,2,0):match("(.*):1:")) -- Always check line number in regexp and file, must be 1 -local function pp(...) print(GetTime(),"|cff009900",__FILE__:sub(-15),strjoin(",",tostringall(...)),"|r") end ---*TYPE module ---*CONFIG noswitch=false,profile=true,enhancedProfile=true ---*MIXINS "AceHook-3.0","AceEvent-3.0","AceTimer-3.0" ---*MINOR 35 --- Generated on 20/01/2017 08:15:04 -local me,ns=... -local addon=ns --#Addon (to keep eclipse happy) -ns=nil -local module=addon:NewSubModule('Followerpage',"AceHook-3.0","AceEvent-3.0","AceTimer-3.0") --#Module -function addon:GetFollowerpageModule() return module end --- Template -local G=C_Garrison -local _ -local AceGUI=LibStub("AceGUI-3.0") -local C=addon:GetColorTable() -local L=addon:GetLocale() -local new=addon.NewTable -local del=addon.DelTable -local kpairs=addon:GetKpairs() -local empty=addon:GetEmpty() -local OHF=OrderHallMissionFrame -local OHFMissionTab=OrderHallMissionFrame.MissionTab --Container for mission list and single mission -local OHFMissions=OrderHallMissionFrame.MissionTab.MissionList -- same as OrderHallMissionFrameMissions Call Update on this to refresh Mission Listing -local OHFFollowerTab=OrderHallMissionFrame.FollowerTab -- Contains model view -local OHFFollowerList=OrderHallMissionFrame.FollowerList -- Contains follower list (visible in both follower and mission mode) -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 followerType=LE_FOLLOWER_TYPE_GARRISON_7_0 -local garrisonType=LE_GARRISON_TYPE_7_0 -local FAKE_FOLLOWERID="0x0000000000000000" -local MAXLEVEL=110 - -local ShowTT=OrderHallCommanderMixin.ShowTT -local HideTT=OrderHallCommanderMixin.HideTT - -local dprint=print -local ddump ---@debug@ -LoadAddOn("Blizzard_DebugTools") -ddump=DevTools_Dump -LoadAddOn("LibDebug") - -if LibDebug then LibDebug() dprint=print end -local safeG=addon.safeG - ---@end-debug@ ---[===[@non-debug@ -dprint=function() end -ddump=function() end -local print=function() end ---@end-non-debug@]===] - --- End Template - DO NOT MODIFY ANYTHING BEFORE THIS LINE ---*BEGIN -local UpgradeFrame -local UpgradeButtons={} -local pool={} ---@debug@ -local debugInfo ---@end-debug@ -function module:CheckSpell() -end -function module:OnInitialized() - UpgradeFrame=CreateFrame("Frame",nil,OHFFollowerTab) - local u=UpgradeFrame - u:SetPoint("TOPLEFT",OHFFollowerTab,"TOPLEFT",5,-72) - u:SetPoint("BOTTOMLEFT",OHFFollowerTab,"BOTTOMLEFT",5,7) - u:SetWidth(70) - u:Show() - --addon:SetBackdrop(u,C:Green()) - self:SecureHook("GarrisonMission_SetFollowerModel","RefreshUpgrades") - self:RegisterEvent("GARRISON_FOLLOWER_UPGRADED") - self:RegisterEvent("GARRISON_FOLLOWER_LIST_UPDATE","GARRISON_FOLLOWER_UPGRADED") - self:RegisterEvent("GARRISON_FOLLOWER_XP_CHANGED","GARRISON_FOLLOWER_UPGRADED") - UpgradeFrame:EnableMouse(true) - --@debug@ - self:RawHookScript(UpgradeFrame,"OnEnter","ShowFollowerData") - self:RawHookScript(UpgradeFrame,"OnLeave",function() GameTooltip:Hide() end) - debugInfo=u:CreateFontString(nil, "OVERLAY", "GameFontNormal") - debugInfo:SetPoint("TOPLEFT",70,20) ---@end-debug@ -end -function module:ShowFollowerData(this) - local tip=GameTooltip - tip:SetOwner(this,"CURSOR_ANCHOR") - tip:AddLine(me) - OrderHallCommanderMixin.DumpData(tip,addon:GetFollowerData(OHFFollowerTab.followerID)) - tip:Show() -end -function module:GARRISON_FOLLOWER_UPGRADED(event,followerType,followerId) - if OHFFollowerTab:IsVisible() then - self:ScheduleTimer("RefreshUpgrades",0.3) - end -end - -function module:RenderUpgradeButton(id,previous) - local qt=GetItemCount(id) - if qt== 0 then return previous end --Not rendering empty buttons - print("Rendering",id,"for",qt,"pieces") - local b=self:AcquireButton() - if previous then - b:SetPoint("TOPLEFT",previous,"BOTTOMLEFT",0,-8) - else - b:SetPoint("TOPLEFT",5,-10) - end - previous=b - b.itemID=id - b:SetAttribute("item",select(2,GetItemInfo(id))) - GarrisonMissionFrame_SetItemRewardDetails(b) - b.Quantity:SetFormattedText("%d",qt) - b.Quantity:SetTextColor(C.Yellow()) - b.Quantity:Show() - b:Show() - return b -end -function module:RefreshUpgrades(model,followerID,displayID,showWeapon) ---@debug@ - debugInfo:SetText(followerID) ---@end-debug@ - if not OHFFollowerTab:IsVisible() then return end - if model then - UpgradeFrame:SetFrameStrata(model:GetFrameStrata()) - UpgradeFrame:SetFrameLevel(model:GetFrameLevel()+5) - end - if not followerID then followerID=OHFFollowerTab.followerID end - local follower=addon:GetFollowerData(followerID) - for i=1,#UpgradeButtons do - self:ReleaseButton(UpgradeButtons[i]) - end - wipe(UpgradeButtons) - if not follower then print("No follower for ",followerID) return end - if follower.isTroop then return end - if not follower.isCollected then return end - if follower.status==GARRISON_FOLLOWER_ON_MISSION then return end - if follower.status==GARRISON_FOLLOWER_COMBAT_ALLY then return end - if follower.status==GARRISON_FOLLOWER_INACTIVE then return end - local u=UpgradeFrame - local previous - if follower.iLevel <850 then - for _,id in pairs(addon:GetData("Upgrades")) do - previous=self:RenderUpgradeButton(id,previous) - end - end - if not follower.isMaxLevel or follower.quality ~=LE_ITEM_QUALITY_EPIC then - for _,id in pairs(addon:GetData("Xp")) do - previous=self:RenderUpgradeButton(id,previous) - end - end - if follower.quality >=LE_ITEM_QUALITY_RARE then - for _,id in pairs(addon:GetData("Equipment")) do - previous=self:RenderUpgradeButton(id,previous) - end - end -end -function module:AcquireButton() - local b=tremove(pool) - if not b then - b=CreateFrame("Button",nil,UpgradeFrame,"OHCUpgradeButton,SecureActionbuttonTemplate") - b:EnableMouse(true) - b:RegisterForClicks("LeftButtonDown") - b:SetAttribute("type","item") - b:SetSize(40,40) - b.Icon:SetSize(40,40) - b:EnableMouse(true) - b:RegisterForClicks("LeftButtonDown") - end - tinsert(UpgradeButtons,b) - return b -end -function module:ReleaseButton(u) - u:Hide() - u:ClearAllPoints() - tinsert(pool,u) -end -local CONFIRM1=L["Upgrading to |cff00ff00%d|r"].."\n" .. CONFIRM_GARRISON_FOLLOWER_UPGRADE -local CONFIRM2=L["Upgrading to |cff00ff00%d|r"].."\n|cffffd200 "..L["You are wasting |cffff0000%d|cffffd200 point(s)!!!"].."|r\n" .. CONFIRM_GARRISON_FOLLOWER_UPGRADE -local function DoUpgradeFollower(this) - G.CastSpellOnFollower(this.data); -end -local function UpgradeFollower(this) - local follower=this:GetParent() - local followerID=follower.followerID - local upgradelevel=this.rawlevel - local genere=this.tipo:sub(1,1) - local currentlevel=genere=="w" and follower.ItemWeapon.itemLevel or follower.ItemArmor.itemLevel - local name = ITEM_QUALITY_COLORS[G.GetFollowerQuality(followerID)].hex..G.GetFollowerName(followerID)..FONT_COLOR_CODE_CLOSE; - local losing=false - local upgrade=math.min(upgradelevel>600 and upgradelevel or upgradelevel+currentlevel,GARRISON_FOLLOWER_MAX_ITEM_LEVEL) - if upgradelevel > 600 and currentlevel>600 then - if (currentlevel > upgradelevel) then - losing=upgradelevel - 600 - else - losing=currentlevel -600 - end - elseif upgrade > GARRISON_FOLLOWER_MAX_ITEM_LEVEL then - losing=(upgrade)-GARRISON_FOLLOWER_MAX_ITEM_LEVEL - end - if losing then - return module:Popup(format(CONFIRM2,upgrade,losing,name),0,DoUpgradeFollower,true,followerID,true) - else - if addon:GetToggle("NOCONFIRM") then - return G.CastSpellOnFollower(followerID); - else - return module:Popup(format(CONFIRM1,upgrade,name),0,DoUpgradeFollower,true,followerID,true) - end - end -end diff --git a/OrderHallCommander/localization.lua b/OrderHallCommander/localization.lua deleted file mode 100644 index 9cdba7c..0000000 --- a/OrderHallCommander/localization.lua +++ /dev/null @@ -1,559 +0,0 @@ -local me,ns=... -local lang=GetLocale() -local l=LibStub("AceLocale-3.0") -local L=l:NewLocale(me,"enUS",true,true) -L["Always counter increased resource cost"] = true -L["Always counter increased time"] = true -L["Always counter kill troops (ignored if we can only use troops with just 1 durability left)"] = true -L["Always counter no bonus loot threat"] = true -L["Better parties available in next future"] = true -L["Building Final report"] = true -L["Capped %1$s. Spend at least %2$d of them"] = true -L["Changes the sort order of missions in Mission panel"] = true -L["Combat ally is proposed for missions so you can consider unassigning him"] = true -L["Complete all missions without confirmation"] = true -L["Configuration for mission party builder"] = true -L["Dont kill Troops"] = true -L["Duration reduced"] = true -L["Duration Time"] = true -L["Expiration Time"] = true -L["Favours leveling follower for xp missions"] = true -L["General"] = true -L["Global approx. xp reward"] = true -L["HallComander Quick Mission Completion"] = true -L[ [=[If you %s, you will lose them -Click on %s to abort]=] ] = [=[If you %s, you will lose them -Click on %s to abort]=] -L[ [=[If you %s, you will lose them -Click on %s to abort]=] ] = true -L["Keep cost low"] = true -L["Keep extra bonus"] = true -L["Keep time short"] = true -L["Keep time VERY short"] = true -L["Level"] = true -L["Make Order Hall Mission Panel movable"] = true -L["Maximize xp gain"] = true -L["Missions"] = true -L["No follower gained xp"] = true -L["Nothing to report"] = true -L["Notifies you when you have troops ready to be collected"] = true -L["Only accept missions with time improved"] = true -L[ [=[OrderHallCommander overrides GarrisonCommander for Order Hall Management. - You can revert to GarrisonCommander simpy disabling OrderhallCommander]=] ] = true -L["Original method"] = true -L["Position is not saved on logout"] = true -L["Resurrect troops effect"] = true -L["Reward type"] = true -L["Show/hide OrderHallCommander mission menu"] = true -L["Sort missions by:"] = true -L["Success Chance"] = true -L["Troop ready alert"] = true -L["Upgrading to |cff00ff00%d|r"] = true -L["Use combat ally"] = true -L["You are wasting |cffff0000%d|cffffd200 point(s)!!!"] = true -L=l:NewLocale(me,"ptBR") -if (L) then -L["Always counter increased resource cost"] = "Sempre contra o aumento do custo de recursos" -L["Always counter increased time"] = "Sempre contra o aumento do tempo" -L["Always counter kill troops (ignored if we can only use troops with just 1 durability left)"] = "Sempre counter kill tropas (ignorado se podemos apenas usar tropas com apenas 1 durabilidade à esquerda)" -L["Better parties available in next future"] = "Festas melhores disponíveis no próximo futuro" -L["Building Final report"] = "Relatório final do edifício" -L["Capped %1$s. Spend at least %2$d of them"] = "Capped% 1 $ s. Gaste pelo menos% 2 $ d deles" -L["Changes the sort order of missions in Mission panel"] = "Altera a ordem de classificação das missões no painel da Missão" -L["Complete all missions without confirmation"] = "Complete todas as missões sem confirmação" -L["Configuration for mission party builder"] = "Configuração para o construtor de parte da missão" -L["Dont kill Troops"] = "Não mate tropas" -L["Duration reduced"] = "Duração reduzida" -L["Duration Time"] = "Tempo de duração" -L["Expiration Time"] = "Data de validade" -L["Favours leveling follower for xp missions"] = "Favors leveling follower para missões xp" -L["General"] = "Geral" -L["Global approx. xp reward"] = "Global aprox. Recompensa xp" -L["HallComander Quick Mission Completion"] = "Conclusão Rápida da Missão HallComander" -L[ [=[If you %s, you will lose them -Click on %s to abort]=] ] = "Se você% s, você os perderá nClique em% s para abortar" -L["Keep cost low"] = "Mantenha o custo baixo" -L["Keep time short"] = "Mantenha o tempo curto" -L["Keep time VERY short"] = "Mantenha o tempo MUITO curto" -L["Level"] = "Nível" -L["Make Order Hall Mission Panel movable"] = "Faça a encomenda Hall Missão Painel móvel" -L["Maximize xp gain"] = "Maximize o ganho de xp" -L["Missions"] = "Missões" -L["No follower gained xp"] = "Nenhum seguidor ganhou xp" -L["Nothing to report"] = "Nada a declarar" -L["Notifies you when you have troops ready to be collected"] = "Notifica você quando você tem tropas prontas para serem coletadas" -L["Only accept missions with time improved"] = "Aceitar apenas missões com o tempo melhorado" -L[ [=[OrderHallCommander overrides GarrisonCommander for Order Hall Management. - You can revert to GarrisonCommander simpy disabling OrderhallCommander]=] ] = "OrderHallCommander substitui o GarrisonCommander para a Gestão de Hall de Ordem. N Você pode reverter para GarrisonCommander simplesmente desativando o OrderhallCommander" -L["Original method"] = "Método original" -L["Position is not saved on logout"] = "A posição não é salva no logout" -L["Resurrect troops effect"] = "Resurrect efeito tropas" -L["Reward type"] = "Tipo de recompensa" -L["Show/hide OrderHallCommander mission menu"] = "Mostrar / ocultar o menu da missão OrderHallCommander" -L["Sort missions by:"] = "Classifique missões por:" -L["Success Chance"] = "Chance de sucesso" -L["Troop ready alert"] = "Alerta de tropas" -L["Upgrading to |cff00ff00%d|r"] = "Atualizando para | cff00ff00% d | r" -L["You are wasting |cffff0000%d|cffffd200 point(s)!!!"] = "Você está desperdiçando | cffff0000% d | cffffd200 point (s) !!!" -return -end -L=l:NewLocale(me,"frFR") -if (L) then -L["Always counter increased resource cost"] = "Toujours contrer les coûts accrus des ressources" -L["Always counter increased time"] = "Toujours contrer le temps accru" -L["Always counter kill troops (ignored if we can only use troops with just 1 durability left)"] = "Toujours contre tuer les troupes (ignoré si nous ne pouvons utiliser des troupes avec une seule durabilité à gauche)" -L["Better parties available in next future"] = "De meilleures parties disponibles au prochain avenir" -L["Building Final report"] = "Rapport final du bâtiment" -L["Capped %1$s. Spend at least %2$d of them"] = "Plafonné% 1 $ s. Dépenser au moins% 2 $ d d'entre eux" -L["Changes the sort order of missions in Mission panel"] = "Modifie l'ordre de tri des missions dans le panneau Mission" -L["Complete all missions without confirmation"] = "Terminer toutes les missions sans confirmation" -L["Configuration for mission party builder"] = "Configuration pour le constructeur de mission" -L["Dont kill Troops"] = "Ne tuez pas les troupes" -L["Duration reduced"] = "Durée réduite" -L["Duration Time"] = "Durée" -L["Expiration Time"] = "Date d'expiration" -L["Favours leveling follower for xp missions"] = "Favors level follower pour les missions xp" -L["General"] = "Général" -L["Global approx. xp reward"] = "Global env. Xp récompense" -L["HallComander Quick Mission Completion"] = "Achèvement rapide de mission HallComander" -L[ [=[If you %s, you will lose them -Click on %s to abort]=] ] = "Si vous% s, vous les perdrez nCliquez sur% s pour annuler" -L["Keep cost low"] = "Garder le coût bas" -L["Keep time short"] = "Garde le temps court" -L["Keep time VERY short"] = "Gardez le temps très court" -L["Level"] = "Niveau" -L["Make Order Hall Mission Panel movable"] = "Commande Hall Mission Panneau mobile" -L["Maximize xp gain"] = "Maximiser le gain de xp" -L["Missions"] = true -L["No follower gained xp"] = "Aucun adepte n'a gagné xp" -L["Nothing to report"] = "Rien à signaler" -L["Notifies you when you have troops ready to be collected"] = "Vous avertit lorsque vous avez des troupes prêtes à être recueillies" -L["Only accept missions with time improved"] = "N'acceptez que les missions avec le temps améliorées" -L[ [=[OrderHallCommander overrides GarrisonCommander for Order Hall Management. - You can revert to GarrisonCommander simpy disabling OrderhallCommander]=] ] = "OrderHallCommander annule GarrisonCommander pour la gestion des commandes Hall. N Vous pouvez revenir à GarrisonCommander simpy désactiver OrderhallCommander" -L["Original method"] = "Méthode originale" -L["Position is not saved on logout"] = "La position n'est pas enregistrée lors de la déconnexion" -L["Resurrect troops effect"] = "Effet Résurrection des troupes" -L["Reward type"] = "Type de récompense" -L["Show/hide OrderHallCommander mission menu"] = "Afficher / masquer le menu de mission OrderHallCommander" -L["Sort missions by:"] = "Missions de tri par:" -L["Success Chance"] = "Chance de succès" -L["Troop ready alert"] = "Alerte prêt des troupes" -L["Upgrading to |cff00ff00%d|r"] = "Mise à niveau vers | cff00ff00% d | r" -L["You are wasting |cffff0000%d|cffffd200 point(s)!!!"] = "Vous perdez | cffff0000% d | cffffd200 point (s) !!!" -return -end -L=l:NewLocale(me,"deDE") -if (L) then -L["Always counter increased resource cost"] = "Immer erhöhte Ressourcenkosten kontern" -L["Always counter increased time"] = "Immer erhöhte Missionsdauer kontern" -L["Always counter kill troops (ignored if we can only use troops with just 1 durability left)"] = "Töten der Trupps immer kontern (dies wird ignoriert, falls nur Truppen mit 1 Haltbarkeit benutzt werden können)" -L["Always counter no bonus loot threat"] = "Kontert immer Bedrohungen, die Bonusbeute verhindern" -L["Better parties available in next future"] = "Bessere Gruppen sind in absehbarer Zeit verfügbar" -L["Building Final report"] = "Erstelle Abschlussbericht" -L["Capped %1$s. Spend at least %2$d of them"] = "Maximal %1$ s. Gib mindestens %2$d davon aus" -L["Changes the sort order of missions in Mission panel"] = "Verändert die Sortierreihenfolge der Missionen in der Missionsübersicht" -L["Combat ally is proposed for missions so you can consider unassigning him"] = "Der Kampfgefährte wird für Missionen vorgeschlagen, du kannst dann entscheiden, ob du ihn abziehen möchtest" -L["Complete all missions without confirmation"] = "Alle Missionen ohne Bestätigung abschließen" -L["Configuration for mission party builder"] = "Konfiguration des Gruppenerstellers für Missionen" -L["Dont kill Troops"] = "Trupps nicht töten" -L["Duration reduced"] = "Dauer reduziert" -L["Duration Time"] = "Dauer" -L["Expiration Time"] = "Ablaufzeit" -L["Favours leveling follower for xp missions"] = "Bevorzugt niedrigstufige Anhänger für EP-Missionen" -L["General"] = "Allgemein" -L["Global approx. xp reward"] = "Ca. Insgesamte EP-Belohnung" -L["HallComander Quick Mission Completion"] = "HallComander Schneller Missionsabschluss" -L[ [=[If you %s, you will lose them -Click on %s to abort]=] ] = [=[Wenn du %s, wirst du sie verlieren. -Klicke auf %s, um abzubrechen]=] -L[ [=[If you %s, you will lose them -Click on %s to abort]=] ] = [=[Wenn du %s, wirst du sie verlieren. -Klicke auf %s, um abzubrechen]=] -L["Keep cost low"] = "Kosten niedrig halten" -L["Keep extra bonus"] = "Bonusbeute behalten" -L["Keep time short"] = "Zeit kurz halten" -L["Keep time VERY short"] = "Zeit SEHR kurz halten" -L["Level"] = "Stufe" -L["Make Order Hall Mission Panel movable"] = "Ordenshallen-Missionsfenster beweglich machen" -L["Maximize xp gain"] = "Erfahrungszunahme maximieren" -L["Missions"] = "Missionen" -L["No follower gained xp"] = "Kein Anhänger erhielt EP" -L["Nothing to report"] = "Nichts zu berichten" -L["Notifies you when you have troops ready to be collected"] = "Benachrichtigt, wenn Truppen bereit sind, gesammelt zu werden" -L["Only accept missions with time improved"] = "Nur Missionen mit verkürzter Dauer annehmen" -L[ [=[OrderHallCommander overrides GarrisonCommander for Order Hall Management. - You can revert to GarrisonCommander simpy disabling OrderhallCommander]=] ] = "OrderHallCommander überschreibt GarrisonCommander für die Verwaltung der Ordenshalle. Sie können GarrisonCommander wiederherstellen, indem Sie OrderhallCommander deaktivieren" -L["Original method"] = "Ursprüngliche Methode" -L["Position is not saved on logout"] = "Die Position wird beim Ausloggen nicht gespeichert" -L["Resurrect troops effect"] = "Truppen wiederbeleben" -L["Reward type"] = "Belohnungsart" -L["Show/hide OrderHallCommander mission menu"] = "OrderHallCommander-Missionsmenü zeigen/ausblenden" -L["Sort missions by:"] = "Sortieren nach:" -L["Success Chance"] = "Erfolgschance" -L["Troop ready alert"] = "Warnung Trupp bereit" -L["Upgrading to |cff00ff00%d|r"] = "Aktualisieren auf | cff00ff00% d | r" -L["Use combat ally"] = "Kampfgefährten verwenden" -L["You are wasting |cffff0000%d|cffffd200 point(s)!!!"] = "Sie verschwenden | cffff0000% d | cffffd200 Punkt (e) !!!" -return -end -L=l:NewLocale(me,"itIT") -if (L) then -L["Always counter increased resource cost"] = "Contrasta sempre incremento risorse" -L["Always counter increased time"] = "Contrasta sempre incremento durata" -L["Always counter kill troops (ignored if we can only use troops with just 1 durability left)"] = "Contrasta sempre morte milizie (ignorato tutte le milizie hanno solo una vita rimanente)" -L["Always counter no bonus loot threat"] = "Contrasta sempre il \"no bonus\"" -L["Better parties available in next future"] = "Ci sono combinazioni migliori nel futuro" -L["Building Final report"] = "Sto preparando il rapporto finale" -L["Capped %1$s. Spend at least %2$d of them"] = "%1$s ha un limite. Spendine almeno %2%d" -L["Changes the sort order of missions in Mission panel"] = "Cambia l'ordine delle mission nel Pannello Missioni" -L["Combat ally is proposed for missions so you can consider unassigning him"] = "Viene proposto l'alleato, per poter valutare se rimuoverlo dalla missione di scorta" -L["Complete all missions without confirmation"] = "Completa tutte le missioni senza chiedere conferma" -L["Configuration for mission party builder"] = "Configurazioni per il generatore di gruppi" -L["Dont kill Troops"] = "Non uccidere le truppe" -L["Duration reduced"] = "Durata" -L["Duration Time"] = "Scadenza" -L["Expiration Time"] = "Scadenza" -L["Favours leveling follower for xp missions"] = "Preferisci i campioni che devono livellare" -L["General"] = "Generale" -L["Global approx. xp reward"] = "Approssimativi PE globali" -L["HallComander Quick Mission Completion"] = "OrderHallCommander Completamento rapido" -L["Keep cost low"] = "Mantieni il costo basso" -L["Keep extra bonus"] = "Ottieni il bonus aggiuntivo" -L["Keep time short"] = "Riduci la durata" -L["Keep time VERY short"] = "Riduci MOLTO la durata" -L["Level"] = "Livello" -L["Make Order Hall Mission Panel movable"] = "Rendi spostabile il pannello missioni" -L["Maximize xp gain"] = "Massimizza il guadagno di PE" -L["Missions"] = "Missioni" -L["No follower gained xp"] = "Nessun campione ha guaagnato PE" -L["Nothing to report"] = "Niente da segnalare" -L["Notifies you when you have troops ready to be collected"] = "Notificami quando ho truppe pronte per essere raccolte" -L["Only accept missions with time improved"] = "Accetta solo missioni con bonus durata ridotta" -L[ [=[OrderHallCommander overrides GarrisonCommander for Order Hall Management. - You can revert to GarrisonCommander simpy disabling OrderhallCommander]=] ] = [=[OrderHallCommander sostituisce l'interfaccia di GarrisonComamnder per le missioni di classe -Disabilitalo se preferisci GarrisonCommander]=] -L["Position is not saved on logout"] = "La posizione non è salvata alla disconnessione" -L["Resurrect troops effect"] = "Resurrezione truppe possibile" -L["Reward type"] = "Tipo ricompensa" -L["Show/hide OrderHallCommander mission menu"] = "Mostra/ascondi il menu di missione di OrderHallCommander" -L["Troop ready alert"] = "Avviso truppe pronte" -L["Use combat ally"] = "Usa l'alleato" -return -end -L=l:NewLocale(me,"koKR") -if (L) then -L["Always counter increased resource cost"] = "자원 비용 증가 항상 대응" -L["Always counter increased time"] = "소요 시간 증가 항상 대응" -L["Always counter kill troops (ignored if we can only use troops with just 1 durability left)"] = "병력 죽이기 항상 대응 (활력이 1만 남은 병력만 있을 땐 무시)" -L["Always counter no bonus loot threat"] = "추가 전리품 획득 불가 항상 대응" -L["Better parties available in next future"] = "다음 시간 후엔 더 나은 파티가 가능합니다" -L["Building Final report"] = "최종 보고서 작성" -L["Capped %1$s. Spend at least %2$d of them"] = "%1$s 상한선에 도달했습니다. 최소 %2$d개를 소모하세요" -L["Changes the sort order of missions in Mission panel"] = "임무 창 내 임무의 정렬 방법을 변경합니다" -L["Combat ally is proposed for missions so you can consider unassigning him"] = "전투 동료가 임무에 제안되며 전투 동료 지정 해제를 해야 할 수 있습니다" -L["Complete all missions without confirmation"] = "확인 없이 모든 임무를 완료합니다" -L["Configuration for mission party builder"] = "임무 파티 구성 설정" -L["Dont kill Troops"] = "병력 죽이지 않기" -L["Duration reduced"] = "수행 시간 감소됨" -L["Duration Time"] = "수행 시간" -L["Expiration Time"] = "만료 시간" -L["Favours leveling follower for xp missions"] = "레벨 육성 중인 추종자를 경험치 임무에 우선 지정합니다" -L["General"] = "일반" -L["Global approx. xp reward"] = "전체 경험치 보상 추정치" -L["HallComander Quick Mission Completion"] = "HallCommander 빠른 임무 완료" -L[ [=[If you %s, you will lose them -Click on %s to abort]=] ] = [=[만약 %s\1241이라면;라면;, 그들을 잃게 됩니다 -취소하려면 %s\1241을;를; 클릭하세요]=] -L[ [=[If you %s, you will lose them -Click on %s to abort]=] ] = [=[만약 %s\1241이라면;라면;, 그들을 잃게 됩니다 -취소하려면 %s\1241을;를; 클릭하세요]=] -L["Keep cost low"] = "비용 절감 유지" -L["Keep extra bonus"] = "추가 전리품 유지" -L["Keep time short"] = "시간 절약 유지" -L["Keep time VERY short"] = "시간 매우 절약 유지" -L["Level"] = "레벨" -L["Make Order Hall Mission Panel movable"] = "직업 전당 임무 창 이동 가능 설정" -L["Maximize xp gain"] = "경험치 획득 최대화" -L["Missions"] = "임무" -L["No follower gained xp"] = "경험치를 획득한 추종자 없음" -L["Nothing to report"] = "보고할 내용 없음" -L["Notifies you when you have troops ready to be collected"] = "병력을 회수할 준비가 되면 당신에게 알립니다" -L["Only accept missions with time improved"] = "소요 시간이 감소한 임무만 수락합니다" -L[ [=[OrderHallCommander overrides GarrisonCommander for Order Hall Management. - You can revert to GarrisonCommander simpy disabling OrderhallCommander]=] ] = [=[OrderHallCommander는 직업 전당 관리를 위해 GarrisonCommander보다 우선됩니다. -OrderHallCommander를 사용 하지 않으면 GarrisonCommander로 전환할 수 있습니다.]=] -L["Original method"] = "원래의 방법" -L["Position is not saved on logout"] = "접속 종료시 위치는 저장되지 않습니다" -L["Resurrect troops effect"] = "병력 부활 효과" -L["Reward type"] = "보상 유형" -L["Show/hide OrderHallCommander mission menu"] = "OrderHallCommander 임무 메뉴 표시/숨기기" -L["Sort missions by:"] = "임무 정렬 방법:" -L["Success Chance"] = "성공 확률" -L["Troop ready alert"] = "병력 준비 경보" -L["Upgrading to |cff00ff00%d|r"] = "|cff00ff00%d|r\\1241으로;로; 향상시키기" -L["Use combat ally"] = "전투 동료 사용" -L["You are wasting |cffff0000%d|cffffd200 point(s)!!!"] = "|cffff0000%d|cffffd200점을 낭비하고 있습니다!!!" -return -end -L=l:NewLocale(me,"esMX") -if (L) then -L["Always counter increased resource cost"] = "Siempre contrarreste el mayor costo de recursos" -L["Always counter increased time"] = "Siempre contrarreste el tiempo incrementado" -L["Always counter kill troops (ignored if we can only use troops with just 1 durability left)"] = "Siempre contra las tropas de matar (ignorado si sólo podemos utilizar tropas con sólo 1 durabilidad a la izquierda)" -L["Better parties available in next future"] = "Mejores fiestas disponibles en el próximo futuro" -L["Building Final report"] = "Informe final del edificio" -L["Capped %1$s. Spend at least %2$d of them"] = "% 1 $ s cubierto. Gasta al menos% 2 $ d de ellos" -L["Changes the sort order of missions in Mission panel"] = "Cambia el orden de las misiones en el panel de la Misión" -L["Complete all missions without confirmation"] = "Completa todas las misiones sin confirmación" -L["Configuration for mission party builder"] = "Configuración para el constructor de la misión" -L["Dont kill Troops"] = "No matar a las tropas" -L["Duration reduced"] = "Duración reducida" -L["Duration Time"] = "Duración" -L["Expiration Time"] = "Tiempo de expiración" -L["Favours leveling follower for xp missions"] = "Favors nivelando seguidor para las misiones xp" -L["General"] = true -L["Global approx. xp reward"] = "Global aprox. Recompensa xp" -L["HallComander Quick Mission Completion"] = "Conclusión de la misión rápida de HallComander" -L[ [=[If you %s, you will lose them -Click on %s to abort]=] ] = "Si% s, los perderá nHaga clic en% s para abortar" -L["Keep cost low"] = "Mantenga el costo bajo" -L["Keep time short"] = "Mantenga el tiempo corto" -L["Keep time VERY short"] = "Mantener el tiempo muy corto" -L["Level"] = "Nivel" -L["Make Order Hall Mission Panel movable"] = "Hacer pedido Hall Misión Panel móvil" -L["Maximize xp gain"] = "Maximizar la ganancia de xp" -L["Missions"] = "Misiones" -L["No follower gained xp"] = "Ningún seguidor ganó xp" -L["Nothing to report"] = "Nada que reportar" -L["Notifies you when you have troops ready to be collected"] = "Notifica cuando hay tropas listas para ser recolectadas" -L["Only accept missions with time improved"] = "Sólo aceptar misiones mejoradas con el tiempo" -L[ [=[OrderHallCommander overrides GarrisonCommander for Order Hall Management. - You can revert to GarrisonCommander simpy disabling OrderhallCommander]=] ] = "OrderHallCommander reemplaza a GarrisonCommander para la Gestión de Hall de Orden. N Puede volver a GarneyCommander simplemente inhabilitando OrderhallCommander" -L["Original method"] = "Método original" -L["Position is not saved on logout"] = "La posición no se guarda al cerrar la sesión" -L["Resurrect troops effect"] = "Efecto de las tropas de resurrección" -L["Reward type"] = "Tipo de recompensa" -L["Show/hide OrderHallCommander mission menu"] = "Mostrar / ocultar el menú de la misión OrderHallCommander" -L["Sort missions by:"] = "Ordenar misiones por:" -L["Success Chance"] = "Éxito" -L["Troop ready alert"] = "Alerta lista de tropas" -L["Upgrading to |cff00ff00%d|r"] = "Actualizando a | cff00ff00% d | r" -L["You are wasting |cffff0000%d|cffffd200 point(s)!!!"] = "Está perdiendo | cffff0000% d | cffffd200 punto (s)!" -return -end -L=l:NewLocale(me,"ruRU") -if (L) then -L["Always counter increased resource cost"] = "Учитывать увеличение стоимости ресурсов." -L["Always counter increased time"] = "Учитывать увеличение времени на задание" -L["Always counter kill troops (ignored if we can only use troops with just 1 durability left)"] = "Учитывать жизни валарьяров. (Игнорируется, если остались войска только с 1 ед.здоровья)" -L["Always counter no bonus loot threat"] = [=[Игнорировать миссии, если -нет шанса на дополнительную добычу]=] -L["Better parties available in next future"] = "Лучшая партия будет скоро доступна" -L["Building Final report"] = "Создать отчет." -L["Capped %1$s. Spend at least %2$d of them"] = "Достигнуто %1$. Потратьте по крайней мере 2%$" -L["Changes the sort order of missions in Mission panel"] = "Изменение порядка сортировки миссий" -L["Combat ally is proposed for missions so you can consider unassigning him"] = [=[Использовать боевого соратника в расчетах. -Перед отправкой освободите соратника.]=] -L["Complete all missions without confirmation"] = "Завершить все миссии без подтверждения" -L["Configuration for mission party builder"] = "Конфигурация для построения мисии" -L["Dont kill Troops"] = "Не убивать валарьяров" -L["Duration reduced"] = "Продолжительность уменьшена" -L["Duration Time"] = "Продолжительность" -L["Expiration Time"] = "Время окончания" -L["Favours leveling follower for xp missions"] = "В миссиях на опыт, использовать гибкую прокачку соратников" -L["General"] = "Основные" -L["Global approx. xp reward"] = "Опыт" -L["HallComander Quick Mission Completion"] = "HallComander Быстрое завершение миссий" -L[ [=[If you %s, you will lose them -Click on %s to abort]=] ] = [=[Если вы %, вы потеряете их. -Нажмите на %, чтобы прервать]=] -L[ [=[If you %s, you will lose them -Click on %s to abort]=] ] = [=[Если вы %, вы потеряете их. -Нажмите на %, чтобы прервать]=] -L["Keep cost low"] = "Дешевые миссии" -L["Keep extra bonus"] = "Дополнительная добыча" -L["Keep time short"] = "Короткие миссии" -L["Keep time VERY short"] = "Быстрые миссии" -L["Level"] = "Уровень" -L["Make Order Hall Mission Panel movable"] = " Разрешить перемещать панель Order Hall" -L["Maximize xp gain"] = "Максимальный опыт" -L["Missions"] = "Миссии" -L["No follower gained xp"] = "Соратник не получает опыт" -L["Nothing to report"] = "Без отчета" -L["Notifies you when you have troops ready to be collected"] = "Уведомлять о готовности свежих войск" -L["Only accept missions with time improved"] = "Разрешать миссии только с ускоренным выполнением" -L[ [=[OrderHallCommander overrides GarrisonCommander for Order Hall Management. - You can revert to GarrisonCommander simpy disabling OrderhallCommander]=] ] = "OrderHallCommander переопределяет GarrisonCommander для управления оплотом. Вы можете вернуться к GarrisonCommander отключив OrderhallCommander" -L["Original method"] = "Обычный метод" -L["Position is not saved on logout"] = "Позиция не сохранится при выходе из системы" -L["Resurrect troops effect"] = "Эффект воскрешения войск" -L["Reward type"] = "Награда" -L["Show/hide OrderHallCommander mission menu"] = "Показать/скрыть меню OrderHallCommander" -L["Sort missions by:"] = "Сортировать миссии по:" -L["Success Chance"] = "Шанс успеха" -L["Troop ready alert"] = "Предупреждать о готовности войск" -L["Upgrading to |cff00ff00%d|r"] = "Обновление до |cff00ff00%d|r" -L["Use combat ally"] = "Боевой соратник" -L["You are wasting |cffff0000%d|cffffd200 point(s)!!!"] = "Вы тратите |cffff0000%d|cffffd200 очков !!!" -return -end -L=l:NewLocale(me,"zhCN") -if (L) then -L["Always counter increased resource cost"] = "总是反制增加资源花费" -L["Always counter increased time"] = "总是反制增加任务时间" -L["Always counter kill troops (ignored if we can only use troops with just 1 durability left)"] = "总是反制杀死部队(如果我们用只剩一次耐久的部队则忽略)" -L["Always counter no bonus loot threat"] = "总是反制没有额外奖励的威胁" -L["Better parties available in next future"] = "在将来有更好的队伍" -L["Building Final report"] = "构建最终报告" -L["Capped %1$s. Spend at least %2$d of them"] = "%1$s封顶了。花费至少%2$d在它身上" -L["Changes the sort order of missions in Mission panel"] = "改变任务面板上的任务排列顺序" -L["Combat ally is proposed for missions so you can consider unassigning him"] = "战斗盟友被建议到任务,所以你可以考虑取消指派他" -L["Complete all missions without confirmation"] = "完成所有任务不须确认" -L["Configuration for mission party builder"] = "任务队伍构建设置" -L["Dont kill Troops"] = "别让部队被杀死" -L["Duration reduced"] = "持续时间已缩短" -L["Duration Time"] = "持续时间" -L["Expiration Time"] = "到期时间" -L["Favours leveling follower for xp missions"] = "倾向于使用升级中追隨者在经验值任务" -L["General"] = "一般" -L["Global approx. xp reward"] = "整体大约经验值奖励" -L["HallComander Quick Mission Completion"] = "大厅指挥官快速任务完成" -L[ [=[If you %s, you will lose them -Click on %s to abort]=] ] = [=[如果你继续,你会失去它们 -点击%s來取消]=] -L[ [=[If you %s, you will lose them -Click on %s to abort]=] ] = [=[如果你继续,你会失去它们 -点击%s來取消]=] -L["Keep cost low"] = "节省大厅资源" -L["Keep extra bonus"] = "优先额外奖励" -L["Keep time short"] = "减少任务时间" -L["Keep time VERY short"] = "最短任务时间" -L["Level"] = "等级" -L["Make Order Hall Mission Panel movable"] = "让大厅任务面板可移动" -L["Maximize xp gain"] = "最大化经验获取" -L["Missions"] = "任务" -L["No follower gained xp"] = "没有追随者获得经验" -L["Nothing to report"] = "没什么可报告" -L["Notifies you when you have troops ready to be collected"] = "当部队已准备好获取时提醒你" -L["Only accept missions with time improved"] = "只允许有时间改善的任务" -L[ [=[OrderHallCommander overrides GarrisonCommander for Order Hall Management. - You can revert to GarrisonCommander simpy disabling OrderhallCommander]=] ] = [=[OrderHallCommander覆盖GarrisonCommander订单厅管理。 - 你可以恢复到GarrisonCommander simpy禁用OrderhallCommander]=] -L["Original method"] = "原始方法" -L["Position is not saved on logout"] = "位置不会在登出后储存" -L["Resurrect troops effect"] = "复活部队效果" -L["Reward type"] = "奖励类型" -L["Show/hide OrderHallCommander mission menu"] = "显示/隐藏大厅指挥官任务选单" -L["Sort missions by:"] = "排列任务根据:" -L["Success Chance"] = "成功机率" -L["Troop ready alert"] = "部队装备提醒" -L["Upgrading to |cff00ff00%d|r"] = "升级到|cff00ff00%d|r" -L["Use combat ally"] = "使用战斗盟友" -L["You are wasting |cffff0000%d|cffffd200 point(s)!!!"] = "你浪费了|cffff0000%d|cffffd200 点数!!!" -return -end -L=l:NewLocale(me,"esES") -if (L) then -L["Always counter increased resource cost"] = "Siempre contrarreste el mayor costo de recursos" -L["Always counter increased time"] = "Siempre contrarreste el tiempo incrementado" -L["Always counter kill troops (ignored if we can only use troops with just 1 durability left)"] = "Siempre contrarrestar la muerte de tropas (ignorado si sólo podemos utilizar tropas con un solo punto de durabilidad)" -L["Always counter no bonus loot threat"] = "Siempre contrarresta la falta de bonificación de botín" -L["Better parties available in next future"] = "Mejores fiestas disponibles en el próximo futuro" -L["Building Final report"] = "Informe final del edificio" -L["Capped %1$s. Spend at least %2$d of them"] = "% 1 $ s cubierto. Gasta al menos% 2 $ d de ellos" -L["Changes the sort order of missions in Mission panel"] = "Cambia el orden de las misiones en el panel de la Misión" -L["Complete all missions without confirmation"] = "Completa todas las misiones sin confirmación" -L["Configuration for mission party builder"] = "Configuración para el constructor de la misión" -L["Dont kill Troops"] = "No matar a las tropas" -L["Duration reduced"] = "Duración reducida" -L["Duration Time"] = "Duración" -L["Expiration Time"] = "Tiempo de expiración" -L["Favours leveling follower for xp missions"] = "Favors nivelando seguidor para las misiones xp" -L["General"] = true -L["Global approx. xp reward"] = "Global aprox. Recompensa xp" -L["HallComander Quick Mission Completion"] = "Conclusión de la misión rápida de HallComander" -L[ [=[If you %s, you will lose them -Click on %s to abort]=] ] = "Si% s, los perderá nHaga clic en% s para abortar" -L["Keep cost low"] = "Mantenga el costo bajo" -L["Keep extra bonus"] = "Mantener bonificación extra" -L["Keep time short"] = "Mantenga el tiempo corto" -L["Keep time VERY short"] = "Mantener el tiempo muy corto" -L["Level"] = "Nivel" -L["Make Order Hall Mission Panel movable"] = "Hacer pedido Hall Misión Panel móvil" -L["Maximize xp gain"] = "Maximizar la ganancia de xp" -L["Missions"] = "Misiones" -L["No follower gained xp"] = "Ningún seguidor ganó xp" -L["Nothing to report"] = "Nada que reportar" -L["Notifies you when you have troops ready to be collected"] = "Notifica cuando hay tropas listas para ser recolectadas" -L["Only accept missions with time improved"] = "Sólo aceptar misiones mejoradas con el tiempo" -L[ [=[OrderHallCommander overrides GarrisonCommander for Order Hall Management. - You can revert to GarrisonCommander simpy disabling OrderhallCommander]=] ] = "OrderHallCommander reemplaza a GarrisonCommander para la Gestión de Hall de Orden. N Puede volver a GarneyCommander simplemente inhabilitando OrderhallCommander" -L["Original method"] = "Método original" -L["Position is not saved on logout"] = "La posición no se guarda al cerrar la sesión" -L["Resurrect troops effect"] = "Efecto de las tropas de resurrección" -L["Reward type"] = "Tipo de recompensa" -L["Show/hide OrderHallCommander mission menu"] = "Mostrar / ocultar el menú de la misión OrderHallCommander" -L["Sort missions by:"] = "Ordenar misiones por:" -L["Success Chance"] = "Éxito" -L["Troop ready alert"] = "Alerta lista de tropas" -L["Upgrading to |cff00ff00%d|r"] = "Actualizando a | cff00ff00% d | r" -L["Use combat ally"] = "Usar aliado de combate" -L["You are wasting |cffff0000%d|cffffd200 point(s)!!!"] = "Está perdiendo | cffff0000% d | cffffd200 punto (s)!" -return -end -L=l:NewLocale(me,"zhTW") -if (L) then -L["Always counter increased resource cost"] = "總是反制增加資源花費" -L["Always counter increased time"] = "總是反制增加任務時間" -L["Always counter kill troops (ignored if we can only use troops with just 1 durability left)"] = "總是反制殺死部隊(如果我們用只剩一次耐久的部隊則忽略)" -L["Always counter no bonus loot threat"] = "總是反制沒有額外獎勵的威脅" -L["Better parties available in next future"] = "在將來有更好的隊伍" -L["Building Final report"] = "構建最終報告" -L["Capped %1$s. Spend at least %2$d of them"] = "%1$s封頂了。花費至少%2$d在它身上" -L["Changes the sort order of missions in Mission panel"] = "改變任務面板上的任務排列順序" -L["Combat ally is proposed for missions so you can consider unassigning him"] = "戰鬥盟友被建議到任務,所以你可以考慮取消指派他" -L["Complete all missions without confirmation"] = "完成所有任務不須確認" -L["Configuration for mission party builder"] = "任務隊伍構建設置" -L["Dont kill Troops"] = "別讓部隊被殺死" -L["Duration reduced"] = "持續時間已縮短" -L["Duration Time"] = "持續時間" -L["Expiration Time"] = "到期時間" -L["Favours leveling follower for xp missions"] = "傾向於使用升級中追隨者在經驗值任務" -L["General"] = "(G) 一般" -L["Global approx. xp reward"] = "整體大約經驗值獎勵" -L["HallComander Quick Mission Completion"] = "大廳指揮官快速任務完成" -L[ [=[If you %s, you will lose them -Click on %s to abort]=] ] = [=[如果您繼續,您會失去它們 -點擊%s來取消]=] -L[ [=[If you %s, you will lose them -Click on %s to abort]=] ] = [=[如果您繼續,您會失去它們 -點擊%s來取消]=] -L["Keep cost low"] = "保持低花費" -L["Keep extra bonus"] = "保持額外獎勵" -L["Keep time short"] = "保持短時間" -L["Keep time VERY short"] = "保持非常短的時間" -L["Level"] = "等級" -L["Make Order Hall Mission Panel movable"] = "讓大廳任務面板可移動" -L["Maximize xp gain"] = "最大化經驗獲取" -L["Missions"] = "(M) 任務" -L["No follower gained xp"] = "沒有追隨者獲得經驗" -L["Nothing to report"] = "沒什麼可報告" -L["Notifies you when you have troops ready to be collected"] = "當部隊已準備好獲取時提醒你" -L["Only accept missions with time improved"] = "只允許有時間改善的任務" -L[ [=[OrderHallCommander overrides GarrisonCommander for Order Hall Management. - You can revert to GarrisonCommander simpy disabling OrderhallCommander]=] ] = [=[大廳指揮官會覆蓋要塞指揮官為大廳管理。 -你可以返回使用要塞指揮官只要簡單的停用大廳指揮官]=] -L["Original method"] = "原始方法" -L["Position is not saved on logout"] = "位置不會在登出後儲存" -L["Resurrect troops effect"] = "復活部隊效果" -L["Reward type"] = "獎勵類型" -L["Show/hide OrderHallCommander mission menu"] = "顯示/隱藏大廳指揮官任務選單" -L["Sort missions by:"] = "排列任務根據:" -L["Success Chance"] = "成功機率" -L["Troop ready alert"] = "部隊整備提醒" -L["Upgrading to |cff00ff00%d|r"] = "升級到|cff00ff00%d|r" -L["Use combat ally"] = "使用戰鬥盟友" -L["You are wasting |cffff0000%d|cffffd200 point(s)!!!"] = "你浪費了|cffff0000%d|cffffd200 點數!!!" -return -end diff --git a/OrderHallCommander/matchmaker.lua b/OrderHallCommander/matchmaker.lua deleted file mode 100644 index b8d04aa..0000000 --- a/OrderHallCommander/matchmaker.lua +++ /dev/null @@ -1,665 +0,0 @@ -local __FILE__=tostring(debugstack(1,2,0):match("(.*):1:")) -- Always check line number in regexp and file, must be 1 -local function pp(...) print(GetTime(),"|cff009900",__FILE__:sub(-15),strjoin(",",tostringall(...)),"|r") end ---*TYPE module ---*CONFIG noswitch=false,profile=true,enhancedProfile=true ---*MIXINS "AceHook-3.0","AceEvent-3.0","AceTimer-3.0","AceSerializer-3.0","AceConsole-3.0" ---*MINOR 35 --- Generated on 20/01/2017 08:15:04 -local me,ns=... -local addon=ns --#Addon (to keep eclipse happy) -ns=nil -local module=addon:NewSubModule('Matchmaker',"AceHook-3.0","AceEvent-3.0","AceTimer-3.0","AceSerializer-3.0","AceConsole-3.0") --#Module -function addon:GetMatchmakerModule() return module end --- Template -local G=C_Garrison -local _ -local AceGUI=LibStub("AceGUI-3.0") -local C=addon:GetColorTable() -local L=addon:GetLocale() -local new=addon.NewTable -local del=addon.DelTable -local kpairs=addon:GetKpairs() -local empty=addon:GetEmpty() -local OHF=OrderHallMissionFrame -local OHFMissionTab=OrderHallMissionFrame.MissionTab --Container for mission list and single mission -local OHFMissions=OrderHallMissionFrame.MissionTab.MissionList -- same as OrderHallMissionFrameMissions Call Update on this to refresh Mission Listing -local OHFFollowerTab=OrderHallMissionFrame.FollowerTab -- Contains model view -local OHFFollowerList=OrderHallMissionFrame.FollowerList -- Contains follower list (visible in both follower and mission mode) -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 followerType=LE_FOLLOWER_TYPE_GARRISON_7_0 -local garrisonType=LE_GARRISON_TYPE_7_0 -local FAKE_FOLLOWERID="0x0000000000000000" -local MAXLEVEL=110 - -local ShowTT=OrderHallCommanderMixin.ShowTT -local HideTT=OrderHallCommanderMixin.HideTT - -local dprint=print -local ddump ---@debug@ -LoadAddOn("Blizzard_DebugTools") -ddump=DevTools_Dump -LoadAddOn("LibDebug") - -if LibDebug then LibDebug() dprint=print end -local safeG=addon.safeG - ---@end-debug@ ---[===[@non-debug@ -dprint=function() end -ddump=function() end -local print=function() end ---@end-non-debug@]===] - --- End Template - DO NOT MODIFY ANYTHING BEFORE THIS LINE ---*BEGIN -local lethalMechanicEffectID = 437; -local cursedMechanicEffectID = 471; -local slowingMechanicEffectID = 428; -local disorientingMechanicEffectID = 472; -local debugMission=0 -local function parse(default,rc,...) - if rc then - return ... - else - --@debug@ - error(message,2) - --@end-debug@ - return default - end -end - -local meta={ -__index = function(t,key) - return function(...) return parse(nil,pcall(C_Garrison[key],...)) end end -} ---upvalues -local assert,ipairs,pairs,wipe,GetFramesRegisteredForEvent=assert,ipairs,pairs,wipe,GetFramesRegisteredForEvent -local select,tinsert,format,pcall,setmetatable,coroutine=select,tinsert,format,pcall,setmetatable,coroutine -local tostringall=tostringall -local followerType=LE_FOLLOWER_TYPE_GARRISON_7_0 -local emptyTable={} -local holdEvents -local releaseEvents -local debug=setmetatable({},{__index=function(t,k) rawset(t,k,new()) return t[k] end}) -local events={stacklevel=0,frames={}} --#events -function addon:GetDebug() - return debug -end -function events.hold() --#eventsholdEvents - if events.stacklevel==0 then - events.frames={GetFramesRegisteredForEvent('GARRISON_FOLLOWER_LIST_UPDATE')} - for i=1,#events.frames do - events.frames[i]:UnregisterEvent("GARRISON_FOLLOWER_LIST_UPDATE") - end - end - events.stacklevel=events.stacklevel+1 -end -function events.release() - events.stacklevel=events.stacklevel-1 - assert(events.stacklevel>=0) - if (events.stacklevel==0) then - for i=1,#events.frames do - events.frames[i]:RegisterEvent("GARRISON_FOLLOWER_LIST_UPDATE") - end - events.frames=nil - end -end -holdEvents=events.hold -releaseEvents=events.release -local maxtime=3600*24*7 --- Candidate management -local CandidateManager={perc=0,chance=0} --#CandidateManager -local CandidateMeta={__index=CandidateManager} -local emptyCandidate=setmetatable({},CandidateMeta) -local inProgressCandidate=setmetatable({},CandidateMeta) -function CandidateManager:IterateFollowers() - return ipairs(self) -end -function CandidateManager:Follower(index) - return self[index] -end --- Party management -local partyManager={} --#PartyManager -local function newParty() - return setmetatable(new(), - {__index=partyManager, - __call=function(table) end - }) -end -local parties={} -local function IsLower(cur,base) - if not cur then - return 99 - else - return cur < base - end -end -local function IsHigher(cur,base) - if not cur then - return 0 - else - return cur > base - end -end - --- addon:RegisterForMenu("mission","SAVETROOPS","SPARE","MAKEITQUICK","MAXIMIZEXP") -function partyManager:Fail(reason,...) ---@debug@ - reason=strjoin(' ',tostringall(reason,...)) ---@end-debug@ - return false,reason -end -local keys={ -'f1', -'f2', -'f3' -} -function partyManager:FillRealFollowers(candidate,dbg) - candidate.busyUntil=GetTime() - local troops=new() - addon:GetAllTroops(troops) - for i=1,3 do - if i > (self.numFollowers or 3) then return end - local key=keys[i]; - if candidate[key] then - local followerID,classSpec=strsplit(',',candidate['f'..i]) - --GARRISON_FOLLOWER_COMBAT_ALLY - classSpec=addon:tonumber(classSpec,0) - if classSpec~=0 then - local better=(candidate.hasKillTroopsEffect and IsLower or IsHigher) - local base=better() - local baseBusy=base - local found,foundBusy,foundFree - for t,troop in pairs(troops) do - local ignore=false - if troop.classSpec==classSpec then - if i>1 and troop.followerID==candidate[i-1] then - ignore=true - end - if i>2 and troop.followerID==candidate[i-2] then - ignore=true - end - troop.status=G.GetFollowerStatus(troop.followerID) - if troop.status then - if better(troop.durability,baseBusy) and not ignore then - foundBusy=t - baseBusy=troop.durability - end - else - troop.busyUntil=0 - if better(troop.durability,base) and not ignore then - found=t - base=troop.durability - end - if not ignore and not foundFree then - foundFree=t - end - end - end - end - -- SAVETROOPS doesnt allow to have unintended casualties - if addon:GetBoolean("SAVETROOPS") and candidate.hasKillTroopsEffect and addon:GetFollowerData(followerID,'durability') > 1 then - followerID=nil - else - if found then - followerID=troops[found].followerID - elseif foundFree then - followerID=troops[foundFree].followerID - elseif foundBusy then - followerID=troops[foundBusy].followerID - else - followerID=nil - end - end - end - candidate[i]=followerID - if followerID then - candidate.busyUntil=math.max(addon:GetFollowerData(followerID,'busyUntil',0),candidate.busyUntil) - end - else - candidate[i]=nil - end - end - del(troops) -end -function partyManager:SatisfyCondition(candidate,key,table) - if type(candidate) ~= "table" then return self:Fail("NOTABLE") end - local followerID=candidate[key] - self.lastChecked=followerID - if not followerID then return self:Fail("No follower id for party slot",key) end - if addon:GetBoolean("SPARE") and candidate.cost > candidate.baseCost then return self:Fail("SPARE",addon:GetBoolean("SPARE"),candidate.cost , candidate.baseCost) end - if addon:GetBoolean("MAKEITVERYQUICK") and not candidate.timeIsImproved then return self:Fail("VERYQUICK") end - if addon:GetBoolean("MAKEITQUICK") and candidate.hasMissionTimeNegativeEffect then return self:Fail("QUICK") end - if addon:GetBoolean("BONUS") and candidate.hasBonusLootNegativeEffect then return self:Fail("BONUS") end - local ready=addon:GetFollowerData(followerID,"busyUntil") - if not ready then return self:Fail("No ready data") end - local status=G.GetFollowerStatus(followerID) - if status then - if addon:GetBoolean("USEALLY") and status==GARRISON_FOLLOWER_COMBAT_ALLY then - return true - end - return self:Fail("BUSY",status,'G.GetFollowerStatus("' ..followerID..'")') - end - return true,'OK' -end -function partyManager:IterateIndex() - self:GenerateIndex() - return ipairs(self.candidatesIndex) -end -local function GetSelectedParty(self,dbg) - local lastkey - local bestkey - local xpkey - local absolutebestkey - local busybestkey - local xpperc=0 - local xpgainers=0 - self:GenerateIndex() - local maxChamps=addon:GetNumber("MAXCHAMP") - for i,key in ipairs(self.candidatesIndex) do - local candidate=self.candidates[key] - if dbg then - local a={'f1','f2','f3'} - local message="key " - for i=1,#a do - local f=candidate[a[i]] - if f then - local id,troop,name=strsplit(',',f) - key=key.. id:sub(11) .. C(name,troop==0 and 'orange' or 'cyan') .. ' ' - end - end - addon:Print(key) - end - if candidate and candidate.champions <=maxChamps then - self:FillRealFollowers(candidate,dbg) - if not absolutebestkey then absolutebestkey=key end - lastkey=key - local got=true - local reason='' - if type(self.numFollowers) ~= "number" then - - end - for i=1,self.numFollowers do - local rc,reason = self:SatisfyCondition(candidate,i) - got=got and rc - if not got then ---@debug@ - if dbg then - if reason=="NOTABLE" then - addon:Print("Received a non table as candidate",type(candidate),candidate) - else - addon:Print(candidate['f'..i],C(reason,'RED')) - end - end ---@end-debug@ - break - end - end - if got then ---@debug@ - if dbg then - addon:Print(C("Satisfy ok","green")) - end ---@end-debug@ - if not bestkey then bestkey=key end - if addon:GetBoolean("MAXIMIZEXP") then - if candidate.perc >= 100 and candidate.xpGainers >xpgainers then - xpkey=key - xpperc=candidate.perc - xpgainers=candidate.xpGainers - end - else - candidate.order=i - candidate.key=key - return candidate,key - end - end ---@debug@ - else - if dbg then addon:Print("Too many champions:",candidate.champions) end ---@end-debug@ - end - - end - --@debug@ - if dbg then addon:Print( - format("Best: %s, Xp: %s, Absolute: %s, Last:%s",tostringall(bestkey,xpkey,absolutebestkey,lastkey)) - ) - end - print("XPKey,Bestkey,Lastkey",self.missionID,xpkey,bestkey,lastkey) - --@end-debug@ - if xpkey then - return self.candidates[xpkey],xpkey - end - if bestkey then - return self.candidates[bestkey],bestkey - end - if absolutebestkey then - return self.candidates[absolutebestkey],absolutebestkey - end - if lastkey then - --if self.candidates[lastkey].busyUntil <= GetTime() then - return self.candidates[lastkey],lastkey -- should not return busy followers - --end - end - return setmetatable(self:GetEffects(),CandidateMeta) -end -function partyManager:GetSelectedParty(mission) - wipe(debug[self.missionID]) - if type(mission)=="table" and mission.inProgress then ---@debug@ - print("inProgress") ---@end-debug@ - if not self.candidates or not self.candidates.progress then - local candidate=self:GetEffects() - local followers=mission.followers - if followers then - for i =1,#followers do - candidate[i]=followers[i] - end - end - self.candidates.progress=setmetatable(candidate,CandidateMeta) - end - return self.candidates.progress,"progress" - end - if type(mission)=="string" and self.candidates[mission] then ---@debug@ - print("Returning explicity set key ",mission) ---@end-debug@ - return self.candidates[mission],mission - end - if not self.ready then ---@debug@ - print("Rebuilding list") ---@end-debug@ - self:Match() - end - - local candidate=GetSelectedParty(self) - self.bestChance=candidate.perc or 0 - self.bestTimeseconds=candidate.timeseconds or 0 - self.totalXP=(self.baseXP+self.rewardXP+(candidate.bonusXP or 0))*(candidate.xpGainers or 0) - return candidate -end -function partyManager:Remove(...) - local tbl=... - if type(tbl)=="table" then - for _,id in ipairs(tbl) do - if type(id)=="table" then id=id.followerID end - local rc,message=pcall(G.RemoveFollowerFromMission,self.missionID,id) ---@debug@ - if not rc then - print("Remove failed",message,self.missionID,...) - end ---@end-debug@ - end - else - for i=1,select('#',...) do - local rc,message=pcall(G.RemoveFollowerFromMission,self.missionID,(select(i,...))) ---@debug@ - if not rc then - print("Remove failed",message,self.missionID,...) - end ---@end-debug@ - end - end -end -function partyManager:GetEffects() - local timestring,timeseconds,timeImproved,chance,buffs,missionEffects,xpBonus,materials,gold=G.GetPartyMissionInfo(self.missionID) - missionEffects.timestring=timestring - missionEffects.timeseconds=timeseconds - missionEffects.perc=chance - missionEffects.timeImproved=timeImproved - missionEffects.xpBonus=xpBonus - missionEffects.materials=materials - missionEffects.gold=gold - local improvements=5 - if timeImproved then improvements=improvements -1 end - if missionEffects.hasMissionTimeNegativeEffect then improvements=improvements+1 end - missionEffects.baseCost,missionEffects.cost=G.GetMissionCost(self.missionID) - if missionEffects.baseCost < missionEffects.cost then - improvements=improvements+2 - elseif missionEffects.baseCost > missionEffects.cost then - improvements=improvements-1 - end - if missionEffects.hasKillTroopsEffect then - improvements=improvements+2 - end - missionEffects.improvements=improvements - return missionEffects - -end -function partyManager:Build(...) ---@debug@ - print("Build",self.numFollowers,...) ---@end-debug@ - local followers=new() - if select('#',...)>0 then - for i=1,self.numFollowers or 3 do - local follower=select(i,...) - if not follower then return self:Remove(followers) end - local followerID=follower.followerID - local rc,res = pcall(G.AddFollowerToMission,self.missionID,followerID) - if not rc or not res then - self:Remove(followers) - del(followers) - return - end - tinsert(followers,follower) - end - end - local missionEffects=self:GetEffects() - missionEffects.xpGainers=0 - missionEffects.champions=0 - for i=1,#followers do - local followerID=followers[i].followerID - local k='f'..i - if not followers[i].isTroop then - local qlevel=addon:GetFollowerData(followerID,'qLevel',0) - missionEffects.champions=missionEffects.champions+1 - if qlevel < addon.MAXQLEVEL then - missionEffects.xpGainers=missionEffects.xpGainers+1 - end - end - missionEffects[k]=format("%s,%s",tostringall(followerID,followers[i].isTroop and followers[i].classSpec or "0")) - --@debug@ - missionEffects[k]=missionEffects [k]..','..addon:GetFollowerData(followerID,'name') - --@end-debug@ - end - self.unique=self.unique+1 - local index=format("%03d:%1d:%1d:%1d:%2d",900-missionEffects.perc,missionEffects.improvements,missionEffects.champions,3-missionEffects.xpGainers,self.unique) - missionEffects.chance=index - self.candidates[index]=setmetatable(missionEffects,CandidateMeta) - self:Remove(followers) - -end - -function partyManager:Match() - - local champs=addon:GetPermutations() - wipe(self.candidates) - local totChamps=#champs - local mission=addon:GetMissionData(self.missionID) - if not mission then - addon:RebuildMissionCache() - mission=addon:GetMissionData(self.missionID) - end - if not mission then return false end ---@debug@ - OHCDebug:Bump("Parties") - print("Match started for mission",mission.name) ---@end-debug@ - self.unique=0 - self.numFollowers=mission.numFollowers - self.missionSort=addon:Reward2Class(mission) - self.missionClass=mission.missionClass - self.missionValue=mission.missionValue - self.baseXP=mission.baseXP or 0 - self.rewardXP=(self.missionClass=="FollowerXP" and self.missionValue) or 0 - self.totalXP=self.baseXP+self.rewardXP - local t=addon:GetTroopTypes() - local t1_1,t1_2=addon:GetTroop(t[1],2) - local t2_1,t2_2=addon:GetTroop(t[2],2) - local t3_1,t3_2=addon:GetTroop(t[3],2) - local async=coroutine.running() - if not async then holdEvents() end - local n=self.numFollowers or 3 - for i=1,n do - for _,tuple in pairs(champs[i]) do - if async then holdEvents() end - local f1,f2,f3=strsplit(',',tuple) - f1=empty(f1) and nil or addon:GetFollowerData(f1) - f2=empty(f1) and nil or addon:GetFollowerData(f2) - f3=empty(f1) and nil or addon:GetFollowerData(f3) - print("Match",tuple,f1,f2,f3) - if i < n then - if n==3 then - if i==1 then -- single champ group, adding double follower - if t1_1 and t1_2 then self:Build(f1,t1_1,t1_2) end -- 2 - if t1_1 and t2_1 then self:Build(f1,t1_1,t2_1) end -- 1 1 - if t1_1 and t3_1 then self:Build(f1,t1_1,t3_1) end -- 1 1 - if t2_1 and t2_2 then self:Build(f1,t2_1,t2_2) end -- 2 - if t2_1 and t3_1 then self:Build(f1,t2_1,t3_1) end -- 1 1 - if t3_1 and t3_2 then self:Build(f1,t3_1,t3_2) end -- 2 - elseif i==2 then -- 2 champ group, adding single follower - if t1_1 then self:Build(f1,f2,t1_1) end - if t2_1 then self:Build(f1,f2,t2_1) end - if t3_1 then self:Build(f1,f2,t3_1) end - end - elseif n==2 then - if t1_1 then self:Build(f1,t1_1) end - if t2_1 then self:Build(f1,t2_1) end - if t3_1 then self:Build(f1,t2_1) end - end - else - self:Build(f1,f2,f3) -- Full Champions group - end - end - if async then - releaseEvents() - coroutine.yield() - end - end - self:Build() - if not async then releaseEvents() end - self.ready=true - return true -end -function partyManager:GenerateIndex() - if not self.candidatesIndex then self.candidatesIndex=new() else wipe(self.candidatesIndex) end - for k,_ in pairs(self.candidates) do - tinsert(self.candidatesIndex,k) - end - table.sort(self.candidatesIndex) -end -function module:OnInitialized() - addon:AddLabel(L["Missions"],L["Configuration for mission party builder"]) - addon:AddBoolean("SAVETROOPS",false,L["Dont kill Troops"],L["Always counter kill troops (ignored if we can only use troops with just 1 durability left)"]) - addon:AddBoolean("BONUS",true,L["Keep extra bonus"],L["Always counter no bonus loot threat"]) - addon:AddBoolean("SPARE",false,L["Keep cost low"],L["Always counter increased resource cost"]) - addon:AddBoolean("MAKEITQUICK",true,L["Keep time short"],L["Always counter increased time"]) - addon:AddBoolean("MAKEITVERYQUICK",false,L["Keep time VERY short"],L["Only accept missions with time improved"]) - addon:AddBoolean("MAXIMIZEXP",false,L["Maximize xp gain"],L["Favours leveling follower for xp missions"]) - --addon:AddBoolean("MAXIMIZEMISSIONS",false,L["Maximize filled missions"],L["Attempts to use less champions for missions, in order to fill more missions"]) - addon:AddRange("MAXCHAMP",2,1,3,L["Max champions"],L["Use at most this many champions"]) - addon:AddBoolean("USEALLY",false,L["Use combat ally"],L["Combat ally is proposed for missions so you can consider unassigning him"]) - addon:RegisterForMenu("mission","SAVETROOPS","BONUS","SPARE","MAKEITQUICK","MAKEITVERYQUICK","MAXIMIZEXP",'MAXCHAMP','USEALLY') - self:RegisterEvent("GARRISON_FOLLOWER_XP_CHANGED","Refresh") - self:RegisterEvent("GARRISON_FOLLOWER_UPGRADED","Refresh") - self:RegisterEvent("GARRISON_FOLLOWER_ADDED","Refresh") - self:RegisterEvent("GARRISON_MISSION_STARTED","Refresh") - self:RegisterEvent("GARRISON_MISSION_COMPLETE_RESPONSE","Refresh") - self:RegisterEvent("FOLLOWER_LIST_UPDATE","Refresh") -end -function module:Refresh(event) - self:ResetParties() - addon:GetMissionlistModule():SortMissions() - return addon:RefreshMissions() -end -function module:ResetParties() - for _,party in pairs(parties) do - party.ready=false - end -end ---Public interface -function addon:ApplySAVETROOPS(value) - return addon:RefreshMissions() -end -function addon:ApplySPARE(value) - return addon:RefreshMissions() -end -function addon:ApplyMAKEITQUICK(value) - return addon:RefreshMissions() -end -function addon:ApplyUSEALLY(value) - return addon:RefreshMissions() -end -function addon:ApplyMAXIMIZEMISSIONS(value) - return addon:RefreshMissions() -end -function addon:ApplyMAXCHAMP(value) - return addon:RefreshMissions() -end -function addon:ApplyBONUS(value) - return addon:RefreshMissions() -end -function addon:ApplyMAKEITVERYQUICK(value) - return addon:RefreshMissions() -end -function addon:ApplyMAXIMIZEXP(value) - return addon:RefreshMissions() -end -function addon:HoldEvents() - return holdEvents() -end -function addon:ReleaseEvents() - return releaseEvents() -end -function addon:GetSelectedParty(missionID,key) - return self:GetParties(missionID):GetSelectedParty(key) -end -function addon:ResetParties() - return module:ResetParties() -end ---@debug@ -function addon:TestParty(missionID) - local parties=self:GetParties(missionID) - self:Print("Debug for ", missionID,G.GetMissionName(missionID)) - local choosen,choosenkey=GetSelectedParty(parties,true) - self:Print(choosenkey) - DevTools_Dump(choosen) - - -end ---@end-debug@ -function addon:GetParties(missionID) - if not parties[missionID] then - parties[missionID]=newParty() - parties[missionID].missionID=missionID - parties[missionID].candidates=new() - end ---@debug@ - local n=0 - for _,_ in pairs(parties) do - n=n+1 - end - OHCDebug:Set("NumParties",n) ---@end-debug@ - return parties[missionID] -end -function addon:GetAllParties() - return parties -end -function addon:ReFillParties() - for missionID,_ in pairs(addon:GetMissionData()) do - self:GetParties(missionID):Match() - end -end ---@debug@ -function addon:SetDebug(id) - debugMission=id -end ---@end-debug@ diff --git a/OrderHallCommander/missionlist.lua b/OrderHallCommander/missionlist.lua deleted file mode 100644 index a1fe935..0000000 --- a/OrderHallCommander/missionlist.lua +++ /dev/null @@ -1,672 +0,0 @@ -local __FILE__=tostring(debugstack(1,2,0):match("(.*):1:")) -- Always check line number in regexp and file, must be 1 -local function pp(...) print(GetTime(),"|cff009900",__FILE__:sub(-15),strjoin(",",tostringall(...)),"|r") end ---*TYPE module ---*CONFIG noswitch=false,profile=true,enhancedProfile=true ---*MIXINS "AceHook-3.0","AceEvent-3.0","AceTimer-3.0" ---*MINOR 35 --- Generated on 20/01/2017 08:15:04 -local me,ns=... -local addon=ns --#Addon (to keep eclipse happy) -ns=nil -local module=addon:NewSubModule('Missionlist',"AceHook-3.0","AceEvent-3.0","AceTimer-3.0") --#Module -function addon:GetMissionlistModule() return module end --- Template -local G=C_Garrison -local _ -local AceGUI=LibStub("AceGUI-3.0") -local C=addon:GetColorTable() -local L=addon:GetLocale() -local new=addon.NewTable -local del=addon.DelTable -local kpairs=addon:GetKpairs() -local empty=addon:GetEmpty() -local OHF=OrderHallMissionFrame -local OHFMissionTab=OrderHallMissionFrame.MissionTab --Container for mission list and single mission -local OHFMissions=OrderHallMissionFrame.MissionTab.MissionList -- same as OrderHallMissionFrameMissions Call Update on this to refresh Mission Listing -local OHFFollowerTab=OrderHallMissionFrame.FollowerTab -- Contains model view -local OHFFollowerList=OrderHallMissionFrame.FollowerList -- Contains follower list (visible in both follower and mission mode) -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 followerType=LE_FOLLOWER_TYPE_GARRISON_7_0 -local garrisonType=LE_GARRISON_TYPE_7_0 -local FAKE_FOLLOWERID="0x0000000000000000" -local MAXLEVEL=110 - -local ShowTT=OrderHallCommanderMixin.ShowTT -local HideTT=OrderHallCommanderMixin.HideTT - -local dprint=print -local ddump ---@debug@ -LoadAddOn("Blizzard_DebugTools") -ddump=DevTools_Dump -LoadAddOn("LibDebug") - -if LibDebug then LibDebug() dprint=print end -local safeG=addon.safeG - ---@end-debug@ ---[===[@non-debug@ -dprint=function() end -ddump=function() end -local print=function() end ---@end-non-debug@]===] - --- End Template - DO NOT MODIFY ANYTHING BEFORE THIS LINE ---*BEGIN --- Additonal frames -local GARRISON_MISSION_AVAILABILITY2=GARRISON_MISSION_AVAILABILITY .. " %s" -local GARRISON_MISSION_ID="MissionID: %d" -local missionstats=setmetatable({}, {__mode = "v"}) -local missionmembers=setmetatable({}, {__mode = "v"}) -local missionthreats=setmetatable({}, {__mode = "v"}) -local missionIDS={} -local spinners=setmetatable({}, {__mode = "v"}) -local parties=setmetatable({}, {__mode = "v"}) -local buttonlist={} -local oGarrison_SortMissions=Garrison_SortMissions -local function nop() end -local Current_Sorter -local sorters={ - Garrison_SortMissions_Original=nop, - Garrison_SortMissions_Chance=function(a,b) - local aparty=addon:GetParties(a.missionID) - local bparty=addon:GetParties(b.missionID) - return aparty.bestChance>bparty.bestChance - end, - Garrison_SortMissions_Level=function(a,b) return a.level==b.level and a.iLevel>b.iLevel or a.level >b.level end, - Garrison_SortMissions_Age=function(a,b) return (a.offerEndTime or 0) < (b.offerEndTime or 0) end, - Garrison_SortMissions_Xp=function(a,b) - local aparty=addon:GetParties(a.missionID) - local bparty=addon:GetParties(b.missionID) - return aparty.totalXP>bparty.totalXP - end, - Garrison_SortMissions_Duration=function(a,b) - local aparty=addon:GetParties(a.missionID) - local bparty=addon:GetParties(b.missionID) - return aparty.bestTimeseconds<bparty.bestTimeseconds - end, - Garrison_SortMissions_Class=function(a,b) - local a=addon:GetMissionData(a.missionID) - local b=addon:GetMissionData(b.missionID) - return (a.missionSort or 0)>(b.missionSort or 0) - end, -} ---@debug@ -local function Garrison_SortMissions_PostHook() - print("Riordino le missioni") - table.sort(OrderHallMissionFrame.MissionTab.MissionList.availableMissions,function(a,b) return a.name < b.name end) -end ---@end-debug@ -function module:OnInitialized() --- Dunno why but every attempt of changing sort starts a memory leak - local sorters={ - Garrison_SortMissions_Original=L["Original method"], - Garrison_SortMissions_Chance=L["Success Chance"], - Garrison_SortMissions_Level=L["Level"], - Garrison_SortMissions_Age=L["Expiration Time"], - Garrison_SortMissions_Xp=L["Global approx. xp reward"], - Garrison_SortMissions_Duration=L["Duration Time"], - Garrison_SortMissions_Class=L["Reward type"], - } - addon:AddSelect("SORTMISSION","Garrison_SortMissions_Original",sorters, L["Sort missions by:"],L["Changes the sort order of missions in Mission panel"]) - addon:AddPrivateAction("HardRefreshMissions","Recalculate",L["Recalculate all parties"]) - addon:RegisterForMenu("mission","SORTMISSION","HardRefreshMissions") - self:LoadButtons() - self:RegisterEvent("GARRISON_MISSION_STARTED",function() wipe(missionIDS) wipe(parties) end) - Current_Sorter=addon:GetString("SORTMISSION") - self:SecureHookScript(OHF--[[MissionTab--]],"OnShow","InitialSetup") - --@debug@ - pp("Current sorter",Current_Sorter) - --@end-debug@ - --hooksecurefunc("Garrison_SortMissions",Garrison_SortMissions_PostHook)--function(missions) module:SortMissions(missions) end) - --self:SecureHook("Garrison_SortMissions",function(missionlist) print("Sorting",#missionlist,"missions") end) - --function(missions) module:SortMissions(missions) end) - self:SecureHookScript(OrderHallMissionFrameMissionsTab1,"OnClick","SortMissions") - self:SecureHookScript(OrderHallMissionFrameMissionsTab2,"OnClick","SortMissions") -end -function module:Print(...) - print(...) -end -function module:LoadButtons(...) - buttonlist=OHFMissions.listScroll.buttons - for i=1,#buttonlist do - local b=buttonlist[i] - self:SecureHookScript(b,"OnEnter","AdjustMissionTooltip") - self:SecureHookScript(b,"OnClick","PostMissionClick") - b:RegisterForClicks("AnyDown") - local scale=0.8 - local f,h,s=b.Title:GetFont() - b.Title:SetFont(f,h*scale,s) - local f,h,s=b.Summary:GetFont() - b.Summary:SetFont(f,h*scale,s) - end -end --- This method is called also when overing on tooltips --- keeps a reference to the mission currently bound to this button -function module:OnUpdate() ---@debug@ - print("OnUpdate") ---@end-debug@ --- for _,frame in pairs(buttonlist) do --- if frame:IsVisible() then --- self:AdjustPosition(frame) --- if frame.info.missionID ~= missionIDS[frame] then --- self:AdjustMissionButton(frame) --- missionIDS[frame]=frame.info.missionID --- end --- end --- end -end -function module:OnSingleUpdate(frame) ---@debug@ - addon:Print("OnSingleUpdate",frame and frame.info and frame.info.missionID,missionIDS[frame]) ---@end-debug@ - if frame:IsVisible() then - self:AdjustPosition(frame) - if frame.info.missionID ~= missionIDS[frame] then - self:AdjustMissionButton(frame) - missionIDS[frame]=frame.info.missionID - end - end -end --- called when needed a full upodate (reload mission data) -function module:OnUpdateMissions(...) - if OHFMissions:IsVisible() then - addon:HardRefreshMissions() - --self:SortMissions() - --OHFMissions:Update() - --for _,frame in pairs(buttonlist) do - -- if frame:IsVisible() then - -- self:AdjustMissionButton(frame,frame.info.rewards) - -- end - --end - end -end -local function sortfunc1(a,b) - return a.timeLeftSeconds < b.timeLeftSeconds -end -local prova={ - {followerTypeID=1}, - {followerTypeID=2}, -} -function module:SortMissions() - if OHFMissions:IsVisible() then - if OHFMissions.inProgress then - pcall(table.sort,OHFMissions.inProgressMissions,sortfunc1) - else - pcall(table.sort,OrderHallMissionFrame.MissionTab.MissionList.availableMissions,sorters[Current_Sorter]) - --Garrison_SortMissions(OHFMissions.availableMissions) - --Garrison_SortMissions(prova) - end - OHFMissions:Update() - end -end -function addon:ApplySORTMISSION(value) - Current_Sorter=value - module:SortMissions() -end -function addon:HardRefreshMissions() ---@debug@ - print("Called hard refresh") ---@end-debug@ - wipe(missionIDS) - wipe(parties) - self:RebuildAllCaches() - self:ResetParties() - collectgarbage() -end -local timer -function addon:RefreshMissions() - if OHFMissionPage:IsVisible() then - module:PostMissionClick(OHFMissionPage) - else - if timer then self:CancelTimer(timer) end - timer=self:ScheduleTimer("EffectiveRefresh",0.1) - end -end -function addon:EffectiveRefresh() - timer=nil - wipe(parties) - wipe(missionIDS) - OHFMissions:Update() -end -local function ToggleSet(this,value) - return addon:ToggleSet(this.flag,this.tipo,value) -end -local function ToggleGet(this) - return addon:ToggleGet(this.flag,this.tipo) - -end -local function PreToggleSet(this) - return ToggleSet(this,this:GetChecked()) -end -local pin -local close -local menu -local button -local function OpenMenu() - addon.db.profile.showmenu=true - button:Hide() - menu:Show() -end -local function CloseMenu() - addon.db.profile.showmenu=false - button:Show() - menu:Hide() -end -function module:Menu() - local previous - local factory=addon:GetFactory() - for _,v in pairs(addon:GetRegisteredForMenu("mission")) do - local flag,icon=strsplit(',',v) - local f=factory:Option(addon,menu,flag) - if type(f)=="table" and f.GetObjectType then - if flag=="MAXCHAMP" then f:SetStep(1) end - if previous then - f:SetPoint("TOPLEFT",previous,"BOTTOMLEFT",0,-10) - else - f:SetPoint("TOPLEFT",menu,"TOPLEFT",32,-30) - end - previous=f - end - end -end - -function module:InitialSetup(this) - if type(addon.db.global.warn01_seen)~="number" then addon.db.global.warn01_seen =0 end - if type(addon.db.global.warn02_seen)~="number" then addon.db.global.warn02_seen =0 end - if GetAddOnEnableState(UnitName("player"),"GarrisonCommander") > 0 then - if addon.db.global.warn02_seen < 3 then - addon.db.global.warn02_seen=addon.db.global.warn02_seen+1 - addon:Popup(L["OrderHallCommander overrides GarrisonCommander for Order Hall Management.\n You can revert to GarrisonCommander simply disabling OrderhallCommander.\nIf instead you like OrderHallCommander remember to add it to Curse client and keep it updated"],20) - end - end - menu=CreateFrame("Frame",nil,OHFMissionTab,"OHCMenu") - menu.Title:SetText(me .. ' ' .. addon.version) - menu.Title:SetTextColor(C:Yellow()) - close=menu.CloseButton - button=CreateFrame("Button",nil,OHFMissionTab,"OHCPin") - button.tooltip=L["Show/hide OrderHallCommander mission menu"] - close:SetScript("OnClick",CloseMenu) - button:SetScript("OnClick",OpenMenu) - button:GetNormalTexture():SetRotation(math.rad(270)) - button:GetHighlightTexture():SetRotation(math.rad(270)) - self:Menu() - if addon.db.profile.showmenu then OpenMenu() else CloseMenu() end - addon.MAXLEVEL=OHF.followerMaxLevel - addon.MAXQUALITY=OHF.followerMaxQuality - addon.MAXQLEVEL=addon.MAXLEVEL+addon.MAXQUALITY - self:Unhook(this,"OnShow") - self:SecureHookScript(this,"OnShow","MainOnShow") - self:SecureHookScript(this,"OnHide","MainOnHide") - OHF.FollowerStatusInfo=OHF:CreateFontString(nil,"OVERLAY","GameFontNormalSmall") - OHF.FollowerStatusInfo:SetPoint("TOPRIGHT",-45,-5) - OHF.FollowerStatusInfo:SetText("") - self:MainOnShow() -end -function module:MainOnShow() - self:Hook(OHFMissions,"Update","OnUpdate",true) - self:Hook(OHFMissions,"UpdateMissions","OnUpdateMissions",true) - self:SecureHook("GarrisonMissionButton_SetRewards","OnSingleUpdate") - --self:SecureHook(OHFMissions,"UpdateCombatAllyMission",function() pp("Called inside updatemissions") pp("\n",debugstack(1)) end) - self:OnUpdate() - addon:ApplySORTMISSION(addon:GetString("SORTMISSION")) - addon:RefreshFollowerStatus() - addon:ParseFollowers() -end -function module:MainOnHide() - self:Unhook(OHFMissions,"UpdateCombatAllyMission") - self:Unhook(OHFMissions,"UpdateMissions") - self:Unhook(OHFMissions,"Update") - self:Unhook("GarrisonMissionButton_SetRewards") - self:Unhook(OHFMissions,"OnUpdate") -end -function module:AdjustPosition(frame) - local mission=frame.info - frame.Title:ClearAllPoints() - if mission.isResult then - frame.Title:SetPoint("TOPLEFT",165,15) - elseif mission.inProgress then - frame.Title:SetPoint("TOPLEFT",165,-10) - else - frame.Title:SetPoint("TOPLEFT",165,-7) - end - if mission.isRare then - frame.Title:SetTextColor(frame.RareText:GetTextColor()) - else - frame.Title:SetTextColor(C:White()) - end - frame.RareText:Hide() - -- Compacting mission time and level - frame.RareText:Hide() - frame.Level:ClearAllPoints() - frame.MissionType:ClearAllPoints() - frame.ItemLevel:Hide() - frame.Level:SetPoint("LEFT",5,0) - frame.MissionType:SetPoint("LEFT",5,0) - if mission.isMaxLevel then - frame.Level:SetText(mission.iLevel) - else - frame.Level:SetText(mission.level) - end - local missionID=mission.missionID -end -function module:AdjustMissionButton(frame) - if not OHF:IsVisible() then return end - local mission=frame.info - local missionID=mission and mission.missionID - if not missionID then return end - missionIDS[frame]=missionID - -- Adding stats frame (expiration date and chance) - if not missionstats[frame] then - missionstats[frame]=CreateFrame("Frame",nil,frame,"OHCStats") ---@debug@ - self:RawHookScript(missionstats[frame],"OnEnter","MissionTip") ---@end-debug@ - end - local stats=missionstats[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))) - else - frame.Level:SetText(mission.level) - frame.Level:SetTextColor(addon:GetDifficultyColors(math.floor(aLevel/mission.level*100))) - end - if mission.inProgress then - stats:SetPoint("LEFT",48,14) - stats.Expire:Hide() - addon:GetCacheModule():SetMissionStatus(missionID,'inProgress') - else - stats.Expire:SetFormattedText("%s\n%s",GARRISON_MISSION_AVAILABILITY,mission.offerTimeRemaining) - stats.Expire:SetTextColor(addon:GetAgeColor(mission.offerEndTime)) - stats:SetPoint("LEFT",48,0) - stats.Expire:Show() - end - stats.Chance:Show() - if not missionmembers[frame] then - missionmembers[frame]=CreateFrame("Frame",nil,frame,"OHCMembers") - end - if not missionthreats[frame] then - missionthreats[frame]=CreateFrame("Frame",nil,frame,"OHCThreats") - end - self:AddMembers(frame) -end -function module:AddMembers(frame) - local start=GetTime() - local mission=frame.info - local nrewards=#mission.rewards - local missionID=mission and mission.missionID - local followers=mission.followers - local key - local party - if not key then - party,key=addon:GetSelectedParty(missionID,mission) - parties[missionID]=key ---@debug@ - print("Party recalculated",party) ---@end-debug@ - else ---@debug@ - print(key,"Party retrieved",party) ---@end-debug@ - party=addon:GetSelectedParty(missionID,key) - end - local members=missionmembers[frame] - members:SetNotReady() - local stats=missionstats[frame] - members:SetPoint("RIGHT",frame.Rewards[nrewards],"LEFT",-5,0) - for i=1,mission.numFollowers do - if party:Follower(i) then - members.Champions[i]:SetFollower(party:Follower(i),not mission.inProgress) - else - members.Champions[i]:SetEmpty() - end - members.Champions[i]:Show() - end - for i=mission.numFollowers+1,3 do - members.Champions[i]:Hide() - - end - - local perc=party.perc or 0 - if perc==0 then - stats.Chance:SetText("N/A") - else - stats.Chance:SetFormattedText(PERCENTAGE_STRING,perc) - end - stats.Chance:SetTextColor(addon:GetDifficultyColors(perc)) - - local threats=missionthreats[frame] - if frame.info.inProgress then - frame.Overlay:SetFrameLevel(20) - threats:Hide() - return - else - threats:Show() - end - threats:SetPoint("TOPLEFT",frame.Title,"BOTTOMLEFT",0,-5) - local enemies=addon:GetMissionData(missionID,'enemies') - if type(enemies)~="table" then - enemies=select(8,G.GetMissionInfo(missionID)) - end - local mechanics=new() - local counters=new() - local biases=new() - for _,enemy in pairs(enemies) do - if type(enemy.mechanics)=="table" then - for mechanicID,mechanic in pairs(enemy.mechanics) do - -- icon=enemy.mechanics[id].icon - mechanic.id=mechanicID - mechanic.bias=-1 - tinsert(mechanics,mechanic) - end - end - end - for _,followerID in party:IterateFollowers() do - if not G.GetFollowerIsTroop(followerID) then - local followerBias = G.GetFollowerBiasForMission(missionID,followerID) - tinsert(counters,("%04d,%s,%s,%f"):format(1000-(followerBias*100),followerID,G.GetFollowerName(followerID),followerBias)) - end - end - table.sort(counters) - for _,data in pairs(counters) do - local _,followerID,_,bias=strsplit(",",data) - local abilities=G.GetFollowerAbilities(followerID) - for _,ability in pairs(abilities) do - for counter,info in pairs(ability.counters) do - for _,mechanic in pairs(mechanics) do - if mechanic.id==counter and not biases[mechanic] then - biases[mechanic]=tonumber(bias) - break - end - end - end - end - end - local color="Yellow" - local baseCost, cost = party.baseCost ,party.cost - if cost<baseCost then - color="Green" - elseif cost>baseCost then - color="Red" - end - if frame.IsCustom or OHFMissions.showInProgress then - cost=-1 - end - if not threats:AddIconsAndCost(mechanics,biases,cost,color,cost > addon:GetResources()) then - addon:RefreshMissions() - end - del(mechanics) - del(counters) - del(biases) -end -function module:MissionTip(this) - local tip=GameTooltip - tip:SetOwner(this,"ANCHOR_CURSOR") - tip:AddLine(me) - tip:AddDoubleLine(addon:GetAverageLevels()) ---@debug@ - local info=this:GetParent().info - OrderHallCommanderMixin.DumpData(tip,info) - tip:AddLine("Followers") - for i,id in ipairs(info.followers) do - tip:AddDoubleLine(id,pcall(G.GetFollowerName,id)) - end - tip:AddLine("Rewards") - for i,d in pairs(info.rewards) do - tip:AddLine('['..i..']') - OrderHallCommanderMixin.DumpData(tip,info.rewards[i]) - end - tip:AddLine("OverRewards") - for i,d in pairs(info.overmaxRewards) do - tip:AddLine('['..i..']') - OrderHallCommanderMixin.DumpData(tip,info.overmaxRewards[i]) - end - tip:AddDoubleLine("MissionID",info.missionID) - local mission=addon:GetMissionData(info.missionID) - tip:AddDoubleLine("MissionClass",mission.missionClass) - tip:AddDoubleLine("MissionValue",mission.missionValue) - tip:AddDoubleLine("MissionSort",mission.missionSort) - ---@end-debug@ - tip:Show() -end -local bestTimes={} -local bestTimesIndex={} -local nobonusloot=G.GetFollowerAbilityDescription(471) -local increasedcost=G.GetFollowerAbilityDescription(472) -local increasedduration=G.GetFollowerAbilityDescription(428) -local killtroops=G.GetFollowerAbilityDescription(437) -function module:AdjustMissionTooltip(this,...) - local tip=GameTooltip - local missionID=this.info.missionID ---@debug@ - tip:AddDoubleLine("MissionID",missionID) ---@end-debug@ - if this.info.inProgress or this.info.completed then return end - if not this.info.isRare then - GameTooltip:AddLine(GARRISON_MISSION_AVAILABILITY); - GameTooltip:AddLine(this.info.offerTimeRemaining, 1, 1, 1); - end - local party=addon:GetParties(missionID) - local key=parties[missionID] - if party then - local candidate =party:GetSelectedParty(key) - if candidate then - if candidate.hasBonusLootNegativeEffect then - GameTooltip:AddLine(nobonusloot,C:Red()) - end - if candidate.hasKillTroopsEffect then - GameTooltip:AddLine(killtroops,C:Red()) - end - if candidate.hasResurrectTroopsEffect then - GameTooltip:AddLine(L["Resurrect troops effect"],C:Green()) - end - if candidate.cost > candidate.baseCost then - GameTooltip:AddLine(increasedcost,C:Red()) - end - if candidate.hasMissionTimeNegativeEffect then - GameTooltip:AddLine(increasedduration,C:Red()) - end - if candidate.timeImproved then - GameTooltip:AddLine(L["Duration reduced"],C:Green()) - end - -- Not important enough to be specifically shown - -- hasSuccessChanceNegativeEffect - -- hasUncounterableSuccessChanceNegativeEffect - end - end - -- Mostrare per ogni tempo di attesa solo la percentuale migliore - wipe(bestTimes) - wipe(bestTimesIndex) - key=key or "999999999999999999999" - if key then - for _,otherkey in party:IterateIndex() do - if otherkey < key then - local candidate=party:GetSelectedParty(otherkey) - local duration=math.max((candidate.busyUntil or 0)-GetTime(),0) - if duration > 0 then - if not bestTimes[duration] or bestTimes[duration] < candidate.perc then - bestTimes[duration]=candidate.perc - end - end - end - end - for t,p in pairs(bestTimes) do - tinsert(bestTimesIndex,t) - end - if #bestTimesIndex > 0 then - tip:AddLine(me) - tip:AddLine(L["Better parties available in next future"]) - table.sort(bestTimesIndex) - local bestChance=0 - for i=1,#bestTimesIndex do - local key=bestTimesIndex[i] - if bestTimes[key] > bestChance then - bestChance=bestTimes[key] - tip:AddDoubleLine(SecondsToTime(key),GARRISON_MISSION_PERCENT_CHANCE:format(bestChance),C.Orange.r,C.Orange.g,C.Orange.b,addon:GetDifficultyColors(bestChance)) - end - end - end ---@debug@ - tip:AddLine("-----------------------------------------------") - OrderHallCommanderMixin.DumpData(tip,addon:GetParties(this.info.missionID):GetSelectedParty(key)) ---@end-debug@ - end - tip:Show() - -end -function module:PostMissionClick(this,button) - local mission=this.info or this.missionInfo -- callable also from mission page ---@debug@ - addon:Print(button) - if button=="MiddleButton" then - addon:TestParty(mission.missionID) - return - end ---@end-debug@ - addon:GetMissionpageModule():FillMissionPage(mission,parties[mission.missionID]) -end -do - local s=setmetatable({},{__index=function(t,k) return 0 end}) - local FOLLOWER_STATUS_FORMAT= L["Followers status "] .. - C(AVAILABLE..':%d ','green') .. - C(GARRISON_FOLLOWER_COMBAT_ALLY .. ":%d ",'cyan') .. - C(GARRISON_FOLLOWER_ON_MISSION .. ":%d ",'red') .. - C(GARRISON_FOLLOWER_INACTIVE .. ":%d","silver") - function addon:RefreshFollowerStatus() - if not OHF:IsVisible() then return end - if empty(addon:GetFollowerData()) then return end - wipe(s) - for followerID,_ in pairs(addon:GetFollowerData()) do - local rc,status=pcall(G.GetFollowerStatus,followerID) -- Follower could have been exhasted and still present in cache - if rc then - status=status or AVAILABLE - s[status]=s[status]+1 - end - end - if (OHF.FollowerStatusInfo) then - OHF.FollowerStatusInfo:SetWidth(0) - OHF.FollowerStatusInfo:SetFormattedText( - FOLLOWER_STATUS_FORMAT, - s[AVAILABLE], - s[GARRISON_FOLLOWER_COMBAT_ALLY], - s[GARRISON_FOLLOWER_ON_MISSION], - s[GARRISON_FOLLOWER_INACTIVE] - ) - end - end - function addon:GetTotFollowers(status) - if not status then - return s[AVAILABLE]+ - s[GARRISON_FOLLOWER_WORKING]+ - s[GARRISON_FOLLOWER_ON_MISSION] - else - return s[status] or 0 - end - end -end - diff --git a/OrderHallCommander/missionpage.lua b/OrderHallCommander/missionpage.lua deleted file mode 100644 index 3c86c35..0000000 --- a/OrderHallCommander/missionpage.lua +++ /dev/null @@ -1,105 +0,0 @@ -local __FILE__=tostring(debugstack(1,2,0):match("(.*):1:")) -- Always check line number in regexp and file, must be 1 -local function pp(...) print(GetTime(),"|cff009900",__FILE__:sub(-15),strjoin(",",tostringall(...)),"|r") end ---*TYPE module ---*CONFIG noswitch=false,profile=true,enhancedProfile=true ---*MIXINS "AceHook-3.0","AceEvent-3.0","AceTimer-3.0" ---*MINOR 35 --- Generated on 20/01/2017 08:15:04 -local me,ns=... -local addon=ns --#Addon (to keep eclipse happy) -ns=nil -local module=addon:NewSubModule('Missionpage',"AceHook-3.0","AceEvent-3.0","AceTimer-3.0") --#Module -function addon:GetMissionpageModule() return module end --- Template -local G=C_Garrison -local _ -local AceGUI=LibStub("AceGUI-3.0") -local C=addon:GetColorTable() -local L=addon:GetLocale() -local new=addon.NewTable -local del=addon.DelTable -local kpairs=addon:GetKpairs() -local empty=addon:GetEmpty() -local OHF=OrderHallMissionFrame -local OHFMissionTab=OrderHallMissionFrame.MissionTab --Container for mission list and single mission -local OHFMissions=OrderHallMissionFrame.MissionTab.MissionList -- same as OrderHallMissionFrameMissions Call Update on this to refresh Mission Listing -local OHFFollowerTab=OrderHallMissionFrame.FollowerTab -- Contains model view -local OHFFollowerList=OrderHallMissionFrame.FollowerList -- Contains follower list (visible in both follower and mission mode) -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 followerType=LE_FOLLOWER_TYPE_GARRISON_7_0 -local garrisonType=LE_GARRISON_TYPE_7_0 -local FAKE_FOLLOWERID="0x0000000000000000" -local MAXLEVEL=110 - -local ShowTT=OrderHallCommanderMixin.ShowTT -local HideTT=OrderHallCommanderMixin.HideTT - -local dprint=print -local ddump ---@debug@ -LoadAddOn("Blizzard_DebugTools") -ddump=DevTools_Dump -LoadAddOn("LibDebug") - -if LibDebug then LibDebug() dprint=print end -local safeG=addon.safeG - ---@end-debug@ ---[===[@non-debug@ -dprint=function() end -ddump=function() end -local print=function() end ---@end-non-debug@]===] - --- End Template - DO NOT MODIFY ANYTHING BEFORE THIS LINE ---*BEGIN -local GARRISON_MISSION_AVAILABILITY2=C(GARRISON_MISSION_AVAILABILITY,'Yellow') .. " %s" -local GARRISON_MISSION_ID="MissionID: %d" -function module:FillMissionPage(missionInfo) - - if type(missionInfo)=="number" then missionInfo=addon:GetMissionData(missionInfo) end - if not missionInfo then return end - local missionType=missionInfo.followerTypeID - if not missionInfo.canStart then return end - local main=OHF - if not main then return end - local missionpage=main:GetMissionPage() - local stage=main.MissionTab.MissionPage.Stage - local model=stage.MissionInfo.MissionTime - if not stage.expires then - stage.expires=stage:CreateFontString() - stage.expires:SetFontObject(model:GetFontObject()) - stage.expires:SetDrawLayer(model:GetDrawLayer()) - end - stage.expires:SetFormattedText(GARRISON_MISSION_AVAILABILITY2,missionInfo.offerTimeRemaining or "") - stage.expires:SetTextColor(addon:GetAgeColor(missionInfo.offerEndTime)) - stage.expires:SetPoint("TOPLEFT",stage.MissionInfo,"BOTTOMLEFT") ---@debug@ - if not stage.missionid then - stage.missionid=stage:CreateFontString() - stage.missionid:SetFontObject(model:GetFontObject()) - stage.missionid:SetDrawLayer(model:GetDrawLayer()) - stage.missionid:SetPoint("TOPLEFT",stage.expires,"BOTTOMLEFT") - end - stage.missionid:SetFormattedText(GARRISON_MISSION_ID,missionInfo.missionID) ---@end-debug@ - if( IsControlKeyDown()) then self:Print("Ctrl key, ignoring mission prefill") return end - if (addon:GetBoolean("NOFILL")) then return end - self:FillParty(missionInfo.missionID) -end -function module:FillParty(missionID,key) - --addon:HoldEvents() - local main=OHF - main:ClearParty() - local party=addon:GetParties(missionID):GetSelectedParty(key) - local missionPage=main:GetMissionPage() - for i=1,#party do - local followerID=party:Follower(i) - if followerID then - missionPage:AddFollower(followerID) - end - end - --addon:ReleaseEvents() -end diff --git a/OrderHallCommander/widgets.lua b/OrderHallCommander/widgets.lua deleted file mode 100644 index c139662..0000000 --- a/OrderHallCommander/widgets.lua +++ /dev/null @@ -1,61 +0,0 @@ -local __FILE__=tostring(debugstack(1,2,0):match("(.*):1:")) -- Always check line number in regexp and file, must be 1 -local function pp(...) print(GetTime(),"|cff009900",__FILE__:sub(-15),strjoin(",",tostringall(...)),"|r") end ---*TYPE module ---*CONFIG noswitch=false,profile=true,enhancedProfile=true ---*MIXINS "AceHook-3.0","AceEvent-3.0","AceTimer-3.0" ---*MINOR 35 --- Generated on 20/01/2017 08:15:04 -local me,ns=... -local addon=ns --#Addon (to keep eclipse happy) -ns=nil -local module=addon:NewSubModule('Widgets',"AceHook-3.0","AceEvent-3.0","AceTimer-3.0") --#Module -function addon:GetWidgetsModule() return module end --- Template -local G=C_Garrison -local _ -local AceGUI=LibStub("AceGUI-3.0") -local C=addon:GetColorTable() -local L=addon:GetLocale() -local new=addon.NewTable -local del=addon.DelTable -local kpairs=addon:GetKpairs() -local empty=addon:GetEmpty() -local OHF=OrderHallMissionFrame -local OHFMissionTab=OrderHallMissionFrame.MissionTab --Container for mission list and single mission -local OHFMissions=OrderHallMissionFrame.MissionTab.MissionList -- same as OrderHallMissionFrameMissions Call Update on this to refresh Mission Listing -local OHFFollowerTab=OrderHallMissionFrame.FollowerTab -- Contains model view -local OHFFollowerList=OrderHallMissionFrame.FollowerList -- Contains follower list (visible in both follower and mission mode) -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 followerType=LE_FOLLOWER_TYPE_GARRISON_7_0 -local garrisonType=LE_GARRISON_TYPE_7_0 -local FAKE_FOLLOWERID="0x0000000000000000" -local MAXLEVEL=110 - -local ShowTT=OrderHallCommanderMixin.ShowTT -local HideTT=OrderHallCommanderMixin.HideTT - -local dprint=print -local ddump ---@debug@ -LoadAddOn("Blizzard_DebugTools") -ddump=DevTools_Dump -LoadAddOn("LibDebug") - -if LibDebug then LibDebug() dprint=print end -local safeG=addon.safeG - ---@end-debug@ ---[===[@non-debug@ -dprint=function() end -ddump=function() end -local print=function() end ---@end-non-debug@]===] - --- End Template - DO NOT MODIFY ANYTHING BEFORE THIS LINE ---*BEGIN - -function module:OnInitialized() - -end diff --git a/OrderHallCommander/widgets.xml b/OrderHallCommander/widgets.xml deleted file mode 100644 index 8ddee4b..0000000 --- a/OrderHallCommander/widgets.xml +++ /dev/null @@ -1,16 +0,0 @@ -<Ui xmlns="http://www.blizzard.com/wow/ui/"> - <Script file="widgets.lua"/> - <Script file="widgets/GUIContainer.lua"/> - <Script file="widgets/MissionsList.lua" /> - <Script file="widgets/MissionButton.lua" /> - <Script file="widgets/Reward.lua" /> - <Script file="widgets/Follower.lua" /> - <Frame name="OHCSpinner" inherits="LoadingSpinnerTemplate" virtual="true"> - <Scripts> - <OnLoad> - self.start=function(self) return self.Anim:Play() end - self.stop=function(self) return self.Anim:Stop() end - </OnLoad> - </Scripts> - </Frame> -</Ui> \ No newline at end of file diff --git a/OrderHallCommander/wowhead.lua b/OrderHallCommander/wowhead.lua deleted file mode 100644 index ec74e31..0000000 --- a/OrderHallCommander/wowhead.lua +++ /dev/null @@ -1,3 +0,0 @@ -local me,ns = ... - -ns.wowhead_update=1478642523