-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First pass of opening/rendering shop dialog. Todo: action for buy/sel…
…l/trade items
- Loading branch information
1 parent
499c27d
commit 4bf92a6
Showing
16 changed files
with
561 additions
and
408 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using AutomaticTypeMapper; | ||
using EndlessClient.Dialogs.Actions; | ||
using EOLib.Domain.Interact; | ||
using EOLib.Domain.NPC; | ||
using EOLib.IO.Repositories; | ||
|
||
namespace EndlessClient.Controllers | ||
{ | ||
[AutoMappedType] | ||
public class NPCInteractionController : INPCInteractionController | ||
{ | ||
private readonly IMapNPCActions _mapNpcActions; | ||
private readonly IInGameDialogActions _inGameDialogActions; | ||
private readonly IENFFileProvider _enfFileProvider; | ||
|
||
public NPCInteractionController(IMapNPCActions mapNpcActions, | ||
IInGameDialogActions inGameDialogActions, | ||
IENFFileProvider enfFileProvider) | ||
{ | ||
_mapNpcActions = mapNpcActions; | ||
_inGameDialogActions = inGameDialogActions; | ||
_enfFileProvider = enfFileProvider; | ||
} | ||
|
||
public void ShowNPCDialog(INPC npc) | ||
{ | ||
var data = _enfFileProvider.ENFFile[npc.ID]; | ||
|
||
switch(data.Type) | ||
{ | ||
case EOLib.IO.NPCType.Shop: | ||
_mapNpcActions.RequestShop(npc.Index); | ||
_inGameDialogActions.ShowShopDialog(); | ||
break; | ||
} | ||
} | ||
} | ||
|
||
public interface INPCInteractionController | ||
{ | ||
void ShowNPCDialog(INPC npc); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
using AutomaticTypeMapper; | ||
using EndlessClient.Dialogs.Services; | ||
using EndlessClient.GameExecution; | ||
using EndlessClient.HUD.Inventory; | ||
using EOLib.Domain.Character; | ||
using EOLib.Domain.Interact.Shop; | ||
using EOLib.Graphics; | ||
using EOLib.IO.Repositories; | ||
using EOLib.Localization; | ||
|
||
namespace EndlessClient.Dialogs.Factories | ||
{ | ||
[AutoMappedType] | ||
public class ShopDialogFactory : IShopDialogFactory | ||
{ | ||
private readonly INativeGraphicsManager _nativeGraphicsManager; | ||
private readonly IEOMessageBoxFactory _messageBoxFactory; | ||
private readonly IItemTransferDialogFactory _itemTransferDialogFactory; | ||
private readonly IEODialogButtonService _dialogButtonService; | ||
private readonly IEODialogIconService _dialogIconService; | ||
private readonly ILocalizedStringFinder _localizedStringFinder; | ||
private readonly IShopDataProvider _shopDataProvider; | ||
private readonly ICharacterInventoryProvider _characterInventoryProvider; | ||
private readonly IEIFFileProvider _eifFileProvider; | ||
private readonly IInventorySpaceValidator _inventorySpaceValidator; | ||
|
||
public ShopDialogFactory(INativeGraphicsManager nativeGraphicsManager, | ||
IEOMessageBoxFactory messageBoxFactory, | ||
IItemTransferDialogFactory itemTransferDialogFactory, | ||
IEODialogButtonService dialogButtonService, | ||
IEODialogIconService dialogIconService, | ||
ILocalizedStringFinder localizedStringFinder, | ||
IShopDataProvider shopDataProvider, | ||
ICharacterInventoryProvider characterInventoryProvider, | ||
IEIFFileProvider eifFileProvider, | ||
IInventorySpaceValidator inventorySpaceValidator) | ||
{ | ||
_nativeGraphicsManager = nativeGraphicsManager; | ||
_messageBoxFactory = messageBoxFactory; | ||
_itemTransferDialogFactory = itemTransferDialogFactory; | ||
_dialogButtonService = dialogButtonService; | ||
_dialogIconService = dialogIconService; | ||
_localizedStringFinder = localizedStringFinder; | ||
_shopDataProvider = shopDataProvider; | ||
_characterInventoryProvider = characterInventoryProvider; | ||
_eifFileProvider = eifFileProvider; | ||
_inventorySpaceValidator = inventorySpaceValidator; | ||
} | ||
|
||
public ShopDialog Create() | ||
{ | ||
return new ShopDialog(_nativeGraphicsManager, | ||
_messageBoxFactory, | ||
_itemTransferDialogFactory, | ||
_dialogButtonService, | ||
_dialogIconService, | ||
_localizedStringFinder, | ||
_shopDataProvider, | ||
_characterInventoryProvider, | ||
_eifFileProvider, | ||
_inventorySpaceValidator); | ||
} | ||
} | ||
|
||
public interface IShopDialogFactory | ||
{ | ||
ShopDialog Create(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.