Пример #1
0
        public override void Tick(double delta)
        {
            if (Disconnected)
            {
                return;
            }
            physics.Tick();
            CheckAsyncResources();

            if (generator == null)
            {
                return;
            }
            if (generator.Done)
            {
                EndGeneration();
            }
            else
            {
                string           state    = generator.CurrentState;
                float            progress = generator.CurrentProgress;
                LoadingMapScreen screen   = ((LoadingMapScreen)game.ActiveScreen);

                screen.SetProgress(progress);
                if (state != lastState)
                {
                    lastState = state;
                    screen.SetMessage(state);
                }
            }
        }
Пример #2
0
        public override void Tick(ScheduledTask task)
        {
            if (Disconnected)
            {
                return;
            }
            physics.Tick();
            CheckAsyncResources();

            if (generator == null)
            {
                return;
            }
            if (generator.Done)
            {
                EndGeneration(); return;
            }

            string           state    = generator.CurrentState;
            float            progress = generator.CurrentProgress;
            LoadingMapScreen screen   = ((LoadingMapScreen)game.Gui.UnderlyingScreen);

            screen.SetProgress(progress);
            if (state == lastState)
            {
                return;
            }
            lastState = state;
            screen.SetMessage(state);
        }