@@ -12,63 +12,6 @@ UI Layers
12
12
13
13
local height = 32
14
14
15
- local x = 0
16
- local y = 0
17
-
18
- function OnClickXYPos ()
19
- if not UnitExists (' target' ) then
20
- print (' You have no target to send location information for' )
21
- return
22
- end
23
- if UnitIsPlayer (' target' ) then
24
- SendChatMessage (' I am at location [' .. round (x * 100 , 2 ) .. ' , ' .. round (y * 100 , 2 ) .. ' ]' , ' WHISPER' , nil , UnitName (' target' ));
25
- SetRaidTarget (' target' , 4 );
26
- else
27
- local index = GetChannelName (" General" )
28
- SendChatMessage (' %t is at location [' .. round (x * 100 , 2 ) .. ' , ' .. round (y * 100 , 2 ) .. ' ]' , ' CHANNEL' , nil , index );
29
- SetRaidTarget (' target' , 8 );
30
- end
31
- end
32
-
33
- local frmMain = CreateFrame (' Button' ,' XYPos' ,UIParent )
34
- frmMain :RegisterForClicks (' AnyUp' )
35
- frmMain :SetScript (' OnClick' , OnClickXYPos )
36
- frmMain :SetSize (170 , height )
37
- frmMain :SetPoint (' TOP' )
38
- -- frmMain:Show()
39
- local backdrop = CreateFrame (" Frame" , " Backdrop" , frmMain , " BackdropTemplate" )
40
- backdrop :SetAllPoints ()
41
- backdrop .backdropInfo = {
42
- bgFile = " Interface/Tooltips/UI-Tooltip-Background" ,-- String - Which texture file to use as frame background (.blp or .tga format)
43
- edgeFile = " Interface/Tooltips/UI-Tooltip-Border" , -- String- Which texture file to use as frame edge blp or .tga format)
44
- tile = true , -- Boolean - whether background texture is tiled or streched
45
- tileEdge = true , -- Boolean - whether edge texture is tiled or streched
46
- tileSize = 16 , -- Number - Control how large each copy of the bgFile becomes on-screen
47
- edgeSize = 16 , -- Number - Control how large each copy of the edgeFile becomes on-screen (i.e. border thickness and corner size)
48
- insets = { left = 4 , right = 4 , top = 4 , bottom = 4 , },
49
- }
50
- -- backdrop:ApplyBackdrop()
51
- --- backdrop:SetBackdropColor(0, 0, 1, 0.3)
52
-
53
- local xyPos = backdrop :CreateFontString (frmMain , ' OVERLAY' , ' GameTooltipText' )
54
- xyPos :SetTextColor (1 , 1 , 1 , 1 )
55
- xyPos :SetPoint (' CENTER' ,0 ,0 )
56
-
57
- local function round (number , precision )
58
- local fmtStr = string.format (' %%0.%sf' ,precision )
59
- number = string.format (fmtStr ,number )
60
- return number
61
- end
62
-
63
- local function updatePos ()
64
- local map = C_Map .GetBestMapForUnit (' player' )
65
- local position = C_Map .GetPlayerMapPosition (map , ' player' )
66
- x , y = position :GetXY ()
67
- xyPos :SetText (' Location [' .. round (x * 100 , 2 ) .. ' , ' .. round (y * 100 , 2 ) .. ' ]' )
68
- end
69
-
70
- -- C_Timer.NewTicker(0.1, updatePos)
71
-
72
15
local parent = CreateFrame (' Frame' ,' Mine' ,UIParent )
73
16
parent :SetPoint (' TOPRIGHT' , MinimapCluster , ' TOPLEFT' , 25 , 0 )
74
17
parent :RegisterEvent (' ADDON_LOADED' )
@@ -79,33 +22,9 @@ parent.t:SetMask('Interface\\Buttons\\buttonhilight-Square')
79
22
parent .t :SetAllPoints (parent )
80
23
parent :Show ()
81
24
82
- -- local frmMain = CreateFrame('Frame','zzz',UIParent)
83
- -- frmMain:SetSize(150, 150)
84
- -- frmMain.t = frmMain:CreateTexture()
85
- -- frmMain:SetPoint('CENTER', 100, 100)
86
- -- frmMain.t:SetTexture('Interface\\DialogFrame\\ui-dialogbox-gold-background.blp')
87
- -- frmMain.t:SetMask('interface/buttons/ui-autocastableoverlay.blp')
88
- -- frmMain.t:SetAllPoints(frmMain)
89
- -- frmMain:Show()
90
-
91
- -- Credits: https://git.tukui.org/Azilroka/ProjectAzilroka/-/blob/f13975c053ecbd8f78a4942166947b0902a2606f/Modules/SquareMinimapButtons.lua
92
- -- local function SkinMinimapButton()
93
- -- MiniMapTrackingIcon:ClearAllPoints()
94
- -- MiniMapTrackingIcon:SetPoint('CENTER')
95
- -- MiniMapTrackingBackground:SetAlpha(0)
96
- -- MiniMapTrackingIconOverlay:SetAlpha(0)
97
- -- MiniMapTrackingButton:SetAlpha(0)
98
- -- end
99
-
100
25
local movedButtonNames = {}
101
26
local movedButtons = {}
102
27
103
- local function printParentChildName (button , width , height )
104
- local parentName = button :GetParent ():GetName ()
105
- local childName = button :GetName ()
106
- print (parentName .. ' -->' .. childName .. ' [' .. width .. ' ,' .. height .. ' ]' )
107
- end
108
-
109
28
local function addButton (button )
110
29
if button :GetName () == nil then return end
111
30
if button :GetParent ():GetName () == ' Mine' then return end
0 commit comments