1 #ifndef _SHOPKEEPER_INTERFACE__H_ 2 #define _SHOPKEEPER_INTERFACE__H_ 3 4 #include "Arms_Dealer.h" 5 #include "Item_Types.h" 6 #include "JA2Types.h" 7 #include "MessageBoxScreen.h" 8 #include "ScreenIDs.h" 9 10 #include <string_theory/string> 11 12 13 //Enums used for when the user clicks on an item and the item goes to.. 14 enum 15 { 16 ARMS_DEALER_INVENTORY, 17 ARMS_DEALER_OFFER_AREA, 18 PLAYERS_OFFER_AREA, 19 PLAYERS_INVENTORY, 20 }; 21 22 #define ARMS_INV_ITEM_SELECTED 0x00000001 // The item has been placed into the offer area 23 //#define ARMS_INV_PLAYERS_ITEM_SELECTED 0x00000002 // The source location for the item has been selected 24 #define ARMS_INV_PLAYERS_ITEM_HAS_VALUE 0x00000004 // The Players item is worth something to this dealer 25 //#define ARMS_INV_ITEM_HIGHLIGHTED 0x00000008 // If the items is highlighted 26 #define ARMS_INV_ITEM_NOT_REPAIRED_YET 0x00000010 // The item is in for repairs but not repaired yet 27 #define ARMS_INV_ITEM_REPAIRED 0x00000020 // The item is repaired 28 #define ARMS_INV_JUST_PURCHASED 0x00000040 // The item was just purchased 29 #define ARMS_INV_PLAYERS_ITEM_HAS_BEEN_EVALUATED 0x00000080 // The Players item has been evaluated 30 31 32 struct INVENTORY_IN_SLOT 33 { 34 BOOLEAN fActive; 35 INT16 sItemIndex; 36 UINT32 uiFlags; 37 OBJECTTYPE ItemObject; 38 UINT8 ubLocationOfObject; //An enum value for the location of the item 39 // ( either in the arms dealers inventory, one of the 40 // offer areas or in the users inventory) 41 INT8 bSlotIdInOtherLocation; 42 43 UINT8 ubIdOfMercWhoOwnsTheItem; 44 UINT32 uiItemPrice; //Only used for the players item that have been evaluated 45 46 INT16 sSpecialItemElement; // refers to which special item element an item in a dealer's inventory area 47 // occupies. -1 Means the item is "perfect" and has no associated special item. 48 }; 49 50 51 enum 52 { 53 SKI_DIRTY_LEVEL0, // no redraw 54 SKI_DIRTY_LEVEL1, // redraw only items 55 SKI_DIRTY_LEVEL2, // redraw everything 56 }; 57 58 extern UINT8 gubSkiDirtyLevel; 59 60 extern const OBJECTTYPE *gpHighLightedItemObject; 61 62 63 extern INVENTORY_IN_SLOT gMoveingItem; 64 65 66 extern OBJECTTYPE *pShopKeeperItemDescObject; 67 68 69 void ShopKeeperScreenInit(void); 70 ScreenID ShopKeeperScreenHandle(void); 71 void ShopKeeperScreenShutdown(void); 72 73 74 void EnterShopKeeperInterfaceScreen( UINT8 ubArmsDealer ); 75 76 77 void DrawHatchOnInventory(SGPVSurface* dst, UINT16 usPosX, UINT16 usPosY, UINT16 usWidth, UINT16 usHeight); 78 BOOLEAN ShouldSoldierDisplayHatchOnItem( UINT8 ubProfileID, INT16 sSlotNum ); 79 void ConfirmToDeductMoneyFromPlayersAccountMessageBoxCallBack(MessageBoxReturnValue); 80 void ConfirmDontHaveEnoughForTheDealerMessageBoxCallBack(MessageBoxReturnValue); 81 82 void SetSkiCursor( UINT16 usCursor ); 83 84 void InitShopKeeperSubTitledText(const ST::string& str); 85 86 void AddItemToPlayersOfferAreaAfterShopKeeperOpen( OBJECTTYPE *pItemObject, INT8 bPreviousInvPos ); 87 88 void BeginSkiItemPointer( UINT8 ubSource, INT8 bSlotNum, BOOLEAN fOfferToDealerFirst ); 89 90 void DeleteShopKeeperItemDescBox(void); 91 92 BOOLEAN CanMercInteractWithSelectedShopkeeper(const SOLDIERTYPE* s); 93 94 void RestrictSkiMouseCursor(void); 95 96 void DoSkiMessageBox(const ST::string& str, ScreenID uiExitScreen, MessageBoxFlags ubFlags, MSGBOX_CALLBACK ReturnCallback); 97 void StartSKIDescriptionBox(void); 98 99 #endif 100