My program doesn't have bugs. It just develops random features.

Difference between revisions of "User:Eliot/EditPackagesCommandlet"

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
(Created page with 'This is a simple commandlet to add and remove a specified editpackage for the use in Batch files when you are not using an IDE. {{Infobox utility |name=EditPack…')
 
m
Line 1: Line 1:
 
This is a simple commandlet to add and remove a specified editpackage for the use in [[wp:Batch file|Batch]] files when you are not using an IDE.
 
This is a simple commandlet to add and remove a specified editpackage for the use in [[wp:Batch file|Batch]] files when you are not using an IDE.
{{Infobox utility
 
|name=EditPackages Commandlet
 
|description=A commandlet that can add and remove a specified editpackage.
 
|author=[[User:Eliot|Eliot]]
 
|compatible={{UE2}}
 
}}
 
{{clear}}
 
  
 
==Source==
 
==Source==

Revision as of 16:02, 26 November 2012

This is a simple commandlet to add and remove a specified editpackage for the use in Batch files when you are not using an IDE.

Source

// Coded by Eliot Van Uytfanghe.
Class EditPackagesCommandlet Extends Commandlet;
 
event int Main( string Parms )
{
	local bool bAdd;
	local string PackageName;
	local int i;
 
	Log( Parms, Name );
	bAdd = Left( Parms, 1 ) == "1";
	PackageName = Mid( Parms, 2 );
	if( bAdd )
	{
		Log( "Adding" @ PackageName, Name );
		Class'EditorEngine'.Default.EditPackages[Class'EditorEngine'.Default.EditPackages.Length] = PackageName;
		Class'EditorEngine'.Static.StaticSaveConfig();
	}
	else
	{
		Log( "Removing" @ PackageName, Name );
		for( i = 0; i < Class'EditorEngine'.Default.EditPackages.Length; ++ i )
		{
			if( Class'EditorEngine'.Default.EditPackages[i] ~= PackageName )
			{
				Class'EditorEngine'.Default.EditPackages.Remove( i, 1 );
				break;
			}
		}
		Class'EditorEngine'.Static.StaticSaveConfig();
	}
}

Usage

@echo off
title Compiling %1%
cd..
cd System
echo ----------------------------------------------------
echo Deleting compiled files of %1%
echo ----------------------------------------------------
del %1%.u
del %1%.ucl
del %1%.int
echo ----------------------------------------------------
echo Compiling!
echo ----------------------------------------------------
ucc.exe EditPackagesCommandlet 1 %1%
ucc.exe MakeCommandlet -EXPORTCACHE
ucc.exe EditPackagesCommandlet 0 %1%
ucc.exe DumpIntCommandlet %1%.u
pause