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.

31 lines
796 B

  1. //=========== (C) Copyright Valve, L.L.C. All rights reserved. ===========
  2. #include "cbase.h"
  3. #include "ui_nugget.h"
  4. class CUiNuggetLoadingProgress : public CUiNuggetBase
  5. {
  6. public:
  7. CUiNuggetLoadingProgress()
  8. {
  9. m_pUiNuggetData->SetString( "map", "" );
  10. m_pUiNuggetData->SetFloat( "progress", 0.0f );
  11. }
  12. DECLARE_NUGGET_FN_MAP( CUiNuggetLoadingProgress, CUiNuggetBase );
  13. NUGGET_BROADCAST_FN( OnLevelLoadingProgress )
  14. {
  15. m_pUiNuggetData->MergeFrom( args, KeyValues::MERGE_KV_BORROW );
  16. return true;
  17. }
  18. virtual bool ShouldDeleteOnLastScreenDisconnect()
  19. {
  20. // bad to try to delete a static.
  21. return false;
  22. }
  23. };
  24. static CUiNuggetLoadingProgress g_nugget_loadingprogress;
  25. UI_NUGGET_FACTORY_GLOBAL_INSTANCE( CUiNuggetLoadingProgress, &g_nugget_loadingprogress, "loadingprogress" );