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
A
AllTheIDs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wowui
AllTheIDs
Commits
601c8c4a
Commit
601c8c4a
authored
Oct 05, 2015
by
Robin Schoonover
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
In quest log, handle currency reward types.
parent
3d5e4663
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
4 deletions
+50
-4
AllTheIDs.toc
AllTheIDs.toc
+1
-0
CurrencyCache.lua
CurrencyCache.lua
+35
-0
GameTooltip.lua
GameTooltip.lua
+14
-4
No files found.
AllTheIDs.toc
View file @
601c8c4a
...
...
@@ -5,5 +5,6 @@
## Author: End
## X-Email: end@cornhooves.org
AllTheIDs.lua
CurrencyCache.lua
GameTooltip.lua
Other.lua
CurrencyCache.lua
0 → 100644
View file @
601c8c4a
local
addon_name
,
addon
=
...
local
function
defaulttable
(
callable
)
callable
=
callable
or
function
()
return
nil
end
return
setmetatable
({},
{
__index
=
function
(
t
,
key
)
local
val
=
callable
()
rawset
(
t
,
key
,
val
)
return
val
end
})
end
addon
.
currencyCache
=
defaulttable
(
defaulttable
)
local
event_frame
=
CreateFrame
(
"FRAME"
)
event_frame
:
SetScript
(
"OnEvent"
,
function
(
frame
,
event
,
...
)
local
func
=
frame
[
event
]
if
func
then
return
func
(
frame
,
...
)
end
end
)
function
event_frame
:
PLAYER_ENTERING_WORLD
()
for
idx
=
1
,
GetCurrencyListSize
()
do
local
link
=
GetCurrencyListLink
(
idx
)
local
name
,
_
,
_
,
_
,
_
,
_
,
icon
=
GetCurrencyListInfo
(
idx
)
if
name
and
icon
then
addon
.
currencyCache
[
name
][
icon
]
=
link
end
end
end
event_frame
:
RegisterEvent
(
"PLAYER_ENTERING_WORLD"
)
event_frame
:
PLAYER_ENTERING_WORLD
()
GameTooltip.lua
View file @
601c8c4a
...
...
@@ -107,12 +107,22 @@ addon:HookTip("SetMerchantCostItem", function(self, idx, currency)
addon
:
AddIDLine
(
self
,
"Currency"
,
currencyID
)
end
)
addon
:
HookTip
(
"SetQuestCurrency"
,
function
(
self
,
type
,
idx
)
-- TODO GetQuestCurrencyInfo(type, idx) => name, texture, count
addon
:
HookTip
(
"SetQuestCurrency"
,
function
(
tip
,
type
,
idx
)
local
name
,
icon
=
GetQuestCurrencyInfo
(
type
,
idx
)
local
link
=
addon
.
currencyCache
[
name
][
icon
]
if
link
then
local
_
,
_
,
name
,
id
=
strfind
(
link
,
"|H(%w+):(%d+)"
)
addon
:
AddIDLine
(
tip
,
name
:
gsub
(
"^%l"
,
string.upper
),
id
)
end
end
)
addon
:
HookTip
(
"SetQuestLogCurrency"
,
function
(
self
,
type
,
idx
)
-- TODO GetQuestLogRewardCurrencyInfo(idx) => name, texture, count
addon
:
HookTip
(
"SetQuestLogCurrency"
,
function
(
tip
,
type
,
idx
)
local
name
,
icon
=
GetQuestLogRewardCurrencyInfo
(
idx
)
local
link
=
addon
.
currencyCache
[
name
][
icon
]
if
link
then
local
_
,
_
,
name
,
id
=
strfind
(
link
,
"|H(%w+):(%d+)"
)
addon
:
AddIDLine
(
tip
,
name
:
gsub
(
"^%l"
,
string.upper
),
id
)
end
end
)
addon
:
HookTip
(
"SetQuestLogItem"
,
function
(
self
,
...
)
...
...
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