SHARE
TWEET

Untitled

a guest Nov 19th, 2019 82 in 153 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*************************************************************************
  2. Crytek Source File.
  3. Copyright (C), Crytek Studios, 2001-2007.
  4. -------------------------------------------------------------------------
  5. $Id$
  6. $DateTime$
  7. Description: Crosshair HUD object (refactored from old HUD code)
  8.  
  9. -------------------------------------------------------------------------
  10. History:
  11. - 15:05:2007  11:00 : Created by Jan Mьller
  12.  
  13. *************************************************************************/
  14.  
  15. #ifndef HUD_CROSSHAIR_H
  16. #define HUD_CROSSHAIR_H
  17.  
  18. # pragma once
  19.  
  20.  
  21. #include "HUDObject.h"
  22. #include "IFlashPlayer.h"
  23. #include "IVehicleSystem.h"
  24. #include "GameFlashAnimation.h"
  25.  
  26. class CHUD;
  27.  
  28. class CHUDCrosshair : public CHUDObject
  29. {
  30.  
  31. public:
  32.     CHUDCrosshair(CHUD* pHUD);
  33.     ~CHUDCrosshair();
  34.  
  35.     void hideIcons();
  36.  
  37.     void SomeH();
  38.  
  39.     // CHUDObject
  40.     virtual void Update(float fDeltaTime);
  41.     // ~CHUDObject
  42.  
  43.     //use-icon
  44.     void SetUsability(int usable, const char* actionLabel = NULL, const char* paramA = NULL, const char* paramB = NULL);
  45.     int GetUsability() const;
  46.     //show enemy hit in crosshair
  47.     void CrosshairHit();
  48.     //choose and set crosshair design
  49.     void SelectCrosshair(IItem *pItem = NULL);
  50.     // set opacity of crosshair (0 is invisible, 1 is fully visible)
  51.     void SetOpacity(float opacity);
  52.     void SetCrosshair(int iCrosshair);
  53.     //get crosshair flash movie
  54.     CGameFlashAnimation *GetFlashAnim() {return &m_animCrossHair;}
  55.     bool IsFriendlyEntity(IEntity *pEntity);
  56.  
  57.     void Break(bool state);
  58.     ILINE int GetCrosshairType() const { return m_iCrosshair; }
  59.  
  60.     void Reset();
  61.  
  62. private:
  63.  
  64.     //update function
  65.     void UpdateCrosshair();
  66.  
  67.     //the main HUD
  68.     CHUD    *g_pHUD;
  69.     //the crosshair flash asset
  70.     CGameFlashAnimation m_animCrossHair;
  71.     //the friend-cross flash asset
  72.     CGameFlashAnimation m_animFriendCross;
  73.     //the use icons flash asset
  74.     CGameFlashAnimation m_animInterActiveIcons;
  75.     //usability flag (can use lookat object)
  76.     int m_iUsable;
  77.     // targetted friendly unit
  78.     int m_iFriendlyTarget;
  79.     // crosshair type cache value
  80.     int m_iCrosshair;
  81.     // maps usability strings to icons
  82.     std::map<string, int> m_useIcons;
  83.     //hide the use icon in special cases
  84.     bool m_bHideUseIconTemp;
  85.     //broken hud state
  86.     bool m_bBroken;
  87.     // crosshair opacity
  88.     float m_opacity;
  89.     float m_spread;
  90.     float m_smoothSpread;
  91. };
  92.  
  93. #endif
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top