Implements global tech modification function. Fixes #1358, refs #1520.

Applies tech modifications to template data returned by GuiInterface.
Extends engine to load arbitrary global scripts, separates this from RNG
replacement. Refs #1193.
Loads global scripts for most script contexts for consistency.
Adds simulation tests for global scripts.

This was SVN commit r12056.
This commit is contained in:
historic_bruno
2012-07-03 02:16:45 +00:00
parent db943341a8
commit 99d04e93bb
14 changed files with 195 additions and 111 deletions
+10 -1
View File
@@ -98,7 +98,16 @@ public:
JSContext* GetContext() const;
JSRuntime* GetRuntime() const;
void ReplaceNondeterministicFunctions(boost::rand48& rng);
/**
* Load global scripts that most script contexts need,
* located in the /globalscripts directory. VFS must be initialized.
*/
bool LoadGlobalScripts();
/**
* Replace the default JS random number geenrator with a seeded, network-sync'd one.
*/
bool ReplaceNondeterministicRNG(boost::rand48& rng);
/**
* Call a constructor function, equivalent to JS "new ctor(arg)".