...
 
Commits (780)
This diff is collapsed.
<Ui xmlns="http://www.blizzard.com/wow/ui/">
<Script file="Config.lua"/>
</Ui>
......@@ -7,33 +7,24 @@ local T, C, L = select(2, ...):unpack()
C["General"] = {
["BackdropColor"] = {0.11, 0.11, 0.11},
["BorderColor"] = {0, 0, 0},
["UseGlobal"] = false,
["HideShadows"] = false,
["AFKSaver"] = true,
["Scaling"] = {
["Options"] = {
["Pixel Perfection"] = "Pixel Perfection",
["Smallest"] = "Smallest",
["Small"] = "Small",
["Medium"] = "Medium",
["Large"] = "Large",
["Oversize"] = "Oversize",
},
["UIScale"] = T.PerfectScale,
["MinimapScale"] = 100,
["WorldMapScale"] = 59,
["Value"] = "Pixel Perfection",
},
["Themes"] = {
["Options"] = {
["Tukui"] = "Tukui",
["Tukui 18"] = "Tukui 18",
["Tukui 17"] = "Tukui 17",
},
["Value"] = "Tukui",
["Value"] = "Tukui 18",
},
}
C["ActionBars"] = {
["Enable"] = true,
["AddNewSpells"] = true,
["HotKey"] = false,
["EquipBorder"] = true,
["Macro"] = false,
......@@ -63,17 +54,23 @@ C["Bags"] = {
["ButtonSize"] = 28,
["Spacing"] = 4,
["ItemsPerRow"] = 11,
["PulseNewItem"] = true,
["Font"] = "Tukui Outline",
}
C["Chat"] = {
["Enable"] = true,
["LeftWidth"] = 370,
["LeftHeight"] = 185,
["RightWidth"] = 370,
["RightHeight"] = 185,
["RightChatAlignRight"] = true,
["BackgroundAlpha"] = 80,
["WhisperSound"] = true,
["ShortChannelName"] = true,
["LinkColor"] = {0.08, 1, 0.36},
["LinkBrackets"] = true,
["ScrollByX"] = 3,
["TextFading"] = false,
["TextFadingTimer"] = 60,
["TabFont"] = "Tukui",
["ChatFont"] = "Tukui",
}
......@@ -84,68 +81,67 @@ C["Cooldowns"] = {
C["DataTexts"] = {
["Battleground"] = true,
["LocalTime"] = true,
["Time24HrFormat"] = false,
["HideFriendsNotPlaying"] = true,
["NameColor"] = {1, 1, 1},
["ValueColor"] = {1, 1, 1},
["Hour24"] = false,
["Font"] = "Tukui",
}
C["Loot"] = {
["Enable"] = true,
["StandardLoot"] = false,
["Font"] = "Tukui",
}
C["Merchant"] = {
["AutoSellGrays"] = true,
["AutoRepair"] = true,
["UseGuildRepair"] = false,
}
C["Misc"] = {
["ThreatBarEnable"] = true,
["AltPowerBarEnable"] = true,
["WorldMapEnable"] = true,
["ExperienceEnable"] = true,
["ReputationEnable"] = true,
["ErrorFilterEnable"] = true,
["AutoInviteEnable"] = false,
["TalkingHeadEnable"] = true,
["AutoSellJunk"] = true,
["AutoRepair"] = true,
["AFKSaver"] = true,
["FadeWorldMapWhileMoving"] = false,
["ObjectiveTrackerFont"] = "Tukui Outline",
}
C["NamePlates"] = {
["Enable"] = true,
["Width"] = 138,
["Height"] = 14,
["CastHeight"] = 4,
["Width"] = 129,
["Height"] = 12,
["NameplateCastBar"] = true,
["Font"] = "Tukui Outline",
["OnlySelfDebuffs"] = true,
["HighlightColor"] = {1, 1, 0},
["HighlightSize"] = 10,
}
C["Party"] = {
["Enable"] = true,
["HealBar"] = true,
["Enable"] = false,
["ShowPets"] = false,
["ShowPlayer"] = true,
["ShowHealthText"] = true,
["ShowManaText"] = false,
["RangeAlpha"] = 0.3,
["Font"] = "Tukui",
["Font"] = "Tukui Outline",
["HealthFont"] = "Tukui Outline",
["HighlightColor"] = {0, 1, 0},
["HighlightSize"] = 10,
}
C["Raid"] = {
["Enable"] = true,
["HealBar"] = true,
["AuraWatch"] = true,
["AuraWatchTimers"] = true,
["DebuffWatch"] = true,
["RangeAlpha"] = 0.3,
["ShowRessurection"] = true,
["ShowHealthText"] = true,
["ShowPets"] = true,
["RangeAlpha"] = 0.3,
["VerticalHealth"] = false,
["MaxUnitPerColumn"] = 10,
["Font"] = "Tukui",
["HealthFont"] = "Tukui Outline",
["MyRaidBuffs"] = true,
["WidthSize"] = 79,
["HeightSize"] = 55,
["HighlightColor"] = {0, 1, 0},
["HighlightSize"] = 10,
["GroupBy"] = {
["Options"] = {
["Group"] = "GROUP",
......@@ -159,9 +155,9 @@ C["Raid"] = {
C["Tooltips"] = {
["Enable"] = true,
["HideOnUnitFrames"] = false,
["HideInCombat"] = false,
["AlwaysCompareItems"] = true,
["UnitHealthText"] = true,
["ShowSpec"] = true,
["MouseOver"] = false,
["HealthFont"] = "Tukui Outline",
}
......@@ -183,6 +179,16 @@ C["Textures"] = {
C["UnitFrames"] = {
["Enable"] = true,
["TotemBar"] = true,
["HealComm"] = true,
["PlayerAuraBars"] = false,
["ScrollingCombatText"] = false,
["ScrollingCombatTextFontSize"] = 32,
["ScrollingCombatTextFont"] = "Tukui Damage",
["PowerTick"] = true,
["Portrait2D"] = true,
["OOCNameLevel"] = false,
["OOCPetNameLevel"] = false,
["Portrait"] = false,
["CastBar"] = true,
["ComboBar"] = true,
......@@ -191,19 +197,15 @@ C["UnitFrames"] = {
["CastBarLatency"] = true,
["Smooth"] = true,
["TargetEnemyHostileColor"] = true,
["CombatLog"] = false,
["HealBar"] = true,
["TotemBar"] = true,
["ShowTargetManaText"] = false,
["CombatLog"] = true,
["PlayerAuras"] = false,
["TargetAuras"] = true,
["FocusAuras"] = true,
["FocusTargetAuras"] = true,
["ArenaAuras"] = true,
["BossAuras"] = true,
["AurasBelow"] = false,
["OnlySelfDebuffs"] = false,
["OnlySelfBuffs"] = false,
["Threat"] = false,
["AltPowerText"] = false,
["Arena"] = true,
["Boss"] = true,
["Font"] = "Tukui Outline",
["HealCommSelfColor"] = {0.29, 1, 0.30},
["HealCommOtherColor"] = {1, 1, 0.36},
["RaidIconSize"] = 24,
}
This diff is collapsed.
......@@ -8,12 +8,6 @@ oUF.colors.disconnected = {
0.1, 0.1, 0.1
}
oUF.colors.runes = {
[1] = {0.69, 0.31, 0.31},
[2] = {0.41, 0.80, 1.00},
[3] = {0.65, 0.63, 0.35},
}
oUF.colors.reaction = {
[1] = { 0.87, 0.37, 0.37 }, -- Hated
[2] = { 0.87, 0.37, 0.37 }, -- Hostile
......@@ -27,46 +21,28 @@ oUF.colors.reaction = {
oUF.colors.power = {
["MANA"] = {0.31, 0.45, 0.63},
["INSANITY"] = {0.40, 0.00, 0.80},
["MAELSTROM"] = {0.00, 0.50, 1.00},
["LUNAR_POWER"] = {0.93, 0.51, 0.93},
["HOLY_POWER"] = {0.95, 0.90, 0.60},
["RAGE"] = {0.69, 0.31, 0.31},
["FOCUS"] = {0.71, 0.43, 0.27},
["ENERGY"] = {0.65, 0.63, 0.35},
["CHI"] = {0.71, 1.00, 0.92},
["RUNES"] = {0.55, 0.57, 0.61},
["SOUL_SHARDS"] = {0.50, 0.32, 0.55},
["FURY"] = {0.78, 0.26, 0.99},
["PAIN"] = {1.00, 0.61, 0.00},
["RUNIC_POWER"] = {0.00, 0.82, 1.00},
["FOCUS"] = {0.71, 0.43, 0.27},
["AMMOSLOT"] = {0.80, 0.60, 0.00},
["FUEL"] = {0.00, 0.55, 0.50},
["POWER_TYPE_STEAM"] = {0.55, 0.57, 0.61},
["POWER_TYPE_PYRITE"] = {0.60, 0.09, 0.17},
["ALTPOWER"] = {0.00, 1.00, 1.00},
}
oUF.colors.class = {
["DEATHKNIGHT"] = { 0.77, 0.12, 0.24 },
["DRUID"] = { 1.00, 0.49, 0.03 },
["HUNTER"] = { 0.67, 0.84, 0.45 },
["MAGE"] = { 0.41, 0.80, 1.00 },
["PALADIN"] = { 0.96, 0.55, 0.73 },
["PRIEST"] = { 0.83, 0.83, 0.83 },
["PRIEST"] = { 0.95, 0.95, 0.95 },
["ROGUE"] = { 1.00, 0.95, 0.32 },
["SHAMAN"] = { 0.16, 0.31, 0.61 },
["SHAMAN"] = { 0.01, 0.44, 0.87 },
["WARLOCK"] = { 0.58, 0.51, 0.79 },
["WARRIOR"] = { 0.78, 0.61, 0.43 },
["MONK"] = { 0.00, 1.00, 0.59 },
["DEMONHUNTER"] = { 0.64, 0.19, 0.79 },
}
oUF.colors.totems = {
[1] = oUF.colors.class[Class], -- Totem 1
[2] = oUF.colors.class[Class], -- Totem 2
[3] = oUF.colors.class[Class], -- Totem 3
[4] = oUF.colors.class[Class], -- Totem 4
oUF.colors.happiness = {
[1] = {.69,.31,.31},
[2] = {.65,.63,.35},
[3] = {.33,.59,.33},
}
oUF.colors.specpowertypes = {
......@@ -79,13 +55,13 @@ oUF.colors.specpowertypes = {
["PALADIN"] = {
[65] = oUF.colors.power["MANA"],
[66] = oUF.colors.power["MANA"],
[70] = oUF.colors.power["HOLY_POWER"],
[70] = oUF.colors.power["MANA"],
},
["HUNTER"] = {
[253] = oUF.colors.power["FOCUS"],
[254] = oUF.colors.power["FOCUS"],
[255] = oUF.colors.power["FOCUS"],
[253] = oUF.colors.power["MANA"],
[254] = oUF.colors.power["MANA"],
[255] = oUF.colors.power["MANA"],
},
["ROGUE"] = {
......@@ -97,18 +73,12 @@ oUF.colors.specpowertypes = {
["PRIEST"] = {
[256] = oUF.colors.power["MANA"],
[257] = oUF.colors.power["MANA"],
[258] = oUF.colors.power["INSANITY"],
},
["DEATHKNIGHT"] = {
[250] = oUF.colors.power["RUNIC_POWER"],
[251] = oUF.colors.power["RUNIC_POWER"],
[252] = oUF.colors.power["RUNIC_POWER"],
[258] = oUF.colors.power["MANA"],
},
["SHAMAN"] = {
[262] = oUF.colors.power["MAELSTROM"],
[263] = oUF.colors.power["MAELSTROM"],
[262] = oUF.colors.power["MANA"],
[263] = oUF.colors.power["MANA"],
[264] = oUF.colors.power["MANA"],
},
......@@ -124,23 +94,57 @@ oUF.colors.specpowertypes = {
[267] = oUF.colors.power["MANA"],
},
["MONK"] = {
[268] = oUF.colors.power["ENERGY"],
[270] = oUF.colors.power["MANA"],
[269] = oUF.colors.power["ENERGY"],
},
["DRUID"] = {
[102] = oUF.colors.power["LUNAR_POWER"],
[102] = oUF.colors.power["MANA"],
[103] = oUF.colors.power["ENERGY"],
[104] = oUF.colors.power["RAGE"],
[105] = oUF.colors.power["MANA"],
},
["DEMONHUNTER"] = {
[577] = oUF.colors.power["FURY"],
[581] = oUF.colors.power["PAIN"],
},
}
RAID_CLASS_COLORS["DRUID"].colorStr = "ffff7b08"
RAID_CLASS_COLORS["DRUID"].r = 1
RAID_CLASS_COLORS["DRUID"].g = 0.49
RAID_CLASS_COLORS["DRUID"].b = 0.03
RAID_CLASS_COLORS["HUNTER"].colorStr = "ffaad673"
RAID_CLASS_COLORS["HUNTER"].r = 0.67
RAID_CLASS_COLORS["HUNTER"].g = 0.84
RAID_CLASS_COLORS["HUNTER"].b = 0.45
RAID_CLASS_COLORS["MAGE"].colorStr = "ff69cdff"
RAID_CLASS_COLORS["MAGE"].r = 0.41
RAID_CLASS_COLORS["MAGE"].g = 0.80
RAID_CLASS_COLORS["MAGE"].b = 1
RAID_CLASS_COLORS["PALADIN"].colorStr = "fff58cba"
RAID_CLASS_COLORS["PALADIN"].r = 0.96
RAID_CLASS_COLORS["PALADIN"].g = 0.55
RAID_CLASS_COLORS["PALADIN"].b = 0.73
RAID_CLASS_COLORS["PRIEST"].colorStr = "fff2f2f2"
RAID_CLASS_COLORS["PRIEST"].r = 0.95
RAID_CLASS_COLORS["PRIEST"].g = 0.95
RAID_CLASS_COLORS["PRIEST"].b = 0.95
RAID_CLASS_COLORS["ROGUE"].colorStr = "fffff152"
RAID_CLASS_COLORS["ROGUE"].r = 1
RAID_CLASS_COLORS["ROGUE"].g = 0.95
RAID_CLASS_COLORS["ROGUE"].b = 0.32
RAID_CLASS_COLORS["SHAMAN"].colorStr = "ff0270dd"
RAID_CLASS_COLORS["SHAMAN"].r = 0.01
RAID_CLASS_COLORS["SHAMAN"].g = 0.44
RAID_CLASS_COLORS["SHAMAN"].b = 0.87
RAID_CLASS_COLORS["WARLOCK"].colorStr = "ff9482c9"
RAID_CLASS_COLORS["WARLOCK"].r = 0.58
RAID_CLASS_COLORS["WARLOCK"].g = 0.51
RAID_CLASS_COLORS["WARLOCK"].b = 0.79
RAID_CLASS_COLORS["WARRIOR"].colorStr = "ffc79c68"
RAID_CLASS_COLORS["WARRIOR"].r = 0.78
RAID_CLASS_COLORS["WARRIOR"].g = 0.61
RAID_CLASS_COLORS["WARRIOR"].b = 0.43
T["Colors"] = oUF.colors
local T, C, L = select(2, ...):unpack()
local AddOnCommands = {} -- Let people use /tukui for their mods
local SelectedProfile = 0
local Split = function(cmd)
if cmd:find("%s") then
......@@ -23,9 +24,50 @@ EventTrace:SetScript("OnEvent", function(self, event)
end)
T.SlashHandler = function(cmd)
local arg1, arg2 = Split(cmd)
local arg1, arg2, arg3 = Split(cmd)
if (arg1 == "dt" or arg1 == "datatext") then
if (arg1 == "" or arg1 == "help") then
print(" ")
print("|cffff8000".. L.Help.Title .."|r")
print(L.Help.Chat)
print(L.Help.Config)
print(L.Help.Datatexts)
print(L.Help.Events)
print(L.Help.Gold)
print(L.Help.Grid)
print(L.Help.Happiness)
print(L.Help.Install)
print(L.Help.Keybinds)
print(L.Help.Load)
print(L.Help.MobsHealth)
print(L.Help.Move)
print(L.Help.Profile)
print(L.Help.Status)
print(L.Help.Test)
print(" ")
elseif (arg1 == "kb" or arg1 == "keybinds") then
T.Miscellaneous.Keybinds:Toggle()
elseif (arg1 == "mh") then
local SlashCommand = _G.SlashCmdList["LIBCLASSICMOBHEALTHONE"]
local Command = (arg3 and arg2.." "..arg3) or (arg2) or ""
SlashCommand(Command)
elseif (arg1 == "chat") then
if (arg2 == "reset") then
local Chat = T.Chat
if Chat then
TukuiData[GetRealmName()][UnitName("Player")].ChatReset = true
Chat:Install()
TukuiData[GetRealmName()][UnitName("Player")].Move.TukuiLeftDataTextBox = nil
TukuiData[GetRealmName()][UnitName("Player")].Move.TukuiRightDataTextBox = nil
ReloadUI()
end
end
elseif (arg1 == "dt" or arg1 == "datatext") then
local DataText = T["DataTexts"]
if arg2 then
......@@ -38,9 +80,37 @@ T.SlashHandler = function(cmd)
DataText:ToggleDataPositions()
end
elseif (arg1 == "install" or arg1 == "reset") then
local Install = T["Install"]
T.Popups.ShowPopup("RESETUI")
elseif (arg1 == "load" or arg1 == "unload") then
local Loaded, Reason = LoadAddOn(arg2)
Install:Launch()
if (Reason == "MISSING") then
T.Print("["..arg2.."] is not installed")
return
end
if arg1 == "load" then
if (IsAddOnLoaded(arg2)) then
T.Print("["..arg2.."] is already loaded")
return
end
EnableAddOn(arg2)
else
DisableAddOn(arg2)
end
ReloadUI()
elseif (arg1 == "br" or arg1 == "report") then
if arg2 == "enable" then
EnableAddOn("Blizzard_PTRFeedback")
else
DisableAddOn("Blizzard_PTRFeedback")
end
ReloadUI()
elseif (arg1 == "status" or arg1 == "debug") then
local Status = TukuiStatus
......@@ -59,43 +129,35 @@ T.SlashHandler = function(cmd)
local Movers = T["Movers"]
Movers:StartOrStopMoving()
elseif (arg1 == "" or arg1 == "help") then
print(" ")
print("|cffff8000".. L.Help.Title .."|r")
print(L.Help.Install)
print(L.Help.Datatexts)
print(L.Help.Config)
print(L.Help.Move)
print(L.Help.Test)
print(L.Help.Profile)
print(L.Help.Grid)
print(L.Help.Status)
print(" ")
elseif (arg1 == "c" or arg1 == "config") then
local Config = TukuiConfig
if (not TukuiConfig) then
T.Print(L.Others.ConfigNotFound)
return
elseif (arg1 == "ph" or arg1 == "happiness") then
if T.MyClass ~= "HUNTER" then
return T.Print("Sorry, you are not an |c"..RAID_CLASS_COLORS["HUNTER"].colorStr.."hunter|r, this command is useless for you. :P")
end
if (not TukuiConfigFrame) then
Config:CreateConfigWindow()
end
local Red, Yellow, Green = T.RGBToHex(unpack(T.Colors.happiness[1])), T.RGBToHex(unpack(T.Colors.happiness[2])), T.RGBToHex(unpack(T.Colors.happiness[3]))
if TukuiConfigFrame:IsVisible() then
TukuiConfigFrame:Hide()
local Happiness, DamagePercentage, LoyaltyRate = GetPetHappiness()
if not Happiness then
T.Print("You don't have any pet summoned at the moment")
else
TukuiConfigFrame:Show()
local Happy = ({"Unhappy", "Content", "Happy"})[Happiness]
local Loyalty = LoyaltyRate > 0 and "gaining" or "losing"
T.Print("Pet is " .. Happy)
T.Print("Pet is doing " .. DamagePercentage .. "% damage")
T.Print("Pet is " .. Loyalty .. " loyalty")
end
T.Print("You can also track your current pet happiness according to the pet frame health bar color. "..Red.."Red|r mean unhappy, "..Yellow.."yellow|r mean content, "..Green.."green|r mean happy.")
elseif (arg1 == "c" or arg1 == "config") then
T.GUI:Toggle()
elseif (arg1 == "gold") and (arg2 == "reset") then
local DataText = T["DataTexts"]
local MyRealm = GetRealmName()
local MyName = UnitName("player")
TukuiData["Gold"] = {}
TukuiData["Gold"][GetRealmName()] = {}
TukuiData["Gold"][GetRealmName()][UnitName("player")] = GetMoney()
DataText:ResetGold()
elseif (arg1 == "test" or arg1 == "testui") then
local Test = T["TestUI"]
......@@ -125,73 +187,48 @@ T.SlashHandler = function(cmd)
elseif (arg1 == "profile" or arg1 == "p") then
if not TukuiData then return end
if TukuiConfigPerAccount then
T.Print("Your settings are currently set accross toons so you can't use this command!")
return
end
if not arg2 then
print(" ")
T.Print("/tukui profile list")
print(" List current profiles available")
T.Print("/tukui profile #")
print(" Apply a profile, replace '#' with a profile number")
print(" ")
else
local IsConfigLoaded = IsAddOnLoaded("Tukui_Config")
if arg2 == "list" or arg2 == "l" then
Tukui.Profiles = {}
Tukui.Profiles.Data = {}
Tukui.Profiles.Options = {}
local EmptyTable = {}
for Server, Table in pairs(TukuiData) do
if not Server then return end
if Server ~= "Gold" then
for Character, Table in pairs(TukuiData[Server]) do
tinsert(Tukui.Profiles.Data, TukuiData[Server][Character])
if IsConfigLoaded then
if TukuiConfigShared and TukuiConfigShared[Server] and TukuiConfigShared[Server][Character] then
tinsert(Tukui.Profiles.Options, TukuiConfigShared[Server][Character])
else
if not TukuiConfigShared then
TukuiConfigShared = {}
end
if not TukuiConfigShared[Server] then
TukuiConfigShared[Server] = {}
end
if not TukuiConfigShared[Server][Character] then
TukuiConfigShared[Server][Character] = {}
end
for Character, Table in pairs(TukuiData[Server]) do
-- Data
tinsert(Tukui.Profiles.Data, TukuiData[Server][Character])
tinsert(Tukui.Profiles.Options, TukuiConfigShared[Server][Character])
end
end
print("Profile "..#Tukui.Profiles.Data..": ["..Server.."]-["..Character.."]")
-- GUI options, it can be not found if you didn't log at least once since version 1.10 on that toon.
if TukuiSettingsPerCharacter and TukuiSettingsPerCharacter[Server] and TukuiSettingsPerCharacter[Server][Character] then
tinsert(Tukui.Profiles.Options, TukuiSettingsPerCharacter[Server][Character])
else
tinsert(Tukui.Profiles.Options, EmptyTable)
end
print("Profile "..#Tukui.Profiles.Data..": ["..Server.."]-["..Character.."]")
end
end
else
local CurrentServer = GetRealmName()
local CurrentCharacter = UnitName("player")
local Profile = tonumber(arg2)
SelectedProfile = tonumber(arg2)
if not Tukui.Profiles or not Tukui.Profiles.Data[Profile] then
if not Tukui.Profiles or not Tukui.Profiles.Data[SelectedProfile] then
T.Print(L.Others.ProfileNotFound)
return
end
TukuiData[CurrentServer][CurrentCharacter] = Tukui.Profiles.Data[Profile]
if IsConfigLoaded then
TukuiConfigShared[CurrentServer][CurrentCharacter] = Tukui.Profiles.Options[Profile]
end
ReloadUI()
T.Popups.ShowPopup("TUKUI_IMPORT_PROFILE")
end
end
elseif AddOnCommands[arg1] then
......@@ -199,6 +236,36 @@ T.SlashHandler = function(cmd)
end
end
-- Create a Tukui popup for profiles
T.Popups.Popup["TUKUI_IMPORT_PROFILE"] = {
Question = "Are you sure you want to import this profile? Continue?",
Answer1 = ACCEPT,
Answer2 = CANCEL,
Function1 = function(self)
TukuiData[T.MyRealm][T.MyName] = Tukui.Profiles.Data[SelectedProfile]
if TukuiSettingsPerCharacter[T.MyRealm][T.MyName].General and TukuiSettingsPerCharacter[T.MyRealm][T.MyName].General.UseGlobal then
-- Look like we use globals for gui, don't import gui settings, keep globals
else
TukuiSettingsPerCharacter[T.MyRealm][T.MyName] = Tukui.Profiles.Options[SelectedProfile]
end
ReloadUI()
end,
}
T.Popups.Popup["RESETUI"] = {
Question = "Are you sure you want to reset Tukui to default?",
Answer1 = ACCEPT,
Answer2 = CANCEL,
Function1 = function(self)
local Install = T["Install"]
Install:ResetSettings()
Install:ResetData()
end,
}
SLASH_TUKUISLASHHANDLER1 = "/tukui"
SlashCmdList["TUKUISLASHHANDLER"] = T.SlashHandler
......
......@@ -3,6 +3,7 @@ local T, C, L = select(2, ...):unpack()
-- Hydra note: Since this file is going to be doing a lot of math/formatting, lets use locals for speed/cpu usage
-- This means no calling functions as methods :P ("string"):format(...) or ("string"):gsub(...) should be format("string", ...) and gsub("string", ...) etc.
local Infinity = math.huge
local reverse = string.reverse
local match = string.match
local modf = math.modf
......@@ -53,6 +54,10 @@ end
-- Format seconds to min/hour/day
T.FormatTime = function(s)
if s == Infinity then
return
end
local Day, Hour, Minute = 86400, 3600, 60
if (s >= Day) then
......
local T, C, L = select(2, ...):unpack()
----------------------------------------------------------------
-- This script will adjust resolution for optimal graphic
----------------------------------------------------------------
local Popups = T["Popups"]
local RequireRestart = false
Popups.Popup["CLIENT_RESTART"] = {
Question = L.Others.ResolutionChanged,
Answer1 = ACCEPT,
Answer2 = CANCEL,
Function1 = function(self)
ReloadUI()
end,
Function2 = function(self)
RequireRestart = false
end,
}
-- Optimize graphic after we enter world
local Graphic = CreateFrame("Frame")
Graphic:RegisterEvent("PLAYER_ENTERING_WORLD")
Graphic:SetScript("OnEvent", function(self, event)
if (event == "DISPLAY_SIZE_CHANGED") then
if not RequireRestart then
Popups.ShowPopup("CLIENT_RESTART")
end
RequireRestart = true
else
local UseUIScale = GetCVar("useUiScale")
if (UseUIScale ~= "1") then
SetCVar("useUiScale", 1)
end
if (format("%.2f", GetCVar("uiScale")) ~= format("%.2f", T.UIScale)) then
SetCVar("uiScale", T.UIScale)
end
-- Allow 4K and WQHD Resolution to have an UIScale lower than 0.64, which is
-- the lowest value of UIParent scale by default
if (T.UIScale < 0.64) then
UIParent:SetScale(T.UIScale)
end
self:UnregisterEvent("PLAYER_ENTERING_WORLD")
self:RegisterEvent("DISPLAY_SIZE_CHANGED")
end
end)
......@@ -4,7 +4,7 @@
-- [[ Build the engine ]] --
local AddOn, Engine = ...
local Resolution = GetCurrentResolution() > 0 and select(GetCurrentResolution(), GetScreenResolutions()) or nil
local Resolution = select(1, GetPhysicalScreenSize()).."x"..select(2, GetPhysicalScreenSize())
local Windowed = Display_DisplayModeDropDown:windowedmode()
local Fullscreen = Display_DisplayModeDropDown:fullscreenmode()
......@@ -20,8 +20,9 @@ end
Engine[1].WindowedMode = Windowed
Engine[1].FullscreenMode = Fullscreen
Engine[1].Resolution = Resolution or (Windowed and GetCVar("gxWindowedResolution")) or GetCVar("gxFullscreenResolution")
Engine[1].ScreenHeight = tonumber(string.match(Engine[1].Resolution, "%d+x(%d+)"))
Engine[1].ScreenWidth = tonumber(string.match(Engine[1].Resolution, "(%d+)x+%d"))
Engine[1].ScreenHeight = select(2, GetPhysicalScreenSize())
Engine[1].ScreenWidth = select(1, GetPhysicalScreenSize())
Engine[1].PerfectScale = min(1, max(0.64, 768 / string.match(Resolution, "%d+x(%d+)")))
Engine[1].MyName = UnitName("player")
Engine[1].MyClass = select(2, UnitClass("player"))
Engine[1].MyLevel = UnitLevel("player")
......@@ -32,9 +33,9 @@ Engine[1].Version = GetAddOnMetadata(AddOn, "Version")
Engine[1].VersionNumber = tonumber(Engine[1].Version)
Engine[1].WoWPatch, Engine[1].WoWBuild, Engine[1].WoWPatchReleaseDate, Engine[1].TocVersion = GetBuildInfo()
Engine[1].WoWBuild = tonumber(Engine[1].WoWBuild)
Engine[1].WelcomeMessage = "|cffff8000Tukui "..Engine[1].Version.."|r - /tukui help"
Engine[1].Hider = CreateFrame("Frame", nil, UIParent) Engine[1].Hider:Hide()
SLASH_RELOADUI1 = "/rl"
SlashCmdList.RELOADUI = ReloadUI
Tukui = Engine
\ No newline at end of file
Tukui = Engine
<Ui xmlns="http://www.blizzard.com/wow/ui/">
<Script file="Media.lua"/>
<Script file="API.lua"/>
<Script file="Colors.lua"/>
<Script file="Toolkit.lua"/>
<Script file="Popup.lua"/>
<Script file="Graphic.lua"/>
<Script file="Core.lua"/>
<Script file="Commands.lua"/>
<Script file="Animation.lua"/>
<Script file="Colors.lua"/>
<Script file="Install.lua"/>
<Script file="VersionCheck.lua"/>
<Script file="MoveUI.lua"/>
......
This diff is collapsed.
......@@ -2,15 +2,58 @@ local T, C, L = select(2, ...):unpack()
local Loading = CreateFrame("Frame")
function Loading:StoreDefaults()
T.Defaults = {}
for group, options in pairs(C) do
if (not T.Defaults[group]) then
T.Defaults[group] = {}
end
for option, value in pairs(options) do
T.Defaults[group][option] = value
if (type(C[group][option]) == "table") then
if C[group][option].Options then
T.Defaults[group][option] = value.Value
else
T.Defaults[group][option] = value
end
else
T.Defaults[group][option] = value
end
end
end
end
function Loading:LoadCustomSettings()
local Settings
local Name = UnitName("Player")
local Realm = GetRealmName()
if (TukuiConfigPerAccount) then
Settings = TukuiConfigShared.Account
if (not TukuiSettingsPerCharacter) then
TukuiSettingsPerCharacter = {}
end
if (not TukuiSettingsPerCharacter[T.MyRealm]) then
TukuiSettingsPerCharacter[T.MyRealm] = {}
end
if (not TukuiSettingsPerCharacter[T.MyRealm][T.MyName]) then
if TukuiSettingsPerChar ~= nil then
-- old table for gui settings, TukuiSettingsPerChar is now deprecated and will be removed in a future build
TukuiSettingsPerCharacter[T.MyRealm][T.MyName] = TukuiSettingsPerChar
else
TukuiSettingsPerCharacter[T.MyRealm][T.MyName] = {}
end
end
if not TukuiSettings then
TukuiSettings = {}
end
if TukuiSettingsPerCharacter[T.MyRealm][T.MyName].General and TukuiSettingsPerCharacter[T.MyRealm][T.MyName].General.UseGlobal == true then
Settings = TukuiSettings
else
Settings = TukuiConfigShared[Realm][Name]
Settings = TukuiSettingsPerCharacter[T.MyRealm][T.MyName]
end
for group, options in pairs(Settings) do
......@@ -24,12 +67,20 @@ function Loading:LoadCustomSettings()
else
Count = Count + 1
C[group][option] = value
if (type(C[group][option]) == "table") then
if C[group][option].Options then
C[group][option].Value = value
else
C[group][option] = value
end
else
C[group][option] = value
end
end
end
end
-- Keeps TukuiConfig clean and small
-- Keeps settings clean and small
if (Count == 0) then
Settings[group] = nil
end
......@@ -39,147 +90,72 @@ function Loading:LoadCustomSettings()
end
end
function Loading:OnEvent(event, addon)
if (event == "PLAYER_LOGIN") then
-- LOAD SETTINGS
self:LoadCustomSettings()
-- LOAD AUTOMATIC SCALING IF AUTOSCALE IF ON
local Scaling = C.General.Scaling.Value
local Adjust = (T.ScreenHeight / 10000) / 2
local UIScale = min(2, max(0.01, 768 / string.match(T.Resolution, "%d+x(%d+)")))
if (Scaling == "Smallest") then
if (T.ScreenHeight >= 1600) then
-- 0.35555556416512 + 0.108 = 0.463 on 4K monitor
UIScale = UIScale + Adjust
else
UIScale = 0.64 - Adjust
end
elseif (Scaling == "Small") then
UIScale = 0.64
elseif (Scaling == "Medium") then
UIScale = 0.64 + Adjust
elseif (Scaling == "Large") then
UIScale = 0.64 + Adjust + Adjust
elseif (Scaling == "Oversize") then
UIScale = 0.64 + Adjust + Adjust + Adjust
end
-- This is for 4K with pixel pecfection scaling
if (T.ScreenHeight >= 1600) and (Scaling == "Pixel Perfection") then
UIScale = UIScale * 2 -- Pixel Perfection Scaling, X 2 to still be almost pixel perfect, should be around 0.71
end
T.Mult = 768 / string.match(T.Resolution, "%d+x(%d+)") / UIScale
T.UIScale = UIScale
function Loading:Enable()
local Toolkit = T00LKIT
-- PANELS
T["Panels"]:Enable()
self:StoreDefaults()
self:LoadCustomSettings()
-- INVENTORY
-- Bags
if (C.Bags.Enable) then
T["Inventory"]["Bags"]:Enable()
end
Toolkit.Settings.BackdropColor = C.General.BackdropColor
Toolkit.Settings.BorderColor = C.General.BorderColor
Toolkit.Settings.UIScale = C.General.UIScale
-- Loot Frame
T["Inventory"]["Loot"]:Enable()
SetCVar("uiScale", Toolkit.Settings.UIScale)
SetCVar("useUiScale", 1)
-- Merchant
T["Inventory"]["Merchant"]:Enable()
-- ACTION BARS
if (C.ActionBars.Enable) then
T["ActionBars"]:Enable()
end
-- COOLDOWNS
T["Cooldowns"]:Enable()
-- MISCELLANEOUS
if C["Misc"].ThreatBarEnable then
T["Miscellaneous"]["ThreatBar"]:Enable()
end
if C["Misc"].AltPowerBarEnable then
T["Miscellaneous"]["AltPowerBar"]:Enable()
end
if C["Misc"].ExperienceEnable then
T["Miscellaneous"]["Experience"]:Enable()
end
if C["Misc"].ReputationEnable then
T["Miscellaneous"]["Reputation"]:Enable()
end
if C["Misc"].ErrorFilterEnable then
T["Miscellaneous"]["ErrorFilter"]:Enable()
end
if C["Misc"].AutoInviteEnable then
T["Miscellaneous"]["Invite"]:Enable()
end
T["Miscellaneous"]["MirrorTimers"]:Enable()
T["Miscellaneous"]["DropDown"]:Enable()
T["Miscellaneous"]["CollectGarbage"]:Enable()
T["Miscellaneous"]["GameMenu"]:Enable()
T["Miscellaneous"]["LossControl"]:Enable()
T["Miscellaneous"]["StaticPopups"]:Enable()
T["Miscellaneous"]["TimerTracker"]:Enable()
T["Miscellaneous"]["Durability"]:Enable()
T["Miscellaneous"]["UIWidgets"]:Enable()
T["Miscellaneous"]["Ghost"]:Enable()
T["Miscellaneous"]["VehicleIndicator"]:Enable()
T["Miscellaneous"]["TalkingHead"]:Enable()
T["Miscellaneous"]["DeathRecap"]:Enable()
T["Miscellaneous"]["AFK"]:Enable()
T["Miscellaneous"]["OrderHall"]:Enable()
T["Miscellaneous"]["UIErrorFilter"]:Enable()
-- BUFFS
if (C.Auras.Enable) then
T["Auras"]:Enable()
end
-- Maps
T["Maps"]["Minimap"]:Enable()
T["Maps"]["Zonemap"]:Enable()
T["Maps"]["Worldmap"]:Enable()
-- DATATEXTS
T["DataTexts"]:Enable()
-- CHAT
T["Chat"]:Enable()
-- UNITFRAMES
T["UnitFrames"]:Enable()
-- TOOLTIPS
T["Tooltips"]:Enable()
-- PET BATTLES
T["PetBattles"]:Enable()
-- Because peoples seem to not know about this?
print(T.WelcomeMessage)
if C.General.HideShadows then
Toolkit.Settings.ShadowTexture = ""
end
end
-- Taint Fix
ShowUIPanel(SpellBookFrame)
HideUIPanel(SpellBookFrame)
function Loading:OnEvent(event)
if (event == "PLAYER_LOGIN") then
T["Panels"]:Enable()
T["Inventory"]["Bags"]:Enable()
T["Inventory"]["Loot"]:Enable()
T["Inventory"]["GroupLoot"]:Enable()
T["Inventory"]["Merchant"]:Enable()
T["ActionBars"]:Enable()
T["Cooldowns"]:Enable()
T["Miscellaneous"]["Experience"]:Enable()
T["Miscellaneous"]["Reputation"]:Enable()
T["Miscellaneous"]["ErrorFilter"]:Enable()
T["Miscellaneous"]["MirrorTimers"]:Enable()
T["Miscellaneous"]["DropDown"]:Enable()
T["Miscellaneous"]["CollectGarbage"]:Enable()
T["Miscellaneous"]["GameMenu"]:Enable()
T["Miscellaneous"]["StaticPopups"]:Enable()
T["Miscellaneous"]["Durability"]:Enable()
T["Miscellaneous"]["UIWidgets"]:Enable()
T["Miscellaneous"]["AFK"]:Enable()
T["Miscellaneous"]["MicroMenu"]:Enable()
T["Miscellaneous"]["GuildNamesByClassColor"]:Enable()
T["Miscellaneous"]["Keybinds"]:Enable()
T["Auras"]:Enable()
T["Maps"]["Minimap"]:Enable()
T["Maps"]["Zonemap"]:Enable()
T["Maps"]["Worldmap"]:Enable()
T["DataTexts"]:Enable()
T["Chat"]:Enable()
T["UnitFrames"]:Enable()
T["Tooltips"]:Enable()
-- restore original stopwatch commands
SlashCmdList["STOPWATCH"] = Stopwatch_Toggle
-- welcome message
T.Print("Welcome |c"..RAID_CLASS_COLORS[T.MyClass].colorStr..T.MyName.."|r! For a commands list, type /tukui")
elseif (event == "PLAYER_ENTERING_WORLD") then
-- OBJECTIVE TRACKER
T["Miscellaneous"]["ObjectiveTracker"]:Enable()
T["Miscellaneous"]["ObjectiveTracker"]:Enable()
elseif (event == "VARIABLES_LOADED") then
T["Loading"]:Enable()
T["GUI"]:Enable()
end
end
Loading:RegisterEvent("PLAYER_LOGIN")
Loading:RegisterEvent("VARIABLES_LOADED")
Loading:RegisterEvent("PLAYER_ENTERING_WORLD")
Loading:RegisterEvent("ADDON_LOADED")
Loading:SetScript("OnEvent", Loading.OnEvent)
T["Loading"] = Loading
......@@ -7,14 +7,14 @@ local Locale = GetLocale()
local TukuiFont = CreateFont("TukuiFont")
TukuiFont:SetFont(C["Medias"].Font, 12)
TukuiFont:SetShadowColor(0, 0, 0)
TukuiFont:SetShadowOffset(1.25, -1.25)
TukuiFont:SetShadowOffset(1, -1)
local TukuiFontOutline = CreateFont("TukuiFontOutline")
TukuiFontOutline:SetFont(C["Medias"].Font, 12, "THINOUTLINE")
local TukuiUFFont = CreateFont("TukuiUFFont")
TukuiUFFont:SetShadowColor(0, 0, 0)
TukuiUFFont:SetShadowOffset(1.25, -1.25)
TukuiUFFont:SetShadowOffset(1, -1)
TukuiUFFont:SetFont(C["Medias"].UnitFrameFont, 12)
local TukuiUFFontOutline = CreateFont("TukuiUFFontOutline")
......@@ -23,9 +23,12 @@ TukuiUFFontOutline:SetFont(C["Medias"].UnitFrameFont, 12, "THINOUTLINE")
local PixelFont = CreateFont("TukuiPixelFont")
PixelFont:SetFont(C["Medias"].PixelFont, 12, "MONOCHROMEOUTLINE")
local TukuiDamageFont = CreateFont("TukuiDamageFont")
TukuiDamageFont:SetFont(C["Medias"].DamageFont, 12, "OUTLINE")
local TextureTable = {
["Blank"] = [[Interface\BUTTONS\WHITE8X8]],
["Tukui"] = [[Interface\AddOns\Tukui\Medias\Textures\Status\Tukui1]],
["Tukui"] = [[Interface\AddOns\Tukui\Medias\Textures\Status\Tukui]],
["ElvUI1"] = [[Interface\AddOns\Tukui\Medias\Textures\Status\ElvUI1]],
["ElvUI2"] = [[Interface\AddOns\Tukui\Medias\Textures\Status\ElvUI2]],
["sRainbow1"] = [[Interface\AddOns\Tukui\Medias\Textures\Status\Rainbow1]],
......@@ -59,6 +62,7 @@ local FontTable = {
["Tukui UF Outline"] = "TukuiUFFontOutline",
["Pixel"] = "TukuiPixelFont",
["Game Font"] = "GameFontWhite",
["Tukui Damage"] = "TukuiDamageFont",
}
T.GetFont = function(font)
......
......@@ -36,6 +36,10 @@ function Movers:RestoreDefaults(button)
local Frame = _G[FrameName]
local Parent = _G[ParentName]
if not Parent then
Parent = UIParent
end
Frame:ClearAllPoints()
Frame:SetPoint(Anchor1, Parent, Anchor2, X, Y)
......@@ -56,6 +60,8 @@ function Movers:RegisterFrame(frame)
end
function Movers:OnDragStart()
GameTooltip_Hide()
self:StartMoving()
end
......@@ -75,14 +81,29 @@ function Movers:OnDragStop()
end
Data[FrameName] = {Anchor1, Parent:GetName(), Anchor2, X, Y}
Movers:OnEnter()
end
function Movers:OnEnter()
GameTooltip:SetOwner(self)
GameTooltip:SetAnchorType("ANCHOR_CURSOR")
GameTooltip:AddLine("Hold left click to drag") -- LOCALIZE ME PLZ
GameTooltip:AddLine("Right click to reset default") -- LOCALIZE ME PLZ
GameTooltip:Show()
end
function Movers:OnLeave()
GameTooltip_Hide()
end
function Movers:CreateDragInfo()
self.DragInfo = CreateFrame("Button", nil, self)
self.DragInfo:SetAllPoints(self)
self.DragInfo:SetTemplate()
self.DragInfo:SetBackdropBorderColor(1, 0, 0)
self.DragInfo:FontString("Text", C.Medias.UnitFrameFont, 12)
self.DragInfo:SetBorderColor(1, 0, 0)
self.DragInfo.Text = self.DragInfo:CreateFontString(nil, "OVERLAY")
self.DragInfo.Text:SetFontTemplate(C.Medias.UnitFrameFont, 16)
self.DragInfo.Text:SetText(self:GetName())