Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
2.2 KiB

  1. 
  2. #include "cbase.h"
  3. #include "econ_item_description.h"
  4. #include "econ_item_interface.h"
  5. //#include "econ_holidays.h"
  6. #include "vgui/ILocalize.h"
  7. #include "localization_provider.h"
  8. #if defined( DOTA_DLL ) || defined( DOTA_GC_DLL )
  9. #include "dota_sharedfuncs.h"
  10. #endif
  11. #ifndef EXTERNALTESTS_DLL
  12. #include "econ_item_inventory.h"
  13. #endif
  14. #ifdef PROJECT_TF
  15. #include "tf_duel_summary.h"
  16. #include "econ_contribution.h"
  17. #include "tf_player_info.h"
  18. #endif
  19. #ifdef VPROF_ENABLED
  20. static const char *g_pszEconDescriptionVprofGroup = _T("Econ Description");
  21. #endif
  22. char *(g_pchWearAmountStrings[]) =
  23. {
  24. "#SFUI_InvTooltip_Wear_Amount_0",
  25. "#SFUI_InvTooltip_Wear_Amount_1",
  26. "#SFUI_InvTooltip_Wear_Amount_2",
  27. "#SFUI_InvTooltip_Wear_Amount_3",
  28. "#SFUI_InvTooltip_Wear_Amount_4"
  29. };
  30. char *( g_pchQuestOperationalPoints[] ) =
  31. {
  32. "", // 1-based
  33. "#Quest_OperationalPoints_1",
  34. "#Quest_OperationalPoints_2",
  35. "#Quest_OperationalPoints_3",
  36. };
  37. ConVar cl_show_quest_info( "cl_show_quest_info", "0", FCVAR_DEVELOPMENTONLY );
  38. // --------------------------------------------------------------------------
  39. // Purpose:
  40. // --------------------------------------------------------------------------
  41. void IEconItemDescription::YieldingFillOutEconItemDescription( IEconItemDescription *out_pDescription, CLocalizationProvider *pLocalizationProvider, const IEconItemInterface *pEconItem )
  42. {
  43. VPROF_BUDGET( "IEconItemDescription::YieldingFillOutEconItemDescription()", g_pszEconDescriptionVprofGroup );
  44. Assert( out_pDescription );
  45. Assert( pLocalizationProvider );
  46. Assert( pEconItem );
  47. out_pDescription->YieldingCacheDescriptionData( pLocalizationProvider, pEconItem );
  48. out_pDescription->GenerateDescriptionLines( pLocalizationProvider, pEconItem );
  49. }
  50. // --------------------------------------------------------------------------
  51. // Purpose:
  52. // --------------------------------------------------------------------------
  53. const econ_item_description_line_t *IEconItemDescription::GetFirstLineWithMetaType( uint32 unMetaTypeSearchFlags ) const
  54. {
  55. for ( unsigned int i = 0; i < GetLineCount(); i++ )
  56. {
  57. const econ_item_description_line_t& pLine = GetLine(i);
  58. if ( (pLine.unMetaType & unMetaTypeSearchFlags) == unMetaTypeSearchFlags )
  59. return &pLine;
  60. }
  61. return NULL;
  62. }