Skip to content

Commit b118393

Browse files
committed
Importing Squeenix
git-svn-id: http://tekkub-wow.googlecode.com/svn/trunk/Squeenix@46 86fe6d9a-1522-0410-a387-bf9db416f0a0
0 parents  commit b118393

9 files changed

+521
-0
lines changed

Border.lua

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
local L = AceLibrary("AceLocale-2.2"):new("SqueenixBorder")
2+
L:RegisterTranslations("enUS", function() return {
3+
["Border style"] = true,
4+
["Change the minimap border style"] = true,
5+
} end)
6+
7+
L:RegisterTranslations("koKR", function() return {
8+
["Border style"] = "외곽선",
9+
["Change the minimap border style"] = "미니맵의 외곽선의 종류를 변경합니다",
10+
} end)
11+
12+
local borders = {
13+
["Rounded"] = {bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, edgeSize = 16,
14+
edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", insets = {left = 5, right = 5, top = 5, bottom = 5}},
15+
16+
["Square"] = {bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16, edgeSize = 16,
17+
edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border", insets = {left = 5, right = 5, top = 5, bottom = 5}},
18+
19+
["Black"] = {bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16,
20+
edgeFile = "", edgeSize = 0, insets = {left = 3, right = 3, top = 3, bottom = 3}},
21+
}
22+
23+
local border = Squeenix:NewModule("Border")
24+
25+
26+
function border:OnInitialize()
27+
local self = self
28+
self.db = Squeenix:AcquireDBNamespace("Border")
29+
Squeenix:RegisterDefaults("Border", "profile", {style = "Square"})
30+
31+
local borderList = {}
32+
for k in pairs(borders) do table.insert(borderList, k) end
33+
34+
Squeenix.Options.args.border = {
35+
name = L["Border style"],
36+
type = "text",
37+
desc = L["Change the minimap border style"],
38+
handler = self,
39+
get = function() return self.db.profile.style end,
40+
set = "SetBorder",
41+
validate = borderList,
42+
}
43+
44+
self.frame = CreateFrame("Button", nil, Minimap)
45+
self.frame:SetPoint("TOPLEFT","Minimap",-5,5)
46+
self.frame:SetPoint("BOTTOMRIGHT","Minimap",5,-5)
47+
48+
self:SetBorder()
49+
self.frame:SetBackdropColor(0,0,0,1)
50+
self.frame:SetFrameStrata("BACKGROUND")
51+
self.frame:SetFrameLevel(1)
52+
end
53+
54+
55+
function border:SetBorder(v)
56+
if v then self.db.profile.style = v end
57+
self.frame:SetBackdrop(borders[self.db.profile.style])
58+
self.frame:SetBackdropColor(0,0,0,1)
59+
end
60+
61+
62+
63+

Hidebuttons.lua

+149
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
local L = AceLibrary("AceLocale-2.2"):new("SqueenixHide")
2+
L:RegisterTranslations("enUS", function() return {
3+
["Hidden"] = true,
4+
["Shown"] = true,
5+
["Hide buttons"] = true,
6+
["Hide minimap buttons"] = true,
7+
["MinimapToggleButton"] = true,
8+
["Hide the MinimapToggleButton"] = true,
9+
["MinimapZoom"] = true,
10+
["Hide the minimap zoom buttons"] = true,
11+
["GameTimeFrame"] = true,
12+
["Hide the GameTimeFrame"] = true,
13+
["MinimapZoneTextButton"] = true,
14+
["Hide the MinimapZoneTextButton"] = true,
15+
["MinimapWorldMapButton"] = true,
16+
["Hide the MinimapWorldMapButton"] = true,
17+
} end)
18+
19+
L:RegisterTranslations("koKR", function() return {
20+
["Hidden"] = "숨김",
21+
["Shown"] = "표시",
22+
["Hide buttons"] = "버튼 숨김",
23+
["Hide minimap buttons"] = "미니맵의 버튼을 숨깁니다",
24+
["MinimapToggleButton"] = "미니맵 토글 버튼",
25+
["Hide the MinimapToggleButton"] = "미니맵토글버튼을 숨깁니다",
26+
["MinimapZoom"] = "미니맵 줌 버튼",
27+
["Hide the minimap zoom buttons"] = "미니맵 줌 버튼을 숨깁니다",
28+
["GameTimeFrame"] = "게임시간",
29+
["Hide the GameTimeFrame"] = "미니맵의 시간표시를 숨깁니다",
30+
["MinimapZoneTextButton"] = "미니맵 지역명",
31+
["Hide the MinimapZoneTextButton"] = "미니맵의 지역명을 숨깁니다",
32+
--["MinimapWorldMapButton"] = true,
33+
--["Hide the MinimapWorldMapButton"] = true,
34+
} end)
35+
36+
local map = {[true] = L["Hidden"], [false] = L["Shown"]}
37+
38+
local hide = Squeenix:NewModule("Hide")
39+
40+
41+
function hide:OnInitialize()
42+
local self = self
43+
self.db = Squeenix:AcquireDBNamespace("Hide")
44+
Squeenix:RegisterDefaults("Hide", "profile", {
45+
MinimapToggleButton = true,
46+
MinimapZoom = true,
47+
GameTimeFrame = true,
48+
MinimapZoneTextButton = false,
49+
})
50+
51+
Squeenix.Options.args.hide = {
52+
name = L["Hide buttons"],
53+
type = "group",
54+
desc = L["Hide minimap buttons"],
55+
handler = self,
56+
args = {
57+
toggle = {
58+
name = L["MinimapToggleButton"],
59+
type = "toggle",
60+
desc = L["Hide the MinimapToggleButton"],
61+
map = map,
62+
handler = self,
63+
get = function() return self.db.profile.MinimapToggleButton end,
64+
set = "HideToggle",
65+
},
66+
worldmap = {
67+
name = L["MinimapWorldMapButton"],
68+
type = "toggle",
69+
desc = L["Hide the MinimapWorldMapButton"],
70+
map = map,
71+
handler = self,
72+
get = function() return self.db.profile.MinimapToggleMap end,
73+
set = "HideMap",
74+
},
75+
zoom = {
76+
name = L["MinimapZoom"],
77+
type = "toggle",
78+
desc = L["Hide the minimap zoom buttons"],
79+
map = map,
80+
handler = self,
81+
get = function() return self.db.profile.MinimapZoom end,
82+
set = "HideZoom",
83+
},
84+
time = {
85+
name = L["GameTimeFrame"],
86+
type = "toggle",
87+
desc = L["Hide the GameTimeFrame"],
88+
map = map,
89+
handler = self,
90+
get = function() return self.db.profile.GameTimeFrame end,
91+
set = "HideTime",
92+
},
93+
text = {
94+
name = L["MinimapZoneTextButton"],
95+
type = "toggle",
96+
desc = L["Hide the MinimapZoneTextButton"],
97+
map = map,
98+
handler = self,
99+
get = function() return self.db.profile.MinimapZoneTextButton end,
100+
set = "HideText",
101+
},
102+
}
103+
}
104+
105+
self:HideText(self.db.profile.MinimapZoneTextButton)
106+
self:HideTime(self.db.profile.GameTimeFrame)
107+
self:HideToggle(self.db.profile.MinimapToggleButton)
108+
self:HideZoom(self.db.profile.MinimapZoom)
109+
hide:HideMap(self.db.profile.MinimapToggleMap)
110+
end
111+
112+
113+
function hide:HideText(v)
114+
self.db.profile.MinimapZoneTextButton = v
115+
if v then MinimapZoneTextButton:Hide()
116+
else MinimapZoneTextButton:Show() end
117+
end
118+
119+
function hide:HideMap(v)
120+
self.db.profile.MinimapToggleMap = v
121+
if v then MiniMapWorldMapButton:Hide()
122+
else MiniMapWorldMapButton:Show() end
123+
end
124+
125+
function hide:HideTime(v)
126+
self.db.profile.GameTimeFrame = v
127+
if v then GameTimeFrame:Hide()
128+
else GameTimeFrame:Show() end
129+
end
130+
131+
132+
function hide:HideToggle(v)
133+
self.db.profile.MinimapToggleButton = v
134+
if v then MinimapToggleButton:Hide()
135+
else MinimapToggleButton:Show() end
136+
end
137+
138+
139+
function hide:HideZoom(v)
140+
self.db.profile.MinimapZoom = v
141+
if v then
142+
MinimapZoomIn:Hide()
143+
MinimapZoomOut:Hide()
144+
else
145+
MinimapZoomIn:Show()
146+
MinimapZoomOut:Show()
147+
end
148+
end
149+

Mask.blp

6.47 KB
Binary file not shown.

Move.lua

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
local L = AceLibrary("AceLocale-2.2"):new("SqueenixMovement")
2+
L:RegisterTranslations("enUS", function() return {
3+
["Lock movement"] = true,
4+
["Lock/unlock minimap movement"] = true,
5+
["Locked"] = true,
6+
["Unlocked"] = true,
7+
["Reset Position"] = true,
8+
["Reset the minimap to it's default position"] = true,
9+
} end)
10+
11+
L:RegisterTranslations("koKR", function() return {
12+
["Lock movement"] = "위치 고정",
13+
["Lock/unlock minimap movement"] = "미니맵의 위치를 이동하거나 고정합니다",
14+
["Locked"] = "고정",
15+
["Unlocked"] = "이동",
16+
["Reset Position"] = "위치 초기화",
17+
["Reset the minimap to it's default position"] = "미니맵의 위치를 기본값으로 되돌립니다",
18+
} end)
19+
20+
21+
local move = Squeenix:NewModule("Movement")
22+
23+
24+
function move:OnInitialize()
25+
local self = self
26+
self.db = Squeenix:AcquireDBNamespace("Movement")
27+
Squeenix:RegisterDefaults("Movement", "profile", {lock = true})
28+
29+
Squeenix.Options.args.lock = {
30+
name = L["Lock movement"],
31+
type = "toggle",
32+
desc = L["Lock/unlock minimap movement"],
33+
mask = {[true] = L["Locked"], [false] = L["Unlocked"]},
34+
get = function() return self.db.profile.lock end,
35+
set = function(v) self.db.profile.lock = v end,
36+
}
37+
Squeenix.Options.args.resetpos = {
38+
name = L["Reset Position"],
39+
type = "execute",
40+
desc = L["Reset the minimap to it's default position"],
41+
func = function()
42+
self.db.profile.x, self.db.profile.y = nil, nil
43+
Minimap:ClearAllPoints()
44+
Minimap:SetPoint("CENTER", "MinimapCluster", "TOP", 9, -92)
45+
end,
46+
disabled = function() return not self.db.profile.x end,
47+
}
48+
49+
Minimap:SetMovable(true)
50+
Minimap:EnableMouse(true)
51+
Minimap:RegisterForDrag("LeftButton")
52+
Minimap:SetScript("OnDragStart", function() if not self.db.profile.lock then Minimap:StartMoving() end end)
53+
Minimap:SetScript("OnDragStop", function()
54+
if self.db.profile.lock then return end
55+
Minimap:StopMovingOrSizing()
56+
self.db.profile.x, self.db.profile.y = Minimap:GetCenter()
57+
end)
58+
59+
Minimap:ClearAllPoints()
60+
if self.db.profile.x then Minimap:SetPoint("CENTER", "UIParent", "BOTTOMLEFT", self.db.profile.x, self.db.profile.y)
61+
else Minimap:SetPoint("CENTER", "MinimapCluster", "TOP", 9, -92) end
62+
end
63+
64+

NESW.lua

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
local L = AceLibrary("AceLocale-2.2"):new("SqueenixNESW")
2+
L:RegisterTranslations("enUS", function() return {
3+
["Compass"] = true,
4+
["Show compass directions on map frame"] = true,
5+
} end)
6+
7+
L:RegisterTranslations("koKR", function() return {
8+
["Compass"] = "방향지시자",
9+
["Show compass directions on map frame"] = "미니맵에 방향지시자를 표시합니다",
10+
} end)
11+
12+
local frames = {}
13+
local nesw = Squeenix:NewModule("NESW")
14+
15+
function nesw:OnInitialize()
16+
local self = self
17+
self.db = Squeenix:AcquireDBNamespace("NESW")
18+
Squeenix:RegisterDefaults("NESW", "profile", {show = true})
19+
Squeenix.Options.args.compass = {
20+
name = L["Compass"],
21+
type = "toggle",
22+
desc = L["Show compass directions on map frame"],
23+
handler = self,
24+
get = function() return self.db.profile.show end,
25+
set = "SetVisible",
26+
}
27+
28+
local f = Minimap
29+
for dir,anc in pairs({W= "LEFT", S = "BOTTOM", E = "RIGHT", N = "TOP"}) do
30+
local w = f:CreateFontString()
31+
w:SetFontObject(GameFontNormal)
32+
w:SetPoint("CENTER", f, anc)
33+
w:SetTextColor(1, 1, dir == "N" and 0 or 1)
34+
w:SetText(dir)
35+
if self.db.profile.show then w:Show()
36+
else w:Hide() end
37+
frames[w] = true
38+
end
39+
end
40+
41+
42+
function nesw:SetVisible(v)
43+
self.db.profile.show = v
44+
if v then for f in pairs(frames) do f:Show() end
45+
else for f in pairs(frames) do f:Hide() end end
46+
end

Scale.lua

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
local L = AceLibrary("AceLocale-2.2"):new("SqueenixScale")
2+
L:RegisterTranslations("enUS", function() return {
3+
["Scale map"] = true,
4+
["Minimap scale"] = true,
5+
["Scale text"] = true,
6+
["Minimap text header scale"] = true,
7+
} end)
8+
9+
L:RegisterTranslations("koKR", function() return {
10+
["Scale map"] = "맵 크기",
11+
["Minimap scale"] = "미니맵의 크기를 설정합니다",
12+
["Scale text"] = "텍스트 크기",
13+
["Minimap text header scale"] = "미니맵의 상단바 텍스트의 크기를 설정합니다.",
14+
} end)
15+
16+
local scale = Squeenix:NewModule("Scale")
17+
18+
19+
function scale:OnInitialize()
20+
local self = self
21+
self.db = Squeenix:AcquireDBNamespace("Scale")
22+
Squeenix:RegisterDefaults("Scale", "profile", {
23+
mapscale = 1,
24+
textscale = 1,
25+
})
26+
27+
Squeenix.Options.args.mapscale = {
28+
name = L["Scale map"],
29+
type = "range",
30+
desc = L["Minimap scale"],
31+
min = 0.5,
32+
max = 2,
33+
step = 0.05,
34+
isPercent = true,
35+
handler = self,
36+
get = function() return self.db.profile.mapscale end,
37+
set = "SetMapScale",
38+
}
39+
Squeenix.Options.args.textscale = {
40+
name = L["Scale text"],
41+
type = "range",
42+
desc = L["Minimap text header scale"],
43+
min = 0.5,
44+
max = 2,
45+
step = 0.05,
46+
isPercent = true,
47+
handler = self,
48+
get = function() return self.db.profile.textscale end,
49+
set = "SetTextScale",
50+
}
51+
52+
self:SetMapScale()
53+
self:SetTextScale()
54+
end
55+
56+
57+
function scale:SetMapScale(v)
58+
if v then self.db.profile.mapscale = v end
59+
Minimap:SetScale(self.db.profile.mapscale)
60+
end
61+
62+
63+
function scale:SetTextScale(v)
64+
if v then self.db.profile.textscale = v end
65+
MinimapZoneTextButton:SetScale(self.db.profile.textscale)
66+
end
67+
68+

0 commit comments

Comments
 (0)