diff --git a/API UI.txt b/API UI.txt index dcef64ce..9b0ebe53 100644 --- a/API UI.txt +++ b/API UI.txt @@ -246,3 +246,9 @@ returns a table containing the texture file and coords for a arena. Details:GetBattlegroundInfo (mapid) returns a table containing the texture file and coords for a battleground. + +Details:GelectNumericalSystem() +returns a number indicating which are the current numerical system: 1 for american/european, 2 for asian. + +Details:SelectNumericalSystem (system) +Set the numerical system to be used, 1 for american/european, 2 for asian. \ No newline at end of file diff --git a/boot.lua b/boot.lua index 00a7cc84..4645a63c 100644 --- a/boot.lua +++ b/boot.lua @@ -1,10 +1,10 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> global name declaration - + _ = nil _detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0") _detalhes.build_counter = 2059 --it's 2061 for release - _detalhes.userversion = "v4.0.5e" + _detalhes.userversion = "v4.0.6" _detalhes.realversion = 76 --core version _detalhes.version = _detalhes.userversion .. " (core " .. _detalhes.realversion .. ")" Details = _detalhes @@ -28,7 +28,7 @@ do -- - Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v4.0.5e (|cFFFFCC00Oct 28, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r More improvements for East Asian Numerical System.\n\n|cFFFFFF00v4.0.5c (|cFFFFCC00Oct 24, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added an option to disable the all-displays window (right click on title bar).\n\n|cFFFFFF00-|r Added an option to suppress segment changes after killing a boss encounter (experimental).\n\n|cFFFFFF00-|r Fixed pet battles auto hide.\n\n|cFFFFFF00-|r Fixed an issue with bar animations starting from the middle of the bar.\n\n|cFFFFFF00-|r Fixed buffs and spell cast start on weakauras creator tool.\n\n|cFFFFFF00v4.0.3a (|cFFFFCC00Set 29, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fix for an error on Damage Taken By Spell display.\n\n|cFFFFFF00v4.0.3 (|cFFFFCC00Set 27, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Some improvements on Plugin's icon at the title bar.\n\n|cFFFFFF00v4.0.2 (|cFFFFCC00Set 26, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added 'ShielTronic Shield' on HealthPotion & Stone display.\n\n|cFFFFFF00-|r Improvements done on Vanguard Plugin.\n\n|cFFFFFF00-|r Fixed an alignment issue which was happening with few tooltips.\n\n|cFFFFFF00-|r Fixed a problem where sometimes the addon crashes while doing a /reload during raid.\n\n|cFFFFFF00-|r Fixed the creation of auras for weakauras from the Forge (/details forge).\n\n|cFFFFFF00v4.0.1 (|cFFFFCC00Set 21, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added an options to use a customized skin file.\n\n|cFFFFFF00-|r Added an options to use a customized bar texture file.\n\n|cFFFFFF00-|r A Package with photoshop files with examples and the skin file for Minimalistic skin are available at WoW Interface.\n\n|cFFFFFF00-|r Added 'API Custom Displays.txt' on Details! folder, this file explain how to create scripts for custom displays.\n\n|cFFFFFF00v4.0h (|cFFFFCC00Set 19, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Created new plugin 'Target Caller' for RBGs, it's available at Curse.com.\n\n|cFFFFFF00-|r Fixed death display color when not using colored by the player class.\n\n|cFFFFFF00-|r Fixed a rare bug where the window for Encounter Details Plugin won't open when clicking on its icon.\n\n|cFFFFFF00-|r Added officer channel to 'Announce Death' feature.\n\n|cFFFFFF00v4.0f (|cFFFFCC00Set 16, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fix for the title bar encounter timer.\n\n|cFFFFFF00v4.0e (|cFFFFCC00Set 14, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added a custom display for Crowd Control Received.\n\n|cFFFFFF00-|r Weak Aura Creator Tool, now has full support for BigWigs and Dbm time bars.\n\n|cFFFFFF00-|r Auras for interrupt and dispelling has been added on the Weak Aura Creator Tool.\n\n|cFFFFFF00-|r Details! Forge now has support for DBM and BigWigs time bars.\n\n|cFFFFFF00-|r Solo Plugins now has a close button on their panels.\n\n|cFFFFFF00-|r Fixed damage/healing score message after a boss kill.\n\n|cFFFFFF00-|r Now, an alert to open the history panel is shown after killing a boss.\n\n|cFFFFFF00-|r Added a 'all-displays' menu when right clicking title bar.\n\n|cFFFFFF00-|r Removed few texture from bookmarks panel, now it has a more clean appearance.\n\n|cFFFFFF00-|r Updated Details! Framework.\n\n|cFFFFFF00-|r Added option in order to change the bar orientation.\n\n|cFFFFFF00-|r Added an option to make the menus on title bar work with clicks instead of hovering over them.\n\n|cFFFFFF00-|r Healing for battleground enemies is now placed on healing done instead of enemy healing done.\n\n|cFFFFFF00-|r Improvements on our support for Arena battles.\n\n|cFFFFFF00-|r Fixed some issues on the Player Detail Window.\n\n|cFFFFFF00-|r Fixed encounter time on title bar text.\n\n|cFFFFFF00-|r Fixed death display tooltip, wasn't respecting the font and size set on options panel.\n\n|cFFFFFF00v3.18.5 (|cFFFFCC00Aug 19, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Improvements on Weakauras creation from Encounter Details plugin.\n\n|cFFFFFF00-|r Improvements on 'Auto Switch to Current' feature. Details! windows are now more responsible about auto changing a segment while the player, for instance, has the report window opened.\n\n|cFFFFFF00-|r Added slash command '/de wipe'. It ends the raid encounter segment and stop capturing data.\nIf you are the raid leader, all other users of Details! will also stop.\nWorks great for players not make damage padding after a wipe call.\n\n|cFFFFFF00-|r Added the overheal made by pets on tooltip and player details window.\n\n|cFFFFFF00-|r Added an option to disable stretch button and bar highlight.\n\n|cFFFFFF00-|r Disabling nicknames now also disable avatars.\n\n|cFFFFFF00-|r Added 'spinal healing injector' on custom display 'Health Potion & Stone' used.\n\n|cFFFFFF00-|r Fixed title text width when auto-hide menu buttons is enabled.\n\n|cFFFFFF00-|r Fixed item level of timewarped items.\n\n|cFFFFFF00-|r Fixed report for custom display Crowd Control.\n\n|cFFFFFF00-|r Fixed role icons on custom displays.\n\n|cFFFFFF00-|r Fixed an issue with dropdown boxes where wasn't showing all options.\n\n|cFFFFFF00-|r Fixed Ticket #53: background alpha after stretching which wasn't correctly coming back to original color.\n\n|cFFFFFF00-|r Fixed ticket #51: API Call 'GetCombat('overall')' wasn't returning the overall combat object.\n\n|cFFFFFF00-|r Fixed ticket #50: issue opening icon selection frame.\n\n|cFFFFFF00v3.17.12 (|cFFFFCC00Aug 05, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added an option for lock micro displays. When locked they don't interact with mouse or stay on top of menus.\n\n|cFFFFFF00-|r Fixed ticket #49: death display not working correctly with sort direction bottom-to-top.\n\n|cFFFFFF00-|r Fixed an issue with death display where the text wasn't updating their width correctly.\n\n|cFFFFFF00-|r Fixed an issue with energy and miscellaneous displays type not working correctly with bar animations.\n\n|cFFFFFF00-|r Fixed an issue while loading old profiles wans't updating their values for newer versions of the addon.\n\n|cFFFFFF00-|r Fixed an issue with bookmarks panel not opening correctly.\n\n|cFFFFFF00v3.17.10 (|cFFFFCC00Aug 02, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed ticket #47: Title bar font resets with UI reload / relog.\n\n|cFFFFFF00-|r Fixed ticket #46: Icon select panel wasn't opening.\n\n|cFFFFFF00-|r Fixed ticket #45: Windwalker icon for Mistweaver monks.\n\n|cFFFFFF00-|r Fixed issue with vehicles exchanging ownership, e.g. Soulbound Constructor on HFC raid.\n\n|cFFFFFF00v3.17.6 (|cFFFFCC00Jul 16, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Major improvements on the aura tool creation for WeakAuras.\n\n|cFFFFFF00-|r Fixed some issues with spec icons where sometimes it shows four small icons.\n\n|cFFFFFF00-|r Added an option to show a stopwatch on the title text showing the elapsed time of an encounter.\n\n|cFFFFFF00-|r Window title text now shrinks correctly when isn't enough space for it.\n\n|cFFFFFF00-|r For some special cases, left click now open the report window and shift+click shows the tooltip content in the window.\n\n|cFFFFFF00-|r Damage Taken by Spells now are a part of Damage bracket (no more on custom).\n\n|cFFFFFF00-|r Fixed custom functions for the customized bar left text.\n\n|cFFFFFF00-|r Improvements on report text format and also reverse option now works as intended.\n\n|cFFFFFF00-|r Removed the option for report only what is shown in the window.\n\n|cFFFFFF00-|r Added skins for report panel, the skin follow the skin selected for Player Detail Window." + Loc ["STRING_VERSION_LOG"] = "|cFFFFFF00v4.0.6 (|cFFFFCC00Nov 01, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added an option for numeral system: Western/East Asian.\n\n|cFFFFFF00v4.0.5c (|cFFFFCC00Oct 24, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added an option to disable the all-displays window (right click on title bar).\n\n|cFFFFFF00-|r Added an option to suppress segment changes after killing a boss encounter (experimental).\n\n|cFFFFFF00-|r Fixed pet battles auto hide.\n\n|cFFFFFF00-|r Fixed an issue with bar animations starting from the middle of the bar.\n\n|cFFFFFF00-|r Fixed buffs and spell cast start on weakauras creator tool.\n\n|cFFFFFF00v4.0.3a (|cFFFFCC00Set 29, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fix for an error on Damage Taken By Spell display.\n\n|cFFFFFF00v4.0.3 (|cFFFFCC00Set 27, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Some improvements on Plugin's icon at the title bar.\n\n|cFFFFFF00v4.0.2 (|cFFFFCC00Set 26, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added 'ShielTronic Shield' on HealthPotion & Stone display.\n\n|cFFFFFF00-|r Improvements done on Vanguard Plugin.\n\n|cFFFFFF00-|r Fixed an alignment issue which was happening with few tooltips.\n\n|cFFFFFF00-|r Fixed a problem where sometimes the addon crashes while doing a /reload during raid.\n\n|cFFFFFF00-|r Fixed the creation of auras for weakauras from the Forge (/details forge).\n\n|cFFFFFF00v4.0.1 (|cFFFFCC00Set 21, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added an options to use a customized skin file.\n\n|cFFFFFF00-|r Added an options to use a customized bar texture file.\n\n|cFFFFFF00-|r A Package with photoshop files with examples and the skin file for Minimalistic skin are available at WoW Interface.\n\n|cFFFFFF00-|r Added 'API Custom Displays.txt' on Details! folder, this file explain how to create scripts for custom displays.\n\n|cFFFFFF00v4.0h (|cFFFFCC00Set 19, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Created new plugin 'Target Caller' for RBGs, it's available at Curse.com.\n\n|cFFFFFF00-|r Fixed death display color when not using colored by the player class.\n\n|cFFFFFF00-|r Fixed a rare bug where the window for Encounter Details Plugin won't open when clicking on its icon.\n\n|cFFFFFF00-|r Added officer channel to 'Announce Death' feature.\n\n|cFFFFFF00v4.0f (|cFFFFCC00Set 16, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fix for the title bar encounter timer.\n\n|cFFFFFF00v4.0e (|cFFFFCC00Set 14, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added a custom display for Crowd Control Received.\n\n|cFFFFFF00-|r Weak Aura Creator Tool, now has full support for BigWigs and Dbm time bars.\n\n|cFFFFFF00-|r Auras for interrupt and dispelling has been added on the Weak Aura Creator Tool.\n\n|cFFFFFF00-|r Details! Forge now has support for DBM and BigWigs time bars.\n\n|cFFFFFF00-|r Solo Plugins now has a close button on their panels.\n\n|cFFFFFF00-|r Fixed damage/healing score message after a boss kill.\n\n|cFFFFFF00-|r Now, an alert to open the history panel is shown after killing a boss.\n\n|cFFFFFF00-|r Added a 'all-displays' menu when right clicking title bar.\n\n|cFFFFFF00-|r Removed few texture from bookmarks panel, now it has a more clean appearance.\n\n|cFFFFFF00-|r Updated Details! Framework.\n\n|cFFFFFF00-|r Added option in order to change the bar orientation.\n\n|cFFFFFF00-|r Added an option to make the menus on title bar work with clicks instead of hovering over them.\n\n|cFFFFFF00-|r Healing for battleground enemies is now placed on healing done instead of enemy healing done.\n\n|cFFFFFF00-|r Improvements on our support for Arena battles.\n\n|cFFFFFF00-|r Fixed some issues on the Player Detail Window.\n\n|cFFFFFF00-|r Fixed encounter time on title bar text.\n\n|cFFFFFF00-|r Fixed death display tooltip, wasn't respecting the font and size set on options panel.\n\n|cFFFFFF00v3.18.5 (|cFFFFCC00Aug 19, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Improvements on Weakauras creation from Encounter Details plugin.\n\n|cFFFFFF00-|r Improvements on 'Auto Switch to Current' feature. Details! windows are now more responsible about auto changing a segment while the player, for instance, has the report window opened.\n\n|cFFFFFF00-|r Added slash command '/de wipe'. It ends the raid encounter segment and stop capturing data.\nIf you are the raid leader, all other users of Details! will also stop.\nWorks great for players not make damage padding after a wipe call.\n\n|cFFFFFF00-|r Added the overheal made by pets on tooltip and player details window.\n\n|cFFFFFF00-|r Added an option to disable stretch button and bar highlight.\n\n|cFFFFFF00-|r Disabling nicknames now also disable avatars.\n\n|cFFFFFF00-|r Added 'spinal healing injector' on custom display 'Health Potion & Stone' used.\n\n|cFFFFFF00-|r Fixed title text width when auto-hide menu buttons is enabled.\n\n|cFFFFFF00-|r Fixed item level of timewarped items.\n\n|cFFFFFF00-|r Fixed report for custom display Crowd Control.\n\n|cFFFFFF00-|r Fixed role icons on custom displays.\n\n|cFFFFFF00-|r Fixed an issue with dropdown boxes where wasn't showing all options.\n\n|cFFFFFF00-|r Fixed Ticket #53: background alpha after stretching which wasn't correctly coming back to original color.\n\n|cFFFFFF00-|r Fixed ticket #51: API Call 'GetCombat('overall')' wasn't returning the overall combat object.\n\n|cFFFFFF00-|r Fixed ticket #50: issue opening icon selection frame.\n\n|cFFFFFF00v3.17.12 (|cFFFFCC00Aug 05, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Added an option for lock micro displays. When locked they don't interact with mouse or stay on top of menus.\n\n|cFFFFFF00-|r Fixed ticket #49: death display not working correctly with sort direction bottom-to-top.\n\n|cFFFFFF00-|r Fixed an issue with death display where the text wasn't updating their width correctly.\n\n|cFFFFFF00-|r Fixed an issue with energy and miscellaneous displays type not working correctly with bar animations.\n\n|cFFFFFF00-|r Fixed an issue while loading old profiles wans't updating their values for newer versions of the addon.\n\n|cFFFFFF00-|r Fixed an issue with bookmarks panel not opening correctly.\n\n|cFFFFFF00v3.17.10 (|cFFFFCC00Aug 02, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Fixed ticket #47: Title bar font resets with UI reload / relog.\n\n|cFFFFFF00-|r Fixed ticket #46: Icon select panel wasn't opening.\n\n|cFFFFFF00-|r Fixed ticket #45: Windwalker icon for Mistweaver monks.\n\n|cFFFFFF00-|r Fixed issue with vehicles exchanging ownership, e.g. Soulbound Constructor on HFC raid.\n\n|cFFFFFF00v3.17.6 (|cFFFFCC00Jul 16, 2015|r|cFFFFFF00)|r:\n\n|cFFFFFF00-|r Major improvements on the aura tool creation for WeakAuras.\n\n|cFFFFFF00-|r Fixed some issues with spec icons where sometimes it shows four small icons.\n\n|cFFFFFF00-|r Added an option to show a stopwatch on the title text showing the elapsed time of an encounter.\n\n|cFFFFFF00-|r Window title text now shrinks correctly when isn't enough space for it.\n\n|cFFFFFF00-|r For some special cases, left click now open the report window and shift+click shows the tooltip content in the window.\n\n|cFFFFFF00-|r Damage Taken by Spells now are a part of Damage bracket (no more on custom).\n\n|cFFFFFF00-|r Fixed custom functions for the customized bar left text.\n\n|cFFFFFF00-|r Improvements on report text format and also reverse option now works as intended.\n\n|cFFFFFF00-|r Removed the option for report only what is shown in the window.\n\n|cFFFFFF00-|r Added skins for report panel, the skin follow the skin selected for Player Detail Window." Loc ["STRING_DETAILS1"] = "|cffffaeaeDetails!:|r " diff --git a/core/util.lua b/core/util.lua index 2b2919de..e611899c 100644 --- a/core/util.lua +++ b/core/util.lua @@ -84,31 +84,33 @@ return _table end + _detalhes.ToKFunctions = {} + --krKR by @yuk6196 (http://wow.curseforge.com/profiles/yuk6196) function _detalhes:UseEastAsianNumericalSystem() function _detalhes:ToK (numero) if (numero > 100000000) then - return _string_format ("%.2f", numero/100000000) .. Loc ["STRING_ABBREVIATE_LETTER_B_UPPER"] + return _string_format ("%.2f", numero/100000000) .. "억" elseif (numero > 10000) then - return _string_format ("%.2f", numero/10000) ..Loc ["STRING_ABBREVIATE_LETTER_M_UPPER"] + return _string_format ("%.2f", numero/10000) .. "만" elseif (numero > 1000) then - return _string_format ("%.1f", numero/1000) ..Loc ["STRING_ABBREVIATE_LETTER_K_UPPER"] + return _string_format ("%.1f", numero/1000) .. "천" end return numero end function _detalhes:ToK2 (numero) if (numero > 99999999) then - return _string_format ("%.2f", numero/100000000) .. Loc ["STRING_ABBREVIATE_LETTER_B_UPPER"] + return _string_format ("%.2f", numero/100000000) .. "억" elseif (numero > 999999) then - return _string_format ("%.2f", numero/10000) .. Loc ["STRING_ABBREVIATE_LETTER_M_UPPER"] + return _string_format ("%.2f", numero/10000) .. "만" elseif (numero > 99999) then - return _math_floor (numero/10000) .. Loc ["STRING_ABBREVIATE_LETTER_M_UPPER"] + return _math_floor (numero/10000) .. "만" elseif (numero > 9999) then - return _string_format ("%.1f", (numero/10000)) .. Loc ["STRING_ABBREVIATE_LETTER_M_UPPER"] + return _string_format ("%.1f", (numero/10000)) .. "만" elseif (numero > 999) then - return _string_format ("%.1f", (numero/1000)) .. Loc ["STRING_ABBREVIATE_LETTER_K_UPPER"] + return _string_format ("%.1f", (numero/1000)) .. "천" end return _string_format ("%.1f", numero) end @@ -116,37 +118,37 @@ --> short numbers no numbers after comma function _detalhes:ToK0 (numero) if (numero > 100000000) then - return _string_format ("%.0f", numero/100000000) ..Loc ["STRING_ABBREVIATE_LETTER_B_UPPER"] + return _string_format ("%.0f", numero/100000000) .. "억" elseif (numero > 10000) then - return _string_format ("%.0f", numero/10000) ..Loc ["STRING_ABBREVIATE_LETTER_M_UPPER"] + return _string_format ("%.0f", numero/10000) .. "만" elseif (numero > 1000) then - return _string_format ("%.0f", numero/1000) ..Loc ["STRING_ABBREVIATE_LETTER_K_UPPER"] + return _string_format ("%.0f", numero/1000) .. "천" end return _string_format ("%.0f", numero) end function _detalhes:ToKMin (numero) if (numero > 100000000) then - return _string_format ("%.2f", numero/100000000) ..Loc ["STRING_ABBREVIATE_LETTER_B_UPPER"] + return _string_format ("%.2f", numero/100000000) .. "억" elseif (numero > 10000) then - return _string_format ("%.2f", numero/10000) ..Loc ["STRING_ABBREVIATE_LETTER_M_LOWER"] + return _string_format ("%.2f", numero/10000) .. "만" elseif (numero > 1000) then - return _string_format ("%.1f", numero/1000) ..Loc ["STRING_ABBREVIATE_LETTER_K_LOWER"] + return _string_format ("%.1f", numero/1000) .. "천" end return numero end function _detalhes:ToK2Min (numero) if (numero > 99999999) then - return _string_format ("%.2f", numero/100000000) .. Loc ["STRING_ABBREVIATE_LETTER_B_LOWER"] + return _string_format ("%.2f", numero/100000000) .. "억" elseif (numero > 999999) then - return _string_format ("%.2f", numero/10000) .. Loc ["STRING_ABBREVIATE_LETTER_M_LOWER"] + return _string_format ("%.2f", numero/10000) .. "만" elseif (numero > 99999) then - return _math_floor (numero/10000) .. Loc ["STRING_ABBREVIATE_LETTER_M_LOWER"] + return _math_floor (numero/10000) .. "만" elseif (numero > 9999) then - return _string_format ("%.1f", (numero/10000)) .. Loc ["STRING_ABBREVIATE_LETTER_M_LOWER"] + return _string_format ("%.1f", (numero/10000)) .. "만" elseif (numero > 999) then - return _string_format ("%.1f", (numero/1000)) .. Loc ["STRING_ABBREVIATE_LETTER_K_LOWER"] + return _string_format ("%.1f", (numero/1000)) .. "천" end return _string_format ("%.1f", numero) end @@ -154,11 +156,11 @@ --> short numbers no numbers after comma function _detalhes:ToK0Min (numero) if (numero > 100000000) then - return _string_format ("%.0f", numero/100000000) ..Loc ["STRING_ABBREVIATE_LETTER_B_UPPER"] + return _string_format ("%.0f", numero/100000000) .. "억" elseif (numero > 10000) then - return _string_format ("%.0f", numero/10000) ..Loc ["STRING_ABBREVIATE_LETTER_M_LOWER"] + return _string_format ("%.0f", numero/10000) .. "만" elseif (numero > 1000) then - return _string_format ("%.0f", numero/1000) ..Loc ["STRING_ABBREVIATE_LETTER_K_LOWER"] + return _string_format ("%.0f", numero/1000) .. "천" end return _string_format ("%.0f", numero) end @@ -166,11 +168,11 @@ --> short numbers no numbers after comma function _detalhes:ToKReport (numero) if (numero > 100000000) then - return _string_format ("%.2f", numero/100000000) ..Loc ["STRING_ABBREVIATE_LETTER_B_UPPER"] + return _string_format ("%.2f", numero/100000000) .. "억" elseif (numero > 10000) then - return _sting_format ("%.1f", numero/10000) ..Loc ["STRING_ABBREVIATE_LETTER_M_UPPER"] + return _string_format ("%.1f", numero/10000) .. "만" elseif (numero > 1000) then - return _string_format ("%.0f", numero/1000) ..Loc ["STRING_ABBREVIATE_LETTER_K_UPPER"] + return _string_format ("%.0f", numero/1000) .. "천" end return numero end @@ -179,9 +181,9 @@ n = _math_floor (n) if (custom) then if (n > 99999999) then - return _string_format (custom, n/100000000) .. Loc ["STRING_ABBREVIATE_LETTER_B_UPPER"] + return _string_format (custom, n/100000000) .. "억" elseif (n > 9999) then - return _string_format (custom, n/10000) .. Loc ["STRING_ABBREVIATE_LETTER_M_UPPER"] + return _string_format (custom, n/10000) .. "만" elseif (n > 999) then return _string_format (custom, (n/1000)) else @@ -191,31 +193,53 @@ return _detalhes.ToKFunctions [_detalhes.ps_abbreviation] (nil, n) end end + + --> no changes + function _detalhes:NoToK (numero) + return _math_floor (numero) + end + -- thanks http://richard.warburton.it + function _detalhes:comma_value (n) + if (not n) then return "0" end + n = _math_floor (n) + if (n == 0) then + return "0" + end + local left,num,right = _string_match (n,'^([^%d]*%d)(%d*)(.-)$') + return left..(num:reverse():gsub('(%d%d%d)','%1,'):reverse())..right + end + + wipe (_detalhes.ToKFunctions) + + tinsert (_detalhes.ToKFunctions, _detalhes.NoToK) + tinsert (_detalhes.ToKFunctions, _detalhes.ToK) + tinsert (_detalhes.ToKFunctions, _detalhes.ToK2) + tinsert (_detalhes.ToKFunctions, _detalhes.ToK0) + tinsert (_detalhes.ToKFunctions, _detalhes.ToKMin) + tinsert (_detalhes.ToKFunctions, _detalhes.ToK2Min) + tinsert (_detalhes.ToKFunctions, _detalhes.ToK0Min) + tinsert (_detalhes.ToKFunctions, _detalhes.comma_value) + end - --> load specific ToK functions for East Asia region - if (LibStub("AceLocale-3.0"):NewLocale ("Details", "koKR")) then - _detalhes:UseEastAsianNumericalSystem() - else - --> load the defaults for all other languages - + function _detalhes:UseWestNumericalSystem() --> short numbers function _detalhes:ToK (numero) if (numero > 1000000) then - return _string_format ("%.2f", numero/1000000) .. Loc ["STRING_ABBREVIATE_LETTER_M_UPPER"] + return _string_format ("%.2f", numero/1000000) .. "M" elseif (numero > 1000) then - return _string_format ("%.1f", numero/1000) .. Loc ["STRING_ABBREVIATE_LETTER_K_UPPER"] + return _string_format ("%.1f", numero/1000) .. "K" end return _string_format ("%.1f", numero) end function _detalhes:ToK2 (numero) if (numero > 999999) then - return _string_format ("%.2f", numero/1000000) .. Loc ["STRING_ABBREVIATE_LETTER_M_UPPER"] + return _string_format ("%.2f", numero/1000000) .. "M" elseif (numero > 99999) then - return _math_floor (numero/1000) .. Loc ["STRING_ABBREVIATE_LETTER_K_UPPER"] + return _math_floor (numero/1000) .. "K" elseif (numero > 999) then - return _string_format ("%.1f", (numero/1000)) .. Loc ["STRING_ABBREVIATE_LETTER_K_UPPER"] + return _string_format ("%.1f", (numero/1000)) .. "K" end return _string_format ("%.1f", numero) end @@ -223,29 +247,29 @@ --> short numbers no numbers after comma function _detalhes:ToK0 (numero) if (numero > 1000000) then - return _string_format ("%.0f", numero/1000000) .. Loc ["STRING_ABBREVIATE_LETTER_M_UPPER"] + return _string_format ("%.0f", numero/1000000) .. "M" elseif (numero > 1000) then - return _string_format ("%.0f", numero/1000) .. Loc ["STRING_ABBREVIATE_LETTER_K_UPPER"] + return _string_format ("%.0f", numero/1000) .. "K" end return _string_format ("%.0f", numero) end function _detalhes:ToKMin (numero) if (numero > 1000000) then - return _string_format ("%.2f", numero/1000000) .. Loc ["STRING_ABBREVIATE_LETTER_M_LOWER"] + return _string_format ("%.2f", numero/1000000) .. "m" elseif (numero > 1000) then - return _string_format ("%.1f", numero/1000) .. Loc ["STRING_ABBREVIATE_LETTER_K_LOWER"] + return _string_format ("%.1f", numero/1000) .. "k" end return _string_format ("%.1f", numero) end function _detalhes:ToK2Min (numero) if (numero > 999999) then - return _string_format ("%.2f", numero/1000000) .. Loc ["STRING_ABBREVIATE_LETTER_M_LOWER"] + return _string_format ("%.2f", numero/1000000) .. "m" elseif (numero > 99999) then - return _math_floor (numero/1000) .. Loc ["STRING_ABBREVIATE_LETTER_K_LOWER"] + return _math_floor (numero/1000) .. "k" elseif (numero > 999) then - return _string_format ("%.1f", (numero/1000)) .. Loc ["STRING_ABBREVIATE_LETTER_K_LOWER"] + return _string_format ("%.1f", (numero/1000)) .. "k" end return _string_format ("%.1f", numero) end @@ -253,9 +277,9 @@ --> short numbers no numbers after comma function _detalhes:ToK0Min (numero) if (numero > 1000000) then - return _string_format ("%.0f", numero/1000000) .. Loc ["STRING_ABBREVIATE_LETTER_M_LOWER"] + return _string_format ("%.0f", numero/1000000) .. "m" elseif (numero > 1000) then - return _string_format ("%.0f", numero/1000) .. Loc ["STRING_ABBREVIATE_LETTER_K_LOWER"] + return _string_format ("%.0f", numero/1000) .. "k" end return _string_format ("%.0f", numero) end @@ -263,9 +287,9 @@ --> short numbers no numbers after comma function _detalhes:ToKReport (numero) if (numero > 1000000) then - return _string_format ("%.2f", numero/1000000) .. Loc ["STRING_ABBREVIATE_LETTER_M_UPPER"] + return _string_format ("%.2f", numero/1000000) .. "M" elseif (numero > 1000) then - return _string_format ("%.1f", numero/1000) .. Loc ["STRING_ABBREVIATE_LETTER_K_UPPER"] + return _string_format ("%.1f", numero/1000) .. "K" end return numero end @@ -274,7 +298,7 @@ n = _math_floor (n) if (custom) then if (n > 999999) then - return _string_format (custom, n/1000000) .. Loc ["STRING_ABBREVIATE_LETTER_M_UPPER"] + return _string_format (custom, n/1000000) .. "M" elseif (n > 999) then return _string_format (custom, (n/1000)) else @@ -284,36 +308,78 @@ return _detalhes.ToKFunctions [_detalhes.ps_abbreviation] (nil, n) end end - end - ---------end of ToK functions---- - - --> no changes - function _detalhes:NoToK (numero) - return _math_floor (numero) - end - -- thanks http://richard.warburton.it - function _detalhes:comma_value (n) - if (not n) then return "0" end - n = _math_floor (n) - if (n == 0) then - return "0" + + --> no changes + function _detalhes:NoToK (numero) + return _math_floor (numero) end - local left,num,right = _string_match (n,'^([^%d]*%d)(%d*)(.-)$') - return left..(num:reverse():gsub('(%d%d%d)','%1,'):reverse())..right + + -- thanks http://richard.warburton.it + function _detalhes:comma_value (n) + if (not n) then return "0" end + n = _math_floor (n) + if (n == 0) then + return "0" + end + local left,num,right = _string_match (n,'^([^%d]*%d)(%d*)(.-)$') + return left..(num:reverse():gsub('(%d%d%d)','%1,'):reverse())..right + end + + wipe (_detalhes.ToKFunctions) + + tinsert (_detalhes.ToKFunctions, _detalhes.NoToK) + tinsert (_detalhes.ToKFunctions, _detalhes.ToK) + tinsert (_detalhes.ToKFunctions, _detalhes.ToK2) + tinsert (_detalhes.ToKFunctions, _detalhes.ToK0) + tinsert (_detalhes.ToKFunctions, _detalhes.ToKMin) + tinsert (_detalhes.ToKFunctions, _detalhes.ToK2Min) + tinsert (_detalhes.ToKFunctions, _detalhes.ToK0Min) + tinsert (_detalhes.ToKFunctions, _detalhes.comma_value) + + -- end + --> load western as default, the proper method is loaded within the profile + _detalhes:UseWestNumericalSystem() + function _detalhes:GetCurrentToKFunction() return _detalhes.ToKFunctions [_detalhes.ps_abbreviation] end + +------------------------------------------------------------------------------------------------------------ +--> numerical system - _detalhes.ToKFunctions = {_detalhes.NoToK, _detalhes.ToK, _detalhes.ToK2, _detalhes.ToK0, _detalhes.ToKMin, _detalhes.ToK2Min, _detalhes.ToK0Min, _detalhes.comma_value} + function _detalhes:GetNumericalSystem() + return _detalhes.numerical_system + end + + function _detalhes:SelectNumericalSystem (system) + if (not system or type (system) ~= "number") then + system = _detalhes.numerical_system or 1 + end + _detalhes.numerical_system = system + + if (system == 1) then + _detalhes:UseWestNumericalSystem() + elseif (system == 2) then + _detalhes:UseEastAsianNumericalSystem() + end + + _detalhes:UpdateToKFunctions() + end + function _detalhes:UpdateToKFunctions() + _detalhes.atributo_damage:UpdateSelectedToKFunction() + _detalhes.atributo_heal:UpdateSelectedToKFunction() + _detalhes.atributo_energy:UpdateSelectedToKFunction() + _detalhes.atributo_misc:UpdateSelectedToKFunction() + _detalhes.atributo_custom:UpdateSelectedToKFunction() + _detalhes:AtualizaGumpPrincipal (-1, true) + end - - - +--------end of ToK functions---- + --> replacing data for custom texts _detalhes.string = {} diff --git a/functions/profiles.lua b/functions/profiles.lua index 9b283462..0ab6054e 100644 --- a/functions/profiles.lua +++ b/functions/profiles.lua @@ -539,6 +539,9 @@ function _detalhes:ApplyProfile (profile_name, nosave, is_copy) --> update player detail window _detalhes:ApplyPDWSkin() + + --> update the numerical system + _detalhes:SelectNumericalSystem() if (_detalhes.initializing) then _detalhes.profile_loaded = true @@ -914,11 +917,12 @@ local default_profile = { --> item level tracker track_item_level = true, - --> text sizes + --> text settings font_sizes = {menus = 10}, font_faces = {menus = "Friz Quadrata TT"}, ps_abbreviation = 3, total_abbreviation = 2, + numerical_system = 1, --> performance use_row_animations = false, diff --git a/gumps/janela_options.lua b/gumps/janela_options.lua index 733b0c10..edcfaff4 100644 --- a/gumps/janela_options.lua +++ b/gumps/janela_options.lua @@ -3955,13 +3955,8 @@ function window:CreateFrame1() local onSelectTimeAbbreviation = function (_, _, abbreviationtype) _detalhes.ps_abbreviation = abbreviationtype - _detalhes.atributo_damage:UpdateSelectedToKFunction() - _detalhes.atributo_heal:UpdateSelectedToKFunction() - _detalhes.atributo_energy:UpdateSelectedToKFunction() - _detalhes.atributo_misc:UpdateSelectedToKFunction() - _detalhes.atributo_custom:UpdateSelectedToKFunction() + _detalhes:UpdateToKFunctions() - _detalhes:AtualizaGumpPrincipal (-1, true) _detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance) end local icon = [[Interface\COMMON\mini-hourglass]] @@ -3982,11 +3977,12 @@ function window:CreateFrame1() end local d = g:NewDropDown (frame1, _, "$parentAbbreviateDropdown", "dpsAbbreviateDropdown", 160, dropdown_height, buildAbbreviationMenu, _detalhes.ps_abbreviation, options_dropdown_template) - frame1.dpsAbbreviateDropdown:SetPoint ("left", frame1.dpsAbbreviateLabel, "right", 2, 0) - window:CreateLineBackground2 (frame1, "dpsAbbreviateDropdown", "dpsAbbreviateLabel", Loc ["STRING_OPTIONS_PS_ABBREVIATE_DESC"]) + + --> avatar + local avatar = NickTag:GetNicknameAvatar (UnitGUID ("player"), NICKTAG_DEFAULT_AVATAR, true) local background, cords, color = NickTag:GetNicknameBackground (UnitGUID ("player"), NICKTAG_DEFAULT_BACKGROUND, NICKTAG_DEFAULT_BACKGROUND_CORDS, {1, 1, 1, 1}, true) @@ -3995,6 +3991,29 @@ function window:CreateFrame1() frame1.avatarPreview2.texcoord = cords frame1.avatarPreview2:SetVertexColor (unpack (color)) + --> numerical system + g:NewLabel (frame1, _, "$parentNumericalSystemLabel", "NumericalSystemLabel", Loc ["STRING_NUMERALSYSTEM"], "GameFontHighlightLeft") + + local onSelectNumeralSystem = function (_, _, systemNumber) + _detalhes:SelectNumericalSystem (systemNumber) + end + + + + + local numeralSystems = { + {value = 1, label = Loc ["STRING_NUMERALSYSTEM_ARABIC_WESTERN"], desc = "1K = 1.000 \n10K = 10.000 \n100K = 100.000 \n1M = 1.000.000", onclick = onSelectNumeralSystem, icon = icon, iconcolor = iconcolor, iconsize = iconsize}, + {value = 2, label = Loc ["STRING_NUMERALSYSTEM_MYRIAD_EASTASIA"], desc = "1천 = 1.000 \n1만 = 10.000 \n10만 = 100.000 \n100만 = 1.000.000", onclick = onSelectNumeralSystem, icon = icon, iconcolor = iconcolor, iconsize = iconsize}, + } + + local buildNumeralSystemsMenu = function() + return numeralSystems + end + + local d = g:NewDropDown (frame1, _, "$parentNumericalSystemOfADropdown", "NumericalSystemDropdown", 160, dropdown_height, buildNumeralSystemsMenu, _detalhes.numerical_system, options_dropdown_template) + d:SetPoint ("left", frame1.NumericalSystemLabel, "right", 2, 0) + window:CreateLineBackground2 (frame1, "NumericalSystemDropdown", "NumericalSystemLabel", Loc ["STRING_NUMERALSYSTEM_DESC"]) + --> animate bars g:NewLabel (frame1, _, "$parentAnimateLabel", "animateLabel", Loc ["STRING_OPTIONS_ANIMATEBARS"], "GameFontHighlightLeft") @@ -4221,11 +4240,12 @@ function window:CreateFrame1() {"maxInstancesLabel", 7, true}, {"dpsAbbreviateLabel", 8}, + {"NumericalSystemLabel", 9}, - {frame1.ToolsLabel, 9, true}, - {frame1.EraseDataLabel, 10}, - {frame1.BookmarkButton, 11}, - {frame1.ClassColorsButton, 12}, + {frame1.ToolsLabel, 10, true}, + {frame1.EraseDataLabel, 11}, + {frame1.BookmarkButton, 12}, + {frame1.ClassColorsButton, 13}, --{"WindowControlsLabel", 9, true}, --{"LockButton", 10}, @@ -10370,6 +10390,7 @@ end --> if not window _G.DetailsOptionsWindow1Slider.MyObject:SetValue (_detalhes.segments_amount) --segments _G.DetailsOptionsWindow1SegmentsLockedSlider.MyObject:SetValue (_detalhes.instances_segments_locked) --locked segments + _G.DetailsOptionsWindow1NumericalSystemOfADropdown.MyObject:Select (_detalhes.numerical_system) _G.DetailsOptionsWindow1WheelSpeedSlider.MyObject:SetValue (_detalhes.scroll_speed) _G.DetailsOptionsWindow1SliderMaxInstances.MyObject:SetValue (_detalhes.instances_amount) diff --git a/gumps/janela_welcome.lua b/gumps/janela_welcome.lua index e13f3c93..d8dfa43b 100644 --- a/gumps/janela_welcome.lua +++ b/gumps/janela_welcome.lua @@ -463,8 +463,16 @@ local window_openned_at = time() continuous:SetChecked (true) end - chronometer:SetScript ("OnClick", function() continuous:SetChecked (false); _detalhes.time_type = 1 end) - continuous:SetScript ("OnClick", function() chronometer:SetChecked (false); _detalhes.time_type = 2 end) + chronometer:SetScript ("OnClick", function() + chronometer:SetChecked (true); + continuous:SetChecked (false); + _detalhes.time_type = 1 + end) + continuous:SetScript ("OnClick", function() + continuous:SetChecked (true); + chronometer:SetChecked (false); + _detalhes.time_type = 2 + end) -- @@ -502,7 +510,7 @@ local window_openned_at = time() pleasewait:SetText ("") pleasewait:Hide() end - end) + end) pages [#pages+1] = {pleasewait, free_frame3, thedude, sword_icon, ampulheta, texto2, chronometer, continuous, chronometer_text, continuous_text, window.changemind2Label} @@ -510,6 +518,100 @@ local window_openned_at = time() widget:Hide() end +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +--> numeral system + + local numeral_image = window:CreateTexture (nil, "overlay") + + numeral_image:SetTexture ([[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]]) + numeral_image:SetPoint ("bottomright", window, "bottomright", -10, 10) + numeral_image:SetHeight (125*3)--125 + numeral_image:SetWidth (89*3)--82 + numeral_image:SetAlpha (.05) + numeral_image:SetTexCoord (1, 0, 0, 1) + + g:NewLabel (window, _, "$parentChangeMindNumeralLabel", "changemindNumeralLabel", Loc ["STRING_WELCOME_2"], "GameFontNormal", 9, "orange") + window.changemindNumeralLabel:SetPoint ("center", window, "center") + window.changemindNumeralLabel:SetPoint ("bottom", window, "bottom", 0, 19) + window.changemindNumeralLabel.align = "|" + + local texto2Numeral = window:CreateFontString (nil, "overlay", "GameFontNormal") + texto2Numeral:SetPoint ("topleft", window, "topleft", 20, -80) + texto2Numeral:SetText (Loc ["STRING_NUMERALSYSTEM_DESC"] .. ":") + + local NumeralType1 = CreateFrame ("CheckButton", "WelcomeWindowNumeralType1", window, "ChatConfigCheckButtonTemplate") + NumeralType1:SetPoint ("topleft", window, "topleft", 20, -110) + local NumeralType2 = CreateFrame ("CheckButton", "WelcomeWindowNumeralType2", window, "ChatConfigCheckButtonTemplate") + NumeralType2:SetPoint ("topleft", window, "topleft", 20, -170) + + _G ["WelcomeWindowNumeralType1Text"]:SetText (Loc ["STRING_NUMERALSYSTEM_ARABIC_WESTERN"] .. ": " .. Loc ["STRING_NUMERALSYSTEM_ARABIC_WESTERN_DESC"]) + _G ["WelcomeWindowNumeralType2Text"]:SetText (Loc ["STRING_NUMERALSYSTEM_MYRIAD_EASTASIA"] .. ": " .. Loc ["STRING_NUMERALSYSTEM_ARABIC_MYRIAD_EASTASIA"]) + + local sword_icon2 = window:CreateTexture (nil, "overlay") + sword_icon2:SetTexture ([[Interface\Addons\Details\images\icons2]]) + sword_icon2:SetPoint ("topright", window, "topright", -30, -10) + sword_icon2:SetSize (128*1.4, 64*1.4) + sword_icon2:SetTexCoord (330/512, 509/512, 437/512, 509/512) + sword_icon2:SetDrawLayer ("overlay", 2) + + local thedude2 = window:CreateTexture (nil, "overlay") + --thedude2:SetTexture ([[Interface\TUTORIALFRAME\UI-TutorialFrame-TheDude]]) + thedude2:SetPoint ("bottomright", sword_icon, "bottomleft", 70, 19) + thedude2:SetWidth (128*1.0) + thedude2:SetHeight (128*1.0) + thedude2:SetTexCoord (0, 1, 0, 1) + thedude2:SetDrawLayer ("overlay", 3) + + local NumeralType1_text = window:CreateFontString (nil, "overlay", "GameFontNormal") + NumeralType1_text:SetText ("1K = 1.000 |cFFFFCC00| |r10K = 10.000 |cFFFFCC00| |r100K = 100.000 |cFFFFCC00| |r1M = 1.000.000") + NumeralType1_text:SetWidth (500) + NumeralType1_text:SetHeight (40) + NumeralType1_text:SetJustifyH ("left") + NumeralType1_text:SetJustifyV ("top") + NumeralType1_text:SetTextColor (.8, .8, .8, 1) + --NumeralType1_text:SetPoint ("topleft", _G ["WelcomeWindowNumeralType1Text"], "topright", 0, 0) + NumeralType1_text:SetPoint ("topleft", window, "topleft", 40, -130) + + local NumeralType2_text = window:CreateFontString (nil, "overlay", "GameFontNormal") + NumeralType2_text:SetText ("1천 = 1.000 |cFFFFCC00| |r1만 = 10.000 |cFFFFCC00| |r10만 = 100.000 |cFFFFCC00| |r100만 = 1.000.000") + NumeralType2_text:SetWidth (500) + NumeralType2_text:SetHeight (40) + NumeralType2_text:SetJustifyH ("left") + NumeralType2_text:SetJustifyV ("top") + NumeralType2_text:SetTextColor (.8, .8, .8, 1) + --NumeralType2_text:SetPoint ("topleft", _G ["WelcomeWindowNumeralType2Text"], "topright", 0, 0) + NumeralType2_text:SetPoint ("topleft", window, "topleft", 40, -190) + + NumeralType1:SetHitRectInsets (0, -70, 0, 0) + NumeralType2:SetHitRectInsets (0, -70, 0, 0) + + if (_detalhes.numerical_system == 1) then --> west + NumeralType1:SetChecked (true) + NumeralType2:SetChecked (false) + elseif (_detalhes.numerical_system == 2) then --> east + NumeralType1:SetChecked (false) + NumeralType2:SetChecked (true) + end + + NumeralType1:SetScript ("OnClick", function() + NumeralType1:SetChecked (true); + NumeralType2:SetChecked (false); + _detalhes.numerical_system = 1 + _detalhes:SelectNumericalSystem() + end) + NumeralType2:SetScript ("OnClick", function() + NumeralType2:SetChecked (true); + NumeralType1:SetChecked (false); + _detalhes.numerical_system = 2 + _detalhes:SelectNumericalSystem() + end) + + pages [#pages+1] = {thedude2, sword_icon2, numeral_image, texto2Numeral, NumeralType1, NumeralType2, NumeralType1_text, NumeralType2_text, window.changemindNumeralLabel} + + for _, widget in ipairs (pages[#pages]) do + widget:Hide() + end + -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --> Skins Page diff --git a/images/icons2.tga b/images/icons2.tga index c7458707..c41e2e36 100644 Binary files a/images/icons2.tga and b/images/icons2.tga differ diff --git a/startup.lua b/startup.lua index 937dbbce..93023665 100644 --- a/startup.lua +++ b/startup.lua @@ -545,7 +545,7 @@ function _G._detalhes:Start() _detalhes:ScheduleTimer ("FadeStartVersion", 12) end - end + end function _detalhes:OpenOptionsWindowAtStart() --_detalhes:OpenOptionsWindow (_detalhes.tabela_instancias[1])