- Added export/import for instances.
- Added export/import for customs displays. - More small changes on ElvUI Frame Style skin. - Fixed boss death recognition. - Fixed the time of buffs applied before the pull. - Fixed issue where sometimes the tooltip for break snap and lock buttons didn't disappear. - New API: _detalhes:GetNumInstancesAmount() return the amount of instances created.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,15 @@
|
||||
## Interface: 40000
|
||||
## X-Curse-Packaged-Version: r49
|
||||
## X-Curse-Project-Name: LibCompress
|
||||
## X-Curse-Project-ID: libcompress
|
||||
## X-Curse-Repository-ID: wow/libcompress/mainline
|
||||
|
||||
## Title: Lib: Compress
|
||||
## Notes: Compression and Decompression library
|
||||
## Author: JJSheets and Galmok at Stormrage-EU (Horde)
|
||||
## X-Website: http://www.wowace.com
|
||||
## X-Category: Library
|
||||
## X-eMail: sheets DOT jeff AT gmail DOT com, galmok AT gmail DOT com
|
||||
## X-License: LGPL v2.1
|
||||
|
||||
lib.xml
|
||||
@@ -0,0 +1,5 @@
|
||||
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
|
||||
..\FrameXML\UI.xsd">
|
||||
<Script file="lib\LibStub\LibStub.lua" />
|
||||
<Script file="LibCompress.lua" />
|
||||
</Ui>
|
||||
@@ -0,0 +1,30 @@
|
||||
-- LibStub is a simple versioning stub meant for use in Libraries. http://www.wowace.com/wiki/LibStub for more info
|
||||
-- LibStub is hereby placed in the Public Domain Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke
|
||||
local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS!
|
||||
local LibStub = _G[LIBSTUB_MAJOR]
|
||||
|
||||
if not LibStub or LibStub.minor < LIBSTUB_MINOR then
|
||||
LibStub = LibStub or {libs = {}, minors = {} }
|
||||
_G[LIBSTUB_MAJOR] = LibStub
|
||||
LibStub.minor = LIBSTUB_MINOR
|
||||
|
||||
function LibStub:NewLibrary(major, minor)
|
||||
assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)")
|
||||
minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must either be a number or contain a number.")
|
||||
|
||||
local oldminor = self.minors[major]
|
||||
if oldminor and oldminor >= minor then return nil end
|
||||
self.minors[major], self.libs[major] = minor, self.libs[major] or {}
|
||||
return self.libs[major], oldminor
|
||||
end
|
||||
|
||||
function LibStub:GetLibrary(major, silent)
|
||||
if not self.libs[major] and not silent then
|
||||
error(("Cannot find a library instance of %q."):format(tostring(major)), 2)
|
||||
end
|
||||
return self.libs[major], self.minors[major]
|
||||
end
|
||||
|
||||
function LibStub:IterateLibraries() return pairs(self.libs) end
|
||||
setmetatable(LibStub, { __call = LibStub.GetLibrary })
|
||||
end
|
||||
@@ -0,0 +1,13 @@
|
||||
## Interface: 20400
|
||||
## Title: Lib: LibStub
|
||||
## Notes: Universal Library Stub
|
||||
## Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel
|
||||
## X-Website: http://jira.wowace.com/browse/LS
|
||||
## X-Category: Library
|
||||
## X-License: Public Domain
|
||||
## X-Curse-Packaged-Version: 1.0
|
||||
## X-Curse-Project-Name: LibStub
|
||||
## X-Curse-Project-ID: libstub
|
||||
## X-Curse-Repository-ID: wow/libstub/mainline
|
||||
|
||||
LibStub.lua
|
||||
@@ -13,4 +13,5 @@
|
||||
<Script file="LibDBIcon-1.0\LibDBIcon-1.0.lua"/>
|
||||
<Include file="LibHotCorners\LibHotCorners.xml" />
|
||||
<Script file="LibGraph-2.0\LibGraph-2.0.lua"/>
|
||||
<Include file="LibCompress\lib.xml"/>
|
||||
</Ui>
|
||||
@@ -1,18 +1,13 @@
|
||||
--File Revision: 1
|
||||
--Last Modification: 27/07/2013
|
||||
-- Change Log:
|
||||
-- 27/07/2013: Finished alpha version.
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> global name declaration
|
||||
|
||||
_ = nil
|
||||
_detalhes = LibStub("AceAddon-3.0"):NewAddon("_detalhes", "AceTimer-3.0", "AceComm-3.0", "AceSerializer-3.0", "NickTag-1.0", "LibHotCorners")
|
||||
|
||||
_detalhes.version = "v1.18.2 (core 20)"
|
||||
_detalhes.userversion = "v1.18.3"
|
||||
_detalhes.build_counter = 5
|
||||
_detalhes.realversion = 21
|
||||
_detalhes.version = "v1.18.4 (core 22)"
|
||||
_detalhes.userversion = "v1.18.4"
|
||||
_detalhes.build_counter = 7
|
||||
_detalhes.realversion = 22
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> initialization stuff
|
||||
@@ -147,22 +142,7 @@ do
|
||||
all = 3, --> Everything
|
||||
raid = 4 --> Raid
|
||||
}
|
||||
--[[
|
||||
_detalhes.flags = {
|
||||
--> Player and Pet
|
||||
player = 0x00000001,--> player character
|
||||
pet = 0x00000002, --> pet mobile
|
||||
--> Group
|
||||
in_group = 0x00000100,--> in group
|
||||
player_in_group = 0x00000101, --> player in group
|
||||
--> Friendship
|
||||
friend = 0x00000010,--> friend (same faction)
|
||||
friend_in_group = 0x00000110, --> friend in group
|
||||
--> Enemies
|
||||
neutral = 0x00000020,--> neutral
|
||||
enemy = 0x00000040--> enemy
|
||||
}
|
||||
--]]
|
||||
|
||||
_detalhes.divisores = {
|
||||
abre = "(", --> open
|
||||
fecha = ")", --> close
|
||||
|
||||
@@ -411,6 +411,9 @@ end
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
--> retorna quantas instância há no momento
|
||||
function _detalhes:GetNumInstancesAmount()
|
||||
return #_detalhes.tabela_instancias
|
||||
end
|
||||
function _detalhes:QuantasInstancias()
|
||||
return #_detalhes.tabela_instancias
|
||||
end
|
||||
@@ -751,15 +754,15 @@ function _detalhes:agrupar_janelas (lados)
|
||||
end
|
||||
end
|
||||
|
||||
instancia.botao_separar:Show()
|
||||
instancia.break_snap_button:SetAlpha (1)
|
||||
|
||||
if (_detalhes.tutorial.unlock_button < 4) then
|
||||
|
||||
_detalhes.temp_table1.IconSize = 32
|
||||
_detalhes.temp_table1.TextHeightMod = -6
|
||||
_detalhes.popup:ShowMe (instancia.botao_separar, "tooltip", "Interface\\Buttons\\LockButton-Unlocked-Up", Loc ["STRING_UNLOCK"], 150, _detalhes.temp_table1)
|
||||
_detalhes.popup:ShowMe (instancia.break_snap_button, "tooltip", "Interface\\Buttons\\LockButton-Unlocked-Up", Loc ["STRING_UNLOCK"], 150, _detalhes.temp_table1)
|
||||
|
||||
--UIFrameFlash (instancia.botao_separar, .5, .5, 5, false, 0, 0)
|
||||
--UIFrameFlash (instancia.break_snap_button, .5, .5, 5, false, 0, 0)
|
||||
_detalhes.tutorial.unlock_button = _detalhes.tutorial.unlock_button + 1
|
||||
end
|
||||
|
||||
@@ -834,7 +837,7 @@ function _detalhes:Desagrupar (instancia, lado)
|
||||
end
|
||||
end
|
||||
|
||||
instancia.botao_separar:Hide()
|
||||
instancia.break_snap_button:SetAlpha (0)
|
||||
|
||||
instancia.verticalSnap = false
|
||||
instancia.horizontalSnap = false
|
||||
@@ -860,7 +863,8 @@ function _detalhes:Desagrupar (instancia, lado)
|
||||
esta_instancia.snap [2] = nil
|
||||
end
|
||||
|
||||
instancia.botao_separar:Hide()
|
||||
instancia.break_snap_button:SetAlpha (0)
|
||||
|
||||
|
||||
if (instancia.iniciada) then
|
||||
instancia:SaveMainWindowPosition()
|
||||
|
||||
@@ -1291,7 +1291,7 @@ function _detalhes:CatchRaidBuffUptime (in_or_out)
|
||||
local class_color = RAID_CLASS_COLORS [class].colorStr
|
||||
string_output = string_output .. "|c" .. class_color .. playername .. "|r |T" .. icon .. ":14:14:0:0:64:64:0:64:0:64|t "
|
||||
end
|
||||
_detalhes.debug_pots2 = string_output
|
||||
_detalhes.pre_pot_used = string_output
|
||||
end
|
||||
|
||||
elseif (_IsInGroup()) then
|
||||
|
||||
+12
-16
@@ -353,8 +353,6 @@
|
||||
|
||||
-- ~end
|
||||
function _detalhes:SairDoCombate (bossKilled, from_encounter_end)
|
||||
|
||||
--print ("=== Saiu de Combate! ===", _tempo)
|
||||
|
||||
if (_detalhes.debug) then
|
||||
_detalhes:Msg ("(debug) ended a combat.")
|
||||
@@ -388,6 +386,7 @@
|
||||
|
||||
--> pega a zona do jogador e vê se foi uma luta contra um Boss -- identifica se a luta foi com um boss
|
||||
if (not _detalhes.tabela_vigente.is_boss) then
|
||||
|
||||
--> function which runs after a boss encounter to try recognize a encounter
|
||||
_detalhes:FindBoss()
|
||||
|
||||
@@ -401,7 +400,6 @@
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
if (_detalhes.tabela_vigente.bossFunction) then
|
||||
@@ -457,17 +455,19 @@
|
||||
end
|
||||
|
||||
if (_detalhes:GetBossDetails (_detalhes.tabela_vigente.is_boss.mapid, _detalhes.tabela_vigente.is_boss.index)) then
|
||||
|
||||
|
||||
_detalhes.tabela_vigente.enemy = _detalhes.tabela_vigente.is_boss.encounter
|
||||
|
||||
if (_detalhes.tabela_vigente.instance_type == "raid") then
|
||||
|
||||
_detalhes.last_encounter2 = _detalhes.last_encounter
|
||||
_detalhes.last_encounter = _detalhes.tabela_vigente.is_boss.name
|
||||
|
||||
--debug
|
||||
_detalhes:Msg (_detalhes.debug_pots1 or "")
|
||||
_detalhes:Msg (_detalhes.debug_pots2 or "")
|
||||
|
||||
if (_detalhes.pre_pot_used) then
|
||||
_detalhes:Msg (_detalhes.pre_pot_used or "")
|
||||
_detalhes.pre_pot_used = nil
|
||||
end
|
||||
end
|
||||
|
||||
if (bossKilled) then
|
||||
@@ -486,13 +486,12 @@
|
||||
end
|
||||
end
|
||||
|
||||
--> schedule captures off
|
||||
if (_detalhes.debug) then
|
||||
_detalhes:Msg ("(debug) found encounter on last fight, freezing parser for 30 seconds.")
|
||||
end
|
||||
|
||||
if (_detalhes.tabela_vigente.instance_type == "raid") then
|
||||
_detalhes:CaptureSet (false, "damage", false, 30)
|
||||
--> schedule captures off
|
||||
_detalhes:CaptureSet (false, "damage", false, 15)
|
||||
if (_detalhes.debug) then
|
||||
_detalhes:Msg ("(debug) freezing parser for 15 seconds.")
|
||||
end
|
||||
end
|
||||
|
||||
--> schedule sync
|
||||
@@ -501,9 +500,6 @@
|
||||
_detalhes:ScheduleTimer ("DelayedSyncAlert", 3)
|
||||
end
|
||||
|
||||
--> schedule clean up
|
||||
--_detalhes:ScheduleTimer ("IniciarColetaDeLixo", 15, true)
|
||||
|
||||
else
|
||||
if (_detalhes.debug) then
|
||||
_detalhes:EqualizeActorsSchedule (_detalhes.host_of)
|
||||
|
||||
+1
-1
@@ -563,7 +563,7 @@
|
||||
esta_instancia.h_esquerda = nil
|
||||
esta_instancia.h_direita = nil
|
||||
esta_instancia.h_cima = nil
|
||||
esta_instancia.botao_separar = nil
|
||||
esta_instancia.break_snap_button = nil
|
||||
esta_instancia.alert = nil
|
||||
|
||||
esta_instancia.StatusBar = nil
|
||||
|
||||
+4
-2
@@ -68,6 +68,8 @@
|
||||
_detalhes:Msg ("(debug) received version alert ", build_number)
|
||||
end
|
||||
|
||||
build_number = tonumber (build_number)
|
||||
|
||||
if (not _detalhes.build_counter or not _detalhes.lastUpdateWarning or not build_number) then
|
||||
return
|
||||
end
|
||||
@@ -281,6 +283,7 @@
|
||||
assert (type (prefix) == "string" and string.len (prefix) == 2, "RegisterPluginComm expects a string with 2 characters on #2 argument.")
|
||||
assert (type (func) == "function", "RegisterPluginComm expects a function on #3 argument.")
|
||||
assert (plugins_registred [prefix] == nil, "Prefix " .. prefix .. " already in use.")
|
||||
assert (_detalhes.network.functions [prefix] == nil, "Prefix " .. prefix .. " already in use.")
|
||||
|
||||
plugins_registred [prefix] = {func, name, version}
|
||||
end
|
||||
@@ -408,5 +411,4 @@
|
||||
if (send_to_guild) then
|
||||
_detalhes:SendGuildData (_detalhes.network.ids.VERSION_CHECK, _detalhes.build_counter)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
+9
-1
@@ -2596,18 +2596,26 @@
|
||||
encounter_start_table:func()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local encounter_table, boss_index = _detalhes:GetBossEncounterDetailsFromEncounterId (zoneMapID, encounterID)
|
||||
if (encounter_table) then
|
||||
_detalhes.encounter_table.index = boss_index
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function _detalhes.parser_functions:ENCOUNTER_END (...)
|
||||
|
||||
if (not _detalhes.encounter_table.start) then
|
||||
return
|
||||
end
|
||||
|
||||
_detalhes.latest_ENCOUNTER_END = _detalhes.latest_ENCOUNTER_END or 0
|
||||
if (_detalhes.latest_ENCOUNTER_END + 15 > _detalhes._tempo) then
|
||||
return
|
||||
end
|
||||
_detalhes.latest_ENCOUNTER_END = _detalhes._tempo
|
||||
|
||||
_detalhes.encounter_table ["end"] = time() - 0.4
|
||||
|
||||
local encounterID, encounterName, difficultyID, raidSize, endStatus = _select (1, ...)
|
||||
|
||||
+60
-1
@@ -207,8 +207,67 @@
|
||||
return from > #s and "" or s:match(".*%S", from)
|
||||
end
|
||||
|
||||
-- /script print (_detalhes:Scale (0, 3, 1, 1000, math.abs (1.654-3)))
|
||||
-- lua base64 codec (c) 2006-2008 by Alex Kloss - http://www.it-rfc.de - licensed under the terms of the LGPL2 - http://lua-users.org/wiki/BaseSixtyFour
|
||||
do
|
||||
_detalhes._encode = {}
|
||||
|
||||
-- shift left
|
||||
local function lsh (value,shift)
|
||||
return (value*(2^shift)) % 256
|
||||
end
|
||||
|
||||
-- shift right
|
||||
local function rsh (value,shift)
|
||||
return math.floor(value/2^shift) % 256
|
||||
end
|
||||
|
||||
-- return single bit (for OR)
|
||||
local function bit (x,b)
|
||||
return (x % 2^b - x % 2^(b-1) > 0)
|
||||
end
|
||||
|
||||
-- logic OR for number values
|
||||
local function lor (x,y)
|
||||
result = 0
|
||||
for p=1,8 do result = result + (((bit(x,p) or bit(y,p)) == true) and 2^(p-1) or 0) end
|
||||
return result
|
||||
end
|
||||
|
||||
-- encryption table
|
||||
local base64chars = {[0]='A',[1]='B',[2]='C',[3]='D',[4]='E',[5]='F',[6]='G',[7]='H',[8]='I',[9]='J',[10]='K',[11]='L',[12]='M',[13]='N',[14]='O',[15]='P',[16]='Q',[17]='R',[18]='S',[19]='T',[20]='U',[21]='V',[22]='W',[23]='X',[24]='Y',[25]='Z',[26]='a',[27]='b',[28]='c',[29]='d',[30]='e',[31]='f',[32]='g',[33]='h',[34]='i',[35]='j',[36]='k',[37]='l',[38]='m',[39]='n',[40]='o',[41]='p',[42]='q',[43]='r',[44]='s',[45]='t',[46]='u',[47]='v',[48]='w',[49]='x',[50]='y',[51]='z',[52]='0',[53]='1',[54]='2',[55]='3',[56]='4',[57]='5',[58]='6',[59]='7',[60]='8',[61]='9',[62]='-',[63]='_'}
|
||||
|
||||
-- function encode
|
||||
-- encodes input string to base64.
|
||||
function _detalhes._encode:enc (data)
|
||||
local bytes = {}
|
||||
local result = ""
|
||||
for spos=0,string.len(data)-1,3 do
|
||||
for byte=1,3 do bytes[byte] = string.byte(string.sub(data,(spos+byte))) or 0 end
|
||||
result = string.format('%s%s%s%s%s',result,base64chars[rsh(bytes[1],2)],base64chars[lor(lsh((bytes[1] % 4),4), rsh(bytes[2],4))] or "=",((#data-spos) > 1) and base64chars[lor(lsh(bytes[2] % 16,2), rsh(bytes[3],6))] or "=",((#data-spos) > 2) and base64chars[(bytes[3] % 64)] or "=")
|
||||
end
|
||||
return result
|
||||
end
|
||||
|
||||
-- decryption table
|
||||
local base64bytes = {['A']=0,['B']=1,['C']=2,['D']=3,['E']=4,['F']=5,['G']=6,['H']=7,['I']=8,['J']=9,['K']=10,['L']=11,['M']=12,['N']=13,['O']=14,['P']=15,['Q']=16,['R']=17,['S']=18,['T']=19,['U']=20,['V']=21,['W']=22,['X']=23,['Y']=24,['Z']=25,['a']=26,['b']=27,['c']=28,['d']=29,['e']=30,['f']=31,['g']=32,['h']=33,['i']=34,['j']=35,['k']=36,['l']=37,['m']=38,['n']=39,['o']=40,['p']=41,['q']=42,['r']=43,['s']=44,['t']=45,['u']=46,['v']=47,['w']=48,['x']=49,['y']=50,['z']=51,['0']=52,['1']=53,['2']=54,['3']=55,['4']=56,['5']=57,['6']=58,['7']=59,['8']=60,['9']=61,['-']=62,['_']=63,['=']=nil}
|
||||
|
||||
-- function decode
|
||||
-- decode base64 input to string
|
||||
function _detalhes._encode:Decode (data)
|
||||
local chars = {}
|
||||
local result=""
|
||||
for dpos=0,string.len(data)-1,4 do
|
||||
for char=1,4 do chars[char] = base64bytes[(string.sub(data,(dpos+char),(dpos+char)) or "=")] end
|
||||
result = string.format('%s%s%s%s',result,string.char(lor(lsh(chars[1],2), rsh(chars[2],4))),(chars[3] ~= nil) and string.char(lor(lsh(chars[2],4), rsh(chars[3],2))) or "",(chars[4] ~= nil) and string.char(lor(lsh(chars[3],6) % 192, (chars[4]))) or "")
|
||||
end
|
||||
return result
|
||||
end
|
||||
|
||||
function _detalhes._encode:Encode (s)
|
||||
return _detalhes._encode:enc (s)
|
||||
end
|
||||
end
|
||||
|
||||
--> scale
|
||||
function _detalhes:Scale (rangeMin, rangeMax, scaleMin, scaleMax, x)
|
||||
return 1 + (x - rangeMin) * (scaleMax - scaleMin) / (rangeMax - rangeMin)
|
||||
|
||||
+671
-1
@@ -961,4 +961,674 @@
|
||||
f:SetBubbleText (nil)
|
||||
|
||||
f:Hide()
|
||||
end
|
||||
end
|
||||
|
||||
function _detalhes:ShowFeedbackRequestWindow()
|
||||
|
||||
local feedback_frame = CreateFrame ("FRAME", "DetailsFeedbackWindow", UIParent, "ButtonFrameTemplate")
|
||||
tinsert (UISpecialFrames, "DetailsFeedbackWindow")
|
||||
feedback_frame:SetPoint ("center", UIParent, "center")
|
||||
feedback_frame:SetSize (512, 200)
|
||||
feedback_frame.portrait:SetTexture ([[Interface\CHARACTERFRAME\TEMPORARYPORTRAIT-FEMALE-GNOME]])
|
||||
|
||||
feedback_frame.TitleText:SetText ("Details! Need Your Help!")
|
||||
|
||||
feedback_frame.uppertext = feedback_frame:CreateFontString (nil, "artwork", "GameFontNormal")
|
||||
feedback_frame.uppertext:SetText ("Tell us about your experience using Details!, what you liked most, where we could improve, what things you want to see in the future?")
|
||||
feedback_frame.uppertext:SetPoint ("topleft", feedback_frame, "topleft", 60, -32)
|
||||
local font, _, flags = feedback_frame.uppertext:GetFont()
|
||||
feedback_frame.uppertext:SetFont (font, 10, flags)
|
||||
feedback_frame.uppertext:SetTextColor (1, 1, 1, .8)
|
||||
feedback_frame.uppertext:SetWidth (440)
|
||||
|
||||
local editbox = _detalhes.gump:NewTextEntry (feedback_frame, nil, "$parentTextEntry", "text", 387, 14)
|
||||
editbox:SetPoint (20, -106)
|
||||
editbox:SetAutoFocus (false)
|
||||
editbox:SetHook ("OnEditFocusGained", function()
|
||||
editbox.text = "http://www.mmo-champion.com/threads/1480721-New-damage-meter-%28Details!%29-need-help-with-tests-and-feedbacks"
|
||||
editbox:HighlightText()
|
||||
end)
|
||||
editbox:SetHook ("OnEditFocusLost", function()
|
||||
editbox.text = "http://www.mmo-champion.com/threads/1480721-New-damage-meter-%28Details!%29-need-help-with-tests-and-feedbacks"
|
||||
editbox:HighlightText()
|
||||
end)
|
||||
editbox:SetHook ("OnChar", function()
|
||||
editbox.text = "http://www.mmo-champion.com/threads/1480721-New-damage-meter-%28Details!%29-need-help-with-tests-and-feedbacks"
|
||||
editbox:HighlightText()
|
||||
end)
|
||||
editbox.text = "http://www.mmo-champion.com/threads/1480721-New-damage-meter-%28Details!%29-need-help-with-tests-and-feedbacks"
|
||||
|
||||
|
||||
feedback_frame.midtext = feedback_frame:CreateFontString (nil, "artwork", "GameFontNormal")
|
||||
feedback_frame.midtext:SetText ("visit the link above and let's make Details! stronger!")
|
||||
feedback_frame.midtext:SetPoint ("center", editbox.widget, "center")
|
||||
feedback_frame.midtext:SetPoint ("top", editbox.widget, "bottom", 0, -2)
|
||||
feedback_frame.midtext:SetJustifyH ("center")
|
||||
local font, _, flags = feedback_frame.midtext:GetFont()
|
||||
feedback_frame.midtext:SetFont (font, 10, flags)
|
||||
--feedback_frame.midtext:SetTextColor (1, 1, 1, 1)
|
||||
feedback_frame.midtext:SetWidth (440)
|
||||
|
||||
|
||||
feedback_frame.gnoma = feedback_frame:CreateTexture (nil, "artwork")
|
||||
feedback_frame.gnoma:SetPoint ("topright", feedback_frame, "topright", -1, -59)
|
||||
feedback_frame.gnoma:SetTexture ("Interface\\AddOns\\Details\\images\\icons2")
|
||||
feedback_frame.gnoma:SetSize (105*1.05, 107*1.05)
|
||||
feedback_frame.gnoma:SetTexCoord (0.2021484375, 0, 0.7919921875, 1)
|
||||
|
||||
feedback_frame.close = CreateFrame ("Button", "DetailsFeedbackWindowCloseButton", feedback_frame, "OptionsButtonTemplate")
|
||||
feedback_frame.close:SetPoint ("bottomleft", feedback_frame, "bottomleft", 8, 4)
|
||||
feedback_frame.close:SetText ("Close")
|
||||
feedback_frame.close:SetScript ("OnClick", function (self)
|
||||
editbox:ClearFocus()
|
||||
feedback_frame:Hide()
|
||||
end)
|
||||
|
||||
feedback_frame.postpone = CreateFrame ("Button", "DetailsFeedbackWindowPostPoneButton", feedback_frame, "OptionsButtonTemplate")
|
||||
feedback_frame.postpone:SetPoint ("bottomright", feedback_frame, "bottomright", -10, 4)
|
||||
feedback_frame.postpone:SetText ("Remind-me Later")
|
||||
feedback_frame.postpone:SetScript ("OnClick", function (self)
|
||||
editbox:ClearFocus()
|
||||
feedback_frame:Hide()
|
||||
_detalhes.tutorial.feedback_window1 = false
|
||||
end)
|
||||
feedback_frame.postpone:SetWidth (130)
|
||||
|
||||
feedback_frame:SetScript ("OnHide", function()
|
||||
editbox:ClearFocus()
|
||||
end)
|
||||
|
||||
--0.0009765625 512
|
||||
function _detalhes:FeedbackSetFocus()
|
||||
DetailsFeedbackWindow:Show()
|
||||
DetailsFeedbackWindowTextEntry.MyObject:SetFocus()
|
||||
DetailsFeedbackWindowTextEntry.MyObject:HighlightText()
|
||||
end
|
||||
_detalhes:ScheduleTimer ("FeedbackSetFocus", 5)
|
||||
|
||||
end
|
||||
|
||||
--> interface menu
|
||||
local f = CreateFrame ("frame", "DetailsInterfaceOptionsPanel", UIParent)
|
||||
f.name = "Details"
|
||||
f.logo = f:CreateTexture (nil, "overlay")
|
||||
f.logo:SetPoint ("center", f, "center", 0, 0)
|
||||
f.logo:SetPoint ("top", f, "top", 25, 56)
|
||||
f.logo:SetTexture ([[Interface\AddOns\Details\images\logotipo]])
|
||||
f.logo:SetSize (256, 128)
|
||||
InterfaceOptions_AddCategory (f)
|
||||
|
||||
--> open options panel
|
||||
f.options_button = CreateFrame ("button", nil, f, "OptionsButtonTemplate")
|
||||
f.options_button:SetText (Loc ["STRING_INTERFACE_OPENOPTIONS"])
|
||||
f.options_button:SetPoint ("topleft", f, "topleft", 10, -100)
|
||||
f.options_button:SetWidth (170)
|
||||
f.options_button:SetScript ("OnClick", function (self)
|
||||
local lower_instance = _detalhes:GetLowerInstanceNumber()
|
||||
_detalhes:OpenOptionsWindow (_detalhes:GetInstance (lower_instance))
|
||||
end)
|
||||
|
||||
--> create new window
|
||||
f.new_window_button = CreateFrame ("button", nil, f, "OptionsButtonTemplate")
|
||||
f.new_window_button:SetText (Loc ["STRING_MINIMAPMENU_NEWWINDOW"])
|
||||
f.new_window_button:SetPoint ("topleft", f, "topleft", 10, -125)
|
||||
f.new_window_button:SetWidth (170)
|
||||
f.new_window_button:SetScript ("OnClick", function (self)
|
||||
_detalhes:CriarInstancia (_, true)
|
||||
end)
|
||||
|
||||
--> row text editor
|
||||
local panel = _detalhes.gump:NewPanel (UIParent, nil, "DetailsWindowOptionsBarTextEditor", nil, 650, 200)
|
||||
panel:SetPoint ("center", UIParent, "center")
|
||||
panel:Hide()
|
||||
panel:SetFrameStrata ("FULLSCREEN")
|
||||
panel:SetBackdrop ({ bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 64, insets = {left=3, right=3, top=3, bottom=3}})
|
||||
panel:DisableGradient()
|
||||
panel:SetBackdropColor (0, 0, 0, 0)
|
||||
panel.locked = false
|
||||
|
||||
local bg_texture = _detalhes.gump:NewImage (panel, [[Interface\AddOns\Details\images\welcome]], 1, 1, "background")
|
||||
bg_texture:SetPoint ("topleft", panel, "topleft")
|
||||
bg_texture:SetPoint ("bottomright", panel, "bottomright")
|
||||
|
||||
function panel.widget:Open (text, callback, host)
|
||||
if (host) then
|
||||
panel:SetPoint ("center", host, "center")
|
||||
end
|
||||
|
||||
text = text:gsub ("||", "|")
|
||||
panel.default_text = text
|
||||
panel.widget.editbox:SetText (text)
|
||||
panel.callback = callback
|
||||
panel:Show()
|
||||
end
|
||||
|
||||
local textentry = _detalhes.gump:NewSpecialLuaEditorEntry (panel.widget, 450, 180, "editbox", "$parentEntry", true)
|
||||
textentry:SetPoint ("topleft", panel.widget, "topleft", 10, -10)
|
||||
|
||||
local arg1_button = _detalhes.gump:NewButton (panel, nil, "$parentButton1", nil, 80, 20, function() textentry.editbox:Insert ("{data1}") end, nil, nil, nil, string.format (Loc ["STRING_OPTIONS_TEXTEDITOR_DATA"], "1"))
|
||||
local arg2_button = _detalhes.gump:NewButton (panel, nil, "$parentButton2", nil, 80, 20, function() textentry.editbox:Insert ("{data2}") end, nil, nil, nil, string.format (Loc ["STRING_OPTIONS_TEXTEDITOR_DATA"], "2"))
|
||||
local arg3_button = _detalhes.gump:NewButton (panel, nil, "$parentButton3", nil, 80, 20, function() textentry.editbox:Insert ("{data3}") end, nil, nil, nil, string.format (Loc ["STRING_OPTIONS_TEXTEDITOR_DATA"], "3"))
|
||||
arg1_button:SetPoint ("topright", panel, "topright", -10, -14)
|
||||
arg2_button:SetPoint ("topright", panel, "topright", -10, -36)
|
||||
arg3_button:SetPoint ("topright", panel, "topright", -10, -58)
|
||||
arg1_button:InstallCustomTexture()
|
||||
arg2_button:InstallCustomTexture()
|
||||
arg3_button:InstallCustomTexture()
|
||||
|
||||
arg1_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_DATA_TOOLTIP"]
|
||||
arg2_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_DATA_TOOLTIP"]
|
||||
arg3_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_DATA_TOOLTIP"]
|
||||
|
||||
-- code author Saiket from http://www.wowinterface.com/forums/showpost.php?p=245759&postcount=6
|
||||
--- @return StartPos, EndPos of highlight in this editbox.
|
||||
local function GetTextHighlight ( self )
|
||||
local Text, Cursor = self:GetText(), self:GetCursorPosition();
|
||||
self:Insert( "" ); -- Delete selected text
|
||||
local TextNew, CursorNew = self:GetText(), self:GetCursorPosition();
|
||||
-- Restore previous text
|
||||
self:SetText( Text );
|
||||
self:SetCursorPosition( Cursor );
|
||||
local Start, End = CursorNew, #Text - ( #TextNew - CursorNew );
|
||||
self:HighlightText( Start, End );
|
||||
return Start, End;
|
||||
end
|
||||
|
||||
local StripColors;
|
||||
do
|
||||
local CursorPosition, CursorDelta;
|
||||
--- Callback for gsub to remove unescaped codes.
|
||||
local function StripCodeGsub ( Escapes, Code, End )
|
||||
if ( #Escapes % 2 == 0 ) then -- Doesn't escape Code
|
||||
if ( CursorPosition and CursorPosition >= End - 1 ) then
|
||||
CursorDelta = CursorDelta - #Code;
|
||||
end
|
||||
return Escapes;
|
||||
end
|
||||
end
|
||||
--- Removes a single escape sequence.
|
||||
local function StripCode ( Pattern, Text, OldCursor )
|
||||
CursorPosition, CursorDelta = OldCursor, 0;
|
||||
return Text:gsub( Pattern, StripCodeGsub ), OldCursor and CursorPosition + CursorDelta;
|
||||
end
|
||||
--- Strips Text of all color escape sequences.
|
||||
-- @param Cursor Optional cursor position to keep track of.
|
||||
-- @return Stripped text, and the updated cursor position if Cursor was given.
|
||||
function StripColors ( Text, Cursor )
|
||||
Text, Cursor = StripCode( "(|*)(|c%x%x%x%x%x%x%x%x)()", Text, Cursor );
|
||||
return StripCode( "(|*)(|r)()", Text, Cursor );
|
||||
end
|
||||
end
|
||||
|
||||
local COLOR_END = "|r";
|
||||
--- Wraps this editbox's selected text with the given color.
|
||||
local function ColorSelection ( self, ColorCode )
|
||||
local Start, End = GetTextHighlight( self );
|
||||
local Text, Cursor = self:GetText(), self:GetCursorPosition();
|
||||
if ( Start == End ) then -- Nothing selected
|
||||
--Start, End = Cursor, Cursor; -- Wrap around cursor
|
||||
return; -- Wrapping the cursor in a color code and hitting backspace crashes the client!
|
||||
end
|
||||
-- Find active color code at the end of the selection
|
||||
local ActiveColor;
|
||||
if ( End < #Text ) then -- There is text to color after the selection
|
||||
local ActiveEnd;
|
||||
local CodeEnd, _, Escapes, Color = 0;
|
||||
while ( true ) do
|
||||
_, CodeEnd, Escapes, Color = Text:find( "(|*)(|c%x%x%x%x%x%x%x%x)", CodeEnd + 1 );
|
||||
if ( not CodeEnd or CodeEnd > End ) then
|
||||
break;
|
||||
end
|
||||
if ( #Escapes % 2 == 0 ) then -- Doesn't escape Code
|
||||
ActiveColor, ActiveEnd = Color, CodeEnd;
|
||||
end
|
||||
end
|
||||
|
||||
if ( ActiveColor ) then
|
||||
-- Check if color gets terminated before selection ends
|
||||
CodeEnd = 0;
|
||||
while ( true ) do
|
||||
_, CodeEnd, Escapes = Text:find( "(|*)|r", CodeEnd + 1 );
|
||||
if ( not CodeEnd or CodeEnd > End ) then
|
||||
break;
|
||||
end
|
||||
if ( CodeEnd > ActiveEnd and #Escapes % 2 == 0 ) then -- Terminates ActiveColor
|
||||
ActiveColor = nil;
|
||||
break;
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local Selection = Text:sub( Start + 1, End );
|
||||
-- Remove color codes from the selection
|
||||
local Replacement, CursorReplacement = StripColors( Selection, Cursor - Start );
|
||||
|
||||
self:SetText( ( "" ):join(
|
||||
Text:sub( 1, Start ),
|
||||
ColorCode, Replacement, COLOR_END,
|
||||
ActiveColor or "", Text:sub( End + 1 )
|
||||
) );
|
||||
|
||||
-- Restore cursor and highlight, adjusting for wrapper text
|
||||
Cursor = Start + CursorReplacement;
|
||||
if ( CursorReplacement > 0 ) then -- Cursor beyond start of color code
|
||||
Cursor = Cursor + #ColorCode;
|
||||
end
|
||||
if ( CursorReplacement >= #Replacement ) then -- Cursor beyond end of color
|
||||
Cursor = Cursor + #COLOR_END;
|
||||
end
|
||||
|
||||
self:SetCursorPosition( Cursor );
|
||||
-- Highlight selection and wrapper
|
||||
self:HighlightText( Start, #ColorCode + ( #Replacement - #Selection ) + #COLOR_END + End );
|
||||
end
|
||||
|
||||
local color_func = function (_, r, g, b, a)
|
||||
local hex = _detalhes:hex (a*255).._detalhes:hex (r*255).._detalhes:hex (g*255).._detalhes:hex (b*255)
|
||||
ColorSelection ( textentry.editbox, "|c" .. hex)
|
||||
end
|
||||
|
||||
local func_button = _detalhes.gump:NewButton (panel, nil, "$parentButton4", nil, 80, 20, function() textentry.editbox:Insert ("{func local player = ...; return 0;}") end, nil, nil, nil, Loc ["STRING_OPTIONS_TEXTEDITOR_FUNC"])
|
||||
local color_button = _detalhes.gump:NewColorPickButton (panel, "$parentButton5", nil, color_func)
|
||||
color_button:SetSize (80, 20)
|
||||
func_button:SetPoint ("topright", panel, "topright", -10, -80)
|
||||
color_button:SetPoint ("topright", panel, "topright", -10, -102)
|
||||
func_button:InstallCustomTexture()
|
||||
|
||||
color_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_COLOR_TOOLTIP"]
|
||||
func_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_FUNC_TOOLTIP"]
|
||||
|
||||
--color_button:InstallCustomTexture()
|
||||
|
||||
--local comma_button = _detalhes.gump:NewButton (panel, nil, "$parentButtonComma", nil, 80, 20, function() textentry.editbox:Insert ("_detalhes:comma_value ( )") end, nil, nil, nil, Loc ["STRING_OPTIONS_TEXTEDITOR_COMMA"])
|
||||
--local tok_button = _detalhes.gump:NewButton (panel, nil, "$parentButtonTok", nil, 80, 20, function() textentry.editbox:Insert ("_detalhes:ToK2 ( )") end, nil, nil, nil, Loc ["STRING_OPTIONS_TEXTEDITOR_TOK"])
|
||||
--comma_button:InstallCustomTexture()
|
||||
--tok_button:InstallCustomTexture()
|
||||
--comma_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_COMMA_TOOLTIP"]
|
||||
--tok_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_TOK_TOOLTIP"]
|
||||
|
||||
--comma_button:SetPoint ("topright", panel, "topright", -100, -14)
|
||||
--tok_button:SetPoint ("topright", panel, "topright", -100, -36)
|
||||
|
||||
local done = function()
|
||||
local text = panel.widget.editbox:GetText()
|
||||
text = text:gsub ("\n", "")
|
||||
|
||||
local test = text
|
||||
|
||||
local function errorhandler(err)
|
||||
return geterrorhandler()(err)
|
||||
end
|
||||
|
||||
local code = [[local str = "STR"; str = str:ReplaceData (100, 50, 75, {nome = "you", total = 10, total_without_pet = 5, damage_taken = 7, last_dps = 1, friendlyfire_total = 6, totalover = 2, totalabsorb = 4, totalover_without_pet = 6, healing_taken = 1, heal_enemy_amt = 2});]]
|
||||
code = code:gsub ("STR", test)
|
||||
|
||||
local f = loadstring (code)
|
||||
local err, two = xpcall (f, errorhandler)
|
||||
|
||||
if (not err) then
|
||||
return
|
||||
end
|
||||
|
||||
panel.callback (text)
|
||||
panel:Hide()
|
||||
end
|
||||
|
||||
local ok_button = _detalhes.gump:NewButton (panel, nil, "$parentButtonOk", nil, 80, 20, done, nil, nil, nil, Loc ["STRING_OPTIONS_TEXTEDITOR_DONE"])
|
||||
ok_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_DONE_TOOLTIP"]
|
||||
ok_button:InstallCustomTexture()
|
||||
ok_button:SetPoint ("topright", panel, "topright", -10, -174)
|
||||
|
||||
local reset_button = _detalhes.gump:NewButton (panel, nil, "$parentDefaultOk", nil, 80, 20, function() textentry.editbox:SetText (_detalhes.instance_defaults.row_info.textR_custom_text) end, nil, nil, nil, Loc ["STRING_OPTIONS_TEXTEDITOR_RESET"])
|
||||
reset_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_RESET_TOOLTIP"]
|
||||
reset_button:InstallCustomTexture()
|
||||
reset_button:SetPoint ("topright", panel, "topright", -100, -152)
|
||||
|
||||
local cancel_button = _detalhes.gump:NewButton (panel, nil, "$parentDefaultCancel", nil, 80, 20, function() textentry.editbox:SetText (panel.default_text); done(); end, nil, nil, nil, Loc ["STRING_OPTIONS_TEXTEDITOR_CANCEL"])
|
||||
cancel_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_CANCEL_TOOLTIP"]
|
||||
cancel_button:InstallCustomTexture()
|
||||
cancel_button:SetPoint ("topright", panel, "topright", -100, -174)
|
||||
|
||||
--update window
|
||||
function _detalhes:OpenUpdateWindow()
|
||||
|
||||
if (not _G.DetailsUpdateDialog) then
|
||||
local updatewindow_frame = CreateFrame ("frame", "DetailsUpdateDialog", UIParent, "ButtonFrameTemplate")
|
||||
updatewindow_frame:SetFrameStrata ("LOW")
|
||||
tinsert (UISpecialFrames, "DetailsUpdateDialog")
|
||||
updatewindow_frame:SetPoint ("center", UIParent, "center")
|
||||
updatewindow_frame:SetSize (512, 200)
|
||||
updatewindow_frame.portrait:SetTexture ([[Interface\CHARACTERFRAME\TEMPORARYPORTRAIT-FEMALE-GNOME]])
|
||||
|
||||
updatewindow_frame.TitleText:SetText ("A New Version Is Available!")
|
||||
|
||||
updatewindow_frame.midtext = updatewindow_frame:CreateFontString (nil, "artwork", "GameFontNormal")
|
||||
updatewindow_frame.midtext:SetText ("Good news everyone!\nA new version has been forged and is waiting to be looted.")
|
||||
updatewindow_frame.midtext:SetPoint ("topleft", updatewindow_frame, "topleft", 10, -90)
|
||||
updatewindow_frame.midtext:SetJustifyH ("center")
|
||||
updatewindow_frame.midtext:SetWidth (370)
|
||||
|
||||
updatewindow_frame.gnoma = updatewindow_frame:CreateTexture (nil, "artwork")
|
||||
updatewindow_frame.gnoma:SetPoint ("topright", updatewindow_frame, "topright", -3, -59)
|
||||
updatewindow_frame.gnoma:SetTexture ("Interface\\AddOns\\Details\\images\\icons2")
|
||||
updatewindow_frame.gnoma:SetSize (105*1.05, 107*1.05)
|
||||
updatewindow_frame.gnoma:SetTexCoord (0.2021484375, 0, 0.7919921875, 1)
|
||||
|
||||
local editbox = _detalhes.gump:NewTextEntry (updatewindow_frame, nil, "$parentTextEntry", "text", 387, 14)
|
||||
editbox:SetPoint (20, -136)
|
||||
editbox:SetAutoFocus (false)
|
||||
editbox:SetHook ("OnEditFocusGained", function()
|
||||
editbox.text = "http://www.curse.com/addons/wow/details"
|
||||
editbox:HighlightText()
|
||||
end)
|
||||
editbox:SetHook ("OnEditFocusLost", function()
|
||||
editbox.text = "http://www.curse.com/addons/wow/details"
|
||||
editbox:HighlightText()
|
||||
end)
|
||||
editbox:SetHook ("OnChar", function()
|
||||
editbox.text = "http://www.curse.com/addons/wow/details"
|
||||
editbox:HighlightText()
|
||||
end)
|
||||
editbox.text = "http://www.curse.com/addons/wow/details"
|
||||
|
||||
updatewindow_frame.close = CreateFrame ("Button", "DetailsUpdateDialogCloseButton", updatewindow_frame, "OptionsButtonTemplate")
|
||||
updatewindow_frame.close:SetPoint ("bottomleft", updatewindow_frame, "bottomleft", 8, 4)
|
||||
updatewindow_frame.close:SetText ("Close")
|
||||
|
||||
updatewindow_frame.close:SetScript ("OnClick", function (self)
|
||||
DetailsUpdateDialog:Hide()
|
||||
editbox:ClearFocus()
|
||||
end)
|
||||
|
||||
updatewindow_frame:SetScript ("OnHide", function()
|
||||
editbox:ClearFocus()
|
||||
end)
|
||||
|
||||
function _detalhes:UpdateDialogSetFocus()
|
||||
DetailsUpdateDialog:Show()
|
||||
DetailsUpdateDialogTextEntry.MyObject:SetFocus()
|
||||
DetailsUpdateDialogTextEntry.MyObject:HighlightText()
|
||||
end
|
||||
_detalhes:ScheduleTimer ("UpdateDialogSetFocus", 1)
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--> minimap icon and hotcorner
|
||||
function _detalhes:RegisterMinimapAndHotCorner()
|
||||
local LDB = LibStub ("LibDataBroker-1.1", true)
|
||||
local LDBIcon = LDB and LibStub ("LibDBIcon-1.0", true)
|
||||
|
||||
if LDB then
|
||||
|
||||
local databroker = LDB:NewDataObject ("Details!", {
|
||||
type = "launcher",
|
||||
icon = [[Interface\AddOns\Details\images\minimap]],
|
||||
text = "0",
|
||||
|
||||
HotCornerIgnore = true,
|
||||
|
||||
OnClick = function (self, button)
|
||||
|
||||
if (button == "LeftButton") then
|
||||
|
||||
--> 1 = open options panel
|
||||
if (_detalhes.minimap.onclick_what_todo == 1) then
|
||||
local lower_instance = _detalhes:GetLowerInstanceNumber()
|
||||
if (not lower_instance) then
|
||||
local instance = _detalhes:GetInstance (1)
|
||||
_detalhes.CriarInstancia (_, _, 1)
|
||||
_detalhes:OpenOptionsWindow (instance)
|
||||
else
|
||||
_detalhes:OpenOptionsWindow (_detalhes:GetInstance (lower_instance))
|
||||
end
|
||||
|
||||
--> 2 = reset data
|
||||
elseif (_detalhes.minimap.onclick_what_todo == 2) then
|
||||
_detalhes.tabela_historico:resetar()
|
||||
|
||||
--> 3 = unknown
|
||||
elseif (_detalhes.minimap.onclick_what_todo == 3) then
|
||||
|
||||
end
|
||||
|
||||
elseif (button == "RightButton") then
|
||||
|
||||
GameTooltip:Hide()
|
||||
local GameCooltip = GameCooltip
|
||||
|
||||
GameCooltip:Reset()
|
||||
GameCooltip:SetType ("menu")
|
||||
GameCooltip:SetOption ("ButtonsYMod", -5)
|
||||
GameCooltip:SetOption ("HeighMod", 5)
|
||||
GameCooltip:SetOption ("TextSize", 10)
|
||||
|
||||
--344 427 200 268 0.0009765625
|
||||
--0.672851, 0.833007, 0.391601, 0.522460
|
||||
|
||||
GameCooltip:SetBannerImage (1, [[Interface\AddOns\Details\images\icons]], 83*.5, 68*.5, {"bottomleft", "topleft", 1, -4}, {0.672851, 0.833007, 0.391601, 0.522460}, nil)
|
||||
GameCooltip:SetBannerImage (2, "Interface\\PetBattles\\Weather-Windy", 512*.35, 128*.3, {"bottomleft", "topleft", -25, -4}, {0, 1, 1, 0})
|
||||
GameCooltip:SetBannerText (1, "Mini Map Menu", {"left", "right", 2, -5}, "white", 10)
|
||||
|
||||
--> reset
|
||||
GameCooltip:AddMenu (1, _detalhes.tabela_historico.resetar, true, nil, nil, Loc ["STRING_MINIMAPMENU_RESET"], nil, true)
|
||||
GameCooltip:AddIcon ([[Interface\COMMON\VOICECHAT-MUTED]], 1, 1, 14, 14)
|
||||
|
||||
GameCooltip:AddLine ("$div")
|
||||
|
||||
--> nova instancai
|
||||
GameCooltip:AddMenu (1, _detalhes.CriarInstancia, true, nil, nil, Loc ["STRING_MINIMAPMENU_NEWWINDOW"], nil, true)
|
||||
GameCooltip:AddIcon ([[Interface\ICONS\Spell_ChargePositive]], 1, 1, 14, 14, 0.0703125, 0.9453125, 0.0546875, 0.9453125)
|
||||
|
||||
--> reopen window 64: 0.0078125
|
||||
local reopen = function()
|
||||
for _, instance in ipairs (_detalhes.tabela_instancias) do
|
||||
if (not instance:IsAtiva()) then
|
||||
_detalhes:CriarInstancia (instance.meu_id)
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
GameCooltip:AddMenu (1, reopen, nil, nil, nil, Loc ["STRING_MINIMAPMENU_REOPEN"], nil, true)
|
||||
GameCooltip:AddIcon ([[Interface\ICONS\Ability_Priest_VoidShift]], 1, 1, 14, 14, 0.0703125, 0.9453125, 0.0546875, 0.9453125)
|
||||
|
||||
GameCooltip:AddMenu (1, _detalhes.ReabrirTodasInstancias, true, nil, nil, Loc ["STRING_MINIMAPMENU_REOPENALL"], nil, true)
|
||||
GameCooltip:AddIcon ([[Interface\ICONS\Ability_Priest_VoidShift]], 1, 1, 14, 14, 0.0703125, 0.9453125, 0.0546875, 0.9453125, "#ffb400")
|
||||
|
||||
GameCooltip:AddLine ("$div")
|
||||
|
||||
--> lock
|
||||
GameCooltip:AddMenu (1, _detalhes.TravasInstancias, true, nil, nil, Loc ["STRING_MINIMAPMENU_LOCK"], nil, true)
|
||||
GameCooltip:AddIcon ([[Interface\PetBattles\PetBattle-LockIcon]], 1, 1, 14, 14, 0.0703125, 0.9453125, 0.0546875, 0.9453125)
|
||||
|
||||
GameCooltip:AddMenu (1, _detalhes.DestravarInstancias, true, nil, nil, Loc ["STRING_MINIMAPMENU_UNLOCK"], nil, true)
|
||||
GameCooltip:AddIcon ([[Interface\PetBattles\PetBattle-LockIcon]], 1, 1, 14, 14, 0.0703125, 0.9453125, 0.0546875, 0.9453125, "gray")
|
||||
|
||||
GameCooltip:SetOwner (self, "topright", "bottomleft")
|
||||
GameCooltip:ShowCooltip()
|
||||
|
||||
|
||||
end
|
||||
end,
|
||||
OnTooltipShow = function (tooltip)
|
||||
tooltip:AddLine ("Details!", 1, 1, 1)
|
||||
if (_detalhes.minimap.onclick_what_todo == 1) then
|
||||
tooltip:AddLine (Loc ["STRING_MINIMAP_TOOLTIP1"])
|
||||
elseif (_detalhes.minimap.onclick_what_todo == 2) then
|
||||
tooltip:AddLine (Loc ["STRING_MINIMAP_TOOLTIP11"])
|
||||
end
|
||||
tooltip:AddLine (Loc ["STRING_MINIMAP_TOOLTIP2"])
|
||||
end,
|
||||
})
|
||||
|
||||
if (databroker and not LDBIcon:IsRegistered ("Details!")) then
|
||||
LDBIcon:Register ("Details!", databroker, self.minimap)
|
||||
end
|
||||
|
||||
_detalhes.databroker = databroker
|
||||
|
||||
end
|
||||
|
||||
--register lib-hotcorners
|
||||
local on_click_on_hotcorner_button = function (frame, button)
|
||||
if (_detalhes.hotcorner_topleft.onclick_what_todo == 1) then
|
||||
local lower_instance = _detalhes:GetLowerInstanceNumber()
|
||||
if (not lower_instance) then
|
||||
local instance = _detalhes:GetInstance (1)
|
||||
_detalhes.CriarInstancia (_, _, 1)
|
||||
_detalhes:OpenOptionsWindow (instance)
|
||||
else
|
||||
_detalhes:OpenOptionsWindow (_detalhes:GetInstance (lower_instance))
|
||||
end
|
||||
|
||||
elseif (_detalhes.hotcorner_topleft.onclick_what_todo == 2) then
|
||||
_detalhes.tabela_historico:resetar()
|
||||
end
|
||||
end
|
||||
|
||||
local on_click_on_quickclick_button = function (frame, button)
|
||||
if (_detalhes.hotcorner_topleft.quickclick_what_todo == 1) then
|
||||
local lower_instance = _detalhes:GetLowerInstanceNumber()
|
||||
if (not lower_instance) then
|
||||
local instance = _detalhes:GetInstance (1)
|
||||
_detalhes.CriarInstancia (_, _, 1)
|
||||
_detalhes:OpenOptionsWindow (instance)
|
||||
else
|
||||
_detalhes:OpenOptionsWindow (_detalhes:GetInstance (lower_instance))
|
||||
end
|
||||
|
||||
elseif (_detalhes.hotcorner_topleft.quickclick_what_todo == 2) then
|
||||
_detalhes.tabela_historico:resetar()
|
||||
end
|
||||
end
|
||||
|
||||
local tooltip_hotcorner = function()
|
||||
GameTooltip:AddLine ("Details!", 1, 1, 1, 1)
|
||||
if (_detalhes.hotcorner_topleft.onclick_what_todo == 1) then
|
||||
GameTooltip:AddLine ("|cFF00FF00Left Click:|r open options panel.", 1, 1, 1, 1)
|
||||
|
||||
elseif (_detalhes.hotcorner_topleft.onclick_what_todo == 2) then
|
||||
GameTooltip:AddLine ("|cFF00FF00Left Click:|r clear all segments.", 1, 1, 1, 1)
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
_detalhes:RegisterHotCornerButton (
|
||||
--> absolute name
|
||||
"Details!",
|
||||
--> corner
|
||||
"TOPLEFT",
|
||||
--> config table
|
||||
self.hotcorner_topleft,
|
||||
--> frame _G name
|
||||
"DetailsLeftCornerButton",
|
||||
--> icon
|
||||
[[Interface\AddOns\Details\images\minimap]],
|
||||
--> tooltip
|
||||
tooltip_hotcorner,
|
||||
--> click function
|
||||
on_click_on_hotcorner_button,
|
||||
--> menus
|
||||
nil,
|
||||
--> quick click
|
||||
on_click_on_quickclick_button)
|
||||
end
|
||||
|
||||
--old versions dialog
|
||||
--[[
|
||||
--print ("Last Version:", _detalhes_database.last_version, "Last Interval Version:", _detalhes_database.last_realversion)
|
||||
|
||||
local resetwarning_frame = CreateFrame ("FRAME", "DetailsResetConfigWarningDialog", UIParent, "ButtonFrameTemplate")
|
||||
resetwarning_frame:SetFrameStrata ("LOW")
|
||||
tinsert (UISpecialFrames, "DetailsResetConfigWarningDialog")
|
||||
resetwarning_frame:SetPoint ("center", UIParent, "center")
|
||||
resetwarning_frame:SetSize (512, 200)
|
||||
resetwarning_frame.portrait:SetTexture ("Interface\\CHARACTERFRAME\\TEMPORARYPORTRAIT-FEMALE-GNOME")
|
||||
resetwarning_frame:SetScript ("OnHide", function()
|
||||
DetailsBubble:HideBubble()
|
||||
end)
|
||||
|
||||
resetwarning_frame.TitleText:SetText ("Noooooooooooo!!!")
|
||||
|
||||
resetwarning_frame.midtext = resetwarning_frame:CreateFontString (nil, "artwork", "GameFontNormal")
|
||||
resetwarning_frame.midtext:SetText ("A pack of murlocs has attacked Details! tech center, our gnomes engineers are working on fixing the damage.\n\n If something is messed in your Details!, especially the close, instance and reset buttons, you can either 'Reset Skin' or access the options panel.")
|
||||
resetwarning_frame.midtext:SetPoint ("topleft", resetwarning_frame, "topleft", 10, -90)
|
||||
resetwarning_frame.midtext:SetJustifyH ("center")
|
||||
resetwarning_frame.midtext:SetWidth (370)
|
||||
|
||||
resetwarning_frame.gnoma = resetwarning_frame:CreateTexture (nil, "artwork")
|
||||
resetwarning_frame.gnoma:SetPoint ("topright", resetwarning_frame, "topright", -3, -80)
|
||||
resetwarning_frame.gnoma:SetTexture ("Interface\\AddOns\\Details\\images\\icons2")
|
||||
resetwarning_frame.gnoma:SetSize (89*1.00, 97*1.00)
|
||||
--resetwarning_frame.gnoma:SetTexCoord (0.212890625, 0.494140625, 0.798828125, 0.99609375) -- 109 409 253 510
|
||||
resetwarning_frame.gnoma:SetTexCoord (0.17578125, 0.001953125, 0.59765625, 0.787109375) -- 1 306 90 403
|
||||
|
||||
resetwarning_frame.close = CreateFrame ("Button", "DetailsFeedbackWindowCloseButton", resetwarning_frame, "OptionsButtonTemplate")
|
||||
resetwarning_frame.close:SetPoint ("bottomleft", resetwarning_frame, "bottomleft", 8, 4)
|
||||
resetwarning_frame.close:SetText ("Close")
|
||||
resetwarning_frame.close:SetScript ("OnClick", function (self)
|
||||
resetwarning_frame:Hide()
|
||||
end)
|
||||
|
||||
resetwarning_frame.see_updates = CreateFrame ("Button", "DetailsResetWindowSeeUpdatesButton", resetwarning_frame, "OptionsButtonTemplate")
|
||||
resetwarning_frame.see_updates:SetPoint ("bottomright", resetwarning_frame, "bottomright", -10, 4)
|
||||
resetwarning_frame.see_updates:SetText ("Update Info")
|
||||
resetwarning_frame.see_updates:SetScript ("OnClick", function (self)
|
||||
_detalhes.OpenNewsWindow()
|
||||
DetailsBubble:HideBubble()
|
||||
--resetwarning_frame:Hide()
|
||||
end)
|
||||
resetwarning_frame.see_updates:SetWidth (130)
|
||||
|
||||
resetwarning_frame.reset_skin = CreateFrame ("Button", "DetailsResetWindowResetSkinButton", resetwarning_frame, "OptionsButtonTemplate")
|
||||
resetwarning_frame.reset_skin:SetPoint ("right", resetwarning_frame.see_updates, "left", -5, 0)
|
||||
resetwarning_frame.reset_skin:SetText ("Reset Skin")
|
||||
resetwarning_frame.reset_skin:SetScript ("OnClick", function (self)
|
||||
--do the reset
|
||||
for index, instance in ipairs (_detalhes.tabela_instancias) do
|
||||
if (not instance.iniciada) then
|
||||
instance:RestauraJanela()
|
||||
local skin = instance.skin
|
||||
instance:ChangeSkin ("Default Skin")
|
||||
instance:ChangeSkin ("Minimalistic")
|
||||
instance:ChangeSkin (skin)
|
||||
instance:DesativarInstancia()
|
||||
else
|
||||
local skin = instance.skin
|
||||
instance:ChangeSkin ("Default Skin")
|
||||
instance:ChangeSkin ("Minimalistic")
|
||||
instance:ChangeSkin (skin)
|
||||
end
|
||||
end
|
||||
end)
|
||||
resetwarning_frame.reset_skin:SetWidth (130)
|
||||
|
||||
resetwarning_frame.open_options = CreateFrame ("Button", "DetailsResetWindowOpenOptionsButton", resetwarning_frame, "OptionsButtonTemplate")
|
||||
resetwarning_frame.open_options:SetPoint ("right", resetwarning_frame.reset_skin, "left", -5, 0)
|
||||
resetwarning_frame.open_options:SetText ("Options Panel")
|
||||
resetwarning_frame.open_options:SetScript ("OnClick", function (self)
|
||||
local lower_instance = _detalhes:GetLowerInstanceNumber()
|
||||
if (not lower_instance) then
|
||||
local instance = _detalhes:GetInstance (1)
|
||||
_detalhes.CriarInstancia (_, _, 1)
|
||||
_detalhes:OpenOptionsWindow (instance)
|
||||
else
|
||||
_detalhes:OpenOptionsWindow (_detalhes:GetInstance (lower_instance))
|
||||
end
|
||||
end)
|
||||
resetwarning_frame.open_options:SetWidth (130)
|
||||
|
||||
function _detalhes:ResetWarningDialog()
|
||||
DetailsResetConfigWarningDialog:Show()
|
||||
DetailsBubble:SetOwner (resetwarning_frame.gnoma, "bottomright", "topleft", 30, -37, 1)
|
||||
DetailsBubble:FlipHorizontal()
|
||||
DetailsBubble:SetBubbleText ("", "", "WWHYYYYYYYYY!!!!", "", "")
|
||||
DetailsBubble:TextConfig (14, nil, "deeppink")
|
||||
DetailsBubble:ShowBubble()
|
||||
|
||||
|
||||
end
|
||||
_detalhes:ScheduleTimer ("ResetWarningDialog", 7)
|
||||
--]]
|
||||
+42
-4
@@ -377,6 +377,32 @@ local ButtonMetaFunctions = {}
|
||||
end
|
||||
end
|
||||
|
||||
-- icon
|
||||
function ButtonMetaFunctions:SetIcon (texture, width, height, layout, texcoord, overlay, textdistance)
|
||||
if (not self.icon) then
|
||||
self.icon = self:CreateTexture (nil, "artwork")
|
||||
self.icon:SetSize (self.height*0.8, self.height*0.8)
|
||||
self.icon:SetPoint ("left", self.widget, "left", 4, 0)
|
||||
|
||||
self.widget.text:ClearAllPoints()
|
||||
self.widget.text:SetPoint ("left", self.icon, "right", textdistance or 2, 0)
|
||||
end
|
||||
|
||||
self.icon:SetTexture (texture)
|
||||
self.icon:SetSize (width or self.height*0.8, height or self.height*0.8)
|
||||
self.icon:SetDrawLayer (layout or "artwork")
|
||||
if (texcoord) then
|
||||
self.icon:SetTexCoord (unpack (texcoord))
|
||||
else
|
||||
self.icon:SetTexCoord (0, 1, 0, 1)
|
||||
end
|
||||
if (overlay) then
|
||||
self.icon:SetVertexColor (unpack (overlay))
|
||||
else
|
||||
self.icon:SetVertexColor (1, 1, 1, 1)
|
||||
end
|
||||
end
|
||||
|
||||
-- frame stratas
|
||||
function ButtonMetaFunctions:SetFrameStrata()
|
||||
return self.button:GetFrameStrata()
|
||||
@@ -557,7 +583,9 @@ local ButtonMetaFunctions = {}
|
||||
end
|
||||
|
||||
if (button.MyObject.capsule_textalign) then
|
||||
if (button.MyObject.capsule_textalign == "left") then
|
||||
if (button.MyObject.icon) then
|
||||
button.MyObject.icon:SetPoint ("left", button, "left", 5, -1)
|
||||
elseif (button.MyObject.capsule_textalign == "left") then
|
||||
button.text:SetPoint ("left", button, "left", 3, -1)
|
||||
elseif (button.MyObject.capsule_textalign == "center") then
|
||||
button.text:SetPoint ("center", button, "center", 1, -1)
|
||||
@@ -565,7 +593,11 @@ local ButtonMetaFunctions = {}
|
||||
button.text:SetPoint ("right", button, "right", -1, -1)
|
||||
end
|
||||
else
|
||||
button.text:SetPoint ("center", button,"center", 1, -1)
|
||||
if (button.MyObject.icon) then
|
||||
button.MyObject.icon:SetPoint ("left", button, "left", 7, -2)
|
||||
else
|
||||
button.text:SetPoint ("center", button,"center", 1, -1)
|
||||
end
|
||||
end
|
||||
|
||||
button.mouse_down = GetTime()
|
||||
@@ -622,7 +654,9 @@ local ButtonMetaFunctions = {}
|
||||
end
|
||||
|
||||
if (button.MyObject.capsule_textalign) then
|
||||
if (button.MyObject.capsule_textalign == "left") then
|
||||
if (button.MyObject.icon) then
|
||||
button.MyObject.icon:SetPoint ("left", button, "left", 4, 0)
|
||||
elseif (button.MyObject.capsule_textalign == "left") then
|
||||
button.text:SetPoint ("left", button, "left", 2, 0)
|
||||
elseif (button.MyObject.capsule_textalign == "center") then
|
||||
button.text:SetPoint ("center", button, "center", 0, 0)
|
||||
@@ -630,7 +664,11 @@ local ButtonMetaFunctions = {}
|
||||
button.text:SetPoint ("right", button, "right", -2, 0)
|
||||
end
|
||||
else
|
||||
button.text:SetPoint ("center", button,"center", 0, 0)
|
||||
if (button.MyObject.icon) then
|
||||
button.MyObject.icon:SetPoint ("left", button, "left", 4, 0)
|
||||
else
|
||||
button.text:SetPoint ("center", button,"center", 0, 0)
|
||||
end
|
||||
end
|
||||
|
||||
if (button.MyObject.container.isMoving) then
|
||||
|
||||
+9
-8
@@ -639,7 +639,7 @@ function gump:NewFillPanel (parent, rows, name, member, w, h, total_lines, fill_
|
||||
if (panel.rows [i].type == "icon") then
|
||||
|
||||
local result = results [i]:gsub (".-%\\", "")
|
||||
row.row_widgets [i].icon.texture = results [i]
|
||||
row.row_widgets [i]._icon.texture = results [i]
|
||||
|
||||
elseif (panel.rows [i].type == "button") then
|
||||
|
||||
@@ -673,7 +673,7 @@ function gump:NewFillPanel (parent, rows, name, member, w, h, total_lines, fill_
|
||||
for i = 1, #row.row_widgets do
|
||||
row.row_widgets [i]:SetText ("")
|
||||
if (panel.rows [i].type == "icon") then
|
||||
row.row_widgets [i].icon.texture = ""
|
||||
row.row_widgets [i]._icon.texture = ""
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -682,7 +682,7 @@ function gump:NewFillPanel (parent, rows, name, member, w, h, total_lines, fill_
|
||||
for i = 1, #row.row_widgets do
|
||||
row.row_widgets [i]:SetText ("")
|
||||
if (panel.rows [i].type == "icon") then
|
||||
row.row_widgets [i].icon.texture = ""
|
||||
row.row_widgets [i]._icon.texture = ""
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -804,26 +804,27 @@ function gump:NewFillPanel (parent, rows, name, member, w, h, total_lines, fill_
|
||||
elseif (_type == "icon") then
|
||||
|
||||
--> create button and icon
|
||||
local iconbutton = gump:NewButton (row, nil, "$parentIconButton" .. o, "iconbutton", panel.rows [o].width, 20)
|
||||
local iconbutton = gump:NewButton (row, nil, "$parentIconButton" .. o, "iconbutton", 22, 20)
|
||||
iconbutton:InstallCustomTexture()
|
||||
|
||||
iconbutton:SetHook ("OnEnter", button_on_enter)
|
||||
iconbutton:SetHook ("OnLeave", button_on_leave)
|
||||
|
||||
--iconbutton:InstallCustomTexture()
|
||||
local icon = gump:NewImage (iconbutton, nil, 20, 20, "artwork", nil, "icon", "$parentIcon" .. o)
|
||||
local icon = gump:NewImage (iconbutton, nil, 20, 20, "artwork", nil, "_icon", "$parentIcon" .. o)
|
||||
iconbutton._icon = icon
|
||||
|
||||
iconbutton:SetPoint ("left", row, "left", anchors [o], 0)
|
||||
iconbutton:SetPoint ("left", row, "left", anchors [o] + ( (panel.rows [o].width - 22) / 2), 0)
|
||||
icon:SetPoint ("center", iconbutton, "center", 0, 0)
|
||||
|
||||
--> set functions
|
||||
local function iconcallback (texture)
|
||||
iconbutton.icon.texture = texture
|
||||
iconbutton._icon.texture = texture
|
||||
panel.rows [o].func (iconbutton.index, texture)
|
||||
end
|
||||
|
||||
iconbutton:SetClickFunction (function()
|
||||
gump:IconPick (iconcallback)
|
||||
gump:IconPick (iconcallback, true)
|
||||
return true
|
||||
end)
|
||||
|
||||
|
||||
@@ -700,8 +700,8 @@ function gump:NewSpecialLuaEditorEntry (parent, w, h, member, name, nointent)
|
||||
scrollframe.editbox:SetMultiLine (true)
|
||||
scrollframe.editbox:SetJustifyH ("left")
|
||||
scrollframe.editbox:SetJustifyV ("top")
|
||||
scrollframe.editbox:SetMaxBytes (40960)
|
||||
scrollframe.editbox:SetMaxLetters (20000)
|
||||
scrollframe.editbox:SetMaxBytes (1024000)
|
||||
scrollframe.editbox:SetMaxLetters (128000)
|
||||
|
||||
borderframe.GetText = function_gettext
|
||||
borderframe.SetText = function_settext
|
||||
|
||||
@@ -28,6 +28,11 @@ do
|
||||
local bossindex = _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].encounter_ids and _detalhes.EncounterInformation [mapid].encounter_ids [encounterid]
|
||||
if (bossindex) then
|
||||
return _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].encounters [bossindex], bossindex
|
||||
else
|
||||
local bossindex = _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].encounter_ids2 and _detalhes.EncounterInformation [mapid].encounter_ids2 [encounterid]
|
||||
if (bossindex) then
|
||||
return _detalhes.EncounterInformation [mapid] and _detalhes.EncounterInformation [mapid].encounters [bossindex], bossindex
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -571,7 +571,7 @@ local default_profile = {
|
||||
capture_real = {
|
||||
["damage"] = true,
|
||||
["heal"] = true,
|
||||
["energy"] = false,
|
||||
["energy"] = true,
|
||||
["miscdata"] = true,
|
||||
["aura"] = true,
|
||||
["spellcast"] = true,
|
||||
|
||||
+14
-10
@@ -5,6 +5,7 @@
|
||||
|
||||
|
||||
local _detalhes = _G._detalhes
|
||||
local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" )
|
||||
local _
|
||||
|
||||
--> install skin function:
|
||||
@@ -484,13 +485,15 @@ local _
|
||||
--[[ for the complete cprop list see the file classe_instancia_include.lua]]
|
||||
instance_cprops = {
|
||||
|
||||
instancebutton_config = {size = {20, 16}, anchor = {7, 0}, textcolor = {.7, .7, .7, 1}, textsize = 10, textfont = "Friz Quadrata TT", highlight_texture = [[Interface\Buttons\UI-Panel-MinimizeButton-Highlight]]},
|
||||
resetbutton_config = {size = {8, 16}, anchor = {2, 0}},
|
||||
closebutton_config = {size = {17, 17}, alpha = 0.60, anchor = {1, 0}},
|
||||
closebutton_config = {size = {20, 20}, alpha = 0.60, anchor = {1, 2}},
|
||||
instancebutton_config = {size = {20, 16}, anchor = {8, 0}, textcolor = {.7, .7, .7, 1}, textsize = 10, textfont = "Friz Quadrata TT", highlight_texture = [[Interface\Buttons\UI-Panel-MinimizeButton-Highlight]]},
|
||||
resetbutton_config = {size = {12, 12}, anchor = {4, 0}, normal_texture = [[Interface\Addons\Details\Images\reset_button2]], highlight_texture = [[Interface\Addons\Details\Images\reset_button2]]},
|
||||
|
||||
--resetbutton_config = {size = {8, 16}, anchor = {2, 0}},
|
||||
|
||||
menu_icons_size = 0.80,
|
||||
menu2_icons_size = 1.10,
|
||||
menu_anchor = {-55, 0, side = 2},
|
||||
menu_anchor = {-58, 0, side = 2},
|
||||
menu_anchor_down = {-60, 0},
|
||||
menu2_anchor = {32, 3},
|
||||
menu2_anchor_down = {32, 3},
|
||||
@@ -519,20 +522,21 @@ local _
|
||||
space = {left = 1, right = -2, between = 1},
|
||||
backdrop = {enabled = true, size = 4, color = {0, 0, 0, 1}, texture = "Details BarBorder 2"}
|
||||
},
|
||||
|
||||
wallpaper = {
|
||||
overlay = {0, 0, 0},
|
||||
width = 227.1267691385938,
|
||||
texcoord = {0.001000000014901161, 0.1710000038146973, 0.001000000014901161, 0.3539316177368164},
|
||||
overlay = {1, 1, 1},
|
||||
width = 256,
|
||||
texcoord = {49/1024, 305/1024, 646/1024, 774/1024},
|
||||
enabled = true,
|
||||
anchor = "all",
|
||||
height = 89.00001440917025,
|
||||
height = 128,
|
||||
alpha = 0.8,
|
||||
texture = "Interface\\Glues\\CREDITS\\Badlands3",
|
||||
texture = [[Interface\AddOns\Details\images\skins\elvui]],
|
||||
}
|
||||
},
|
||||
|
||||
skin_options = {
|
||||
{type = "button", label = "", text = "Align Within Right Chat", func = align_right_chat, desc = "Move and resize the windows #1 and #2 placing over the right chat window.\nThis process doesn't lock nor snap the two windows."}
|
||||
{type = "button", label = "", text = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON1"], func = align_right_chat, desc = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON1_DESC"]}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
+181
-13
@@ -45,6 +45,19 @@
|
||||
|
||||
local class_type_dano = _detalhes.atributos.dano
|
||||
local class_type_misc = _detalhes.atributos.misc
|
||||
|
||||
local object_keys = {
|
||||
["name"] = true,
|
||||
["icon"] = true,
|
||||
["attribute"] = true,
|
||||
["spellid"] = true,
|
||||
["author"] = true,
|
||||
["desc"] = true,
|
||||
["source"] = true,
|
||||
["target"] = true,
|
||||
["script"] = true,
|
||||
["tooltip"] = true,
|
||||
}
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> create the window
|
||||
@@ -60,6 +73,7 @@
|
||||
end
|
||||
|
||||
DetailsCustomPanel:Reset()
|
||||
DetailsCustomPanel:ClearFocus()
|
||||
|
||||
--> hide the frame
|
||||
_G.DetailsCustomPanel:Hide()
|
||||
@@ -132,6 +146,7 @@
|
||||
|
||||
DetailsCustomPanel.BoxType = 1
|
||||
DetailsCustomPanel.IsEditing = false
|
||||
DetailsCustomPanel.IsImporting = false
|
||||
DetailsCustomPanel.CodeEditing = false
|
||||
DetailsCustomPanel.current_attribute = "damagedone"
|
||||
|
||||
@@ -161,6 +176,12 @@
|
||||
]]
|
||||
DetailsCustomPanel.code2 = DetailsCustomPanel.code2_default
|
||||
|
||||
function DetailsCustomPanel:ClearFocus()
|
||||
custom_window.desc_field:ClearFocus()
|
||||
custom_window.name_field:ClearFocus()
|
||||
custom_window.author_field:ClearFocus()
|
||||
end
|
||||
|
||||
function DetailsCustomPanel:Reset()
|
||||
self.name_field:SetText ("")
|
||||
self.icon_image:SetTexture ([[Interface\ICONS\TEMP]])
|
||||
@@ -182,6 +203,8 @@
|
||||
|
||||
DetailsCustomPanel.current_attribute = "damagedone"
|
||||
DetailsCustomPanelAttributeMenu1:Click()
|
||||
|
||||
DetailsCustomPanel:ClearFocus()
|
||||
end
|
||||
|
||||
function DetailsCustomPanel:RemoveDisplay (custom_object, index)
|
||||
@@ -201,10 +224,13 @@
|
||||
_detalhes.switch:OnRemoveCustom (index)
|
||||
end
|
||||
|
||||
function DetailsCustomPanel:StartEdit (custom_object)
|
||||
function DetailsCustomPanel:StartEdit (custom_object, import)
|
||||
|
||||
DetailsCustomPanel:Reset()
|
||||
DetailsCustomPanel:ClearFocus()
|
||||
|
||||
DetailsCustomPanel.IsEditing = custom_object
|
||||
DetailsCustomPanel.IsImporting = import
|
||||
|
||||
self.name_field:SetText (custom_object:GetName())
|
||||
self.desc_field:SetText (custom_object:GetDesc())
|
||||
@@ -276,19 +302,25 @@
|
||||
|
||||
end
|
||||
|
||||
DetailsCustomPanel:SetAcceptButtonText (Loc ["STRING_CUSTOM_SAVE"])
|
||||
if (import) then
|
||||
DetailsCustomPanel:SetAcceptButtonText (Loc ["STRING_CUSTOM_IMPORT_BUTTON"])
|
||||
else
|
||||
DetailsCustomPanel:SetAcceptButtonText (Loc ["STRING_CUSTOM_SAVE"])
|
||||
end
|
||||
end
|
||||
|
||||
function DetailsCustomPanel:CreateNewCustom()
|
||||
|
||||
local name = self.name_field:GetText()
|
||||
DetailsCustomPanel:ClearFocus()
|
||||
_detalhes.MicroButtonAlert:Hide()
|
||||
|
||||
if (string.len (name) < 5) then
|
||||
return false, _detalhes:Msg (Loc ["STRING_CUSTOM_SHORTNAME"])
|
||||
elseif (string.len (name) > 32) then
|
||||
return false, _detalhes:Msg (Loc ["STRING_CUSTOM_LONGNAME"])
|
||||
end
|
||||
|
||||
|
||||
local icon = self.icon_image:GetTexture()
|
||||
local desc = self.desc_field:GetText()
|
||||
local author = self.author_field:GetText()
|
||||
@@ -324,9 +356,19 @@
|
||||
object.spellid = tonumber (spellid)
|
||||
object.script = false
|
||||
object.tooltip = false
|
||||
|
||||
if (DetailsCustomPanel.IsImporting) then
|
||||
_detalhes:Msg (Loc ["STRING_CUSTOM_IMPORTED"])
|
||||
else
|
||||
_detalhes:Msg (Loc ["STRING_CUSTOM_SAVED"])
|
||||
end
|
||||
|
||||
if (DetailsCustomPanel.IsImporting) then
|
||||
tinsert (_detalhes.custom, object)
|
||||
end
|
||||
|
||||
DetailsCustomPanel.IsEditing = false
|
||||
_detalhes:Msg (Loc ["STRING_CUSTOM_SAVED"])
|
||||
DetailsCustomPanel.IsImporting = false
|
||||
self.author_field:Enable()
|
||||
return true
|
||||
else
|
||||
@@ -369,8 +411,18 @@
|
||||
object.script = main_code
|
||||
object.tooltip = tooltip_code
|
||||
|
||||
if (DetailsCustomPanel.IsImporting) then
|
||||
_detalhes:Msg (Loc ["STRING_CUSTOM_IMPORTED"])
|
||||
else
|
||||
_detalhes:Msg (Loc ["STRING_CUSTOM_SAVED"])
|
||||
end
|
||||
|
||||
if (DetailsCustomPanel.IsImporting) then
|
||||
tinsert (_detalhes.custom, object)
|
||||
end
|
||||
|
||||
DetailsCustomPanel.IsEditing = false
|
||||
_detalhes:Msg (Loc ["STRING_CUSTOM_SAVED"])
|
||||
DetailsCustomPanel.IsImporting = false
|
||||
self.author_field:Enable()
|
||||
return true
|
||||
else
|
||||
@@ -401,6 +453,8 @@
|
||||
|
||||
function DetailsCustomPanel:AcceptFunc()
|
||||
|
||||
_detalhes.MicroButtonAlert:Hide()
|
||||
|
||||
if (DetailsCustomPanel.CodeEditing) then
|
||||
--> close the edit box saving the text
|
||||
if (DetailsCustomPanel.CodeEditing == 1) then
|
||||
@@ -410,7 +464,10 @@
|
||||
end
|
||||
|
||||
DetailsCustomPanel.CodeEditing = false
|
||||
if (DetailsCustomPanel.IsEditing) then
|
||||
|
||||
if (DetailsCustomPanel.IsImporting) then
|
||||
DetailsCustomPanel:SetAcceptButtonText (Loc ["STRING_CUSTOM_IMPORT_BUTTON"])
|
||||
elseif (DetailsCustomPanel.IsEditing) then
|
||||
DetailsCustomPanel:SetAcceptButtonText (Loc ["STRING_CUSTOM_SAVE"])
|
||||
else
|
||||
DetailsCustomPanel:SetAcceptButtonText (Loc ["STRING_CUSTOM_CREATE"])
|
||||
@@ -422,6 +479,7 @@
|
||||
local succesful_edit = DetailsCustomPanel:CreateNewCustom()
|
||||
if (succesful_edit) then
|
||||
DetailsCustomPanel.IsEditing = false
|
||||
DetailsCustomPanel.IsImporting = false
|
||||
DetailsCustomPanel:SetAcceptButtonText (Loc ["STRING_CUSTOM_CREATE"])
|
||||
DetailsCustomPanel:Reset()
|
||||
end
|
||||
@@ -433,12 +491,17 @@
|
||||
|
||||
function DetailsCustomPanel:CancelFunc()
|
||||
|
||||
DetailsCustomPanel:ClearFocus()
|
||||
_detalhes.MicroButtonAlert:Hide()
|
||||
|
||||
if (DetailsCustomPanel.CodeEditing) then
|
||||
--> close the edit box without save
|
||||
custom_window.codeeditor:Hide()
|
||||
DetailsCustomPanel.CodeEditing = false
|
||||
|
||||
if (DetailsCustomPanel.IsEditing) then
|
||||
if (DetailsCustomPanel.IsImporting) then
|
||||
DetailsCustomPanel:SetAcceptButtonText (Loc ["STRING_CUSTOM_IMPORT_BUTTON"])
|
||||
elseif (DetailsCustomPanel.IsEditing) then
|
||||
DetailsCustomPanel:SetAcceptButtonText (Loc ["STRING_CUSTOM_SAVE"])
|
||||
else
|
||||
DetailsCustomPanel:SetAcceptButtonText (Loc ["STRING_CUSTOM_CREATE"])
|
||||
@@ -446,6 +509,7 @@
|
||||
|
||||
elseif (DetailsCustomPanel.IsEditing) then
|
||||
DetailsCustomPanel.IsEditing = false
|
||||
DetailsCustomPanel.IsImporting = false
|
||||
DetailsCustomPanel:SetAcceptButtonText (Loc ["STRING_CUSTOM_CREATE"])
|
||||
DetailsCustomPanel:Reset()
|
||||
|
||||
@@ -465,6 +529,8 @@
|
||||
return
|
||||
end
|
||||
|
||||
DetailsCustomPanel:ClearFocus()
|
||||
|
||||
custom_window.selected_left:SetPoint ("topleft", self, "topleft")
|
||||
custom_window.selected_right:SetPoint ("topright", self, "topright")
|
||||
|
||||
@@ -600,18 +666,120 @@
|
||||
--> export button
|
||||
local export_display = function (_, _, custom_object, index)
|
||||
GameCooltip:Hide()
|
||||
--DetailsCustomPanel:RemoveDisplay (custom_object, index)
|
||||
|
||||
local export_object = {}
|
||||
|
||||
for key, value in pairs (custom_object) do
|
||||
if (object_keys [key]) then
|
||||
if (type (value) == "table") then
|
||||
export_object [key] = table_deepcopy (value)
|
||||
else
|
||||
export_object [key] = value
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local serialized_table = _detalhes:Serialize (export_object)
|
||||
--local zip = LibStub:GetLibrary ("LibCompress"):CompressHuffman (serialized_table)
|
||||
--local encoded = _detalhes._encode:Encode (zip)
|
||||
local encoded = _detalhes._encode:Encode (serialized_table)
|
||||
|
||||
if (not custom_window.ExportBox) then
|
||||
local editbox = _detalhes.gump:NewTextEntry (custom_window, nil, "$parentExportBox", "ExportBox", 842, 20)
|
||||
editbox:SetPoint ("topleft", DetailsCustomPanel, "bottomleft", 10, 0)
|
||||
editbox:SetPoint ("topright", DetailsCustomPanel, "bottomright")
|
||||
editbox:SetAutoFocus (false)
|
||||
editbox:SetHook ("OnEditFocusLost", function()
|
||||
editbox:Hide()
|
||||
end)
|
||||
editbox:SetHook ("OnChar", function()
|
||||
editbox:Hide()
|
||||
end)
|
||||
end
|
||||
|
||||
if (custom_window.ImportBox) then
|
||||
custom_window.ImportBox:Hide()
|
||||
custom_window.exportLabel:Hide()
|
||||
custom_window.ImportConfirm:Hide()
|
||||
end
|
||||
|
||||
custom_window.ExportBox:Show()
|
||||
custom_window.ExportBox:SetText (encoded)
|
||||
custom_window.ExportBox:HighlightText()
|
||||
custom_window.ExportBox:SetFocus()
|
||||
|
||||
end
|
||||
custom_window:CreateMenuButton (Loc ["STRING_CUSTOM_EXPORT"], "Interface\\ICONS\\INV_Misc_Gift_01", build_menu, export_display, nil, nil, "Export", {0.00, 0.9, 0.07, 0.93}) --> localize
|
||||
DetailsCustomPanelExport:Disable()
|
||||
|
||||
--> import buttonRaceChange
|
||||
local import_display = function (_, _, custom_object, index)
|
||||
GameCooltip:Hide()
|
||||
--DetailsCustomPanel:RemoveDisplay (custom_object, index)
|
||||
|
||||
if (not custom_window.ImportBox) then
|
||||
|
||||
local export_string = gump:NewLabel (custom_window, custom_window, "$parenImportLabel", "exportLabel", Loc ["STRING_CUSTOM_PASTE"], "GameFontNormal")
|
||||
export_string:SetPoint ("topleft", DetailsCustomPanel, "bottomleft", 10, -5)
|
||||
|
||||
local editbox = _detalhes.gump:NewTextEntry (custom_window, nil, "$parentImportBox", "ImportBox", 772 - export_string.width - 2, 20)
|
||||
editbox:SetPoint ("left", export_string, "right", 2, 0)
|
||||
editbox:SetAutoFocus (false)
|
||||
|
||||
local import = function()
|
||||
local text = editbox:GetText()
|
||||
|
||||
local decode = _detalhes._encode:Decode (text)
|
||||
--local unzip = LibStub:GetLibrary ("LibCompress"):DecompressHuffman (decode)
|
||||
--local deserialized_object = select (2, _detalhes:Deserialize (unzip))
|
||||
|
||||
if (type (decode) ~= "string") then
|
||||
_detalhes:Msg (Loc ["STRING_CUSTOM_IMPORT_ERROR"])
|
||||
return
|
||||
end
|
||||
|
||||
local deserialized_object = select (2, _detalhes:Deserialize (decode))
|
||||
|
||||
if (DetailsCustomPanel.CodeEditing) then
|
||||
DetailsCustomPanel:CancelFunc()
|
||||
end
|
||||
|
||||
if (type (deserialized_object) == "string") then
|
||||
_detalhes:Msg (Loc ["STRING_CUSTOM_IMPORT_ERROR"])
|
||||
return
|
||||
end
|
||||
|
||||
setmetatable (deserialized_object, _detalhes.atributo_custom)
|
||||
deserialized_object.__index = _detalhes.atributo_custom
|
||||
|
||||
_detalhes.MicroButtonAlert.Text:SetText (Loc ["STRING_CUSTOM_IMPORT_ALERT"])
|
||||
_detalhes.MicroButtonAlert:SetPoint ("bottom", custom_window.box0.acceptbutton.widget, "top", 0, 20)
|
||||
_detalhes.MicroButtonAlert:SetHeight (200)
|
||||
_detalhes.MicroButtonAlert:Show()
|
||||
|
||||
DetailsCustomPanel:StartEdit (deserialized_object, true)
|
||||
|
||||
custom_window.ImportBox:ClearFocus()
|
||||
custom_window.ImportBox:Hide()
|
||||
custom_window.exportLabel:Hide()
|
||||
custom_window.ImportConfirm:Hide()
|
||||
end
|
||||
|
||||
local okey_button = gump:NewButton (custom_window, nil, "$parentImportConfirm", "ImportConfirm", 65, 18, import, nil, nil, nil, Loc ["STRING_CUSTOM_IMPORT_BUTTON"])
|
||||
okey_button:InstallCustomTexture()
|
||||
okey_button:SetPoint ("left", editbox, "right", 2, 0)
|
||||
end
|
||||
|
||||
if (custom_window.ExportBox) then
|
||||
custom_window.ExportBox:Hide()
|
||||
end
|
||||
|
||||
custom_window.ImportBox:SetText ("")
|
||||
custom_window.ImportBox:Show()
|
||||
custom_window.exportLabel:Show()
|
||||
custom_window.ImportConfirm:Show()
|
||||
custom_window.ImportBox:SetFocus()
|
||||
|
||||
end
|
||||
custom_window:CreateMenuButton (Loc ["STRING_CUSTOM_IMPORT"], "Interface\\ICONS\\INV_MISC_NOTE_02", build_menu, import_display, nil, nil, "Import", {0.00, 0.9, 0.07, 0.93}) --> localize
|
||||
DetailsCustomPanelImport:Disable()
|
||||
custom_window:CreateMenuButton (Loc ["STRING_CUSTOM_IMPORT"], "Interface\\ICONS\\INV_MISC_NOTE_02", import_display, nil, nil, nil, "Import", {0.00, 0.9, 0.07, 0.93}) --> localize
|
||||
|
||||
local box_types = {
|
||||
{}, --normal
|
||||
@@ -757,7 +925,7 @@
|
||||
desc_field:SetPoint ("left", desc_label, "left", 62, 0)
|
||||
desc_field.tooltip = Loc ["STRING_CUSTOM_DESCRIPTION_DESC"]
|
||||
custom_window.desc_field = desc_field
|
||||
|
||||
|
||||
--icon
|
||||
local icon_label = gump:NewLabel (box0, box0, "$parenIconLabel", "icon", Loc ["STRING_CUSTOM_ICON"], "GameFontHighlightLeft") --> localize-me
|
||||
icon_label:SetPoint ("topleft", desc_label, "bottomleft", 0, -12)
|
||||
|
||||
+343
-107
@@ -841,18 +841,15 @@ local menus = { --labels nos menus
|
||||
return f
|
||||
end
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
local background_on_enter2 = function (self)
|
||||
if (self.background_frame) then
|
||||
self = self.background_frame
|
||||
end
|
||||
|
||||
if (self.is_button) then
|
||||
self.label:SetTextColor ("white")
|
||||
|
||||
if (self.is_button1) then
|
||||
self.label:SetTextColor (self.is_button1)
|
||||
else
|
||||
self.label:SetTextColor (1, .8, 0)
|
||||
end
|
||||
@@ -887,19 +884,20 @@ local menus = { --labels nos menus
|
||||
end
|
||||
|
||||
GameCooltip:Hide()
|
||||
|
||||
if (self.is_button) then
|
||||
self.label:SetTextColor ({1, 0.8, 0})
|
||||
|
||||
if (self.is_button2) then
|
||||
self.label:SetTextColor (self.is_button2)
|
||||
else
|
||||
self.label:SetTextColor (1, 1, 1)
|
||||
end
|
||||
end
|
||||
|
||||
function window:create_line_background2 (frameX, label, parent, icon, is_button)
|
||||
function window:create_line_background2 (frameX, label, parent, icon, is_button1, is_button2)
|
||||
local f = CreateFrame ("frame", nil, frameX)
|
||||
f:SetPoint ("left", label.widget or label, "left", -2, 0)
|
||||
f:SetSize (260, 16)
|
||||
f.is_button = is_button
|
||||
f.is_button1 = is_button1
|
||||
f.is_button2 = is_button2
|
||||
f:SetScript ("OnEnter", background_on_enter2)
|
||||
f:SetScript ("OnLeave", background_on_leave2)
|
||||
f:SetScript ("OnMouseDown", background_on_mouse_down)
|
||||
@@ -927,13 +925,13 @@ local menus = { --labels nos menus
|
||||
return f
|
||||
end
|
||||
|
||||
function window:CreateLineBackground2 (frame, widget_name, label_name, desc_loc, icon, is_button)
|
||||
function window:CreateLineBackground2 (frame, widget_name, label_name, desc_loc, icon, is_button1, is_button2)
|
||||
|
||||
if (type (widget_name) == "table") then
|
||||
widget_name.info = desc_loc
|
||||
widget_name.have_tooltip = desc_loc
|
||||
widget_name.have_icon = icon
|
||||
local f = window:create_line_background2 (frame, label_name, widget_name, icon)
|
||||
local f = window:create_line_background2 (frame, label_name, widget_name, icon, is_button1, is_button2)
|
||||
if (widget_name.SetHook) then
|
||||
widget_name:SetHook ("OnEnter", background_on_enter2)
|
||||
widget_name:SetHook ("OnLeave", background_on_leave2)
|
||||
@@ -947,11 +945,13 @@ local menus = { --labels nos menus
|
||||
frame [widget_name].info = desc_loc
|
||||
frame [widget_name].have_tooltip = desc_loc
|
||||
frame [widget_name].have_icon = icon
|
||||
local f = window:create_line_background2 (frame, frame [label_name], frame [widget_name], icon, is_button)
|
||||
local f = window:create_line_background2 (frame, frame [label_name], frame [widget_name], icon, is_button1, is_button2)
|
||||
frame [widget_name]:SetHook ("OnEnter", background_on_enter2)
|
||||
frame [widget_name]:SetHook ("OnLeave", background_on_leave2)
|
||||
f.is_button = is_button
|
||||
frame [widget_name].is_button = is_button
|
||||
f.is_button1 = is_button1
|
||||
f.is_button2 = is_button2
|
||||
frame [widget_name].is_button1 = is_button1
|
||||
frame [widget_name].is_button2 = is_button2
|
||||
return f
|
||||
end
|
||||
|
||||
@@ -1966,11 +1966,11 @@ function window:CreateFrame18()
|
||||
|
||||
{"autoCurrentLabel", 10},
|
||||
|
||||
{"totalBarAnchorLabel", 11, true},
|
||||
{"totalBarIconLabel", 12},
|
||||
{"totalBarPickColorLabel", 13},
|
||||
{"totalBarLabel", 14},
|
||||
{"totalBarOnlyInGroupLabel", 15},
|
||||
--{"totalBarAnchorLabel", 11, true},
|
||||
--{"totalBarIconLabel", 12},
|
||||
--{"totalBarPickColorLabel", 13},
|
||||
--{"totalBarLabel", 14},
|
||||
--{"totalBarOnlyInGroupLabel", 15},
|
||||
}
|
||||
|
||||
window:arrange_menu (frame18, left_side, x, -90)
|
||||
@@ -1978,6 +1978,12 @@ function window:CreateFrame18()
|
||||
local right_side = {
|
||||
{"instancesMiscLabel", 1, true},
|
||||
{"deleteInstanceLabel", 2},
|
||||
|
||||
{"totalBarAnchorLabel", 3, true},
|
||||
{"totalBarIconLabel", 4},
|
||||
{"totalBarPickColorLabel", 5},
|
||||
{"totalBarLabel", 6},
|
||||
{"totalBarOnlyInGroupLabel", 7},
|
||||
}
|
||||
|
||||
window:arrange_menu (frame18, right_side, window.right_start_at, -90)
|
||||
@@ -1997,7 +2003,7 @@ function window:CreateFrame17()
|
||||
--> combat alpha modifier
|
||||
|
||||
--anchor
|
||||
g:NewLabel (frame17, _, "$parentHideInCombatAnchor", "hideInCombatAnchor", "Combat and Group Alpha Mod:", "GameFontNormal")
|
||||
g:NewLabel (frame17, _, "$parentHideInCombatAnchor", "hideInCombatAnchor", Loc ["STRING_OPTIONS_ALPHAMOD_ANCHOR"], "GameFontNormal")
|
||||
|
||||
--> hide in combat
|
||||
g:NewLabel (frame17, _, "$parentCombatAlphaLabel", "combatAlphaLabel", Loc ["STRING_OPTIONS_COMBAT_ALPHA"], "GameFontHighlightLeft")
|
||||
@@ -2140,6 +2146,17 @@ function window:CreateFrame16()
|
||||
local titulo_datacharts_desc = g:NewLabel (frame16, _, "$parentDataChartsText2", "DataCharts2Label", Loc ["STRING_OPTIONS_DATACHARTTITLE_DESC"], "GameFontNormal", 9, "white")
|
||||
titulo_datacharts_desc.width = 350
|
||||
|
||||
--> warning
|
||||
if (not _detalhes:GetPlugin ("DETAILS_PLUGIN_CHART_VIEWER")) then
|
||||
local label = g:NewLabel (frame16, _, "$parentPluginWarningLabel", "PluginWarningLabel", Loc ["STRING_OPTIONS_CHART_PLUGINWARNING"], "GameFontNormal")
|
||||
local image = g:NewImage (frame16, [[Interface\DialogFrame\UI-Dialog-Icon-AlertNew]])
|
||||
label:SetPoint ("topright", frame16, "topright", -42, -15)
|
||||
label:SetJustifyH ("left")
|
||||
label:SetWidth (160)
|
||||
image:SetPoint ("right", label, "left", -7, 0)
|
||||
image:SetSize (32, 32)
|
||||
end
|
||||
|
||||
--> panel
|
||||
local edit_name = function (index, name)
|
||||
_detalhes:TimeDataUpdate (index, name)
|
||||
@@ -2154,6 +2171,14 @@ function window:CreateFrame16()
|
||||
big_code_editor:SetBackdropColor (0, 0, 0, 1)
|
||||
big_code_editor:Hide()
|
||||
|
||||
big_code_editor:SetBackdropColor (0, 0, 0, 0.95)
|
||||
local background = g:NewImage (big_code_editor, [[Interface\ARCHEOLOGY\Arch-BookCompletedLeft]])
|
||||
background:SetPoint ("topleft", big_code_editor, "topleft")
|
||||
background:SetPoint ("bottomright", big_code_editor, "bottomright")
|
||||
background:SetDesaturated (true)
|
||||
background:SetTexCoord (1, 0, 0, 0.9)
|
||||
background:SetAlpha (0.2)
|
||||
|
||||
local accept = function()
|
||||
big_code_editor:ClearFocus()
|
||||
if (not big_code_editor.is_export) then
|
||||
@@ -2167,12 +2192,12 @@ function window:CreateFrame16()
|
||||
end
|
||||
local accept_changes = g:NewButton (big_code_editor, nil, "$parentAccept", "acceptButton", 24, 24, accept, nil, nil, [[Interface\Buttons\UI-CheckBox-Check]])
|
||||
accept_changes:SetPoint (10, 18)
|
||||
local accept_changes_label = g:NewLabel (big_code_editor, nil, nil, nil, "Save")
|
||||
local accept_changes_label = g:NewLabel (big_code_editor, nil, nil, nil, Loc ["STRING_OPTIONS_CHART_SAVE"])
|
||||
accept_changes_label:SetPoint ("left", accept_changes, "right", 2, 0)
|
||||
|
||||
local cancel_changes = g:NewButton (big_code_editor, nil, "$parentCancel", "CancelButton", 20, 20, cancel, nil, nil, [[Interface\PetBattles\DeadPetIcon]])
|
||||
cancel_changes:SetPoint (100, 17)
|
||||
local cancel_changes_label = g:NewLabel (big_code_editor, nil, nil, nil, "Cancel")
|
||||
local cancel_changes_label = g:NewLabel (big_code_editor, nil, nil, nil, Loc ["STRING_OPTIONS_CHART_CANCEL"])
|
||||
cancel_changes_label:SetPoint ("left", cancel_changes, "right", 2, 0)
|
||||
|
||||
local edit_code = function (index)
|
||||
@@ -2181,7 +2206,7 @@ function window:CreateFrame16()
|
||||
local func = data [2]
|
||||
|
||||
if (type (func) == "function") then
|
||||
return _detalhes:Msg ("The code is already loaded and cannot be displayed.")
|
||||
return _detalhes:Msg (Loc ["STRING_OPTIONS_CHART_CODELOADED"])
|
||||
end
|
||||
|
||||
big_code_editor:SetText (func)
|
||||
@@ -2220,23 +2245,34 @@ function window:CreateFrame16()
|
||||
big_code_editor2:SetBackdropColor (0, 0, 0, 1)
|
||||
big_code_editor2:Hide()
|
||||
|
||||
big_code_editor2:SetBackdropColor (0, 0, 0, 0.95)
|
||||
local background = g:NewImage (big_code_editor2, [[Interface\ARCHEOLOGY\Arch-BookCompletedLeft]])
|
||||
background:SetPoint ("topleft", big_code_editor2, "topleft")
|
||||
background:SetPoint ("bottomright", big_code_editor2, "bottomright")
|
||||
background:SetDesaturated (true)
|
||||
background:SetTexCoord (1, 0, 0, 0.9)
|
||||
background:SetAlpha (0.2)
|
||||
|
||||
local close_export_box = function()
|
||||
big_code_editor2:ClearFocus()
|
||||
big_code_editor2:Hide()
|
||||
end
|
||||
local close_export = g:NewButton (big_code_editor2, nil, "$parentClose", "closeButton", 24, 24, close_export_box, nil, nil, [[Interface\Buttons\UI-CheckBox-Check]])
|
||||
close_export:SetPoint (10, 18)
|
||||
local close_export_label = g:NewLabel (big_code_editor2, nil, nil, nil, "Close")
|
||||
local close_export_label = g:NewLabel (big_code_editor2, nil, nil, nil, Loc ["STRING_OPTIONS_CHART_CLOSE"])
|
||||
close_export_label:SetPoint ("left", close_export, "right", 2, 0)
|
||||
|
||||
local export_function = function (index)
|
||||
local data = _detalhes.savedTimeCaptures [index]
|
||||
if (data) then
|
||||
|
||||
local serialized = _detalhes:Serialize (data)
|
||||
local encoded = _detalhes._encode:Encode (serialized)
|
||||
|
||||
--serialized = LibStub:GetLibrary ("LibCompress"):CompressLZW (serialized)
|
||||
--local serialized = LibStub:GetLibrary ("LibCompress"):Compress (func)
|
||||
|
||||
big_code_editor2:SetText (serialized)
|
||||
big_code_editor2:SetText (encoded)
|
||||
|
||||
big_code_editor2:Show()
|
||||
big_code_editor2.editbox:HighlightText()
|
||||
@@ -2261,14 +2297,14 @@ function window:CreateFrame16()
|
||||
end
|
||||
|
||||
local header = {
|
||||
{name = "Name", width = 175, type = "entry", func = edit_name},
|
||||
{name = "Edit Code", width = 55, type = "button", func = edit_code, icon = [[Interface\Buttons\UI-GuildButton-OfficerNote-Disabled]], notext = true, iconalign = "center"},
|
||||
{name = "Icon", width = 50, type = "icon", func = edit_icon},
|
||||
{name = "Author", width = 125, type = "text", func = edit_author},
|
||||
{name = "Version", width = 65, type = "entry", func = edit_version},
|
||||
{name = "Enabled", width = 50, type = "button", func = edit_enabled, icon = [[Interface\COMMON\Indicator-Green]], notext = true, iconalign = "center"},
|
||||
{name = "Export", width = 50, type = "button", func = export_function, icon = [[Interface\Buttons\UI-GuildButton-PublicNote-Up]], notext = true, iconalign = "center"},
|
||||
{name = "Remove", width = 70, type = "button", func = remove_capture, icon = [[Interface\Glues\LOGIN\Glues-CheckBox-Check]], notext = true, iconalign = "center"},
|
||||
{name = Loc ["STRING_OPTIONS_CHART_NAME"], width = 175, type = "entry", func = edit_name},
|
||||
{name = Loc ["STRING_OPTIONS_CHART_EDIT"], width = 55, type = "button", func = edit_code, icon = [[Interface\Buttons\UI-GuildButton-OfficerNote-Disabled]], notext = true, iconalign = "center"},
|
||||
{name = Loc ["STRING_OPTIONS_CHART_ICON"], width = 50, type = "icon", func = edit_icon},
|
||||
{name = Loc ["STRING_OPTIONS_CHART_AUTHOR"], width = 125, type = "text", func = edit_author},
|
||||
{name = Loc ["STRING_OPTIONS_CHART_VERSION"], width = 65, type = "entry", func = edit_version},
|
||||
{name = Loc ["STRING_OPTIONS_CHART_ENABLED"], width = 50, type = "button", func = edit_enabled, icon = [[Interface\COMMON\Indicator-Green]], notext = true, iconalign = "center"},
|
||||
{name = Loc ["STRING_OPTIONS_CHART_EXPORT"], width = 50, type = "button", func = export_function, icon = [[Interface\Buttons\UI-GuildButton-MOTD-Up]], notext = true, iconalign = "center"},
|
||||
{name = Loc ["STRING_OPTIONS_CHART_REMOVE"], width = 70, type = "button", func = remove_capture, icon = [[Interface\Glues\LOGIN\Glues-CheckBox-Check]], notext = true, iconalign = "center"},
|
||||
}
|
||||
|
||||
local total_lines = function()
|
||||
@@ -2309,47 +2345,54 @@ function window:CreateFrame16()
|
||||
panel:Refresh()
|
||||
|
||||
--> add panel
|
||||
local addframe = g:NewPanel (frame16, nil, "$parentUserTimeCapturesAddPanel", "userTimeCaptureAddPanel", 640, 382)
|
||||
addframe.backdrop = {bgFile = [[Interface\AddOns\Details\images\background]]}
|
||||
addframe.color = "black"
|
||||
addframe:SetPoint (10, -70)
|
||||
local addframe = g:NewPanel (frame16, nil, "$parentUserTimeCapturesAddPanel", "userTimeCaptureAddPanel", 644, 382)
|
||||
addframe.backdrop = {bgFile = [[Interface\AddOns\Details\images\background]], edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]],
|
||||
tile = 1, tileSize = 16, edgeSize = 16, insets = {left = 3, right = 3, top = 2, bottom = 2}}
|
||||
addframe:SetPoint (8, -70)
|
||||
addframe:SetFrameLevel (7)
|
||||
addframe:Hide()
|
||||
|
||||
addframe:SetGradient ("OnEnter", {0, 0, 0, .95})
|
||||
addframe:SetGradient ("OnLeave", {0, 0, 0, .95})
|
||||
addframe:SetBackdropColor (0, 0, 0, .95)
|
||||
|
||||
addframe:SetBackdropColor (0, 0, 0, 0.95)
|
||||
local background = g:NewImage (addframe, [[Interface\ARCHEOLOGY\Arch-BookCompletedLeft]])
|
||||
background:SetPoint ("topleft", addframe, "topleft")
|
||||
background:SetPoint ("bottomright", addframe, "bottomright")
|
||||
background:SetDesaturated (true)
|
||||
background:SetTexCoord (1, 0, 0, 0.9)
|
||||
background:SetAlpha (0.2)
|
||||
|
||||
--> name
|
||||
local capture_name = g:NewLabel (addframe, nil, "$parentNameLabel", "nameLabel", "Name: ")
|
||||
local capture_name = g:NewLabel (addframe, nil, "$parentNameLabel", "nameLabel", Loc ["STRING_OPTIONS_CHART_ADDNAME"])
|
||||
local capture_name_entry = g:NewTextEntry (addframe, nil, "$parentNameEntry", "nameEntry", 160, 20, function() end)
|
||||
capture_name_entry:SetMaxLetters (16)
|
||||
capture_name_entry:SetPoint ("left", capture_name, "right", 2, 0)
|
||||
|
||||
--> function
|
||||
local capture_func = g:NewLabel (addframe, nil, "$parentFunctionLabel", "functionLabel", "Code: ")
|
||||
local capture_func = g:NewLabel (addframe, nil, "$parentFunctionLabel", "functionLabel", Loc ["STRING_OPTIONS_CHART_ADDCODE"])
|
||||
local capture_func_entry = g:NewSpecialLuaEditorEntry (addframe.widget, 300, 200, "funcEntry", "$parentFuncEntry")
|
||||
capture_func_entry:SetPoint ("topleft", capture_func.widget, "topright", 2, 0)
|
||||
capture_func_entry:SetSize (500, 200)
|
||||
|
||||
--> icon
|
||||
local capture_icon = g:NewLabel (addframe, nil, "$parentIconLabel", "iconLabel", "Icon: ")
|
||||
local capture_icon = g:NewLabel (addframe, nil, "$parentIconLabel", "iconLabel", Loc ["STRING_OPTIONS_CHART_ADDICON"])
|
||||
local icon_button_func = function (texture)
|
||||
addframe.iconButton.icon.texture = texture
|
||||
end
|
||||
local capture_icon_button = g:NewButton (addframe, nil, "$parentIconButton", "iconButton", 20, 20, function() g:IconPick (icon_button_func) end)
|
||||
local capture_icon_button = g:NewButton (addframe, nil, "$parentIconButton", "iconButton", 20, 20, function() g:IconPick (icon_button_func, true) end)
|
||||
local capture_icon_button_icon = g:NewImage (capture_icon_button, [[Interface\ICONS\TEMP]], 19, 19, "background", nil, "icon", "$parentIcon")
|
||||
capture_icon_button_icon:SetPoint (0, 0)
|
||||
capture_icon_button:InstallCustomTexture()
|
||||
capture_icon_button:SetPoint ("left", capture_icon, "right", 2, 0)
|
||||
|
||||
--> author
|
||||
local capture_author = g:NewLabel (addframe, nil, "$parentAuthorLabel", "authorLabel", "Author: ")
|
||||
local capture_author = g:NewLabel (addframe, nil, "$parentAuthorLabel", "authorLabel", Loc ["STRING_OPTIONS_CHART_ADDAUTHOR"])
|
||||
local capture_author_entry = g:NewTextEntry (addframe, nil, "$parentAuthorEntry", "authorEntry", 160, 20, function() end)
|
||||
capture_author_entry:SetPoint ("left", capture_author, "right", 2, 0)
|
||||
|
||||
--> version
|
||||
local capture_version = g:NewLabel (addframe, nil, "$parentVersionLabel", "versionLabel", "Version: ")
|
||||
local capture_version = g:NewLabel (addframe, nil, "$parentVersionLabel", "versionLabel", Loc ["STRING_OPTIONS_CHART_ADDVERSION"])
|
||||
local capture_version_entry = g:NewTextEntry (addframe, nil, "$parentVersionEntry", "versionEntry", 160, 20, function() end)
|
||||
capture_version_entry:SetPoint ("left", capture_version, "right", 2, 0)
|
||||
|
||||
@@ -2360,14 +2403,17 @@ function window:CreateFrame16()
|
||||
frame16.importEditor:Hide()
|
||||
big_code_editor:ClearFocus()
|
||||
big_code_editor:Hide()
|
||||
big_code_editor2:ClearFocus()
|
||||
big_code_editor2:Hide()
|
||||
if (DetailsIconPickFrame and DetailsIconPickFrame:IsShown()) then
|
||||
DetailsIconPickFrame:Hide()
|
||||
end
|
||||
end
|
||||
local addbutton = g:NewButton (frame16, nil, "$parentAddButton", "addbutton", 135, 21, add, nil, nil, nil, "Add Data Capture")
|
||||
local addbutton = g:NewButton (frame16, nil, "$parentAddButton", "addbutton", 100, 21, add, nil, nil, nil, Loc ["STRING_OPTIONS_CHART_ADD"])
|
||||
addbutton:InstallCustomTexture()
|
||||
addbutton:SetPoint ("bottomright", panel, "topright", -30, 0)
|
||||
|
||||
addbutton:SetIcon ([[Interface\PaperDollInfoFrame\Character-Plus]], 12, 12, nil, nil, nil, 4)
|
||||
|
||||
local left = g:NewImage (frame16, "Interface\\PaperDollInfoFrame\\PaperDollSidebarTabs", 64, 13, "artwork", {0, 1, 0, 0.05078125})
|
||||
left:SetPoint ("bottomright", addbutton, "bottomleft", 34, 0)
|
||||
left:SetBlendMode ("ADD")
|
||||
@@ -2378,17 +2424,35 @@ function window:CreateFrame16()
|
||||
|
||||
--> open import panel button
|
||||
|
||||
local importframe = g:NewSpecialLuaEditorEntry (frame16, 643, 382, "importEditor", "$parentImportEditor", true)
|
||||
importframe:SetPoint ("topleft", frame16, "topleft", 7, -70)
|
||||
local importframe = g:NewSpecialLuaEditorEntry (frame16, 644, 382, "importEditor", "$parentImportEditor", true)
|
||||
local font, size, flag = importframe.editbox:GetFont()
|
||||
importframe.editbox:SetFont (font, 9, flag)
|
||||
|
||||
importframe:SetPoint ("topleft", frame16, "topleft", 8, -70)
|
||||
importframe:SetFrameLevel (frame16:GetFrameLevel()+6)
|
||||
importframe:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]],
|
||||
tile = 1, tileSize = 16, edgeSize = 16, insets = {left = 5, right = 5, top = 5, bottom = 5}})
|
||||
importframe:SetBackdropColor (0, 0, 0, 1)
|
||||
importframe:Hide()
|
||||
|
||||
importframe:SetBackdropColor (0, 0, 0, 0.95)
|
||||
local background = g:NewImage (importframe, [[Interface\ARCHEOLOGY\Arch-BookCompletedLeft]])
|
||||
background:SetPoint ("topleft", importframe, "topleft")
|
||||
background:SetPoint ("bottomright", importframe, "bottomright")
|
||||
background:SetDesaturated (true)
|
||||
background:SetTexCoord (1, 0, 0, 0.9)
|
||||
background:SetAlpha (0.2)
|
||||
|
||||
local doimport = function()
|
||||
local text = importframe:GetText()
|
||||
local unserialize = select (2, _detalhes:Deserialize (text))
|
||||
|
||||
local decode = _detalhes._encode:Decode (text)
|
||||
if (type (decode) ~= "string") then
|
||||
_detalhes:Msg (Loc ["STRING_CUSTOM_IMPORT_ERROR"])
|
||||
return
|
||||
end
|
||||
|
||||
local unserialize = select (2, _detalhes:Deserialize (decode))
|
||||
|
||||
if (type (unserialize) == "table") then
|
||||
if (unserialize[1] and unserialize[2] and unserialize[3] and unserialize[4] and unserialize[5]) then
|
||||
@@ -2397,10 +2461,10 @@ function window:CreateFrame16()
|
||||
_detalhes:Msg (register)
|
||||
end
|
||||
else
|
||||
_detalhes:Msg ("The import string is invalid.")
|
||||
_detalhes:Msg (Loc ["STRING_OPTIONS_CHART_IMPORTERROR"])
|
||||
end
|
||||
else
|
||||
_detalhes:Msg ("The import string is invalid.")
|
||||
_detalhes:Msg (Loc ["STRING_OPTIONS_CHART_IMPORTERROR"])
|
||||
end
|
||||
|
||||
importframe:Hide()
|
||||
@@ -2409,7 +2473,7 @@ function window:CreateFrame16()
|
||||
|
||||
local accept_import = g:NewButton (importframe, nil, "$parentAccept", "acceptButton", 24, 24, doimport, nil, nil, [[Interface\Buttons\UI-CheckBox-Check]])
|
||||
accept_import:SetPoint (10, 18)
|
||||
local accept_import_label = g:NewLabel (importframe, nil, nil, nil, "Import")
|
||||
local accept_import_label = g:NewLabel (importframe, nil, nil, nil, Loc ["STRING_OPTIONS_CHART_IMPORT"])
|
||||
accept_import_label:SetPoint ("left", accept_import, "right", 2, 0)
|
||||
|
||||
local cancelimport = function()
|
||||
@@ -2419,7 +2483,7 @@ function window:CreateFrame16()
|
||||
|
||||
local cancel_changes = g:NewButton (importframe, nil, "$parentCancel", "CancelButton", 20, 20, cancelimport, nil, nil, [[Interface\PetBattles\DeadPetIcon]])
|
||||
cancel_changes:SetPoint (100, 17)
|
||||
local cancel_changes_label = g:NewLabel (importframe, nil, nil, nil, "Cancel")
|
||||
local cancel_changes_label = g:NewLabel (importframe, nil, nil, nil, Loc ["STRING_OPTIONS_CHART_CANCEL"])
|
||||
cancel_changes_label:SetPoint ("left", cancel_changes, "right", 2, 0)
|
||||
|
||||
local import = function()
|
||||
@@ -2429,13 +2493,16 @@ function window:CreateFrame16()
|
||||
addframe:Hide()
|
||||
big_code_editor:ClearFocus()
|
||||
big_code_editor:Hide()
|
||||
big_code_editor2:ClearFocus()
|
||||
big_code_editor2:Hide()
|
||||
if (DetailsIconPickFrame and DetailsIconPickFrame:IsShown()) then
|
||||
DetailsIconPickFrame:Hide()
|
||||
end
|
||||
end
|
||||
local importbutton = g:NewButton (frame16, nil, "$parentImportButton", "importbutton", 75, 21, import, nil, nil, nil, "Import")
|
||||
local importbutton = g:NewButton (frame16, nil, "$parentImportButton", "importbutton", 100, 21, import, nil, nil, nil, Loc ["STRING_OPTIONS_CHART_IMPORT"])
|
||||
importbutton:InstallCustomTexture()
|
||||
importbutton:SetPoint ("bottomright", panel, "topright", -165, 0)
|
||||
importbutton:SetPoint ("right", addbutton, "left", -4, 0)
|
||||
importbutton:SetIcon ([[Interface\Buttons\UI-GuildButton-PublicNote-Up]], 14, 14, nil, nil, nil, 4)
|
||||
|
||||
local left = g:NewImage (frame16, "Interface\\PaperDollInfoFrame\\PaperDollSidebarTabs", 64, 13, "artwork", {0, 1, 0, 0.05078125})
|
||||
left:SetPoint ("bottomright", importbutton, "bottomleft", 34, 0)
|
||||
@@ -2446,31 +2513,31 @@ function window:CreateFrame16()
|
||||
right:Hide()
|
||||
|
||||
--> close button
|
||||
local closebutton = g:NewButton (addframe, nil, "$parentAddCloseButton", "addClosebutton", 135, 21, function() addframe:Hide() end, nil, nil, nil, "Close")
|
||||
local closebutton = g:NewButton (addframe, nil, "$parentAddCloseButton", "addClosebutton", 100, 21, function() addframe:Hide() end, nil, nil, nil, Loc ["STRING_OPTIONS_CHART_CLOSE"])
|
||||
closebutton:InstallCustomTexture()
|
||||
|
||||
--> confirm add capture
|
||||
local addcapture = function()
|
||||
local name = capture_name_entry.text
|
||||
if (name == "") then
|
||||
return _detalhes:Msg ("The name is invalid.")
|
||||
return _detalhes:Msg (Loc ["STRING_OPTIONS_CHART_NAMEERROR"])
|
||||
end
|
||||
|
||||
local author = capture_author_entry.text
|
||||
if (author == "") then
|
||||
return _detalhes:Msg ("Author name is invalid.")
|
||||
return _detalhes:Msg (Loc ["STRING_OPTIONS_CHART_AUTHORERROR"])
|
||||
end
|
||||
|
||||
local icon = capture_icon_button_icon.texture
|
||||
|
||||
local version = capture_version_entry.text
|
||||
if (version == "") then
|
||||
return _detalhes:Msg ("Version is invalid.")
|
||||
return _detalhes:Msg (Loc ["STRING_OPTIONS_CHART_VERSIONERROR"])
|
||||
end
|
||||
|
||||
local func = capture_func_entry:GetText()
|
||||
if (func == "") then
|
||||
return _detalhes:Msg ("Function is invalid.")
|
||||
return _detalhes:Msg (Loc ["STRING_OPTIONS_CHART_FUNCERROR"])
|
||||
end
|
||||
|
||||
_detalhes:TimeDataRegister (name, func, nil, author, version, icon, true)
|
||||
@@ -2489,7 +2556,7 @@ function window:CreateFrame16()
|
||||
addframe:Hide();
|
||||
|
||||
end
|
||||
local addcapturebutton = g:NewButton (addframe, nil, "$parentAddCaptureButton", "addCapturebutton", 135, 21, addcapture, nil, nil, nil, "Add")
|
||||
local addcapturebutton = g:NewButton (addframe, nil, "$parentAddCaptureButton", "addCapturebutton", 100, 21, addcapture, nil, nil, nil, Loc ["STRING_OPTIONS_CHART_ADD2"])
|
||||
addcapturebutton:InstallCustomTexture()
|
||||
|
||||
--> anchors
|
||||
@@ -2499,8 +2566,12 @@ function window:CreateFrame16()
|
||||
capture_author:SetPoint (start, -80)
|
||||
capture_version:SetPoint (start, -105)
|
||||
capture_func:SetPoint (start, -130)
|
||||
closebutton:SetPoint ("bottomright", addframe, "bottomright", 0, 0)
|
||||
addcapturebutton:SetPoint (50, -360)
|
||||
|
||||
addcapturebutton:SetIcon ([[Interface\Buttons\UI-CheckBox-Check]], 18, 18, nil, nil, nil, 4)
|
||||
closebutton:SetIcon ([[Interface\PetBattles\DeadPetIcon]], 14, 14, nil, nil, nil, 4)
|
||||
|
||||
addcapturebutton:SetPoint ("bottomright", addframe, "bottomright", -5, 5)
|
||||
closebutton:SetPoint ("right", addcapturebutton, "left", -4, 0)
|
||||
|
||||
--> anchors
|
||||
|
||||
@@ -2538,12 +2609,12 @@ function window:CreateFrame15()
|
||||
|
||||
--> custom spells panel
|
||||
local header = {
|
||||
{name = "Index", width = 55, type = "text"},
|
||||
{name = "Name", width = 310, type = "entry", func = name_entry_func},
|
||||
{name = "Icon", width = 50, type = "icon", func = icon_func},
|
||||
{name = "Spell ID", width = 100, type = "text"},
|
||||
{name = "Reset", width = 50, type = "button", func = reset_func, icon = [[Interface\Buttons\UI-RefreshButton]], notext = true, iconalign = "center"},
|
||||
{name = "Remove", width = 75, type = "button", func = remove_func, icon = [[Interface\Glues\LOGIN\Glues-CheckBox-Check]], notext = true, iconalign = "center"},
|
||||
{name = Loc ["STRING_OPTIONS_SPELL_INDEX"], width = 55, type = "text"},
|
||||
{name = Loc ["STRING_OPTIONS_SPELL_NAME"], width = 310, type = "entry", func = name_entry_func},
|
||||
{name = Loc ["STRING_OPTIONS_SPELL_ICON"], width = 50, type = "icon", func = icon_func},
|
||||
{name = Loc ["STRING_OPTIONS_SPELL_SPELLID"], width = 100, type = "text"},
|
||||
{name = Loc ["STRING_OPTIONS_SPELL_RESET"], width = 50, type = "button", func = reset_func, icon = [[Interface\Buttons\UI-RefreshButton]], notext = true, iconalign = "center"},
|
||||
{name = Loc ["STRING_OPTIONS_SPELL_REMOVE"], width = 75, type = "button", func = remove_func, icon = [[Interface\Glues\LOGIN\Glues-CheckBox-Check]], notext = true, iconalign = "center"},
|
||||
}
|
||||
--local header = {{name = "Index", type = "text"}, {name = "Name", type = "entry"}, {name = "Icon", type = "icon"}, {name = "Author", type = "text"}, {name = "Version", type = "text"}}
|
||||
|
||||
@@ -2564,25 +2635,33 @@ function window:CreateFrame15()
|
||||
panel:Refresh()
|
||||
|
||||
--> add
|
||||
|
||||
|
||||
--> add panel
|
||||
local addframe = g:NewPanel (frame15, nil, "$parentCustomSpellsAddPanel", "customSpellsAddPanel", 640, 382)
|
||||
addframe.backdrop = {bgFile = [[Interface\AddOns\Details\images\background]]}
|
||||
addframe.color = "black"
|
||||
addframe:SetPoint (10, -70)
|
||||
local addframe = g:NewPanel (frame15, nil, "$parentCustomSpellsAddPanel", "customSpellsAddPanel", 644, 382)
|
||||
addframe.backdrop = {bgFile = [[Interface\AddOns\Details\images\background]], edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]],
|
||||
tile = 1, tileSize = 16, edgeSize = 16, insets = {left = 3, right = 3, top = 2, bottom = 2}}
|
||||
|
||||
addframe:SetPoint (8, -70)
|
||||
addframe:SetFrameLevel (7)
|
||||
addframe:Hide()
|
||||
|
||||
addframe:SetGradient ("OnEnter", {0, 0, 0, .95})
|
||||
addframe:SetGradient ("OnLeave", {0, 0, 0, .95})
|
||||
addframe:SetBackdropColor (0, 0, 0, .95)
|
||||
|
||||
local desc = "A ID is a unique number to identify the spell inside World of Warcraft. There is many ways to get the number:\n\n- On the Player Details Window, hold shift while hover over spells bars.\n- Type the spell name in the SpellId field, a tooltip is shown with suggested spells.\n- Community web sites, most of them have the spellid on the address link.\n- Browsing the spell cache below:"
|
||||
addframe:SetBackdropColor (0, 0, 0, 0.95)
|
||||
local background = g:NewImage (addframe, [[Interface\ACHIEVEMENTFRAME\UI-Achievement-StatsBackground]])
|
||||
background:SetPoint ("topleft", addframe, "topleft")
|
||||
background:SetPoint ("bottomright", addframe, "bottomright")
|
||||
background:SetDesaturated (true)
|
||||
background:SetTexCoord (1, 0, 0, 1)
|
||||
background:SetAlpha (0.4)
|
||||
|
||||
local desc = Loc ["STRING_OPTIONS_SPELL_SPELLID_DESC"]
|
||||
local desc_spellid = g:NewLabel (addframe, nil, "$parentSpellidDescLabel", "spellidDescLabel", desc)
|
||||
|
||||
local spellid = g:NewLabel (addframe, nil, "$parentSpellidLabel", "spellidLabel", "SpellId: ")
|
||||
local spellname = g:NewLabel (addframe, nil, "$parentSpellnameLabel", "spellnameLabel", "Custom Name: ")
|
||||
local spellicon = g:NewLabel (addframe, nil, "$parentSpelliconLabel", "spelliconLabel", "Custom Icon: ")
|
||||
local spellid = g:NewLabel (addframe, nil, "$parentSpellidLabel", "spellidLabel", Loc ["STRING_OPTIONS_SPELL_ADDSPELLID"])
|
||||
local spellname = g:NewLabel (addframe, nil, "$parentSpellnameLabel", "spellnameLabel", Loc ["STRING_OPTIONS_SPELL_ADDNAME"])
|
||||
local spellicon = g:NewLabel (addframe, nil, "$parentSpelliconLabel", "spelliconLabel", Loc ["STRING_OPTIONS_SPELL_ADDICON"])
|
||||
|
||||
local spellname_entry_func = function() end
|
||||
local spellname_entry = g:NewTextEntry (addframe, nil, "$parentSpellnameEntry", "spellnameEntry", 160, 20, spellname_entry_func)
|
||||
@@ -2594,7 +2673,7 @@ function window:CreateFrame15()
|
||||
spellname_entry:SetText (spellname)
|
||||
addframe.spellIconButton.icon.texture = icon
|
||||
else
|
||||
_detalhes:Msg ("Spell not found.")
|
||||
_detalhes:Msg (Loc ["STRING_OPTIONS_SPELL_NOTFOUND"])
|
||||
end
|
||||
end
|
||||
local spellid_entry = g:NewSpellEntry (addframe, spellid_entry_func, 160, 20, nil, nil, "spellidEntry", "$parentSpellidEntry")
|
||||
@@ -2604,7 +2683,7 @@ function window:CreateFrame15()
|
||||
local icon_button_func = function (texture)
|
||||
addframe.spellIconButton.icon.texture = texture
|
||||
end
|
||||
local icon_button = g:NewButton (addframe, nil, "$parentSpellIconButton", "spellIconButton", 20, 20, function() g:IconPick (icon_button_func) end)
|
||||
local icon_button = g:NewButton (addframe, nil, "$parentSpellIconButton", "spellIconButton", 20, 20, function() g:IconPick (icon_button_func, true) end)
|
||||
local icon_button_icon = g:NewImage (icon_button, [[Interface\ICONS\TEMP]], 19, 19, "background", nil, "icon", "$parentSpellIcon")
|
||||
icon_button_icon:SetPoint (0, 0)
|
||||
icon_button:InstallCustomTexture()
|
||||
@@ -2653,24 +2732,24 @@ function window:CreateFrame15()
|
||||
end
|
||||
|
||||
--> close button
|
||||
local closebutton = g:NewButton (addframe, nil, "$parentAddCloseButton", "addClosebutton", 135, 21, function() addframe:Hide(); table.wipe (all_cached_spells) end, nil, nil, nil, "Close")
|
||||
local closebutton = g:NewButton (addframe, nil, "$parentAddCloseButton", "addClosebutton", 100, 21, function() addframe:Hide(); table.wipe (all_cached_spells) end, nil, nil, nil, Loc ["STRING_OPTIONS_SPELL_CLOSE"])
|
||||
closebutton:InstallCustomTexture()
|
||||
|
||||
--> confirm add spell
|
||||
local addspell = function()
|
||||
local id = spellid_entry.text
|
||||
if (id == "") then
|
||||
return _detalhes:Msg ("Spell id invalid.")
|
||||
return _detalhes:Msg (Loc ["STRING_OPTIONS_SPELL_IDERROR"])
|
||||
end
|
||||
local name = spellname_entry.text
|
||||
if (name == "") then
|
||||
return _detalhes:Msg ("Spell name invalid.")
|
||||
return _detalhes:Msg (Loc ["STRING_OPTIONS_SPELL_NAMEERROR"])
|
||||
end
|
||||
local icon = addframe.spellIconButton.icon.texture
|
||||
|
||||
id = tonumber (id)
|
||||
if (not id) then
|
||||
return _detalhes:Msg ("Spell id invalid.")
|
||||
return _detalhes:Msg (Loc ["STRING_OPTIONS_SPELL_IDERROR"])
|
||||
end
|
||||
|
||||
_detalhes:UserCustomSpellAdd (id, name, icon)
|
||||
@@ -2687,16 +2766,21 @@ function window:CreateFrame15()
|
||||
addframe:Hide();
|
||||
table.wipe (all_cached_spells)
|
||||
end
|
||||
local addspellbutton = g:NewButton (addframe, nil, "$parentAddSpellButton", "addSpellbutton", 135, 21, addspell, nil, nil, nil, "Add")
|
||||
local addspellbutton = g:NewButton (addframe, nil, "$parentAddSpellButton", "addSpellbutton", 100, 21, addspell, nil, nil, nil, Loc ["STRING_OPTIONS_SPELL_ADD"])
|
||||
addspellbutton:InstallCustomTexture()
|
||||
|
||||
addspellbutton:SetIcon ([[Interface\Buttons\UI-CheckBox-Check]], 18, 18, nil, nil, nil, 4)
|
||||
closebutton:SetIcon ([[Interface\PetBattles\DeadPetIcon]], 14, 14, nil, nil, nil, 4)
|
||||
|
||||
addspellbutton:SetPoint ("bottomright", addframe, "bottomright", -5, 5)
|
||||
closebutton:SetPoint ("right", addspellbutton, "left", -4, 0)
|
||||
|
||||
closebutton:SetPoint ("bottomright", addframe, "bottomright", 0, 0)
|
||||
desc_spellid:SetPoint (50, -30)
|
||||
scrollframe:SetPoint ("topleft", addframe.widget, "topleft", 50, -110)
|
||||
spellid:SetPoint (50, -285)
|
||||
spellname:SetPoint (50, -310)
|
||||
spellicon:SetPoint (50, -335)
|
||||
addspellbutton:SetPoint (50, -360)
|
||||
|
||||
|
||||
scrollframe:Show()
|
||||
|
||||
@@ -2714,17 +2798,17 @@ function window:CreateFrame15()
|
||||
refresh_cache (scrollframe)
|
||||
end
|
||||
|
||||
|
||||
|
||||
--> open add panel button
|
||||
local add = function()
|
||||
update_cache_scroll()
|
||||
addframe:Show()
|
||||
end
|
||||
local addbutton = g:NewButton (frame15, nil, "$parentAddButton", "addbutton", 135, 21, add, nil, nil, nil, "Add Spell")
|
||||
local addbutton = g:NewButton (frame15, nil, "$parentAddButton", "addbutton", 100, 21, add, nil, nil, nil, Loc ["STRING_OPTIONS_SPELL_ADDSPELL"])
|
||||
addbutton:InstallCustomTexture()
|
||||
addbutton:SetPoint ("bottomright", panel, "topright", -30, 0)
|
||||
|
||||
addbutton:SetIcon ([[Interface\PaperDollInfoFrame\Character-Plus]], 12, 12, nil, nil, nil, 4)
|
||||
|
||||
local left = g:NewImage (frame15, "Interface\\PaperDollInfoFrame\\PaperDollSidebarTabs", 64, 13, "artwork", {0, 1, 0, 0.05078125})
|
||||
left:SetPoint ("bottomright", addbutton, "bottomleft", 34, 0)
|
||||
left:SetBlendMode ("ADD")
|
||||
@@ -3136,25 +3220,39 @@ function window:CreateFrame1()
|
||||
|
||||
--> window controls
|
||||
|
||||
local buttons_width = 140
|
||||
|
||||
--lock unlock
|
||||
g:NewButton (frame1, _, "$parentLockButton", "LockButton", 160, 18, _detalhes.lock_instance_function, nil, nil, nil, Loc ["STRING_OPTIONS_WC_LOCK"])
|
||||
g:NewButton (frame1, _, "$parentLockButton", "LockButton", buttons_width, 18, _detalhes.lock_instance_function, nil, nil, nil, Loc ["STRING_OPTIONS_WC_LOCK"])
|
||||
frame1.LockButton:InstallCustomTexture()
|
||||
window:CreateLineBackground2 (frame1, "LockButton", "LockButton", Loc ["STRING_OPTIONS_WC_LOCK_DESC"], nil, true)
|
||||
window:CreateLineBackground2 (frame1, "LockButton", "LockButton", Loc ["STRING_OPTIONS_WC_LOCK_DESC"], nil, {1, 0.8, 0}, {1, 1, 1})
|
||||
|
||||
frame1.LockButton:SetIcon ([[Interface\PetBattles\PetBattle-LockIcon]], nil, nil, nil, {0.0703125, 0.9453125, 0.0546875, 0.9453125})
|
||||
frame1.LockButton:SetTextColor (1, 1, 1, 1)
|
||||
|
||||
--break snap
|
||||
g:NewButton (frame1, _, "$parentBreakSnapButton", "BreakSnapButton", 160, 18, _G.DetailsOptionsWindow.instance.Desagrupar, -1, nil, nil, Loc ["STRING_OPTIONS_WC_UNSNAP"])
|
||||
g:NewButton (frame1, _, "$parentBreakSnapButton", "BreakSnapButton", buttons_width, 18, _G.DetailsOptionsWindow.instance.Desagrupar, -1, nil, nil, Loc ["STRING_OPTIONS_WC_UNSNAP"])
|
||||
frame1.BreakSnapButton:InstallCustomTexture()
|
||||
window:CreateLineBackground2 (frame1, "BreakSnapButton", "BreakSnapButton", Loc ["STRING_OPTIONS_WC_UNSNAP_DESC"], nil, true)
|
||||
|
||||
window:CreateLineBackground2 (frame1, "BreakSnapButton", "BreakSnapButton", Loc ["STRING_OPTIONS_WC_UNSNAP_DESC"], nil, {1, 0.8, 0}, {1, 1, 1})
|
||||
|
||||
frame1.BreakSnapButton:SetIcon ([[Interface\AddOns\Details\images\icons]], nil, nil, nil, {160/512, 179/512, 142/512, 162/512})
|
||||
frame1.BreakSnapButton:SetTextColor (1, 1, 1, 1)
|
||||
|
||||
--close
|
||||
g:NewButton (frame1, _, "$parentCloseButton", "CloseButton", 160, 18, _detalhes.close_instancia_func, _G.DetailsOptionsWindow.instance, nil, nil, Loc ["STRING_OPTIONS_WC_CLOSE"])
|
||||
g:NewButton (frame1, _, "$parentCloseButton", "CloseButton", buttons_width, 18, _detalhes.close_instancia_func, _G.DetailsOptionsWindow.instance, nil, nil, Loc ["STRING_OPTIONS_WC_CLOSE"])
|
||||
frame1.CloseButton:InstallCustomTexture()
|
||||
window:CreateLineBackground2 (frame1, "CloseButton", "CloseButton", Loc ["STRING_OPTIONS_WC_CLOSE_DESC"], nil, true)
|
||||
|
||||
window:CreateLineBackground2 (frame1, "CloseButton", "CloseButton", Loc ["STRING_OPTIONS_WC_CLOSE_DESC"], nil, {1, 0.8, 0}, {1, 1, 1})
|
||||
|
||||
frame1.CloseButton:SetIcon ([[Interface\Buttons\UI-Panel-MinimizeButton-Up]], nil, nil, nil, {0.143125, 0.8653125, 0.1446875, 0.8653125})
|
||||
frame1.CloseButton:SetTextColor (1, 1, 1, 1)
|
||||
|
||||
--create
|
||||
g:NewButton (frame1, _, "$parentCreateWindowButton", "CreateWindowButton", 160, 18, function() _detalhes.CriarInstancia (nil, nil, true) end, nil, nil, nil, Loc ["STRING_OPTIONS_WC_CREATE"])
|
||||
g:NewButton (frame1, _, "$parentCreateWindowButton", "CreateWindowButton", buttons_width, 18, function() _detalhes.CriarInstancia (nil, nil, true) end, nil, nil, nil, Loc ["STRING_OPTIONS_WC_CREATE"])
|
||||
frame1.CreateWindowButton:InstallCustomTexture()
|
||||
window:CreateLineBackground2 (frame1, "CreateWindowButton", "CreateWindowButton", Loc ["STRING_OPTIONS_WC_CREATE_DESC"], nil, true)
|
||||
window:CreateLineBackground2 (frame1, "CreateWindowButton", "CreateWindowButton", Loc ["STRING_OPTIONS_WC_CREATE_DESC"], nil, {1, 0.8, 0}, {1, 1, 1})
|
||||
|
||||
frame1.CreateWindowButton:SetIcon ([[Interface\Buttons\UI-AttributeButton-Encourage-Up]])
|
||||
frame1.CreateWindowButton:SetTextColor (1, 1, 1, 1)
|
||||
|
||||
--> anchors
|
||||
|
||||
@@ -3735,6 +3833,64 @@ function window:CreateFrame3()
|
||||
|
||||
local frame3 = window.options [3][1]
|
||||
|
||||
function frame3:CreateImportBox()
|
||||
local textbox = g:NewSpecialLuaEditorEntry (frame3, 443, 80, "TextBox", "$parentTextBox", true)
|
||||
textbox:SetPoint ("bottomleft", frame3, "bottomleft", 30, 30)
|
||||
textbox:SetFrameLevel (frame3:GetFrameLevel()+6)
|
||||
textbox:SetBackdrop ({bgFile = [[Interface\AddOns\Details\images\background]], edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]],
|
||||
tile = 1, tileSize = 16, edgeSize = 16, insets = {left = 5, right = 5, top = 5, bottom = 5}})
|
||||
textbox:SetBackdropColor (0, 0, 0, 1)
|
||||
textbox:Hide()
|
||||
|
||||
frame3.TextBox.editbox:SetScript ("OnEditFocusGained", function (self) self:HighlightText() end)
|
||||
|
||||
local close_export_box = function()
|
||||
textbox:ClearFocus()
|
||||
textbox:Hide()
|
||||
end
|
||||
|
||||
--export
|
||||
local close_export = g:NewButton (textbox, nil, "$parentClose", "export_close_button", 24, 24, close_export_box, nil, nil, [[Interface\Buttons\UI-CheckBox-Check]])
|
||||
close_export:SetPoint (10, 18)
|
||||
local close_export_label = g:NewLabel (textbox, nil, nil, "export_close", Loc ["STRING_OPTIONS_CHART_CLOSE"])
|
||||
close_export_label:SetPoint ("left", close_export, "right", 2, 0)
|
||||
local copy_export_label = g:NewLabel (textbox, nil, nil, "export_copy", Loc ["STRING_OPTIONS_SAVELOAD_EXPORT_COPY"])
|
||||
copy_export_label:SetPoint ("bottomright", textbox, "topright", -6, 1)
|
||||
|
||||
--import
|
||||
local doimport = function()
|
||||
|
||||
local text = textbox:GetText()
|
||||
|
||||
local decode = _detalhes._encode:Decode (text)
|
||||
if (type (decode) ~= "string") then
|
||||
_detalhes:Msg (Loc ["STRING_CUSTOM_IMPORT_ERROR"])
|
||||
return
|
||||
end
|
||||
|
||||
local unserialize = select (2, _detalhes:Deserialize (decode))
|
||||
|
||||
if (type (unserialize) == "table") then
|
||||
_detalhes.savedStyles [#_detalhes.savedStyles+1] = unserialize
|
||||
_detalhes:Msg (Loc ["STRING_OPTIONS_SAVELOAD_IMPORT_OKEY"])
|
||||
textbox:Hide()
|
||||
else
|
||||
_detalhes:Msg (Loc ["STRING_CUSTOM_IMPORT_ERROR"])
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
local accept_import = g:NewButton (textbox, nil, "$parentAccept", "import_accept_button", 24, 24, doimport, nil, nil, [[Interface\Buttons\UI-CheckBox-Check]])
|
||||
accept_import:SetPoint (10, 18)
|
||||
local accept_import_label = g:NewLabel (textbox, nil, nil, "import_accept_label", Loc ["STRING_OPTIONS_CHART_IMPORT"])
|
||||
accept_import_label:SetPoint ("left", accept_import, "right", 2, 0)
|
||||
|
||||
local cancel_changes = g:NewButton (textbox, nil, "$parentCancel", "import_cancel_button", 20, 20, close_export_box, nil, nil, [[Interface\PetBattles\DeadPetIcon]])
|
||||
cancel_changes:SetPoint (100, 17)
|
||||
local cancel_changes_label = g:NewLabel (textbox, nil, nil, "import_cancel_label", Loc ["STRING_OPTIONS_CHART_CANCEL"])
|
||||
cancel_changes_label:SetPoint ("left", cancel_changes, "right", 2, 0)
|
||||
end
|
||||
|
||||
--> Skin
|
||||
local titulo_skin = g:NewLabel (frame3, _, "$parentTituloSkin", "tituloSkinLabel", Loc ["STRING_OPTIONS_SKIN_A"], "GameFontNormal", 16)
|
||||
local titulo_skin_desc = g:NewLabel (frame3, _, "$parentTituloSkin2", "tituloSkin2Label", Loc ["STRING_OPTIONS_SKIN_A_DESC"], "GameFontNormal", 9, "white")
|
||||
@@ -3833,7 +3989,7 @@ function window:CreateFrame3()
|
||||
}
|
||||
|
||||
for key, value in pairs (_G.DetailsOptionsWindow.instance) do
|
||||
if (_detalhes.instance_defaults [key]) then
|
||||
if (_detalhes.instance_defaults [key] ~= nil) then
|
||||
if (type (value) == "table") then
|
||||
savedObject [key] = table_deepcopy (value)
|
||||
else
|
||||
@@ -4004,6 +4160,85 @@ function window:CreateFrame3()
|
||||
|
||||
window:CreateLineBackground2 (frame3, "customSkinSelectToRemoveDropdown", "removeCustomSkinLabel", Loc ["STRING_OPTIONS_SAVELOAD_ERASE_DESC"])
|
||||
|
||||
--> Export Custom Skin
|
||||
g:NewLabel (frame3, _, "$parentExportCustomSkinLabel", "ExportCustomSkinLabel", Loc ["STRING_OPTIONS_SAVELOAD_EXPORT"], "GameFontHighlightLeft")
|
||||
--
|
||||
local onSelectCustomSkinToExport = function (_, _, index)
|
||||
if (not frame3.TextBox) then
|
||||
frame3:CreateImportBox()
|
||||
end
|
||||
|
||||
frame3.TextBox.import_accept_button:Hide()
|
||||
frame3.TextBox.import_accept_label:Hide()
|
||||
frame3.TextBox.import_cancel_button:Hide()
|
||||
frame3.TextBox.import_cancel_label:Hide()
|
||||
|
||||
frame3.TextBox.export_close_button:Show()
|
||||
frame3.TextBox.export_close:Show()
|
||||
frame3.TextBox.export_copy:Show()
|
||||
|
||||
frame3.TextBox:Show()
|
||||
|
||||
local serialized = _detalhes:Serialize (_detalhes.savedStyles [index])
|
||||
local encoded = _detalhes._encode:Encode (serialized)
|
||||
|
||||
frame3.TextBox:SetText (encoded)
|
||||
frame3.TextBox.editbox:HighlightText()
|
||||
frame3.TextBox.editbox:SetFocus (true)
|
||||
|
||||
_G.DetailsOptionsWindow3CustomSkinExportDropdown.MyObject:Select (false)
|
||||
end
|
||||
|
||||
local loadtable2 = {}
|
||||
local buildCustomSkinToExportMenu = function()
|
||||
table.wipe (loadtable2)
|
||||
for index, _table in ipairs (_detalhes.savedStyles) do
|
||||
tinsert (loadtable2, {value = index, label = _table.name, onclick = onSelectCustomSkinToExport, icon = [[Interface\Buttons\UI-GuildButton-MOTD-Up]], color = {1, 1, 1}, iconcolor = {1, .9, .9, 0.8}, texcoord = {1, 0, 0, 1}})
|
||||
end
|
||||
return loadtable2
|
||||
end
|
||||
|
||||
local d = g:NewDropDown (frame3, _, "$parentCustomSkinExportDropdown", "CustomSkinSelectToExportDropdown", 160, 20, buildCustomSkinToExportMenu, 0)
|
||||
d:SetEmptyTextAndIcon (Loc ["STRING_OPTIONS_SKIN_SELECT"])
|
||||
d.onenter_backdrop = dropdown_backdrop_onenter
|
||||
d.onleave_backdrop = dropdown_backdrop_onleave
|
||||
d:SetBackdrop (dropdown_backdrop)
|
||||
d:SetBackdropColor (unpack (dropdown_backdrop_onleave))
|
||||
|
||||
frame3.CustomSkinSelectToExportDropdown:SetPoint ("left", frame3.ExportCustomSkinLabel, "right", 2, 0)
|
||||
|
||||
window:CreateLineBackground2 (frame3, "CustomSkinSelectToExportDropdown", "ExportCustomSkinLabel", Loc ["STRING_OPTIONS_SAVELOAD_EXPORT_DESC"])
|
||||
|
||||
--> Import Button
|
||||
|
||||
local import_saved = function()
|
||||
if (not frame3.TextBox) then
|
||||
frame3:CreateImportBox()
|
||||
end
|
||||
|
||||
frame3.TextBox.import_accept_button:Show()
|
||||
frame3.TextBox.import_accept_label:Show()
|
||||
frame3.TextBox.import_cancel_button:Show()
|
||||
frame3.TextBox.import_cancel_label:Show()
|
||||
|
||||
frame3.TextBox.export_close_button:Hide()
|
||||
frame3.TextBox.export_close:Hide()
|
||||
frame3.TextBox.export_copy:Hide()
|
||||
|
||||
frame3.TextBox:SetText ("")
|
||||
frame3.TextBox:Show()
|
||||
frame3.TextBox:SetFocus (true)
|
||||
|
||||
end
|
||||
|
||||
g:NewButton (frame3, _, "$parentImportButton", "ImportButton", 160, 18, import_saved, nil, nil, nil, Loc ["STRING_OPTIONS_SAVELOAD_IMPORT"])
|
||||
frame3.ImportButton:InstallCustomTexture()
|
||||
|
||||
g:NewLabel (frame3, _, "$parentImportLabel", "ImportLabel", "", "GameFontHighlightLeft")
|
||||
frame3.ImportLabel:SetPoint ("left", frame3.ImportButton, "left")
|
||||
|
||||
window:CreateLineBackground2 (frame3, "ImportButton", "ImportLabel", Loc ["STRING_OPTIONS_SAVELOAD_IMPORT_DESC"])
|
||||
|
||||
--> extra Options
|
||||
g:NewLabel (frame3, _, "$parentSkinExtraOptionsAnchor", "SkinExtraOptionsAnchor", Loc ["STRING_OPTIONS_SKIN_EXTRA_OPTIONS_ANCHOR"], "GameFontNormal")
|
||||
frame3.SkinExtraOptionsAnchor:Hide()
|
||||
@@ -4030,9 +4265,10 @@ function window:CreateFrame3()
|
||||
{"saveSkinLabel", 4},
|
||||
{"loadCustomSkinLabel", 5},
|
||||
{"removeCustomSkinLabel", 6},
|
||||
{"makeDefault", 7, true},
|
||||
{"applyToAll", 8},
|
||||
--{"", 9},
|
||||
{"makeDefault", 10},
|
||||
{"applyToAll", 11},
|
||||
{"ExportCustomSkinLabel", 7},
|
||||
{"ImportButton", 9, true},
|
||||
--{"", 10},
|
||||
}
|
||||
|
||||
|
||||
+66
-47
@@ -312,20 +312,18 @@ local function OnLeaveMainWindow (instancia, self)
|
||||
--> resizes and lock button
|
||||
instancia.baseframe.resize_direita:SetAlpha (0)
|
||||
instancia.baseframe.resize_esquerda:SetAlpha (0)
|
||||
gump:Fade (instancia.baseframe.lock_button, 1)
|
||||
instancia.baseframe.lock_button:SetAlpha (0)
|
||||
instancia.break_snap_button:SetAlpha (0)
|
||||
|
||||
--> stretch button
|
||||
--gump:Fade (instancia.baseframe.button_stretch, -1)
|
||||
gump:Fade (instancia.baseframe.button_stretch, "ALPHA", 0)
|
||||
|
||||
--> snaps
|
||||
instancia.botao_separar:Hide()
|
||||
|
||||
elseif (instancia.modo ~= _detalhes._detalhes_props["MODO_ALONE"] and instancia.baseframe.isLocked) then
|
||||
gump:Fade (instancia.baseframe.lock_button, 1)
|
||||
instancia.baseframe.lock_button:SetAlpha (0)
|
||||
gump:Fade (instancia.baseframe.button_stretch, "ALPHA", 0)
|
||||
instancia.botao_separar:Hide()
|
||||
|
||||
instancia.break_snap_button:SetAlpha (0)
|
||||
|
||||
end
|
||||
end
|
||||
_detalhes.OnLeaveMainWindow = OnLeaveMainWindow
|
||||
@@ -345,8 +343,7 @@ local function OnEnterMainWindow (instancia, self)
|
||||
--> resizes and lock button
|
||||
instancia.baseframe.resize_direita:SetAlpha (1)
|
||||
instancia.baseframe.resize_esquerda:SetAlpha (1)
|
||||
|
||||
gump:Fade (instancia.baseframe.lock_button, 0)
|
||||
instancia.baseframe.lock_button:SetAlpha (1)
|
||||
|
||||
--> stretch button
|
||||
gump:Fade (instancia.baseframe.button_stretch, "ALPHA", 0.6)
|
||||
@@ -354,19 +351,19 @@ local function OnEnterMainWindow (instancia, self)
|
||||
--> snaps
|
||||
for _, instancia_id in _pairs (instancia.snap) do
|
||||
if (instancia_id) then
|
||||
instancia.botao_separar:Show()
|
||||
instancia.break_snap_button:SetAlpha (1)
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
elseif (instancia.modo ~= _detalhes._detalhes_props["MODO_ALONE"] and instancia.baseframe.isLocked) then
|
||||
gump:Fade (instancia.baseframe.lock_button, 0)
|
||||
instancia.baseframe.lock_button:SetAlpha (1)
|
||||
gump:Fade (instancia.baseframe.button_stretch, "ALPHA", 0.6)
|
||||
|
||||
--> snaps
|
||||
for _, instancia_id in _pairs (instancia.snap) do
|
||||
if (instancia_id) then
|
||||
instancia.botao_separar:Show()
|
||||
instancia.break_snap_button:SetAlpha (1)
|
||||
break
|
||||
end
|
||||
end
|
||||
@@ -1240,6 +1237,7 @@ local lockFunctionOnEnter = function (self)
|
||||
GameCooltip:Reset()
|
||||
GameCooltip:SetType ("tooltip")
|
||||
GameCooltip:AddFromTable (lockButtonTooltip)
|
||||
GameCooltip:SetOption ("NoLastSelectedBar", true)
|
||||
GameCooltip:SetWallpaper (1, [[Interface\SPELLBOOK\Spellbook-Page-1]], {.6, 0.1, 0, 0.64453125}, {1, 1, 1, 0.1}, true)
|
||||
GameCooltip:SetOwner (self)
|
||||
GameCooltip:ShowCooltip()
|
||||
@@ -1247,16 +1245,20 @@ local lockFunctionOnEnter = function (self)
|
||||
end
|
||||
|
||||
local lockFunctionOnLeave = function (self)
|
||||
|
||||
if (self.mostrando) then
|
||||
|
||||
self.going_hide = true
|
||||
OnLeaveMainWindow (self.instancia, self)
|
||||
self.label:SetTextColor (.3, .3, .3, .6)
|
||||
self.mostrando = false
|
||||
_G.GameCooltip:ShowMe (false)
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
local lockFunctionOnHide = function (self)
|
||||
if (self.going_hide) then
|
||||
GameCooltip:ShowMe (false)
|
||||
self.going_hide = nil
|
||||
end
|
||||
end
|
||||
|
||||
function _detalhes:DelayOptionsRefresh (instance, no_reopen)
|
||||
@@ -1294,10 +1296,25 @@ _detalhes.lock_instance_function = lockFunctionOnClick
|
||||
|
||||
local unSnapButtonTooltip = {
|
||||
{text = Loc ["STRING_DETACH_DESC"]},
|
||||
{icon = [[Interface\CURSOR\CURSORICONSNEW]], width = 14, height = 14, l = 4/128, r = 24/128, t = 34/256, b = 60/256, color = "orange"},
|
||||
{icon = [[Interface\AddOns\Details\images\icons]], width = 14, height = 14, l = 160/512, r = 179/512, t = 142/512, b = 162/512},
|
||||
}
|
||||
|
||||
local unSnapButtonOnEnter = function (self)
|
||||
|
||||
local have_snap = false
|
||||
for _, instancia_id in _pairs (self.instancia.snap) do
|
||||
if (instancia_id) then
|
||||
have_snap = true
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if (not have_snap) then
|
||||
OnEnterMainWindow (self.instancia, self)
|
||||
self.mostrando = true
|
||||
return
|
||||
end
|
||||
|
||||
OnEnterMainWindow (self.instancia, self)
|
||||
self.mostrando = true
|
||||
|
||||
@@ -1309,9 +1326,11 @@ local unSnapButtonOnEnter = function (self)
|
||||
end
|
||||
|
||||
local unSnapButtonOnLeave = function (self)
|
||||
OnLeaveMainWindow (self.instancia, self)
|
||||
self.mostrando = false
|
||||
GameCooltip:Hide()
|
||||
if (self.mostrando) then
|
||||
OnLeaveMainWindow (self.instancia, self)
|
||||
self.mostrando = false
|
||||
GameCooltip:Hide()
|
||||
end
|
||||
end
|
||||
|
||||
local shift_monitor = function (self)
|
||||
@@ -2504,6 +2523,7 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando)
|
||||
baseframe.lock_button:SetScript ("OnClick", lockFunctionOnClick)
|
||||
baseframe.lock_button:SetScript ("OnEnter", lockFunctionOnEnter)
|
||||
baseframe.lock_button:SetScript ("OnLeave", lockFunctionOnLeave)
|
||||
baseframe.lock_button:SetScript ("OnHide", lockFunctionOnHide)
|
||||
baseframe.lock_button:SetFrameStrata ("HIGH")
|
||||
baseframe.lock_button:SetFrameLevel (baseframe:GetFrameLevel() + 6)
|
||||
baseframe.lock_button.instancia = instancia
|
||||
@@ -2586,32 +2606,31 @@ function gump:CriaJanelaPrincipal (ID, instancia, criando)
|
||||
|
||||
-- break snap button ----------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
instancia.botao_separar = CreateFrame ("button", "DetailsBreakSnapButton" .. ID, baseframe.cabecalho.fechar)
|
||||
instancia.botao_separar:SetPoint ("bottom", baseframe.resize_direita, "top", -1, 0)
|
||||
instancia.botao_separar:SetFrameLevel (baseframe:GetFrameLevel() + 5)
|
||||
instancia.botao_separar:SetSize (13, 13)
|
||||
instancia.break_snap_button = CreateFrame ("button", "DetailsBreakSnapButton" .. ID, baseframe.cabecalho.fechar)
|
||||
instancia.break_snap_button:SetPoint ("bottom", baseframe.resize_direita, "top", -1, 0)
|
||||
instancia.break_snap_button:SetFrameLevel (baseframe:GetFrameLevel() + 5)
|
||||
instancia.break_snap_button:SetSize (13, 13)
|
||||
instancia.break_snap_button:SetAlpha (0)
|
||||
|
||||
instancia.botao_separar.instancia = instancia
|
||||
instancia.break_snap_button.instancia = instancia
|
||||
|
||||
instancia.botao_separar:SetScript ("OnClick", function()
|
||||
instancia.break_snap_button:SetScript ("OnClick", function()
|
||||
instancia:Desagrupar (-1)
|
||||
end)
|
||||
|
||||
instancia.botao_separar:SetScript ("OnEnter", unSnapButtonOnEnter)
|
||||
instancia.botao_separar:SetScript ("OnLeave", unSnapButtonOnLeave)
|
||||
instancia.break_snap_button:SetScript ("OnEnter", unSnapButtonOnEnter)
|
||||
instancia.break_snap_button:SetScript ("OnLeave", unSnapButtonOnLeave)
|
||||
|
||||
|
||||
instancia.botao_separar:SetNormalTexture (DEFAULT_SKIN)
|
||||
instancia.botao_separar:SetDisabledTexture (DEFAULT_SKIN)
|
||||
instancia.botao_separar:SetHighlightTexture (DEFAULT_SKIN, "ADD")
|
||||
instancia.botao_separar:SetPushedTexture (DEFAULT_SKIN)
|
||||
instancia.break_snap_button:SetNormalTexture (DEFAULT_SKIN)
|
||||
instancia.break_snap_button:SetDisabledTexture (DEFAULT_SKIN)
|
||||
instancia.break_snap_button:SetHighlightTexture (DEFAULT_SKIN, "ADD")
|
||||
instancia.break_snap_button:SetPushedTexture (DEFAULT_SKIN)
|
||||
|
||||
instancia.botao_separar:GetNormalTexture():SetTexCoord (unpack (COORDS_UNLOCK_BUTTON))
|
||||
instancia.botao_separar:GetDisabledTexture():SetTexCoord (unpack (COORDS_UNLOCK_BUTTON))
|
||||
instancia.botao_separar:GetHighlightTexture():SetTexCoord (unpack (COORDS_UNLOCK_BUTTON))
|
||||
instancia.botao_separar:GetPushedTexture():SetTexCoord (unpack (COORDS_UNLOCK_BUTTON))
|
||||
|
||||
instancia.botao_separar:Hide()
|
||||
instancia.break_snap_button:GetNormalTexture():SetTexCoord (unpack (COORDS_UNLOCK_BUTTON))
|
||||
instancia.break_snap_button:GetDisabledTexture():SetTexCoord (unpack (COORDS_UNLOCK_BUTTON))
|
||||
instancia.break_snap_button:GetHighlightTexture():SetTexCoord (unpack (COORDS_UNLOCK_BUTTON))
|
||||
instancia.break_snap_button:GetPushedTexture():SetTexCoord (unpack (COORDS_UNLOCK_BUTTON))
|
||||
|
||||
-- scripts ------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -4569,10 +4588,10 @@ function _detalhes:ChangeSkin (skin_name)
|
||||
self.baseframe.resize_direita.texture:SetTexture (skin_file) --> botão de redimencionar da direita
|
||||
self.baseframe.resize_esquerda.texture:SetTexture (skin_file) --> botão de redimencionar da esquerda
|
||||
|
||||
self.botao_separar:SetNormalTexture (skin_file) --> cadeado
|
||||
self.botao_separar:SetDisabledTexture (skin_file)
|
||||
self.botao_separar:SetHighlightTexture (skin_file, "ADD")
|
||||
self.botao_separar:SetPushedTexture (skin_file)
|
||||
self.break_snap_button:SetNormalTexture (skin_file) --> cadeado
|
||||
self.break_snap_button:SetDisabledTexture (skin_file)
|
||||
self.break_snap_button:SetHighlightTexture (skin_file, "ADD")
|
||||
self.break_snap_button:SetPushedTexture (skin_file)
|
||||
|
||||
----------> icon anchor and size
|
||||
|
||||
@@ -4788,31 +4807,31 @@ function _detalhes:SetFrameStrata (strata)
|
||||
self.baseframe:SetFrameStrata (strata)
|
||||
|
||||
if (strata == "BACKGROUND") then
|
||||
self.botao_separar:SetFrameStrata ("LOW")
|
||||
self.break_snap_button:SetFrameStrata ("LOW")
|
||||
self.baseframe.resize_esquerda:SetFrameStrata ("LOW")
|
||||
self.baseframe.resize_direita:SetFrameStrata ("LOW")
|
||||
self.baseframe.lock_button:SetFrameStrata ("LOW")
|
||||
|
||||
elseif (strata == "LOW") then
|
||||
self.botao_separar:SetFrameStrata ("MEDIUM")
|
||||
self.break_snap_button:SetFrameStrata ("MEDIUM")
|
||||
self.baseframe.resize_esquerda:SetFrameStrata ("MEDIUM")
|
||||
self.baseframe.resize_direita:SetFrameStrata ("MEDIUM")
|
||||
self.baseframe.lock_button:SetFrameStrata ("MEDIUM")
|
||||
|
||||
elseif (strata == "MEDIUM") then
|
||||
self.botao_separar:SetFrameStrata ("HIGH")
|
||||
self.break_snap_button:SetFrameStrata ("HIGH")
|
||||
self.baseframe.resize_esquerda:SetFrameStrata ("HIGH")
|
||||
self.baseframe.resize_direita:SetFrameStrata ("HIGH")
|
||||
self.baseframe.lock_button:SetFrameStrata ("HIGH")
|
||||
|
||||
elseif (strata == "HIGH") then
|
||||
self.botao_separar:SetFrameStrata ("DIALOG")
|
||||
self.break_snap_button:SetFrameStrata ("DIALOG")
|
||||
self.baseframe.resize_esquerda:SetFrameStrata ("DIALOG")
|
||||
self.baseframe.resize_direita:SetFrameStrata ("DIALOG")
|
||||
self.baseframe.lock_button:SetFrameStrata ("DIALOG")
|
||||
|
||||
elseif (strata == "DIALOG") then
|
||||
self.botao_separar:SetFrameStrata ("FULLSCREEN")
|
||||
self.break_snap_button:SetFrameStrata ("FULLSCREEN")
|
||||
self.baseframe.resize_esquerda:SetFrameStrata ("FULLSCREEN")
|
||||
self.baseframe.resize_direita:SetFrameStrata ("FULLSCREEN")
|
||||
self.baseframe.lock_button:SetFrameStrata ("FULLSCREEN")
|
||||
|
||||
@@ -179,7 +179,7 @@ function _detalhes:OpenWelcomeWindow ()
|
||||
--save standard
|
||||
local savedObject = {}
|
||||
for key, value in pairs (instance) do
|
||||
if (_detalhes.instance_defaults [key]) then
|
||||
if (_detalhes.instance_defaults [key] ~= nil) then
|
||||
if (type (value) == "table") then
|
||||
savedObject [key] = table_deepcopy (value)
|
||||
else
|
||||
|
||||
Binary file not shown.
Binary file not shown.
+133
-53
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -9,7 +9,9 @@ local Loc = LibStub ("AceLocale-3.0"):GetLocale ("Details_RaidInfo-SiegeOfOrgrim
|
||||
local _detalhes = _G._detalhes
|
||||
|
||||
local siege_of_orgrimmar = {
|
||||
|
||||
id = 1136,
|
||||
ej_id = 369,
|
||||
|
||||
name = Loc ["STRING_RAID_NAME"],
|
||||
|
||||
@@ -17,6 +19,8 @@ local siege_of_orgrimmar = {
|
||||
|
||||
icon = "Interface\\AddOns\\Details_RaidInfo-SiegeOfOrgrimmar\\images\\icon256x128",
|
||||
|
||||
is_raid = true,
|
||||
|
||||
background = "Interface\\AddOns\\Details_RaidInfo-SiegeOfOrgrimmar\\images\\wallpaper",
|
||||
backgroundEJ = [[Interface\EncounterJournal\UI-EJ-LOREBG-SiegeofOrgrimmar]],
|
||||
|
||||
@@ -54,6 +58,31 @@ local siege_of_orgrimmar = {
|
||||
end,
|
||||
|
||||
encounter_ids = {
|
||||
--> Ids by Index
|
||||
852, 849, 866, 867, 881, 864, 856, 850, 846, 870, 851, 865, 853, 869,
|
||||
-- Vale of Eternal Sorrows
|
||||
[852] = 1, -- Immerseus
|
||||
[849] = 2, -- Fallen Protectors
|
||||
[866] = 3, -- Norushen
|
||||
[867] = 4, -- Sha of Pride
|
||||
-- Gates of Retribution
|
||||
[881] = 5, -- Galakras
|
||||
[864] = 6, -- Iron Juggernaut
|
||||
[856] = 7, -- Kor'kron Dark Shaman
|
||||
[850] = 8, -- General Nazgrim
|
||||
|
||||
-- The Underhold
|
||||
[846] = 9, -- Malkorok
|
||||
[870] = 10, -- Spoils of Pandaria
|
||||
[851] = 11, -- Thok the Bloodthirsty
|
||||
|
||||
-- Downfall
|
||||
[865] = 12, -- Siegecrafter Blackfuse
|
||||
[853] = 13, -- Paragons of Klaxy
|
||||
[869] = 14, -- Garrosh Hellscream
|
||||
},
|
||||
|
||||
encounter_ids2 = {
|
||||
-- Vale of Eternal Sorrows
|
||||
[1602] = 1, -- Immerseus
|
||||
[1598] = 2, -- Fallen Protectors
|
||||
|
||||
@@ -9,7 +9,9 @@ local Loc = LibStub ("AceLocale-3.0"):GetLocale ("Details_RaidInfo-ThroneOfThund
|
||||
local _detalhes = _G._detalhes
|
||||
|
||||
local throne_of_thunder = {
|
||||
|
||||
id = 1098,
|
||||
ej_id = 362,
|
||||
|
||||
name = Loc ["STRING_RAID_NAME"],
|
||||
|
||||
@@ -17,6 +19,8 @@ local throne_of_thunder = {
|
||||
|
||||
icon = "Interface\\AddOns\\Details_RaidInfo-ThroneOfThunder\\images\\icon256x128",
|
||||
|
||||
is_raid = true,
|
||||
|
||||
background = "Interface\\AddOns\\Details_RaidInfo-ThroneOfThunder\\images\\raid_tot",
|
||||
backgroundEJ = [[Interface\EncounterJournal\UI-EJ-LOREBG-ThunderKingRaid]],
|
||||
|
||||
@@ -36,6 +40,24 @@ local throne_of_thunder = {
|
||||
"Ra-den"
|
||||
},
|
||||
|
||||
encounter_ids = {
|
||||
--> Ids by Index
|
||||
827, 819, 816, 825, 821, 828, 818, 820, 824, 817, 829, 832,
|
||||
[827] = 1, -- Jin'rokh the Breaker
|
||||
[819] = 2, -- Horridon
|
||||
[816] = 3, -- Frost King Malakk
|
||||
[825] = 4, -- Tortos
|
||||
[821] = 5, -- Magaera
|
||||
[828] = 6, -- Ji-Kun
|
||||
[818] = 7, -- Durumu the Forgotten
|
||||
[820] = 8, -- Primordius
|
||||
[824] = 9, -- Dark Animus
|
||||
[817] = 10, -- Iron Qon
|
||||
[829] = 11, -- Lu'lin
|
||||
[832] = 12, -- Lei Shen
|
||||
--[] = 13, -- Ra-den
|
||||
},
|
||||
|
||||
boss_ids = {
|
||||
-- Last Stand of the Zandalari
|
||||
[69465] = 1, -- Jin'rokh the Breaker
|
||||
|
||||
+36
-681
@@ -1,14 +1,10 @@
|
||||
--File Revision: 1
|
||||
--Last Modification: 27/07/2013
|
||||
-- Change Log:
|
||||
-- 27/07/2013: Finished alpha version.
|
||||
|
||||
function _G._detalhes:Start()
|
||||
|
||||
local Loc = LibStub ("AceLocale-3.0"):GetLocale ( "Details" )
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> details defaults
|
||||
--> row single click
|
||||
|
||||
--> single click row function replace
|
||||
--damage, dps, damage taken, friendly fire
|
||||
@@ -20,6 +16,15 @@ function _G._detalhes:Start()
|
||||
--cc breaks, ress, interrupts, dispells, deaths
|
||||
self.row_singleclick_overwrite [4] = {true, true, true, true, self.atributo_misc.ReportSingleDeadLine, self.atributo_misc.ReportSingleCooldownLine, self.atributo_misc.ReportSingleBuffUptimeLine, self.atributo_misc.ReportSingleDebuffUptimeLine}
|
||||
|
||||
function self:ReplaceRowSingleClickFunction (attribute, sub_attribute, func)
|
||||
assert (type (attribute) == "number" and attribute >= 1 and attribute <= 4, "ReplaceRowSingleClickFunction expects a attribute index on #1 argument.")
|
||||
assert (type (sub_attribute) == "number" and sub_attribute >= 1 and sub_attribute <= 10, "ReplaceRowSingleClickFunction expects a sub attribute index on #2 argument.")
|
||||
assert (type (func) == "function", "ReplaceRowSingleClickFunction expects a function on #3 argument.")
|
||||
|
||||
self.row_singleclick_overwrite [attribute] [sub_attribute] = func
|
||||
return true
|
||||
end
|
||||
|
||||
self.click_to_report_color = {1, 0.8, 0, 1}
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -27,16 +32,19 @@ function _G._detalhes:Start()
|
||||
|
||||
--> build frames
|
||||
|
||||
--> fast switch
|
||||
--> bookmarks
|
||||
if (self.switch.InitSwitch) then
|
||||
self.switch:InitSwitch()
|
||||
end
|
||||
|
||||
--> custom window
|
||||
self.custom = self.custom or {}
|
||||
--self:InitCustom()
|
||||
|
||||
--> actor info
|
||||
--> micro button alert
|
||||
self.MicroButtonAlert = CreateFrame ("frame", "DetailsMicroButtonAlert", UIParent, "MicroButtonAlertTemplate")
|
||||
self.MicroButtonAlert:Hide()
|
||||
|
||||
--> actor details window
|
||||
self.janela_info = self.gump:CriaJanelaInfo()
|
||||
self.gump:Fade (self.janela_info, 1)
|
||||
|
||||
@@ -45,15 +53,13 @@ function _G._detalhes:Start()
|
||||
self.CreateCopyPasteWindow = nil
|
||||
|
||||
--> start instances
|
||||
|
||||
if (self:QuantasInstancias() == 0) then
|
||||
if (self:GetNumInstancesAmount() == 0) then
|
||||
self:CriarInstancia()
|
||||
end
|
||||
self:GetLowerInstanceNumber()
|
||||
self:CheckConsolidates()
|
||||
|
||||
--> start time machine
|
||||
|
||||
self.timeMachine:Ligar()
|
||||
|
||||
--> update abbreviation shorcut
|
||||
@@ -230,93 +236,10 @@ function _G._detalhes:Start()
|
||||
|
||||
--> send feedback panel if the user got 100 or more logons with details
|
||||
if (self.tutorial.logons > 100) then -- and self.tutorial.logons < 104
|
||||
|
||||
if (not self.tutorial.feedback_window1) then
|
||||
self.tutorial.feedback_window1 = true
|
||||
|
||||
local feedback_frame = CreateFrame ("FRAME", "DetailsFeedbackWindow", UIParent, "ButtonFrameTemplate")
|
||||
tinsert (UISpecialFrames, "DetailsFeedbackWindow")
|
||||
feedback_frame:SetPoint ("center", UIParent, "center")
|
||||
feedback_frame:SetSize (512, 200)
|
||||
feedback_frame.portrait:SetTexture ([[Interface\CHARACTERFRAME\TEMPORARYPORTRAIT-FEMALE-GNOME]])
|
||||
|
||||
feedback_frame.TitleText:SetText ("Details! Need Your Help!")
|
||||
|
||||
feedback_frame.uppertext = feedback_frame:CreateFontString (nil, "artwork", "GameFontNormal")
|
||||
feedback_frame.uppertext:SetText ("Tell us about your experience using Details!, what you liked most, where we could improve, what things you want to see in the future?")
|
||||
feedback_frame.uppertext:SetPoint ("topleft", feedback_frame, "topleft", 60, -32)
|
||||
local font, _, flags = feedback_frame.uppertext:GetFont()
|
||||
feedback_frame.uppertext:SetFont (font, 10, flags)
|
||||
feedback_frame.uppertext:SetTextColor (1, 1, 1, .8)
|
||||
feedback_frame.uppertext:SetWidth (440)
|
||||
|
||||
local editbox = _detalhes.gump:NewTextEntry (feedback_frame, nil, "$parentTextEntry", "text", 387, 14)
|
||||
editbox:SetPoint (20, -106)
|
||||
editbox:SetAutoFocus (false)
|
||||
editbox:SetHook ("OnEditFocusGained", function()
|
||||
editbox.text = "http://www.mmo-champion.com/threads/1480721-New-damage-meter-%28Details!%29-need-help-with-tests-and-feedbacks"
|
||||
editbox:HighlightText()
|
||||
end)
|
||||
editbox:SetHook ("OnEditFocusLost", function()
|
||||
editbox.text = "http://www.mmo-champion.com/threads/1480721-New-damage-meter-%28Details!%29-need-help-with-tests-and-feedbacks"
|
||||
editbox:HighlightText()
|
||||
end)
|
||||
editbox:SetHook ("OnChar", function()
|
||||
editbox.text = "http://www.mmo-champion.com/threads/1480721-New-damage-meter-%28Details!%29-need-help-with-tests-and-feedbacks"
|
||||
editbox:HighlightText()
|
||||
end)
|
||||
editbox.text = "http://www.mmo-champion.com/threads/1480721-New-damage-meter-%28Details!%29-need-help-with-tests-and-feedbacks"
|
||||
|
||||
|
||||
feedback_frame.midtext = feedback_frame:CreateFontString (nil, "artwork", "GameFontNormal")
|
||||
feedback_frame.midtext:SetText ("visit the link above and let's make Details! stronger!")
|
||||
feedback_frame.midtext:SetPoint ("center", editbox.widget, "center")
|
||||
feedback_frame.midtext:SetPoint ("top", editbox.widget, "bottom", 0, -2)
|
||||
feedback_frame.midtext:SetJustifyH ("center")
|
||||
local font, _, flags = feedback_frame.midtext:GetFont()
|
||||
feedback_frame.midtext:SetFont (font, 10, flags)
|
||||
--feedback_frame.midtext:SetTextColor (1, 1, 1, 1)
|
||||
feedback_frame.midtext:SetWidth (440)
|
||||
|
||||
|
||||
feedback_frame.gnoma = feedback_frame:CreateTexture (nil, "artwork")
|
||||
feedback_frame.gnoma:SetPoint ("topright", feedback_frame, "topright", -1, -59)
|
||||
feedback_frame.gnoma:SetTexture ("Interface\\AddOns\\Details\\images\\icons2")
|
||||
feedback_frame.gnoma:SetSize (105*1.05, 107*1.05)
|
||||
feedback_frame.gnoma:SetTexCoord (0.2021484375, 0, 0.7919921875, 1)
|
||||
|
||||
feedback_frame.close = CreateFrame ("Button", "DetailsFeedbackWindowCloseButton", feedback_frame, "OptionsButtonTemplate")
|
||||
feedback_frame.close:SetPoint ("bottomleft", feedback_frame, "bottomleft", 8, 4)
|
||||
feedback_frame.close:SetText ("Close")
|
||||
feedback_frame.close:SetScript ("OnClick", function (self)
|
||||
editbox:ClearFocus()
|
||||
feedback_frame:Hide()
|
||||
end)
|
||||
|
||||
feedback_frame.postpone = CreateFrame ("Button", "DetailsFeedbackWindowPostPoneButton", feedback_frame, "OptionsButtonTemplate")
|
||||
feedback_frame.postpone:SetPoint ("bottomright", feedback_frame, "bottomright", -10, 4)
|
||||
feedback_frame.postpone:SetText ("Remind-me Later")
|
||||
feedback_frame.postpone:SetScript ("OnClick", function (self)
|
||||
editbox:ClearFocus()
|
||||
feedback_frame:Hide()
|
||||
_detalhes.tutorial.feedback_window1 = false
|
||||
end)
|
||||
feedback_frame.postpone:SetWidth (130)
|
||||
|
||||
feedback_frame:SetScript ("OnHide", function()
|
||||
editbox:ClearFocus()
|
||||
end)
|
||||
|
||||
--0.0009765625 512
|
||||
function _detalhes:FeedbackSetFocus()
|
||||
DetailsFeedbackWindow:Show()
|
||||
DetailsFeedbackWindowTextEntry.MyObject:SetFocus()
|
||||
DetailsFeedbackWindowTextEntry.MyObject:HighlightText()
|
||||
end
|
||||
_detalhes:ScheduleTimer ("FeedbackSetFocus", 5)
|
||||
|
||||
_detalhes:ShowFeedbackRequestWindow()
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--> check is this is the first run of this version
|
||||
@@ -341,136 +264,25 @@ function _G._detalhes:Start()
|
||||
|
||||
if (_detalhes_database.last_realversion and _detalhes_database.last_realversion < 18 and enable_reset_warning) then
|
||||
|
||||
--print ("Last Version:", _detalhes_database.last_version, "Last Interval Version:", _detalhes_database.last_realversion)
|
||||
|
||||
local resetwarning_frame = CreateFrame ("FRAME", "DetailsResetConfigWarningDialog", UIParent, "ButtonFrameTemplate")
|
||||
resetwarning_frame:SetFrameStrata ("LOW")
|
||||
tinsert (UISpecialFrames, "DetailsResetConfigWarningDialog")
|
||||
resetwarning_frame:SetPoint ("center", UIParent, "center")
|
||||
resetwarning_frame:SetSize (512, 200)
|
||||
resetwarning_frame.portrait:SetTexture ([[Interface\CHARACTERFRAME\TEMPORARYPORTRAIT-FEMALE-GNOME]])
|
||||
resetwarning_frame:SetScript ("OnHide", function()
|
||||
DetailsBubble:HideBubble()
|
||||
end)
|
||||
|
||||
resetwarning_frame.TitleText:SetText ("Noooooooooooo!!!")
|
||||
|
||||
resetwarning_frame.midtext = resetwarning_frame:CreateFontString (nil, "artwork", "GameFontNormal")
|
||||
resetwarning_frame.midtext:SetText ("A pack of murlocs has attacked Details! tech center, our gnomes engineers are working on fixing the damage.\n\n If something is messed in your Details!, especially the close, instance and reset buttons, you can either 'Reset Skin' or access the options panel.")
|
||||
resetwarning_frame.midtext:SetPoint ("topleft", resetwarning_frame, "topleft", 10, -90)
|
||||
resetwarning_frame.midtext:SetJustifyH ("center")
|
||||
resetwarning_frame.midtext:SetWidth (370)
|
||||
|
||||
resetwarning_frame.gnoma = resetwarning_frame:CreateTexture (nil, "artwork")
|
||||
resetwarning_frame.gnoma:SetPoint ("topright", resetwarning_frame, "topright", -3, -80)
|
||||
resetwarning_frame.gnoma:SetTexture ("Interface\\AddOns\\Details\\images\\icons2")
|
||||
resetwarning_frame.gnoma:SetSize (89*1.00, 97*1.00)
|
||||
--resetwarning_frame.gnoma:SetTexCoord (0.212890625, 0.494140625, 0.798828125, 0.99609375) -- 109 409 253 510
|
||||
resetwarning_frame.gnoma:SetTexCoord (0.17578125, 0.001953125, 0.59765625, 0.787109375) -- 1 306 90 403
|
||||
|
||||
resetwarning_frame.close = CreateFrame ("Button", "DetailsFeedbackWindowCloseButton", resetwarning_frame, "OptionsButtonTemplate")
|
||||
resetwarning_frame.close:SetPoint ("bottomleft", resetwarning_frame, "bottomleft", 8, 4)
|
||||
resetwarning_frame.close:SetText ("Close")
|
||||
resetwarning_frame.close:SetScript ("OnClick", function (self)
|
||||
resetwarning_frame:Hide()
|
||||
end)
|
||||
|
||||
resetwarning_frame.see_updates = CreateFrame ("Button", "DetailsResetWindowSeeUpdatesButton", resetwarning_frame, "OptionsButtonTemplate")
|
||||
resetwarning_frame.see_updates:SetPoint ("bottomright", resetwarning_frame, "bottomright", -10, 4)
|
||||
resetwarning_frame.see_updates:SetText ("Update Info")
|
||||
resetwarning_frame.see_updates:SetScript ("OnClick", function (self)
|
||||
_detalhes.OpenNewsWindow()
|
||||
DetailsBubble:HideBubble()
|
||||
--resetwarning_frame:Hide()
|
||||
end)
|
||||
resetwarning_frame.see_updates:SetWidth (130)
|
||||
|
||||
resetwarning_frame.reset_skin = CreateFrame ("Button", "DetailsResetWindowResetSkinButton", resetwarning_frame, "OptionsButtonTemplate")
|
||||
resetwarning_frame.reset_skin:SetPoint ("right", resetwarning_frame.see_updates, "left", -5, 0)
|
||||
resetwarning_frame.reset_skin:SetText ("Reset Skin")
|
||||
resetwarning_frame.reset_skin:SetScript ("OnClick", function (self)
|
||||
--do the reset
|
||||
for index, instance in ipairs (_detalhes.tabela_instancias) do
|
||||
if (not instance.iniciada) then
|
||||
instance:RestauraJanela()
|
||||
local skin = instance.skin
|
||||
instance:ChangeSkin ("Default Skin")
|
||||
instance:ChangeSkin ("Minimalistic")
|
||||
instance:ChangeSkin (skin)
|
||||
instance:DesativarInstancia()
|
||||
else
|
||||
local skin = instance.skin
|
||||
instance:ChangeSkin ("Default Skin")
|
||||
instance:ChangeSkin ("Minimalistic")
|
||||
instance:ChangeSkin (skin)
|
||||
end
|
||||
end
|
||||
end)
|
||||
resetwarning_frame.reset_skin:SetWidth (130)
|
||||
|
||||
resetwarning_frame.open_options = CreateFrame ("Button", "DetailsResetWindowOpenOptionsButton", resetwarning_frame, "OptionsButtonTemplate")
|
||||
resetwarning_frame.open_options:SetPoint ("right", resetwarning_frame.reset_skin, "left", -5, 0)
|
||||
resetwarning_frame.open_options:SetText ("Options Panel")
|
||||
resetwarning_frame.open_options:SetScript ("OnClick", function (self)
|
||||
local lower_instance = _detalhes:GetLowerInstanceNumber()
|
||||
if (not lower_instance) then
|
||||
local instance = _detalhes:GetInstance (1)
|
||||
_detalhes.CriarInstancia (_, _, 1)
|
||||
_detalhes:OpenOptionsWindow (instance)
|
||||
for index, instance in ipairs (_detalhes.tabela_instancias) do
|
||||
if (not instance.iniciada) then
|
||||
instance:RestauraJanela()
|
||||
local skin = instance.skin
|
||||
instance:ChangeSkin ("Default Skin")
|
||||
instance:ChangeSkin ("Minimalistic")
|
||||
instance:ChangeSkin (skin)
|
||||
instance:DesativarInstancia()
|
||||
else
|
||||
_detalhes:OpenOptionsWindow (_detalhes:GetInstance (lower_instance))
|
||||
local skin = instance.skin
|
||||
instance:ChangeSkin ("Default Skin")
|
||||
instance:ChangeSkin ("Minimalistic")
|
||||
instance:ChangeSkin (skin)
|
||||
end
|
||||
end)
|
||||
resetwarning_frame.open_options:SetWidth (130)
|
||||
|
||||
function _detalhes:ResetWarningDialog()
|
||||
DetailsResetConfigWarningDialog:Show()
|
||||
DetailsBubble:SetOwner (resetwarning_frame.gnoma, "bottomright", "topleft", 30, -37, 1)
|
||||
DetailsBubble:FlipHorizontal()
|
||||
DetailsBubble:SetBubbleText ("", "", "WWHYYYYYYYYY!!!!", "", "")
|
||||
DetailsBubble:TextConfig (14, nil, "deeppink")
|
||||
DetailsBubble:ShowBubble()
|
||||
|
||||
|
||||
end
|
||||
_detalhes:ScheduleTimer ("ResetWarningDialog", 7)
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--> interface menu
|
||||
local f = CreateFrame ("frame", "DetailsInterfaceOptionsPanel", UIParent)
|
||||
f.name = "Details"
|
||||
f.logo = f:CreateTexture (nil, "overlay")
|
||||
f.logo:SetPoint ("center", f, "center", 0, 0)
|
||||
f.logo:SetPoint ("top", f, "top", 25, 56)
|
||||
f.logo:SetTexture ([[Interface\AddOns\Details\images\logotipo]])
|
||||
f.logo:SetSize (256, 128)
|
||||
InterfaceOptions_AddCategory (f)
|
||||
|
||||
--> open options panel
|
||||
f.options_button = CreateFrame ("button", nil, f, "OptionsButtonTemplate")
|
||||
f.options_button:SetText (Loc ["STRING_INTERFACE_OPENOPTIONS"])
|
||||
f.options_button:SetPoint ("topleft", f, "topleft", 10, -100)
|
||||
f.options_button:SetWidth (170)
|
||||
f.options_button:SetScript ("OnClick", function (self)
|
||||
local lower_instance = _detalhes:GetLowerInstanceNumber()
|
||||
_detalhes:OpenOptionsWindow (_detalhes:GetInstance (lower_instance))
|
||||
end)
|
||||
|
||||
--> create new window
|
||||
f.new_window_button = CreateFrame ("button", nil, f, "OptionsButtonTemplate")
|
||||
f.new_window_button:SetText (Loc ["STRING_MINIMAPMENU_NEWWINDOW"])
|
||||
f.new_window_button:SetPoint ("topleft", f, "topleft", 10, -125)
|
||||
f.new_window_button:SetWidth (170)
|
||||
f.new_window_button:SetScript ("OnClick", function (self)
|
||||
_detalhes:CriarInstancia (_, true)
|
||||
end)
|
||||
|
||||
--> MicroButtonAlertTemplate
|
||||
self.MicroButtonAlert = CreateFrame ("frame", "DetailsMicroButtonAlert", UIParent, "MicroButtonAlertTemplate")
|
||||
self.MicroButtonAlert:Hide()
|
||||
|
||||
local lower = _detalhes:GetLowerInstanceNumber()
|
||||
if (lower) then
|
||||
local instance = _detalhes:GetInstance (lower)
|
||||
@@ -537,409 +349,13 @@ function _G._detalhes:Start()
|
||||
end
|
||||
|
||||
--> minimap
|
||||
local LDB = LibStub ("LibDataBroker-1.1", true)
|
||||
local LDBIcon = LDB and LibStub ("LibDBIcon-1.0", true)
|
||||
|
||||
if LDB then
|
||||
_detalhes:RegisterMinimapAndHotCorner()
|
||||
|
||||
local databroker = LDB:NewDataObject ("Details!", {
|
||||
type = "launcher",
|
||||
icon = [[Interface\AddOns\Details\images\minimap]],
|
||||
text = "0",
|
||||
|
||||
HotCornerIgnore = true,
|
||||
|
||||
OnClick = function (self, button)
|
||||
|
||||
if (button == "LeftButton") then
|
||||
|
||||
--> 1 = open options panel
|
||||
if (_detalhes.minimap.onclick_what_todo == 1) then
|
||||
local lower_instance = _detalhes:GetLowerInstanceNumber()
|
||||
if (not lower_instance) then
|
||||
local instance = _detalhes:GetInstance (1)
|
||||
_detalhes.CriarInstancia (_, _, 1)
|
||||
_detalhes:OpenOptionsWindow (instance)
|
||||
else
|
||||
_detalhes:OpenOptionsWindow (_detalhes:GetInstance (lower_instance))
|
||||
end
|
||||
|
||||
--> 2 = reset data
|
||||
elseif (_detalhes.minimap.onclick_what_todo == 2) then
|
||||
_detalhes.tabela_historico:resetar()
|
||||
|
||||
--> 3 = unknown
|
||||
elseif (_detalhes.minimap.onclick_what_todo == 3) then
|
||||
|
||||
end
|
||||
|
||||
elseif (button == "RightButton") then
|
||||
|
||||
GameTooltip:Hide()
|
||||
local GameCooltip = GameCooltip
|
||||
|
||||
GameCooltip:Reset()
|
||||
GameCooltip:SetType ("menu")
|
||||
GameCooltip:SetOption ("ButtonsYMod", -5)
|
||||
GameCooltip:SetOption ("HeighMod", 5)
|
||||
GameCooltip:SetOption ("TextSize", 10)
|
||||
|
||||
--344 427 200 268 0.0009765625
|
||||
--0.672851, 0.833007, 0.391601, 0.522460
|
||||
|
||||
GameCooltip:SetBannerImage (1, [[Interface\AddOns\Details\images\icons]], 83*.5, 68*.5, {"bottomleft", "topleft", 1, -4}, {0.672851, 0.833007, 0.391601, 0.522460}, nil)
|
||||
GameCooltip:SetBannerImage (2, "Interface\\PetBattles\\Weather-Windy", 512*.35, 128*.3, {"bottomleft", "topleft", -25, -4}, {0, 1, 1, 0})
|
||||
GameCooltip:SetBannerText (1, "Mini Map Menu", {"left", "right", 2, -5}, "white", 10)
|
||||
|
||||
--> reset
|
||||
GameCooltip:AddMenu (1, _detalhes.tabela_historico.resetar, true, nil, nil, Loc ["STRING_MINIMAPMENU_RESET"], nil, true)
|
||||
GameCooltip:AddIcon ([[Interface\COMMON\VOICECHAT-MUTED]], 1, 1, 14, 14)
|
||||
|
||||
GameCooltip:AddLine ("$div")
|
||||
|
||||
--> nova instancai
|
||||
GameCooltip:AddMenu (1, _detalhes.CriarInstancia, true, nil, nil, Loc ["STRING_MINIMAPMENU_NEWWINDOW"], nil, true)
|
||||
GameCooltip:AddIcon ([[Interface\ICONS\Spell_ChargePositive]], 1, 1, 14, 14, 0.0703125, 0.9453125, 0.0546875, 0.9453125)
|
||||
|
||||
--> reopen window 64: 0.0078125
|
||||
local reopen = function()
|
||||
for _, instance in ipairs (_detalhes.tabela_instancias) do
|
||||
if (not instance:IsAtiva()) then
|
||||
_detalhes:CriarInstancia (instance.meu_id)
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
GameCooltip:AddMenu (1, reopen, nil, nil, nil, Loc ["STRING_MINIMAPMENU_REOPEN"], nil, true)
|
||||
GameCooltip:AddIcon ([[Interface\ICONS\Ability_Priest_VoidShift]], 1, 1, 14, 14, 0.0703125, 0.9453125, 0.0546875, 0.9453125)
|
||||
|
||||
GameCooltip:AddMenu (1, _detalhes.ReabrirTodasInstancias, true, nil, nil, Loc ["STRING_MINIMAPMENU_REOPENALL"], nil, true)
|
||||
GameCooltip:AddIcon ([[Interface\ICONS\Ability_Priest_VoidShift]], 1, 1, 14, 14, 0.0703125, 0.9453125, 0.0546875, 0.9453125, "#ffb400")
|
||||
|
||||
GameCooltip:AddLine ("$div")
|
||||
|
||||
--> lock
|
||||
GameCooltip:AddMenu (1, _detalhes.TravasInstancias, true, nil, nil, Loc ["STRING_MINIMAPMENU_LOCK"], nil, true)
|
||||
GameCooltip:AddIcon ([[Interface\PetBattles\PetBattle-LockIcon]], 1, 1, 14, 14, 0.0703125, 0.9453125, 0.0546875, 0.9453125)
|
||||
|
||||
GameCooltip:AddMenu (1, _detalhes.DestravarInstancias, true, nil, nil, Loc ["STRING_MINIMAPMENU_UNLOCK"], nil, true)
|
||||
GameCooltip:AddIcon ([[Interface\PetBattles\PetBattle-LockIcon]], 1, 1, 14, 14, 0.0703125, 0.9453125, 0.0546875, 0.9453125, "gray")
|
||||
|
||||
GameCooltip:SetOwner (self, "topright", "bottomleft")
|
||||
GameCooltip:ShowCooltip()
|
||||
|
||||
|
||||
end
|
||||
end,
|
||||
OnTooltipShow = function (tooltip)
|
||||
tooltip:AddLine ("Details!", 1, 1, 1)
|
||||
if (_detalhes.minimap.onclick_what_todo == 1) then
|
||||
tooltip:AddLine (Loc ["STRING_MINIMAP_TOOLTIP1"])
|
||||
elseif (_detalhes.minimap.onclick_what_todo == 2) then
|
||||
tooltip:AddLine (Loc ["STRING_MINIMAP_TOOLTIP11"])
|
||||
end
|
||||
tooltip:AddLine (Loc ["STRING_MINIMAP_TOOLTIP2"])
|
||||
end,
|
||||
})
|
||||
|
||||
if (databroker and not LDBIcon:IsRegistered ("Details!")) then
|
||||
LDBIcon:Register ("Details!", databroker, self.minimap)
|
||||
end
|
||||
|
||||
_detalhes.databroker = databroker
|
||||
|
||||
end
|
||||
|
||||
--register lib-hotcorners
|
||||
local on_click_on_hotcorner_button = function (frame, button)
|
||||
if (_detalhes.hotcorner_topleft.onclick_what_todo == 1) then
|
||||
local lower_instance = _detalhes:GetLowerInstanceNumber()
|
||||
if (not lower_instance) then
|
||||
local instance = _detalhes:GetInstance (1)
|
||||
_detalhes.CriarInstancia (_, _, 1)
|
||||
_detalhes:OpenOptionsWindow (instance)
|
||||
else
|
||||
_detalhes:OpenOptionsWindow (_detalhes:GetInstance (lower_instance))
|
||||
end
|
||||
|
||||
elseif (_detalhes.hotcorner_topleft.onclick_what_todo == 2) then
|
||||
_detalhes.tabela_historico:resetar()
|
||||
end
|
||||
end
|
||||
|
||||
local on_click_on_quickclick_button = function (frame, button)
|
||||
if (_detalhes.hotcorner_topleft.quickclick_what_todo == 1) then
|
||||
local lower_instance = _detalhes:GetLowerInstanceNumber()
|
||||
if (not lower_instance) then
|
||||
local instance = _detalhes:GetInstance (1)
|
||||
_detalhes.CriarInstancia (_, _, 1)
|
||||
_detalhes:OpenOptionsWindow (instance)
|
||||
else
|
||||
_detalhes:OpenOptionsWindow (_detalhes:GetInstance (lower_instance))
|
||||
end
|
||||
|
||||
elseif (_detalhes.hotcorner_topleft.quickclick_what_todo == 2) then
|
||||
_detalhes.tabela_historico:resetar()
|
||||
end
|
||||
end
|
||||
|
||||
local tooltip_hotcorner = function()
|
||||
GameTooltip:AddLine ("Details!", 1, 1, 1, 1)
|
||||
if (_detalhes.hotcorner_topleft.onclick_what_todo == 1) then
|
||||
GameTooltip:AddLine ("|cFF00FF00Left Click:|r open options panel.", 1, 1, 1, 1)
|
||||
|
||||
elseif (_detalhes.hotcorner_topleft.onclick_what_todo == 2) then
|
||||
GameTooltip:AddLine ("|cFF00FF00Left Click:|r clear all segments.", 1, 1, 1, 1)
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
_detalhes:RegisterHotCornerButton (
|
||||
--> absolute name
|
||||
"Details!",
|
||||
--> corner
|
||||
"TOPLEFT",
|
||||
--> config table
|
||||
self.hotcorner_topleft,
|
||||
--> frame _G name
|
||||
"DetailsLeftCornerButton",
|
||||
--> icon
|
||||
[[Interface\AddOns\Details\images\minimap]],
|
||||
--> tooltip
|
||||
tooltip_hotcorner,
|
||||
--> click function
|
||||
on_click_on_hotcorner_button,
|
||||
--> menus
|
||||
nil,
|
||||
--> quick click
|
||||
on_click_on_quickclick_button)
|
||||
|
||||
--> register time captures
|
||||
--_detalhes:LoadUserTimeCaptures()
|
||||
|
||||
--[[
|
||||
local f = CreateFrame ("frame", nil, UIParent)
|
||||
f:SetSize (200, 200)
|
||||
f:SetPoint ("center", UIParent, "center")
|
||||
local t = f:CreateTexture (nil, "overlay")
|
||||
t:SetPoint ("center", f, "center")
|
||||
t:SetTexture (1, 1, 1, 1)
|
||||
t:SetSize (100, 100)
|
||||
|
||||
f:SetAlpha (.1)
|
||||
t:SetAlpha (1)
|
||||
t:SetVertexColor (1, 1, 1, 1)
|
||||
|
||||
local b = CreateFrame ("button", "teste", f, "OptionsButtonTemplate")
|
||||
b:SetSize (75, 30)
|
||||
b:SetPoint ("left", f, "left")
|
||||
b:SetAlpha (1)
|
||||
--]]
|
||||
|
||||
local panel = self.gump:NewPanel (UIParent, nil, "DetailsWindowOptionsBarTextEditor", nil, 650, 200)
|
||||
panel:SetPoint ("center", UIParent, "center")
|
||||
panel:Hide()
|
||||
panel:SetFrameStrata ("FULLSCREEN")
|
||||
panel:SetBackdrop ({ bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 64, edgeFile="Interface\\Tooltips\\UI-Tooltip-Border", edgeSize=16, insets = {left=3, right=3, top=3, bottom=3}})
|
||||
panel:DisableGradient()
|
||||
panel:SetBackdropColor (0, 0, 0, 1)
|
||||
|
||||
function panel.widget:Open (text, callback, host)
|
||||
if (host) then
|
||||
panel:SetPoint ("center", host, "center")
|
||||
end
|
||||
|
||||
text = text:gsub ("||", "|")
|
||||
panel.default_text = text
|
||||
panel.widget.editbox:SetText (text)
|
||||
panel.callback = callback
|
||||
panel:Show()
|
||||
end
|
||||
|
||||
local textentry = self.gump:NewSpecialLuaEditorEntry (panel.widget, 450, 180, "editbox", "$parentEntry", true)
|
||||
textentry:SetPoint ("topleft", panel.widget, "topleft", 10, -10)
|
||||
|
||||
local arg1_button = self.gump:NewButton (panel, nil, "$parentButton1", nil, 80, 20, function() textentry.editbox:Insert ("{data1}") end, nil, nil, nil, "{data1}")
|
||||
local arg2_button = self.gump:NewButton (panel, nil, "$parentButton2", nil, 80, 20, function() textentry.editbox:Insert ("{data2}") end, nil, nil, nil, "{data2}")
|
||||
local arg3_button = self.gump:NewButton (panel, nil, "$parentButton3", nil, 80, 20, function() textentry.editbox:Insert ("{data3}") end, nil, nil, nil, "{data3}")
|
||||
arg1_button:SetPoint ("topright", panel, "topright", -10, -14)
|
||||
arg2_button:SetPoint ("topright", panel, "topright", -10, -36)
|
||||
arg3_button:SetPoint ("topright", panel, "topright", -10, -58)
|
||||
arg1_button:InstallCustomTexture()
|
||||
arg2_button:InstallCustomTexture()
|
||||
arg3_button:InstallCustomTexture()
|
||||
|
||||
-- code author Saiket from http://www.wowinterface.com/forums/showpost.php?p=245759&postcount=6
|
||||
--- @return StartPos, EndPos of highlight in this editbox.
|
||||
local function GetTextHighlight ( self )
|
||||
local Text, Cursor = self:GetText(), self:GetCursorPosition();
|
||||
self:Insert( "" ); -- Delete selected text
|
||||
local TextNew, CursorNew = self:GetText(), self:GetCursorPosition();
|
||||
-- Restore previous text
|
||||
self:SetText( Text );
|
||||
self:SetCursorPosition( Cursor );
|
||||
local Start, End = CursorNew, #Text - ( #TextNew - CursorNew );
|
||||
self:HighlightText( Start, End );
|
||||
return Start, End;
|
||||
end
|
||||
|
||||
local StripColors;
|
||||
do
|
||||
local CursorPosition, CursorDelta;
|
||||
--- Callback for gsub to remove unescaped codes.
|
||||
local function StripCodeGsub ( Escapes, Code, End )
|
||||
if ( #Escapes % 2 == 0 ) then -- Doesn't escape Code
|
||||
if ( CursorPosition and CursorPosition >= End - 1 ) then
|
||||
CursorDelta = CursorDelta - #Code;
|
||||
end
|
||||
return Escapes;
|
||||
end
|
||||
end
|
||||
--- Removes a single escape sequence.
|
||||
local function StripCode ( Pattern, Text, OldCursor )
|
||||
CursorPosition, CursorDelta = OldCursor, 0;
|
||||
return Text:gsub( Pattern, StripCodeGsub ), OldCursor and CursorPosition + CursorDelta;
|
||||
end
|
||||
--- Strips Text of all color escape sequences.
|
||||
-- @param Cursor Optional cursor position to keep track of.
|
||||
-- @return Stripped text, and the updated cursor position if Cursor was given.
|
||||
function StripColors ( Text, Cursor )
|
||||
Text, Cursor = StripCode( "(|*)(|c%x%x%x%x%x%x%x%x)()", Text, Cursor );
|
||||
return StripCode( "(|*)(|r)()", Text, Cursor );
|
||||
end
|
||||
end
|
||||
|
||||
local COLOR_END = "|r";
|
||||
--- Wraps this editbox's selected text with the given color.
|
||||
local function ColorSelection ( self, ColorCode )
|
||||
local Start, End = GetTextHighlight( self );
|
||||
local Text, Cursor = self:GetText(), self:GetCursorPosition();
|
||||
if ( Start == End ) then -- Nothing selected
|
||||
--Start, End = Cursor, Cursor; -- Wrap around cursor
|
||||
return; -- Wrapping the cursor in a color code and hitting backspace crashes the client!
|
||||
end
|
||||
-- Find active color code at the end of the selection
|
||||
local ActiveColor;
|
||||
if ( End < #Text ) then -- There is text to color after the selection
|
||||
local ActiveEnd;
|
||||
local CodeEnd, _, Escapes, Color = 0;
|
||||
while ( true ) do
|
||||
_, CodeEnd, Escapes, Color = Text:find( "(|*)(|c%x%x%x%x%x%x%x%x)", CodeEnd + 1 );
|
||||
if ( not CodeEnd or CodeEnd > End ) then
|
||||
break;
|
||||
end
|
||||
if ( #Escapes % 2 == 0 ) then -- Doesn't escape Code
|
||||
ActiveColor, ActiveEnd = Color, CodeEnd;
|
||||
end
|
||||
end
|
||||
|
||||
if ( ActiveColor ) then
|
||||
-- Check if color gets terminated before selection ends
|
||||
CodeEnd = 0;
|
||||
while ( true ) do
|
||||
_, CodeEnd, Escapes = Text:find( "(|*)|r", CodeEnd + 1 );
|
||||
if ( not CodeEnd or CodeEnd > End ) then
|
||||
break;
|
||||
end
|
||||
if ( CodeEnd > ActiveEnd and #Escapes % 2 == 0 ) then -- Terminates ActiveColor
|
||||
ActiveColor = nil;
|
||||
break;
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local Selection = Text:sub( Start + 1, End );
|
||||
-- Remove color codes from the selection
|
||||
local Replacement, CursorReplacement = StripColors( Selection, Cursor - Start );
|
||||
|
||||
self:SetText( ( "" ):join(
|
||||
Text:sub( 1, Start ),
|
||||
ColorCode, Replacement, COLOR_END,
|
||||
ActiveColor or "", Text:sub( End + 1 )
|
||||
) );
|
||||
|
||||
-- Restore cursor and highlight, adjusting for wrapper text
|
||||
Cursor = Start + CursorReplacement;
|
||||
if ( CursorReplacement > 0 ) then -- Cursor beyond start of color code
|
||||
Cursor = Cursor + #ColorCode;
|
||||
end
|
||||
if ( CursorReplacement >= #Replacement ) then -- Cursor beyond end of color
|
||||
Cursor = Cursor + #COLOR_END;
|
||||
end
|
||||
|
||||
self:SetCursorPosition( Cursor );
|
||||
-- Highlight selection and wrapper
|
||||
self:HighlightText( Start, #ColorCode + ( #Replacement - #Selection ) + #COLOR_END + End );
|
||||
end
|
||||
|
||||
local color_func = function (_, r, g, b, a)
|
||||
local hex = _detalhes:hex (a*255).._detalhes:hex (r*255).._detalhes:hex (g*255).._detalhes:hex (b*255)
|
||||
ColorSelection ( textentry.editbox, "|c" .. hex)
|
||||
end
|
||||
|
||||
local func_button = self.gump:NewButton (panel, nil, "$parentButton4", nil, 80, 20, function() textentry.editbox:Insert ("{func local player = ...; return 0;}") end, nil, nil, nil, Loc ["STRING_OPTIONS_TEXTEDITOR_FUNC"])
|
||||
local color_button = self.gump:NewColorPickButton (panel, "$parentButton5", nil, color_func)
|
||||
color_button:SetSize (80, 20)
|
||||
func_button:SetPoint ("topright", panel, "topright", -10, -80)
|
||||
color_button:SetPoint ("topright", panel, "topright", -10, -102)
|
||||
func_button:InstallCustomTexture()
|
||||
|
||||
color_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_COLOR_TOOLTIP"]
|
||||
func_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_FUNC_TOOLTIP"]
|
||||
|
||||
--color_button:InstallCustomTexture()
|
||||
|
||||
local comma_button = self.gump:NewButton (panel, nil, "$parentButtonComma", nil, 80, 20, function() textentry.editbox:Insert ("_detalhes:comma_value ( )") end, nil, nil, nil, Loc ["STRING_OPTIONS_TEXTEDITOR_COMMA"])
|
||||
local tok_button = self.gump:NewButton (panel, nil, "$parentButtonTok", nil, 80, 20, function() textentry.editbox:Insert ("_detalhes:ToK2 ( )") end, nil, nil, nil, Loc ["STRING_OPTIONS_TEXTEDITOR_TOK"])
|
||||
comma_button:InstallCustomTexture()
|
||||
tok_button:InstallCustomTexture()
|
||||
comma_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_COMMA_TOOLTIP"]
|
||||
tok_button.tooltip = Loc ["STRING_OPTIONS_TEXTEDITOR_TOK_TOOLTIP"]
|
||||
|
||||
comma_button:SetPoint ("topright", panel, "topright", -100, -14)
|
||||
tok_button:SetPoint ("topright", panel, "topright", -100, -36)
|
||||
|
||||
local done = function()
|
||||
local text = panel.widget.editbox:GetText()
|
||||
text = text:gsub ("\n", "")
|
||||
|
||||
local test = text
|
||||
|
||||
local function errorhandler(err)
|
||||
return geterrorhandler()(err)
|
||||
end
|
||||
|
||||
local code = [[local str = "STR"; str = str:ReplaceData (100, 50, 75, {nome = "you", total = 10, total_without_pet = 5, damage_taken = 7, last_dps = 1, friendlyfire_total = 6, totalover = 2, totalabsorb = 4, totalover_without_pet = 6, healing_taken = 1, heal_enemy_amt = 2});]]
|
||||
code = code:gsub ("STR", test)
|
||||
|
||||
local f = loadstring (code)
|
||||
local err, two = xpcall (f, errorhandler)
|
||||
|
||||
if (not err) then
|
||||
return
|
||||
end
|
||||
|
||||
panel.callback (text)
|
||||
panel:Hide()
|
||||
end
|
||||
|
||||
local ok_button = self.gump:NewButton (panel, nil, "$parentButtonOk", nil, 80, 20, done, nil, nil, nil, "DONE")
|
||||
ok_button:InstallCustomTexture()
|
||||
ok_button:SetPoint ("topright", panel, "topright", -10, -174)
|
||||
|
||||
local reset_button = self.gump:NewButton (panel, nil, "$parentDefaultOk", nil, 80, 20, function() textentry.editbox:SetText (_detalhes.instance_defaults.row_info.textR_custom_text) end, nil, nil, nil, "Default")
|
||||
reset_button:InstallCustomTexture()
|
||||
reset_button:SetPoint ("topright", panel, "topright", -100, -152)
|
||||
|
||||
local cancel_button = self.gump:NewButton (panel, nil, "$parentDefaultCancel", nil, 80, 20, function() textentry.editbox:SetText (panel.default_text); done(); end, nil, nil, nil, "Cancel")
|
||||
cancel_button:InstallCustomTexture()
|
||||
cancel_button:SetPoint ("topright", panel, "topright", -100, -174)
|
||||
|
||||
function _detalhes:OpenOptionsWindowAtStart()
|
||||
--_detalhes:OpenOptionsWindow (_detalhes.tabela_instancias[1])
|
||||
--print (_G ["DetailsClearSegmentsButton1"]:GetSize())
|
||||
--_detalhes:OpenCustomWindow()
|
||||
--_detalhes:OpenCustomDisplayWindow()
|
||||
--_detalhes:OpenWelcomeWindow() --for debug
|
||||
end
|
||||
_detalhes:ScheduleTimer ("OpenOptionsWindowAtStart", 2)
|
||||
@@ -947,70 +363,9 @@ function _G._detalhes:Start()
|
||||
|
||||
--BNSendFriendInvite ("tercio#1488")
|
||||
|
||||
function _detalhes:OpenUpdateWindow()
|
||||
--encode test
|
||||
|
||||
--local box1 =
|
||||
|
||||
if (not _G.DetailsUpdateDialog) then
|
||||
local updatewindow_frame = CreateFrame ("frame", "DetailsUpdateDialog", UIParent, "ButtonFrameTemplate")
|
||||
updatewindow_frame:SetFrameStrata ("LOW")
|
||||
tinsert (UISpecialFrames, "DetailsUpdateDialog")
|
||||
updatewindow_frame:SetPoint ("center", UIParent, "center")
|
||||
updatewindow_frame:SetSize (512, 200)
|
||||
updatewindow_frame.portrait:SetTexture ([[Interface\CHARACTERFRAME\TEMPORARYPORTRAIT-FEMALE-GNOME]])
|
||||
|
||||
updatewindow_frame.TitleText:SetText ("A New Version Is Available!")
|
||||
|
||||
updatewindow_frame.midtext = updatewindow_frame:CreateFontString (nil, "artwork", "GameFontNormal")
|
||||
updatewindow_frame.midtext:SetText ("Good news everyone!\nA new version has been forged and is waiting to be looted.")
|
||||
updatewindow_frame.midtext:SetPoint ("topleft", updatewindow_frame, "topleft", 10, -90)
|
||||
updatewindow_frame.midtext:SetJustifyH ("center")
|
||||
updatewindow_frame.midtext:SetWidth (370)
|
||||
|
||||
updatewindow_frame.gnoma = updatewindow_frame:CreateTexture (nil, "artwork")
|
||||
updatewindow_frame.gnoma:SetPoint ("topright", updatewindow_frame, "topright", -3, -59)
|
||||
updatewindow_frame.gnoma:SetTexture ("Interface\\AddOns\\Details\\images\\icons2")
|
||||
updatewindow_frame.gnoma:SetSize (105*1.05, 107*1.05)
|
||||
updatewindow_frame.gnoma:SetTexCoord (0.2021484375, 0, 0.7919921875, 1)
|
||||
|
||||
local editbox = _detalhes.gump:NewTextEntry (updatewindow_frame, nil, "$parentTextEntry", "text", 387, 14)
|
||||
editbox:SetPoint (20, -136)
|
||||
editbox:SetAutoFocus (false)
|
||||
editbox:SetHook ("OnEditFocusGained", function()
|
||||
editbox.text = "http://www.curse.com/addons/wow/details"
|
||||
editbox:HighlightText()
|
||||
end)
|
||||
editbox:SetHook ("OnEditFocusLost", function()
|
||||
editbox.text = "http://www.curse.com/addons/wow/details"
|
||||
editbox:HighlightText()
|
||||
end)
|
||||
editbox:SetHook ("OnChar", function()
|
||||
editbox.text = "http://www.curse.com/addons/wow/details"
|
||||
editbox:HighlightText()
|
||||
end)
|
||||
editbox.text = "http://www.curse.com/addons/wow/details"
|
||||
|
||||
updatewindow_frame.close = CreateFrame ("Button", "DetailsUpdateDialogCloseButton", updatewindow_frame, "OptionsButtonTemplate")
|
||||
updatewindow_frame.close:SetPoint ("bottomleft", updatewindow_frame, "bottomleft", 8, 4)
|
||||
updatewindow_frame.close:SetText ("Close")
|
||||
|
||||
updatewindow_frame.close:SetScript ("OnClick", function (self)
|
||||
DetailsUpdateDialog:Hide()
|
||||
editbox:ClearFocus()
|
||||
end)
|
||||
|
||||
updatewindow_frame:SetScript ("OnHide", function()
|
||||
editbox:ClearFocus()
|
||||
end)
|
||||
|
||||
function _detalhes:UpdateDialogSetFocus()
|
||||
DetailsUpdateDialog:Show()
|
||||
DetailsUpdateDialogTextEntry.MyObject:SetFocus()
|
||||
DetailsUpdateDialogTextEntry.MyObject:HighlightText()
|
||||
end
|
||||
_detalhes:ScheduleTimer ("UpdateDialogSetFocus", 1)
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user