Advertisement
Guest User

Untitled

a guest
Mar 24th, 2012
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.54 KB | None | 0 0
  1. ##########################################################################################
  2.     ## --Bone functions.
  3.     ##########################################################################################
  4.    
  5.     --redo these functions.
  6.     ShowBone = function(self, bone, affectChild)
  7.         if not bone then return end
  8.         local HiddenBones = self:GetUnitParam('HiddenBones') or {}
  9.          
  10.         if table.find(HiddenBones, bone) and self:IsValidBone(bone) then
  11.             table.removeByValue(HiddenBones, bone)
  12.         end
  13.                
  14.         self:SetUnitParam('HiddenBones', HiddenBones)
  15.         oldUnit.ShowBone(self, bone, affectChild)
  16.     end,
  17.    
  18.     ShowAllValidBones = function(self, AffectsChild)
  19.         local HiddenBones = self:GetUnitParam('HiddenBones') or {}
  20.     end,
  21.    
  22.     HideBone = function(self, bone, affectChild)
  23.         if not bone then return end
  24.         local HiddenBones = self:GetUnitParam('HiddenBones') or {}
  25.          
  26.         if not table.find(HiddenBones, bone) and self:IsValidBone(bone) then
  27.             table.insert(HiddenBones, bone)
  28.         end
  29.        
  30.         self:SetUnitParam('HiddenBones', HiddenBones)
  31.         oldUnit.HideBone(self, bone, affectChild)
  32.     end,
  33.    
  34.     HideAllValidBones = function(self, affectsChild)
  35.         local HiddenBones = self:GetUnitParam('HiddenBones') or {}
  36.     end,
  37.    
  38.     GetHiddenBones = function(self)
  39.         local HiddenBones = self:GetUnitParam('HiddenBones') or {}
  40.         return HiddenBones
  41.     end,
  42.    
  43.     IsBoneHidden = function(self, bone)
  44.         if not bone or not self:IsValidBone(bone) then return end
  45.         local HiddenBones = self:GetUnitParam('HiddenBones') or {}
  46.        
  47.         if table.find(HiddenBones, bone) then
  48.             return true
  49.         else
  50.             return false
  51.         end
  52.     end,
  53.    
  54.     HideHiddenBones = function(self)
  55.         local HiddenBones = self:GetUnitParam('HiddenBones') or {}
  56.                
  57.         if table.getn(HiddenBones) > 0 then
  58.             for k,v in HiddenBones do
  59.                 self:HideBone(v, true)
  60.             end
  61.         end
  62.     end,
  63.    
  64.     ShowHiddenBones = function(self)
  65.         local HiddenBones = self:GetUnitParam('HiddenBones') or {}
  66.                
  67.         if table.getn(HiddenBones) > 0 then
  68.             for k,v in HiddenBones do
  69.                 self:ShowBone(v, true)
  70.             end
  71.         end
  72.     end,
  73.    
  74.     ShowBoneNames = function(self)
  75.         local totalBones = self:GetBoneCount()
  76.        
  77.         for i = 1, totalBones do
  78.             if self:GetBoneName(i) then
  79.                 LOG('Bone #' ..i..' Name --> ' .. repr(self:GetBoneName(i)))
  80.             end
  81.         end
  82.     end,
  83.    
  84.     GetBonesByName = function(self)
  85.         local totalBones = self:GetBoneCount()
  86.         local Bones = {}
  87.        
  88.         if totalBones > 0 then
  89.             for i = 1, totalBones do
  90.                 if self:GetBoneName(i) then
  91.                     table.insert(Bones, self:GetBoneName(i))
  92.                 end
  93.             end
  94.         end
  95.        
  96.         return Bones
  97.     end,
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement