Merging pull request 'Add support for transliteration' by Vardex.

This commit adds the code changes in Details! that is required to make the new library work.
This commit is contained in:
Tercio Jose
2019-10-27 18:07:15 -03:00
parent 9e97edb7c5
commit b700d87491
8 changed files with 65 additions and 14 deletions
+1 -1
View File
@@ -125,7 +125,7 @@ size = number, adjust the size of the border.
color = table, {r, g, b, a}
texture = string, edge name for SharedMedia:Fetch ("border", texture)
instance:SetBarTextSettings (size, font, fixedcolor, leftcolorbyclass, rightcolorbyclass, leftoutline, rightoutline, customrighttextenabled, customrighttext, percentage_type, showposition, customlefttextenabled, customlefttext)
instance:SetBarTextSettings (size, font, fixedcolor, leftcolorbyclass, rightcolorbyclass, leftoutline, rightoutline, customrighttextenabled, customrighttext, percentage_type, showposition, customlefttextenabled, customlefttext, translittest)
size = number, text size
font = string, text font, e.g "Arrial Narrow"
fixedcolor = table with {r, b, g, a} or html color string (e.g. "blue").
+2 -2
View File
@@ -1,5 +1,5 @@
local dversion = 153
local dversion = 154
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary (major, minor)
@@ -21,7 +21,7 @@ SMALL_NUMBER = 0.000001
ALPHA_BLEND_AMOUNT = 0.8400251
DF.AuthorInfo = {
Name = "Tercioo",
Name = "Terciob",
Discord = "https://discord.gg/AGSzAZX",
}
+1
View File
@@ -18,4 +18,5 @@
<Include file="LibItemUpgradeInfo-1.0\LibItemUpgradeInfo-1.0.xml"/>
<!-- <Include file="LibGroupInSpecT-1.1\lib.xml"/> temp disabled due to classic-->
<Include file="DF\load.xml"/>
<Include file="LibTranslit\LibTranslit-1.0.xml"/>
</Ui>
+7 -6
View File
@@ -1,8 +1,8 @@
-- damage object
--2672
local _detalhes = _G._detalhes
local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" )
local Translit = LibStub ("LibTranslit-1.0")
local gump = _detalhes.gump
local _
@@ -2672,6 +2672,11 @@ local InBarIconPadding = 6
bar_number = bar.colocacao .. ". "
end
--translate cyrillic alphabet to western alphabet by Vardex (https://github.com/Vardex May 22, 2019)
if (instance.row_info.textL_translit_text) then
self.displayName = Translit:Transliterate(self.displayName, "!")
end
if (enemy) then
if (arena_enemy) then
if (_detalhes.show_arena_role_icon) then
@@ -5158,11 +5163,7 @@ end
if (not no_refresh) then
_detalhes.refresh:r_atributo_damage (actor, shadow)
end
--a referncia do .owner pode ter sido apagada?
--os 2 segmentos foram juntados porm a referncia do owner de um pet criado ali em cima deve ser nula?
--teria que analisar se o novo objecto de um pet e colocar a referncia do owner no pet novamente, ou pelo menos verificar se a referncia valida
--> tempo decorrido (captura de dados)
local end_time = actor.end_time
if (not actor.end_time) then
+10
View File
@@ -1,4 +1,12 @@
--default values for instances (windows)
--if a new value is added here and it does not exists (nil) in the instance, it'll be copied into it
--the value added can be overwritten in the skins.lua file or /run Details:GetWindow(1).<value> =
--or thought a new option in the options panel
--values added into 'instance_skin_ignored_values' won't be passed when the user exports the profile or exports the skin individually.
local _detalhes = _G._detalhes
local SharedMedia = LibStub:GetLibrary("LibSharedMedia-3.0")
@@ -197,6 +205,8 @@ _detalhes.instance_defaults = {
textR_separator = ",",
--left text bar number
textL_show_number = true,
--translit text by Vardex (https://github.com/Vardex May 22, 2019)
textL_translit_text = false,
--if text class color are false, this color will be used
fixed_text_color = {1, 1, 1},
--left text outline effect
+3 -3
View File
@@ -6,13 +6,13 @@ local _
--> install skin function:
function _detalhes:InstallSkin (skin_name, skin_table)
if (not skin_name) then
return false -- sem nome
return false -- skin without a name
elseif (_detalhes.skins [skin_name]) then
return false -- ja existe
return false -- skin with this name already exists
end
if (not skin_table.file) then
return false -- sem arquivo
return false -- no skin file
end
skin_table.author = skin_table.author or ""
+35 -1
View File
@@ -1,4 +1,10 @@
--[[ options panel file --]]
--[[
options panel file
please note: this file was wrote on 2012 when Details! had only 5 options,
the addon got bigger but I keeped the same format, you're free to judge my decision.
--]]
--[[
search for "~number" without the quotes to quick access the page:
@@ -6770,6 +6776,30 @@ function window:CreateFrame5()
window:CreateLineBackground2 (frame5, "PositionNumberSlider", "PositionNumberLabel", Loc ["STRING_OPTIONS_TEXT_LPOSITION_DESC"])
--> left translit text by Vardex (https://github.com/Vardex May 22, 2019)
g:NewSwitch (frame5, _, "$parentTranslitTextSlider", "TranslitTextSlider", 60, 20, _, _, instance.row_info.textL_translit_text, nil, nil, nil, nil, options_switch_template)
g:NewLabel (frame5, _, "$parentTranslitTextLabel", "TranslitTextLabel", Loc ["STRING_OPTIONS_TEXT_LTRANSLIT"], "GameFontHighlightLeft")
frame5.TranslitTextSlider:SetPoint ("left", frame5.TranslitTextLabel, "right", 2)
frame5.TranslitTextSlider:SetAsCheckBox()
frame5.TranslitTextSlider.OnSwitch = function (self, instance, value)
instance:SetBarTextSettings (nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, value)
if (_detalhes.options_group_edit and not DetailsOptionsWindow.loading_settings) then
for _, this_instance in ipairs (instance:GetInstanceGroup()) do
if (this_instance ~= instance) then
this_instance:SetBarTextSettings (nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, value)
end
end
end
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
end
window:CreateLineBackground2 (frame5, "TranslitTextSlider", "TranslitTextLabel", Loc ["STRING_OPTIONS_TEXT_LTRANSLIT_DESC"])
--> right outline
g:NewSwitch (frame5, _, "$parentTextRightOutlineSlider", "textRightOutlineSlider", 60, 20, _, _, instance.row_info.textR_outline, nil, nil, nil, nil, options_switch_template)
g:NewLabel (frame5, _, "$parentTextRightOutlineLabel", "textRightOutlineLabel", Loc ["STRING_OPTIONS_TEXT_LOUTILINE"], "GameFontHighlightLeft")
@@ -7284,6 +7314,7 @@ function window:CreateFrame5()
{"OutlineSmallColorLabelLeft", 2},
{"classColorsLeftTextLabel", 3},
{"PositionNumberLabel", 4},
{"TranslitTextLabel", 5},
{"cutomLeftTextLabel", 5, true},
{"cutomLeftTextEntryLabel", 6},
}
@@ -11530,6 +11561,9 @@ end --> if not window
_G.DetailsOptionsWindow5PositionNumberSlider.MyObject:SetFixedParameter (editing_instance)
_G.DetailsOptionsWindow5PositionNumberSlider.MyObject:SetValue (editing_instance.row_info.textL_show_number)
_G.DetailsOptionsWindow5TranslitTextSlider.MyObject:SetFixedParameter (editing_instance)
_G.DetailsOptionsWindow5TranslitTextSlider.MyObject:SetValue (editing_instance.row_info.textL_translit_text)
_G.DetailsOptionsWindow5BracketDropdown.MyObject:SetFixedParameter (editing_instance)
_G.DetailsOptionsWindow5SeparatorDropdown.MyObject:SetFixedParameter (editing_instance)
_G.DetailsOptionsWindow5RightTextShowTotalSlider.MyObject:SetFixedParameter (editing_instance)
+6 -1
View File
@@ -4135,7 +4135,7 @@ function gump:CriaNovaBarra (instancia, index)
return new_row
end
function _detalhes:SetBarTextSettings (size, font, fixedcolor, leftcolorbyclass, rightcolorbyclass, leftoutline, rightoutline, customrighttextenabled, customrighttext, percentage_type, showposition, customlefttextenabled, customlefttext, smalloutline_left, smalloutlinecolor_left, smalloutline_right, smalloutlinecolor_right)
function _detalhes:SetBarTextSettings (size, font, fixedcolor, leftcolorbyclass, rightcolorbyclass, leftoutline, rightoutline, customrighttextenabled, customrighttext, percentage_type, showposition, customlefttextenabled, customlefttext, smalloutline_left, smalloutlinecolor_left, smalloutline_right, smalloutlinecolor_right, translittext)
--> size
if (size) then
@@ -4219,6 +4219,11 @@ function _detalhes:SetBarTextSettings (size, font, fixedcolor, leftcolorbyclass,
if (type (showposition) == "boolean") then
self.row_info.textL_show_number = showposition
end
--> translit text by Vardex (https://github.com/Vardex May 22, 2019)
if (type (translittext) == "boolean") then
self.row_info.textL_translit_text = translittext
end
self:InstanceReset()
self:InstanceRefreshRows()