Esempio n. 1
0
 public void Initialize()
 {
     if (ServiceHelper.IsFull)
     {
         this.CMProvider        = ServiceHelper.Get <IContentManagerProvider>();
         this.LevelManager      = ServiceHelper.Get <ILevelManager>();
         this.LevelMaterializer = ServiceHelper.Get <ILevelMaterializer>();
     }
     if (this.Animated)
     {
         if (this.animation == null)
         {
             this.animation    = this.CMProvider.CurrentLevel.Load <AnimatedTexture>("Background Planes/" + this.TextureName);
             this.Timing       = this.animation.Timing.Clone();
             this.Texture      = (Texture)this.animation.Texture;
             this.actualWidth  = this.animation.FrameWidth;
             this.actualHeight = this.animation.FrameHeight;
         }
         this.Timing.Loop = true;
         this.Timing.RandomizeStep();
         this.Size = new Vector3((float)this.actualWidth / 16f, (float)this.actualHeight / 16f, 0.125f);
     }
     else
     {
         if (this.Texture == null)
         {
             this.Texture = (Texture)this.CMProvider.CurrentLevel.Load <Texture2D>("Background Planes/" + this.TextureName);
         }
         this.Size = new Vector3((float)(this.Texture as Texture2D).Width / 16f, (float)(this.Texture as Texture2D).Height / 16f, 0.125f);
     }
     this.InitializeGroup();
 }
Esempio n. 2
0
 public ChatTextBox(IContentManagerProvider contentManagerProvider)
     : base(new Rectangle(124, 308, 440, 19),
            Constants.FontSize08,
            caretTexture: contentManagerProvider.Content.Load <Texture2D>("cursor"))
 {
     MaxChars     = 140;
     _endMuteTime = Optional <DateTime> .Empty;
 }
Esempio n. 3
0
        protected XnaGame(GraphicsDevice graphicsDevice, IContentManagerProvider contentManagerProvider)
        {
            graphicsDevice.ThrowIfNull("graphicsDevice");
            contentManagerProvider.ThrowIfNull("contentManagerProvider");

            _graphicsDevice = graphicsDevice;
            _content = contentManagerProvider.GetContentManager(graphicsDevice);
        }
Esempio n. 4
0
        protected XnaGame(GraphicsDevice graphicsDevice, IContentManagerProvider contentManagerProvider)
        {
            graphicsDevice.ThrowIfNull("graphicsDevice");
            contentManagerProvider.ThrowIfNull("contentManagerProvider");

            _graphicsDevice = graphicsDevice;
            _content        = contentManagerProvider.GetContentManager(graphicsDevice);
        }
Esempio n. 5
0
        public static void PreInitialize()
        {
            IContentManagerProvider contentManagerProvider = ServiceHelper.Get <IContentManagerProvider>();

            contentManagerProvider.Global.Load <Texture2D>("Other Textures/SCROLL/SCROLL_A");
            contentManagerProvider.Global.Load <Texture2D>("Other Textures/SCROLL/SCROLL_B");
            contentManagerProvider.Global.Load <Texture2D>("Other Textures/SCROLL/SCROLL_C");
        }
        public ChangePasswordDialog(INativeGraphicsManager nativeGraphicsManager,
                                    IGameStateProvider gameStateProvider,
                                    IContentManagerProvider contentManagerProvider,
                                    IEOMessageBoxFactory eoMessageBoxFactory,
                                    IKeyboardDispatcherProvider keyboardDispatcherProvider,
                                    IPlayerInfoProvider playerInfoProvider,
                                    IEODialogButtonService dialogButtonService)
            : base(gameStateProvider)
        {
            _eoMessageBoxFactory = eoMessageBoxFactory;
            _playerInfoProvider  = playerInfoProvider;
            var dispatcher = keyboardDispatcherProvider.Dispatcher;

            BackgroundTexture = nativeGraphicsManager.TextureFromResource(GFXTypes.PreLoginUI, 21);

            var cursorTexture = contentManagerProvider.Content.Load <Texture2D>("Cursor");

            _inputBoxes = new IXNATextBox[4];
            for (int i = 0; i < _inputBoxes.Length; ++i)
            {
                var tb = new XNATextBox(new Rectangle(198, 60 + i * 30, 137, 19), Constants.FontSize08, caretTexture: cursorTexture)
                {
                    LeftPadding = 5,
                    DefaultText = " ",
                    MaxChars    = i == 0 ? 16 : 12,
                    PasswordBox = i > 1,
                    TextColor   = ColorConstants.LightBeigeText
                };
                _inputBoxes[i] = tb;
            }

            _clickEventHandler = new TextBoxClickEventHandler(dispatcher, _inputBoxes);
            _tabEventHandler   = new TextBoxTabEventHandler(dispatcher, _inputBoxes);

            dispatcher.Subscriber = _inputBoxes[0];

            _ok = new XNAButton(
                dialogButtonService.SmallButtonSheet,
                new Vector2(157, 195),
                dialogButtonService.GetSmallDialogButtonOutSource(SmallButton.Ok),
                dialogButtonService.GetSmallDialogButtonOverSource(SmallButton.Ok));
            _ok.OnClick += OnButtonPressed;

            _cancel = new XNAButton(
                dialogButtonService.SmallButtonSheet,
                new Vector2(250, 195),
                dialogButtonService.GetSmallDialogButtonOutSource(SmallButton.Cancel),
                dialogButtonService.GetSmallDialogButtonOverSource(SmallButton.Cancel));
            _cancel.OnClick += (s, e) => Close(XNADialogResult.Cancel);

            CenterInGameView();
        }
Esempio n. 7
0
 public GlitchyRespawner(Game game, TrileInstance instance, bool soundEmitter)
   : base(game)
 {
   this.UpdateOrder = -2;
   this.DrawOrder = 10;
   this.Instance = instance;
   this.EmitOrNot = soundEmitter;
   this.TargetRenderer = ServiceHelper.Get<ITargetRenderingManager>();
   this.LightingPostProcess = ServiceHelper.Get<ILightingPostProcess>();
   this.LevelMaterializer = ServiceHelper.Get<ILevelMaterializer>();
   this.GameState = ServiceHelper.Get<IGameStateManager>();
   this.CameraManager = ServiceHelper.Get<IDefaultCameraManager>();
   this.LevelManager = ServiceHelper.Get<IGameLevelManager>();
   this.CMProvider = ServiceHelper.Get<IContentManagerProvider>();
 }
Esempio n. 8
0
 public GlitchyRespawner(Game game, TrileInstance instance, bool soundEmitter)
     : base(game)
 {
     this.UpdateOrder         = -2;
     this.DrawOrder           = 10;
     this.Instance            = instance;
     this.EmitOrNot           = soundEmitter;
     this.TargetRenderer      = ServiceHelper.Get <ITargetRenderingManager>();
     this.LightingPostProcess = ServiceHelper.Get <ILightingPostProcess>();
     this.LevelMaterializer   = ServiceHelper.Get <ILevelMaterializer>();
     this.GameState           = ServiceHelper.Get <IGameStateManager>();
     this.CameraManager       = ServiceHelper.Get <IDefaultCameraManager>();
     this.LevelManager        = ServiceHelper.Get <IGameLevelManager>();
     this.CMProvider          = ServiceHelper.Get <IContentManagerProvider>();
 }
 public ChangePasswordDialogFactory(INativeGraphicsManager nativeGraphicsManager,
                                    IGameStateProvider gameStateProvider,
                                    IContentManagerProvider contentManagerProvider,
                                    IEOMessageBoxFactory eoMessageBoxFactory,
                                    IKeyboardDispatcherProvider keyboardDispatcherProvider,
                                    IPlayerInfoProvider playerInfoProvider,
                                    IEODialogButtonService eoDialogButtonService)
 {
     _nativeGraphicsManager      = nativeGraphicsManager;
     _gameStateProvider          = gameStateProvider;
     _contentManagerProvider     = contentManagerProvider;
     _eoMessageBoxFactory        = eoMessageBoxFactory;
     _keyboardDispatcherProvider = keyboardDispatcherProvider;
     _playerInfoProvider         = playerInfoProvider;
     _eoDialogButtonService      = eoDialogButtonService;
 }
Esempio n. 10
0
 public ControlSetFactory(INativeGraphicsManager nativeGraphicsManager,
                          IEOMessageBoxFactory messageBoxFactory,
                          IHudControlsFactory hudControlsFactory,
                          IContentManagerProvider contentManagerProvider,
                          IKeyboardDispatcherProvider keyboardDispatcherProvider,
                          IConfigurationProvider configProvider,
                          ICharacterInfoPanelFactory characterInfoPanelFactory)
 {
     _nativeGraphicsManager      = nativeGraphicsManager;
     _messageBoxFactory          = messageBoxFactory;
     _hudControlsFactory         = hudControlsFactory;
     _contentManagerProvider     = contentManagerProvider;
     _keyboardDispatcherProvider = keyboardDispatcherProvider;
     _configProvider             = configProvider;
     _characterInfoPanelFactory  = characterInfoPanelFactory;
 }
 public CreateCharacterDialogFactory(INativeGraphicsManager nativeGraphicsManager,
                                     IGameStateProvider gameStateProvider,
                                     ICharacterRendererFactory characterRendererFactory,
                                     IContentManagerProvider contentManagerProvider,
                                     IKeyboardDispatcherProvider keyboardDispatcherProvider,
                                     IEOMessageBoxFactory eoMessageBoxFactory,
                                     IEODialogButtonService dialogButtonService)
 {
     _nativeGraphicsManager      = nativeGraphicsManager;
     _gameStateProvider          = gameStateProvider;
     _characterRendererFactory   = characterRendererFactory;
     _contentManagerProvider     = contentManagerProvider;
     _keyboardDispatcherProvider = keyboardDispatcherProvider;
     _eoMessageBoxFactory        = eoMessageBoxFactory;
     _dialogButtonService        = dialogButtonService;
 }
Esempio n. 12
0
 public HudPanelFactory(INativeGraphicsManager nativeGraphicsManager,
                        IContentManagerProvider contentManagerProvider,
                        IHudControlProvider hudControlProvider,
                        INewsProvider newsProvider,
                        IChatProvider chatProvider,
                        ICharacterProvider characterProvider,
                        ICharacterInventoryProvider characterInventoryProvider,
                        IExperienceTableProvider experienceTableProvider,
                        IEOMessageBoxFactory messageBoxFactory,
                        ITrainingController trainingController)
 {
     _nativeGraphicsManager      = nativeGraphicsManager;
     _contentManagerProvider     = contentManagerProvider;
     _hudControlProvider         = hudControlProvider;
     _newsProvider               = newsProvider;
     _chatProvider               = chatProvider;
     _characterProvider          = characterProvider;
     _characterInventoryProvider = characterInventoryProvider;
     _experienceTableProvider    = experienceTableProvider;
     _messageBoxFactory          = messageBoxFactory;
     _trainingController         = trainingController;
 }
Esempio n. 13
0
 public HudControlsFactory(IHudButtonController hudButtonController,
                           IHudPanelFactory hudPanelFactory,
                           IMapRendererFactory mapRendererFactory,
                           IUserInputHandlerFactory userInputHandlerFactory,
                           INativeGraphicsManager nativeGraphicsManager,
                           IGraphicsDeviceProvider graphicsDeviceProvider,
                           IClientWindowSizeProvider clientWindowSizeProvider,
                           IEndlessGameProvider endlessGameProvider,
                           ICharacterRepository characterRepository,
                           ICurrentMapStateRepository currentMapStateRepository,
                           IKeyStateRepository keyStateRepository,
                           IStatusLabelSetter statusLabelSetter,
                           IStatusLabelTextProvider statusLabelTextProvider,
                           IContentManagerProvider contentManagerProvider,
                           IHudControlProvider hudControlProvider,
                           IChatModeCalculator chatModeCalculator,
                           IExperienceTableProvider experienceTableProvider)
 {
     _hudButtonController       = hudButtonController;
     _hudPanelFactory           = hudPanelFactory;
     _mapRendererFactory        = mapRendererFactory;
     _userInputHandlerFactory   = userInputHandlerFactory;
     _nativeGraphicsManager     = nativeGraphicsManager;
     _graphicsDeviceProvider    = graphicsDeviceProvider;
     _clientWindowSizeProvider  = clientWindowSizeProvider;
     _endlessGameProvider       = endlessGameProvider;
     _characterRepository       = characterRepository;
     _currentMapStateRepository = currentMapStateRepository;
     _keyStateRepository        = keyStateRepository;
     _statusLabelSetter         = statusLabelSetter;
     _statusLabelTextProvider   = statusLabelTextProvider;
     _contentManagerProvider    = contentManagerProvider;
     _hudControlProvider        = hudControlProvider;
     _chatModeCalculator        = chatModeCalculator;
     _experienceTableProvider   = experienceTableProvider;
 }
Esempio n. 14
0
 public static void Initialize(Game game)
 {
     Components = game.Components;
     CMProvider = GetService <IContentManagerProvider>();
 }
Esempio n. 15
0
 public MovingGroupState(TrileGroup group, bool connective)
 {
   this.LevelManager = ServiceHelper.Get<ILevelManager>();
   this.CMProvider = ServiceHelper.Get<IContentManagerProvider>();
   this.Group = group;
   this.IsConnective = connective;
   this.neededTrigger = this.Path.NeedsTrigger;
   this.paused = this.neededTrigger;
   this.referenceOrigins = new Vector3[group.Triles.Count];
   this.MarkedPosition = Vector3.Zero;
   int num = 0;
   foreach (TrileInstance trileInstance in group.Triles)
   {
     this.MarkedPosition += trileInstance.Center;
     this.referenceOrigins[num++] = trileInstance.Position;
   }
   this.MarkedPosition /= (float) group.Triles.Count;
   if (!group.PhysicsInitialized)
   {
     foreach (TrileInstance instance in group.Triles)
       instance.PhysicsState = new InstancePhysicsState(instance);
     group.PhysicsInitialized = true;
   }
   this.Segments = new List<PathSegment>((IEnumerable<PathSegment>) this.Path.Segments);
   foreach (TrileInstance trileInstance in group.Triles)
     trileInstance.ForceSeeThrough = true;
   if (this.Path.EndBehavior == PathEndBehavior.Bounce)
   {
     for (int index = this.Segments.Count - 1; index >= 0; --index)
     {
       PathSegment pathSegment = this.Segments[index];
       Vector3 vector3 = index == 0 ? Vector3.Zero : this.Segments[index - 1].Destination;
       this.Segments.Add(new PathSegment()
       {
         Acceleration = pathSegment.Deceleration,
         Deceleration = pathSegment.Acceleration,
         Destination = vector3,
         Duration = pathSegment.Duration,
         JitterFactor = pathSegment.JitterFactor,
         WaitTimeOnFinish = pathSegment.WaitTimeOnStart,
         WaitTimeOnStart = pathSegment.WaitTimeOnFinish,
         Bounced = true
       });
     }
   }
   if (this.Path.SoundName != null)
   {
     try
     {
       this.eAssociatedSound = SoundEffectExtensions.EmitAt(this.CMProvider.CurrentLevel.Load<SoundEffect>("Sounds/" + this.Path.SoundName), Vector3.Zero, true, true);
     }
     catch (Exception ex)
     {
       Logger.Log("Moving groups", LogSeverity.Warning, "Could not find sound " + this.Path.SoundName);
       this.Path.SoundName = (string) null;
     }
   }
   if (this.IsConnective)
   {
     this.eConnectiveIdle = SoundEffectExtensions.EmitAt(this.CMProvider.CurrentLevel.Load<SoundEffect>("Sounds/Industrial/ConnectiveIdle"), Vector3.Zero, true, true);
     this.sConnectiveKlonk = this.CMProvider.CurrentLevel.Load<SoundEffect>("Sounds/Industrial/ConnectiveKlonk");
     this.sConnectiveStartUp = this.CMProvider.CurrentLevel.Load<SoundEffect>("Sounds/Industrial/ConnectiveStartUp");
   }
   if (!this.IsConnective)
   {
     this.attachedAOs = Enumerable.ToArray<ArtObjectInstance>(Enumerable.Where<ArtObjectInstance>((IEnumerable<ArtObjectInstance>) this.LevelManager.ArtObjects.Values, (Func<ArtObjectInstance, bool>) (x =>
     {
       int? local_0 = x.ActorSettings.AttachedGroup;
       int local_1 = group.Id;
       if (local_0.GetValueOrDefault() == local_1)
         return local_0.HasValue;
       else
         return false;
     })));
     if (this.attachedAOs.Length > 0)
       this.aoOrigins = Enumerable.ToArray<Vector3>(Enumerable.Select<ArtObjectInstance, Vector3>((IEnumerable<ArtObjectInstance>) this.attachedAOs, (Func<ArtObjectInstance, Vector3>) (x => x.Position)));
     this.attachedPlanes = Enumerable.ToArray<BackgroundPlane>(Enumerable.Where<BackgroundPlane>((IEnumerable<BackgroundPlane>) this.LevelManager.BackgroundPlanes.Values, (Func<BackgroundPlane, bool>) (x =>
     {
       int? local_0 = x.AttachedGroup;
       int local_1 = group.Id;
       if (local_0.GetValueOrDefault() == local_1)
         return local_0.HasValue;
       else
         return false;
     })));
     if (this.attachedPlanes.Length > 0)
       this.planeOrigins = Enumerable.ToArray<Vector3>(Enumerable.Select<BackgroundPlane, Vector3>((IEnumerable<BackgroundPlane>) this.attachedPlanes, (Func<BackgroundPlane, Vector3>) (x => x.Position)));
   }
   else
   {
     foreach (TrileInstance trileInstance in this.Group.Triles)
       trileInstance.ForceClampToGround = true;
   }
   this.Enabled = true;
   this.Silent = true;
   this.Reset();
   this.StartNewSegment();
   this.Silent = false;
   this.sinceSegmentStarted -= TimeSpan.FromSeconds((double) this.Path.OffsetSeconds);
 }
Esempio n. 16
0
 protected TimedXnaGame(GraphicsDevice graphicsDevice, IContentManagerProvider contentManagerProvider)
     : base(graphicsDevice, contentManagerProvider)
 {
 }
 protected TimedXnaGame(GraphicsDevice graphicsDevice, IContentManagerProvider contentManagerProvider)
     : base(graphicsDevice, contentManagerProvider)
 {
 }
Esempio n. 18
0
 public void Initialize()
 {
   if (ServiceHelper.IsFull)
   {
     this.CMProvider = ServiceHelper.Get<IContentManagerProvider>();
     this.LevelManager = ServiceHelper.Get<ILevelManager>();
     this.LevelMaterializer = ServiceHelper.Get<ILevelMaterializer>();
   }
   if (this.Animated)
   {
     if (this.animation == null)
     {
       this.animation = this.CMProvider.CurrentLevel.Load<AnimatedTexture>("Background Planes/" + this.TextureName);
       this.Timing = this.animation.Timing.Clone();
       this.Texture = (Texture) this.animation.Texture;
       this.actualWidth = this.animation.FrameWidth;
       this.actualHeight = this.animation.FrameHeight;
     }
     this.Timing.Loop = true;
     this.Timing.RandomizeStep();
     this.Size = new Vector3((float) this.actualWidth / 16f, (float) this.actualHeight / 16f, 0.125f);
   }
   else
   {
     if (this.Texture == null)
       this.Texture = (Texture) this.CMProvider.CurrentLevel.Load<Texture2D>("Background Planes/" + this.TextureName);
     this.Size = new Vector3((float) (this.Texture as Texture2D).Width / 16f, (float) (this.Texture as Texture2D).Height / 16f, 0.125f);
   }
   this.InitializeGroup();
 }
Esempio n. 19
0
 public ChatBubbleTextureProvider(IContentManagerProvider contentManagerProvider)
 {
     _contentManagerProvider = contentManagerProvider;
     _chatBubbleTextures     = new Dictionary <ChatBubbleTexture, Texture2D>();
 }