gui: add animation speed dropdown menu

This commit is contained in:
shagu
2017-07-29 15:06:06 +02:00
parent c1ca648fdd
commit 95a611a46d
2 changed files with 29 additions and 1 deletions
+19
View File
@@ -637,5 +637,24 @@ function pfUI:MigrateConfig()
end
end
-- migrating animation_speed (> 3.1.2)
if checkversion(3, 1, 2) then
if tonumber(pfUI_config.unitframes.animation_speed) >= 13 then
pfUI_config.unitframes.animation_speed = "13"
elseif tonumber(pfUI_config.unitframes.animation_speed) >= 8 then
pfUI_config.unitframes.animation_speed = "8"
elseif tonumber(pfUI_config.unitframes.animation_speed) >= 5 then
pfUI_config.unitframes.animation_speed = "5"
elseif tonumber(pfUI_config.unitframes.animation_speed) >= 3 then
pfUI_config.unitframes.animation_speed = "3"
elseif tonumber(pfUI_config.unitframes.animation_speed) >= 2 then
pfUI_config.unitframes.animation_speed = "2"
elseif tonumber(pfUI_config.unitframes.animation_speed) >= 1 then
pfUI_config.unitframes.animation_speed = "1"
else
pfUI_config.unitframes.animation_speed = "5"
end
end
pfUI_config.version = pfUI.version.string
end
+10 -1
View File
@@ -604,6 +604,15 @@ pfUI:RegisterModule("gui", function ()
table.insert(dropdown_selection_fonts, "Fonts\\FZXHLJW.TTF:FZXHLJW")
end
local dropdown_unitframes_animationspeed = {
"1:" .. T["Instant"],
"2:" .. T["Very Fast"],
"3:" .. T["Fast"],
"5:" .. T["Medium"],
"8:" .. T["Slow"],
"13:" .. T["Very Slow"],
}
local dropdown_unitframes_text = {
"none:" .. T["Disable"],
"unit:" .. T["Unit String"],
@@ -873,7 +882,7 @@ pfUI:RegisterModule("gui", function ()
CreateConfig(this, T["Custom Health Bar Color"], C.unitframes, "customcolor", "color")
CreateConfig(this, T["Enable Custom Color Health Bar Background"], C.unitframes, "custombg", "checkbox")
CreateConfig(this, T["Custom Health Bar Background Color"], C.unitframes, "custombgcolor", "color")
CreateConfig(this, T["Healthbar Animation Speed"], C.unitframes, "animation_speed")
CreateConfig(this, T["Healthbar Animation Speed"], C.unitframes, "animation_speed", "dropdown", dropdown_unitframes_animationspeed)
CreateConfig(this, T["Portrait Alpha"], C.unitframes, "portraitalpha")
CreateConfig(this, T["Always Use 2D Portraits"], C.unitframes, "always2dportrait", "checkbox")
CreateConfig(this, T["Enable 2D Portraits As Fallback"], C.unitframes, "portraittexture", "checkbox")