From de71a58bc452e288389113889c395eb4d68acb83 Mon Sep 17 00:00:00 2001 From: Wanne Date: Sat, 23 Feb 2013 09:45:27 +0000 Subject: [PATCH] - Externalized Florist Delivery Locations by tagging to externalized BobbyR locations (by Buggler) - Flower shipment now costs half of BobbyR's shipping rate (by Buggler) git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5867 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Laptop/BobbyRMailOrder.cpp | 10 +- Laptop/florist Order Form.cpp | 168 +++++++++++++++++++++------------- 2 files changed, 112 insertions(+), 66 deletions(-) diff --git a/Laptop/BobbyRMailOrder.cpp b/Laptop/BobbyRMailOrder.cpp index 19909791a..19e7af714 100644 --- a/Laptop/BobbyRMailOrder.cpp +++ b/Laptop/BobbyRMailOrder.cpp @@ -77,8 +77,8 @@ enum BR_DROP_DOWN_DISPLAY, }; -#define BOBBYR_ORDER_NUM_SHIPPING_CITIES 17 -#define BOBBYR_NUM_DISPLAYED_CITIES 10 +//#define BOBBYR_ORDER_NUM_SHIPPING_CITIES 17 +//#define BOBBYR_NUM_DISPLAYED_CITIES 10 #define BOBBYR_NUM_DISPLAYED_ITEMS 10 @@ -1504,7 +1504,8 @@ BOOLEAN CreateDestroyBobbyRDropDown( UINT8 ubDropDownAction ) usPosX = BOBBYR_CITY_START_LOCATION_X; usPosY = BOBBYR_CITY_START_LOCATION_Y; - for( i=0; i< BOBBYR_NUM_DISPLAYED_CITIES; i++) + //for( i=0; i< BOBBYR_NUM_DISPLAYED_CITIES; i++) + for( i=0; i< guiNumOfDisplayedCities; i++) { MSYS_DefineRegion( &gSelectedDropDownRegion[i], usPosX, (UINT16)(usPosY+4), (UINT16)(usPosX+BOBBYR_DROP_DOWN_WIDTH-6), (UINT16)(usPosY+usFontHeight+7), MSYS_PRIORITY_HIGH, CURSOR_WWW, SelectDropDownMovementCallBack, SelectDropDownRegionCallBack); @@ -2112,7 +2113,8 @@ void DrawGoldRectangle( INT8 bCityNum ) //usHeight = usTempHeight / (BOBBYR_ORDER_NUM_SHIPPING_CITIES+1); usHeight = usTempHeight / (gPostalService.LookupDestinationList().size()+1); - usPosY = usTempPosY + (UINT16)( ( ( BOBBYR_SCROLL_AREA_HEIGHT - 2 * BOBBYR_SCROLL_ARROW_HEIGHT ) / (FLOAT)(BOBBYR_ORDER_NUM_SHIPPING_CITIES +1) ) * bCityNum ); + //usPosY = usTempPosY + (UINT16)( ( ( BOBBYR_SCROLL_AREA_HEIGHT - 2 * BOBBYR_SCROLL_ARROW_HEIGHT ) / (FLOAT)(BOBBYR_ORDER_NUM_SHIPPING_CITIES +1) ) * bCityNum ); + usPosY = usTempPosY + (UINT16)( ( ( BOBBYR_SCROLL_AREA_HEIGHT - 2 * BOBBYR_SCROLL_ARROW_HEIGHT ) / (FLOAT)(gPostalService.LookupDestinationList().size()+1) ) * bCityNum ); temp = BOBBYR_SCROLL_AREA_Y + BOBBYR_SCROLL_AREA_HEIGHT - BOBBYR_SCROLL_ARROW_HEIGHT - usHeight - 1; diff --git a/Laptop/florist Order Form.cpp b/Laptop/florist Order Form.cpp index 7028a2e4f..811ed52e7 100644 --- a/Laptop/florist Order Form.cpp +++ b/Laptop/florist Order Form.cpp @@ -19,24 +19,25 @@ #include "Text.h" #include "LaptopSave.h" #include "Random.h" + #include "postalservice.h" #endif #include "meanwhile.h" -#define FLOWER_ORDEER_TINY_FONT FONT10ARIAL -#define FLOWER_ORDEER_SMALL_FONT FONT12ARIAL -#define FLOWER_ORDEER_BIG_FONT FONT12ARIAL -#define FLOWER_ORDEER_SMALL_COLOR FONT_MCOLOR_WHITE -#define FLOWER_ORDEER_LINK_COLOR FONT_MCOLOR_LTYELLOW -#define FLOWER_ORDEER_DROP_DOWN_FONT FONT12ARIAL -#define FLOWER_ORDEER_DROP_DOWN_COLOR FONT_MCOLOR_WHITE +#define FLOWER_ORDER_TINY_FONT FONT10ARIAL +#define FLOWER_ORDER_SMALL_FONT FONT12ARIAL +#define FLOWER_ORDER_BIG_FONT FONT12ARIAL +#define FLOWER_ORDER_SMALL_COLOR FONT_MCOLOR_WHITE +#define FLOWER_ORDER_LINK_COLOR FONT_MCOLOR_LTYELLOW +#define FLOWER_ORDER_DROP_DOWN_FONT FONT12ARIAL +#define FLOWER_ORDER_DROP_DOWN_COLOR FONT_MCOLOR_WHITE -#define FLOWER_ORDER_STATIC_TEXT_COLOR 76 +#define FLOWER_ORDER_STATIC_TEXT_COLOR 76 #define FLOWER_ORDER_FLOWER_BOX_X LAPTOP_SCREEN_UL_X + 7 #define FLOWER_ORDER_FLOWER_BOX_Y LAPTOP_SCREEN_WEB_UL_Y + 63 -#define FLOWER_ORDER_FLOWER_BOX_WIDTH 75 +#define FLOWER_ORDER_FLOWER_BOX_WIDTH 75 #define FLOWER_ORDER_FLOWER_BOX_HEIGHT 100 @@ -92,7 +93,7 @@ #define FLOWER_ORDER_PERSONAL_SENT_BOX_X FLOWER_ORDER_SENTIMENT_BOX_X + 5 #define FLOWER_ORDER_PERSONAL_SENT_BOX_Y FLOWER_ORDER_SENTIMENT_BOX_Y + 5 #define FLOWER_ORDER_PERSONAL_SENT_TEXT_WIDTH 457 -#define FLOWER_ORDER_PERSONAL_SENT_TEXT_HEIGHT 17//44 +#define FLOWER_ORDER_PERSONAL_SENT_TEXT_HEIGHT 17//44 #define FLOWER_ORDER_BILLING_INFO_X FLOWER_ORDER_ADDITIONAL_SERVICES_X #define FLOWER_ORDER_BILLING_INFO_Y LAPTOP_SCREEN_WEB_UL_Y + 296 - FLOWER_ORDER_SMALLER_PS_OFFSET_Y @@ -140,7 +141,7 @@ #define FLOWER_ORDER_PERSONEL_SENTIMENT_NUM_CHARS 75 #define FLOWER_ORDER_NAME_FIELD_NUM_CHARS 35 - +/* // Buggler: Externalized by tagging to BobbyR locations & shipping costs typedef struct { STR16 *psCityLoc; @@ -148,8 +149,10 @@ typedef struct UINT8 ubWhenItGetsThereCost; } FlowerOrderLocationStruct; + #define FLOWER_ORDER_NUMBER_OF_DROP_DOWN_LOCATIONS 17 +///* FlowerOrderLocationStruct FlowerOrderLocations[FLOWER_ORDER_NUMBER_OF_DROP_DOWN_LOCATIONS]={ { &pDeliveryLocationStrings[0], 20, 15}, { &pDeliveryLocationStrings[1], 95, 70}, @@ -169,6 +172,7 @@ FlowerOrderLocationStruct FlowerOrderLocations[FLOWER_ORDER_NUMBER_OF_DROP_DOWN_ { &pDeliveryLocationStrings[15], 50, 40}, { &pDeliveryLocationStrings[16], 40, 30} }; +*/ UINT32 guiDeliveryLocation; UINT32 guiFlowerFrame; @@ -246,10 +250,16 @@ void SelectFloristDisableDropDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iR //mouse region for the drop down city location area -MOUSE_REGION gSelectedFlowerDropDownRegion[ FLOWER_ORDER_NUMBER_OF_DROP_DOWN_LOCATIONS ]; +//MOUSE_REGION gSelectedFlowerDropDownRegion[ FLOWER_ORDER_NUMBER_OF_DROP_DOWN_LOCATIONS ]; +MOUSE_REGION *gSelectedFlowerDropDownRegion; void SelectFlowerDropDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason ); void SelectFlowerDropDownMovementCallBack(MOUSE_REGION * pRegion, INT32 iReason ); +//Dealtar's Airport Externalization. +BOOLEAN gfFlowerInitialized = 0; +extern UINT8 guiNumOfDisplayedCities; +extern vector < PDestinationStruct > gDestinationTable; +extern CPostalService gPostalService; //to select typing in the personal sentiment box //MOUSE_REGION gSelectedFloristPersonalSentimentBoxRegion; @@ -397,9 +407,9 @@ BOOLEAN EnterFloristOrderForm() MSYS_SetRegionUserData( &gSelectedFloristCheckBoxRegion[i], 0, i ); i++; - usPosX = StringPixLength( sOrderFormText[FLORIST_ORDER_SELECT_FROM_OURS], FLOWER_ORDEER_SMALL_FONT) + 2 + FLOWER_ORDER_LINK_TO_CARD_GALLERY_X; - usWidth = StringPixLength( sOrderFormText[FLORIST_ORDER_STANDARDIZED_CARDS], FLOWER_ORDEER_SMALL_FONT); - usHeight = GetFontHeight(FLOWER_ORDEER_SMALL_FONT); + usPosX = StringPixLength( sOrderFormText[FLORIST_ORDER_SELECT_FROM_OURS], FLOWER_ORDER_SMALL_FONT) + 2 + FLOWER_ORDER_LINK_TO_CARD_GALLERY_X; + usWidth = StringPixLength( sOrderFormText[FLORIST_ORDER_STANDARDIZED_CARDS], FLOWER_ORDER_SMALL_FONT); + usHeight = GetFontHeight(FLOWER_ORDER_SMALL_FONT); MSYS_DefineRegion( &gSelectedFloristCardGalleryLinkRegion, usPosX, FLOWER_ORDER_LINK_TO_CARD_GALLERY_Y, (UINT16)(usPosX + usWidth), (UINT16)(FLOWER_ORDER_LINK_TO_CARD_GALLERY_Y + usHeight), MSYS_PRIORITY_HIGH, CURSOR_WWW, MSYS_NO_CALLBACK, SelectFloristCardGalleryLinkRegionCallBack ); MSYS_AddRegion(&gSelectedFloristCardGalleryLinkRegion); @@ -537,62 +547,59 @@ void RenderFloristOrderForm() BltVideoObject(FRAME_BUFFER, hPixHandle, 0,FLOWER_ORDER_SENTIMENT_BOX_X, FLOWER_ORDER_SENTIMENT_BOX_Y, VO_BLT_SRCTRANSPARENCY,NULL); //Bouquet name, price and order number,text - DrawTextToScreen(sOrderFormText[FLORIST_ORDER_NAME_BOUQUET], FLOWER_ORDER_FLOWER_NAME_X, FLOWER_ORDER_FLOWER_NAME_Y, 0, FLOWER_ORDEER_SMALL_FONT, FLOWER_ORDER_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); - DrawTextToScreen(sOrderFormText[FLORIST_ORDER_PRICE], FLOWER_ORDER_BOUQUET_NAME_X, FLOWER_ORDER_BOUQUET_NAME_Y, 0, FLOWER_ORDEER_SMALL_FONT, FLOWER_ORDER_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); - DrawTextToScreen(sOrderFormText[FLORIST_ORDER_ORDER_NUMBER], FLOWER_ORDER_ORDER_NUM_NAME_X, FLOWER_ORDER_ORDER_NUM_NAME_Y, 0, FLOWER_ORDEER_SMALL_FONT, FLOWER_ORDER_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); + DrawTextToScreen(sOrderFormText[FLORIST_ORDER_NAME_BOUQUET], FLOWER_ORDER_FLOWER_NAME_X, FLOWER_ORDER_FLOWER_NAME_Y, 0, FLOWER_ORDER_SMALL_FONT, FLOWER_ORDER_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); + DrawTextToScreen(sOrderFormText[FLORIST_ORDER_PRICE], FLOWER_ORDER_BOUQUET_NAME_X, FLOWER_ORDER_BOUQUET_NAME_Y, 0, FLOWER_ORDER_SMALL_FONT, FLOWER_ORDER_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); + DrawTextToScreen(sOrderFormText[FLORIST_ORDER_ORDER_NUMBER], FLOWER_ORDER_ORDER_NUM_NAME_X, FLOWER_ORDER_ORDER_NUM_NAME_Y, 0, FLOWER_ORDER_SMALL_FONT, FLOWER_ORDER_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); //The flower name - usPosX = StringPixLength( sOrderFormText[FLORIST_ORDER_NAME_BOUQUET], FLOWER_ORDEER_SMALL_FONT) + 5 + FLOWER_ORDER_FLOWER_NAME_X; + usPosX = StringPixLength( sOrderFormText[FLORIST_ORDER_NAME_BOUQUET], FLOWER_ORDER_SMALL_FONT) + 5 + FLOWER_ORDER_FLOWER_NAME_X; uiStartLoc = FLOR_GALLERY_TEXT_TOTAL_SIZE * guiCurrentlySelectedFlower; LoadEncryptedDataFromFile(FLOR_GALLERY_TEXT_FILE, sTemp, uiStartLoc, FLOR_GALLERY_TEXT_TITLE_SIZE); - DrawTextToScreen( sTemp, usPosX, FLOWER_ORDER_FLOWER_NAME_Y, 0, FLOWER_ORDEER_SMALL_FONT, FLOWER_ORDEER_SMALL_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); + DrawTextToScreen( sTemp, usPosX, FLOWER_ORDER_FLOWER_NAME_Y, 0, FLOWER_ORDER_SMALL_FONT, FLOWER_ORDER_SMALL_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); - - - - //Deliverry Date - DrawTextToScreen(sOrderFormText[FLORIST_ORDER_DELIVERY_DATE], FLOWER_ORDER_ORDER_NUM_NAME_X, FLOWER_ORDER_DATE_Y, 0, FLOWER_ORDEER_BIG_FONT, FLOWER_ORDER_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); + //Delivery Date + DrawTextToScreen(sOrderFormText[FLORIST_ORDER_DELIVERY_DATE], FLOWER_ORDER_ORDER_NUM_NAME_X, FLOWER_ORDER_DATE_Y, 0, FLOWER_ORDER_BIG_FONT, FLOWER_ORDER_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); //Next day - DrawTextToScreen(sOrderFormText[FLORIST_ORDER_NEXT_DAY], FLOWER_ORDER_CHECK_BOX_0_X+FLOWER_ORDER_CHECK_WIDTH+3, FLOWER_ORDER_CHECK_BOX_0_Y+2, 0, FLOWER_ORDEER_SMALL_FONT, FLOWER_ORDEER_SMALL_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); + DrawTextToScreen(sOrderFormText[FLORIST_ORDER_NEXT_DAY], FLOWER_ORDER_CHECK_BOX_0_X+FLOWER_ORDER_CHECK_WIDTH+3, FLOWER_ORDER_CHECK_BOX_0_Y+2, 0, FLOWER_ORDER_SMALL_FONT, FLOWER_ORDER_SMALL_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); //When it get there - DrawTextToScreen(sOrderFormText[FLORIST_ORDER_GETS_THERE], FLOWER_ORDER_CHECK_BOX_1_X+FLOWER_ORDER_CHECK_WIDTH+3, FLOWER_ORDER_CHECK_BOX_1_Y+2, 0, FLOWER_ORDEER_SMALL_FONT, FLOWER_ORDEER_SMALL_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); + DrawTextToScreen(sOrderFormText[FLORIST_ORDER_GETS_THERE], FLOWER_ORDER_CHECK_BOX_1_X+FLOWER_ORDER_CHECK_WIDTH+3, FLOWER_ORDER_CHECK_BOX_1_Y+2, 0, FLOWER_ORDER_SMALL_FONT, FLOWER_ORDER_SMALL_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); //Deliverry locatiuon - DrawTextToScreen(sOrderFormText[FLORIST_ORDER_DELIVERY_LOCATION], FLOWER_ORDER_ORDER_NUM_NAME_X, FLOWER_ORDER_LOCATION_Y, 0, FLOWER_ORDEER_BIG_FONT, FLOWER_ORDER_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); + DrawTextToScreen(sOrderFormText[FLORIST_ORDER_DELIVERY_LOCATION], FLOWER_ORDER_ORDER_NUM_NAME_X, FLOWER_ORDER_LOCATION_Y, 0, FLOWER_ORDER_BIG_FONT, FLOWER_ORDER_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); //Additional services - DrawTextToScreen(sOrderFormText[FLORIST_ORDER_ADDITIONAL_CHARGES], FLOWER_ORDER_ADDITIONAL_SERVICES_X, FLOWER_ORDER_ADDITIONAL_SERVICES_Y, 0, FLOWER_ORDEER_BIG_FONT, FLOWER_ORDER_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); + DrawTextToScreen(sOrderFormText[FLORIST_ORDER_ADDITIONAL_CHARGES], FLOWER_ORDER_ADDITIONAL_SERVICES_X, FLOWER_ORDER_ADDITIONAL_SERVICES_Y, 0, FLOWER_ORDER_BIG_FONT, FLOWER_ORDER_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); //crushed bouquet - DrawTextToScreen(sOrderFormText[FLORIST_ORDER_CRUSHED], FLOWER_ORDER_CHECK_BOX_2_X+FLOWER_ORDER_CHECK_WIDTH+3, FLOWER_ORDER_CHECK_BOX_2_Y+2, 0, FLOWER_ORDEER_SMALL_FONT, FLOWER_ORDEER_SMALL_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); + DrawTextToScreen(sOrderFormText[FLORIST_ORDER_CRUSHED], FLOWER_ORDER_CHECK_BOX_2_X+FLOWER_ORDER_CHECK_WIDTH+3, FLOWER_ORDER_CHECK_BOX_2_Y+2, 0, FLOWER_ORDER_SMALL_FONT, FLOWER_ORDER_SMALL_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); //black roses - DrawTextToScreen(sOrderFormText[FLORIST_ORDER_BLACK_ROSES], FLOWER_ORDER_CHECK_BOX_3_X+FLOWER_ORDER_CHECK_WIDTH+3, FLOWER_ORDER_CHECK_BOX_3_Y+2, 0, FLOWER_ORDEER_SMALL_FONT, FLOWER_ORDEER_SMALL_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); + DrawTextToScreen(sOrderFormText[FLORIST_ORDER_BLACK_ROSES], FLOWER_ORDER_CHECK_BOX_3_X+FLOWER_ORDER_CHECK_WIDTH+3, FLOWER_ORDER_CHECK_BOX_3_Y+2, 0, FLOWER_ORDER_SMALL_FONT, FLOWER_ORDER_SMALL_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); //wilted bouquet - DrawTextToScreen(sOrderFormText[FLORIST_ORDER_WILTED], FLOWER_ORDER_CHECK_BOX_4_X+FLOWER_ORDER_CHECK_WIDTH+3, FLOWER_ORDER_CHECK_BOX_4_Y+2, 0, FLOWER_ORDEER_SMALL_FONT, FLOWER_ORDEER_SMALL_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); + DrawTextToScreen(sOrderFormText[FLORIST_ORDER_WILTED], FLOWER_ORDER_CHECK_BOX_4_X+FLOWER_ORDER_CHECK_WIDTH+3, FLOWER_ORDER_CHECK_BOX_4_Y+2, 0, FLOWER_ORDER_SMALL_FONT, FLOWER_ORDER_SMALL_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); //fruit cake - DrawTextToScreen(sOrderFormText[FLORIST_ORDER_FRUIT_CAKE], FLOWER_ORDER_CHECK_BOX_5_X+FLOWER_ORDER_CHECK_WIDTH+3, FLOWER_ORDER_CHECK_BOX_5_Y+2, 0, FLOWER_ORDEER_SMALL_FONT, FLOWER_ORDEER_SMALL_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); + DrawTextToScreen(sOrderFormText[FLORIST_ORDER_FRUIT_CAKE], FLOWER_ORDER_CHECK_BOX_5_X+FLOWER_ORDER_CHECK_WIDTH+3, FLOWER_ORDER_CHECK_BOX_5_Y+2, 0, FLOWER_ORDER_SMALL_FONT, FLOWER_ORDER_SMALL_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); //Personal sentiment - usPosX = FLOWER_ORDER_PERSONAL_SENT_TEXT_X + StringPixLength( sOrderFormText[FLORIST_ORDER_PERSONAL_SENTIMENTS], FLOWER_ORDEER_BIG_FONT) + 5; - DrawTextToScreen(sOrderFormText[FLORIST_ORDER_PERSONAL_SENTIMENTS], FLOWER_ORDER_PERSONAL_SENT_TEXT_X, FLOWER_ORDER_PERSONAL_SENT_TEXT_Y, 0, FLOWER_ORDEER_BIG_FONT, FLOWER_ORDER_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); - DrawTextToScreen(sOrderFormText[FLORIST_ORDER_CARD_LENGTH], usPosX, FLOWER_ORDER_PERSONAL_SENT_TEXT_Y+2, 0, FLOWER_ORDEER_TINY_FONT, FLOWER_ORDEER_SMALL_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); + usPosX = FLOWER_ORDER_PERSONAL_SENT_TEXT_X + StringPixLength( sOrderFormText[FLORIST_ORDER_PERSONAL_SENTIMENTS], FLOWER_ORDER_BIG_FONT) + 5; + DrawTextToScreen(sOrderFormText[FLORIST_ORDER_PERSONAL_SENTIMENTS], FLOWER_ORDER_PERSONAL_SENT_TEXT_X, FLOWER_ORDER_PERSONAL_SENT_TEXT_Y, 0, FLOWER_ORDER_BIG_FONT, FLOWER_ORDER_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); + DrawTextToScreen(sOrderFormText[FLORIST_ORDER_CARD_LENGTH], usPosX, FLOWER_ORDER_PERSONAL_SENT_TEXT_Y+2, 0, FLOWER_ORDER_TINY_FONT, FLOWER_ORDER_SMALL_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); //Billing information - DrawTextToScreen(sOrderFormText[FLORIST_ORDER_BILLING_INFO], FLOWER_ORDER_BILLING_INFO_X, FLOWER_ORDER_BILLING_INFO_Y, 0, FLOWER_ORDEER_BIG_FONT, FLOWER_ORDER_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); + DrawTextToScreen(sOrderFormText[FLORIST_ORDER_BILLING_INFO], FLOWER_ORDER_BILLING_INFO_X, FLOWER_ORDER_BILLING_INFO_Y, 0, FLOWER_ORDER_BIG_FONT, FLOWER_ORDER_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); //Billing Name - DrawTextToScreen(sOrderFormText[FLORIST_ORDER_NAME], FLOWER_ORDER_NAME_TEXT_X, FLOWER_ORDER_NAME_TEXT_Y, FLOWER_ORDER_NAME_TEXT_WIDTH, FLOWER_ORDEER_BIG_FONT, FLOWER_ORDER_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED ); + DrawTextToScreen(sOrderFormText[FLORIST_ORDER_NAME], FLOWER_ORDER_NAME_TEXT_X, FLOWER_ORDER_NAME_TEXT_Y, FLOWER_ORDER_NAME_TEXT_WIDTH, FLOWER_ORDER_BIG_FONT, FLOWER_ORDER_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED ); //the text to link to the card gallery - DrawTextToScreen(sOrderFormText[FLORIST_ORDER_SELECT_FROM_OURS], FLOWER_ORDER_LINK_TO_CARD_GALLERY_X, FLOWER_ORDER_LINK_TO_CARD_GALLERY_Y, 0, FLOWER_ORDEER_BIG_FONT, FLOWER_ORDER_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); - usPosX = StringPixLength( sOrderFormText[FLORIST_ORDER_SELECT_FROM_OURS], FLOWER_ORDEER_SMALL_FONT) + 5 + FLOWER_ORDER_LINK_TO_CARD_GALLERY_X; - DrawTextToScreen(sOrderFormText[FLORIST_ORDER_STANDARDIZED_CARDS], usPosX, FLOWER_ORDER_LINK_TO_CARD_GALLERY_Y, 0, FLOWER_ORDEER_BIG_FONT, FLOWER_ORDEER_LINK_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); + DrawTextToScreen(sOrderFormText[FLORIST_ORDER_SELECT_FROM_OURS], FLOWER_ORDER_LINK_TO_CARD_GALLERY_X, FLOWER_ORDER_LINK_TO_CARD_GALLERY_Y, 0, FLOWER_ORDER_BIG_FONT, FLOWER_ORDER_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); + usPosX = StringPixLength( sOrderFormText[FLORIST_ORDER_SELECT_FROM_OURS], FLOWER_ORDER_SMALL_FONT) + 5 + FLOWER_ORDER_LINK_TO_CARD_GALLERY_X; + DrawTextToScreen(sOrderFormText[FLORIST_ORDER_STANDARDIZED_CARDS], usPosX, FLOWER_ORDER_LINK_TO_CARD_GALLERY_Y, 0, FLOWER_ORDER_BIG_FONT, FLOWER_ORDER_LINK_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); DisplayFloristCheckBox(); @@ -840,7 +847,7 @@ void DisplayFloristCheckBox() else BltVideoObject(FRAME_BUFFER, hPixHandle, 0, FLOWER_ORDER_CHECK_BOX_3_X, FLOWER_ORDER_CHECK_BOX_3_Y, VO_BLT_SRCTRANSPARENCY,NULL); - //Foiurth check box + //fourth check box GetVideoObject(&hPixHandle, guiFlowerOrderCheckBoxButtonImage); if( gfFLoristCheckBox4Down ) BltVideoObject(FRAME_BUFFER, hPixHandle, 1, FLOWER_ORDER_CHECK_BOX_4_X, FLOWER_ORDER_CHECK_BOX_4_Y, VO_BLT_SRCTRANSPARENCY,NULL); @@ -895,13 +902,13 @@ void DisplayFlowerDynamicItems() CleanOutControlCodesFromString(sTemp, sText); - DisplayWrappedString( (UINT16)(FLOWER_ORDER_SENTIMENT_BOX_X+10), (UINT16)(FLOWER_ORDER_SENTIMENT_BOX_Y+7), FLOWER_ORDER_PERSONAL_SENT_TEXT_WIDTH, 2, FLOWER_ORDEER_SMALL_FONT, FLOWER_ORDEER_SMALL_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED); + DisplayWrappedString( (UINT16)(FLOWER_ORDER_SENTIMENT_BOX_X+10), (UINT16)(FLOWER_ORDER_SENTIMENT_BOX_Y+7), FLOWER_ORDER_PERSONAL_SENT_TEXT_WIDTH, 2, FLOWER_ORDER_SMALL_FONT, FLOWER_ORDER_SMALL_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED); } */ //order number - usPosX = StringPixLength( sOrderFormText[FLORIST_ORDER_ORDER_NUMBER], FLOWER_ORDEER_SMALL_FONT) + 5 + FLOWER_ORDER_ORDER_NUM_NAME_X; + usPosX = StringPixLength( sOrderFormText[FLORIST_ORDER_ORDER_NUMBER], FLOWER_ORDER_SMALL_FONT) + 5 + FLOWER_ORDER_ORDER_NUM_NAME_X; swprintf(sTemp, L"%d", LaptopSaveInfo.uiFlowerOrderNumber ); - DrawTextToScreen( sTemp, usPosX, FLOWER_ORDER_ORDER_NUM_NAME_Y, 0, FLOWER_ORDEER_SMALL_FONT, FLOWER_ORDEER_SMALL_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); + DrawTextToScreen( sTemp, usPosX, FLOWER_ORDER_ORDER_NUM_NAME_Y, 0, FLOWER_ORDER_SMALL_FONT, FLOWER_ORDER_SMALL_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); guiFlowerPrice = 0; // the user selected crushed bouquet @@ -921,20 +928,22 @@ void DisplayFlowerDynamicItems() guiFlowerPrice += gubFlowerOrder_AdditioanalServicePrices[3]; //price - usPosX = StringPixLength( sOrderFormText[FLORIST_ORDER_PRICE], FLOWER_ORDEER_SMALL_FONT) + 5 + FLOWER_ORDER_BOUQUET_NAME_X; + usPosX = StringPixLength( sOrderFormText[FLORIST_ORDER_PRICE], FLOWER_ORDER_SMALL_FONT) + 5 + FLOWER_ORDER_BOUQUET_NAME_X; uiStartLoc = FLOR_GALLERY_TEXT_TOTAL_SIZE * guiCurrentlySelectedFlower + FLOR_GALLERY_TEXT_TITLE_SIZE; LoadEncryptedDataFromFile(FLOR_GALLERY_TEXT_FILE, sTemp, uiStartLoc, FLOR_GALLERY_TEXT_PRICE_SIZE); swscanf( sTemp, L"%hu", &usPrice); //if its the next day delivery if( gfFLoristCheckBox0Down ) - guiFlowerPrice += usPrice + FlowerOrderLocations[ gubCurrentlySelectedFlowerLocation ].ubNextDayDeliveryCost; + //guiFlowerPrice += usPrice + FlowerOrderLocations[ gubCurrentlySelectedFlowerLocation ].ubNextDayDeliveryCost; + guiFlowerPrice += usPrice + gPostalService.GetDestinationFee(0, gDestinationTable[gubCurrentlySelectedFlowerLocation]->usID) / 2; //else its the 'when it gets there' delivery else - guiFlowerPrice += usPrice + FlowerOrderLocations[ gubCurrentlySelectedFlowerLocation ].ubWhenItGetsThereCost; + //guiFlowerPrice += usPrice + FlowerOrderLocations[ gubCurrentlySelectedFlowerLocation ].ubWhenItGetsThereCost; + guiFlowerPrice += usPrice + gPostalService.GetDestinationFee(1, gDestinationTable[gubCurrentlySelectedFlowerLocation]->usID) / 2; swprintf( sTemp, L"$%d.00 %s", guiFlowerPrice, pMessageStrings[ MSG_USDOLLAR_ABBREVIATION ] ); - DrawTextToScreen( sTemp, usPosX, FLOWER_ORDER_BOUQUET_NAME_Y, 0, FLOWER_ORDEER_SMALL_FONT, FLOWER_ORDEER_SMALL_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); + DrawTextToScreen( sTemp, usPosX, FLOWER_ORDER_BOUQUET_NAME_Y, 0, FLOWER_ORDER_SMALL_FONT, FLOWER_ORDER_SMALL_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); } @@ -1028,7 +1037,7 @@ BOOLEAN CreateDestroyFlowerOrderDestDropDown( UINT8 ubDropDownMode ) UINT8 i; UINT16 usPosX, usPosY; UINT16 usTemp; - UINT16 usFontHeight = GetFontHeight( FLOWER_ORDEER_DROP_DOWN_FONT ); + UINT16 usFontHeight = GetFontHeight( FLOWER_ORDER_DROP_DOWN_FONT ); UINT8 ubTextFieldID; if( fMouseRegionsCreated ) @@ -1059,7 +1068,8 @@ BOOLEAN CreateDestroyFlowerOrderDestDropDown( UINT8 ubDropDownMode ) usPosX = FLOWER_ORDER_DROP_DOWN_CITY_START_X; usPosY = FLOWER_ORDER_DROP_DOWN_CITY_START_Y; - for( i=0; i< FLOWER_ORDER_NUMBER_OF_DROP_DOWN_LOCATIONS; i++) + //for( i=0; i< FLOWER_ORDER_NUMBER_OF_DROP_DOWN_LOCATIONS; i++) + for( i=0; i< gPostalService.LookupDestinationList().size(); i++) { MSYS_DefineRegion( &gSelectedFlowerDropDownRegion[i], usPosX, (UINT16)(usPosY+4), (UINT16)(usPosX+FLOWER_ORDER_DROP_DOWN_LOCATION_WIDTH), (UINT16)(usPosY+usFontHeight), MSYS_PRIORITY_HIGH+3, CURSOR_WWW, SelectFlowerDropDownMovementCallBack, SelectFlowerDropDownRegionCallBack); @@ -1082,7 +1092,7 @@ BOOLEAN CreateDestroyFlowerOrderDestDropDown( UINT8 ubDropDownMode ) KillTextInputMode(); //disable the clear order and accept order buttons, (their rendering interferes with the drop down graphics) - } + } break; case FLOWER_ORDER_DROP_DOWN_DESTROY: @@ -1092,12 +1102,14 @@ BOOLEAN CreateDestroyFlowerOrderDestDropDown( UINT8 ubDropDownMode ) if( !fMouseRegionsCreated ) break; - for( i=0; i< FLOWER_ORDER_NUMBER_OF_DROP_DOWN_LOCATIONS; i++) + //for( i=0; i< FLOWER_ORDER_NUMBER_OF_DROP_DOWN_LOCATIONS; i++) + for( i=0; i< gPostalService.LookupDestinationList().size(); i++) MSYS_RemoveRegion( &gSelectedFlowerDropDownRegion[i]); //display the name on the title bar ColorFillVideoSurfaceArea( FRAME_BUFFER, FLOWER_ORDER_DROP_DOWN_LOCATION_X+3, FLOWER_ORDER_DELIVERY_LOCATION_Y+3, FLOWER_ORDER_DROP_DOWN_LOCATION_X+FLOWER_ORDER_DROP_DOWN_LOCATION_WIDTH, FLOWER_ORDER_DELIVERY_LOCATION_Y+FLOWER_ORDER_DELIVERY_LOCATION_HEIGHT-2, Get16BPPColor( FROMRGB( 0, 0, 0 ) ) ); - DrawTextToScreen( *(FlowerOrderLocations[ gubCurrentlySelectedFlowerLocation ].psCityLoc), FLOWER_ORDER_DROP_DOWN_CITY_START_X+6, FLOWER_ORDER_DROP_DOWN_CITY_START_Y+3, 0, FLOWER_ORDEER_DROP_DOWN_FONT, FLOWER_ORDEER_DROP_DOWN_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); + //DrawTextToScreen( *(FlowerOrderLocations[ gubCurrentlySelectedFlowerLocation ].psCityLoc), FLOWER_ORDER_DROP_DOWN_CITY_START_X+6, FLOWER_ORDER_DROP_DOWN_CITY_START_Y+3, 0, FLOWER_ORDER_DROP_DOWN_FONT, FLOWER_ORDER_DROP_DOWN_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); + DrawTextToScreen( (STR16)gDestinationTable[ gubCurrentlySelectedFlowerLocation ]->wstrName.c_str(), FLOWER_ORDER_DROP_DOWN_CITY_START_X+6, FLOWER_ORDER_DROP_DOWN_CITY_START_Y+3, 0, FLOWER_ORDER_DROP_DOWN_FONT, FLOWER_ORDER_DROP_DOWN_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); //enable the drop down region MSYS_DisableRegion(&gSelectedFloristDisableDropDownRegion); @@ -1108,15 +1120,15 @@ BOOLEAN CreateDestroyFlowerOrderDestDropDown( UINT8 ubDropDownMode ) //enable the text entry fields InitFlowerOrderTextInputBoxes(); - } + } break; case FLOWER_ORDER_DROP_DOWN_DISPLAY: { UINT8 i; UINT16 usPosY, usPosX; - UINT16 usFontHeight = GetFontHeight( FLOWER_ORDEER_DROP_DOWN_FONT ); - HVOBJECT hImageHandle; + UINT16 usFontHeight = GetFontHeight( FLOWER_ORDER_DROP_DOWN_FONT ); + HVOBJECT hImageHandle; //Display the background for the drop down window ColorFillVideoSurfaceArea( FRAME_BUFFER, FLOWER_ORDER_DROP_DOWN_LOCATION_X, FLOWER_ORDER_DROP_DOWN_LOCATION_Y, FLOWER_ORDER_DROP_DOWN_LOCATION_X+FLOWER_ORDER_DROP_DOWN_LOCATION_WIDTH, FLOWER_ORDER_DROP_DOWN_LOCATION_Y+usHeight, Get16BPPColor( FROMRGB( 0, 0, 0 ) ) ); @@ -1159,9 +1171,11 @@ BOOLEAN CreateDestroyFlowerOrderDestDropDown( UINT8 ubDropDownMode ) //Display the list of cities usPosY = FLOWER_ORDER_DROP_DOWN_CITY_START_Y + 3; - for( i=0; i< FLOWER_ORDER_NUMBER_OF_DROP_DOWN_LOCATIONS; i++) + //for( i=0; i< FLOWER_ORDER_NUMBER_OF_DROP_DOWN_LOCATIONS; i++) + for( i=0; i< gPostalService.LookupDestinationList().size(); i++) { - DrawTextToScreen( *(FlowerOrderLocations[i].psCityLoc), FLOWER_ORDER_DROP_DOWN_CITY_START_X+6, usPosY, 0, FLOWER_ORDEER_DROP_DOWN_FONT, FLOWER_ORDEER_DROP_DOWN_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); + //DrawTextToScreen( *(FlowerOrderLocations[i].psCityLoc), FLOWER_ORDER_DROP_DOWN_CITY_START_X+6, usPosY, 0, FLOWER_ORDER_DROP_DOWN_FONT, FLOWER_ORDER_DROP_DOWN_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); + DrawTextToScreen( (STR16)gDestinationTable[i]->wstrName.c_str(), FLOWER_ORDER_DROP_DOWN_CITY_START_X+6, usPosY, 0, FLOWER_ORDER_DROP_DOWN_FONT, FLOWER_ORDER_DROP_DOWN_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); usPosY += usFontHeight + 2; } @@ -1178,7 +1192,7 @@ BOOLEAN CreateDestroyFlowerOrderDestDropDown( UINT8 ubDropDownMode ) void FlowerOrderDrawSelectedCity( UINT8 ubNumber ) { UINT16 usPosY; - UINT16 usFontHeight = GetFontHeight( FLOWER_ORDEER_DROP_DOWN_FONT ); + UINT16 usFontHeight = GetFontHeight( FLOWER_ORDER_DROP_DOWN_FONT ); usPosY = (usFontHeight + 2) * ubNumber + FLOWER_ORDER_DROP_DOWN_CITY_START_Y; @@ -1186,7 +1200,8 @@ void FlowerOrderDrawSelectedCity( UINT8 ubNumber ) ColorFillVideoSurfaceArea( FRAME_BUFFER, FLOWER_ORDER_DROP_DOWN_CITY_START_X, usPosY+2, FLOWER_ORDER_DROP_DOWN_CITY_START_X+FLOWER_ORDER_DROP_DOWN_LOCATION_WIDTH-9, usPosY+usFontHeight+4, Get16BPPColor( FROMRGB( 255, 255, 255 ) ) ); SetFontShadow(NO_SHADOW); - DrawTextToScreen( *(FlowerOrderLocations[ubNumber].psCityLoc), FLOWER_ORDER_DROP_DOWN_CITY_START_X+6, (UINT16)(usPosY+3), 0, FLOWER_ORDEER_DROP_DOWN_FONT, 2, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); + //DrawTextToScreen( *(FlowerOrderLocations[ubNumber].psCityLoc), FLOWER_ORDER_DROP_DOWN_CITY_START_X+6, (UINT16)(usPosY+3), 0, FLOWER_ORDER_DROP_DOWN_FONT, 2, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); + DrawTextToScreen( (STR16)gDestinationTable[ubNumber]->wstrName.c_str(), FLOWER_ORDER_DROP_DOWN_CITY_START_X+6, (UINT16)(usPosY+3), 0, FLOWER_ORDER_DROP_DOWN_FONT, 2, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); SetFontShadow(DEFAULT_SHADOW); FlowerOrderDisplayShippingLocationCity(); @@ -1199,7 +1214,8 @@ void FlowerOrderDisplayShippingLocationCity() { //display the name on the title bar ColorFillVideoSurfaceArea( FRAME_BUFFER, FLOWER_ORDER_DROP_DOWN_LOCATION_X+3, FLOWER_ORDER_DELIVERY_LOCATION_Y+3, FLOWER_ORDER_DROP_DOWN_LOCATION_X+FLOWER_ORDER_DROP_DOWN_LOCATION_WIDTH, FLOWER_ORDER_DELIVERY_LOCATION_Y+FLOWER_ORDER_DELIVERY_LOCATION_HEIGHT-2, Get16BPPColor( FROMRGB( 0, 0, 0 ) ) ); - DrawTextToScreen( *(FlowerOrderLocations[ gubCurrentlySelectedFlowerLocation ].psCityLoc), FLOWER_ORDER_DELIVERY_LOCATION_X+5, FLOWER_ORDER_DELIVERY_LOCATION_Y+5, 0, FLOWER_ORDEER_SMALL_FONT, FLOWER_ORDEER_SMALL_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); + //DrawTextToScreen( *(FlowerOrderLocations[ gubCurrentlySelectedFlowerLocation ].psCityLoc), FLOWER_ORDER_DELIVERY_LOCATION_X+5, FLOWER_ORDER_DELIVERY_LOCATION_Y+5, 0, FLOWER_ORDER_SMALL_FONT, FLOWER_ORDER_SMALL_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); + DrawTextToScreen( (STR16)gDestinationTable[ gubCurrentlySelectedFlowerLocation ]->wstrName.c_str(), FLOWER_ORDER_DELIVERY_LOCATION_X+5, FLOWER_ORDER_DELIVERY_LOCATION_Y+5, 0, FLOWER_ORDER_SMALL_FONT, FLOWER_ORDER_SMALL_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); } @@ -1282,9 +1298,11 @@ void HandleFloristOrderKeyBoardInput() SetActiveField(0); break; + /* case ESC: SetActiveField(0); break; + */ default: HandleKeyBoardShortCutsForLapTop( InputEvent.usEvent, InputEvent.usParam, InputEvent.usKeyState ); @@ -1325,4 +1343,30 @@ void InitFloristOrderForm() gsSentimentTextField[0] = 0; gsNameTextField[0] = 0; + //Dealtar's Airport Externalization. + // Update the destination and shipment tables upon entering Bobby R + if (!gDestinationTable.empty()) + { + gDestinationTable.erase(gDestinationTable.begin(), gDestinationTable.end()); + } + + RefToDestinationListIterator dli = gPostalService.LookupDestinationList().begin(); + + while (dli != gPostalService.LookupDestinationList().end()) + { + gDestinationTable.push_back(&DESTINATION(dli)); + dli++; + + } + + // Dealtar/Buggler: The following code had to be put here, because GameInitFloristOrderForm() is called + // before XML data is read into gPostalService due to the screen order in screens.cpp -> GameScreens[] + if (!gfFlowerInitialized) + { + gfFlowerInitialized = TRUE; + gSelectedFlowerDropDownRegion = new MOUSE_REGION[gPostalService.LookupDestinationList().size()]; + int x = gPostalService.LookupDestinationList().size(); + guiNumOfDisplayedCities = (x < 10) ? x : 10; + //gDestinationTable.resize(gPostalService.LookupDestinationList().size()); + } }