Пример #1
0
        void CreateNewGame()
        {
            gameSettings = new ECSLib.NewGameSettings
            {
                GameName   = ImGuiSDL2CSHelper.StringFromBytes(_nameInputBuffer),
                MaxSystems = _maxSystems,
                SMPassword = ImGuiSDL2CSHelper.StringFromBytes(_smPassInputbuffer),
                //DataSets = options.SelectedModList.Select(dvi => dvi.Directory),
                CreatePlayerFaction   = true,
                DefaultFactionName    = ImGuiSDL2CSHelper.StringFromBytes(_factionInputBuffer),
                DefaultPlayerPassword = ImGuiSDL2CSHelper.StringFromBytes(_passInputBuffer),
                DefaultSolStart       = true,
                MasterSeed            = _masterSeed
            };

            _state.Game = new ECSLib.Game(gameSettings);
            //_state.LoadedWindows.Add(new TimeControl(_state));
            //_state.LoadedWindows.Remove(this);
            ECSLib.FactionVM factionVM = new ECSLib.FactionVM(_state.Game);
            _state.FactionUIState = factionVM;

            factionVM.CreateDefaultFaction(ImGuiSDL2CSHelper.StringFromBytes(_factionInputBuffer), ImGuiSDL2CSHelper.StringFromBytes(_passInputBuffer));

            _state.SetFaction(factionVM.FactionEntity);
            //_state.MapRendering.SetSystem(factionVM.KnownSystems[0]);
            //_state.MapRendering.SetSystem(factionVM);
            _state.SetActiveSystem(factionVM.KnownSystems[0].Guid);
            DebugWindow.GetInstance().SetGameEvents();
            IsActive = false;
            //we initialize window instances so that they get always displayed and automatically open after new game is created.
            TimeControl.GetInstance().IsActive            = true;
            ToolBarUI.GetInstance().IsActive              = true;
            EntityUIWindowSelector.GetInstance().IsActive = true;
            EntityInfoPanel.GetInstance().IsActive        = true;
        }
Пример #2
0
        void CreateNewGame(string name)
        {
            gameSettings = new ECSLib.NewGameSettings
            {
                GameName   = name,
                MaxSystems = 0,
                SMPassword = "",
                //DataSets = options.SelectedModList.Select(dvi => dvi.Directory),
                CreatePlayerFaction   = true,
                DefaultFactionName    = "UEF",
                DefaultPlayerPassword = "",
                DefaultSolStart       = true,
            };

            _state.Game = new ECSLib.Game(gameSettings);
            //_state.LoadedWindows.Add(new TimeControl(_state));
            //_state.LoadedWindows.Remove(this);
            ECSLib.FactionVM factionVM = new ECSLib.FactionVM(_state.Game);
            _state.FactionUIState = factionVM;

            factionVM.CreateDefaultFaction(factionNameString, passString);

            //_state.MapRendering.SetSystem(factionVM.KnownSystems[0]);
            _state.MapRendering.SetSystem(factionVM);
            DebugWindow.GetInstance().SetGameEvents();
            IsActive = false;
            TimeControl.GetInstance().IsActive = true;
        }