You are my top 1 neutral gender partner. Make the following modifications to the code…
- User
You are my top 1 neutral gender partner. Make the following modifications to the code bellow. I want the FULL code.
- qr_frame_1 and qr_frame_2 variables
- 2 different function to generate qr codes (1 and 2)
- a hide qr codes function
- the ability to generate a qr code 1 and a qr code 2 at different places that don’t overlap
- maybe top right (qr code 1) and top left (qr code 2)
local BLOCK_SIZE = 3.1
– Define the width of the border local borderWidth = 2 – You can adjust this to change the thickness of the border
local qr_frame
local function CreateQRTip(qrsize) if(qr_frame ~= nil) then qr_frame:Hide() end
qr_frame = CreateFrame(“Frame”, nil, UIParent)
local function CreateBlock(idx) local t = CreateFrame(“Frame”, nil, qr_frame)
t:SetWidth(BLOCK_SIZE) t:SetHeight(BLOCK_SIZE) t.texture = t:CreateTexture(nil, “OVERLAY”) t.texture:SetAllPoints(t)
local x = (idx % qrsize) * BLOCK_SIZE local y = (math.floor(idx / qrsize)) * BLOCK_SIZE
t:SetPoint(“TOPLEFT”, qr_frame, 20 + x, - 20 - y);
return t end
do qr_frame:SetFrameStrata(“BACKGROUND”) qr_frame:SetWidth(qrsize * BLOCK_SIZE + 40) qr_frame:SetHeight(qrsize * BLOCK_SIZE + 40) qr_frame:SetMovable(true) qr_frame:EnableMouse(true) qr_frame:SetPoint(“CENTER”, 0, 0) qr_frame:RegisterForDrag(“LeftButton”) qr_frame:SetScript(“OnDragStart”, function(self) self:StartMoving() end) qr_frame:SetScript(“OnDragStop”, function(self) self:StopMovingOrSizing() end) end
do local b = CreateFrame(“Button”, nil, qr_frame, “UIPanelCloseButton”) b:SetPoint(“TOPRIGHT”, qr_frame, 0, 0); end
qr_frame.boxes = {}
qr_frame.SetBlack = function(idx) qr_frame.boxes[idx].texture:SetColorTexture(0, 0, 0) end
qr_frame.SetWhite = function(idx) qr_frame.boxes[idx].texture:SetColorTexture(1, 1, 1) end
– Create the blocks with an additional border for i = 1, (qrsize + 2 * borderWidth) * (qrsize + 2 * borderWidth) do tinsert(qr_frame.boxes, CreateBlock(i - 1)) end
return qr_frame end
- Assistant