ShopKeeper Interface.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. #ifndef _SHOPKEEPER_INTERFACE__H_
  2. #define _SHOPKEEPER_INTERFACE__H_
  3. #include "Store Inventory.h"
  4. #define SKI_NUM_TRADING_INV_SLOTS 12
  5. #define SKI_NUM_TRADING_INV_ROWS 2
  6. #define SKI_NUM_TRADING_INV_COLS 6
  7. //Enums used for when the user clicks on an item and the item goes to..
  8. enum
  9. {
  10. ARMS_DEALER_INVENTORY,
  11. ARMS_DEALER_OFFER_AREA,
  12. PLAYERS_OFFER_AREA,
  13. PLAYERS_INVENTORY,
  14. };
  15. #define ARMS_INV_ITEM_SELECTED 0x00000001 // The item has been placed into the offer area
  16. //#define ARMS_INV_PLAYERS_ITEM_SELECTED 0x00000002 // The source location for the item has been selected
  17. #define ARMS_INV_PLAYERS_ITEM_HAS_VALUE 0x00000004 // The Players item is worth something to this dealer
  18. //#define ARMS_INV_ITEM_HIGHLIGHTED 0x00000008 // If the items is highlighted
  19. #define ARMS_INV_ITEM_NOT_REPAIRED_YET 0x00000010 // The item is in for repairs but not repaired yet
  20. #define ARMS_INV_ITEM_REPAIRED 0x00000020 // The item is repaired
  21. #define ARMS_INV_JUST_PURCHASED 0x00000040 // The item was just purchased
  22. #define ARMS_INV_PLAYERS_ITEM_HAS_BEEN_EVALUATED 0x00000080 // The Players item has been evaluated
  23. typedef struct
  24. {
  25. BOOLEAN fActive;
  26. INT16 sItemIndex;
  27. UINT32 uiFlags;
  28. OBJECTTYPE ItemObject;
  29. UINT8 ubLocationOfObject; //An enum value for the location of the item ( either in the arms dealers inventory, one of the offer areas or in the users inventory)
  30. INT8 bSlotIdInOtherLocation;
  31. UINT8 ubIdOfMercWhoOwnsTheItem;
  32. UINT32 uiItemPrice; //Only used for the players item that have been evaluated
  33. INT16 sSpecialItemElement; // refers to which special item element an item in a dealer's inventory area
  34. // occupies. -1 Means the item is "perfect" and has no associated special item.
  35. } INVENTORY_IN_SLOT;
  36. extern INVENTORY_IN_SLOT PlayersOfferArea[ SKI_NUM_TRADING_INV_SLOTS ];
  37. extern INT32 giShopKeepDialogueEventinProgress;
  38. //extern BOOLEAN gfRedrawSkiScreen;
  39. enum
  40. {
  41. SKI_DIRTY_LEVEL0, // no redraw
  42. SKI_DIRTY_LEVEL1, // redraw only items
  43. SKI_DIRTY_LEVEL2, // redraw everything
  44. };
  45. extern UINT8 gubSkiDirtyLevel;
  46. extern OBJECTTYPE *gpHighLightedItemObject;
  47. extern INVENTORY_IN_SLOT gMoveingItem;
  48. extern OBJECTTYPE *pShopKeeperItemDescObject;
  49. UINT32 ShopKeeperScreenInit( void );
  50. UINT32 ShopKeeperScreenHandle( void );
  51. UINT32 ShopKeeperScreenShutdown( void );
  52. void EnterShopKeeperInterfaceScreen( UINT8 ubArmsDealer );
  53. void DrawHatchOnInventory( UINT32 uiSurface, UINT16 usPosX, UINT16 usPosY, UINT16 usWidth, UINT16 usHeight );
  54. BOOLEAN ShouldSoldierDisplayHatchOnItem( UINT8 ubProfileID, INT16 sSlotNum );
  55. INT8 AddItemToPlayersOfferArea( UINT8 ubProfileID, INVENTORY_IN_SLOT* pInvSlot, INT8 bSlotIdInOtherLocation );
  56. void ConfirmToDeductMoneyFromPlayersAccountMessageBoxCallBack( UINT8 bExitValue );
  57. void ConfirmDontHaveEnoughForTheDealerMessageBoxCallBack( UINT8 bExitValue );
  58. void SkiHelpTextDoneCallBack( void );
  59. void SetSkiCursor( UINT16 usCursor );
  60. void InitShopKeeperSubTitledText( STR16 pString );
  61. void AddItemToPlayersOfferAreaAfterShopKeeperOpen( OBJECTTYPE *pItemObject, INT8 bPreviousInvPos );
  62. void BeginSkiItemPointer( UINT8 ubSource, INT8 bSlotNum, BOOLEAN fOfferToDealerFirst );
  63. void DeleteShopKeeperItemDescBox();
  64. BOOLEAN CanMercInteractWithSelectedShopkeeper( SOLDIERTYPE *pSoldier );
  65. void DealerGetsBribed( UINT8 ubProfileId, UINT32 uiMoneyAmount );
  66. #ifdef JA2TESTVERSION
  67. void AddShopkeeperToGridNo( UINT8 ubProfile, INT16 sGridNo );
  68. #endif
  69. void RestrictSkiMouseCursor();
  70. #endif