Complete rewrite of message handler
This commit is contained in:
@ -138,7 +138,7 @@ function StatPointUI.OnLoad()
|
||||
end
|
||||
|
||||
function OnCacheReceived(sender, argTable)
|
||||
StatPointUI.cache = argTable[2]
|
||||
StatPointUI.cache = argTable[1]
|
||||
local rowContent = {"Strength", "Agility", "Stamina", "Intellect", "Spirit"}
|
||||
for i = 1, 5 do
|
||||
StatPointUI[rowContent[i]].Val:SetText(StatPointUI.cache[i])
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
## Interface: 30300
|
||||
## Title: StatPointUI
|
||||
## Notes: CMH Stat Point UI example script.
|
||||
## Version: 1.0
|
||||
## Version: 1.1
|
||||
## Author: Foereaper, Kaev
|
||||
##RequiredDeps: CMH
|
||||
|
||||
|
||||
@ -107,8 +107,8 @@ end
|
||||
function OnSpendPointRequest(player, argTable)
|
||||
if(StatPointUI.cache[player:GetGUIDLow()][6] > 0) then
|
||||
-- Double check that the stat requested is actually a valid number
|
||||
if(tonumber(argTable[2]) <= 5 and tonumber(argTable[2]) >= 0) then
|
||||
StatPointUI.OnPointSpent(player:GetGUIDLow(), argTable[2])
|
||||
if(tonumber(argTable[1]) <= 5 and tonumber(argTable[1]) >= 0) then
|
||||
StatPointUI.OnPointSpent(player:GetGUIDLow(), argTable[1])
|
||||
end
|
||||
else
|
||||
player:SendBroadcastMessage("You have no points left!")
|
||||
|
||||
Reference in New Issue
Block a user