Difference between revisions of "Engine.UpdateResources"

From Tomb Raider Mod Launcher Wiki
Jump to navigation Jump to search
(Created page with "== Function == <syntaxhighlight lang="javascript"> function Engine.UpdateResources(); </syntaxhighlight> === Arguments === There are no arguments to this function. === Des...")
 
 
(One intermediate revision by the same user not shown)
Line 16: Line 16:
  
 
This function doesn't return any arguments.
 
This function doesn't return any arguments.
 +
 +
=== Example ===
 +
 +
<syntaxhighlight lang="javascript">
 +
 +
// Add a handler for "refresh" to that we can update the resource cache using the chatbox.
 +
// It would be a good idea to check if the user is allowed to do so when possible.
 +
//
 +
Engine.AddCommandHandler("refresh",function(player, commandLine, command, arguments){
 +
Engine.UpdateResources();
 +
});
 +
 +
</syntaxhighlight>
  
 
== Notes ==
 
== Notes ==
  
 
The resource cache contains a list of all the resources that can be started or stopped. If you modify the resources folder you will need to call this function to update the resource cache accordingly.
 
The resource cache contains a list of all the resources that can be started or stopped. If you modify the resources folder you will need to call this function to update the resource cache accordingly.

Latest revision as of 06:57, 12 August 2014

Function

function Engine.UpdateResources();

Arguments

There are no arguments to this function.

Description

This function will update the resource cache.

Returns

This function doesn't return any arguments.

Example

// Add a handler for "refresh" to that we can update the resource cache using the chatbox.
// It would be a good idea to check if the user is allowed to do so when possible.
//
Engine.AddCommandHandler("refresh",function(player, commandLine, command, arguments){
	Engine.UpdateResources();
});

Notes

The resource cache contains a list of all the resources that can be started or stopped. If you modify the resources folder you will need to call this function to update the resource cache accordingly.