Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##########################################################################################
- ## --Bone functions.
- ##########################################################################################
- --redo these functions.
- ShowBone = function(self, bone, affectChild)
- if not bone then return end
- local HiddenBones = self:GetUnitParam('HiddenBones') or {}
- if table.find(HiddenBones, bone) and self:IsValidBone(bone) then
- table.removeByValue(HiddenBones, bone)
- end
- self:SetUnitParam('HiddenBones', HiddenBones)
- oldUnit.ShowBone(self, bone, affectChild)
- end,
- ShowAllValidBones = function(self, AffectsChild)
- local HiddenBones = self:GetUnitParam('HiddenBones') or {}
- end,
- HideBone = function(self, bone, affectChild)
- if not bone then return end
- local HiddenBones = self:GetUnitParam('HiddenBones') or {}
- if not table.find(HiddenBones, bone) and self:IsValidBone(bone) then
- table.insert(HiddenBones, bone)
- end
- self:SetUnitParam('HiddenBones', HiddenBones)
- oldUnit.HideBone(self, bone, affectChild)
- end,
- HideAllValidBones = function(self, affectsChild)
- local HiddenBones = self:GetUnitParam('HiddenBones') or {}
- end,
- GetHiddenBones = function(self)
- local HiddenBones = self:GetUnitParam('HiddenBones') or {}
- return HiddenBones
- end,
- IsBoneHidden = function(self, bone)
- if not bone or not self:IsValidBone(bone) then return end
- local HiddenBones = self:GetUnitParam('HiddenBones') or {}
- if table.find(HiddenBones, bone) then
- return true
- else
- return false
- end
- end,
- HideHiddenBones = function(self)
- local HiddenBones = self:GetUnitParam('HiddenBones') or {}
- if table.getn(HiddenBones) > 0 then
- for k,v in HiddenBones do
- self:HideBone(v, true)
- end
- end
- end,
- ShowHiddenBones = function(self)
- local HiddenBones = self:GetUnitParam('HiddenBones') or {}
- if table.getn(HiddenBones) > 0 then
- for k,v in HiddenBones do
- self:ShowBone(v, true)
- end
- end
- end,
- ShowBoneNames = function(self)
- local totalBones = self:GetBoneCount()
- for i = 1, totalBones do
- if self:GetBoneName(i) then
- LOG('Bone #' ..i..' Name --> ' .. repr(self:GetBoneName(i)))
- end
- end
- end,
- GetBonesByName = function(self)
- local totalBones = self:GetBoneCount()
- local Bones = {}
- if totalBones > 0 then
- for i = 1, totalBones do
- if self:GetBoneName(i) then
- table.insert(Bones, self:GetBoneName(i))
- end
- end
- end
- return Bones
- end,
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement