Skip to content

Instantly share code, notes, and snippets.

@Meorawr
Meorawr / ForbiddenChatBubbles.md
Created August 12, 2020 20:12
9.0 Forbidden Chat Bubbles

On Beta clients, chat bubbles seem to have a child frame which is forbidden even outside of instances - while the chat bubble frame itself isn't:

/say s
/run C_Timer.After(1.5, function() for _, b in ipairs(C_ChatBubbles.GetAllChatBubbles()) do print(b:IsForbidden(), b:GetNumChildren(), b:GetChildren():IsForbidden()); end; end)

The above if placed in a macro and executed outside of an instance will print "false 1 true" to the chat frame, indicating that the chat bubble wasn't forbidden, had 1 child, and the child was forbidden.

On Live clients, chat bubbles don't have a child frame but themselves aren't forbidden outside of instances:

/say s

@Meorawr
Meorawr / AddOn_SelectionPopoutDemo.lua
Last active August 31, 2020 12:27
SelectionPopoutButtonTemplate Demo
local function CreateSelectionModel(entries)
local selections = {};
for i = 1, entries do
selections[i] = {
-- `name` is the only required key. There is color swatch support too, but that's
-- probably not needed.
name = "Item " .. i,
-- Other keys can be created as needed and made available to OnEntryClick.
@Meorawr
Meorawr / MinimalUI.lua
Last active August 31, 2020 11:42
"Can you recommend me a minimal UI?"
-- Set a user waypoint and begin tracking it, then run the below script and
-- enter any portal that will trigger a loading screen transition.
--
-- Enjoy your new super-minimalistic user interface.
local ScriptHandlers = {
"OnLoad",
"OnAttributeChanged",
"OnSizeChanged",
"OnEvent",
return {
"OnAnimFinished",
"OnAnimStarted",
"OnArrowPressed",
"OnAttributeChanged",
"OnButtonUpdate",
"OnChar",
"OnCharComposition",
"OnClick",
"OnColorSelect",
@Meorawr
Meorawr / GTT_CreatureInspect.lua
Last active May 12, 2021 21:43
Creature Spawn Inspector
--
-- Creature GUID Inspector
--
function GTT_CreatureInspect(self)
local _, unit = self:GetUnit();
local guid = UnitGUID(unit or "none");
local prefix = string.match(guid, "^([CVP][^l][^-]+)");
if not guid or not prefix then
@Meorawr
Meorawr / RadarChart.lua
Last active January 28, 2021 00:47
Radar Chart Template
local VertexCorner = tInvert({
"TopLeft",
"BottomLeft",
"TopRight",
"BottomRight",
});
local function CreateLinePool(parent, layer, subLayer)
local function CreateLine()
return parent:CreateLine(nil, layer, nil, subLayer);
@Meorawr
Meorawr / coexist.lua
Created February 4, 2021 14:26
Coroutine Nonsense
local co_pool = {};
local function co_main(fn, ...)
-- Main loop for a thread pool coroutine. Each resumption of the coroutine
-- as acquired from the pool should pass in a function and arguments to be
-- invoked.
--
-- The function is expected to return either true or false as its first
-- return value; if true then the thread will stay alive, otherwise it
-- will die. A dead thread should not be released into the pool.
@Meorawr
Meorawr / BattlePetGuidDetector.lua
Created February 20, 2021 16:25
Battle Pet GUID Detector
local BattlePetTrackerMixin = {};
function BattlePetTrackerMixin:OnLoad()
self:RegisterUnitEvent("UNIT_SPELLCAST_SUCCEEDED", "player", "");
self:RegisterEvent("COMPANION_UPDATE");
self:SetScript("OnEvent", function(_, ...) self:OnEvent(...) end);
self.currentServerId = nil;
self.currentInstanceId = nil;
self.currentZoneUid = nil;
AcceptSockets
C_AchievementInfo.GetRewardItemID
C_AchievementInfo.GetSupercedingAchievements
C_AchievementInfo.IsValidAchievement
C_AchievementInfo.SetPortraitTexture
C_EquipmentSet.AssignSpecToEquipmentSet
C_EquipmentSet.CanUseEquipmentSets
C_EquipmentSet.ClearIgnoredSlotsForSave
C_EquipmentSet.CreateEquipmentSet
C_EquipmentSet.DeleteEquipmentSet
@Meorawr
Meorawr / ScrollingEditBox.lua
Last active July 23, 2021 12:05
ScrollingEditBox Demo
local WindowFrame = CreateFrame("Frame", nil, UIParent, "ButtonFrameTemplate")
WindowFrame:SetPoint("CENTER");
WindowFrame:SetSize(640, 480);
ButtonFrameTemplate_HidePortrait(WindowFrame);
local ScrollBar = CreateFrame("EventFrame", nil, WindowFrame, "WowTrimScrollBar");
ScrollBar:SetPoint("TOPRIGHT", -4, -60);
ScrollBar:SetPoint("BOTTOMRIGHT", -4, 28);
local EditFrame = CreateFrame("Frame", nil, WindowFrame, "ScrollingEditBoxTemplate");