와우 애드온 개발자를 위한 8.0 API 변경 사항
WoW 사용자 인터페이스 팀은 격전의 아제로 출시와 함께 향후 애드온 개발자에게 영향을 줄 수 있는 몇 가지 변경 사항을 알리고자 합니다. 이러한 변경 사항 중 상당수는 이미 베타 영역에서 진행되고 있으며 일부는 BFA 사전 패치가 있기 전까지는 적용되지 않을 예정입니다.
애드온 개발자가 아니라면 이 글을 무시하셔도 좋습니다.
출처: https://us.battle.net/forums/en/wow/topic/20762318007
*** 전투 로그 이벤트 변경 ***
COMBAT_LOG_EVENT 및 COMBAT_LOG_EVENT_UNFILTERED 이벤트에는 더 이상 이벤트 페이로드가 없습니다. 이러한 이벤트로 이전에 전달된 정보를 얻으려면 CombatLogGetCurrentEventInfo 함수를 사용하십시오.
*** 주문 시스템 API 변경 ***
백엔드 변경으로 Spell System API 및 이벤트에는 몇 가지 주요 변경 사항이 있습니다. 주문 API 또는 이벤트를 사용하는 경우 다음을 읽으십시오.
주문 이름을 제외한 주문 문자열 부분 (주문 설명 등)은 요청 시 로드될 것입니다. 이는 아래 함수에 영향을 미칩니다.
Function Name -- Return value affected
GetActiveArtifactByRace -- #5 (spell description)
GetArtifactInfoByRace -- #5 (spell description)
GetRecipeDescription -- #1(spell description)
GetSelectedArtifactInfo -- #5 (spell description)
GetSpellBookItemName -- #2 (spell name subtext)
GetSpellDescription -- #1 (spell description)
GetTrainerServiceAbilityReq -- #1(spell name subtext)
GetTrainerServiceDescription -- #1 (spell description)
이러한 함수를 호출하면 함수 호출시 데이터를 사용할 수 없기 때문에 나열된 반환 값이 nil이거나 비어있을 수 있습니다. 우리는 Lua (SpellMixin) 에서 데이터를 사용할 수 있을 때까지 호출을 지연시키는 인터페이스를 제공합니다. 이 인터페이스를 사용하면 빈 데이터를 반환하지 않고 이전 목록의 함수를 호출 할 수 있습니다.
local spell = Spell:CreateFromSpellID(spellID);
spell:ContinueOnSpellLoad(function()
spellButton:SetText(GetSpellDescription(spell:GetSpellID());
end);
주문 문자열을 읽어오고 사용 가능한 경우 SetText 호출이 즉시 수행됩니다. 그렇지 않은 경우 데이터가 로드 될 때까지 호출을 지연시킵니다.
요청을 취소하려면 아래 Lua를 이용하세요.
local spell = Spell:CreateFromSpellID(spellID);
local spellDataLoadedCancelFunc = spell:ContinueWithCancelOnSpellLoad(function()
button:SetText(GetSpellDescription(spell:GetSpellID());
end);
요청을 취소 할 준비가 되면 취소 기능을 호출하십시오.
if spellDataLoadedCancelFunc then
spellDataLoadedCancelFunc();
spellDataLoadedCancelFunc = nil; -- for safety!
end
ContinueOnSpellLoad 함수 외에도 SpellMixin은 다양한 주문 문자열 필드를 쿼리하기 위해 다음과 같은 멤버 함수를 제공합니다.
GetSpellID() The Spell ID associated with this SpellMixin.
GetSpellName() The spell’s name.
GetSpellSubtext() The spell’s name subtext (often the spell rank).
GetSpellDescription() The spell’s description.
이전 예제와 같이 캡처 된 함수 본문에서 이러한 함수를 호출해야 합니다. 다음은 이러한 함수를 사용하여 단순화 된 첫 번째 예제입니다.
local spell = Spell:CreateFromSpellID(spellID);
spell:ContinueOnSpellLoad(function()
spellButton:SetText(spell:GetSpellDescription());
end);
*** 함수 변경 사항 ***
대부분 몇몇 인자를 제거합니다. 따라서 해당 함수를 이용한다면 반드시 호출 인자를 수정하시기 바랍니다.
• GetSpellInfo - second parameter used to return Spell.nameSubtext -- now returns nil.
• GetTrainerServiceInfo - dropped second parameter (nameSubtext).
• GetShapeshiftFormInfo - dropped second parameter (name).
• GetMacroSpell - dropped first two parameters (name, and nameSubtext).
• GetPetActionInfo - dropped second parameter (nameSubtext).
• GetPossessInfo - second parameter changed from spell name to spell ID.
• CancelUnitBuff - no longer supports canceling by spell name.
• UnitBuff - dropped second parameter (nameSubtext). Also, no longer supports querying by spell name.
• UnitDebuff - dropped second parameter (nameSubtext). Also, no longer supports querying by spell name.
• UnitAura - dropped second parameter (nameSubtext). Also, no longer supports querying by spell name.
• UnitCastingInfo - dropped second parameter (nameSubtext).
• UnitChannelInfo - dropped second parameter (nameSubtext).
• GameTooltip:GetSpell - dropped second parameter (nameSubtext).
• GetAuraInfo - no longer supports querying by spell name.
• GetItemSpell - dropped second parameter (nameSubtext).
• GetSpellLink - no longer returns trade skill link as second parameter (see GetSpellTradeSkillLink below).
*** 함수 삭제 ***
• FindSpellOverrideNameByName
• FindBaseSpellNameByName
• SearchGuildRecipes
*** 함수 추가 ***
• CancelPetPossess
• FindSpellOverrideByID
• FindBaseSpellByID
• DoesSpellExist
• GetSpellTradeSkillLink
• GetSpellSubtext
*** 이벤트 변경 사항 ***
• UNIT_SPELLCAST_SUCCEEDED - no longer provide spell name and rank.
• UNIT_SPELLCAST_FAILED_QUIET - no longer provide spell name and rank.
• UNIT_SPELLCAST_INTERRUPTED - no longer provide spell name and rank.
• UNIT_SPELLCAST_START - no longer provide spell name and rank.
• UNIT_SPELLCAST_FAILED - no longer provide spell name and rank.
• UNIT_SPELLCAST_STOP - no longer provide spell name and rank.
• UNIT_SPELLCAST_DELAYED - no longer provide spell name and rank.
• UNIT_SPELLCAST_CHANNEL_START - no longer provide spell name and rank.
• UNIT_SPELLCAST_CHANNEL_UPDATE - no longer provide spell name and rank.
• UNIT_SPELLCAST_CHANNEL_STOP - no longer provide spell name and rank.
*** 세계 지도 변경 사항 ***
지도는 거의 완전히 재작성되었으며 모든 맵 API가 제거되었습니다. 이미 대체한 것도 있지만, 현재 전환 중인 함수도 있습니다. worldMapAreaID, dungeonMapID, dungeonFloor가 모두 제거되고 uiMapID로 바뀝니다. AddOns/Blizzard_Deprecated/ UIMapIDToWorldMapAreaID.lua에서 이전 데이터와 새 데이터 간의 매핑을 포함하였고, 신형 데이터로 쉽게 변환 할 수 있습니다.
*** 이벤트 문서 ***
함수 및 테이블 API 문서 외에도 모든 이벤트와 해당 페이로드가 문서화되었습니다. /api 명령을 사용하여 게임 내에서 이벤트 설명을 볼 수 있습니다. 바이너리 파일은 /AddOns/Blizzard_APIDocumentation에서 찾을 수 있습니다. 이들은 기존 'ExportInterfaceFiles code'명령을 통해 내보내집니다.
UI 위젯이 WorldStateFrame을 대체합니다.
UI 위젯은 앞으로 진행될 다양한 UI 작업을 처리 할 수 있는 새로운 시스템입니다. 결과적으로 WorldStateFrame은 더 이상 필요하지 않으며 완전히 사라질 것입니다. WorldState 이벤트는 계속 유지되므로 해당 이벤트는 걱정할 필요가 없습니다.
새로운 이벤트와 UI 위젯 시스템 API 함수가 있습니다. 문서 폴더의 UIWidgetManagerDocumentation.lua를 참조하십시오. 자세한 내용은 AddOnsBlizzard_UIWidgets 폴더의 lua와 xml 파일을 참조하십시오.
*** 음성 채팅 ***
새로운 음성 대화 시스템이 현재 가동 중입니다! 음성 채팅 API에 대한 문서는 위에 나열된 일반 문서 폴더에 있습니다.
VoiceActivityManager는 음성 채팅하는 사람이 말하기 시작할 때 알림 프레임 생성을 등록할 수 있게 해주는 Lua 시스템입니다. 이 목적으로 RegisterFrameForVoiceActivityNotifications 및 UnregisterFrameForVoiceActivityNotifications 메서드를 사용할 수 있습니다.
*** Pool Collections ***
PoolCollections are a new Lua-side system that allows you to register multiple pools for creating frames using different templates and/or frame types and not have to keep a Pool around for each one. It works in much the same way that Pools do, you just need to make sure that you call CreatePool before you attempt to create an object of a particular type. Here is an example of how you might use PoolCollections:
-- First create the PoolCollection and call CreatePool for every template type you will be creating
self.myPools = CreatePoolCollection();
self.myPools:CreatePool("FRAME", parent, "FrameTemplateA");
self.myPools:CreatePool("FRAME", parent, " FrameTemplateB");
self.myPools:CreatePool("BUTTON", parent, "ButtonTemplateA");
self.myPools:CreatePool("BUTTON ", parent, " ButtonTemplateB");
-- Then creating any of those templates is as easy as calling Acquire on the PoolCollection
local frame1 = self.myPools:Acquire("FrameTemplateA");
local frame2 = self.myPools:Acquire("FrameTemplateB");
local frame3 = self.myPools:Acquire("FrameTemplateB");
local button1 = self.myPools:Acquire("ButtonTemplateB");
local button2 = self.myPools:Acquire("ButtonTemplateA");
-- And when you are done with the frames, you can release them one by one or use ReleaseAll
self.myPools:Release(frame3);
self.myPools:ReleaseAll();
*** Texture object API 변경 사항 ***
• The SetRotation(radians) function now rotates the textures vertices instead of modifying the texture cords
• GetRotation 함수가 추가되었습니다.
• Rotation을 설정하면 더 이상 SetTexCoord에 의해 설정된 텍스처 좌표가 없어지지 않습니다.
• 구형 API와 다르게, rotations은 Anchor 변경 사항 전체에서 지속됩니다.
• XML로 작성된 텍스처는 특정한 각도로 지정된 "rotation"속성을 순환하여 초기화될 수 있습니다.
*** Frame API 기타 변경 사항 ***
• 새로 추가 된 SetScale, GetScale 및 GetEffectiveScale 함수를 사용하여 Texture, FontString 및 Line의 크기를 직접 조정할 수 있습니다.
• 모델 XML 속성 "scale"은 이제 "modelScale"로 호출됩니다.
*** 기타 변경 사항 ***
• 알 수 없는 이벤트를 등록 또는 등록 취소하려고 시도하면 Lua 오류가 발생합니다
• anchor 처리 성능을 향상 시켰습니다.
• anchor 처리가 유효한 rect를 해결하지 못할 가능성이 적습니다.
• xpcall은 이제 pcall과 같은 인수를 허용합니다.
• 경고 시스템이 정비되어 UI에 여러 경고 영역이 포함될 수 있습니다. 또한 경고에 사용할 ContainedAlertFrame이라는 새로운 내장 유형을 추가했습니다.
• 이제 Context Menu에 사용자 정의 프레임이 포함될 수 있습니다.
• GetItemInfo는 이제 플레이어의 판매 가격을 고려합니다.