2008-11-08 23:42:12 +00:00
|
|
|
/*
|
|
|
|
OpenMW - The completely unofficial reimplementation of Morrowind
|
|
|
|
Copyright (C) 2008 Nicolay Korslund
|
|
|
|
Email: < korslund@gmail.com >
|
|
|
|
WWW: http://openmw.snaptoad.com/
|
|
|
|
|
|
|
|
This file (object.d) is part of the OpenMW package.
|
|
|
|
|
|
|
|
OpenMW is distributed as free software: you can redistribute it
|
|
|
|
and/or modify it under the terms of the GNU General Public License
|
|
|
|
version 3, as published by the Free Software Foundation.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful, but
|
|
|
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
version 3 along with this program. If not, see
|
|
|
|
http://www.gnu.org/licenses/ .
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2009-01-22 20:36:36 +00:00
|
|
|
module mscripts.setup;
|
2008-11-07 13:14:46 +00:00
|
|
|
|
|
|
|
import monster.monster;
|
2009-01-22 20:36:36 +00:00
|
|
|
import monster.compiler.scopes : global;
|
2009-01-14 20:51:17 +00:00
|
|
|
import monster.modules.timer;
|
|
|
|
|
2008-11-14 23:02:24 +00:00
|
|
|
import core.config;
|
2009-02-08 18:41:03 +00:00
|
|
|
import ogre.gui;
|
2009-02-01 02:21:08 +00:00
|
|
|
|
|
|
|
import std.string;
|
2008-11-07 13:14:46 +00:00
|
|
|
|
|
|
|
// Set up the base Monster classes we need in OpenMW
|
|
|
|
void initMonsterScripts()
|
|
|
|
{
|
2009-01-14 20:51:17 +00:00
|
|
|
initAllModules();
|
|
|
|
setSleepMethod(SleepMethod.Timer);
|
|
|
|
|
2008-11-15 16:35:15 +00:00
|
|
|
// Add the script directories
|
2008-12-30 01:59:24 +00:00
|
|
|
vm.addPath("mscripts/");
|
|
|
|
vm.addPath("mscripts/gameobjects/");
|
|
|
|
vm.addPath("mscripts/sound/");
|
2008-11-07 13:14:46 +00:00
|
|
|
|
2009-01-22 20:36:36 +00:00
|
|
|
// Import some modules into the global scope, so we won't have to
|
|
|
|
// import them manually in each script.
|
|
|
|
global.registerImport("io", "random", "timer");
|
2008-11-07 13:14:46 +00:00
|
|
|
|
2008-12-30 01:59:24 +00:00
|
|
|
// Get the Config singleton object
|
|
|
|
config.mo = (new MonsterClass("Config")).getSing();
|
2008-11-14 23:02:24 +00:00
|
|
|
|
2009-02-08 18:41:03 +00:00
|
|
|
// Set up the GUI Monster module
|
|
|
|
setupGUIScripts();
|
2009-01-16 12:56:54 +00:00
|
|
|
|
2009-01-20 08:29:15 +00:00
|
|
|
// Run the test script
|
|
|
|
vm.run("test.mn");
|
2008-11-07 13:14:46 +00:00
|
|
|
}
|
2009-02-01 02:21:08 +00:00
|
|
|
|
2009-02-08 18:41:03 +00:00
|
|
|
// Run the GUI scripts. These should be run only after the
|
|
|
|
// GUI/rendering system has been initialized
|
|
|
|
void runGUIScripts()
|
2009-02-01 02:21:08 +00:00
|
|
|
{
|
2009-02-08 18:41:03 +00:00
|
|
|
// Create the HUD and windows
|
|
|
|
vm.run("makegui.mn");
|
2009-02-01 02:21:08 +00:00
|
|
|
|
2009-02-08 18:41:03 +00:00
|
|
|
// Run the fps ticker
|
|
|
|
vm.run("fpsticker.mn");
|
2009-02-01 02:21:08 +00:00
|
|
|
}
|