режим предателя + UI референсы и DragonUI

This commit is contained in:
2026-04-09 02:05:29 +04:00
parent 1109d19bb5
commit e8f1ae4ab9
397 changed files with 202750 additions and 37 deletions
@@ -0,0 +1,181 @@
local ListOfGMs = {};
function GMChatFrame_IsGM(playerName)
return ListOfGMs[strlower(playerName)];
end
function GMChatFrame_OnLoad(self)
local name = self:GetName();
for index, value in pairs(CHAT_FRAME_TEXTURES) do
local object = _G[name..value];
local objectType = object:GetObjectType();
if ( objectType == "Button" ) then
object:GetNormalTexture():SetVertexColor(0, 0, 0);
object:GetHighlightTexture():SetVertexColor(0, 0, 0);
object:GetPushedTexture():SetVertexColor(0, 0, 0);
elseif ( objectType == "Texture" ) then
_G[name..value]:SetVertexColor(0,0,0);
else
--error("Unhandled object type");
end
object:SetAlpha(0.4);
end
self:RegisterEvent("CHAT_MSG_WHISPER");
self:RegisterEvent("CHAT_MSG_WHISPER_INFORM");
self:RegisterEvent("UPDATE_CHAT_COLOR");
self:RegisterEvent("UPDATE_CHAT_WINDOWS");
self.flashTimer = 0;
self.lastGM = {};
GMChatOpenLog:Enable();
self:SetClampRectInsets(-35, 0, 30, 0);
self:SetFont(DEFAULT_CHAT_FRAME:GetFont());
end
function GMChatFrame_OnEvent(self, event, ...)
local arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8 = ...;
if ( event == "CHAT_MSG_WHISPER" and arg6 == "GM" ) then
local info = ChatTypeInfo["WHISPER"];
local pflag = "|TInterface\\ChatFrame\\UI-ChatIcon-Blizz.blp:0:2:0:-3|t ";
-- Search for icon links and replace them with texture links.
local term;
for tag in string.gmatch(arg1, "%b{}") do
term = strlower(string.gsub(tag, "[{}]", ""));
if ( ICON_TAG_LIST[term] and ICON_LIST[ICON_TAG_LIST[term]] ) then
arg1 = string.gsub(arg1, tag, ICON_LIST[ICON_TAG_LIST[term]] .. "0|t");
end
end
local body = format(CHAT_WHISPER_GET, pflag.."|HplayerGM:"..arg2..":"..arg11.."|h".."["..arg2.."]".."|h")..arg1;
ListOfGMs[strlower(arg2)] = true;
self:AddMessage(body, info.r, info.g, info.b, info.id);
if ( self.lastGMForCVar ~= arg2 and GMChatFrame:IsShown() ) then
SetCVar("lastTalkedToGM", arg2);
end
self.lastGMForCVar = arg2;
if ( not GMChatFrame:IsShown() ) then
GMChatStatusFrame:Show();
GMChatStatusFrame_Pulse();
table.insert(self.lastGM,arg2);
PlaySound("GM_ChatWarning");
DEFAULT_CHAT_FRAME:AddMessage(pflag.."|HGMChat|h["..GM_CHAT_STATUS_READY_DESCRIPTION.."]|h", info.r, info.g, info.b, info.id);
DEFAULT_CHAT_FRAME:SetHyperlinksEnabled(true);
DEFAULT_CHAT_FRAME.overrideHyperlinksEnabled = true;
SetButtonPulse(HelpMicroButton, 3600, 1.0);
SetButtonPulse(GMChatOpenLog, 3600, 1.0);
else
ChatEdit_SetLastTellTarget(arg2);
end
elseif ( event == "CHAT_MSG_WHISPER_INFORM" and GMChatFrame_IsGM(arg2) ) then
local info = ChatTypeInfo["WHISPER_INFORM"];
local pflag = "|TInterface\\ChatFrame\\UI-ChatIcon-Blizz.blp:0:2:0:-3|t ";
-- Search for icon links and replace them with texture links.
local term;
for tag in string.gmatch(arg1, "%b{}") do
term = strlower(string.gsub(tag, "[{}]", ""));
if ( ICON_TAG_LIST[term] and ICON_LIST[ICON_TAG_LIST[term]] ) then
arg1 = string.gsub(arg1, tag, ICON_LIST[ICON_TAG_LIST[term]] .. "0|t");
end
end
local body = format(CHAT_WHISPER_INFORM_GET, pflag.."|HplayerGM:"..arg2..":"..arg11.."|h".."["..arg2.."]".."|h")..arg1;
self:AddMessage(body, info.r, info.g, info.b, info.id);
elseif ( event == "UPDATE_CHAT_COLOR" ) then
local arg1, arg2, arg3, arg4 = ...
local info = ChatTypeInfo[strupper(arg1)];
if ( info ) then
info.r = arg2;
info.g = arg3;
info.b = arg4;
self:UpdateColorByID(info.id, info.r, info.g, info.b);
if ( strupper(arg1) == "WHISPER" ) then
info = ChatTypeInfo["REPLY"];
if ( info ) then
info.r = arg2;
info.g = arg3;
info.b = arg4;
self:UpdateColorByID(info.id, info.r, info.g, info.b);
end
end
end
elseif ( event == "UPDATE_CHAT_WINDOWS" ) then
local _, fontSize= FCF_GetChatWindowInfo(1);
if ( fontSize > 0 ) then
local fontFile, unused, fontFlags = DEFAULT_CHAT_FRAME:GetFont();
self:SetFont(fontFile, fontSize, fontFlags);
end
end
end
function GMChatFrame_OnShow(self)
GMChatStatusFrame:Hide();
GMChatOpenLog:Disable();
for _,gmName in ipairs(self.lastGM) do
ChatEdit_SetLastTellTarget(gmName);
end
table.wipe(self.lastGM);
if ( self.lastGMForCVar ) then
SetCVar("lastTalkedToGM", self.lastGMForCVar);
end
SetButtonPulse(HelpMicroButton, 0, 1); --Stop the buttons from pulsing.
SetButtonPulse(GMChatOpenLog, 0, 1);
self:SetScript("OnUpdate", GMChatFrame_OnUpdate);
end
function GMChatFrame_OnHide(self)
GMChatOpenLog:Enable();
SetCVar("lastTalkedToGM", "");
end
function GMChatFrame_OnUpdate(self, elapsed)
if ( DEFAULT_CHAT_FRAME.isUninteractable ) then
DEFAULT_CHAT_FRAME:SetHyperlinksEnabled(false);
end
DEFAULT_CHAT_FRAME.overrideHyperlinksEnabled = false;
self:SetScript("OnUpdate", nil);
end
function GMChatFrame_Show()
GMChatFrame:Show();
end
function GMChatFrame_Close()
GMChatFrame:Hide();
end
function GMChatStatusFrame_OnClick()
GMChatFrame_Show();
end
local function GMChatStatusFrame_PulseFunc(self, elapsed)
return abs(sin(elapsed*180*450--[[<--Number of times to pulse here]]));
end
local GMChatStatusFrame_PulseTable = {
totalTime = 900,
updateFunc = "SetAlpha",
getPosFunc = GMChatStatusFrame_PulseFunc,
}
function GMChatStatusFrame_Pulse()
local pulse = GMChatStatusFramePulse;
pulse:Show();
pulse:SetAlpha(0);
SetUpAnimation(pulse, GMChatStatusFrame_PulseTable, pulse.Hide);
end
@@ -0,0 +1,7 @@
## Interface: 30300
## Title: Blizzard_GMChatUI
## Secure: 1
## LoadOnDemand: 1
Blizzard_GMChatUI.lua
Blizzard_GMChatUI.xml
Localization.lua
@@ -0,0 +1,263 @@
<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">
<ScrollingMessageFrame name="GMChatFrame" hidden="true" inherits="FloatingChatFrameTemplate" clampedToScreen="true">
<Size>
<AbsDimension x="430" y="120"/>
</Size>
<Anchors>
<Anchor point="BOTTOMLEFT">
<Offset>
<AbsDimension x="32" y="395"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad function="GMChatFrame_OnLoad"/>
<OnEvent function="GMChatFrame_OnEvent"/>
<OnShow function="GMChatFrame_OnShow"/>
<OnHide function="GMChatFrame_OnHide"/>
</Scripts>
</ScrollingMessageFrame>
<Frame name="GMChatTab" frameStrata="LOW" parent="GMChatFrame">
<Anchors>
<Anchor point="BOTTOMLEFT" relativeTo="GMChatFrame" relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="0" y="3"/>
</Offset>
</Anchor>
<Anchor point="TOPRIGHT" relativeTo="GMChatFrame" relativePoint="TOPRIGHT">
<Offset>
<AbsDimension x="0" y="30"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture name="$parentLeft" file="Interface\Minimap\UI-Minimap-Border">
<Size>
<AbsDimension x="14" y="27"/>
</Size>
<Anchors>
<Anchor point="TOPLEFT"/>
</Anchors>
<TexCoords left="0.3164" right="0.371" top="0.0" bottom="0.07"/>
</Texture>
<Texture name="$parentRight" file="Interface\Minimap\UI-Minimap-Border">
<Size>
<AbsDimension x="14" y="27"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT"/>
</Anchors>
<TexCoords left="0.371" right="0.3164" top="0.0" bottom="0.07"/>
</Texture>
<Texture name="$parentMiddle" file="Interface\Minimap\UI-Minimap-Border">
<Anchors>
<Anchor point="BOTTOMLEFT" relativeTo="$parentLeft" relativePoint="BOTTOMRIGHT"/>
<Anchor point="TOPRIGHT" relativeTo="$parentRight" relativePoint="TOPLEFT"/>
</Anchors>
<TexCoords left="0.371" right="0.85156" top="0.0" bottom="0.07"/>
</Texture>
</Layer>
<Layer level="ARTWORK">
<FontString name="$parentText" inherits="GameFontNormalSmall" text="GM_CHAT" justifyH="LEFT">
<Size>
<AbsDimension x="200" y="8"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentLeft" relativePoint="RIGHT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<Frame name="$parentFlash" hidden="true">
<Size>
<AbsDimension x="5" y="32"/>
</Size>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentLeft">
<Offset>
<AbsDimension x="0" y="-7"/>
</Offset>
</Anchor>
<Anchor point="RIGHT" relativeTo="$parentRight">
<Offset>
<AbsDimension x="0" y="-7"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="BACKGROUND">
<Texture file="Interface\PaperDollInfoFrame\UI-Character-Tab-Highlight" alphaMode="ADD" setAllPoints="true"/>
</Layer>
</Layers>
</Frame>
</Frames>
<Scripts>
<OnLoad>
self:RegisterForDrag("LeftButton");
</OnLoad>
<OnLeave>
GameTooltip:Hide();
</OnLeave>
<OnDragStart>
GMChatFrame:StartMoving();
</OnDragStart>
<OnDragStop>
GMChatFrame:StopMovingOrSizing();
</OnDragStop>
</Scripts>
</Frame>
<Button name="$parentCloseButton" inherits="UIPanelCloseButton" parent="GMChatFrame" frameStrata="MEDIUM">
<Anchors>
<Anchor point="RIGHT" relativeTo="GMChatTab" relativePoint="RIGHT">
<Offset>
<AbsDimension x="-1" y="-2"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
self:SetFrameLevel(self:GetFrameLevel() + 40);
</OnLoad>
</Scripts>
</Button>
<Frame name="GMChatStatusFrame" toplevel="true" parent="UIParent" enableMouse="true" hidden="true" frameStrata="FULLSCREEN">
<Size>
<AbsDimension x="208" y="75"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT">
<Offset>
<AbsDimension x="-180" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Frames>
<!-- this frame helps us size a backdrop frame according to the size of the title and text
and prevents the backdrop frame from drawing on top of the text-->
<Frame setAllPoints="true">
<Layers>
<Layer level="ARTWORK">
<FontString name="GMChatStatusFrameTitleText" inherits="GameFontNormalSmall" justifyH="LEFT" text="GM_CHAT_STATUS_READY">
<Size x="168" y="0"/>
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="10" y="-8"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
<FontString name="GMChatStatusFrameDescription" inherits="GameFontHighlightSmall" justifyH="LEFT" text="GM_CHAT_STATUS_READY_DESCRIPTION">
<Size x="168" y="0"/>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="GMChatStatusFrameTitleText" relativePoint="BOTTOMLEFT">
<Offset>
<AbsDimension x="0" y="-2"/>
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
</Frame>
<Button enableMouse="true">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="GMChatStatusFrameTitleText">
<Offset x="-8" y="8"/>
</Anchor>
<Anchor point="BOTTOMRIGHT" relativeTo="GMChatStatusFrameDescription">
<Offset x="30" y="-8"/> <!-- width added to accomodate the status button -->
</Anchor>
</Anchors>
<Backdrop bgFile="Interface\Tooltips\UI-Tooltip-Background" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
<EdgeSize>
<AbsValue val="16"/>
</EdgeSize>
<TileSize>
<AbsValue val="16"/>
</TileSize>
<BackgroundInsets>
<AbsInset left="5" right="5" top="5" bottom="5"/>
</BackgroundInsets>
</Backdrop>
<Layers>
<Layer level="BACKGROUND">
<Texture name="GMChatStatusFramePulse" file="Interface\GMChatFrame\UI-GMStatusFrame-Pulse" hidden="true">
<Anchors>
<Anchor point="TOPLEFT">
<Offset>
<AbsDimension x="-24" y="18"/>
</Offset>
</Anchor>
<Anchor point="BOTTOMRIGHT">
<Offset>
<AbsDimension x="24" y="-18"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnLoad>
self:SetBackdropBorderColor(TOOLTIP_DEFAULT_COLOR.r, TOOLTIP_DEFAULT_COLOR.g, TOOLTIP_DEFAULT_COLOR.b);
self:SetBackdropColor(TOOLTIP_DEFAULT_BACKGROUND_COLOR.r, TOOLTIP_DEFAULT_BACKGROUND_COLOR.g, TOOLTIP_DEFAULT_BACKGROUND_COLOR.b);
</OnLoad>
<OnClick>
GMChatStatusFrame_OnClick();
</OnClick>
</Scripts>
</Button>
<Button name="$parentButton">
<Size>
<AbsDimension x="32" y="16"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT">
<Offset>
<AbsDimension x="-5" y="-6"/>
</Offset>
</Anchor>
</Anchors>
<Layers>
<Layer level="ARTWORK">
<Texture file="Interface\ChatFrame\UI-ChatIcon-Blizz">
<Size>
<AbsDimension x="32" y="16"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
</Texture>
</Layer>
</Layers>
<Scripts>
<OnClick>
GMChatStatusFrame_OnClick();
</OnClick>
</Scripts>
</Button>
</Frames>
<Scripts>
<OnShow>
GetGMTicket();
TemporaryEnchantFrame:SetPoint("TOPRIGHT", self:GetParent(), "TOPRIGHT", -205, (-self:GetHeight()));
</OnShow>
<OnHide>
GetGMTicket();
TemporaryEnchantFrame:SetPoint("TOPRIGHT", "UIParent", "TOPRIGHT", -180, -13);
</OnHide>
</Scripts>
</Frame>
</Ui>
@@ -0,0 +1 @@
-- This file is executed at the end of addon load