Skip to content

Commit

Permalink
pfUI обновлен
Browse files Browse the repository at this point in the history
  • Loading branch information
KasVital committed Dec 25, 2017
1 parent d622284 commit d68ef64
Show file tree
Hide file tree
Showing 31 changed files with 1,329 additions and 299 deletions.
5 changes: 3 additions & 2 deletions pfUI/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ This is **not** an addon-pack like [ShaguUI](http://shagu.org/shaguui/), however

<img src="http://mephis.he-hosting.de/shaguaddons/pfUI/mmobase/screen.jpg" align="right" width="48.87%">
<img src="http://mephis.he-hosting.de/shaguaddons/pfUI/mmobase/moveit.jpg" width="48.87%">
<img src="http://i.imgur.com/xo060dZ.jpg" align="right" width="48.87%">
<img src="http://i.imgur.com/gGnVtP6.jpg" width="48.87%">
<img src="https://i.imgur.com/eRKDZwe.jpg" align="right" width="48.87%">
<img src="http://i.imgur.com/xo060dZ.jpg" width="48.87%">

## Installation
1. Download **[Latest Version](https://github.com/shagu/pfUI/archive/master.zip)**
Expand All @@ -21,6 +21,7 @@ This is **not** an addon-pack like [ShaguUI](http://shagu.org/shaguui/), however
## Commands

/pfui Open the configuration GUI
/share Open the configuration import/export dialog
/gm Open the ticket Dialog
/rl Reload the whole UI
/focus Creates a Focus-Frame for the current target
Expand Down
7 changes: 6 additions & 1 deletion pfUI/api/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("global", nil, "language", GetLocale())
pfUI:UpdateConfig("global", nil, "profile", "default")
pfUI:UpdateConfig("global", nil, "pixelperfect", "0")
pfUI:UpdateConfig("global", nil, "hdgraphic", "0")
pfUI:UpdateConfig("global", nil, "offscreen", "0")

pfUI:UpdateConfig("global", nil, "font_default", "Interface\\AddOns\\pfUI\\fonts\\Myriad-Pro.ttf")
Expand Down Expand Up @@ -67,6 +68,8 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("appearance", "bags", "borderonlygear", "0")
pfUI:UpdateConfig("appearance", "minimap", "mouseoverzone", "0")
pfUI:UpdateConfig("appearance", "minimap", "coordsloc", "bottomleft")
pfUI:UpdateConfig("appearance", "minimap", "tracking_size", "16")
pfUI:UpdateConfig("appearance", "minimap", "tracking_pulse", "1")

pfUI:UpdateConfig("loot", nil, "autoresize", "1")
pfUI:UpdateConfig("loot", nil, "autopickup", "1")
Expand Down Expand Up @@ -455,7 +458,8 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("bars", nil, "rangecolor", "1,0.1,0.1,1")
pfUI:UpdateConfig("bars", nil, "showmacro", "1")
pfUI:UpdateConfig("bars", nil, "showkeybind", "1")
pfUI:UpdateConfig("bars", nil, "hunterbar", "1")
pfUI:UpdateConfig("bars", nil, "showequipped", "1")
pfUI:UpdateConfig("bars", nil, "hunterbar", "0")
pfUI:UpdateConfig("bars", nil, "keydown", "0")
pfUI:UpdateConfig("bars", nil, "hide_time", "1")
pfUI:UpdateConfig("bars", nil, "hide_actionmain", "0")
Expand Down Expand Up @@ -504,6 +508,7 @@ function pfUI:LoadConfig()

pfUI:UpdateConfig("chat", "text", "input_width", "0")
pfUI:UpdateConfig("chat", "text", "input_height", "0")
pfUI:UpdateConfig("chat", "text", "outline", "1")
pfUI:UpdateConfig("chat", "text", "time", "0")
pfUI:UpdateConfig("chat", "text", "timeformat", "%H:%M:%S")
pfUI:UpdateConfig("chat", "text", "timebracket", "[]")
Expand Down
128 changes: 128 additions & 0 deletions pfUI/api/spell.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
-- load pfUI environment
setfenv(1, pfUI:GetEnvironment())

local pfSpellScan = CreateFrame("GameTooltip", "pfSpellScan", UIParent, "GameTooltipTemplate")
pfSpellScan:SetOwner(WorldFrame, "ANCHOR_NONE")

-- [ GetSpellMaxRank ]
-- Returns the maximum rank of a players spell.
-- 'name' [string] spellname to query
-- return: [string],[number] maximum rank in characters and the number
-- e.g "Rank 1" and "1"
local spellmaxrank = {}
function pfUI.api.GetSpellMaxRank(name)
if spellmaxrank[name] then return unpack(spellmaxrank[name]) end

local rank = { 0, nil}
for i = 1, GetNumSpellTabs() do
local _, _, offset, num = GetSpellTabInfo(i)
local bookType = BOOKTYPE_SPELL
for id = offset + 1, offset + num do
local spellName, spellRank = GetSpellName(id, bookType)
if spellName == name then
if not rank[2] then rank[2] = spellRank end

local _, _, numRank = string.find(spellRank, " (%d+)$")
if numRank and tonumber(numRank) > rank[1] then
rank = { tonumber(numRank), spellRank}
end
end
end
end

spellmaxrank[name] = { rank[2], rank[1] }
return rank[2], rank[1]
end

-- [ GetSpellIndex ]
-- Returns the spellbook index and bookid of the given spell.
-- 'name' [string] spellname to query
-- 'rank' [string] rank to query (optional)
-- return: [number],[string] spell index and spellbook id
local spellindex = {}
function pfUI.api.GetSpellIndex(name, rank)
if spellindex[name..(rank or "")] then return unpack(spellindex[name..(rank or "")]) end
if not rank then rank = GetSpellMaxRank(name) end

for i = 1, GetNumSpellTabs() do
local _, _, offset, num = GetSpellTabInfo(i)
local bookType = BOOKTYPE_SPELL
for id = offset + 1, offset + num do
local spellName, spellRank = GetSpellName(id, bookType)
if rank and rank == spellRank and name == spellName then
spellindex[name..rank] = { id, bookType }
return id, bookType
elseif not rank and name == spellName then
spellindex[name] = { id, bookType }
return id, bookType
end
end
end
spellindex[name..(rank or "")] = { nil }
return nil
end

-- [ GetSpellInfo ]
-- Returns several information about a spell.
-- 'index' [string/number] Spellname or Index of a spell in the spellbook
-- 'bookType' [string] Type of spellbook (optional)
-- return:
-- [string] Name of the spell
-- [string] Secondary text associated with the spell
-- (e.g."Rank 5", "Racial", etc.)
-- [string] Path to an icon texture for the spell
-- [number] Casting time of the spell in milliseconds
-- [number] Minimum range from the target required to cast the spell
-- [number] Maximum range from the target at which you can cast the spell
local spellinfo = {}
function pfUI.api.GetSpellInfo(index, bookType)
if spellinfo[index] then return unpack(spellinfo[index]) end

local name, rank
local icon = ""
local castingTime = 0
local minRange = 0
local maxRange = 0

if type(index) == "string" then
local _, _, sname, srank = string.find(index, '(.+)%((.+)%)')
name = sname or index
rank = srank or GetSpellMaxRank(name)
index, bookType = GetSpellIndex(name, rank)
else
name, rank = GetSpellName(index, bookType)
end

if name and index then
texture = GetSpellTexture(index, bookType)
end

if index then
pfSpellScan:ClearLines()
pfSpellScan:SetSpell(index, bookType)

for i=1, 4 do
for _, text in pairs({_G["pfSpellScanTextLeft"..i], _G["pfSpellScanTextRight"..i]}) do
if text and text:IsVisible() and text:GetText() then
local _, _, sec = string.find(text:GetText(), gsub(SPELL_CAST_TIME_SEC, "%%.3g", "%(.+%)"))
local _, _, min = string.find(text:GetText(), gsub(SPELL_CAST_TIME_MIN, "%%.3g", "%(.+%)"))
local _, _, range = string.find(text:GetText(), gsub(SPELL_RANGE, "%%s", "%(.+%)"))

if sec or min then castingTime = tonumber(sec) * 1000 or tonumber(min) * 1000 end
if range then
local _, _, min, max = string.find(range, "(.+)-(.+)")
if min and max then
minRange = tonumber(min)
maxRange = tonumber(max)
else
minRange = 0
maxRange = tonumber(range)
end
end
end
end
end
end
spellinfo[index] = { name, rank, icon, castingTime, minRange, maxRange }
return name, rank, icon, castingTime, minRange, maxRange
end
51 changes: 48 additions & 3 deletions pfUI/api/unitframes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,43 @@ function pfUI.uf:CreateUnitFrame(unit, id, config, tick)
f.hp.bar.texture:SetAllPoints(f.hp.bar)
end

f.incHeal = CreateFrame("StatusBar", nil, f.hp.bar)
f.incHeal:SetHeight(f.config.height)
f.incHeal:SetWidth(f.config.width)
f.incHeal:SetStatusBarTexture("Interface\\AddOns\\pfUI\\img\\bar")
f.incHeal:SetMinMaxValues(0, 1)
f.incHeal:SetValue(1)
f.incHeal:SetStatusBarColor(0, 1, 0, 0.5)
f.incHeal:Hide()

f.incHeal:SetScript("OnShow", function()
if pfUI.prediction and f.label and f.id then
pfUI.prediction:TriggerUpdate(UnitName(f.label .. f.id))
end
end)

if pfUI_config.unitframes.custombg == "0" then
f.incHeal:SetFrameLevel(2)
else
f.incHeal:SetFrameLevel(3)
end

if f.config.verticalbar == "0" then
f.incHeal:SetPoint("TOPLEFT", f.hp.bar, "TOPLEFT", 0, 0)
else
f.incHeal:SetPoint("BOTTOM", f.hp.bar, "BOTTOM", 0, 0)
end

f.ressIcon = CreateFrame("Frame", nil, f.hp.bar)
f.ressIcon:SetFrameLevel(16)
f.ressIcon:SetWidth(32)
f.ressIcon:SetHeight(32)
f.ressIcon:SetPoint("CENTER", f, "CENTER", 0, 4)
f.ressIcon.texture = f.ressIcon:CreateTexture(nil,"BACKGROUND")
f.ressIcon.texture:SetTexture("Interface\\AddOns\\pfUI\\img\\ress")
f.ressIcon.texture:SetAllPoints(f.ressIcon)
f.ressIcon:Hide()

f.power = CreateFrame("Frame",nil, f)
f.power:SetPoint(f.config.panchor, f.hp, relative_point, 0, -2*default_border - f.config.pspace)
f.power:SetWidth((f.config.pwidth ~= "-1" and f.config.pwidth or f.config.width))
Expand Down Expand Up @@ -1456,10 +1493,18 @@ function pfUI.uf.GetColor(self, preset)
if RAID_CLASS_COLORS[class] then
r, g, b = RAID_CLASS_COLORS[class].r, RAID_CLASS_COLORS[class].g, RAID_CLASS_COLORS[class].b
end
else
if UnitReactionColor[UnitReaction(unitstr, "player")] then
r, g, b = UnitReactionColor[UnitReaction(unitstr, "player")].r, UnitReactionColor[UnitReaction(unitstr, "player")].g, UnitReactionColor[UnitReaction(unitstr, "player")].b
elseif self.label == "pet" then
local happiness = GetPetHappiness()
if happiness == 1 then
r, g, b = 1, 0, 0
elseif happiness == 2 then
r, g, b = 1, 1, 0
else
r, g, b = 0, 1, 0
end
else
local color = UnitReactionColor[UnitReaction(unitstr, "player")]
if color then r, g, b = color.r, color.g, color.b end
end

elseif preset == "class" and config["classcolor"] == "1" then
Expand Down
13 changes: 9 additions & 4 deletions pfUI/env/fonts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function pfUI.environment:UpdateFonts()
SystemFont:SetFont(pfUI.font_default, 15)
GameFontNormal:SetFont(pfUI.font_default, 12)
GameFontBlack:SetFont(pfUI.font_default, 12)
GameFontNormalSmall:SetFont(pfUI.font_default, 12)
GameFontNormalSmall:SetFont(pfUI.font_default, 11)
GameFontNormalLarge:SetFont(pfUI.font_default, 16)
GameFontNormalHuge:SetFont(pfUI.font_default, 20)
NumberFontNormal:SetFont(pfUI.font_default, 14, "OUTLINE")
Expand All @@ -53,17 +53,22 @@ function pfUI.environment:UpdateFonts()
MailTextFontNormal:SetFont(pfUI.font_default, 15)
SubSpellFont:SetFont(pfUI.font_default, 12)
DialogButtonNormalText:SetFont(pfUI.font_default, 16)
ZoneTextFont:SetFont(pfUI.font_default, 48, "OUTLINE")
ZoneTextFont:SetFont(pfUI.font_default, 34, "OUTLINE")
SubZoneTextFont:SetFont(pfUI.font_default, 24, "OUTLINE")
TextStatusBarTextSmall:SetFont(pfUI.font_default, 12, "NORMAL")
GameTooltipText:SetFont(pfUI.font_default, 12)
GameTooltipTextSmall:SetFont(pfUI.font_default, 12)
GameTooltipHeaderText:SetFont(pfUI.font_default, 14)
GameTooltipHeaderText:SetFont(pfUI.font_default, 13)
WorldMapTextFont:SetFont(pfUI.font_default, 102, "THICK")
InvoiceTextFontNormal:SetFont(pfUI.font_default, 12)
InvoiceTextFontSmall:SetFont(pfUI.font_default, 12)
ChatFontNormal:SetFont(pfUI.font_default, 12, "NORMAL")
CombatTextFont:SetFont(pfUI.font_combat, 25)

if pfUI_config and pfUI_config.chat and pfUI_config.chat.text.outline == "1" then
ChatFontNormal:SetFont(pfUI.font_default, 13, "OUTLINE")
else
ChatFontNormal:SetFont(pfUI.font_default, 13)
end
end

-- run environment update
Expand Down
19 changes: 17 additions & 2 deletions pfUI/env/translations_deDE.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pfUI_translation["deDE"] = {
["Always Use 2D Portraits"] = nil,
["Ammo Counter"] = nil,
["Appearance"] = nil,
["AtlasLoot"] = nil,
["Autohide"] = nil,
["Auto Repair Items"] = nil,
["Auto Sell Grey Items"] = nil,
Expand Down Expand Up @@ -45,7 +46,9 @@ pfUI_translation["deDE"] = {
["|cff33ffccChat: \"Layout\"|r\n\nDo you want me to adjust the layout of your chatframes?\nThis would make sure, that every window is placed on its dedicated position."] = nil,
["|cff33ffccChat: \"Loot & Spam\"|r\n\nDo you want me to create and manage a specific Chatframe called \"Loot & Spam\"?\nThis chat will display world channels, loot information and miscellaneous messages,\nthat would otherwise clutter your main chatframe."] = nil,
["|cff33ffccKeybind Mode|r\nThis mode allows you to bind keyboard shortcuts to your actionbars.\nBy hovering a button with your cursor and pressing a key, the key will be assigned to that button.\nHit Escape on a button to remove bindings.\n\nPress Escape or click on an empty area to leave the keybind mode."] = nil,
["|cff33ffccpf|rUI: New version available! Have a look at http://shagu.org !"] = nil,
["|cff33ffccUnlock Mode|r\nThis mode allows you to move frames by dragging them using the mouse cursor. Frames can be scaled by scrolling up and down.\nTo scale multiple frames at once (eg. raidframes), hold down the shift key while scrolling. Click into an empty space to go back to the pfUI menu."] = nil,
["|cffddddddIt's always safe to upgrade |cff33ffccpf|rUI. |cffddddddYou won't lose any of your configuration."] = nil,
["|cffff5555EVERYTHING"] = nil,
["Channeling Color"] = nil,
["Chat Background Color"] = nil,
Expand Down Expand Up @@ -86,6 +89,7 @@ pfUI_translation["deDE"] = {
["Debuff Position"] = nil,
["Debuff Size"] = nil,
["Debuffs Per Row"] = nil,
["Decode"] = nil,
["Default"] = nil,
["Delete profile"] = nil,
["Delete / Reset"] = nil,
Expand Down Expand Up @@ -167,12 +171,13 @@ pfUI_translation["deDE"] = {
["Enable Level Color in Text"] = nil,
["Enable \"Loot & Spam\" Chat Window"] = nil,
["Enable Loot Window On MouseCursor"] = nil,
["Enable Maximum Graphic Details"] = nil,
["Enable Micro Bar"] = nil,
["Enable Mouselook With Right Click"] = nil,
["Enable Native UI-Scale"] = nil,
["Enable Offscreen Frame Positions"] = nil,
["Enable Overlap"] = nil,
["Enable Pastel Colors"] = nil,
["Enable Pixel Perfect (Native Resolution)"] = nil,
["Enable Power Color in Text"] = nil,
["Enable Range Based Auto Paging (Hunter)"] = nil,
["Enable Range Display On Hotkeys"] = nil,
Expand All @@ -185,9 +190,12 @@ pfUI_translation["deDE"] = {
["Enable Target Switch Animation"] = nil,
["Enable Timestamps"] = nil,
["Enable URL Detection"] = nil,
["Enable Vertical Health Bar"] = nil,
["Enable Zone Text On Minimap Mouseover"] = nil,
["Encode"] = nil,
["Experience"] = nil,
["Exp"] = nil,
["Export"] = nil,
["Fast"] = nil,
["Firstrun"] = nil,
["FlightMap"] = nil,
Expand Down Expand Up @@ -226,12 +234,13 @@ pfUI_translation["deDE"] = {
["Hide Totems"] = nil,
["Hoverbind"] = nil,
["Icon Size"] = nil,
["Ignore Layout"] = nil,
["Import"] = nil,
["Incoming Whispers Color"] = nil,
["Inputbox Height"] = nil,
["Inputbox Width"] = nil,
["Instant"] = nil,
["Invert Health Bar"] = nil,
["Enable Vertical Health Bar"] = nil,
["is not allowed in profile name"] = nil,
["Item Durability"] = nil,
["KLH Threat Meter (Dock)"] = nil,
Expand Down Expand Up @@ -263,19 +272,22 @@ pfUI_translation["deDE"] = {
["Medium"] = nil,
["Memory Usage"] = nil,
["Minimap"] = nil,
["Minimap Tracking"] = nil,
["Modules"] = nil,
["Money"] = nil,
["Mousewheel Scroll Speed"] = nil,
["ms"] = nil,
["Name"] = nil,
["Nameplates"] = nil,
["Nameplate Width"] = nil,
["N/A"] = nil,
["Native"] = nil,
["Network Down"] = nil,
["Network Latency"] = nil,
["Network Up"] = nil,
["NEW TIMER"] = nil,
["Next Memory Cleanup"] = nil,
["No tracking spell active"] = nil,
["Now"] = nil,
["Only Count Bagspace On Regular Bags"] = nil,
["Only Show Chat Dock On Mouseover"] = nil,
Expand Down Expand Up @@ -339,11 +351,13 @@ pfUI_translation["deDE"] = {
["Settings"] = nil,
["Shapeshift Bar (BarShapeShift)"] = nil,
["Shift-Click Action"] = nil,
["Show Equipped Items"] = nil,
["Show Health Points"] = nil,
["Show/Hide Timer"] = nil,
["Show Hotkey Text"] = nil,
["Show Hots as Buff Indicators"] = nil,
["Show Hots of all Classes"] = nil,
["Show Inactive Tracking"] = nil,
["Show Macro Text"] = nil,
["Show Players Only"] = nil,
["Show Procs as Buff Indicators"] = nil,
Expand Down Expand Up @@ -378,6 +392,7 @@ pfUI_translation["deDE"] = {
["Top Left"] = nil,
["Top"] = nil,
["Top Right"] = nil,
["Tracking Icon Size"] = nil,
["UI-Scale"] = nil,
["Unit Frame Border Size"] = nil,
["Unit Frame Layout"] = nil,
Expand Down
Loading

0 comments on commit d68ef64

Please sign in to comment.