Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
ElvUI_MerathilisUI
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Merathilis
ElvUI_MerathilisUI
Commits
1aefa0e9
Commit
1aefa0e9
authored
Sep 10, 2019
by
Merathilis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added own Durability DataText.. needs testing.
parent
935173a4
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
143 additions
and
17 deletions
+143
-17
ElvUI_MerathilisUI/core/install.lua
ElvUI_MerathilisUI/core/install.lua
+1
-1
ElvUI_MerathilisUI/locales/deDE.lua
ElvUI_MerathilisUI/locales/deDE.lua
+1
-0
ElvUI_MerathilisUI/locales/enUS.lua
ElvUI_MerathilisUI/locales/enUS.lua
+1
-0
ElvUI_MerathilisUI/locales/frFR.lua
ElvUI_MerathilisUI/locales/frFR.lua
+1
-0
ElvUI_MerathilisUI/locales/itIT.lua
ElvUI_MerathilisUI/locales/itIT.lua
+1
-0
ElvUI_MerathilisUI/locales/koKR.lua
ElvUI_MerathilisUI/locales/koKR.lua
+1
-0
ElvUI_MerathilisUI/locales/ruRU.lua
ElvUI_MerathilisUI/locales/ruRU.lua
+1
-0
ElvUI_MerathilisUI/locales/zhCN.lua
ElvUI_MerathilisUI/locales/zhCN.lua
+1
-0
ElvUI_MerathilisUI/locales/zhTW.lua
ElvUI_MerathilisUI/locales/zhTW.lua
+1
-0
ElvUI_MerathilisUI/modules/datatexts/durability.lua
ElvUI_MerathilisUI/modules/datatexts/durability.lua
+117
-0
ElvUI_MerathilisUI/modules/datatexts/load_datatexts.xml
ElvUI_MerathilisUI/modules/datatexts/load_datatexts.xml
+1
-0
ElvUI_MerathilisUI/modules/datatexts/time.lua
ElvUI_MerathilisUI/modules/datatexts/time.lua
+16
-16
No files found.
ElvUI_MerathilisUI/core/install.lua
View file @
1aefa0e9
...
...
@@ -2450,7 +2450,7 @@ function MER:SetupDts()
E
.
db
[
"datatexts"
][
"minimapBottom"
]
=
false
E
.
db
[
"mui"
][
"datatexts"
][
"panels"
][
"ChatTab_Datatext_Panel"
].
left
=
"BfA Missions"
E
.
db
[
"mui"
][
"datatexts"
][
"panels"
][
"ChatTab_Datatext_Panel"
].
middle
=
"Durability"
E
.
db
[
"mui"
][
"datatexts"
][
"panels"
][
"ChatTab_Datatext_Panel"
].
middle
=
"
MUI
Durability"
E
.
db
[
"mui"
][
"datatexts"
][
"panels"
][
"ChatTab_Datatext_Panel"
].
right
=
"Gold"
...
...
ElvUI_MerathilisUI/locales/deDE.lua
View file @
1aefa0e9
...
...
@@ -194,6 +194,7 @@ L["Middle Datatext Panel"] = "Mittlere Infotextleiste"
L
[
"Right Click"
]
=
"Rechtsklick"
L
[
"Toggle ActionBar"
]
=
"Aktionsleisten ausblenden"
L
[
"Toggle Middle DT"
]
=
"Mittleren Infotext ausblenden"
L
[
"Dura."
]
=
"Haltb."
-- DataBars
L
[
"DataBars"
]
=
"Informationsleisten"
...
...
ElvUI_MerathilisUI/locales/enUS.lua
View file @
1aefa0e9
...
...
@@ -197,6 +197,7 @@ L["Middle Datatext Panel"] = true
L
[
"Right Click"
]
=
true
L
[
"Toggle ActionBar"
]
=
true
L
[
"Toggle Middle DT"
]
=
true
L
[
"Dura."
]
=
true
-- DataBars
L
[
"DataBars"
]
=
true
...
...
ElvUI_MerathilisUI/locales/frFR.lua
View file @
1aefa0e9
...
...
@@ -196,6 +196,7 @@ L["Middle Datatext Panel"] = true
L
[
"Right Click"
]
=
true
L
[
"Toggle ActionBar"
]
=
true
L
[
"Toggle Middle DT"
]
=
true
L
[
"Dura."
]
=
true
-- DataBars
L
[
"DataBars"
]
=
true
...
...
ElvUI_MerathilisUI/locales/itIT.lua
View file @
1aefa0e9
...
...
@@ -196,6 +196,7 @@ L["Middle Datatext Panel"] = true
L
[
"Right Click"
]
=
true
L
[
"Toggle ActionBar"
]
=
true
L
[
"Toggle Middle DT"
]
=
true
L
[
"Dura."
]
=
true
-- DataBars
L
[
"DataBars"
]
=
true
...
...
ElvUI_MerathilisUI/locales/koKR.lua
View file @
1aefa0e9
...
...
@@ -192,6 +192,7 @@ L["Middle Datatext Panel"] = true
L
[
"Right Click"
]
=
true
L
[
"Toggle ActionBar"
]
=
true
L
[
"Toggle Middle DT"
]
=
true
L
[
"Dura."
]
=
true
-- DataBars
L
[
"DataBars"
]
=
true
...
...
ElvUI_MerathilisUI/locales/ruRU.lua
View file @
1aefa0e9
...
...
@@ -194,6 +194,7 @@ L["Middle Datatext Panel"] = true
L
[
"Right Click"
]
=
true
L
[
"Toggle ActionBar"
]
=
true
L
[
"Toggle Middle DT"
]
=
true
L
[
"Dura."
]
=
true
-- DataBars
L
[
"DataBars"
]
=
true
...
...
ElvUI_MerathilisUI/locales/zhCN.lua
View file @
1aefa0e9
...
...
@@ -194,6 +194,7 @@ L["Middle Datatext Panel"] = "中间的信息面板"
L["
Right
Click
"] = true
L["
Toggle
ActionBar
"] = true
L["
Toggle
Middle
DT
"] = true
L["
Dura
.
"] = true
-- DataBars
L["
DataBars
"] = "
数据条
"
...
...
ElvUI_MerathilisUI/locales/zhTW.lua
View file @
1aefa0e9
...
...
@@ -194,6 +194,7 @@ L["Middle Datatext Panel"] = true
L
[
"Right Click"
]
=
true
L
[
"Toggle ActionBar"
]
=
true
L
[
"Toggle Middle DT"
]
=
true
L
[
"Dura."
]
=
true
-- DataBars
L
[
"DataBars"
]
=
true
...
...
ElvUI_MerathilisUI/modules/datatexts/durability.lua
0 → 100644
View file @
1aefa0e9
local
MER
,
E
,
L
,
V
,
P
,
G
=
unpack
(
select
(
2
,
...
))
local
DT
=
E
:
GetModule
(
'DataTexts'
)
--Lua functions
local
_G
=
_G
local
select
=
select
local
format
,
gsub
=
string.format
,
string.gsub
local
floor
,
modf
=
math.floor
,
math.modf
local
tsort
=
table.sort
--WoW
API
/
Variables
local
CreateFrame
=
CreateFrame
local
GetAverageItemLevel
=
GetAverageItemLevel
local
GetInventoryItemTexture
=
GetInventoryItemTexture
local
GetInventoryItemDurability
=
GetInventoryItemDurability
local
GetInventoryItemLink
=
GetInventoryItemLink
local
GetMoneyString
=
GetMoneyString
local
InCombatLockdown
=
InCombatLockdown
local
ToggleCharacter
=
ToggleCharacter
local
UIParent
=
UIParent
local
DURABILITY
=
DURABILITY
local
NONE
=
NONE
local
REPAIR_COST
=
REPAIR_COST
local
HEADER_COLON
=
HEADER_COLON
local
repairCostString
=
gsub
(
REPAIR_COST
,
HEADER_COLON
,
":"
)
local
localSlots
=
{
[
1
]
=
{
1
,
INVTYPE_HEAD
,
1000
},
[
2
]
=
{
3
,
INVTYPE_SHOULDER
,
1000
},
[
3
]
=
{
5
,
INVTYPE_CHEST
,
1000
},
[
4
]
=
{
6
,
INVTYPE_WAIST
,
1000
},
[
5
]
=
{
9
,
INVTYPE_WRIST
,
1000
},
[
6
]
=
{
10
,
INVTYPE_HAND
,
1000
},
[
7
]
=
{
7
,
INVTYPE_LEGS
,
1000
},
[
8
]
=
{
8
,
INVTYPE_FEET
,
1000
},
[
9
]
=
{
16
,
INVTYPE_WEAPONMAINHAND
,
1000
},
[
10
]
=
{
17
,
INVTYPE_WEAPONOFFHAND
,
1000
}
}
local
function
sortSlots
(
a
,
b
)
if
a
and
b
then
return
(
a
[
3
]
==
b
[
3
]
and
a
[
1
]
<
b
[
1
])
or
(
a
[
3
]
<
b
[
3
])
end
end
local
function
getItemDurability
()
local
numSlots
=
0
for
i
=
1
,
10
do
localSlots
[
i
][
3
]
=
1000
local
index
=
localSlots
[
i
][
1
]
if
GetInventoryItemLink
(
"player"
,
index
)
then
local
current
,
max
=
GetInventoryItemDurability
(
index
)
if
current
then
localSlots
[
i
][
3
]
=
current
/
max
numSlots
=
numSlots
+
1
end
end
end
tsort
(
localSlots
,
sortSlots
)
return
numSlots
end
local
function
gradientColor
(
perc
)
perc
=
perc
>
1
and
1
or
perc
<
0
and
0
or
perc
-- Stay between 0-1
local
seg
,
relperc
=
modf
(
perc
*
2
)
local
r1
,
g1
,
b1
,
r2
,
g2
,
b2
=
select
(
seg
*
3
+
1
,
1
,
0
,
0
,
1
,
1
,
0
,
0
,
1
,
0
,
0
,
0
,
0
)
-- R -> Y -> G
local
r
,
g
,
b
=
r1
+
(
r2
-
r1
)
*
relperc
,
g1
+
(
g2
-
g1
)
*
relperc
,
b1
+
(
b2
-
b1
)
*
relperc
return
format
(
"|cff%02x%02x%02x"
,
r
*
255
,
g
*
255
,
b
*
255
),
r
,
g
,
b
end
local
tip
=
CreateFrame
(
"GameTooltip"
,
"muiDurabilityTooltip"
)
tip
:
SetOwner
(
UIParent
,
"ANCHOR_NONE"
)
local
function
OnEvent
(
self
)
local
numSlots
=
getItemDurability
()
if
numSlots
>
0
then
self
.
text
:
SetText
(
format
(
gsub
(
L[
"Dura."
]..
": "
..
"
[
color
]
%d|r%%"
,
"%
[
color%
]
"
,
(
gradientColor
(
floor
(
localSlots[1][3]*100
)
/
100
))),
floor
(
localSlots
[
1
][
3
]
*
100
)))
else
self
.
text
:
SetText
(
L
[
"Dura."
]
..
": "
..
NONE
)
end
end
local
function
Click
()
if
InCombatLockdown
()
then
_G
.
UIErrorsFrame
:
AddMessage
(
E
.
InfoColor
..
_G
.
ERR_NOT_IN_COMBAT
)
return
end
ToggleCharacter
(
"PaperDollFrame"
)
end
local
function
OnEnter
(
self
)
DT
:
SetupTooltip
(
self
)
local
total
,
equipped
=
GetAverageItemLevel
()
DT
.
tooltip
:
ClearLines
()
DT
.
tooltip
:
AddDoubleLine
(
DURABILITY
,
format
(
"%s: %d/%d"
,
_G
.
STAT_AVERAGE_ITEM_LEVEL
,
equipped
,
total
),
.
6
,
.
8
,
1
,
1
,
1
,
1
)
DT
.
tooltip
:
AddLine
(
" "
)
local
totalCost
=
0
for
i
=
1
,
10
do
if
localSlots
[
i
][
3
]
~=
1000
then
local
slot
=
localSlots
[
i
][
1
]
local
green
=
localSlots
[
i
][
3
]
*
2
local
red
=
1
-
green
local
slotIcon
=
"|T"
..
GetInventoryItemTexture
(
"player"
,
slot
)
..
":13:15:0:0:50:50:4:46:4:46|t "
or
""
DT
.
tooltip
:
AddDoubleLine
(
slotIcon
..
localSlots
[
i
][
2
],
floor
(
localSlots
[
i
][
3
]
*
100
)
..
"%"
,
1
,
1
,
1
,
red
+
1
,
green
,
0
)
totalCost
=
totalCost
+
select
(
3
,
tip
:
SetInventoryItem
(
"player"
,
slot
))
end
end
if
totalCost
>
0
then
DT
.
tooltip
:
AddLine
(
" "
)
DT
.
tooltip
:
AddDoubleLine
(
repairCostString
,
GetMoneyString
(
totalCost
),
.
6
,
.
8
,
1
,
1
,
1
,
1
)
end
DT
.
tooltip
:
Show
()
end
DT
:
RegisterDatatext
(
'MUI Durability'
,
{
'PLAYER_ENTERING_WORLD'
,
"UPDATE_INVENTORY_DURABILITY"
,
"MERCHANT_SHOW"
},
OnEvent
,
nil
,
Click
,
OnEnter
,
nil
,
DURABILITY
)
ElvUI_MerathilisUI/modules/datatexts/load_datatexts.xml
View file @
1aefa0e9
<Ui
xmlns=
"http://www.blizzard.com/wow/ui/"
>
<Script
file=
"options.lua"
/>
<Script
file=
"durability.lua"
/>
<Script
file=
"time.lua"
/>
</Ui>
ElvUI_MerathilisUI/modules/datatexts/time.lua
View file @
1aefa0e9
local
E
,
L
,
V
,
P
,
G
,
_
=
unpack
(
ElvUI
);
--Inport: Engine, Locales, PrivateDB, ProfileDB, GlobalDB, Localize Underscore
local
MER
,
E
,
L
,
V
,
P
,
G
=
unpack
(
select
(
2
,
...
))
local
DT
=
E
:
GetModule
(
'DataTexts'
)
--All credits belongs to Merathilis for this Time datatext mod
...
...
@@ -98,14 +98,14 @@ local function formatResetTime(sec)
return
"N/A"
end
if
d
>
0
and
lockoutFormatString
[
h
>
10
and
1
or
2
]
then
if
d
>
0
and
lockoutFormatString
[
h
>
10
and
1
or
2
]
then
return
format
(
lockoutFormatString
[
h
>
10
and
1
or
2
],
d
,
h
,
m
)
end
if
h
>
0
and
lockoutFormatString
[
h
>
10
and
3
or
4
]
then
return
format
(
lockoutFormatString
[
h
>
10
and
3
or
4
],
h
,
m
)
end
if
m
>
0
and
lockoutFormatString
[
m
>
10
and
5
or
6
]
then
return
format
(
lockoutFormatString
[
m
>
10
and
5
or
6
],
m
)
if
m
>
0
and
lockoutFormatString
[
m
>
10
and
5
or
6
]
then
return
format
(
lockoutFormatString
[
m
>
10
and
5
or
6
],
m
)
end
end
...
...
@@ -120,7 +120,7 @@ local function OnEvent(self, event)
end
local
function
Click
()
_G
[
"GameTimeFrame"
]:
Click
()
;
_G
[
"GameTimeFrame"
]:
Click
()
end
local
function
OnLeave
(
self
)
...
...
@@ -136,7 +136,7 @@ local function OnEnter(self)
RequestRaidInfo
()
end
DT
.
tooltip
:
AddLine
(
VOICE_CHAT_BATTLEGROUND
)
;
DT
.
tooltip
:
AddLine
(
VOICE_CHAT_BATTLEGROUND
)
for
i
=
1
,
GetNumWorldPVPAreas
()
do
_
,
localizedName
,
isActive
,
canQueue
,
startTime
,
canEnter
=
GetWorldPVPAreaInfo
(
i
)
if
canEnter
then
...
...
@@ -160,10 +160,10 @@ local function OnEnter(self)
DT
.
tooltip
:
AddLine
(
L
[
"Saved Raid(s)"
])
oneraid
=
true
end
if
extended
then
lockoutColor
=
lockoutColorExtended
if
extended
then
lockoutColor
=
lockoutColorExtended
else
lockoutColor
=
lockoutColorNormal
lockoutColor
=
lockoutColorNormal
end
local
_
,
_
,
isHeroic
,
_
,
displayHeroic
,
displayMythic
=
GetDifficultyInfo
(
difficultyId
)
...
...
@@ -193,7 +193,7 @@ local function OnEnter(self)
DT
.
tooltip
:
AddLine
(
" "
)
if
AmPm
==
-
1
then
DT
.
tooltip
:
AddDoubleLine
(
E
.
db
.
datatexts
.
localtime
and
TIMEMANAGER_TOOLTIP_REALMTIME
or
TIMEMANAGER_TOOLTIP_LOCALTIME
,
DT
.
tooltip
:
AddDoubleLine
(
E
.
db
.
datatexts
.
localtime
and
TIMEMANAGER_TOOLTIP_REALMTIME
or
TIMEMANAGER_TOOLTIP_LOCALTIME
,
format
(
europeDisplayFormat_nocolor
,
Hr
,
Min
),
1
,
1
,
1
,
lockoutColorNormal
.
r
,
lockoutColorNormal
.
g
,
lockoutColorNormal
.
b
)
else
DT
.
tooltip
:
AddDoubleLine
(
E
.
db
.
datatexts
.
localtime
and
TIMEMANAGER_TOOLTIP_REALMTIME
or
TIMEMANAGER_TOOLTIP_LOCALTIME
,
...
...
@@ -226,11 +226,11 @@ local function OnEnter(self)
}
DT
.
tooltip
:
AddLine
(
" "
)
local
date
=
C_DateAndTime
.
GetCurrentCalendarTime
()
;
local
presentWeekday
=
date
.
weekday
;
local
presentMonth
=
date
.
month
;
local
presentDay
=
date
.
monthDay
;
local
presentYear
=
date
.
year
;
local
date
=
C_DateAndTime
.
GetCurrentCalendarTime
()
local
presentWeekday
=
date
.
weekday
local
presentMonth
=
date
.
month
local
presentDay
=
date
.
monthDay
local
presentYear
=
date
.
year
DT
.
tooltip
:
AddLine
(
format
(
"%s, %s %d, %d"
,
daysAbr
[
presentWeekday
],
monthAbr
[
presentMonth
],
presentDay
,
presentYear
))
DT
.
tooltip
:
Show
()
...
...
@@ -276,4 +276,4 @@ function Update(self, t)
int
=
5
end
DT
:
RegisterDatatext
(
"MUI Time"
,
{
"QUEST_COMPLETE"
,
"QUEST_LOG_UPDATE"
},
OnEvent
,
Update
,
Click
,
OnEnter
,
OnLeave
)
\ No newline at end of file
DT
:
RegisterDatatext
(
"MUI Time"
,
{
"QUEST_COMPLETE"
,
"QUEST_LOG_UPDATE"
},
OnEvent
,
Update
,
Click
,
OnEnter
,
OnLeave
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment