本文整理汇总了C#中Root.RestoreConfig方法的典型用法代码示例。如果您正苦于以下问题:C# Root.RestoreConfig方法的具体用法?C# Root.RestoreConfig怎么用?C# Root.RestoreConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Root
的用法示例。
在下文中一共展示了Root.RestoreConfig方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialise
public void Initialise()
{
Root = new Root();
ConfigFile cf = new ConfigFile();
cf.Load("Resources.cfg", "\t:=", true);
ConfigFile.SectionIterator seci = cf.GetSectionIterator();
while (seci.MoveNext())
{
ConfigFile.SettingsMultiMap settings = seci.Current;
foreach (KeyValuePair<string, string> pair in settings)
ResourceGroupManager.Singleton.AddResourceLocation(pair.Value, pair.Key, seci.CurrentKey);
}
if (!Root.RestoreConfig())
if (!Root.ShowConfigDialog())
return;
Root.RenderSystem.SetConfigOption("VSync", "Yes");
RenderWindow = Root.Initialise(true, "WorldCreator"); // @@@@@@@@@@@@@@@ Nazwa okna gry.
ResourceGroupManager.Singleton.InitialiseAllResourceGroups();
SceneManager = Root.CreateSceneManager(SceneType.ST_GENERIC);
Camera = SceneManager.CreateCamera("MainCamera");
Viewport = RenderWindow.AddViewport(Camera);
Camera.NearClipDistance = 0.1f;
Camera.FarClipDistance = 1000.0f;
Camera.AspectRatio = ((float)RenderWindow.Width / (float)RenderWindow.Height);
MOIS.ParamList pl = new MOIS.ParamList();
IntPtr windowHnd;
RenderWindow.GetCustomAttribute("WINDOW", out windowHnd);
pl.Insert("WINDOW", windowHnd.ToString());
InputManager = MOIS.InputManager.CreateInputSystem(pl);
Keyboard = (MOIS.Keyboard)InputManager.CreateInputObject(MOIS.Type.OISKeyboard, false);
Mouse = (MOIS.Mouse)InputManager.CreateInputObject(MOIS.Type.OISMouse, false);
NewtonWorld = new World();
NewtonDebugger = new Debugger(NewtonWorld);
NewtonDebugger.Init(SceneManager);
ObjectManager = new ObjectManager();
MaterialManager = new MaterialManager();
MaterialManager.Initialise();
//CharacterProfileManager = new CharacterProfileManager();
Items = new Items();
//PrizeManager = new PrizeManager(); //////////////////// @@ Brand nju staff. Nawet trochę działa :Δ
//Quests = new Quests();
//NPCManager = new NPCManager();
Labeler = new TextLabeler(5);
User = new Player();
CharacterProfileManager = new CharacterProfileManager();
NPCManager = new NPCManager();
HumanController = new HumanController();
TypedInput = new TypedInput();
//SoundManager = new SoundManager();
}
示例2: Initialise
public void Initialise()
{
Root = new Root();
ConfigFile cf = new ConfigFile();
cf.Load("Resources.cfg", "\t:=", true);
ConfigFile.SectionIterator seci = cf.GetSectionIterator();
while (seci.MoveNext())
{
ConfigFile.SettingsMultiMap settings = seci.Current;
foreach (KeyValuePair<string, string> pair in settings)
ResourceGroupManager.Singleton.AddResourceLocation(pair.Value, pair.Key, seci.CurrentKey);
}
if (!Root.RestoreConfig())
if (!Root.ShowConfigDialog())
return;
Root.RenderSystem.SetConfigOption("VSync", "Yes");
RenderWindow = Root.Initialise(true, "Kolejny epicki erpeg"); // @@@@@@@@@@@@@@@ Nazwa okna gry.
ResourceGroupManager.Singleton.InitialiseAllResourceGroups();
SceneManager = Root.CreateSceneManager(SceneType.ST_GENERIC);
Camera = SceneManager.CreateCamera("MainCamera");
Viewport = RenderWindow.AddViewport(Camera);
Camera.NearClipDistance = 0.1f;
Camera.FarClipDistance = 1000.0f;
Camera.AspectRatio = ((float)RenderWindow.Width / (float)RenderWindow.Height);
MOIS.ParamList pl = new MOIS.ParamList();
IntPtr windowHnd;
RenderWindow.GetCustomAttribute("WINDOW", out windowHnd);
pl.Insert("WINDOW", windowHnd.ToString());
InputManager = MOIS.InputManager.CreateInputSystem(pl);
Keyboard = (MOIS.Keyboard)InputManager.CreateInputObject(MOIS.Type.OISKeyboard, true);
Mouse = (MOIS.Mouse)InputManager.CreateInputObject(MOIS.Type.OISMouse, true);
NewtonWorld = new World();
NewtonDebugger = new Debugger(NewtonWorld);
NewtonDebugger.Init(SceneManager);
GameCamera = new GameCamera();
ObjectManager = new ObjectManager();
MaterialManager = new MaterialManager();
MaterialManager.Initialise();
Items = new Items();
PrizeManager = new PrizeManager(); //////////////////// @@ Brand nju staff. Nawet trochę działa :Δ
CharacterProfileManager = new CharacterProfileManager();
Quests = new Quests();
NPCManager = new NPCManager();
Labeler = new TextLabeler(5);
Random = new Random();
HumanController = new HumanController();
TypedInput = new TypedInput();
SoundManager = new SoundManager();
Dialog = new Dialog();
Mysz = new MOIS.MouseState_NativePtr();
Conversations = new Conversations();
TriggerManager = new TriggerManager();
Engine.Singleton.Keyboard.KeyPressed += new MOIS.KeyListener.KeyPressedHandler(TypedInput.onKeyPressed);
Mouse.MouseReleased += new MOIS.MouseListener.MouseReleasedHandler(MouseReleased);
IngameConsole = new IngameConsole();
IngameConsole.Init();
IngameConsole.AddCommand("dupa", "soundOddawajPiec");
IngameConsole.AddCommand("tp", "ZejscieDoPiwnicy");
IngameConsole.AddCommand("exit", "Exit", "Wychodzi z gry. Ale odkrywcze. Super. Musze sprawdzic jak sie zachowa konsola przy duzej dlugosci linii xD llllllllllllllllllllllllllllllllllllllllllllmmmmmmmmmmmmmmmmmmmmmiiiiiiiiiiiiiiii");
IngameConsole.AddCommand("play", "playSound", "Odtwarza dzwiek. Skladnia: play <sciezka do pliku>. Np. play other/haa.mp3");
IngameConsole.AddCommand("map", "ChangeMap");
IngameConsole.AddCommand("save", "SaveGame");
IngameConsole.AddCommand("load", "LoadGame");
IngameConsole.AddCommand("help", "ConsoleHelp");
IngameConsole.AddCommand("h", "CommandHelp");
}
示例3: CreateWindow
/// <summary>
/// Creates the window.
/// </summary>
/// <param name="root">The root.</param>
protected virtual void CreateWindow(Root root)
{
Configuration config = Configuration;
RenderWindow window;
if (Configuration.Ogre.UseOgreConfig) {
if (!root.RestoreConfig()) {
if (!root.ShowConfigDialog()) {
Console.WriteLine("Could not show the config dialog for Ogre");
Exit();
return;
}
root.SaveConfig();
}
window = root.Initialize(true, Configuration.Game.Name);
} else {
if (config.Ogre.RenderWindowParameters != null) {
Dictionary<string, string> parameters = config.Ogre.RenderWindowParameters.ToDictionary(
item => item.Name,
item => item.Value);
window = root.CreateRenderWindow(
"OgreRoot",
config.Screen.Width,
config.Screen.Height,
config.Screen.Fullscreen,
new RenderWindowParameters(parameters));
} else {
window = root.CreateRenderWindow(
"OgreRoot",
config.Screen.Width,
config.Screen.Height,
config.Screen.Fullscreen);
}
}
Variables.Ogre.RenderWindow = window;
}
示例4: Initialise
public void Initialise()
{
m_Root = new Root();
ConfigFile cf = new ConfigFile();
cf.Load("Resources.cfg", "\t:=", true);
ConfigFile.SectionIterator seci = cf.GetSectionIterator();
while (seci.MoveNext())
{
ConfigFile.SettingsMultiMap settings = seci.Current;
foreach (KeyValuePair<string, string> pair in settings)
ResourceGroupManager.Singleton.AddResourceLocation(pair.Value, pair.Key, seci.CurrentKey);
}
if (!m_Root.RestoreConfig())
if (!m_Root.ShowConfigDialog())
return;
m_RenderWindow = m_Root.Initialise(true);
ResourceGroupManager.Singleton.InitialiseAllResourceGroups();
m_SceneManager = m_Root.CreateSceneManager(SceneType.ST_GENERIC);
m_Camera = m_SceneManager.CreateCamera("MainCamera");
m_Viewport = m_RenderWindow.AddViewport(m_Camera);
m_Camera.NearClipDistance = 0.1f;
m_Camera.FarClipDistance = 1000.0f;
MOIS.ParamList pl = new MOIS.ParamList();
IntPtr windowHnd;
m_RenderWindow.GetCustomAttribute("WINDOW", out windowHnd);
pl.Insert("WINDOW", windowHnd.ToString());
m_InputManager = MOIS.InputManager.CreateInputSystem(pl);
m_Keyboard = (MOIS.Keyboard)m_InputManager.CreateInputObject(MOIS.Type.OISKeyboard, false);
m_Mouse = (MOIS.Mouse)m_InputManager.CreateInputObject(MOIS.Type.OISMouse, false);
m_NewtonWorld = new World();
m_NewtonDebugger = new Debugger(m_NewtonWorld);
m_NewtonDebugger.Init(m_SceneManager);
m_GameCamera = new GameCamera();
m_ObjectManager = new ObjectManager();
}