mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Development Trunk (now obsolete): https://ja2svn.dyndns.org/source/ja2/branches/Wanne/JA2%201.13%20MP A detailed list of all the features (changes) is visible in the history log of the development trunk: INFO: There will be no further development in the development source trunk, so is obsolete from now on! This commit contains the following features (bugfixes are not listed): - New Feature: Show merc ranks in Strategy Screen before merc name o Toggle on/off in the ingame options screen o For each experience level (0-10) there are defined rank names in the language specific text files o Additional language text that is not translated yet is marked with // TODO.Translate - New Feature: Faster Bobby Ray Shipments o This feature is selectable in the ja2_options.ini o When activated Bobby Ray shipments will be really fast -> Overnight Express: 5 - 7 hours -> Air Service: 10, 12 or 14 hours -> Standard Service: 15, 18 or 21 hours o In a multiplayer game, this feature is disabled (because shipment arrive immediately in the destination sector) - New Feature: AP cost for manipulating the merc inventory o This feature is selectable in the start new game screen o For example, putting a weapon from hand in the backpack costs APs o The AP costs are defined in the APBPConstants.ini o In a multiplayer game, this feature is disabled - New Feature: Added possibility to set individual Gear Kit names o Set individual names in the optional new tag <mGearKitName> inside the <GEARKIT> root element (File: TableData\MercStartingGear.xml) - New Feature: Externalized the maximum purchase amount (JA2 vanilla: 10) for Bobby Rays purchases per shipment o Define the max. amount in the ja2_options.ini: BOBBY_RAY_MAX_PURCHASE_AMOUNT, Range: 10 - 100) o Nice scrolling bars to scroll through all the purchases - New Feature: Now it is possible to walk on "water" tiles or handle those tiles like "normal" tiles o (instead of showing the swimming animation and counting the APs for swimming), when the soldier is located on the second level (level > 0) - New Feature: Externalized AIM Veterans laptop site o Add maximum of 4 pages o Add new AIM to veterans page, and remove AIM from veterans page. o New XML file: OldAIMArchive.xml (language specific XML files: *.OldAIMArchive.xml) - New Feature: Added possibility to choose from 254 IMP faces o Modified IMPPortraits.xml o Added new GameDir folder "IMPFaces" which contains the IMP face portraits o Moved IMP faces in the new "IMPFaces" folder - New Feature: ARSP - All Resolution Support Project o See here: http://www.ja-galaxy-forum.com/board/ubbthreads.php?ubb=showflat&Number=298698&page=1 o Support any kind of screen resolution. This works by choosing the matching full supported resolution (640x480, 800x600, 1024x768) and then centering the graphics o See ja2.ini for defining the screen resolution - New Feature: AI Turn Speed Up (FF-MOD) o see here: http://www.ja-galaxy-forum.com/board/ubbthreads.php?ubb=showflat&Number=298699#Post298699 o When this feature is activated it allows fast enemy turns o New entry in ja2.ini to enable this feature: HIGHSPEED_TIMER = TRUE o Turn on/off auto fast turns in ingame options o New ja2_options.ini settings for fine tuning: [Clock Settings] ini block - New Feature: "Lock" / "Release" mouse cursor in tactical windowed mode, so the mouse can stay within window boundary o This is very helpful for doing scrolling with the mouse (by moving the mouse to the window edge) in windowed mode o You can toggle on/off the feature by pressing CTRL + Z. It is also possible to press CTRL + Y. So the user can decide which fits better :) o Whenever you toggle on/off a screen message appears on the tactical log to notify the player - New Feature: Weapon overheating o Basically, every shot fired from a gun increases its temperature. On higher temperatures, the gun jams more frequently o On/off toggle in the ingame options o Graphical thermometer indication on the weapon picture o New ja2_options.ini section with a few options, Section: [Tactical Weapon Overheating Settings] o XML changes (New Tags) --> AmmoTypes.xml: <temperatureModificator> --> Items.xml: <barrel>, <usOverheatingCooldownFactor> --> Weapons.xml: <usOverheatingJamThreshold>, <usOverheatingDamageThreshold>, <usOverheatingSingleShotTemperature> o Added a few barells to Items.xml (end of the file) o more infos: http://www.ja-galaxy-forum.com/board/ubbthreads.php?ubb=showflat&Number=301059&page=1 - New Feature: Resting weapons on a surfaces o You can now rest your weapon on crates, low walls, rocks, debris, open windows etc. while you are crouched. Resting will give yu the superior gun handling modifiers from PRONE position. o A little 'A' on your gun indicates if you are resting it or not. o Both settings can be turned on and off in Ja2_Options.ini under 'Tactical Gameplay Settings' - New Feature: Externalized option on whether mercs can exit sector using grid exit in turn based mode o new ja2_options.ini property: GRID_EXIT_IN_TURNBASED o This ini setting does not affect leaving sectors on map edges - Rework/Update: Ammo boxes and Ammo crates o Ammo crate items added for remaining calibers. Tweaked prices to correspond to magazines, tweaked capacities and weights to be reasonable (~800 or less). o Shift-R reload now looks at both boxes and crates in sector items and merc's inventory to reload, and tops off magazines in inventory as well. Only possible outside of combat. o Ctrl-Shift-A still creates crates as per usual, with some fixes to ensure all ammo is caught on the first press. o Shift-A now creates ammo boxes in the same loop. They mostly behave like crates, but fit in mercs inventories. o Ammo boxes are available to purchase at BR and tony, sam, etc. Individual magazines/drums/etc are no longer available. o Removed ammo crate xml tag. Added ubMagType tag to Magazines array. This allows us to differentiate between magazines, bullets, boxes and crates. o Changed ammo filtering in BR's to display boxes appropriately. Added back the "Mag:" display (changed text to "Size:") o Added ja2set.dat.xml file (WF map version in WF maps folder) to be used instead of ja2set.dat file (ja2.ini setting added) For now, if you want to play vanilla instead, just change the setting in the ini (see comments in file). o Added P4-P9Items image files (up to 5k images each) and tileslots. 1.13 core items will continue to use Guns and P1-P3Items for the foreseeable future. P4-P9 can be used by customizers/modders to avoid conflicts with Guns/P1-P3 items. TODO: Need to discuss a strategy for this in the forums. o Added in Ambient/0.bad and 32.bad to avoid an exception in the code. o Updated the XML Editor o Standardized the text on all the ammo items. - New Multiplayer Feature: Sharing same FOV (field of view) in a coop/team-dm (for friendly teams) game o You will also see enemies, that your teammate sees git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5108 3b4a5df2-a311-0410-b5c6-a8a6f20db521
589 lines
20 KiB
C++
589 lines
20 KiB
C++
#ifdef PRECOMPILEDHEADERS
|
|
#include "Laptop All.h"
|
|
#include "BobbyRShipments.h"
|
|
#else
|
|
#include "laptop.h"
|
|
#include "BobbyRShipments.h"
|
|
#include "bobbyr.h"
|
|
#include "utilities.h"
|
|
#include "WCheck.h"
|
|
#include "Text.h"
|
|
#include "BobbyRGuns.h"
|
|
#include "cursors.h"
|
|
#include "BobbyRMailOrder.h"
|
|
#include "wordwrap.h"
|
|
#include "strategic.h"
|
|
#include "strategicmap.h"
|
|
#include "PostalService.h"
|
|
#endif
|
|
|
|
|
|
|
|
#define BOBBYR_SHIPMENT_TITLE_TEXT_FONT FONT14ARIAL
|
|
#define BOBBYR_SHIPMENT_TITLE_TEXT_COLOR 157
|
|
|
|
#define BOBBYR_SHIPMENT_STATIC_TEXT_FONT FONT12ARIAL
|
|
#define BOBBYR_SHIPMENT_STATIC_TEXT_COLOR 145
|
|
|
|
|
|
#define BOBBYR_BOBBY_RAY_TITLE_X LAPTOP_SCREEN_UL_X + 171
|
|
#define BOBBYR_BOBBY_RAY_TITLE_Y LAPTOP_SCREEN_WEB_UL_Y + 3
|
|
|
|
#define BOBBYR_ORDER_FORM_TITLE_X BOBBYR_BOBBY_RAY_TITLE_X
|
|
#define BOBBYR_ORDER_FORM_TITLE_Y BOBBYR_BOBBY_RAY_TITLE_Y + 37
|
|
#define BOBBYR_ORDER_FORM_TITLE_WIDTH 159
|
|
|
|
#define BOBBYR_SHIPMENT_DELIVERY_GRID_X LAPTOP_SCREEN_UL_X + 2
|
|
#define BOBBYR_SHIPMENT_DELIVERY_GRID_Y BOBBYR_SHIPMENT_ORDER_GRID_Y
|
|
#define BOBBYR_SHIPMENT_DELIVERY_GRID_WIDTH 183
|
|
|
|
#define BOBBYR_SHIPMENT_ORDER_GRID_X LAPTOP_SCREEN_UL_X + 223
|
|
#define BOBBYR_SHIPMENT_ORDER_GRID_Y LAPTOP_SCREEN_WEB_UL_Y + 62
|
|
|
|
|
|
#define BOBBYR_SHIPMENT_BACK_BUTTON_X iScreenWidthOffset + 130
|
|
#define BOBBYR_SHIPMENT_BACK_BUTTON_Y iScreenHeightOffset + 400 + LAPTOP_SCREEN_WEB_DELTA_Y + 4
|
|
|
|
#define BOBBYR_SHIPMENT_HOME_BUTTON_X iScreenWidthOffset + 515
|
|
#define BOBBYR_SHIPMENT_HOME_BUTTON_Y BOBBYR_SHIPMENT_BACK_BUTTON_Y
|
|
|
|
#define BOBBYR_SHIPMENT_NUM_PREVIOUS_SHIPMENTS 13
|
|
#define MAX_SHIPMENTS_THAT_FIT_ON_SCREEN 13
|
|
|
|
|
|
|
|
#define BOBBYR_SHIPMENT_ORDER_NUM_X iScreenWidthOffset + 116//LAPTOP_SCREEN_UL_X + 9
|
|
#define BOBBYR_SHIPMENT_ORDER_NUM_START_Y iScreenHeightOffset + 144
|
|
#define BOBBYR_SHIPMENT_ORDER_NUM_WIDTH 64
|
|
|
|
#define BOBBYR_SHIPMENT_GAP_BTN_LINES 20
|
|
|
|
|
|
#define BOBBYR_SHIPMENT_SHIPMENT_ORDER_NUM_X BOBBYR_SHIPMENT_ORDER_NUM_X
|
|
#define BOBBYR_SHIPMENT_SHIPMENT_ORDER_NUM_Y iScreenHeightOffset + 117
|
|
|
|
#define BOBBYR_SHIPMENT_NUM_ITEMS_X iScreenWidthOffset + 183//BOBBYR_SHIPMENT_ORDER_NUM_X+BOBBYR_SHIPMENT_ORDER_NUM_WIDTH+2
|
|
#define BOBBYR_SHIPMENT_NUM_ITEMS_Y BOBBYR_SHIPMENT_SHIPMENT_ORDER_NUM_Y
|
|
#define BOBBYR_SHIPMENT_NUM_ITEMS_WIDTH 116
|
|
|
|
//#define BOBBYR_SHIPMENT_
|
|
|
|
|
|
extern UINT8 gubPurchaseAtTopOfList;
|
|
extern BOOLEAN gfDrawGridArrowMouseRegions;
|
|
extern BOOLEAN gfDrawGridColumnMouseRegion;
|
|
extern MOUSE_REGION gSelectedUpDownArrowOnGridScrollAreaRegion[2];
|
|
extern void SelectUpDownArrowOnGridScrollAreaRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason );
|
|
extern MOUSE_REGION *gSelectedGridScrollColumnRegion;
|
|
extern void SelectGridScrollColumnRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason );
|
|
extern void SelectGridScrollColumnMovementCallBack(MOUSE_REGION * pRegion, INT32 iReason );
|
|
|
|
UINT32 guiBobbyRShipmentGrid;
|
|
|
|
BOOLEAN gfBobbyRShipmentsDirty = FALSE;
|
|
|
|
INT32 giBobbyRShipmentSelectedShipment = -1;
|
|
|
|
//Back Button
|
|
void BtnBobbyRShipmentBackCallback(GUI_BUTTON *btn,INT32 reason);
|
|
UINT32 guiBobbyRShipmetBack;
|
|
INT32 guiBobbyRShipmentBackImage;
|
|
|
|
//Home Button
|
|
void BtnBobbyRShipmentHomeCallback(GUI_BUTTON *btn,INT32 reason);
|
|
UINT32 guiBobbyRShipmentHome;
|
|
INT32 giBobbyRShipmentHomeImage;
|
|
|
|
|
|
|
|
MOUSE_REGION gSelectedPreviousShipmentsRegion[BOBBYR_SHIPMENT_NUM_PREVIOUS_SHIPMENTS];
|
|
void SelectPreviousShipmentsRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason );
|
|
|
|
|
|
//
|
|
// Function Prototypes
|
|
//
|
|
|
|
void DisplayShipmentGrid();
|
|
void DisplayPreviousShipments();
|
|
void DisplayShipmentTitles();
|
|
void RemovePreviousShipmentsMouseRegions();
|
|
void CreatePreviousShipmentsMouseRegions();
|
|
INT32 CountNumberValidShipmentForTheShipmentsPage();
|
|
//ppp
|
|
extern CPostalService gPostalService;
|
|
extern vector<PShipmentStruct> gShipmentTable;
|
|
extern UINT32 guiGoldArrowImages;
|
|
extern UINT32 guiBobbyROrderGrid;
|
|
//
|
|
// Function
|
|
//
|
|
|
|
void GameInitBobbyRShipments()
|
|
{
|
|
|
|
}
|
|
|
|
|
|
BOOLEAN EnterBobbyRShipments()
|
|
{
|
|
VOBJECT_DESC VObjectDesc;
|
|
|
|
InitBobbyRWoodBackground();
|
|
|
|
// load the Order Grid graphic and add it
|
|
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
|
|
FilenameForBPP("LAPTOP\\BobbyRay_OnOrder.sti", VObjectDesc.ImageFile);
|
|
CHECKF(AddVideoObject(&VObjectDesc, &guiBobbyRShipmentGrid));
|
|
|
|
// Gold Arrow for the scroll area
|
|
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
|
|
FilenameForBPP( "LAPTOP\\GoldArrows.sti", VObjectDesc.ImageFile );
|
|
CHECKF( AddVideoObject( &VObjectDesc, &guiGoldArrowImages ) );
|
|
|
|
guiBobbyRShipmentBackImage = LoadButtonImage("LAPTOP\\CatalogueButton.sti", -1,0,-1,1,-1 );
|
|
guiBobbyRShipmetBack = CreateIconAndTextButton( guiBobbyRShipmentBackImage, BobbyROrderFormText[BOBBYR_BACK], BOBBYR_GUNS_BUTTON_FONT,
|
|
BOBBYR_GUNS_TEXT_COLOR_ON, BOBBYR_GUNS_SHADOW_COLOR,
|
|
BOBBYR_GUNS_TEXT_COLOR_OFF, BOBBYR_GUNS_SHADOW_COLOR,
|
|
TEXT_CJUSTIFIED,
|
|
BOBBYR_SHIPMENT_BACK_BUTTON_X, BOBBYR_SHIPMENT_BACK_BUTTON_Y, BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
|
|
DEFAULT_MOVE_CALLBACK, BtnBobbyRShipmentBackCallback);
|
|
SetButtonCursor( guiBobbyRShipmetBack, CURSOR_LAPTOP_SCREEN);
|
|
|
|
|
|
giBobbyRShipmentHomeImage = UseLoadedButtonImage( guiBobbyRShipmentBackImage, -1,0,-1,1,-1 );
|
|
guiBobbyRShipmentHome = CreateIconAndTextButton( giBobbyRShipmentHomeImage, BobbyROrderFormText[BOBBYR_HOME], BOBBYR_GUNS_BUTTON_FONT,
|
|
BOBBYR_GUNS_TEXT_COLOR_ON, BOBBYR_GUNS_SHADOW_COLOR,
|
|
BOBBYR_GUNS_TEXT_COLOR_OFF, BOBBYR_GUNS_SHADOW_COLOR,
|
|
TEXT_CJUSTIFIED,
|
|
BOBBYR_SHIPMENT_HOME_BUTTON_X, BOBBYR_SHIPMENT_HOME_BUTTON_Y, BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
|
|
DEFAULT_MOVE_CALLBACK, BtnBobbyRShipmentHomeCallback);
|
|
SetButtonCursor( guiBobbyRShipmentHome, CURSOR_LAPTOP_SCREEN);
|
|
|
|
CreateBobbyRayOrderTitle();
|
|
|
|
giBobbyRShipmentSelectedShipment = -1;
|
|
gubPurchaseAtTopOfList = 0;
|
|
|
|
/*
|
|
//if there are shipments
|
|
if( giNumberOfNewBobbyRShipment != 0 )
|
|
{
|
|
INT32 iCnt;
|
|
|
|
// WDS - If there are more than 13 shipments only show 13 because
|
|
// that is all that will fit on the screen. If you show more things
|
|
// get corrupted.
|
|
INT32 max = giNumberOfNewBobbyRShipment;
|
|
if (max > MAX_SHIPMENTS_THAT_FIT_ON_SCREEN)
|
|
max = MAX_SHIPMENTS_THAT_FIT_ON_SCREEN;
|
|
|
|
//get the first shipment #
|
|
for( iCnt=0; iCnt<max; iCnt++ )
|
|
{
|
|
if( gpNewBobbyrShipments[iCnt].fActive )
|
|
giBobbyRShipmentSelectedShipment = iCnt;
|
|
}
|
|
}
|
|
*/
|
|
//if there are shipments
|
|
if( gShipmentTable.size() != 0 )
|
|
{
|
|
INT32 iCnt=0;
|
|
|
|
//get the first shipment #
|
|
vector<PShipmentStruct>::iterator& psi = gShipmentTable.begin();
|
|
|
|
while(psi != gShipmentTable.end())
|
|
{
|
|
if(((PShipmentStruct)*psi)->ShipmentStatus == SHIPMENT_INTRANSIT)
|
|
{
|
|
giBobbyRShipmentSelectedShipment = iCnt;
|
|
}
|
|
psi++;
|
|
iCnt++;
|
|
}
|
|
}
|
|
|
|
if (gfDrawGridArrowMouseRegions == TRUE)
|
|
{
|
|
MSYS_DisableRegion( &gSelectedUpDownArrowOnGridScrollAreaRegion[0]);
|
|
MSYS_DisableRegion( &gSelectedUpDownArrowOnGridScrollAreaRegion[1]);
|
|
MSYS_RemoveRegion( &gSelectedUpDownArrowOnGridScrollAreaRegion[0]);
|
|
MSYS_RemoveRegion( &gSelectedUpDownArrowOnGridScrollAreaRegion[1]);
|
|
gfDrawGridArrowMouseRegions = FALSE;
|
|
}
|
|
if (gfDrawGridColumnMouseRegion == TRUE)
|
|
{
|
|
MSYS_DisableRegion( gSelectedGridScrollColumnRegion);
|
|
MSYS_RemoveRegion( gSelectedGridScrollColumnRegion);
|
|
gfDrawGridColumnMouseRegion = FALSE;
|
|
}
|
|
CreatePreviousShipmentsMouseRegions();
|
|
|
|
return( TRUE );
|
|
}
|
|
|
|
void ExitBobbyRShipments()
|
|
{
|
|
DeleteBobbyRWoodBackground();
|
|
DestroyBobbyROrderTitle();
|
|
|
|
DeleteVideoObjectFromIndex(guiBobbyRShipmentGrid);
|
|
DeleteVideoObjectFromIndex(guiGoldArrowImages);
|
|
|
|
UnloadButtonImage( guiBobbyRShipmentBackImage );
|
|
UnloadButtonImage( giBobbyRShipmentHomeImage );
|
|
RemoveButton( guiBobbyRShipmetBack );
|
|
RemoveButton( guiBobbyRShipmentHome );
|
|
|
|
RemovePreviousShipmentsMouseRegions();
|
|
if (gfDrawGridArrowMouseRegions == TRUE)
|
|
{
|
|
MSYS_DisableRegion( &gSelectedUpDownArrowOnGridScrollAreaRegion[0]);
|
|
MSYS_DisableRegion( &gSelectedUpDownArrowOnGridScrollAreaRegion[1]);
|
|
MSYS_RemoveRegion( &gSelectedUpDownArrowOnGridScrollAreaRegion[0]);
|
|
MSYS_RemoveRegion( &gSelectedUpDownArrowOnGridScrollAreaRegion[1]);
|
|
gfDrawGridArrowMouseRegions = FALSE;
|
|
}
|
|
if (gfDrawGridColumnMouseRegion == TRUE)
|
|
{
|
|
MSYS_DisableRegion( gSelectedGridScrollColumnRegion);
|
|
MSYS_RemoveRegion( gSelectedGridScrollColumnRegion);
|
|
gfDrawGridColumnMouseRegion = FALSE;
|
|
}
|
|
}
|
|
|
|
void HandleBobbyRShipments()
|
|
{
|
|
if( gfBobbyRShipmentsDirty )
|
|
{
|
|
gfBobbyRShipmentsDirty = FALSE;
|
|
|
|
RenderBobbyRShipments();
|
|
}
|
|
}
|
|
|
|
void RenderBobbyRShipments()
|
|
{
|
|
// HVOBJECT hPixHandle;
|
|
|
|
// Dealtar: this must be static as this is accessed after this function has returned
|
|
static BobbyRayPurchaseStruct brps[100];
|
|
for(int i = 0; i < 100; i++) //JMich
|
|
{
|
|
memset(&brps[i], 0, sizeof(BobbyRayPurchaseStruct));
|
|
}
|
|
|
|
DrawBobbyRWoodBackground();
|
|
|
|
DrawBobbyROrderTitle();
|
|
|
|
//Output the title
|
|
DrawTextToScreen(gzBobbyRShipmentText[ BOBBYR_SHIPMENT__TITLE ], BOBBYR_ORDER_FORM_TITLE_X, BOBBYR_ORDER_FORM_TITLE_Y, BOBBYR_ORDER_FORM_TITLE_WIDTH, BOBBYR_SHIPMENT_TITLE_TEXT_FONT, BOBBYR_SHIPMENT_TITLE_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
|
|
|
|
DisplayShipmentGrid();
|
|
|
|
if(giBobbyRShipmentSelectedShipment != -1)
|
|
{
|
|
RefToShipmentPackageListIterator spli = gShipmentTable[giBobbyRShipmentSelectedShipment]->ShipmentPackages.begin();
|
|
int j;
|
|
for(unsigned i = 0; i < gShipmentTable[giBobbyRShipmentSelectedShipment]->ShipmentPackages.size(); i++, spli++)
|
|
{
|
|
brps[i].bItemQuality = ((ShipmentPackageStruct)*spli).bItemQuality;
|
|
brps[i].ubNumberPurchased = ((ShipmentPackageStruct)*spli).ubNumber;
|
|
brps[i].usItemIndex = ((ShipmentPackageStruct)*spli).usItemIndex;
|
|
brps[i].fUsed = (((ShipmentPackageStruct)*spli).bItemQuality < 100);
|
|
|
|
if(brps[i].fUsed)
|
|
{
|
|
for(j=0; j < MAXITEMS; j++)
|
|
{
|
|
if(LaptopSaveInfo.BobbyRayUsedInventory[j].usItemIndex == brps[i].usItemIndex)
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
brps[i].usBobbyItemIndex = j;
|
|
}
|
|
else
|
|
{
|
|
for(j=0; j < MAXITEMS; j++)
|
|
{
|
|
if(LaptopSaveInfo.BobbyRayInventory[j].usItemIndex == brps[i].usItemIndex)
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
brps[i].usBobbyItemIndex = j;
|
|
}
|
|
}
|
|
}
|
|
|
|
/*
|
|
if( giBobbyRShipmentSelectedShipment != -1 &&
|
|
gpNewBobbyrShipments[ giBobbyRShipmentSelectedShipment ].fActive &&
|
|
gpNewBobbyrShipments[ giBobbyRShipmentSelectedShipment ].fDisplayedInShipmentPage )
|
|
{
|
|
// DisplayPurchasedItems( FALSE, BOBBYR_SHIPMENT_ORDER_GRID_X, BOBBYR_SHIPMENT_ORDER_GRID_Y, &LaptopSaveInfo.BobbyRayOrdersOnDeliveryArray[giBobbyRShipmentSelectedShipment].BobbyRayPurchase[0], FALSE );
|
|
DisplayPurchasedItems( FALSE, BOBBYR_SHIPMENT_ORDER_GRID_X, BOBBYR_SHIPMENT_ORDER_GRID_Y, &gpNewBobbyrShipments[giBobbyRShipmentSelectedShipment].BobbyRayPurchase[0], FALSE, giBobbyRShipmentSelectedShipment );
|
|
}
|
|
else
|
|
{
|
|
// DisplayPurchasedItems( FALSE, BOBBYR_SHIPMENT_ORDER_GRID_X, BOBBYR_SHIPMENT_ORDER_GRID_Y, &LaptopSaveInfo.BobbyRayOrdersOnDeliveryArray[giBobbyRShipmentSelectedShipment].BobbyRayPurchase[0], TRUE );
|
|
DisplayPurchasedItems( FALSE, BOBBYR_SHIPMENT_ORDER_GRID_X, BOBBYR_SHIPMENT_ORDER_GRID_Y, NULL, TRUE, giBobbyRShipmentSelectedShipment );
|
|
}
|
|
*/
|
|
|
|
if( giBobbyRShipmentSelectedShipment != -1 &&
|
|
gShipmentTable[ giBobbyRShipmentSelectedShipment ]->ShipmentStatus == SHIPMENT_INTRANSIT) // &&
|
|
{
|
|
DisplayPurchasedItems( FALSE, BOBBYR_SHIPMENT_ORDER_GRID_X, BOBBYR_SHIPMENT_ORDER_GRID_Y,&brps[0], FALSE, giBobbyRShipmentSelectedShipment );
|
|
}
|
|
else
|
|
{
|
|
DisplayPurchasedItems( FALSE, BOBBYR_SHIPMENT_ORDER_GRID_X, BOBBYR_SHIPMENT_ORDER_GRID_Y, NULL, TRUE, giBobbyRShipmentSelectedShipment );
|
|
}
|
|
|
|
|
|
DisplayShipmentTitles();
|
|
DisplayPreviousShipments();
|
|
|
|
MarkButtonsDirty( );
|
|
RenderWWWProgramTitleBar( );
|
|
InvalidateRegion(LAPTOP_SCREEN_UL_X,LAPTOP_SCREEN_WEB_UL_Y,LAPTOP_SCREEN_LR_X,LAPTOP_SCREEN_WEB_LR_Y);
|
|
}
|
|
|
|
void BtnBobbyRShipmentBackCallback(GUI_BUTTON *btn,INT32 reason)
|
|
{
|
|
if(reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
|
|
{
|
|
btn->uiFlags |= BUTTON_CLICKED_ON;
|
|
InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
|
|
}
|
|
if(reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
|
|
{
|
|
btn->uiFlags &= (~BUTTON_CLICKED_ON );
|
|
|
|
guiCurrentLaptopMode = LAPTOP_MODE_BOBBY_R_MAILORDER;
|
|
|
|
InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
|
|
}
|
|
if(reason & MSYS_CALLBACK_REASON_LOST_MOUSE)
|
|
{
|
|
btn->uiFlags &= (~BUTTON_CLICKED_ON );
|
|
InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
|
|
}
|
|
}
|
|
|
|
|
|
void BtnBobbyRShipmentHomeCallback(GUI_BUTTON *btn,INT32 reason)
|
|
{
|
|
if(reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
|
|
{
|
|
btn->uiFlags |= BUTTON_CLICKED_ON;
|
|
InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
|
|
}
|
|
if(reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
|
|
{
|
|
btn->uiFlags &= (~BUTTON_CLICKED_ON );
|
|
|
|
guiCurrentLaptopMode = LAPTOP_MODE_BOBBY_R;
|
|
|
|
InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
|
|
}
|
|
if(reason & MSYS_CALLBACK_REASON_LOST_MOUSE)
|
|
{
|
|
btn->uiFlags &= (~BUTTON_CLICKED_ON );
|
|
InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
|
|
}
|
|
}
|
|
|
|
|
|
void DisplayShipmentGrid()
|
|
{
|
|
HVOBJECT hPixHandle, hPixGrid;
|
|
VOBJECT_DESC VObjectDesc;
|
|
GetVideoObject(&hPixHandle, guiBobbyRShipmentGrid);
|
|
// Shipment Order Grid
|
|
BltVideoObject(FRAME_BUFFER, hPixHandle, 0, BOBBYR_SHIPMENT_DELIVERY_GRID_X, BOBBYR_SHIPMENT_DELIVERY_GRID_Y, VO_BLT_SRCTRANSPARENCY,NULL);
|
|
|
|
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
|
|
FilenameForBPP("LAPTOP\\BobbyOrderGrid.sti", VObjectDesc.ImageFile);
|
|
AddVideoObject(&VObjectDesc, &guiBobbyROrderGrid);
|
|
GetVideoObject(&hPixGrid, guiBobbyROrderGrid);
|
|
BltVideoObject(FRAME_BUFFER, hPixGrid, 0, BOBBYR_SHIPMENT_ORDER_GRID_X, BOBBYR_SHIPMENT_ORDER_GRID_Y, VO_BLT_SRCTRANSPARENCY,NULL);
|
|
|
|
// Order Grid
|
|
//BltVideoObject(FRAME_BUFFER, hPixGrid, 0, BOBBYR_SHIPMENT_ORDER_GRID_X, BOBBYR_SHIPMENT_ORDER_GRID_Y, VO_BLT_SRCTRANSPARENCY,NULL);
|
|
}
|
|
|
|
|
|
|
|
void DisplayShipmentTitles()
|
|
{
|
|
//output the order #
|
|
DrawTextToScreen( gzBobbyRShipmentText[BOBBYR_SHIPMENT__ORDERED_ON], BOBBYR_SHIPMENT_SHIPMENT_ORDER_NUM_X, BOBBYR_SHIPMENT_SHIPMENT_ORDER_NUM_Y, BOBBYR_SHIPMENT_ORDER_NUM_WIDTH, BOBBYR_SHIPMENT_STATIC_TEXT_FONT, BOBBYR_SHIPMENT_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
|
|
|
|
//Output the # of items
|
|
DrawTextToScreen( gzBobbyRShipmentText[BOBBYR_SHIPMENT__NUM_ITEMS], BOBBYR_SHIPMENT_NUM_ITEMS_X, BOBBYR_SHIPMENT_NUM_ITEMS_Y, BOBBYR_SHIPMENT_NUM_ITEMS_WIDTH, BOBBYR_SHIPMENT_STATIC_TEXT_FONT, BOBBYR_SHIPMENT_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
|
|
}
|
|
|
|
void DisplayPreviousShipments()
|
|
{
|
|
UINT32 uiCnt;
|
|
CHAR16 zText[512];
|
|
UINT16 usPosY = BOBBYR_SHIPMENT_ORDER_NUM_START_Y;
|
|
UINT32 uiNumItems; // = CountNumberValidShipmentForTheShipmentsPage();
|
|
UINT32 uiNumberItemsInShipments = 0;
|
|
UINT32 uiItemCnt;
|
|
UINT8 ubFontColor = BOBBYR_SHIPMENT_STATIC_TEXT_COLOR;
|
|
|
|
RefToShipmentListIterator sli = gPostalService.LookupShipmentList().begin();
|
|
|
|
uiNumItems = (UINT32)gPostalService.LookupShipmentList().size();
|
|
if(uiNumItems > BOBBYR_SHIPMENT_NUM_PREVIOUS_SHIPMENTS)
|
|
uiNumItems = BOBBYR_SHIPMENT_NUM_PREVIOUS_SHIPMENTS;
|
|
|
|
//loop through all the shipments
|
|
for( uiCnt=0; uiCnt<uiNumItems; uiCnt++ )
|
|
{
|
|
/*
|
|
//if it is a valid shipment, and can be displayed at bobby r
|
|
if( gpNewBobbyrShipments[ uiCnt ].fActive &&
|
|
gpNewBobbyrShipments[ giBobbyRShipmentSelectedShipment ].fDisplayedInShipmentPage )
|
|
*/
|
|
// if it is a shipment that is active (= in transit)
|
|
if( gShipmentTable[ uiCnt ]->ShipmentStatus == SHIPMENT_INTRANSIT)
|
|
{
|
|
if( uiCnt == (UINT32)giBobbyRShipmentSelectedShipment )
|
|
{
|
|
ubFontColor = FONT_MCOLOR_WHITE;
|
|
}
|
|
else
|
|
{
|
|
ubFontColor = BOBBYR_SHIPMENT_STATIC_TEXT_COLOR;
|
|
}
|
|
|
|
//Display the "ordered on day num"
|
|
//swprintf( zText, L"%s %d", gpGameClockString[0], gpNewBobbyrShipments[ uiCnt ].uiOrderedOnDayNum );
|
|
swprintf( zText, L"%s %d", gpGameClockString[0], gShipmentTable[ uiCnt ]->uiOrderDate );
|
|
DrawTextToScreen( zText, BOBBYR_SHIPMENT_ORDER_NUM_X, usPosY, BOBBYR_SHIPMENT_ORDER_NUM_WIDTH, BOBBYR_SHIPMENT_STATIC_TEXT_FONT, ubFontColor, 0, FALSE, CENTER_JUSTIFIED );
|
|
|
|
uiNumberItemsInShipments = 0;
|
|
|
|
/*
|
|
// for( uiItemCnt=0; uiItemCnt<LaptopSaveInfo.BobbyRayOrdersOnDeliveryArray[ uiCnt ].ubNumberPurchases; uiItemCnt++ )
|
|
for( uiItemCnt=0; uiItemCnt<gpNewBobbyrShipments[ uiCnt ].ubNumberPurchases; uiItemCnt++ )
|
|
{
|
|
// uiNumberItemsInShipments += LaptopSaveInfo.BobbyRayOrdersOnDeliveryArray[ uiCnt ].BobbyRayPurchase[uiItemCnt].ubNumberPurchased;
|
|
uiNumberItemsInShipments += gpNewBobbyrShipments[ uiCnt ].BobbyRayPurchase[uiItemCnt].ubNumberPurchased;
|
|
}
|
|
*/
|
|
for( uiItemCnt=0; uiItemCnt<gShipmentTable[ uiCnt ]->ShipmentPackages.size(); uiItemCnt++ )
|
|
{
|
|
uiNumberItemsInShipments += gShipmentTable[ uiCnt ]->ShipmentPackages[uiItemCnt].ubNumber;
|
|
}
|
|
|
|
|
|
//Display the # of items
|
|
swprintf( zText, L"%d", uiNumberItemsInShipments );
|
|
DrawTextToScreen( zText, BOBBYR_SHIPMENT_NUM_ITEMS_X, usPosY, BOBBYR_SHIPMENT_NUM_ITEMS_WIDTH, BOBBYR_SHIPMENT_STATIC_TEXT_FONT, ubFontColor, 0, FALSE, CENTER_JUSTIFIED );
|
|
usPosY += BOBBYR_SHIPMENT_GAP_BTN_LINES;
|
|
}
|
|
}
|
|
}
|
|
|
|
void CreatePreviousShipmentsMouseRegions()
|
|
{
|
|
UINT32 uiCnt;
|
|
UINT16 usPosY = BOBBYR_SHIPMENT_ORDER_NUM_START_Y;
|
|
UINT16 usWidth = BOBBYR_SHIPMENT_DELIVERY_GRID_WIDTH;
|
|
UINT16 usHeight = GetFontHeight( BOBBYR_SHIPMENT_STATIC_TEXT_FONT );
|
|
//UINT32 uiNumItems = CountNumberOfBobbyPurchasesThatAreInTransit();
|
|
UINT32 uiNumItems = gPostalService.GetShipmentCount(SHIPMENT_INTRANSIT);
|
|
|
|
// WDS - If there are more than 13 shipments only show 13 because
|
|
// that is all that will fit on the screen. If you show more things
|
|
// get corrupted.
|
|
UINT32 max = uiNumItems;
|
|
if (max > MAX_SHIPMENTS_THAT_FIT_ON_SCREEN)
|
|
max = MAX_SHIPMENTS_THAT_FIT_ON_SCREEN;
|
|
|
|
for( uiCnt=0; uiCnt<max; uiCnt++ )
|
|
{
|
|
MSYS_DefineRegion( &gSelectedPreviousShipmentsRegion[uiCnt], BOBBYR_SHIPMENT_ORDER_NUM_X, usPosY, (UINT16)(BOBBYR_SHIPMENT_ORDER_NUM_X+usWidth), (UINT16)(usPosY+usHeight), MSYS_PRIORITY_HIGH,
|
|
CURSOR_WWW, MSYS_NO_CALLBACK, SelectPreviousShipmentsRegionCallBack );
|
|
MSYS_AddRegion(&gSelectedPreviousShipmentsRegion[uiCnt]);
|
|
MSYS_SetRegionUserData( &gSelectedPreviousShipmentsRegion[uiCnt], 0, uiCnt);
|
|
|
|
usPosY += BOBBYR_SHIPMENT_GAP_BTN_LINES;
|
|
}
|
|
}
|
|
|
|
void RemovePreviousShipmentsMouseRegions()
|
|
{
|
|
UINT32 uiCnt;
|
|
//UINT32 uiNumItems = CountNumberOfBobbyPurchasesThatAreInTransit();
|
|
UINT32 uiNumItems = gPostalService.GetShipmentCount(SHIPMENT_INTRANSIT);
|
|
|
|
|
|
for( uiCnt=0; uiCnt<uiNumItems; uiCnt++ )
|
|
{
|
|
MSYS_RemoveRegion( &gSelectedPreviousShipmentsRegion[uiCnt] );
|
|
}
|
|
}
|
|
|
|
void SelectPreviousShipmentsRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason )
|
|
{
|
|
if (iReason & MSYS_CALLBACK_REASON_INIT)
|
|
{
|
|
}
|
|
else if(iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
|
|
{
|
|
gubPurchaseAtTopOfList = 0;
|
|
INT32 iSlotID = MSYS_GetRegionUserData( pRegion, 0 );
|
|
|
|
|
|
// if( CountNumberOfBobbyPurchasesThatAreInTransit() > iSlotID )
|
|
if( gPostalService.GetShipmentCount(SHIPMENT_INTRANSIT) > iSlotID )
|
|
{
|
|
INT32 iCnt;
|
|
INT32 iValidShipmentCounter=0;
|
|
|
|
giBobbyRShipmentSelectedShipment = -1;
|
|
|
|
//loop through and get the "x" iSlotID shipment
|
|
// for( iCnt=0; iCnt<giNumberOfNewBobbyRShipment; iCnt++ )
|
|
for( iCnt=0; iCnt<gPostalService.GetShipmentCount(SHIPMENT_INTRANSIT); iCnt++ )
|
|
{
|
|
// if( gpNewBobbyrShipments[iCnt].fActive )
|
|
if( gShipmentTable[iCnt]->ShipmentStatus == SHIPMENT_INTRANSIT )
|
|
{
|
|
if( iValidShipmentCounter == iSlotID )
|
|
{
|
|
giBobbyRShipmentSelectedShipment = iCnt;
|
|
}
|
|
|
|
iValidShipmentCounter++;
|
|
}
|
|
}
|
|
}
|
|
|
|
gfBobbyRShipmentsDirty = TRUE;
|
|
}
|
|
}
|
|
|
|
//Dealtar's Airport Externalization
|
|
/*
|
|
* Function no longer used.
|
|
INT32 CountNumberValidShipmentForTheShipmentsPage()
|
|
{
|
|
if( giNumberOfNewBobbyRShipment > BOBBYR_SHIPMENT_NUM_PREVIOUS_SHIPMENTS )
|
|
return( BOBBYR_SHIPMENT_NUM_PREVIOUS_SHIPMENTS );
|
|
else
|
|
return( giNumberOfNewBobbyRShipment );
|
|
}
|
|
*/
|
|
|