Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- The below section displays an icon if the player is in the cone behind their target
- local playerPos = GameLib.GetPlayerUnit():GetPosition()
- local vecTargToPlayer = Vector3.New(targetPos.x - playerPos.x, 0, targetPos.z - playerPos.z)
- vecTargToPlayer = vecTargToPlayer:Normal()
- local nDotTargPlayer = Vector3.Dot(vecTargToPlayer, vecTargetFacing)
- if nDotTargPlayer >= cos135 then
- if not self.wndNotification:IsShown() then
- if self.settings.anchor then
- self.wndNotification:SetAnchorOffsets(unpack(self.settings.anchor))
- end
- self.wndNotification:Show(true)
- end
- else
- self.wndNotification:Show(false)
- end
- end
- function FromBehind:OnRestore(eType, t)
- if eType ~= GameLib.CodeEnumAddonSaveLevel.Character then return end
- self.settings = {}
- self.settings = t
- self:MoreDots()
- end
- function FromBehind:OnSave(eType)
- if eType == GameLib.CodeEnumAddonSaveLevel.Character then
- self.settings.anchor = {self.wndNotification:GetAnchorOffsets()}
- return self.settings
- end
- end
- -----------------------------------------------------------------------------------------------
- -- FromBehind Instance
- -----------------------------------------------------------------------------------------------
- local FromBehindInst = FromBehind:new()
- FromBehindInst:Init()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement