Quantcast

last one

Steven Jackson [07-18-14 - 04:46]
last one
Filename
Interface/AddOns/SVUI/packages/override/SVOverride.lua
Interface/AddOns/SVUI/scripts/pvp.lua
diff --git a/Interface/AddOns/SVUI/packages/override/SVOverride.lua b/Interface/AddOns/SVUI/packages/override/SVOverride.lua
index 2a75729..2321423 100644
--- a/Interface/AddOns/SVUI/packages/override/SVOverride.lua
+++ b/Interface/AddOns/SVUI/packages/override/SVOverride.lua
@@ -87,21 +87,15 @@ end
 local Vehicle_OnSetPoint = function(self,_,parent)
 	if(parent == "MinimapCluster" or parent == _G["MinimapCluster"]) then
 		VehicleSeatIndicator:ClearAllPoints()
-		if SVUI_VehicleFrame_MOVE then
+		if SVUI_VehicleFrame_MOVE then
 			VehicleSeatIndicator:Point("BOTTOM", SVUI_VehicleFrame_MOVE, "BOTTOM", 0, 0)
 		else
-			local width,height = VehicleSeatIndicator:GetSize()
-			local holder = CreateFrame("Frame", "SVUI_VehicleFrame", SuperVillain.UIParent)
-			holder:SetSize(width, ((height + width) + 2))
-			holder:Point("TOPLEFT", SuperVillain.UIParent, "TOPLEFT", 22, -45)
-
-			VehicleSeatIndicator:SetParent(holder)
-			VehicleSeatIndicator:Point("BOTTOM", holder, "BOTTOM", 0, 0)
-			VehicleSeatIndicator:SetFixedPanelTemplate("Transparent")
+			VehicleSeatIndicator:Point("TOPLEFT", SuperVillain.UIParent, "TOPLEFT", 22, -45)
+			SuperVillain:SetSVMovable(VehicleSeatIndicator, "SVUI_VehicleFrame_MOVE", L["Vehicle Seat Frame"])

-			local exit = CreateFrame("Button", "SVUI_BailOut", holder, "SecureHandlerClickTemplate")
-			exit:Size(width, width)
-			exit:Point("TOP", holder, "TOP", 0, 0)
+			local exit = CreateFrame("Button", "SVUI_BailOut", SuperVillain.UIParent, "SecureHandlerClickTemplate")
+			exit:Size(40, 40)
+			exit:Point("TOPLEFT", SVUI_MinimapFrame, "BOTTOMLEFT", 0, -30)
 			exit:SetNormalTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Icons\\EXIT")
 			exit:SetPushedTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Icons\\EXIT")
 			exit:SetHighlightTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Icons\\EXIT")
@@ -110,7 +104,7 @@ local Vehicle_OnSetPoint = function(self,_,parent)
 			exit:SetScript("OnClick", VehicleExit)
 			RegisterStateDriver(exit, "visibility", "[vehicleui] show;hide")

-			SuperVillain:SetSVMovable(holder, "SVUI_VehicleFrame_MOVE", L["Vehicle Seat Frame"])
+			SuperVillain:SetSVMovable(exit, "SVUI_BailOut_MOVE", L["Bail Out"])
 		end;
 		VehicleSeatIndicator:SetScale(0.8)
 	end
diff --git a/Interface/AddOns/SVUI/scripts/pvp.lua b/Interface/AddOns/SVUI/scripts/pvp.lua
index ac90b0a..e9ec5e8 100644
--- a/Interface/AddOns/SVUI/scripts/pvp.lua
+++ b/Interface/AddOns/SVUI/scripts/pvp.lua
@@ -82,37 +82,34 @@ local PVP_NODES = {

 local function EnteringBattleGround()
 	SVUI_PVPComm:Show()
-	local numButtons = 1
 	local mapID = GetCurrentMapAreaID()
 	local points = PVP_NODES[mapID]
-	if(not points) then return end
+	if(not points) then
+		SVUI_PVPComm:Hide()
+		return
+	end
 	for i = 1, #points do
-		if(numButtons <= 5) then
-			local name = points[i]
-			local nodeName = ("SVUI_PVPNode%d"):format(numButtons)
-			local node = _G[nodeName]
-			local safe = node.Safe
-			local help = node.Help
-			safe.name = name
-			help.name = name
-			node.Text:SetText(name)
-			node:SetFontString(node.Text)
-			node:Show()
-			numButtons = numButtons + 1
-		end
+		local name = points[i]
+		local nodeName = ("SVUI_PVPNode%d"):format(i)
+		local node = _G[nodeName]
+		local safe = node.Safe
+		local help = node.Help
+		safe.name = name
+		help.name = name
+		node.Text:SetText(name)
+		node:Show()
 	end
 end

 local function ExitingBattleGround()
 	for i = 1, 5 do
-		local nodeName = ("SVUI_PVPNode%d"):format(numButtons)
+		local nodeName = ("SVUI_PVPNode%d"):format(i)
 		local node = _G[nodeName]
 		local safe = node.Safe
 		local help = node.Help
 		safe.name = ""
 		help.name = ""
 		node.Text:SetText("")
-		node:SetFontString(node.Text)
 		node:Hide()
 	end
 	SVUI_PVPComm:Hide()
@@ -122,18 +119,18 @@ end
 HANDLERS
 ##########################################################
 ]]--
-local Node_OnEnter = function(self)
+local Safe_OnEnter = function(self)
 	if InCombatLockdown() then return end
-	if(self.description and self.description ~= "") then
+	if(self.name and self.name ~= "") then
 		self:SetBackdropBorderColor(1,0.45,0)
 		GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 0, 4)
 		GameTooltip:ClearLines()
-		GameTooltip:AddLine(self.description, 1, 1, 1)
+		GameTooltip:AddLine(self.name .. " is Safe!", 1, 1, 1)
 		GameTooltip:Show()
 	end
 end

-local Node_OnLeave = function(self)
+local Safe_OnLeave = function(self)
 	if InCombatLockdown() then return end
 	self:SetBackdropBorderColor(0,0,0)
 	if(GameTooltip:IsShown()) then GameTooltip:Hide() end
@@ -146,6 +143,23 @@ local Safe_OnClick = function(self)
 	end
 end

+local Help_OnEnter = function(self)
+	if InCombatLockdown() then return end
+	if(self.name and self.name ~= "") then
+		self:SetBackdropBorderColor(1,0.45,0)
+		GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 0, 4)
+		GameTooltip:ClearLines()
+		GameTooltip:AddLine(self.name .. " Needs Help!", 1, 1, 1)
+		GameTooltip:Show()
+	end
+end
+
+local Help_OnLeave = function(self)
+	if InCombatLockdown() then return end
+	self:SetBackdropBorderColor(0,0,0)
+	if(GameTooltip:IsShown()) then GameTooltip:Hide() end
+end
+
 local Help_OnClick = function(self)
 	if(self.name and self.name ~= "") then
 		local msg = ("{rt8} Incoming %s {rt8}"):format(self.name)
@@ -183,16 +197,16 @@ local function LoadPVPComm()
 	for i = 1, 5 do
 		local yOffset = (24 * (i - 1)) + 2

-		local poiName = ("SVUI_PVPNode"):format(i)
+		local poiName = ("SVUI_PVPNode%d"):format(i)
 		local poi = CreateFrame("Frame", poiName, holder)
-		poi:SetSize(152, 22)
+		poi:SetSize(180, 22)
 		poi:SetPoint("TOP", holder, "TOP", 0, -yOffset)
 		poi:SetPanelTemplate("Transparent")
 		poi.Text = poi:CreateFontString(nil,"OVERLAY")
 		poi.Text:SetFont(SuperVillain.Media.font.roboto, 12, "NONE")
 		poi.Text:SetPoint("LEFT", poi, "LEFT", 2, 0)
 		poi.Text:SetHeight(22)
-		poi.Text:SetWidth(104)
+		poi.Text:SetWidth(130)
 		poi.Text:SetJustifyH("CENTER")
 		poi.Text:SetText("")

@@ -200,14 +214,12 @@ local function LoadPVPComm()
 		safe:SetSize(22, 22)
 		safe:SetPoint("RIGHT", poi, "RIGHT", -2, 0)
 		safe:SetButtonTemplate()
-		local stxt = safe:CreateFontString(nil,"OVERLAY")
-		stxt:SetFont(SuperVillain.Media.font.roboto, 12, "NONE")
-		stxt:SetAllPoints(safe)
-		stxt:SetJustifyH("CENTER")
-		stxt:SetText("SAFE")
-		safe:SetFontString(stxt)
-		safe:SetScript("OnEnter", Node_OnEnter)
-		safe:SetScript("OnLeave", Node_OnLeave)
+		local sicon = safe:CreateTexture(nil, "OVERLAY")
+		sicon:SetAllPoints(safe)
+		sicon:SetTexCoord(0.1, 0.9, 0.1, 0.9)
+		sicon:SetTexture([[Interface\PaperDollInfoFrame\Character-Plus]])
+		safe:SetScript("OnEnter", Safe_OnEnter)
+		safe:SetScript("OnLeave", Safe_OnLeave)
 		safe:SetScript("OnClick", Safe_OnClick)

 		poi.Safe = safe
@@ -216,14 +228,12 @@ local function LoadPVPComm()
 		help:SetSize(22, 22)
 		help:SetPoint("RIGHT", safe, "LEFT", -2, 0)
 		help:SetButtonTemplate()
-		local dtxt = help:CreateFontString(nil,"OVERLAY")
-		dtxt:SetFont(SuperVillain.Media.font.roboto, 12, "NONE")
-		dtxt:SetAllPoints(help)
-		dtxt:SetJustifyH("CENTER")
-		dtxt:SetText("HELP")
-		help:SetFontString(dtxt)
-		help:SetScript("OnEnter", Node_OnEnter)
-		help:SetScript("OnLeave", Node_OnLeave)
+		local hicon = help:CreateTexture(nil, "OVERLAY")
+		hicon:SetAllPoints(help)
+		hicon:SetTexCoord(0.1, 0.9, 0.1, 0.9)
+		hicon:SetTexture([[Interface\WorldMap\Skull_64Red]])
+		help:SetScript("OnEnter", Help_OnEnter)
+		help:SetScript("OnLeave", Help_OnLeave)
 		help:SetScript("OnClick", Help_OnClick)

 		poi.Help = help