Skip to content

Commit

Permalink
Merging pull request 'Add support for transliteration' by Vardex.
Browse files Browse the repository at this point in the history
This commit adds the code changes in Details! that is required to make the new library work.
  • Loading branch information
Tercioo committed Oct 27, 2019
1 parent 9e97edb commit b700d87
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 14 deletions.
2 changes: 1 addition & 1 deletion API UI.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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").
Expand Down
4 changes: 2 additions & 2 deletions Libs/DF/fw.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

local dversion = 153
local dversion = 154
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary (major, minor)

Expand All @@ -21,7 +21,7 @@ SMALL_NUMBER = 0.000001
ALPHA_BLEND_AMOUNT = 0.8400251

DF.AuthorInfo = {
Name = "Tercioo",
Name = "Terciob",
Discord = "https://discord.gg/AGSzAZX",
}

Expand Down
1 change: 1 addition & 0 deletions Libs/libs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
13 changes: 7 additions & 6 deletions classes/classe_damage.lua
Original file line number Diff line number Diff line change
@@ -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 _

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -5158,11 +5163,7 @@ end
if (not no_refresh) then
_detalhes.refresh:r_atributo_damage (actor, shadow)
end

--a refer�ncia do .owner pode ter sido apagada?
--os 2 segmentos foram juntados por�m a refer�ncia 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 refer�ncia do owner no pet novamente, ou pelo menos verificar se a refer�ncia � valida


--> tempo decorrido (captura de dados)
local end_time = actor.end_time
if (not actor.end_time) then
Expand Down
10 changes: 10 additions & 0 deletions classes/classe_instancia_include.lua
Original file line number Diff line number Diff line change
@@ -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")

Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions functions/skins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
Expand Down
36 changes: 35 additions & 1 deletion gumps/janela_options.lua
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -7284,6 +7314,7 @@ function window:CreateFrame5()
{"OutlineSmallColorLabelLeft", 2},
{"classColorsLeftTextLabel", 3},
{"PositionNumberLabel", 4},
{"TranslitTextLabel", 5},
{"cutomLeftTextLabel", 5, true},
{"cutomLeftTextEntryLabel", 6},
}
Expand Down Expand Up @@ -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)
Expand Down
7 changes: 6 additions & 1 deletion gumps/janela_principal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit b700d87

Please sign in to comment.