Пример #1
0
        /// <summary>
        /// Initiates loading for world.
        /// </summary>
        public void InitWorld()
        {
            LoadProgress = ContentLoadingProgress.InitObjects;
            if (TS1)
            {
                ((TS1ObjectProvider)WorldObjects).Init();
                WorldObjectGlobals.Init();
                LoadProgress = ContentLoadingProgress.InitArch;

                WorldWalls.InitTS1();
                WorldFloors.InitTS1();
            }
            else
            {
                ((WorldObjectProvider)WorldObjects).Init((_device != null));
                ((WorldObjectCatalog)WorldCatalog).Init(this);
                WorldObjectGlobals.Init();
                LoadProgress = ContentLoadingProgress.InitArch;

                WorldWalls.Init();
                WorldFloors.Init();
            }
            WorldRoofs.Init();
            LoadProgress = ContentLoadingProgress.Done;
        }
Пример #2
0
        public override void Update(UpdateState state)
        {
            if (LastProgress != Content.LoadProgress)
            {
                LastProgress = Content.LoadProgress;

                if (LastLabel != null)
                {
                    LastLabel.Kill();
                }
                LastLabel          = new UISimitoneLoadLabel(LoadText[(int)LastProgress]);
                LastLabel.Position = new Vector2(ScreenWidth / 2, ScreenHeight * 0.75f);
                Add(LastLabel);

                LoadProgress.OverallPercent = (float)LastProgress / (float)ContentLoadingProgress.Done;
            }
            lock (this)
            {
                if (LoadingComplete)
                {
                    GameController.EnterGameMode("", false);
                }
            }
            base.Update(state);
        }
Пример #3
0
        /// <summary>
        /// Initiates loading for world.
        /// </summary>
        public void InitWorld()
        {
            LoadProgress = ContentLoadingProgress.InitObjects;
            if (TS1)
            {
                WorldObjectGlobals.Init();
                ((TS1ObjectProvider)WorldObjects).Init();
                LoadProgress = ContentLoadingProgress.InitArch;

                WorldWalls.InitTS1();
                WorldFloors.InitTS1();
            }
            else
            {
                WorldObjectGlobals.Init();
                ((WorldObjectProvider)WorldObjects).Init((Device != null));
                ((WorldObjectCatalog)WorldCatalog).Init(this);
                LoadProgress = ContentLoadingProgress.InitArch;

                WorldWalls.Init();
                WorldFloors.Init();
                Upgrades.Init();
                if (Mode == ContentMode.SERVER)
                {
                    Upgrades.LoadJSONTuning();
                }
            }
            WorldRoofs.Init();
            LoadProgress = ContentLoadingProgress.Done;
        }
Пример #4
0
        /// <summary>
        /// Setup the content manager so it knows where to find various files.
        /// </summary>
        private void Init()
        {
            Inited = true;
            if (!TS1)
            {
                Audio.Init();
            }
            /** Scan system for files **/
            if (AllFiles == null)
            {
                LoadProgress = ContentLoadingProgress.ScanningFiles;
                var allFiles = new List <string>();
                if (Target != FSOEngineMode.TS1)
                {
                    _ScanFiles(BasePath, allFiles, BasePath);
                    AllFiles = allFiles.ToArray();
                }
            }

            var ts1AllFiles = new List <string>();
            var oldBase     = BasePath;

            if (TS1)
            {
                _ScanFiles(TS1BasePath, ts1AllFiles, TS1BasePath);
                TS1AllFiles = ts1AllFiles.ToArray();
            }

            LoadProgress = ContentLoadingProgress.InitGlobal;
            TS1Global?.Init();
            LoadProgress = ContentLoadingProgress.InitBCF;
            BCFGlobal?.Init();

            if (!TS1)
            {
                PIFFRegistry.Init(Path.Combine(FSOEnvironment.ContentDir, "Patch/"));
            }
            else
            {
                PIFFRegistry.Init(Path.Combine(FSOEnvironment.ContentDir, "TS1Patch/"));
            }

            LoadProgress = ContentLoadingProgress.InitAvatars;
            _archives    = new Dictionary <string, FAR3Archive>();
            if (Target != FSOEngineMode.TS1 && Mode == ContentMode.CLIENT)
            {
                UIGraphics.Init();
            }

            if (TS1)
            {
                ((TS1AvatarTextureProvider)AvatarTextures)?.Init();
                ((TS1BMFProvider)AvatarMeshes)?.Init();
                Jobs         = new TS1JobProvider(TS1Global);
                Neighborhood = new TS1NeighborhoodProvider(this);
            }
            else
            {
                if (Mode == ContentMode.CLIENT)
                {
                    AvatarHandgroups.Init();
                }
                AvatarBindings.Init();
                AvatarOutfits.Init();
                AvatarPurchasables.Init();
                AvatarCollections.Init();
                AvatarThumbnails.Init();
                ((AvatarTextureProvider)AvatarTextures)?.Init();
                ((AvatarAnimationProvider)AvatarAnimations).Init();
                ((AvatarSkeletonProvider)AvatarSkeletons).Init();
                ((AvatarAppearanceProvider)AvatarAppearances).Init();
                ((AvatarMeshProvider)AvatarMeshes)?.Init();
                CityMaps.Init();
                RackOutfits.Init();
                Ini.Init();
            }

            LoadProgress = ContentLoadingProgress.InitAudio;
            if (TS1)
            {
                Audio.Init();
            }

            InitWorld();
        }
Пример #5
0
        /// <summary>
        /// Creates a new instance of Content.
        /// </summary>
        /// <param name="basePath">Path to client directory.</param>
        /// <param name="device">A GraphicsDevice instance.</param>
        private GameContent(string basePath, ContentMode mode, GraphicsDevice device, bool init)
        {
            LoadProgress = ContentLoadingProgress.Started;
            BasePath     = basePath;
            _device      = device;
            Mode         = mode;

            ImageLoader.PremultiplyPNG = 1;// (FSOEnvironment.DirectX)?0:1;

            if (device != null)
            {
                RCMeshes   = new RCMeshProvider(device);
                UIGraphics = new UIGraphicsProvider(this);
                if (TS1)
                {
                    TS1Global      = new TS1Provider(this);
                    AvatarTextures = new TS1AvatarTextureProvider(TS1Global);
                    AvatarMeshes   = new TS1BMFProvider(TS1Global);
                }
                else
                {
                    AvatarTextures = new AvatarTextureProvider(this);
                    AvatarMeshes   = new AvatarMeshProvider(this, _device);
                }
                AvatarHandgroups = new HandgroupProvider(this);
                AbstractTextureRef.FetchDevice        = device;
                AbstractTextureRef.ImageFetchFunction = AbstractTextureRef.ImageFetchWithDevice;
            }
            Changes  = new ChangeManager();
            CustomUI = new CustomUIProvider(this);

            if (TS1)
            {
                var provider = new TS1ObjectProvider(this, TS1Global);
                WorldObjects      = provider;
                WorldCatalog      = provider;
                BCFGlobal         = new TS1BCFProvider(this, TS1Global);
                AvatarAnimations  = new TS1BCFAnimationProvider(BCFGlobal);
                AvatarSkeletons   = new TS1BCFSkeletonProvider(BCFGlobal);
                AvatarAppearances = new TS1BCFAppearanceProvider(BCFGlobal);
                Audio             = new TS1Audio(this);
            }
            else
            {
                AvatarBindings    = new AvatarBindingProvider(this);
                AvatarAppearances = new AvatarAppearanceProvider(this);
                AvatarOutfits     = new AvatarOutfitProvider(this);

                AvatarPurchasables = new AvatarPurchasables(this);
                AvatarCollections  = new AvatarCollectionsProvider(this);
                AvatarThumbnails   = new AvatarThumbnailProvider(this);

                AvatarAnimations = new AvatarAnimationProvider(this);
                AvatarSkeletons  = new AvatarSkeletonProvider(this);
                WorldObjects     = new WorldObjectProvider(this);
                WorldCatalog     = new WorldObjectCatalog();
                Audio            = new Audio(this);
                CityMaps         = new CityMapsProvider(this);
                RackOutfits      = new RackOutfitsProvider(this);
                Ini          = new IniProvider(this);
                GlobalTuning = new Tuning(Path.Combine(basePath, "tuning.dat"));
            }
            WorldFloors        = new WorldFloorProvider(this);
            WorldWalls         = new WorldWallProvider(this);
            WorldObjectGlobals = new WorldGlobalProvider(this);
            WorldRoofs         = new WorldRoofProvider(this);

            InitBasic();
            if (init)
            {
                Init();
            }
        }