Skip to content

Commit

Permalink
Remove GameStateProvider as dependency of TextInputDialog
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanmoffat committed Apr 19, 2022
1 parent 55b90c2 commit d12b7a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
8 changes: 2 additions & 6 deletions EndlessClient/Dialogs/Factories/TextInputDialogFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,16 @@ namespace EndlessClient.Dialogs.Factories
[AutoMappedType]
public class TextInputDialogFactory : ITextInputDialogFactory
{
private readonly IGameStateProvider _gameStateProvider;
private readonly INativeGraphicsManager _nativeGraphicsManager;
private readonly IEODialogButtonService _eoDialogButtonService;
private readonly IKeyboardDispatcherRepository _keyboardDispatcherRepository;
private readonly IContentProvider _contentProvider;

public TextInputDialogFactory(IGameStateProvider gameStateProvider,
INativeGraphicsManager nativeGraphicsManager,
public TextInputDialogFactory(INativeGraphicsManager nativeGraphicsManager,
IEODialogButtonService eoDialogButtonService,
IKeyboardDispatcherRepository keyboardDispatcherRepository,
IContentProvider contentProvider)
{
_gameStateProvider = gameStateProvider;
_nativeGraphicsManager = nativeGraphicsManager;
_eoDialogButtonService = eoDialogButtonService;
_keyboardDispatcherRepository = keyboardDispatcherRepository;
Expand All @@ -31,8 +28,7 @@ public TextInputDialogFactory(IGameStateProvider gameStateProvider,

public TextInputDialog Create(string prompt, int maxInputChars = 12)
{
return new TextInputDialog(_gameStateProvider,
_nativeGraphicsManager,
return new TextInputDialog(_nativeGraphicsManager,
_eoDialogButtonService,
_keyboardDispatcherRepository,
_contentProvider,
Expand Down
7 changes: 2 additions & 5 deletions EndlessClient/Dialogs/TextInputDialog.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
using EndlessClient.Content;
using EndlessClient.Dialogs.Services;
using EndlessClient.GameExecution;
using EndlessClient.Input;
using EOLib;
using EOLib.Graphics;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using XNAControls;

namespace EndlessClient.Dialogs
Expand All @@ -19,14 +17,13 @@ public class TextInputDialog : BaseEODialog

public string ResponseText => _inputBox.Text;

public TextInputDialog(IGameStateProvider gameStateProvider,
INativeGraphicsManager nativeGraphicsManager,
public TextInputDialog(INativeGraphicsManager nativeGraphicsManager,
IEODialogButtonService eoDialogButtonService,
IKeyboardDispatcherRepository keyboardDispatcherRepository,
IContentProvider contentProvider,
string prompt,
int maxInputChars = 12)
: base(gameStateProvider)
: base(isInGame: true)
{
_keyboardDispatcherRepository = keyboardDispatcherRepository;

Expand Down

0 comments on commit d12b7a1

Please sign in to comment.