protected override void LoadContent() { base.LoadContent(); MyraEnvironment.Game = this; Desktop = new Desktop(); /* MyraEnvironment.DisableClipping = true; * MyraEnvironment.DrawFocusedWidgetFrame = true; * MyraEnvironment.DrawWidgetsFrames = true;*/ CompilerParams.Verbose = true; var compiler = new Compiler(); TJ.Module = compiler.Process(Path.Combine(Files.ExecutableFolder, DataPath)); if (StartGameIndex == null) { SwitchToMainMenu(); } else { if (!Slot.Exists(StartGameIndex.Value)) { TJ.LogInfo("Slot {0} isn't used", StartGameIndex.Value); SwitchToMainMenu(); } else { Play(StartGameIndex.Value); } } }
public void Play(int slotIndex) { if (TJ.Player != null) { TJ.Player.Stats.Life.Changed -= Life_Changed; } TJ.Session = new GameSession(slotIndex); TJ.Player.Stats.Life.Changed += Life_Changed; SwitchTo <GameView>(); var gameView = (GameView)Desktop.Root; Desktop.FocusedKeyboardWidget = gameView; TJ.Session.MapNavigationBase = gameView.MapNavigation; TJ.Session.UpdateTilesVisibility(); UpdateStats(); TJ.GameLog("Welcome to 'Troubles of Jord' version {0}.", TJ.Version); }