Commit a55ea6aa authored by TOM_RUS's avatar TOM_RUS

WOW-36599patch9.0.2_Beta

parent c5903bda
......@@ -258,6 +258,20 @@ local Item =
{ Name = "stackCount", Type = "number", Nilable = false },
},
},
{
Name = "IsAnimaItemByID",
Type = "Function",
Arguments =
{
{ Name = "itemInfo", Type = "string", Nilable = false },
},
Returns =
{
{ Name = "isAnimaItem", Type = "bool", Nilable = false },
},
},
{
Name = "IsBound",
Type = "Function",
......
......@@ -250,6 +250,7 @@ function PVPUIFrame_ConfigureRewardFrame(rewardFrame, honor, experience, itemRew
rewardQuantity = reward.quantity;
elseif reward.id == Constants.CurrencyConsts.CONQUEST_CURRENCY_ID then
rewardFrame.conquestAmount = reward.quantity;
rewardTexture = rewardTexture or texture;
end
end
end
......@@ -264,7 +265,18 @@ function PVPUIFrame_ConfigureRewardFrame(rewardFrame, honor, experience, itemRew
end
end
if currencyID or itemID or honor > 0 or experience > 0 then
if not rewardTexture then
if honor > 0 then
local currencyInfo = C_CurrencyInfo.GetBasicCurrencyInfo(Constants.CurrencyConsts.HONOR_CURRENCY_ID, honor);
if currencyInfo then
rewardTexture = currencyInfo.icon;
end
elseif experience > 0 then
rewardTexture = "Interface\\Icons\\xp_icon"
end
end
if rewardTexture then
SetPortraitToTexture(rewardFrame.Icon, rewardTexture);
rewardFrame.honor = honor;
rewardFrame.experience = experience;
......
......@@ -213,7 +213,7 @@ function WorldQuestDataProviderMixin:RefreshAllData(fromOnShow)
local mapID = mapCanvas:GetMapID();
if (mapID) then
taskInfo = C_TaskQuest.GetQuestsForPlayerByMapID(mapID);
self.matchWorldMapFilters = MapUtil.MapHasEmissaries(mapID);
self.matchWorldMapFilters = MapUtil.MapShouldShowWorldQuestFilters(mapID);
end
if taskInfo then
......
......@@ -94,7 +94,8 @@ function WorldMapTrackingOptionsButtonMixin:OnSelection(value, checked)
SetCVar(value, checked and "1" or "0");
elseif (value == "worldQuestFilterResources" or value == "worldQuestFilterArtifactPower" or
value == "worldQuestFilterProfessionMaterials" or value == "worldQuestFilterGold" or
value == "worldQuestFilterEquipment" or value == "worldQuestFilterReputation") then
value == "worldQuestFilterEquipment" or value == "worldQuestFilterReputation" or
value == "worldQuestFilterAnima") then
-- World quest reward filter cvars
SetCVar(value, checked and "1" or "0");
end
......@@ -147,7 +148,7 @@ function WorldMapTrackingOptionsButtonMixin:InitializeDropDown()
-- If we aren't on a map which has emissaries don't show the world quest reward filter options.
local mapID = self:GetParent():GetMapID();
if not mapID or not MapUtil.MapHasEmissaries(mapID) then
if not mapID or not MapUtil.MapShouldShowWorldQuestFilters(mapID) then
return;
end
......@@ -181,15 +182,23 @@ function WorldMapTrackingOptionsButtonMixin:InitializeDropDown()
info.keepShownOnClick = true;
info.func = OnSelection;
info.text = WORLD_QUEST_REWARD_FILTERS_RESOURCES;
info.value = "worldQuestFilterResources";
info.checked = GetCVarBool("worldQuestFilterResources");
UIDropDownMenu_AddButton(info);
-- TODO:: Further adjustments to more cleanly determine filters per map and make this future-proof.
if MapUtil.IsShadowlandsZoneMap(mapID) then
info.text = WORLD_QUEST_REWARD_FILTERS_ANIMA;
info.value = "worldQuestFilterAnima";
info.checked = GetCVarBool("worldQuestFilterAnima");
UIDropDownMenu_AddButton(info);
else
info.text = WORLD_QUEST_REWARD_FILTERS_RESOURCES;
info.value = "worldQuestFilterResources";
info.checked = GetCVarBool("worldQuestFilterResources");
UIDropDownMenu_AddButton(info);
info.text = WORLD_QUEST_REWARD_FILTERS_ARTIFACT_POWER;
info.value = "worldQuestFilterArtifactPower";
info.checked = GetCVarBool("worldQuestFilterArtifactPower");
UIDropDownMenu_AddButton(info);
info.text = WORLD_QUEST_REWARD_FILTERS_ARTIFACT_POWER;
info.value = "worldQuestFilterArtifactPower";
info.checked = GetCVarBool("worldQuestFilterArtifactPower");
UIDropDownMenu_AddButton(info);
end
info.text = WORLD_QUEST_REWARD_FILTERS_PROFESSION_MATERIALS;
info.value = "worldQuestFilterProfessionMaterials";
......
......@@ -2136,7 +2136,7 @@ SlashCmdList["FRIENDS"] = function(msg)
end
if not msg or msg == "" then
ToggleFriendsPanel();
else
else
local player, note = strmatch(msg, "%s*([^%s]+)%s*(.*)");
if player then
C_FriendList.AddOrRemoveFriend(player, note);
......@@ -2934,6 +2934,30 @@ function ChatFrame_AddChannel(chatFrame, channel)
return channelIndex;
end
local function ChatFrame_CheckAddChannel(chatFrame, eventType, channelID)
-- This is called in the event that a user receives chat events for a channel that isn't enabled for any chat frames.
-- Minor hack, because chat channel filtering is backed by the client, but driven entirely from Lua.
-- This solves the issue of Guides abdicating their status, and then re-applying in the same game session, unless ChatFrame_AddChannel
-- is called, the channel filter will be off even though it's still enabled in the client, since abdication removes the chat channel and its config.
-- Only add to default (since multiple chat frames receive the event and we don't want to add to others)
if chatFrame ~= DEFAULT_CHAT_FRAME then
return false;
end
-- Only add if the user is joining a channel
if eventType ~= "YOU_CHANGED" then
return false;
end
-- Only add regional channels
if not C_ChatInfo.IsChannelRegionalForChannelID(channelID) then
return false;
end
return ChatFrame_AddChannel(chatFrame, C_ChatInfo.GetChannelShortcutForChannelID(channelID)) ~= nil;
end
function ChatFrame_GetCommunitiesChannelLocalID(clubId, streamId)
local channelName = Chat_GetCommunitiesChannelName(clubId, streamId);
local localID = GetChannelName(channelName);
......@@ -3126,17 +3150,12 @@ function ChatFrame_ConfigEventHandler(self, event, ...)
local isInitialLogin, isUIReload = ...;
if isInitialLogin then
C_Timer.After(3, ChatFrame_CheckShowNewcomerGraduation);
self:RegisterEvent("ZONE_CHANGED_NEW_AREA");
end
end
self.chatLevelUP = {};
LevelUpDisplay_InitPlayerStates(self.chatLevelUP);
return true;
elseif ( event == "ZONE_CHANGED_NEW_AREA" ) then
ChatFrame_CheckRemoveNewcomerChannel();
self:UnregisterEvent("ZONE_CHANGED_NEW_AREA");
return true;
elseif ( event == "NEUTRAL_FACTION_SELECT_RESULT" ) then
self.defaultLanguage = GetDefaultLanguage();
......@@ -3446,12 +3465,6 @@ function ChatFrame_CheckShowNewcomerGraduation(isFromGraduationEvent)
end
end
function ChatFrame_CheckRemoveNewcomerChannel()
if not IsActivePlayerNewcomer() and not IsActivePlayerMentor() then
LeaveChannelByName(C_ChatInfo.GetChannelShortcutForChannelID(C_ChatInfo.GetMentorChannelID()));
end
end
function ChatFrame_MessageEventHandler(self, event, ...)
if ( strsub(event, 1, 8) == "CHAT_MSG" ) then
local arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17 = ...;
......@@ -3511,9 +3524,8 @@ function ChatFrame_MessageEventHandler(self, event, ...)
end
end
if not found or not info then
if arg1 == "YOU_CHANGED" and C_ChatInfo.IsChannelRegional(arg8) then
ChatFrame_AddChannel(self, C_ChatInfo.GetChannelShortcutForChannelID(arg7));
else
local eventType, channelID = arg1, arg7;
if not ChatFrame_CheckAddChannel(self, eventType, channelID) then
return true;
end
end
......
......@@ -935,8 +935,9 @@ KEY_PADBACK_REV = "GamePad -";
-- "Shapes" label style specializations
KEY_PAD1_SHP = "GamePad X";
KEY_PAD2_SHP = "GamePad O";
KEY_PAD3_SHP = "GamePad S";
KEY_PAD4_SHP = "GamePad T";
KEY_PAD3_SHP = "GamePad Square";
KEY_PAD4_SHP = "GamePad Triangle";
KEY_PAD5_SHP = "GamePad Mute";
KEY_PADLSTICK_SHP = "GamePad L3";
KEY_PADRSTICK_SHP = "GamePad R3";
KEY_PADLSHOULDER_SHP = "GamePad L1";
......
local SHADOWLANDS_CONTINENT_MAP_ID = 1550;
local ORIBOS_UI_MAP_IDS = { 1670, 1671, 1672, 1673 };
MapUtil = {};
function MapUtil.IsMapTypeZone(mapID)
......@@ -97,3 +101,37 @@ function MapUtil.GetMapCenterOnMap(mapID, topMapID)
local centerY = top + (bottom - top) * .5;
return centerX, centerY;
end
function MapUtil.IsChildMap(mapID, ancestorMapID)
local mapInfo = C_Map.GetMapInfo(mapID);
while (mapInfo ~= nil) and (mapInfo.parentMapID ~= nil) do
if mapInfo.parentMapID == ancestorMapID then
return true;
end
mapInfo = C_Map.GetMapInfo(mapInfo.parentMapID);
end
return false;
end
function MapUtil.IsOribosMap(mapID)
return tContains(ORIBOS_UI_MAP_IDS, mapID);
end
function MapUtil.IsShadowlandsZoneMap(mapID)
if mapID == SHADOWLANDS_CONTINENT_MAP_ID or MapUtil.IsOribosMap(mapID) then
return true;
end
local mapInfo = C_Map.GetMapInfo(mapID);
if (mapInfo.mapType ~= Enum.UIMapType.Zone) and (mapInfo.mapType ~= Enum.UIMapType.Continent) then
return false;
end
return MapUtil.IsChildMap(mapID, SHADOWLANDS_CONTINENT_MAP_ID);
end
function MapUtil.MapShouldShowWorldQuestFilters(mapID)
return MapUtil.MapHasEmissaries(mapID) or MapUtil.IsShadowlandsZoneMap(mapID);
end
......@@ -12,6 +12,7 @@ WORLD_QUEST_REWARD_TYPE_FLAG_ARTIFACT_POWER = 0x0004;
WORLD_QUEST_REWARD_TYPE_FLAG_MATERIALS = 0x0008;
WORLD_QUEST_REWARD_TYPE_FLAG_EQUIPMENT = 0x0010;
WORLD_QUEST_REWARD_TYPE_FLAG_REPUTATION = 0x0020;
WORLD_QUEST_REWARD_TYPE_FLAG_ANIMA = 0x0040;
function WorldMap_GetWorldQuestRewardType(questID)
if ( not HaveQuestRewardData(questID) ) then
C_TaskQuest.RequestPreloadRewardData(questID);
......@@ -54,6 +55,10 @@ function WorldMap_GetWorldQuestRewardType(questID)
if ( classID == LE_ITEM_CLASS_TRADEGOODS ) then
worldQuestRewardType = bit.bor(worldQuestRewardType, WORLD_QUEST_REWARD_TYPE_FLAG_MATERIALS);
end
if ( C_Item.IsAnimaItemByID(itemID) ) then
worldQuestRewardType = bit.bor(worldQuestRewardType, WORLD_QUEST_REWARD_TYPE_FLAG_ANIMA);
end
end
end
......@@ -103,6 +108,8 @@ function WorldMap_DoesWorldQuestInfoPassFilters(info, ignoreTypeFilters)
typeMatchesFilters = true;
elseif ( GetCVarBool("worldQuestFilterReputation") and bit.band(worldQuestRewardType, WORLD_QUEST_REWARD_TYPE_FLAG_REPUTATION) ~= 0 ) then
typeMatchesFilters = true;
elseif ( GetCVarBool("worldQuestFilterAnima") and bit.band(worldQuestRewardType, WORLD_QUEST_REWARD_TYPE_FLAG_ANIMA) ~= 0 ) then
typeMatchesFilters = true;
end
-- We always want to show quests that do not fit any of the enumerated reward types.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment