Advertisement
nphxboxlive

[CoD5 / WaW] ugx_modder_help.gsc

Dec 27th, 2020
785
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.09 KB | None | 0 0
  1. //UGX Notes: This is code from DLC3 for creating the modderhelp hud. I moved this to an external file for #include purposes. Want to keep the external file references to a minimum (i.e. no maps\_filename::function())
  2.  
  3. #include maps\_utility;
  4. #include common_scripts\utility;
  5. #include maps\_zombiemode_utility;
  6.  
  7. //Args:
  8. // item: the item to be analyzed
  9. // msg: the message to display if the check fails
  10. // type: the type of check we are performing
  11. //Types:
  12. // entity: checks if an entity is defined
  13. // test: checks bool value of item parameter.
  14.  
  15. modderHelp( item, msg, type )
  16. {
  17.     if(!isDefined(type)) type = "entity";
  18.     // Developer Needs To Be Set To 1
  19.     if( getDvarInt( "developer" ) >= 1 )
  20.     {
  21.         // Title
  22.         if( !isDefined( level.modderHelpText[ 0 ] ) )
  23.         {
  24.             level.modderHelpText[ 0 ] = modderHelpHUD_CreateText( "UGX Modtools Patch Developer Help Center" );
  25.         }
  26.        
  27.         if(type == "entity")
  28.         {
  29.             // Check If Entity Exists Or Forced Error Msg
  30.             if( !isDefined( item ) )
  31.             {
  32.                 // Check If Error Msg Exists
  33.                 if( !isDefined( msg ) )
  34.                 {
  35.                     return false;
  36.                 }
  37.                
  38.                 // Let Modder Know What's Wrong And How To Fix         
  39.                 level.modderHelpText[ level.modderHelpText.size ] = modderHelpHUD_CreateText( "^1   -" + msg );
  40.                
  41.                 return true; // Return That There Was Something Wrong
  42.             }
  43.         }
  44.         if(type == "test")
  45.         {
  46.             if(item)
  47.                 level.modderHelpText[ level.modderHelpText.size ] = modderHelpHUD_CreateText( "^1   -" + msg );
  48.         }
  49.     }
  50.    
  51.     return false;
  52. }
  53.  
  54. modderHelpHUD_CreateText( Msg )
  55. {
  56.     temp_modderHelpHUD = newHudElem();
  57.     temp_modderHelpHUD.x = 0;
  58.     temp_modderHelpHUD.y = (level.modderHelpText.size * 20) - 180;
  59.     temp_modderHelpHUD.alignX = "left";
  60.     temp_modderHelpHUD.alignY = "middle";
  61.     temp_modderHelpHUD.horzAlign = "left";
  62.     temp_modderHelpHUD.vertAlign = "middle";
  63.     temp_modderHelpHUD.sort = 1;
  64.     temp_modderHelpHUD.foreground = true;
  65.     temp_modderHelpHUD.fontScale = 1.25;
  66.     temp_modderHelpHUD SetText( Msg );
  67.     temp_modderHelpHUD.alpha = 0;
  68.     temp_modderHelpHUD FadeOverTime( 1.2 );
  69.     temp_modderHelpHUD.alpha = 1;
  70.    
  71.     return temp_modderHelpHUD;
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement