MERGED source code from development trunk revision 4545 up to latest current revision 4882

Development Trunk: 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: The source code for the official 2011 release (4870) has been branched here:
https://ja2svn.dyndns.org/source/ja2/branches/JA2_rev.4870_2011

This commit contains the following features:

*** Externalized Vehicles ***
o Now with this feature we can add/remove vehicles
o New XML File: TableData\Vehicles.xml
o Added a new function parameter to lua file Scripts\Overhead lua to set up the helicopter in method: SetUpHelicopterForPlayer()
o Added example mini (Docs\Externalized Vehicles Example.zip) mod which adds 2 additional vehicles (hummer and ice-cream truck to sector A9)

*** Up to 255 save slots ***
- There is a "Next" and "Prev" button where you can scroll through the save slots
- It is now possible to load the automatic save (SAVE_EVERY_N_HOURS) from the load screen. This is the first slot after the quickload slot
- Added the 2 alternate players end turn saves (which can be enabled/disabled in option screen) to the save/load game form

*** New Feature: Externalized emails from Emails.edt to XML***
o This feature can be enabled/disabled in the Source:
--> See email.cpp: If "ReadXMLEmail" == FALSE, then normal way (read from Email.edt) otherwise read from XML files
o 2 new XML files: TableData\Email\EmailMercAvailable.xml and EmailMercLevelUp.xml
o Renamed SenderNamesList.xml to EmailSenderNamesList.xml and moved from TableData folder to TableData\Email folder
o Names for mercenaries are get from the file MercProfiles.xml and different names get from the file EmailSenderNamesList.xml

*** Externalized Hidden Towns (Tixa, Orta) ***
o Now it is possible to add new hidden towns (locations)
o See file: TableData/Map/Cities.xml
o New variable in TableData/Map/Cities.xml
- hiddenTown:   0 = show on strategy map, 1 = Hide on strategy map
- townIcon:     1 = on, 0 = off (This is the icon you see on the strategy map)
- szIconFile:   The path to the sti icon file (eg: interface\prison.sti, interface\my_icon.sti)
- iconPosition: The x,y position of the icon on the strategy map

*** Encyclopedia and Briefing Room, reachable from the laptop ***
o 2 new ja2_options.ini properties: BRIEFING_ROOM, ENCYCLOPEDIA
o demonstration video: http://www.youtube.com/watch?v=7CIXdXWLrAo
o Added Example usage of the Briefing Room
- Extract it in your JA2 1.13 folder and use the latest development executable
- The briefing room can be reached from the laptop. Enter SN5631 for the code and then click the "Exit" button
- See "Info_BriefingRoom.txt" and "BriefingRoom_Mission1.png"

*** Improved interrupt system (IIS) ***
o This system changes the way interrupts work. See: http://www.ja-galaxy-forum.com/board/ubbthreads.php?ubb=showflat&Number=290787#Post290787
o Option system (see ja2_options.ini: IMPROVED_INTERRUPT_SYSTEM)
o A few more settings for the interrupt system in ja2_options.ini
o INFO: Multiplayer games always use the "old" interrupt system, not matter what the user selects in the ja2_options.ini

*** Walking and sidestepping with weapon raised ***
o Enable/disable the walking/sidestepping with raised weapon in ja2_options.ini: ALLOW_WALKING_WITH_WEAPON_RAISED
o You can set an AP/BP modifier when walking/sidestepping with weapon raised in APBPConstants.ini: AP_MODIFIER_WEAPON_READY
o The following feature apply when you walk/sidestep with weapon raised:
-> limited angle of view, but you can see more farther when the weapon has a scope
-> better change for interrupts if you see an enemy
-> less APs and BPs when shooting, because the weapon is already raised
-> It should cost more APs when walking. Maybe you can export the additional AP and BP modifier to the APBPConstants.ini

*** Increase squad size to 8 (800x600) and 8 and 10 (1024x768) ***
o Squad sizes (dependend on the screen resolution) can be selected in the start new game screen
o In a multiplayer game, the squad size will always be 6, because it does not work with more soldiers/squad

*** Added UB-1.13 source code ***
o Merged the UB-1.13 source code (Revision: 4721) from svn: http://subversion.assembla.com/svn/ub-source113
o If you want to build UB-EXE or UB-MapEditor, just enable the 2 defines (JA2UB and JA2UBMAPS) in "builddefines.h"
o The UB-Verion reads from "ja2_UB.ini" instead of "ja2.ini"
o There are 2 new XML files
- Layout\LayoutMainMenu.xml
- MapAction\ActionItems.xml
o There are 2 new LUA-Script files
- Scripts\ExplosionControl.lua
- Scripts\InterfaceDialogue.lua

*** Hide enemy health text / enemy hit count ***
o ja2_options.ini: HIDE_ENEMY_HEALTH_TEXT, HIDE_ENEMY_HIT_COUNT
o both new settings only have effect in a singleplayer game
o see: http://www.ja-galaxy-forum.com/board/ubbthreads.php?ubb=showflat&Number=128840&page=1


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@4885 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2012-01-18 11:19:01 +00:00
parent c42d68ff0f
commit e64d5a2fa6
264 changed files with 40710 additions and 2771 deletions
+117 -15
View File
@@ -11,6 +11,10 @@
#include "Multi Language Graphic Utils.h"
#endif
#ifdef JA2UB
#include "ub_config.h"
#endif
#define AIM_LINK_TITLE_FONT FONT14ARIAL
#define AIM_LINK_TITLE_COLOR AIM_GREEN
@@ -42,7 +46,9 @@
#define AIM_LINK_LINK_TEXT_3_Y AIM_LINK_INSURANCE_LINK_Y + 45
#ifdef JA2UB
INT16 LinkID = 3;
#endif
@@ -67,29 +73,81 @@ void GameInitAimLinks()
BOOLEAN EnterAimLinks()
{
VOBJECT_DESC VObjectDesc;
UINT16 usPosY;
INT16 i;
UINT16 usPosY;
InitAimDefaults();
InitAimMenuBar();
#ifdef JA2UB
if (gGameUBOptions.LaptopLinkBobby == TRUE )
{
#endif
// load the Bobby link graphic and add it
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
GetMLGFilename( VObjectDesc.ImageFile, MLG_BOBBYRAYLINK );
CHECKF(AddVideoObject(&VObjectDesc, &guiBobbyLink));
#ifdef JA2UB
}
#endif
#ifdef JA2UB
if (gGameUBOptions.LaptopLinkFuneral == TRUE )
{
#endif
// load the Funeral graphic and add it
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
GetMLGFilename( VObjectDesc.ImageFile, MLG_MORTUARYLINK );
CHECKF(AddVideoObject(&VObjectDesc, &guiFuneralLink));
#ifdef JA2UB
}
#endif
#ifdef JA2UB
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
{
#endif
// load the Insurance graphic and add it
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
GetMLGFilename( VObjectDesc.ImageFile, MLG_INSURANCELINK );
CHECKF(AddVideoObject(&VObjectDesc, &guiInsuranceLink));
#ifdef JA2UB
}
#endif
#ifdef JA2UB
usPosY = AIM_LINK_BOBBY_LINK_Y;
if (gGameUBOptions.LaptopLinkBobby == TRUE )
{
MSYS_DefineRegion( &gSelectedLinkRegion[0], AIM_LINK_BOBBY_LINK_X, usPosY , AIM_LINK_BOBBY_LINK_X + AIM_LINK_LINK_WIDTH, (UINT16)(usPosY + AIM_LINK_LINK_HEIGHT), MSYS_PRIORITY_HIGH,
CURSOR_WWW, MSYS_NO_CALLBACK, SelectLinkRegionCallBack );
MSYS_AddRegion(&gSelectedLinkRegion[0]);
MSYS_SetRegionUserData( &gSelectedLinkRegion[0], 0, gubLinkPages[0]);
//usPosY += AIM_LINK_LINK_OFFSET_Y;
}
usPosY = AIM_LINK_FUNERAL_LINK_Y;
if (gGameUBOptions.LaptopLinkFuneral == TRUE )
{
MSYS_DefineRegion( &gSelectedLinkRegion[1], AIM_LINK_FUNERAL_LINK_X, usPosY , AIM_LINK_FUNERAL_LINK_X + AIM_LINK_LINK_WIDTH, (UINT16)(usPosY + AIM_LINK_LINK_HEIGHT), MSYS_PRIORITY_HIGH,
CURSOR_WWW, MSYS_NO_CALLBACK, SelectLinkRegionCallBack );
MSYS_AddRegion(&gSelectedLinkRegion[1]);
MSYS_SetRegionUserData( &gSelectedLinkRegion[1], 0, gubLinkPages[1]);
//usPosY += AIM_LINK_LINK_OFFSET_Y;
}
usPosY = AIM_LINK_INSURANCE_LINK_Y;
if (gGameUBOptions.LaptopLinkInsurance== TRUE )
{
MSYS_DefineRegion( &gSelectedLinkRegion[2], AIM_LINK_INSURANCE_LINK_X, usPosY , AIM_LINK_INSURANCE_LINK_X + AIM_LINK_LINK_WIDTH, (UINT16)(usPosY + AIM_LINK_LINK_HEIGHT), MSYS_PRIORITY_HIGH,
CURSOR_WWW, MSYS_NO_CALLBACK, SelectLinkRegionCallBack );
MSYS_AddRegion(&gSelectedLinkRegion[2]);
MSYS_SetRegionUserData( &gSelectedLinkRegion[2], 0, gubLinkPages[2]);
usPosY += AIM_LINK_LINK_OFFSET_Y;
}
#else
usPosY = AIM_LINK_BOBBY_LINK_Y;
for(i=0; i<AIM_LINK_NUM_LINKS; i++)
for(UINT8 i=0; i<AIM_LINK_NUM_LINKS; i++)
{
MSYS_DefineRegion( &gSelectedLinkRegion[i], AIM_LINK_BOBBY_LINK_X, usPosY , AIM_LINK_BOBBY_LINK_X + AIM_LINK_LINK_WIDTH, (UINT16)(usPosY + AIM_LINK_LINK_HEIGHT), MSYS_PRIORITY_HIGH,
CURSOR_WWW, MSYS_NO_CALLBACK, SelectLinkRegionCallBack );
@@ -97,7 +155,7 @@ BOOLEAN EnterAimLinks()
MSYS_SetRegionUserData( &gSelectedLinkRegion[i], 0, gubLinkPages[i]);
usPosY += AIM_LINK_LINK_OFFSET_Y;
}
#endif
RenderAimLinks();
return(TRUE);
@@ -108,14 +166,37 @@ void ExitAimLinks()
INT16 i;
RemoveAimDefaults();
#ifdef JA2UB
if (gGameUBOptions.LaptopLinkBobby == TRUE )
DeleteVideoObjectFromIndex(guiBobbyLink);
if (gGameUBOptions.LaptopLinkFuneral == TRUE )
DeleteVideoObjectFromIndex(guiFuneralLink);
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
DeleteVideoObjectFromIndex(guiInsuranceLink);
if (gGameUBOptions.LaptopLinkBobby == TRUE )
MSYS_RemoveRegion( &gSelectedLinkRegion[0]);
if (gGameUBOptions.LaptopLinkFuneral == TRUE )
MSYS_RemoveRegion( &gSelectedLinkRegion[1]);
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
MSYS_RemoveRegion( &gSelectedLinkRegion[2]);
#else
DeleteVideoObjectFromIndex(guiBobbyLink);
DeleteVideoObjectFromIndex(guiFuneralLink);
DeleteVideoObjectFromIndex(guiInsuranceLink);
for(i=0; i<AIM_LINK_NUM_LINKS; i++)
MSYS_RemoveRegion( &gSelectedLinkRegion[i]);
#endif
ExitAimMenuBar();
}
@@ -132,17 +213,38 @@ void RenderAimLinks()
DrawAimDefaults();
DisableAimButton();
#ifdef JA2UB
if (gGameUBOptions.LaptopLinkBobby == TRUE )
{
#endif
GetVideoObject(&hPixHandle, guiBobbyLink);
BltVideoObject(FRAME_BUFFER, hPixHandle, 0, AIM_LINK_BOBBY_LINK_X, AIM_LINK_BOBBY_LINK_Y, VO_BLT_SRCTRANSPARENCY,NULL);
#ifdef JA2UB
}
#endif
#ifdef JA2UB
if (gGameUBOptions.LaptopLinkFuneral == TRUE )
{
#endif
GetVideoObject(&hPixHandle, guiFuneralLink);
BltVideoObject(FRAME_BUFFER, hPixHandle, 0, AIM_LINK_FUNERAL_LINK_X, AIM_LINK_FUNERAL_LINK_Y, VO_BLT_SRCTRANSPARENCY,NULL);
// DrawTextToScreen(AimLinkText[AIM_LINK_FUNERAL], AIM_LINK_BOBBY_LINK_X, AIM_LINK_LINK_TEXT_2_Y, AIM_LINK_LINK_WIDTH, AIM_LINK_FONT, AIM_LINK_COLOR, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
#ifdef JA2UB
}
#endif
#ifdef JA2UB
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
{
#endif
GetVideoObject(&hPixHandle, guiInsuranceLink);
BltVideoObject(FRAME_BUFFER, hPixHandle, 0, AIM_LINK_INSURANCE_LINK_X, AIM_LINK_INSURANCE_LINK_Y, VO_BLT_SRCTRANSPARENCY,NULL);
// DrawTextToScreen(AimLinkText[AIM_LINK_LISTENING], AIM_LINK_BOBBY_LINK_X, AIM_LINK_LINK_TEXT_3_Y, AIM_LINK_LINK_WIDTH, AIM_LINK_FONT, AIM_LINK_COLOR, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
#ifdef JA2UB
}
#endif
//Draw Link Title
DrawTextToScreen(AimLinkText[AIM_LINK_TITLE], AIM_LINK_TITLE_X, AIM_LINK_TITLE_Y, AIM_LINK_TITLE_WIDTH, AIM_LINK_TITLE_FONT, AIM_LINK_TITLE_COLOR, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
+8 -7
View File
@@ -722,6 +722,7 @@ UINT8 GetStatColor( INT8 bStat );
#ifdef JA2TESTVERSION
BOOLEAN QuickHireMerc();
void TempHandleAimMemberKeyBoardInput();
extern void SetFlagToForceHireMerc( BOOLEAN fForceHire );
#endif
@@ -5060,13 +5061,13 @@ void HandleAimMemberKeyBoardInput()
// contact only if merc alive
if( !IsMercDead( gbCurrentSoldier ) )
{
if( !gubVideoConferencingMode)
{
gubVideoConferencingMode = AIM_VIDEO_POPUP_MODE;
//gubVideoConferencingMode = AIM_VIDEO_INIT_MODE;
gfFirstTimeInContactScreen = TRUE;
}
InitCreateDeleteAimPopUpBox(AIM_POPUP_DELETE, NULL, NULL, 0, 0, 0);
if( !gubVideoConferencingMode)
{
gubVideoConferencingMode = AIM_VIDEO_POPUP_MODE;
//gubVideoConferencingMode = AIM_VIDEO_INIT_MODE;
gfFirstTimeInContactScreen = TRUE;
}
InitCreateDeleteAimPopUpBox(AIM_POPUP_DELETE, NULL, NULL, 0, 0, 0);
}
break;
#ifdef JA2TESTVERSION
+1 -1
View File
@@ -3918,4 +3918,4 @@ void HandleBobbyRGunsKeyBoardInput()
}
}
}
}
}
+596
View File
@@ -0,0 +1,596 @@
#ifdef PRECOMPILEDHEADERS
#include "Laptop All.h"
#else
#include "Laptop All.h"
#include "Utilities.h"
#include "WCheck.h"
#include "timer control.h"
#include "Debug.h"
#include "WordWrap.h"
#include "Encrypted File.h"
#include "email.h"
#include "Game Clock.h"
#include "Text.h"
#include "LaptopSave.h"
#include "Multi Language Graphic Utils.h"
#include "soldier profile type.h"
#endif
#include "Encyclopedia_Data.h"
#include "Encyclopedia.h"
#include "BriefingRoom.h"
// Link Images
#define BRIEFINGROOM_BUTTON_SIZE_X 205
#define BRIEFINGROOM_BUTTON_SIZE_Y 19
#define BRIEFINGROOM_COPYRIGHT_X iScreenWidthOffset + 160
#define BRIEFINGROOM_COPYRIGHT_Y iScreenHeightOffset + 415 // + LAPTOP_SCREEN_WEB_DELTA_Y
#define BRIEFINGROOM_COPYRIGHT_WIDTH 400
#define BRIEFINGROOM_COPYRIGHT_GAP 9
#define IMAGE_OFFSET_X LAPTOP_SCREEN_UL_X
#define IMAGE_OFFSET_Y LAPTOP_SCREEN_WEB_UL_Y
//262, 28
// RustBackGround
#define RUSTBACKGROUND_SIZE_X 125
#define RUSTBACKGROUND_SIZE_Y 100
#define RUSTBACKGROUND_1_X IMAGE_OFFSET_X
#define RUSTBACKGROUND_1_Y IMAGE_OFFSET_Y
#define BRIEFINGROOM_FONT12ARIAL FONT12ARIAL
#define BRIEFINGROOM_FONT_MCOLOR_WHITE FONT_MCOLOR_WHITE
#define BRIEFINGROOM_BUTTONS_DEF 1
#define BRIEFINGROOM_SUBTITLE_Y iScreenHeightOffset + 150 + LAPTOP_SCREEN_WEB_DELTA_Y
#define BRIEFINGROOM_CONTENTBUTTON_X iScreenWidthOffset + 259
#define BRIEFINGROOM_CONTENTBUTTON_Y BRIEFINGROOM_SUBTITLE_Y
#define BRIEFINGROOM_TOC_X BRIEFINGROOM_CONTENTBUTTON_X
#define BRIEFINGROOM_TOC_Y 5
#define BRIEFINGROOM_TOC_GAP_Y 25
UINT32 guiRustBriefingRoomBackGround;
UINT32 guiRustBriefingRoomLogoAim;
MOUSE_REGION gSelectedBriefingRoomTocMenuRegion[ 6 ];
UINT32 guiContentButtonBriefingRoom;
UINT32 guiBRIEFINGROOMACTIVATIONINDENT;
void SelectBriefingRoomLocationButton(MOUSE_REGION * pRegion, INT32 iReason );
void SelectBriefingRoomCharacterButton(MOUSE_REGION * pRegion, INT32 iReason );
void SelectBriefingRoomQuestsButton(MOUSE_REGION * pRegion, INT32 iReason );
void SelectBriefingRoomInentoryButton(MOUSE_REGION * pRegion, INT32 iReason );
void LaptopInitBriefingRoom();
BOOLEAN fFirstTimeInBriefingRoom = TRUE;
BOOLEAN DrawBriefingRoomLogoAim();
//------------
void DisplayPlayerActivationBriefingRoomString( void );
void ProcessPlayerInputActivationBriefingRoomString( void );
void GetPlayerKeyBoardInputForBriefingRoomHomePage( void );
void HandleBriefingRoomTextEvent( UINT32 uiKey );
void DisplayActivationBriefingRoomStringCursor( void );
INT32 BriefingRoomGlowColorsList[][3] ={
{ 0,0,0 },
{ 0,25,0 },
{ 0,50,0 },
{ 0,75,0 },
{ 0,100,0 },
{ 0,125,0 },
{ 0,150,0 },
{ 0,175,0 },
{ 0,200,0 },
{ 0,225,0 },
{ 0,255,0 },
};
// btn callbacks
void BtnBriefingRoomAboutUsCallback(GUI_BUTTON *btn,INT32 reason);
void ResetActivationBriefingRoomStringTextBox(void);
// position defines
#define IMP_PLAYER_ACTIVATION_STRING_X LAPTOP_SCREEN_UL_X + 203//261
#define IMP_PLAYER_ACTIVATION_STRING_Y LAPTOP_SCREEN_WEB_UL_Y + 266 //336
#define CURSOR_Y IMP_PLAYER_ACTIVATION_STRING_Y - 5
#define CURSOR_HEIGHT GetFontHeight( FONT14ARIAL ) + 6
// the player activation string
CHAR16 pPlayerBriefingRoomActivationString[32];
// position within player activation string
INT32 iStringBriefingRoomPos = 0;
UINT16 uiCursorBriefingRoomPosition = IMP_PLAYER_ACTIVATION_STRING_X;
// has a new char been added or deleted?
BOOLEAN fNewCharInActivationBriefingRoomString = FALSE;
//------------
void GameInitBriefingRoom()
{
LaptopInitBriefingRoom();
}
BOOLEAN EnterBriefingRoom()
{
VOBJECT_DESC VObjectDesc;
//-----------------------------------------
// upon entry to Imp home page
memset(pPlayerBriefingRoomActivationString, 0, sizeof(pPlayerBriefingRoomActivationString));
// reset string position
iStringBriefingRoomPos =0;
// reset activation cursor position
uiCursorBriefingRoomPosition = IMP_PLAYER_ACTIVATION_STRING_X;
// we have now vsisited IMP, reset fact we haven't
fNotVistedImpYet = FALSE;
//------------------------
LaptopInitBriefingRoom();
InitBriefingRoomDefaults();
// load the Rust bacground graphic and add it
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
//FilenameForBPP("LAPTOP\\rustbackground.sti", VObjectDesc.ImageFile);
FilenameForBPP("BriefingRoom\\aimlogo_big.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiRustBriefingRoomLogoAim));
/*
// load the MemberShipcard graphic and add it
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
FilenameForBPP("BriefingRoom\\CONTENTBUTTON.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiContentButtonBriefingRoom));
*/
// this procedure will load the activation indent into memory
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
FilenameForBPP("LAPTOP\\ActivationIndent.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiBRIEFINGROOMACTIVATIONINDENT));
//** Mouse Regions **
/*
usPosY = BRIEFINGROOM_CONTENTBUTTON_Y + 120;
for(i=0; i<BRIEFINGROOM_BUTTONS_DEF; i++)
{
if ( i == 0 )
MSYS_DefineRegion( &gSelectedBriefingRoomTocMenuRegion[i], BRIEFINGROOM_TOC_X, usPosY, (UINT16)(BRIEFINGROOM_TOC_X + BRIEFINGROOM_BUTTON_SIZE_X), (UINT16)(usPosY + BRIEFINGROOM_BUTTON_SIZE_Y), MSYS_PRIORITY_HIGH,
CURSOR_WWW, MSYS_NO_CALLBACK, SelectBriefingRoomLocationButton);
MSYS_AddRegion(&gSelectedBriefingRoomTocMenuRegion[i]);
usPosY += BRIEFINGROOM_TOC_GAP_Y;
}
*/
fFirstTimeInBriefingRoom = FALSE;
RenderBriefingRoom();
return( TRUE );
}
void LaptopInitBriefingRoom()
{
}
void ExitBriefingRoom()
{
RemoveBriefingRoomDefaults();
//DeleteVideoObjectFromIndex(guiContentButtonBriefingRoom);
DeleteVideoObjectFromIndex(guiRustBriefingRoomLogoAim);
// remove activation indent symbol
DeleteVideoObjectFromIndex( guiBRIEFINGROOMACTIVATIONINDENT );
}
void HandleBriefingRoom()
{
// handle keyboard input for this screen
GetPlayerKeyBoardInputForBriefingRoomHomePage( );
// has a new char been added to activation string
if( fNewCharInActivationBriefingRoomString )
{
// display string
DisplayPlayerActivationBriefingRoomString( );
}
// render the cursor
DisplayActivationBriefingRoomStringCursor( );
}
void RenderBriefingRoom()
{
UINT16 usWidth=0;
HVOBJECT hHandle;
DrawBriefingRoomDefaults();
DrawBriefingRoomLogoAim();
// get the video object
GetVideoObject(&hHandle, guiBRIEFINGROOMACTIVATIONINDENT);
// blt to sX, sY relative to upper left corner
BltVideoObject(FRAME_BUFFER, hHandle, 0, LAPTOP_SCREEN_UL_X + 200, LAPTOP_SCREEN_WEB_UL_Y + 260 , VO_BLT_SRCTRANSPARENCY,NULL);
DisplayBriefingRoomSlogan();
DisplayBriefingRoomCopyright();
RenderWWWProgramTitleBar( );
// render the activation string
//-------------
DisplayPlayerActivationBriefingRoomString( );
//-------------
InvalidateRegion(LAPTOP_SCREEN_UL_X,LAPTOP_SCREEN_WEB_UL_Y,LAPTOP_SCREEN_LR_X,LAPTOP_SCREEN_WEB_LR_Y);
}
void SelectBriefingRoomLocationButton(MOUSE_REGION * pRegion, INT32 iReason )
{
if (iReason & MSYS_CALLBACK_REASON_INIT)
{
}
else if(iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
{
bEncyclopediaLocation = FALSE;
bEncyclopediaCharacter = FALSE;
bEncyclopediaInventory = FALSE;
bEncyclopediaQuests = FALSE;
bBriefingRoom = TRUE;
if(!fFirstTimeInBriefingRoom) guiCurrentLaptopMode = LAPTOP_MODE_BRIEFING_ROOM;
}
else if (iReason & MSYS_CALLBACK_REASON_RBUTTON_UP)
{
}
}
BOOLEAN InitBriefingRoomDefaults()
{
VOBJECT_DESC VObjectDesc;
// load the Rust bacground graphic and add it
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
//FilenameForBPP("LAPTOP\\rustbackground.sti", VObjectDesc.ImageFile);
FilenameForBPP("BriefingRoom\\background.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiRustBriefingRoomBackGround));
return(TRUE);
}
BOOLEAN RemoveBriefingRoomDefaults()
{
DeleteVideoObjectFromIndex(guiRustBriefingRoomBackGround);
return(TRUE);
}
BOOLEAN DrawBriefingRoomLogoAim()
{
HVOBJECT hLogoEncyklopedia;
GetVideoObject(&hLogoEncyklopedia, guiRustBriefingRoomLogoAim);
BltVideoObject(FRAME_BUFFER, hLogoEncyklopedia, 0,BRIEFINGROOM_TOC_X, RUSTBACKGROUND_1_Y + 40, VO_BLT_SRCTRANSPARENCY,NULL);
return(TRUE);
}
BOOLEAN DrawBriefingRoomDefaults()
{
HVOBJECT hRustBackGroundHandle;
// Blt the rust background
GetVideoObject(&hRustBackGroundHandle, guiRustBriefingRoomBackGround);
BltVideoObject(FRAME_BUFFER, hRustBackGroundHandle, 0,RUSTBACKGROUND_1_X, RUSTBACKGROUND_1_Y, VO_BLT_SRCTRANSPARENCY,NULL);
return(TRUE);
}
BOOLEAN DisplayBriefingRoomSlogan()
{
return(TRUE);
}
BOOLEAN DisplayBriefingRoomCopyright()
{
return(TRUE);
}
void DisplayPlayerActivationBriefingRoomString( void )
{
HVOBJECT hHandle;
// this function will grab the string that the player will enter for activation
// player gone too far, move back
if(iStringBriefingRoomPos > 64)
{
iStringBriefingRoomPos = 64;
}
// restore background
//RenderActivationIndent( 257, 328 );
// get the video object
GetVideoObject(&hHandle, guiBRIEFINGROOMACTIVATIONINDENT);
// blt to sX, sY relative to upper left corner
BltVideoObject(FRAME_BUFFER, hHandle, 0, LAPTOP_SCREEN_UL_X + 200, LAPTOP_SCREEN_WEB_UL_Y + 260 , VO_BLT_SRCTRANSPARENCY,NULL);
// setup the font stuff
SetFont( FONT14ARIAL );
SetFontForeground( 184 );
SetFontBackground(FONT_BLACK);
// reset shadow
SetFontShadow(DEFAULT_SHADOW);
mprintf(IMP_PLAYER_ACTIVATION_STRING_X, IMP_PLAYER_ACTIVATION_STRING_Y, pPlayerBriefingRoomActivationString);
fNewCharInActivationBriefingRoomString = FALSE;
fReDrawScreenFlag = TRUE;
return;
}
void DisplayActivationBriefingRoomStringCursor( void )
{
// this procdure will draw the activation string cursor on the screen at position cursorx cursory
UINT32 uiDestPitchBYTES;
static UINT32 uiBaseTime = 0;
UINT32 uiDeltaTime = 0;
UINT8 *pDestBuf;
static UINT32 iCurrentState = 0;
static BOOLEAN fIncrement = TRUE;
if(uiBaseTime == 0)
{
uiBaseTime = GetJA2Clock();
}
// get difference
uiDeltaTime = GetJA2Clock() - uiBaseTime;
// if difference is long enough, rotate colors
if(uiDeltaTime > MIN_GLOW_DELTA)
{
if( iCurrentState == 10)
{
// start rotating downward
fIncrement = FALSE;
}
if( iCurrentState == 0)
{
// rotate colors upward
fIncrement = TRUE;
}
// if increment upward, increment iCurrentState
if(fIncrement)
{
iCurrentState++;
}
else
{
// else downwards
iCurrentState--;
}
// reset basetime to current clock
uiBaseTime = GetJA2Clock( );
}
pDestBuf = LockVideoSurface( FRAME_BUFFER, &uiDestPitchBYTES );
SetClippingRegionAndImageWidth( uiDestPitchBYTES, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
// draw line in current state
LineDraw(TRUE, (UINT16) uiCursorBriefingRoomPosition, CURSOR_Y, (UINT16)uiCursorBriefingRoomPosition, CURSOR_Y + CURSOR_HEIGHT, Get16BPPColor( FROMRGB( BriefingRoomGlowColorsList[ iCurrentState ][ 0 ], BriefingRoomGlowColorsList[ iCurrentState ][ 1 ], BriefingRoomGlowColorsList[ iCurrentState ][ 2 ] ) ),
pDestBuf );
// unlock frame buffer
UnLockVideoSurface( FRAME_BUFFER );
InvalidateRegion((UINT16) uiCursorBriefingRoomPosition , CURSOR_Y , (UINT16)uiCursorBriefingRoomPosition + 1, CURSOR_Y + CURSOR_HEIGHT + 1);
return;
}
void GetPlayerKeyBoardInputForBriefingRoomHomePage( void )
{
InputAtom InputEvent;
POINT MousePos;
GetCursorPos(&MousePos);
ScreenToClient(ghWindow, &MousePos); // In window coords!
while (DequeueEvent(&InputEvent) == TRUE)
{
// HOOK INTO MOUSE HOOKS
/*
switch(InputEvent.usEvent)
{
case LEFT_BUTTON_DOWN:
MouseSystemHook(LEFT_BUTTON_DOWN, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown);
break;
case LEFT_BUTTON_UP:
MouseSystemHook(LEFT_BUTTON_UP, (INT16)MousePos.x, (INT16)MousePos.y ,_LeftButtonDown, _RightButtonDown);
break;
case RIGHT_BUTTON_DOWN:
MouseSystemHook(RIGHT_BUTTON_DOWN, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown);
break;
case RIGHT_BUTTON_UP:
MouseSystemHook(RIGHT_BUTTON_UP, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown);
break;
}
*/
if( !HandleTextInput( &InputEvent ) && (InputEvent.usEvent == KEY_DOWN || InputEvent.usEvent == KEY_REPEAT || InputEvent.usEvent == KEY_UP ) )
{
switch( InputEvent.usParam )
{
case (( ENTER ) ):
if(( InputEvent.usEvent == KEY_UP ) )
{
// return hit, check to see if current player activation string is a valid one
ProcessPlayerInputActivationBriefingRoomString( );
fNewCharInActivationBriefingRoomString = TRUE;
}
break;
case (( ESC )):
HandleLapTopESCKey(); // WANNE: Fix for proper closing of the IMP laptop page
LeaveLapTopScreen( );
break;
default:
if(InputEvent.usEvent == KEY_DOWN || InputEvent.usEvent == KEY_REPEAT )
{
HandleBriefingRoomTextEvent( InputEvent.usParam );
}
break;
}
}
}
return;
}
void HandleBriefingRoomTextEvent( UINT32 uiKey )
{
// this function checks to see if a letter or a backspace was pressed, if so, either put char to screen
// or delete it
switch( uiKey )
{
case ( BACKSPACE ):
if( iStringBriefingRoomPos >= 0 )
{
if( iStringBriefingRoomPos > 0 )
{
// decrement iStringBriefingRoomPosition
iStringBriefingRoomPos-=1;
}
// null out char
pPlayerBriefingRoomActivationString[iStringBriefingRoomPos ] = 0;
// move back cursor
uiCursorBriefingRoomPosition = StringPixLength( pPlayerBriefingRoomActivationString, FONT14ARIAL ) + IMP_PLAYER_ACTIVATION_STRING_X;
// string has been altered, redisplay
fNewCharInActivationBriefingRoomString = TRUE;
}
break;
default:
if( uiKey >= 'A' && uiKey <= 'Z' ||
uiKey >= 'a' && uiKey <= 'z' ||
uiKey >= '0' && uiKey <= '9' ||
uiKey == '_' || uiKey == '.' || uiKey ==' ')
{
// if the current string position is at max or great, do nothing
if( iStringBriefingRoomPos >= 8 )
{
break;
}
else
{
if(iStringBriefingRoomPos < 0 )
{
iStringBriefingRoomPos = 0;
}
// valid char, capture and convert to CHAR16
pPlayerBriefingRoomActivationString[iStringBriefingRoomPos] = ( CHAR16 )uiKey;
// null out next char position
pPlayerBriefingRoomActivationString[iStringBriefingRoomPos + 1] = 0;
// move cursor position ahead
uiCursorBriefingRoomPosition = StringPixLength( pPlayerBriefingRoomActivationString, FONT14ARIAL ) + IMP_PLAYER_ACTIVATION_STRING_X;
// increment string position
iStringBriefingRoomPos +=1;
// string has been altered, redisplay
fNewCharInActivationBriefingRoomString = TRUE;
}
}
break;
}
return;
}
void ProcessPlayerInputActivationBriefingRoomString( void )
{
// prcess string to see if it matches activation string
char charPlayerActivationString[32];
wcstombs(charPlayerActivationString,pPlayerBriefingRoomActivationString,32);
if( ( ( wcscmp(pPlayerBriefingRoomActivationString, L"SN5631") == 0 ) || ( wcscmp(pPlayerBriefingRoomActivationString, L"sn5631") == 0 ) ) ) //&&( LaptopSaveInfo.gfNewGameLaptop < 2 ) )
{
//bEncyclopediaLocation = FALSE;
//bEncyclopediaCharacter = FALSE;
//bEncyclopediaInventory = FALSE;
//bEncyclopediaQuests = FALSE;
//bBriefingRoom = FALSE;
//bBriefingRoomSpecialMission = TRUE;
ResetTemp();
CopyToTemp (gBriefingRoomData, TRUE, 0 , -1, FALSE );
if(!fFirstTimeInBriefingRoom) guiCurrentLaptopMode = LAPTOP_MODE_BRIEFING_ROOM_ENTER;
// DoLapTopMessageBox( MSG_BOX_LAPTOP_DEFAULT, AimPopUpText[ AIM_MEMBER_ALREADY_HAVE_MAX_MERCS ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL);
}
return;
}
void ResetActivationBriefingRoomStringTextBox(void)
{
// Reset activation text box
for (int i = 0; i < iStringBriefingRoomPos; i++)
{
pPlayerBriefingRoomActivationString[i] = 0;
}
iStringBriefingRoomPos = 0;
uiCursorBriefingRoomPosition = StringPixLength( pPlayerBriefingRoomActivationString, FONT14ARIAL ) + IMP_PLAYER_ACTIVATION_STRING_X;
DisplayPlayerActivationBriefingRoomString();
DisplayActivationBriefingRoomStringCursor();
}
+20
View File
@@ -0,0 +1,20 @@
#ifndef __BRIEFINGROOM_H
#define __BRIEFINGROOM_H
#include "Cursors.h"
#include "soldier profile type.h"
void GameInitBriefingRoom();
BOOLEAN EnterBriefingRoom();
void ExitBriefingRoom();
void HandleBriefingRoom();
void RenderBriefingRoom();
BOOLEAN RemoveBriefingRoomDefaults();
BOOLEAN InitBriefingRoomDefaults();
BOOLEAN DrawBriefingRoomDefaults();
BOOLEAN DisplayBriefingRoomSlogan();
BOOLEAN DisplayBriefingRoomCopyright();
#endif
+665
View File
@@ -0,0 +1,665 @@
#ifdef PRECOMPILEDHEADERS
#include "Laptop All.h"
#else
#include "Laptop All.h"
#include "Utilities.h"
#include "WCheck.h"
#include "timer control.h"
#include "Debug.h"
#include "WordWrap.h"
#include "Encrypted File.h"
#include "email.h"
#include "Game Clock.h"
#include "Text.h"
#include "LaptopSave.h"
#include "Multi Language Graphic Utils.h"
#include "soldier profile type.h"
#endif
#include "Encyclopedia_Data.h"
#include "Encyclopedia.h"
#include "BriefingRoomM.h"
// Link Images
#define BRIEFINGROOM_MISSION_BUTTON_SIZE_X 121
#define BRIEFINGROOM_MISSION_BUTTON_SIZE_Y 42
#define BRIEFINGROOM_MISSION_COPYRIGHT_X iScreenWidthOffset + 160
#define BRIEFINGROOM_MISSION_COPYRIGHT_Y iScreenHeightOffset + 415 // + LAPTOP_SCREEN_WEB_DELTA_Y
#define BRIEFINGROOM_MISSION_COPYRIGHT_WIDTH 400
#define BRIEFINGROOM_MISSION_COPYRIGHT_GAP 9
#define IMAGE_OFFSET_X LAPTOP_SCREEN_UL_X
#define IMAGE_OFFSET_Y LAPTOP_SCREEN_WEB_UL_Y
//262, 28
// RustBackGround
#define RUSTBACKGROUND_SIZE_X 125
#define RUSTBACKGROUND_SIZE_Y 100
#define RUSTBACKGROUND_1_X IMAGE_OFFSET_X
#define RUSTBACKGROUND_1_Y IMAGE_OFFSET_Y
#define BRIEFINGROOM_MISSION_FONT12ARIAL FONT12ARIAL
#define BRIEFINGROOM_MISSION_FONT_MCOLOR_WHITE FONT_MCOLOR_WHITE
#define BRIEFINGROOM_MISSION_BUTTONS_DEF 1
#define BRIEFINGROOM_MISSION_SUBTITLE_Y iScreenHeightOffset + 150 + LAPTOP_SCREEN_WEB_DELTA_Y
#define BRIEFINGROOM_MISSION_CONTENTBUTTON_X iScreenWidthOffset + 259
#define BRIEFINGROOM_MISSION_CONTENTBUTTON_Y BRIEFINGROOM_MISSION_SUBTITLE_Y
#define BRIEFINGROOM_MISSION_TOC_X BRIEFINGROOM_MISSION_CONTENTBUTTON_X
#define BRIEFINGROOM_MISSION_TOC_Y 5
#define BRIEFINGROOM_MISSION_TOC_GAP_Y 25
#define BRIEFINGROOM_MISSION_LOCATION_BOX_X LAPTOP_SCREEN_UL_X + (500-BRIEFINGROOM_MISSION_LOCATION_BOX_WIDTH)/2
#define BRIEFINGROOM_MISSION_LOCATION_BOX_Y iScreenHeightOffset + 260 + LAPTOP_SCREEN_WEB_DELTA_Y
#define EBRIEFINGROOM_MISSION_LOCATION_BOX_SHADOW_GAP 4
#define BRIEFINGROOM_MISSION_LOCATION_BOX_WIDTH 400//309
#define BRIEFINGROOM_MISSION_LOCATION_BOX_SHADOW_GAP 4
#define BRIEFINGROOM_MISSION_BOX_FONT FONT10ARIAL
#define BRIEFINGROOM_MISSION_BOX_COLOR FONT_MCOLOR_WHITE
#define BRIEFINGROOM_MISSION_PAGE_FONT FONT10ARIAL
#define BRIEFINGROOM_MISSION_BOX_X LAPTOP_SCREEN_UL_X + (500-BRIEFINGROOM_MISSION_BOX_WIDTH)/2
#define BRIEFINGROOM_MISSION_BOX_Y iScreenHeightOffset + 260 + LAPTOP_SCREEN_WEB_DELTA_Y
#define BRIEFINGROOM_MISSION_BOX_WIDTH 400
#define BRIEFINGROOM_MISSION_BOX_TEXT_WIDTH 250
#define BRIEFINGROOM_MISSION_BOX_DESC_X BRIEFINGROOM_MISSION_BOX_X + 8
#define BRIEFINGROOM_MISSION_BOX_DESC_Y BRIEFINGROOM_MISSION_PANEL_Y + BRIEFINGROOM_MISSION_PANEL_HEIGHT + 5
#define BRIEFINGROOM_MISSION_PANEL_HEIGHT 0
#define BRIEFINGROOM_MISSION_PANEL_Y BRIEFINGROOM_MISSION_BOX_Y + 6
UINT32 guiRustBriefingRoomEnterBackGround;
UINT32 guiRustBriefingRoomEnterLogoAim;
MOUSE_REGION gSelectedBriefingRoomEnterTocMenuRegion[ 6 ];
UINT32 guiContentButtonBriefingRoomEnter;
UINT32 guiBRIEFINGROOM_MISSIONACTIVATIONINDENT;
void SelectBriefingRoomEnterLocationButton(MOUSE_REGION * pRegion, INT32 iReason );
void SelectBriefingRoomEnterCharacterButton(MOUSE_REGION * pRegion, INT32 iReason );
void SelectBriefingRoomEnterQuestsButton(MOUSE_REGION * pRegion, INT32 iReason );
void SelectBriefingRoomEnterInentoryButton(MOUSE_REGION * pRegion, INT32 iReason );
void LaptopInitBriefingRoomEnter();
BOOLEAN fFirstTimeInBriefingRoomEnter = TRUE;
BOOLEAN DrawBriefingRoomEnterLogoAim();
//------------
void DisplayPlayerActivationBriefingRoomEnterString( void );
void ProcessPlayerInputActivationBriefingRoomEnterString( void );
void GetPlayerKeyBoardInputForBriefingRoomEnterHomePage( void );
void HandleBriefingRoomEnterTextEvent( UINT32 uiKey );
void DisplayActivationBriefingRoomEnterStringCursor( void );
INT32 BriefingRoomEnterGlowColorsList[][3] ={
{ 0,0,0 },
{ 0,25,0 },
{ 0,50,0 },
{ 0,75,0 },
{ 0,100,0 },
{ 0,125,0 },
{ 0,150,0 },
{ 0,175,0 },
{ 0,200,0 },
{ 0,225,0 },
{ 0,255,0 },
};
// btn callbacks
void BtnBriefingRoomEnterAboutUsCallback(GUI_BUTTON *btn,INT32 reason);
void ResetActivationBriefingRoomEnterStringTextBox(void);
// position defines
#define IMP_PLAYER_ACTIVATION_STRING_X LAPTOP_SCREEN_UL_X + 103//261
#define IMP_PLAYER_ACTIVATION_STRING_Y LAPTOP_SCREEN_WEB_UL_Y + 246 //336
#define CURSOR_Y IMP_PLAYER_ACTIVATION_STRING_Y - 5
#define CURSOR_HEIGHT GetFontHeight( FONT14ARIAL ) + 6
// the player activation string
CHAR16 pPlayerBriefingRoomEnterActivationString[32];
// position within player activation string
INT32 iStringBriefingRoomEnterPos = 0;
UINT16 uiCursorBriefingRoomEnterPosition = IMP_PLAYER_ACTIVATION_STRING_X;
// has a new char been added or deleted?
BOOLEAN fNewCharInActivationBriefingRoomEnterString = FALSE;
//------------
void GameInitBriefingRoomEnter()
{
LaptopInitBriefingRoomEnter();
}
BOOLEAN EnterBriefingRoomEnter()
{
VOBJECT_DESC VObjectDesc;
UINT16 i, usPosY;
//-----------------------------------------
// upon entry to Imp home page
memset(pPlayerBriefingRoomEnterActivationString, 0, sizeof(pPlayerBriefingRoomEnterActivationString));
// reset string position
iStringBriefingRoomEnterPos =0;
// reset activation cursor position
uiCursorBriefingRoomEnterPosition = IMP_PLAYER_ACTIVATION_STRING_X;
// we have now vsisited IMP, reset fact we haven't
fNotVistedImpYet = FALSE;
//------------------------
LaptopInitBriefingRoomEnter();
InitBriefingRoomEnterDefaults();
// load the Rust bacground graphic and add it
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
//FilenameForBPP("LAPTOP\\rustbackground.sti", VObjectDesc.ImageFile);
FilenameForBPP("BriefingRoom\\aimlogo.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiRustBriefingRoomEnterLogoAim));
// load the MemberShipcard graphic and add it
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
FilenameForBPP("BriefingRoom\\BUTTONS.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiContentButtonBriefingRoomEnter));
// this procedure will load the activation indent into memory
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
FilenameForBPP("LAPTOP\\ActivationIndent.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiBRIEFINGROOM_MISSIONACTIVATIONINDENT));
//** Mouse Regions **
usPosY = BRIEFINGROOM_MISSION_CONTENTBUTTON_Y + 120;
for(i=0; i<BRIEFINGROOM_MISSION_BUTTONS_DEF; i++)
{
if ( i == 0 )
MSYS_DefineRegion( &gSelectedBriefingRoomEnterTocMenuRegion[i], BRIEFINGROOM_MISSION_TOC_X+120, usPosY, (UINT16)(BRIEFINGROOM_MISSION_TOC_X+120 + BRIEFINGROOM_MISSION_BUTTON_SIZE_X), (UINT16)(usPosY + BRIEFINGROOM_MISSION_BUTTON_SIZE_Y), MSYS_PRIORITY_HIGH,
CURSOR_WWW, MSYS_NO_CALLBACK, SelectBriefingRoomEnterLocationButton);
MSYS_AddRegion(&gSelectedBriefingRoomEnterTocMenuRegion[i]);
usPosY += BRIEFINGROOM_MISSION_TOC_GAP_Y;
}
fFirstTimeInBriefingRoomEnter = FALSE;
RenderBriefingRoomEnter();
return( TRUE );
}
void LaptopInitBriefingRoomEnter()
{
}
void ExitBriefingRoomEnter()
{
UINT16 i;
RemoveBriefingRoomEnterDefaults();
DeleteVideoObjectFromIndex(guiContentButtonBriefingRoomEnter);
DeleteVideoObjectFromIndex(guiRustBriefingRoomEnterLogoAim);
// Remove Mouse Regions
for(i=0; i<BRIEFINGROOM_MISSION_BUTTONS_DEF; i++)
MSYS_RemoveRegion( &gSelectedBriefingRoomEnterTocMenuRegion[i]);
// remove activation indent symbol
DeleteVideoObjectFromIndex( guiBRIEFINGROOM_MISSIONACTIVATIONINDENT );
}
void HandleBriefingRoomEnter()
{
// handle keyboard input for this screen
GetPlayerKeyBoardInputForBriefingRoomEnterHomePage( );
// has a new char been added to activation string
if( fNewCharInActivationBriefingRoomEnterString )
{
// display string
DisplayPlayerActivationBriefingRoomEnterString( );
}
// render the cursor
DisplayActivationBriefingRoomEnterStringCursor( );
}
void RenderBriefingRoomEnter()
{
UINT16 i, idText, usPosY;
UINT16 usHeight;
HVOBJECT hContentButtonHandle;
UINT16 usWidth=0;
HVOBJECT hHandle;
DrawBriefingRoomEnterDefaults();
DrawBriefingRoomEnterLogoAim();
ShadowVideoSurfaceRect( FRAME_BUFFER, BRIEFINGROOM_MISSION_LOCATION_BOX_X+BRIEFINGROOM_MISSION_LOCATION_BOX_SHADOW_GAP+150, BRIEFINGROOM_MISSION_LOCATION_BOX_Y + 13 + BRIEFINGROOM_MISSION_LOCATION_BOX_SHADOW_GAP - 227 , BRIEFINGROOM_MISSION_LOCATION_BOX_X + 400 + BRIEFINGROOM_MISSION_LOCATION_BOX_SHADOW_GAP, BRIEFINGROOM_MISSION_LOCATION_BOX_Y + BRIEFINGROOM_MISSION_LOCATION_BOX_SHADOW_GAP-42);
DisplayWrappedString(BRIEFINGROOM_MISSION_BOX_DESC_X + 150, BRIEFINGROOM_MISSION_BOX_DESC_Y - 210, BRIEFINGROOM_MISSION_BOX_TEXT_WIDTH, 6, BRIEFINGROOM_MISSION_BOX_FONT, BRIEFINGROOM_MISSION_BOX_COLOR, L"Test box!", FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
GetVideoObject(&hContentButtonHandle, guiContentButtonBriefingRoomEnter);
usHeight = GetFontHeight(BRIEFINGROOM_MISSION_FONT12ARIAL);
usPosY = BRIEFINGROOM_MISSION_CONTENTBUTTON_Y + 120;
for(i=0; i<BRIEFINGROOM_MISSION_BUTTONS_DEF; i++)
{
idText = i + 16;
BltVideoObject(FRAME_BUFFER, hContentButtonHandle, 0,BRIEFINGROOM_MISSION_TOC_X+120, usPosY, VO_BLT_SRCTRANSPARENCY,NULL);
usWidth = StringPixLength(pMenuStrings[idText], BRIEFINGROOM_MISSION_FONT12ARIAL);
DrawTextToScreen(pMenuStrings[idText], BRIEFINGROOM_MISSION_TOC_X+120, (UINT16)(usPosY + BRIEFINGROOM_MISSION_TOC_Y+10), BRIEFINGROOM_MISSION_BUTTON_SIZE_X, BRIEFINGROOM_MISSION_FONT12ARIAL, BRIEFINGROOM_MISSION_FONT_MCOLOR_WHITE, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
usPosY += BRIEFINGROOM_MISSION_TOC_GAP_Y;
}
// get the video object
GetVideoObject(&hHandle, guiBRIEFINGROOM_MISSIONACTIVATIONINDENT);
// blt to sX, sY relative to upper left corner
BltVideoObject(FRAME_BUFFER, hHandle, 0, LAPTOP_SCREEN_UL_X + 100, LAPTOP_SCREEN_WEB_UL_Y + 240 , VO_BLT_SRCTRANSPARENCY,NULL);
DisplayBriefingRoomEnterSlogan();
DisplayBriefingRoomEnterCopyright();
RenderWWWProgramTitleBar( );
// render the activation string
//-------------
DisplayPlayerActivationBriefingRoomEnterString( );
//-------------
InvalidateRegion(LAPTOP_SCREEN_UL_X,LAPTOP_SCREEN_WEB_UL_Y,LAPTOP_SCREEN_LR_X,LAPTOP_SCREEN_WEB_LR_Y);
}
void SelectBriefingRoomEnterLocationButton(MOUSE_REGION * pRegion, INT32 iReason )
{
if (iReason & MSYS_CALLBACK_REASON_INIT)
{
}
else if(iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
{
if ( gBriefingRoomData[0].Hidden == TRUE )
{
bEncyclopediaLocation = FALSE;
bEncyclopediaCharacter = FALSE;
bEncyclopediaInventory = FALSE;
bEncyclopediaQuests = FALSE;
bBriefingRoomSpecialMission = FALSE;
bBriefingRoom = TRUE;
ResetVal = FALSE;
IDPageEncyData = PAGEBRIEFINGROOM;
if(!fFirstTimeInBriefingRoomEnter) guiCurrentLaptopMode = LAPTOP_MODE_BRIEFING_ROOM;
}
else
{
DoLapTopMessageBox( MSG_BOX_LAPTOP_DEFAULT, pSectorPageText[ 5 ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL);
}
}
else if (iReason & MSYS_CALLBACK_REASON_RBUTTON_UP)
{
}
}
BOOLEAN InitBriefingRoomEnterDefaults()
{
VOBJECT_DESC VObjectDesc;
// load the Rust bacground graphic and add it
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
//FilenameForBPP("LAPTOP\\rustbackground.sti", VObjectDesc.ImageFile);
FilenameForBPP("BriefingRoom\\background.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiRustBriefingRoomEnterBackGround));
return(TRUE);
}
BOOLEAN RemoveBriefingRoomEnterDefaults()
{
DeleteVideoObjectFromIndex(guiRustBriefingRoomEnterBackGround);
return(TRUE);
}
BOOLEAN DrawBriefingRoomEnterLogoAim()
{
HVOBJECT hLogoEncyklopedia;
GetVideoObject(&hLogoEncyklopedia, guiRustBriefingRoomEnterLogoAim);
BltVideoObject(FRAME_BUFFER, hLogoEncyklopedia, 0,BRIEFINGROOM_MISSION_TOC_X-120, RUSTBACKGROUND_1_Y + 20, VO_BLT_SRCTRANSPARENCY,NULL);
return(TRUE);
}
BOOLEAN DrawBriefingRoomEnterDefaults()
{
HVOBJECT hRustBackGroundHandle;
// Blt the rust background
GetVideoObject(&hRustBackGroundHandle, guiRustBriefingRoomEnterBackGround);
BltVideoObject(FRAME_BUFFER, hRustBackGroundHandle, 0,RUSTBACKGROUND_1_X, RUSTBACKGROUND_1_Y, VO_BLT_SRCTRANSPARENCY,NULL);
return(TRUE);
}
BOOLEAN DisplayBriefingRoomEnterSlogan()
{
return(TRUE);
}
BOOLEAN DisplayBriefingRoomEnterCopyright()
{
return(TRUE);
}
void DisplayPlayerActivationBriefingRoomEnterString( void )
{
HVOBJECT hHandle;
// this function will grab the string that the player will enter for activation
// player gone too far, move back
if(iStringBriefingRoomEnterPos > 64)
{
iStringBriefingRoomEnterPos = 64;
}
// restore background
//RenderActivationIndent( 257, 328 );
// get the video object
GetVideoObject(&hHandle, guiBRIEFINGROOM_MISSIONACTIVATIONINDENT);
// blt to sX, sY relative to upper left corner
BltVideoObject(FRAME_BUFFER, hHandle, 0, LAPTOP_SCREEN_UL_X + 100, LAPTOP_SCREEN_WEB_UL_Y + 240 , VO_BLT_SRCTRANSPARENCY,NULL);
// setup the font stuff
SetFont( FONT14ARIAL );
SetFontForeground( 184 );
SetFontBackground(FONT_BLACK);
// reset shadow
SetFontShadow(DEFAULT_SHADOW);
mprintf(IMP_PLAYER_ACTIVATION_STRING_X, IMP_PLAYER_ACTIVATION_STRING_Y, pPlayerBriefingRoomEnterActivationString);
fNewCharInActivationBriefingRoomEnterString = FALSE;
fReDrawScreenFlag = TRUE;
return;
}
void DisplayActivationBriefingRoomEnterStringCursor( void )
{
// this procdure will draw the activation string cursor on the screen at position cursorx cursory
UINT32 uiDestPitchBYTES;
static UINT32 uiBaseTime = 0;
UINT32 uiDeltaTime = 0;
UINT8 *pDestBuf;
static UINT32 iCurrentState = 0;
static BOOLEAN fIncrement = TRUE;
if(uiBaseTime == 0)
{
uiBaseTime = GetJA2Clock();
}
// get difference
uiDeltaTime = GetJA2Clock() - uiBaseTime;
// if difference is long enough, rotate colors
if(uiDeltaTime > MIN_GLOW_DELTA)
{
if( iCurrentState == 10)
{
// start rotating downward
fIncrement = FALSE;
}
if( iCurrentState == 0)
{
// rotate colors upward
fIncrement = TRUE;
}
// if increment upward, increment iCurrentState
if(fIncrement)
{
iCurrentState++;
}
else
{
// else downwards
iCurrentState--;
}
// reset basetime to current clock
uiBaseTime = GetJA2Clock( );
}
pDestBuf = LockVideoSurface( FRAME_BUFFER, &uiDestPitchBYTES );
SetClippingRegionAndImageWidth( uiDestPitchBYTES, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
// draw line in current state
LineDraw(TRUE, (UINT16) uiCursorBriefingRoomEnterPosition, CURSOR_Y, (UINT16)uiCursorBriefingRoomEnterPosition, CURSOR_Y + CURSOR_HEIGHT, Get16BPPColor( FROMRGB( BriefingRoomEnterGlowColorsList[ iCurrentState ][ 0 ], BriefingRoomEnterGlowColorsList[ iCurrentState ][ 1 ], BriefingRoomEnterGlowColorsList[ iCurrentState ][ 2 ] ) ),
pDestBuf );
// unlock frame buffer
UnLockVideoSurface( FRAME_BUFFER );
InvalidateRegion((UINT16) uiCursorBriefingRoomEnterPosition , CURSOR_Y , (UINT16)uiCursorBriefingRoomEnterPosition + 1, CURSOR_Y + CURSOR_HEIGHT + 1);
return;
}
void GetPlayerKeyBoardInputForBriefingRoomEnterHomePage( void )
{
InputAtom InputEvent;
POINT MousePos;
GetCursorPos(&MousePos);
ScreenToClient(ghWindow, &MousePos); // In window coords!
while (DequeueEvent(&InputEvent) == TRUE)
{
// HOOK INTO MOUSE HOOKS
/*
switch(InputEvent.usEvent)
{
case LEFT_BUTTON_DOWN:
MouseSystemHook(LEFT_BUTTON_DOWN, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown);
break;
case LEFT_BUTTON_UP:
MouseSystemHook(LEFT_BUTTON_UP, (INT16)MousePos.x, (INT16)MousePos.y ,_LeftButtonDown, _RightButtonDown);
break;
case RIGHT_BUTTON_DOWN:
MouseSystemHook(RIGHT_BUTTON_DOWN, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown);
break;
case RIGHT_BUTTON_UP:
MouseSystemHook(RIGHT_BUTTON_UP, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown);
break;
}
*/
if( !HandleTextInput( &InputEvent ) && (InputEvent.usEvent == KEY_DOWN || InputEvent.usEvent == KEY_REPEAT || InputEvent.usEvent == KEY_UP ) )
{
switch( InputEvent.usParam )
{
case (( ENTER ) ):
if(( InputEvent.usEvent == KEY_UP ) )
{
// return hit, check to see if current player activation string is a valid one
ProcessPlayerInputActivationBriefingRoomEnterString( );
fNewCharInActivationBriefingRoomEnterString = TRUE;
}
break;
case (( ESC )):
HandleLapTopESCKey(); // WANNE: Fix for proper closing of the IMP laptop page
LeaveLapTopScreen( );
break;
default:
if(InputEvent.usEvent == KEY_DOWN || InputEvent.usEvent == KEY_REPEAT )
{
HandleBriefingRoomEnterTextEvent( InputEvent.usParam );
}
break;
}
}
}
return;
}
void HandleBriefingRoomEnterTextEvent( UINT32 uiKey )
{
// this function checks to see if a letter or a backspace was pressed, if so, either put char to screen
// or delete it
switch( uiKey )
{
case ( BACKSPACE ):
if( iStringBriefingRoomEnterPos >= 0 )
{
if( iStringBriefingRoomEnterPos > 0 )
{
// decrement iStringBriefingRoomEnterPosition
iStringBriefingRoomEnterPos-=1;
}
// null out char
pPlayerBriefingRoomEnterActivationString[iStringBriefingRoomEnterPos ] = 0;
// move back cursor
uiCursorBriefingRoomEnterPosition = StringPixLength( pPlayerBriefingRoomEnterActivationString, FONT14ARIAL ) + IMP_PLAYER_ACTIVATION_STRING_X;
// string has been altered, redisplay
fNewCharInActivationBriefingRoomEnterString = TRUE;
}
break;
default:
if( uiKey >= 'A' && uiKey <= 'Z' ||
uiKey >= 'a' && uiKey <= 'z' ||
uiKey >= '0' && uiKey <= '9' ||
uiKey == '_' || uiKey == '.' || uiKey ==' ')
{
// if the current string position is at max or great, do nothing
if( iStringBriefingRoomEnterPos >= 8 )
{
break;
}
else
{
if(iStringBriefingRoomEnterPos < 0 )
{
iStringBriefingRoomEnterPos = 0;
}
// valid char, capture and convert to CHAR16
pPlayerBriefingRoomEnterActivationString[iStringBriefingRoomEnterPos] = ( CHAR16 )uiKey;
// null out next char position
pPlayerBriefingRoomEnterActivationString[iStringBriefingRoomEnterPos + 1] = 0;
// move cursor position ahead
uiCursorBriefingRoomEnterPosition = StringPixLength( pPlayerBriefingRoomEnterActivationString, FONT14ARIAL ) + IMP_PLAYER_ACTIVATION_STRING_X;
// increment string position
iStringBriefingRoomEnterPos +=1;
// string has been altered, redisplay
fNewCharInActivationBriefingRoomEnterString = TRUE;
}
}
break;
}
return;
}
void ProcessPlayerInputActivationBriefingRoomEnterString( void )
{
// prcess string to see if it matches activation string
char charPlayerActivationString[32];
wcstombs(charPlayerActivationString,pPlayerBriefingRoomEnterActivationString,32);
if( ( ( wcscmp(pPlayerBriefingRoomEnterActivationString, L"SN5631") == 0 ) || ( wcscmp(pPlayerBriefingRoomEnterActivationString, L"sn5631") == 0 ) ) ) //&&( LaptopSaveInfo.gfNewGameLaptop < 2 ) )
{
/*
bEncyclopediaLocation = FALSE;
bEncyclopediaCharacter = FALSE;
bEncyclopediaInventory = FALSE;
bEncyclopediaQuests = FALSE;
bBriefingRoom = FALSE;
bBriefingRoomSpecialMission = TRUE;
ResetVal = FALSE;
IDPageEncyData = PAGEBRIEFINGROOMSPECIALMISSION;
if(!fFirstTimeInBriefingRoomEnter) guiCurrentLaptopMode = LAPTOP_MODE_BRIEFING_ROOM;
*/
}
return;
}
void ResetActivationBriefingRoomEnterStringTextBox(void)
{
// Reset activation text box
for (int i = 0; i < iStringBriefingRoomEnterPos; i++)
{
pPlayerBriefingRoomEnterActivationString[i] = 0;
}
iStringBriefingRoomEnterPos = 0;
uiCursorBriefingRoomEnterPosition = StringPixLength( pPlayerBriefingRoomEnterActivationString, FONT14ARIAL ) + IMP_PLAYER_ACTIVATION_STRING_X;
DisplayPlayerActivationBriefingRoomEnterString();
DisplayActivationBriefingRoomEnterStringCursor();
}
+20
View File
@@ -0,0 +1,20 @@
#ifndef __BRIEFINGROOMM_H
#define __BRIEFINGROOMM_H
#include "Cursors.h"
#include "soldier profile type.h"
void GameInitBriefingRoomEnter();
BOOLEAN EnterBriefingRoomEnter();
void ExitBriefingRoomEnter();
void HandleBriefingRoomEnter();
void RenderBriefingRoomEnter();
BOOLEAN RemoveBriefingRoomEnterDefaults();
BOOLEAN InitBriefingRoomEnterDefaults();
BOOLEAN DrawBriefingRoomEnterDefaults();
BOOLEAN DisplayBriefingRoomEnterSlogan();
BOOLEAN DisplayBriefingRoomEnterCopyright();
#endif
+390
View File
@@ -0,0 +1,390 @@
#ifdef PRECOMPILEDHEADERS
#include "Laptop All.h"
#else
#include "Laptop All.h"
#include "Utilities.h"
#include "WCheck.h"
#include "timer control.h"
#include "Debug.h"
#include "WordWrap.h"
#include "Encrypted File.h"
#include "email.h"
#include "Game Clock.h"
#include "Text.h"
#include "LaptopSave.h"
#include "Multi Language Graphic Utils.h"
#include "soldier profile type.h"
#endif
#include "Encyclopedia_Data.h"
#include "Encyclopedia.h"
// Link Images
#define ENCYCLOPEDIA_BUTTON_SIZE_X 205
#define ENCYCLOPEDIA_BUTTON_SIZE_Y 19
#define ENCYCLOPEDIA_COPYRIGHT_X iScreenWidthOffset + 160
#define ENCYCLOPEDIA_COPYRIGHT_Y iScreenHeightOffset + 415 // + LAPTOP_SCREEN_WEB_DELTA_Y
#define ENCYCLOPEDIA_COPYRIGHT_WIDTH 400
#define ENCYCLOPEDIA_COPYRIGHT_GAP 9
#define IMAGE_OFFSET_X LAPTOP_SCREEN_UL_X
#define IMAGE_OFFSET_Y LAPTOP_SCREEN_WEB_UL_Y
//262, 28
// RustBackGround
#define RUSTBACKGROUND_SIZE_X 125
#define RUSTBACKGROUND_SIZE_Y 100
#define RUSTBACKGROUND_1_X IMAGE_OFFSET_X
#define RUSTBACKGROUND_1_Y IMAGE_OFFSET_Y
#define ENCYCLOPEDIA_FONT12ARIAL FONT12ARIAL
#define ENCYCLOPEDIA_FONT_MCOLOR_WHITE FONT_MCOLOR_WHITE
#define ENCYCLOPEDIA_BUTTONS_DEF 4
#define ENCYCLOPEDIA_SUBTITLE_Y iScreenHeightOffset + 150 + LAPTOP_SCREEN_WEB_DELTA_Y
#define ENCYCLOPEDIA_CONTENTBUTTON_X iScreenWidthOffset + 259
#define ENCYCLOPEDIA_CONTENTBUTTON_Y ENCYCLOPEDIA_SUBTITLE_Y
#define ENCYCLOPEDIA_TOC_X ENCYCLOPEDIA_CONTENTBUTTON_X
#define ENCYCLOPEDIA_TOC_Y 5
#define ENCYCLOPEDIA_TOC_GAP_Y 25
UINT32 guiRustEncyclopediaBackGround;
UINT32 guiRustEncyclopediaLogoAim;
MOUSE_REGION gSelectedEncyclopediaTocMenuRegion[ 6 ];
UINT32 guiContentButtonEncy;
void SelectEncyclopediaLocationButton(MOUSE_REGION * pRegion, INT32 iReason );
void SelectEncyclopediaCharacterButton(MOUSE_REGION * pRegion, INT32 iReason );
void SelectEncyclopediaQuestsButton(MOUSE_REGION * pRegion, INT32 iReason );
void SelectEncyclopediaInentoryButton(MOUSE_REGION * pRegion, INT32 iReason );
void LaptopInitEncyclopedia();
void InitEncyklopediaBool();
BOOLEAN fFirstTimeInEncyclopedia = TRUE;
BOOLEAN DrawEncyclopediaLogoAim();
ENCYCLOPEDIA_LOCATION gEncyclopediaLocationData[ NUM_SECTOR ];
ENCYCLOPEDIA_LOCATION gEncyclopediaDataTemp[ NUM_MAX_TEMP ];
ENCYCLOPEDIA_LOCATION gEncyclopediaProfilesData[ NUM_PROFILES ];
ENCYCLOPEDIA_LOCATION gEncyclopediaInventoryData[ MAXITEMS ];
ENCYCLOPEDIA_LOCATION gEncyclopediaOldProfilesData[ NUM_PROFILES ];
ENCYCLOPEDIA_LOCATION gEncyclopediaQuestsData[ MAX_QUESTS ];
ENCYCLOPEDIA_LOCATION gBriefingRoomData[ NUM_SECTOR ];
ENCYCLOPEDIA_LOCATION gBriefingRoomSpecialMissionData[ NUM_SECTOR ];
BOOLEAN saveEncyclopediaLocationData[ NUM_SECTOR ];
ENCYCLOPEDIA_PROF_SAVE saveEncyclopediaProfilesData[ NUM_PROFILES ];
BOOLEAN saveEncyclopediaInventoryData[ MAXITEMS ];
BOOLEAN saveEncyclopediaOldProfilesData[ NUM_PROFILES ];
BOOLEAN saveEncyclopediaQuestsData[ MAX_QUESTS ];
MISSION_SAVE saveBriefingRoomData[ NUM_SECTOR ];
MISSION_SAVE saveBriefingRoomSpecialMissionData[ NUM_SECTOR ];
MISSION_SAVE saveMissionData[ NUM_SECTOR ];
void GameInitEncyclopedia()
{
LaptopInitEncyclopedia();
}
BOOLEAN EnterEncyclopedia()
{
VOBJECT_DESC VObjectDesc;
UINT16 i, usPosY;
LaptopInitEncyclopedia();
InitEncyclopediaDefaults();
// load the Rust bacground graphic and add it
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
//FilenameForBPP("LAPTOP\\rustbackground.sti", VObjectDesc.ImageFile);
FilenameForBPP("ENCYCLOPEDIA\\encyclopedialogoaim.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiRustEncyclopediaLogoAim));
// load the MemberShipcard graphic and add it
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
FilenameForBPP("Encyclopedia\\CONTENTBUTTON.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiContentButtonEncy));
//** Mouse Regions **
usPosY = ENCYCLOPEDIA_CONTENTBUTTON_Y + 120;
for(i=0; i<ENCYCLOPEDIA_BUTTONS_DEF; i++)
{
if ( i == 0 )
MSYS_DefineRegion( &gSelectedEncyclopediaTocMenuRegion[i], ENCYCLOPEDIA_TOC_X, usPosY, (UINT16)(ENCYCLOPEDIA_TOC_X + ENCYCLOPEDIA_BUTTON_SIZE_X), (UINT16)(usPosY + ENCYCLOPEDIA_BUTTON_SIZE_Y), MSYS_PRIORITY_HIGH,
CURSOR_WWW, MSYS_NO_CALLBACK, SelectEncyclopediaLocationButton);
else if ( i == 1 )
MSYS_DefineRegion( &gSelectedEncyclopediaTocMenuRegion[i], ENCYCLOPEDIA_TOC_X, usPosY, (UINT16)(ENCYCLOPEDIA_TOC_X + ENCYCLOPEDIA_BUTTON_SIZE_X), (UINT16)(usPosY + ENCYCLOPEDIA_BUTTON_SIZE_Y), MSYS_PRIORITY_HIGH,
CURSOR_WWW, MSYS_NO_CALLBACK, SelectEncyclopediaCharacterButton);
else if ( i == 2 )
MSYS_DefineRegion( &gSelectedEncyclopediaTocMenuRegion[i], ENCYCLOPEDIA_TOC_X, usPosY, (UINT16)(ENCYCLOPEDIA_TOC_X + ENCYCLOPEDIA_BUTTON_SIZE_X), (UINT16)(usPosY + ENCYCLOPEDIA_BUTTON_SIZE_Y), MSYS_PRIORITY_HIGH,
CURSOR_WWW, MSYS_NO_CALLBACK, SelectEncyclopediaInentoryButton);
else if ( i == 3 )
MSYS_DefineRegion( &gSelectedEncyclopediaTocMenuRegion[i], ENCYCLOPEDIA_TOC_X, usPosY, (UINT16)(ENCYCLOPEDIA_TOC_X + ENCYCLOPEDIA_BUTTON_SIZE_X), (UINT16)(usPosY + ENCYCLOPEDIA_BUTTON_SIZE_Y), MSYS_PRIORITY_HIGH,
CURSOR_WWW, MSYS_NO_CALLBACK, SelectEncyclopediaQuestsButton);
MSYS_AddRegion(&gSelectedEncyclopediaTocMenuRegion[i]);
usPosY += ENCYCLOPEDIA_TOC_GAP_Y;
}
fFirstTimeInEncyclopedia = FALSE;
RenderEncyclopedia();
return( TRUE );
}
void LaptopInitEncyclopedia()
{
}
void InitEncyklopediaBool()
{
bEncyclopediaLocation = FALSE;
bEncyclopediaCharacter = FALSE;
bEncyclopediaInventory = FALSE;
bEncyclopediaQuests = FALSE;
bBriefingRoom = FALSE;
bBriefingRoomSpecialMission = FALSE;
}
void ExitEncyclopedia()
{
UINT16 i;
//InitEncyklopediaBool();
RemoveEncyclopediaDefaults();
DeleteVideoObjectFromIndex(guiContentButtonEncy);
DeleteVideoObjectFromIndex(guiRustEncyclopediaLogoAim);
// Remove Mouse Regions
for(i=0; i<ENCYCLOPEDIA_BUTTONS_DEF; i++)
MSYS_RemoveRegion( &gSelectedEncyclopediaTocMenuRegion[i]);
//guiCurrentLaptopMode = LAPTOP_MODE_NONE;
}
void HandleEncyclopedia()
{
}
void RenderEncyclopedia()
{
UINT16 i, usPosY;
UINT16 usHeight;
HVOBJECT hContentButtonHandle;
UINT16 usWidth=0;
DrawEncyclopediaDefaults();
DrawEncyclopediaLogoAim();
GetVideoObject(&hContentButtonHandle, guiContentButtonEncy);
usHeight = GetFontHeight(ENCYCLOPEDIA_FONT12ARIAL);
usPosY = ENCYCLOPEDIA_CONTENTBUTTON_Y + 120;
for(i=0; i<ENCYCLOPEDIA_BUTTONS_DEF; i++)
{
BltVideoObject(FRAME_BUFFER, hContentButtonHandle, 0,ENCYCLOPEDIA_TOC_X, usPosY, VO_BLT_SRCTRANSPARENCY,NULL);
usWidth = StringPixLength(pMenuStrings[i], ENCYCLOPEDIA_FONT12ARIAL);
DrawTextToScreen(pMenuStrings[i], ENCYCLOPEDIA_TOC_X, (UINT16)(usPosY + ENCYCLOPEDIA_TOC_Y), ENCYCLOPEDIA_BUTTON_SIZE_X, ENCYCLOPEDIA_FONT12ARIAL, ENCYCLOPEDIA_FONT_MCOLOR_WHITE, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
usPosY += ENCYCLOPEDIA_TOC_GAP_Y;
}
DisplayEncyclopediaSlogan();
DisplayEncyclopediaCopyright();
RenderWWWProgramTitleBar( );
//InitEncyklopediaBool();
InvalidateRegion(LAPTOP_SCREEN_UL_X,LAPTOP_SCREEN_WEB_UL_Y,LAPTOP_SCREEN_LR_X,LAPTOP_SCREEN_WEB_LR_Y);
}
void SelectEncyclopediaLocationButton(MOUSE_REGION * pRegion, INT32 iReason )
{
if (iReason & MSYS_CALLBACK_REASON_INIT)
{
}
else if(iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
{
bEncyclopediaLocation = TRUE;
bEncyclopediaCharacter = FALSE;
bEncyclopediaInventory = FALSE;
bEncyclopediaQuests = FALSE;
bBriefingRoom = FALSE;
bBriefingRoomSpecialMission = FALSE;
ResetVal = TRUE;
IDPageEncyData = PAGEENCYCLOPEDIALOCATION;
if(!fFirstTimeInEncyclopedia) guiCurrentLaptopMode = LAPTOP_MODE_ENCYCLOPEDIA_LOCATION;
}
else if (iReason & MSYS_CALLBACK_REASON_RBUTTON_UP)
{
}
}
void SelectEncyclopediaCharacterButton(MOUSE_REGION * pRegion, INT32 iReason )
{
if (iReason & MSYS_CALLBACK_REASON_INIT)
{
}
else if(iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
{
bEncyclopediaLocation = FALSE;
bEncyclopediaCharacter = TRUE;
bEncyclopediaInventory = FALSE;
bEncyclopediaQuests = FALSE;
bBriefingRoom = FALSE;
bBriefingRoomSpecialMission = FALSE;
ResetVal = TRUE;
IDPageEncyData = PAGEENCYCLOPEDIACHARACTER;
if(!fFirstTimeInEncyclopedia) guiCurrentLaptopMode = LAPTOP_MODE_ENCYCLOPEDIA_LOCATION;
}
else if (iReason & MSYS_CALLBACK_REASON_RBUTTON_UP)
{
}
}
void SelectEncyclopediaQuestsButton(MOUSE_REGION * pRegion, INT32 iReason )
{
if (iReason & MSYS_CALLBACK_REASON_INIT)
{
}
else if(iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
{
bEncyclopediaLocation = FALSE;
bEncyclopediaCharacter = FALSE;
bEncyclopediaInventory = FALSE;
bEncyclopediaQuests = TRUE;
bBriefingRoom = FALSE;
bBriefingRoomSpecialMission = FALSE;
ResetVal = FALSE;
IDPageEncyData = PAGEENCYCLOPEDIAQUESTS;
if(!fFirstTimeInEncyclopedia) guiCurrentLaptopMode = LAPTOP_MODE_ENCYCLOPEDIA_LOCATION;
}
else if (iReason & MSYS_CALLBACK_REASON_RBUTTON_UP)
{
}
}
void SelectEncyclopediaInentoryButton(MOUSE_REGION * pRegion, INT32 iReason )
{
if (iReason & MSYS_CALLBACK_REASON_INIT)
{
}
else if(iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
{
bEncyclopediaLocation = FALSE;
bEncyclopediaCharacter = FALSE;
bEncyclopediaInventory = TRUE;
bEncyclopediaQuests = FALSE;
bBriefingRoom = FALSE;
bBriefingRoomSpecialMission = FALSE;
ResetVal = FALSE;
IDPageEncyData = PAGEENCYCLOPEDIAINVENTORY;
if(!fFirstTimeInEncyclopedia) guiCurrentLaptopMode = LAPTOP_MODE_ENCYCLOPEDIA_LOCATION;
}
else if (iReason & MSYS_CALLBACK_REASON_RBUTTON_UP)
{
}
}
BOOLEAN InitEncyclopediaDefaults()
{
VOBJECT_DESC VObjectDesc;
// load the Rust bacground graphic and add it
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
//FilenameForBPP("LAPTOP\\rustbackground.sti", VObjectDesc.ImageFile);
FilenameForBPP("ENCYCLOPEDIA\\encyclopediabackground.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiRustEncyclopediaBackGround));
return(TRUE);
}
BOOLEAN RemoveEncyclopediaDefaults()
{
DeleteVideoObjectFromIndex(guiRustEncyclopediaBackGround);
return(TRUE);
}
BOOLEAN DrawEncyclopediaLogoAim()
{
HVOBJECT hLogoEncyklopedia;
// UINT16 x,y, uiPosX, uiPosY;
GetVideoObject(&hLogoEncyklopedia, guiRustEncyclopediaLogoAim);
BltVideoObject(FRAME_BUFFER, hLogoEncyklopedia, 0,ENCYCLOPEDIA_TOC_X, RUSTBACKGROUND_1_Y + 40, VO_BLT_SRCTRANSPARENCY,NULL);
return(TRUE);
}
BOOLEAN DrawEncyclopediaDefaults()
{
HVOBJECT hRustBackGroundHandle;
// UINT16 x,y, uiPosX, uiPosY;
// Blt the rust background
GetVideoObject(&hRustBackGroundHandle, guiRustEncyclopediaBackGround);
BltVideoObject(FRAME_BUFFER, hRustBackGroundHandle, 0,RUSTBACKGROUND_1_X, RUSTBACKGROUND_1_Y, VO_BLT_SRCTRANSPARENCY,NULL);
/*
uiPosY = RUSTBACKGROUND_1_Y;
for(y=0; y<4; y++)
{
uiPosX = RUSTBACKGROUND_1_X;
for(x=0; x<4; x++)
{
BltVideoObject(FRAME_BUFFER, hRustBackGroundHandle, 0,uiPosX, uiPosY, VO_BLT_SRCTRANSPARENCY,NULL);
uiPosX += RUSTBACKGROUND_SIZE_X;
}
uiPosY += RUSTBACKGROUND_SIZE_Y;
}
*/
return(TRUE);
}
BOOLEAN DisplayEncyclopediaSlogan()
{
return(TRUE);
}
BOOLEAN DisplayEncyclopediaCopyright()
{
return(TRUE);
}
+225
View File
@@ -0,0 +1,225 @@
#ifndef __ENCYCLOPEDIA_H
#define __ENCYCLOPEDIA_H
#include "Cursors.h"
#include "soldier profile type.h"
#include "Quests.h"
enum
{
ENCYCLOPEDIA_SLOGAN,
ENCYCLOPEDIA_WARNING_1,
ENCYCLOPEDIA_WARNING_2,
ENCYCLOPEDIA_COPYRIGHT_1,
ENCYCLOPEDIA_COPYRIGHT_2,
ENCYCLOPEDIA_COPYRIGHT_3
};
void GameInitEncyclopedia();
BOOLEAN EnterEncyclopedia();
void ExitEncyclopedia();
void HandleEncyclopedia();
void RenderEncyclopedia();
BOOLEAN RemoveEncyclopediaDefaults();
BOOLEAN InitEncyclopediaDefaults();
BOOLEAN DrawEncyclopediaDefaults();
BOOLEAN DisplayEncyclopediaSlogan();
BOOLEAN DisplayEncyclopediaCopyright();
#define ENCYCLOPEDIA_DECRIPTION_SIZE 1120
#define ENCYCLOPEDIA_NAME_SIZE 160
#define NUM_SECTOR 4*255
#define MAX_ENCYCLOPEDIA_CHARS 500
#define NUM_MAX_TEMP 10000
#define TEXT_NUM_ENC TEXT_NUM_ENCYCLOPEDIA_HELP_TEXT
enum
{
//Locations
NONE_NONE = 0,
LOCATION_CITIES,
LOCATION_SAM,
LOCATION_OTHER,
LOCATION_MINES,
LOCATION_MILITARY,
LOCATION_LABORATORY,
LOCATION_FACTORY,
LOCATION_HOSPITAL,
LOCATION_PRISON,
LOCATION_AIRPORT,
TEXT_NUM_ENCYCLOPEDIA_HELP_TEXT
};
//Profiles
enum
{
PROFIL = 0,
PROFIL_AIM,
PROFIL_MERC,
PROFIL_RPC,
PROFIL_NPC,
PROFIL_VEHICLES,
PROFIL_IMP,
};
//SubGroup
enum
{
PROFIL_NONE = 0,
PROFIL_EPC = 1,
// PROFIL_TERRORIS,
// PROFIL_DEIDRANNA_SOLDIER,
// PROFIL_HICK,
// PROFIL_KINGPIN,
// PROFIL_KINGPIN,
};
typedef struct
{
//Profiles/Locations
UINT32 uiIndex;
CHAR8 szFile[MAX_ENCYCLOPEDIA_CHARS];
CHAR8 szFile2[MAX_ENCYCLOPEDIA_CHARS];
CHAR8 szFile3[MAX_ENCYCLOPEDIA_CHARS];
CHAR8 szFile4[MAX_ENCYCLOPEDIA_CHARS];
CHAR16 Name[ENCYCLOPEDIA_NAME_SIZE];
CHAR16 sDesc1[ENCYCLOPEDIA_DECRIPTION_SIZE];
CHAR16 sDesc2[ENCYCLOPEDIA_DECRIPTION_SIZE];
CHAR16 sDesc3[ENCYCLOPEDIA_DECRIPTION_SIZE];
CHAR16 sDesc4[ENCYCLOPEDIA_DECRIPTION_SIZE];
CHAR16 sDesc5[ENCYCLOPEDIA_DECRIPTION_SIZE];
CHAR16 sDesc6[ENCYCLOPEDIA_DECRIPTION_SIZE];
CHAR16 sDesc7[ENCYCLOPEDIA_DECRIPTION_SIZE];
CHAR16 sDesc8[ENCYCLOPEDIA_DECRIPTION_SIZE];
CHAR16 sDesc9[ENCYCLOPEDIA_DECRIPTION_SIZE];
CHAR16 sDesc10[ENCYCLOPEDIA_DECRIPTION_SIZE];
CHAR16 sDesc11[ENCYCLOPEDIA_DECRIPTION_SIZE];
CHAR16 sDesc12[ENCYCLOPEDIA_DECRIPTION_SIZE];
CHAR16 sDesc13[ENCYCLOPEDIA_DECRIPTION_SIZE];
CHAR16 sDesc14[ENCYCLOPEDIA_DECRIPTION_SIZE];
CHAR16 sDesc15[ENCYCLOPEDIA_DECRIPTION_SIZE];
CHAR16 sDesc16[ENCYCLOPEDIA_DECRIPTION_SIZE];
CHAR16 sDesc17[ENCYCLOPEDIA_DECRIPTION_SIZE];
CHAR16 sDesc18[ENCYCLOPEDIA_DECRIPTION_SIZE];
CHAR16 sDesc19[ENCYCLOPEDIA_DECRIPTION_SIZE];
CHAR16 sDesc20[ENCYCLOPEDIA_DECRIPTION_SIZE];
BOOLEAN Hidden;
CHAR16 sImageDesc1[150];
CHAR16 sImageDesc2[150];
CHAR16 sImageDesc3[150];
CHAR16 sImageDesc4[150];
UINT32 sImagePositionX[4];
UINT32 sImagePositionY[4];
/*
UINT32 sImagePosition1X;
UINT32 sImagePosition1Y;
UINT32 sImagePosition2X;
UINT32 sImagePosition2Y;
UINT32 sImagePosition3X;
UINT32 sImagePosition3Y;
UINT32 sImagePosition4X;
UINT32 sImagePosition4Y;
*/
UINT32 MaxPages;
INT32 MaxImages;
//Only locations
INT32 LocType;
INT16 SectorX;
INT16 SectorY;
INT16 SectorZ;
//Only profiles
INT32 IDProfile;
INT32 subGroup1;
INT32 subCivGroup;
INT32 InventoryClass;
BOOLEAN Filtr;
BOOLEAN enableDesc;
BOOLEAN bvisible;
CHAR16 sCode[150];
CHAR8 sSounds[MAX_ENCYCLOPEDIA_CHARS];
//Quests
INT32 QuestID;
INT32 pQuests;
BOOLEAN SpecialQuestImage;
CHAR8 BeforeImage[MAX_ENCYCLOPEDIA_CHARS];
CHAR8 AfterImage[MAX_ENCYCLOPEDIA_CHARS];
UINT32 ImagePositionQX[10];
UINT32 ImagePositionQY[10];
CHAR16 ImageDescBefore[150];
CHAR16 ImageDescAfter[150];
INT32 NextMission;
UINT32 MissionID;
INT32 CheckMission;
//Inventory
} ENCYCLOPEDIA_LOCATION;
#define MAX_IMAGES 4
#define MAX_PAGES 4
#define MISSIONNOSTARTED 0
#define MISSIONSTART 1
#define MISSIONEND 2
extern ENCYCLOPEDIA_LOCATION gEncyclopediaLocationData[ NUM_SECTOR ];
extern ENCYCLOPEDIA_LOCATION gEncyclopediaProfilesData[ NUM_PROFILES ];
extern ENCYCLOPEDIA_LOCATION gEncyclopediaDataTemp[ NUM_MAX_TEMP ];
extern ENCYCLOPEDIA_LOCATION gEncyclopediaInventoryData[ MAXITEMS ];
extern ENCYCLOPEDIA_LOCATION gEncyclopediaOldProfilesData[ NUM_PROFILES ];
extern ENCYCLOPEDIA_LOCATION gEncyclopediaQuestsData[ MAX_QUESTS ];
extern ENCYCLOPEDIA_LOCATION gBriefingRoomData[ NUM_SECTOR ];
extern ENCYCLOPEDIA_LOCATION gBriefingRoomSpecialMissionData[ NUM_SECTOR ];
typedef struct
{
UINT32 uiIndex;
BOOLEAN Hidden;
BOOLEAN bvisible;
} ENCYCLOPEDIA_PROF_SAVE;
typedef struct
{
UINT32 uiIndex;
BOOLEAN Hidden;
INT32 CheckMission;
} MISSION_SAVE;
//extern MISSION_SAVE saveMissionData[ NUM_SECTOR ];
extern BOOLEAN saveEncyclopediaLocationData[ NUM_SECTOR ];
extern ENCYCLOPEDIA_PROF_SAVE saveEncyclopediaProfilesData[ NUM_PROFILES ];
extern BOOLEAN saveEncyclopediaInventoryData[ MAXITEMS ];
extern BOOLEAN saveEncyclopediaOldProfilesData[ NUM_PROFILES ];
extern BOOLEAN saveEncyclopediaQuestsData[ MAX_QUESTS ];
extern MISSION_SAVE saveBriefingRoomData[ NUM_SECTOR ];
extern MISSION_SAVE saveBriefingRoomSpecialMissionData[ NUM_SECTOR ];
extern void InitEncyklopediaBool();
#endif
File diff suppressed because it is too large Load Diff
+40
View File
@@ -0,0 +1,40 @@
#ifndef __Encyclopedia_Data_H
#define __Encyclopedia_Data_H
#include "Encyclopedia.h"
#include "Encyclopedia_Data.h"
void GameInitEncyclopediaLocation();
BOOLEAN EnterEncyclopediaLocation();
void ExitEncyclopediaLocation();
void HandleEncyclopediaLocation();
void RenderEncyclopediaLocation(BOOLEAN bHidden);
extern BOOLEAN bEncyclopediaLocation;
extern BOOLEAN bEncyclopediaCharacter;
extern BOOLEAN bEncyclopediaInventory;
extern BOOLEAN bEncyclopediaQuests;
extern BOOLEAN bBriefingRoom;
extern BOOLEAN bBriefingRoomSpecialMission;
extern UINT32 IDPageEncyData;
extern void InitData ( BOOLEAN bInit);
extern void UnLoadMenuButtons ();
extern BOOLEAN ResetVal;
extern void CopyToTemp ( ENCYCLOPEDIA_LOCATION *Ency, BOOLEAN bFiltr, INT32 sort, INT32 TypFiltr, BOOLEAN ShowBox );
extern void ResetTemp();
extern BOOLEAN LoadEncyclopediaFromLoadGameFile( HWFILE hFile );
extern BOOLEAN SaveEncyclopediaToSaveGameFile( HWFILE hFile );
#define PAGENONE 0
#define PAGEENCYCLOPEDIALOCATION 1
#define PAGEENCYCLOPEDIACHARACTER 2
#define PAGEENCYCLOPEDIAINVENTORY 3
#define PAGEENCYCLOPEDIAQUESTS 4
#define PAGEBRIEFINGROOM 5
#define PAGEBRIEFINGROOMSPECIALMISSION 6
#endif
+58 -58
View File
@@ -613,79 +613,79 @@ UINT8 IncrementStat( INT32 iStatToIncrement )
switch( iStatToIncrement )
{
case( STRENGTH_ATTRIBUTE ):
if( iCurrentStrength > iMaxAttribute -1 )
if( iCurrentStrength > iMaxAttribute -1 )
{
// too high, leave
return( SLIDER_OUT_OF_RANGE );
}
else
}
else
{
iCurrentStrength++;
iCurrentBonusPoints--;
iCurrentBonusPoints--;
}
break;
case( DEXTERITY_ATTRIBUTE ):
if( iCurrentDexterity > iMaxAttribute -1 )
case( DEXTERITY_ATTRIBUTE ):
if( iCurrentDexterity > iMaxAttribute -1 )
{
// too high, leave
return( SLIDER_OUT_OF_RANGE );
}
else
}
else
{
iCurrentDexterity++;
iCurrentBonusPoints--;
iCurrentBonusPoints--;
}
break;
case( AGILITY_ATTRIBUTE ):
if( iCurrentAgility > iMaxAttribute -1 )
if( iCurrentAgility > iMaxAttribute -1 )
{
// too high, leave
return( SLIDER_OUT_OF_RANGE );
}
else
}
else
{
iCurrentAgility++;
iCurrentBonusPoints--;
iCurrentBonusPoints--;
}
break;
case( WISDOM_ATTRIBUTE ):
if( iCurrentWisdom > iMaxAttribute -1 )
if( iCurrentWisdom > iMaxAttribute -1 )
{
// too high, leave
return( SLIDER_OUT_OF_RANGE );
}
else
}
else
{
iCurrentWisdom++;
iCurrentBonusPoints--;
iCurrentBonusPoints--;
}
break;
case( HEALTH_ATTRIBUTE ):
if( iCurrentHealth > iMaxAttribute -1 )
case( HEALTH_ATTRIBUTE ):
if( iCurrentHealth > iMaxAttribute -1 )
{
// too high, leave
return( SLIDER_OUT_OF_RANGE );
}
else
}
else
{
iCurrentHealth++;
iCurrentBonusPoints--;
iCurrentBonusPoints--;
}
break;
case( LEADERSHIP_ATTRIBUTE ):
if( iCurrentLeaderShip > iMaxAttribute -1 )
if( iCurrentLeaderShip > iMaxAttribute -1 )
{
// too high, leave
return( SLIDER_OUT_OF_RANGE );
}
else
else
{
if( iCurrentLeaderShip == 0)
{
if( DoWeHaveThisManyBonusPoints( iMaxZeroBonus ) == TRUE )
{
iCurrentLeaderShip+=iLeaderShipMinimum;
iCurrentBonusPoints-=iMaxZeroBonus;
iCurrentLeaderShip+=iLeaderShipMinimum;
iCurrentBonusPoints-=iMaxZeroBonus;
fSkillAtZeroWarning = FALSE;
}
else
@@ -695,25 +695,25 @@ UINT8 IncrementStat( INT32 iStatToIncrement )
}
else
{
iCurrentLeaderShip++;
iCurrentBonusPoints--;
iCurrentLeaderShip++;
iCurrentBonusPoints--;
}
}
break;
case( MARKSMANSHIP_SKILL ):
if( iCurrentMarkmanship > iMaxAttribute -1 )
if( iCurrentMarkmanship > iMaxAttribute -1 )
{
// too high, leave
return( SLIDER_OUT_OF_RANGE );
}
else
}
else
{
if( iCurrentMarkmanship == 0)
{
if( DoWeHaveThisManyBonusPoints( iMaxZeroBonus ) == TRUE )
{
iCurrentMarkmanship+=iMarkmanshipMinimum;
iCurrentBonusPoints-=iMaxZeroBonus;
iCurrentMarkmanship+=iMarkmanshipMinimum;
iCurrentBonusPoints-=iMaxZeroBonus;
fSkillAtZeroWarning = FALSE;
}
else
@@ -723,25 +723,25 @@ UINT8 IncrementStat( INT32 iStatToIncrement )
}
else
{
iCurrentMarkmanship++;
iCurrentBonusPoints--;
iCurrentMarkmanship++;
iCurrentBonusPoints--;
}
}
break;
case( MECHANICAL_SKILL ):
if( iCurrentMechanical > iMaxAttribute -1 )
if( iCurrentMechanical > iMaxAttribute -1 )
{
// too high, leave
return( SLIDER_OUT_OF_RANGE );
}
else
}
else
{
if( iCurrentMechanical == 0)
{
if( DoWeHaveThisManyBonusPoints( iMaxZeroBonus ) == TRUE )
{
iCurrentMechanical+=iMechanicalMinimum;
iCurrentBonusPoints-=iMaxZeroBonus;
iCurrentMechanical+=iMechanicalMinimum;
iCurrentBonusPoints-=iMaxZeroBonus;
fSkillAtZeroWarning = FALSE;
}
else
@@ -751,25 +751,25 @@ UINT8 IncrementStat( INT32 iStatToIncrement )
}
else
{
iCurrentMechanical++;
iCurrentBonusPoints--;
iCurrentMechanical++;
iCurrentBonusPoints--;
}
}
break;
case( MEDICAL_SKILL ):
if( iCurrentMedical > iMaxAttribute -1 )
if( iCurrentMedical > iMaxAttribute -1 )
{
// too high, leave
return( SLIDER_OUT_OF_RANGE );
}
else
}
else
{
if( iCurrentMedical == 0)
if( iCurrentMedical == 0)
{
if( DoWeHaveThisManyBonusPoints( iMaxZeroBonus ) == TRUE )
{
iCurrentMedical+=iMedicalMinimum;
iCurrentBonusPoints-=iMaxZeroBonus;
iCurrentMedical+=iMedicalMinimum;
iCurrentBonusPoints-=iMaxZeroBonus;
fSkillAtZeroWarning = FALSE;
}
else
@@ -779,25 +779,25 @@ UINT8 IncrementStat( INT32 iStatToIncrement )
}
else
{
iCurrentMedical++;
iCurrentBonusPoints--;
iCurrentMedical++;
iCurrentBonusPoints--;
}
}
break;
case( EXPLOSIVE_SKILL ):
if( iCurrentExplosives > iMaxAttribute -1 )
if( iCurrentExplosives > iMaxAttribute -1 )
{
// too high, leave
return( SLIDER_OUT_OF_RANGE );
}
else
}
else
{
if( iCurrentExplosives == 0)
{
if( DoWeHaveThisManyBonusPoints( iMaxZeroBonus ) == TRUE )
{
iCurrentExplosives+=iExplosivesMinimum;
iCurrentBonusPoints-=iMaxZeroBonus;
iCurrentExplosives+=iExplosivesMinimum;
iCurrentBonusPoints-=iMaxZeroBonus;
fSkillAtZeroWarning = FALSE;
}
else
@@ -807,8 +807,8 @@ UINT8 IncrementStat( INT32 iStatToIncrement )
}
else
{
iCurrentExplosives++;
iCurrentBonusPoints--;
iCurrentExplosives++;
iCurrentBonusPoints--;
}
}
break;
@@ -1916,7 +1916,7 @@ INT32 GetCurrentAttributeValue( INT32 iAttribute )
void SetAttributes( void )
{
INT32 iExtraPoints = 0;
// added externilized multiplier for starting level - SADNRO
iLevelCostMultiplier = gGameExternalOptions.iIMPStartingLevelCostMultiplier;
+10 -78
View File
@@ -114,9 +114,6 @@ void RenderGender( void );
void DecrementTextEnterMode( void );
void Print8CharacterOnlyString( void );
BOOLEAN CheckCharacterInputForEgg( void );
UINT32 GetCyrillicUnicodeChar( UINT32 uiKey );
UINT32 TranslateKey( UINT32 uiKey, unsigned char* translationTable );
BOOLEAN CheckIsKeyValid( UINT32 uiKey );
// mouse region callbacks
void SelectFullNameRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason );
@@ -589,29 +586,18 @@ void HandleBeginScreenTextEvent( UINT32 uiKey )
break;
default:
//Heinz (18.01.2009): Russian layout
// ViSoR (07.01.2012) : Russian and Belarussian layouts
//
#if defined(RUSSIAN) || defined(BELARUSSIAN)
if( ( (DWORD)GetKeyboardLayout(0) & 0xFFFF ) == 0x419) // Russian
#if defined(RUSSIAN)
if( ( (DWORD)GetKeyboardLayout(0) & 0xFFFF ) == 0x419)
{
unsigned char TranslationTable[] =
" #Ý####ý####á-þ.0123456789ÆæÁ#Þ##ÔÈÑÂÓÀÏÐØÎËÄÜÒÙÇÉÊÛÅÃÌÖ×Íßõ#ú#_¸ôèñâóàïðøîëäüòùçéêûåãìö÷íÿÕ#Ú¨";
uiKey = TranslateKey( uiKey, TranslationTable );
uiKey = GetCyrillicUnicodeChar( uiKey );
unsigned char RussianTranslationTable[] =
" #Ý####ý####á-þ.0123456789ÆæÁ#Þ##ÔÈÑÂÓÀÏÐØÎËÄÜÒÙÇÉÊÛÅÃÌÖ×Íßõ#ú#_¸ôèñâóàïðøîëäüòùçéêûåãìö÷íÿÕ#Ú¨";
if(uiKey >= ' ' && uiKey <= '~') uiKey = RussianTranslationTable[uiKey-' '];
else uiKey = '#';
}
else if ( ( (DWORD)GetKeyboardLayout(0) & 0xFFFF ) == 0x423) // Belarussian
{
unsigned char TranslationTable[] =
" #Ý####ý####á-þ.0123456789ÆæÁ#Þ##Ô²ÑÂÓÀÏÐØÎËÄÜÒ¡ÇÉÊÛÅÃÌÖ×Íßõ#'#_¸ô³ñâóàïðøîëäüò¢çéêûåãìö÷íÿÕ#'¨";
uiKey = TranslateKey( uiKey, TranslationTable );
uiKey = GetCyrillicUnicodeChar( uiKey );
}
else if( !CheckIsKeyValid( uiKey ) )
uiKey = '#';
if( uiKey != '#')
else if( !(uiKey >= 'A' && uiKey <= 'Z' || uiKey >= 'a' && uiKey <= 'z' || uiKey >= '0' && uiKey <= '9' ||
uiKey == '_' || uiKey == '.' || uiKey == ' ') ) uiKey = '#';
if(uiKey != '#')
#else
#ifndef USE_CODE_PAGE
if( uiKey >= 'A' && uiKey <= 'Z' ||
@@ -702,64 +688,10 @@ void HandleBeginScreenTextEvent( UINT32 uiKey )
return;
}
UINT32 GetCyrillicUnicodeChar( UINT32 uiKey )
{
// À - ÿ
if (uiKey >= 192 && uiKey <= 255)
uiKey += 0x0350;
// ¨
if (uiKey == 168)
uiKey = 0x0401;
// ¸
if (uiKey == 184)
uiKey = 0x0451;
// ¡
if (uiKey == 161)
uiKey = 0x040E;
// ¢
if (uiKey == 162)
uiKey = 0x045E;
// ²
if (uiKey == 178)
uiKey = 0x0406;
// ³
if (uiKey == 179)
uiKey = 0x0456;
return uiKey;
}
BOOLEAN CheckIsKeyValid( UINT32 uiKey )
{
if( uiKey >= 'A' && uiKey <= 'Z' ||
uiKey >= 'a' && uiKey <= 'z' ||
uiKey >= '0' && uiKey <= '9' ||
uiKey == '_' ||
uiKey == '.' ||
uiKey == ' ')
return TRUE;
else
return FALSE;
}
UINT32 TranslateKey( UINT32 uiKey, unsigned char* translationTable )
{
if( uiKey >= ' ' && uiKey <= '~' )
uiKey = translationTable[uiKey-' '];
else
uiKey = '#';
return uiKey;
}
void DisplayFullNameStringCursor( void )
{
{
// this procdure will draw the activation string cursor on the screen at position cursorx cursory
UINT32 uiDestPitchBYTES;
static UINT32 uiBaseTime = 0;
+2 -2
View File
@@ -364,13 +364,13 @@ void BtnIMPConfirmYes(GUI_BUTTON *btn,INT32 reason)
//Kaiden: Below is the Imp personality E-mail as it was.
/*
// send email notice
//AddEmail(IMP_EMAIL_PROFILE_RESULTS, IMP_EMAIL_PROFILE_RESULTS_LENGTH, IMP_PROFILE_RESULTS, GetWorldTotalMin( ) );
//AddEmail(IMP_EMAIL_PROFILE_RESULTS, IMP_EMAIL_PROFILE_RESULTS_LENGTH, IMP_PROFILE_RESULTS, GetWorldTotalMin( ),TYPE_EMAIL_NONE );
AddFutureDayStrategicEvent( EVENT_DAY2_ADD_EMAIL_FROM_IMP, 60 * 7, 0, 2 );
*/
//Kaiden: And here is my Answer to the IMP E-mails only
// profiling the last IMP made. You get the results immediately
AddEmail(IMP_EMAIL_PROFILE_RESULTS, IMP_EMAIL_PROFILE_RESULTS_LENGTH, IMP_PROFILE_RESULTS, GetWorldTotalMin( ), LaptopSaveInfo.iIMPIndex, -1 );
AddEmail(IMP_EMAIL_PROFILE_RESULTS, IMP_EMAIL_PROFILE_RESULTS_LENGTH, IMP_PROFILE_RESULTS, GetWorldTotalMin( ), LaptopSaveInfo.iIMPIndex, -1, TYPE_EMAIL_EMAIL_EDT);
//RenderCharProfile( );
+14 -3
View File
@@ -30,6 +30,10 @@
#include "Squads.h"
#endif
#ifdef JA2UB
#include "ub_config.h"
#endif
void GetPlayerKeyBoardInputForIMPHomePage( void );
void DisplayPlayerActivationString( void );
void ProcessPlayerInputActivationString( void );
@@ -403,9 +407,12 @@ void ProcessPlayerInputActivationString( void )
{
freeMercSlot = FALSE;
}
#ifdef JA2UB
if( ( ( gGameUBOptions.LaptopIMPPassJA2 == TRUE && wcscmp(pPlayerActivationString, L"XEP624") == 0 ) || ( gGameUBOptions.LaptopIMPPassJA2 == TRUE && wcscmp(pPlayerActivationString, L"xep624") == 0 ) ) || ( ( gGameUBOptions.LaptopIMPPassUB == TRUE && wcscmp(pPlayerActivationString, L"GP97SL") == 0 ) || ( gGameUBOptions.LaptopIMPPassUB == TRUE && wcscmp(pPlayerActivationString, L"gp97sl") == 0 ) ) && ( LaptopSaveInfo.gfNewGameLaptop < 2 ) )
#else
//Madd multiple imps if( ( ( wcscmp(pPlayerActivationString, L"XEP624") == 0 ) || ( wcscmp(pPlayerActivationString, L"xep624") == 0 ) )&&( LaptopSaveInfo.fIMPCompletedFlag == FALSE ) &&( LaptopSaveInfo.gfNewGameLaptop < 2 ) )
if( ( ( wcscmp(pPlayerActivationString, L"XEP624") == 0 ) || ( wcscmp(pPlayerActivationString, L"xep624") == 0 ) ) &&( LaptopSaveInfo.gfNewGameLaptop < 2 ) )
#endif
{
// WANNE: Check total number of hired mercs
if( freeMercSlot == FALSE )
@@ -444,7 +451,7 @@ void ProcessPlayerInputActivationString( void )
ResetActivationStringTextBox();
//DoLapTopMessageBox( MSG_BOX_IMP_STYLE, pImpPopUpStrings[ 11 ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL);
AddEmail(IMP_EMAIL_PROFILE_RESULTS, IMP_EMAIL_PROFILE_RESULTS_LENGTH, IMP_PROFILE_RESULTS, GetWorldTotalMin( ), LaptopSaveInfo.iIMPIndex, -1 );
AddEmail(IMP_EMAIL_PROFILE_RESULTS, IMP_EMAIL_PROFILE_RESULTS_LENGTH, IMP_PROFILE_RESULTS, GetWorldTotalMin( ), LaptopSaveInfo.iIMPIndex, -1 , TYPE_EMAIL_EMAIL_EDT);
}
}
else
@@ -470,7 +477,7 @@ void ProcessPlayerInputActivationString( void )
ResetActivationStringTextBox();
//DoLapTopMessageBox( MSG_BOX_IMP_STYLE, pImpPopUpStrings[ 11 ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL);
AddEmail(IMP_EMAIL_PROFILE_RESULTS, IMP_EMAIL_PROFILE_RESULTS_LENGTH, IMP_PROFILE_RESULTS, GetWorldTotalMin( ), LaptopSaveInfo.iIMPIndex, -1 );
AddEmail(IMP_EMAIL_PROFILE_RESULTS, IMP_EMAIL_PROFILE_RESULTS_LENGTH, IMP_PROFILE_RESULTS, GetWorldTotalMin( ), LaptopSaveInfo.iIMPIndex, -1 , TYPE_EMAIL_EMAIL_EDT);
}
}
else
@@ -480,7 +487,11 @@ void ProcessPlayerInputActivationString( void )
}
else
{
#ifdef JA2UB
if( ( ( gGameUBOptions.LaptopIMPPassJA2 == TRUE && wcscmp(pPlayerActivationString, L"XEP624") != 0 ) && ( gGameUBOptions.LaptopIMPPassJA2 == TRUE && wcscmp(pPlayerActivationString, L"xep624") != 0 ) ) || ( ( gGameUBOptions.LaptopIMPPassUB == TRUE && wcscmp(pPlayerActivationString, L"GP97SL") != 0 ) && ( gGameUBOptions.LaptopIMPPassUB == TRUE && wcscmp(pPlayerActivationString, L"gp97sl") != 0 ) ) )
#else
if( ( ( wcscmp(pPlayerActivationString, L"XEP624") != 0 ) && ( wcscmp(pPlayerActivationString, L"xep624") != 0 ) ) )
#endif
{
DoLapTopMessageBox( MSG_BOX_IMP_STYLE, pImpPopUpStrings[ 0 ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL);
}
+17 -6
View File
@@ -775,7 +775,7 @@ INT8 GetLastSelectedMinorTrait( void )
UINT8 StrengthRequiredAdjustmentForMinorTraits( INT32 iInitialValue )
{
// Only for new trait system
if (!gGameOptions.fNewTraitSystem)
if (!gGameOptions.fNewTraitSystem || !gSkillTraitValues.fAllowAttributePrereq)
{
return 0;
}
@@ -799,7 +799,7 @@ UINT8 StrengthRequiredAdjustmentForMinorTraits( INT32 iInitialValue )
UINT8 DexterityRequiredAdjustmentForMinorTraits( INT32 iInitialValue )
{
// Only for new trait system
if (!gGameOptions.fNewTraitSystem)
if (!gGameOptions.fNewTraitSystem || !gSkillTraitValues.fAllowAttributePrereq)
{
return 0;
}
@@ -852,7 +852,7 @@ UINT8 DexterityRequiredAdjustmentForMinorTraits( INT32 iInitialValue )
UINT8 AgilityRequiredAdjustmentForMinorTraits( INT32 iInitialValue )
{
// Only for new trait system
if (!gGameOptions.fNewTraitSystem)
if (!gGameOptions.fNewTraitSystem || !gSkillTraitValues.fAllowAttributePrereq)
{
return 0;
}
@@ -905,7 +905,7 @@ UINT8 AgilityRequiredAdjustmentForMinorTraits( INT32 iInitialValue )
UINT8 HealthRequiredAdjustmentForMinorTraits( INT32 iInitialValue )
{
// Only for new trait system
if (!gGameOptions.fNewTraitSystem)
if (!gGameOptions.fNewTraitSystem || !gSkillTraitValues.fAllowAttributePrereq)
{
return 0;
}
@@ -930,7 +930,7 @@ UINT8 HealthRequiredAdjustmentForMinorTraits( INT32 iInitialValue )
UINT8 WisdomRequiredAdjustmentForMinorTraits( INT32 iInitialValue )
{
// Only for new trait system
if (!gGameOptions.fNewTraitSystem)
if (!gGameOptions.fNewTraitSystem || !gSkillTraitValues.fAllowAttributePrereq)
{
return 0;
}
@@ -983,7 +983,7 @@ UINT8 WisdomRequiredAdjustmentForMinorTraits( INT32 iInitialValue )
UINT8 LeaderShipRequiredAdjustmentForMinorTraits( INT32 iInitialValue )
{
// Only for new trait system
if (!gGameOptions.fNewTraitSystem)
if (!gGameOptions.fNewTraitSystem || !gSkillTraitValues.fAllowAttributePrereq)
{
return 0;
}
@@ -1022,6 +1022,12 @@ UINT8 MedicalRequiredAdjustmentForMinorTraits( INT32 iInitialValue )
}
UINT8 ExplosivesRequiredAdjustmentForMinorTraits( INT32 iInitialValue )
{
// Only for new trait system
if (!gGameOptions.fNewTraitSystem || !gSkillTraitValues.fAllowAttributePrereq)
{
return 0;
}
if ( gfMinorTraitQuestions[ IMP_SKILL_TRAITS_NEW_DEMOLITIONS ] )
{
// 60 is minimum, +10 is addition to other preset requirements
@@ -1249,6 +1255,11 @@ void AssignMinorTraitHelpText( UINT8 ubNumber )
swprintf( atStr, gzIMPMinorTraitsHelpTextsStealthy[2], gSkillTraitValues.ubSTStealthBonus, L"%");
wcscat( apStr, atStr );
}
if( gSkillTraitValues.ubSTReducedAPsRegistered != 0 && gGameExternalOptions.fImprovedInterruptSystem )
{
swprintf( atStr, gzIMPMinorTraitsHelpTextsStealthy[4], gSkillTraitValues.ubSTReducedAPsRegistered, L"%");
wcscat( apStr, atStr );
}
if( gSkillTraitValues.ubSTStealthPenaltyForMovingReduction != 0 )
{
swprintf( atStr, gzIMPMinorTraitsHelpTextsStealthy[3], gSkillTraitValues.ubSTStealthPenaltyForMovingReduction, L"%");
+20 -10
View File
@@ -1312,7 +1312,7 @@ INT8 GetLastSelectedSkill( void )
INT32 StrengthRequiredDueToMajorSkills( void )
{
// Only for new trait system
if (!gGameOptions.fNewTraitSystem)
if (!gGameOptions.fNewTraitSystem || !gSkillTraitValues.fAllowAttributePrereq)
{
return 0;
}
@@ -1358,7 +1358,7 @@ INT32 StrengthRequiredDueToMajorSkills( void )
INT32 AgilityRequiredDueToMajorSkills( void )
{
// Only for new trait system
if (!gGameOptions.fNewTraitSystem)
if (!gGameOptions.fNewTraitSystem || !gSkillTraitValues.fAllowAttributePrereq)
{
return 0;
}
@@ -1404,7 +1404,7 @@ INT32 AgilityRequiredDueToMajorSkills( void )
INT32 DexterityRequiredDueToMajorSkills( void )
{
// Only for new trait system
if (!gGameOptions.fNewTraitSystem)
if (!gGameOptions.fNewTraitSystem || !gSkillTraitValues.fAllowAttributePrereq)
{
return 0;
}
@@ -1494,7 +1494,7 @@ INT32 DexterityRequiredDueToMajorSkills( void )
INT32 HealthRequiredDueToMajorSkills( void )
{
// Only for new trait system
if (!gGameOptions.fNewTraitSystem)
if (!gGameOptions.fNewTraitSystem || !gSkillTraitValues.fAllowAttributePrereq)
{
return 0;
}
@@ -1540,7 +1540,7 @@ INT32 HealthRequiredDueToMajorSkills( void )
INT32 LeadershipRequiredDueToMajorSkills( void )
{
// Only for new trait system
if (!gGameOptions.fNewTraitSystem)
if (!gGameOptions.fNewTraitSystem || !gSkillTraitValues.fAllowAttributePrereq)
{
return 0;
}
@@ -1575,7 +1575,7 @@ INT32 LeadershipRequiredDueToMajorSkills( void )
INT32 WisdomRequiredDueToMajorSkills( void )
{
// Only for new trait system
if (!gGameOptions.fNewTraitSystem)
if (!gGameOptions.fNewTraitSystem || !gSkillTraitValues.fAllowAttributePrereq)
{
return 0;
}
@@ -1643,7 +1643,7 @@ INT32 WisdomRequiredDueToMajorSkills( void )
INT32 MarksmanshipRequiredDueToMajorSkills( void )
{
// Only for new trait system
if (!gGameOptions.fNewTraitSystem)
if (!gGameOptions.fNewTraitSystem || !gSkillTraitValues.fAllowAttributePrereq)
{
return 0;
}
@@ -1700,7 +1700,7 @@ INT32 MarksmanshipRequiredDueToMajorSkills( void )
INT32 MechanicalRequiredDueToMajorSkills( void )
{
// Only for new trait system
if (!gGameOptions.fNewTraitSystem)
if (!gGameOptions.fNewTraitSystem || !gSkillTraitValues.fAllowAttributePrereq)
{
return 0;
}
@@ -1724,7 +1724,7 @@ INT32 MechanicalRequiredDueToMajorSkills( void )
INT32 MedicalRequiredDueToMajorSkills( void )
{
// Only for new trait system
if (!gGameOptions.fNewTraitSystem)
if (!gGameOptions.fNewTraitSystem || !gSkillTraitValues.fAllowAttributePrereq)
{
return 0;
}
@@ -1748,7 +1748,7 @@ INT32 MedicalRequiredDueToMajorSkills( void )
INT32 ExplosivesRequiredDueToMajorSkills( void )
{
// Only for new trait system
if (!gGameOptions.fNewTraitSystem)
if (!gGameOptions.fNewTraitSystem || !gSkillTraitValues.fAllowAttributePrereq)
{
return 0;
}
@@ -2148,6 +2148,11 @@ void AssignSkillTraitHelpText( UINT8 ubTraitNumber, BOOLEAN fExpertLevel )
wcscat( apStr, atStr );
}
}
if( gSkillTraitValues.ubMAReducedAPsRegisteredWhenMoving != 0 && gGameExternalOptions.fImprovedInterruptSystem )
{
swprintf( atStr, gzIMPMajorTraitsHelpTextsMartialArts[27], ( gSkillTraitValues.ubMAReducedAPsRegisteredWhenMoving * (fExpertLevel ? 2 : 1)), L"%");
wcscat( apStr, atStr );
}
if( gSkillTraitValues.ubMAChanceToCkickDoors != 0 )
{
swprintf( atStr, gzIMPMajorTraitsHelpTextsMartialArts[25], ( gSkillTraitValues.ubMAChanceToCkickDoors * (fExpertLevel ? 2 : 1)), L"%");
@@ -2180,6 +2185,11 @@ void AssignSkillTraitHelpText( UINT8 ubTraitNumber, BOOLEAN fExpertLevel )
swprintf( atStr, gzIMPMajorTraitsHelpTextsSquadleader[2], ( gSkillTraitValues.ubSLEffectiveLevelAsStandby * (fExpertLevel ? 2 : 1)));
wcscat( apStr, atStr );
}
if( gSkillTraitValues.ubSLCollectiveInterruptsBonus != 0 && gGameExternalOptions.fImprovedInterruptSystem )
{
swprintf( atStr, gzIMPMajorTraitsHelpTextsSquadleader[11], ( gSkillTraitValues.ubSLCollectiveInterruptsBonus * (fExpertLevel ? 2 : 1)), L"%");
wcscat( apStr, atStr );
}
if( gSkillTraitValues.ubSLOverallSuppresionBonusPercent != 0 )
{
swprintf( atStr, gzIMPMajorTraitsHelpTextsSquadleader[3], ( gSkillTraitValues.ubSLOverallSuppresionBonusPercent * (fExpertLevel ? 2 : 1)), L"%", (fExpertLevel ? gzIMPSkillTraitsTextNewMajor[ubTraitNumber + 11] : gzIMPSkillTraitsTextNewMajor[ubTraitNumber]));
+41 -2
View File
@@ -17,6 +17,32 @@
#include "GameSettings.h"
#include "Text.h"
#include "_Ja25Englishtext.h"
#ifdef JA2UB
#include "laptop.h"
#include "email.h"
#include "Utilities.h"
#include "WCheck.h"
#include "Debug.h"
#include "WordWrap.h"
#include "Render Dirty.h"
#include "Encrypted File.h"
#include "cursors.h"
#include "soldier profile.h"
#include "IMP Compile Character.h"
#include "IMP Voices.h"
#include "IMP Portraits.h"
#include "Game Clock.h"
#include "environment.h"
#include "AimMembers.h"
#include "Random.h"
#include "Text.h"
#include "LaptopSave.h"
#include "finances.h"
#include "PostalService.h"
#include "faces.h"
#include "GameSettings.h"
#endif
#endif
#define IMP_SEEK_AMOUNT 5 * 80 * 2
@@ -46,8 +72,10 @@ void OffSetQuestionForFemaleSpecificQuestions( INT32 *iCurrentOffset );
#define QTN_FIRST_COLUMN_X iScreenWidthOffset + 80
#define QTN_SECOND_COLUMN_X iScreenWidthOffset + 320
#ifdef JA2UB
#define IMPTEXT_EDT_FILE_JA25 "BINARYDATA\\IMPText25.edt"
#define IMPTEXT_EDT_FILE_JA2 "BINARYDATA\\IMPText.edt"
#endif
void LoadAndDisplayIMPText( INT16 sStartX, INT16 sStartY, INT16 sLineLength, INT16 sIMPTextRecordNumber, UINT32 uiFont, UINT8 ubColor, BOOLEAN fShadow, UINT32 uiFlags)
{
@@ -62,7 +90,18 @@ void LoadAndDisplayIMPText( INT16 sStartX, INT16 sStartY, INT16 sLineLength, INT
}
// load the string
#ifdef JA2UB
if (FileExists(IMPTEXT_EDT_FILE_JA25))
{
LoadEncryptedDataFromFile(IMPTEXT_EDT_FILE_JA25, sString, ( UINT32 ) ( ( sIMPTextRecordNumber ) * IMP_SEEK_AMOUNT ), IMP_SEEK_AMOUNT);
}
else
{
LoadEncryptedDataFromFile(IMPTEXT_EDT_FILE_JA2, sString, ( UINT32 ) ( ( sIMPTextRecordNumber ) * IMP_SEEK_AMOUNT ), IMP_SEEK_AMOUNT);
}
#else
LoadEncryptedDataFromFile("BINARYDATA\\IMPText.EDT", sString, ( UINT32 ) ( ( sIMPTextRecordNumber ) * IMP_SEEK_AMOUNT ), IMP_SEEK_AMOUNT);
#endif
// null put last char
sString[ wcslen( sString) ] = 0;
+48
View File
@@ -402,6 +402,14 @@
RelativePath=".\BobbyRUsed.h"
>
</File>
<File
RelativePath=".\BriefingRoom.h"
>
</File>
<File
RelativePath=".\BriefingRoomM.h"
>
</File>
<File
RelativePath=".\BrokenLink.h"
>
@@ -414,6 +422,14 @@
RelativePath=".\email.h"
>
</File>
<File
RelativePath=".\Encyclopedia.h"
>
</File>
<File
RelativePath=".\Encyclopedia_Data.h"
>
</File>
<File
RelativePath=".\files.h"
>
@@ -680,6 +696,14 @@
RelativePath=".\BobbyRUsed.cpp"
>
</File>
<File
RelativePath=".\BriefingRoom.cpp"
>
</File>
<File
RelativePath=".\BriefingRoomM.cpp"
>
</File>
<File
RelativePath=".\BrokenLink.cpp"
>
@@ -692,6 +716,14 @@
RelativePath=".\email.cpp"
>
</File>
<File
RelativePath=".\Encyclopedia.cpp"
>
</File>
<File
RelativePath=".\Encyclopedia_Data.cpp"
>
</File>
<File
RelativePath=".\files.cpp"
>
@@ -880,6 +912,22 @@
RelativePath=".\XML_DeliveryMethods.cpp"
>
</File>
<File
RelativePath=".\XML_Email.cpp"
>
</File>
<File
RelativePath=".\XML_EmailMercAvailable.cpp"
>
</File>
<File
RelativePath=".\XML_EmailMercLevelUp.cpp"
>
</File>
<File
RelativePath=".\XML_EncyclopediaLocation.cpp"
>
</File>
<File
RelativePath=".\XML_IMPPortraits.cpp"
>
+48
View File
@@ -403,6 +403,14 @@
RelativePath="BobbyRUsed.h"
>
</File>
<File
RelativePath=".\BriefingRoom.h"
>
</File>
<File
RelativePath=".\BriefingRoomM.h"
>
</File>
<File
RelativePath="BrokenLink.h"
>
@@ -415,6 +423,14 @@
RelativePath="email.h"
>
</File>
<File
RelativePath=".\Encyclopedia.h"
>
</File>
<File
RelativePath=".\Encyclopedia_Data.h"
>
</File>
<File
RelativePath="files.h"
>
@@ -679,6 +695,14 @@
RelativePath="BobbyRUsed.cpp"
>
</File>
<File
RelativePath=".\BriefingRoom.cpp"
>
</File>
<File
RelativePath=".\BriefingRoomM.cpp"
>
</File>
<File
RelativePath="BrokenLink.cpp"
>
@@ -691,6 +715,14 @@
RelativePath="email.cpp"
>
</File>
<File
RelativePath=".\Encyclopedia.cpp"
>
</File>
<File
RelativePath=".\Encyclopedia_Data.cpp"
>
</File>
<File
RelativePath="files.cpp"
>
@@ -883,6 +915,22 @@
RelativePath=".\XML_DeliveryMethods.cpp"
>
</File>
<File
RelativePath=".\XML_Email.cpp"
>
</File>
<File
RelativePath=".\XML_EmailMercAvailable.cpp"
>
</File>
<File
RelativePath=".\XML_EmailMercLevelUp.cpp"
>
</File>
<File
RelativePath=".\XML_EncyclopediaLocation.cpp"
>
</File>
<File
RelativePath=".\XML_IMPPortraits.cpp"
>
+12
View File
@@ -39,9 +39,13 @@
<ClInclude Include="BobbyRMisc.h" />
<ClInclude Include="BobbyRShipments.h" />
<ClInclude Include="BobbyRUsed.h" />
<ClInclude Include="BriefingRoom.h" />
<ClInclude Include="BriefingRoomM.h" />
<ClInclude Include="BrokenLink.h" />
<ClInclude Include="CharProfile.h" />
<ClInclude Include="email.h" />
<ClInclude Include="Encyclopedia.h" />
<ClInclude Include="Encyclopedia_Data.h" />
<ClInclude Include="files.h" />
<ClInclude Include="finances.h" />
<ClInclude Include="florist Cards.h" />
@@ -109,9 +113,13 @@
<ClCompile Include="BobbyRMisc.cpp" />
<ClCompile Include="BobbyRShipments.cpp" />
<ClCompile Include="BobbyRUsed.cpp" />
<ClCompile Include="BriefingRoom.cpp" />
<ClCompile Include="BriefingRoomM.cpp" />
<ClCompile Include="BrokenLink.cpp" />
<ClCompile Include="CharProfile.cpp" />
<ClCompile Include="email.cpp" />
<ClCompile Include="Encyclopedia.cpp" />
<ClCompile Include="Encyclopedia_Data.cpp" />
<ClCompile Include="files.cpp" />
<ClCompile Include="finances.cpp" />
<ClCompile Include="florist Cards.cpp" />
@@ -160,6 +168,10 @@
<ClCompile Include="XML_AIMAvailability.cpp" />
<ClCompile Include="XML_ConditionsForMercAvailability.cpp" />
<ClCompile Include="XML_DeliveryMethods.cpp" />
<ClCompile Include="XML_Email.cpp" />
<ClCompile Include="XML_EmailMercAvailable.cpp" />
<ClCompile Include="XML_EmailMercLevelUp.cpp" />
<ClCompile Include="XML_EncyclopediaLocation.cpp" />
<ClCompile Include="XML_IMPPortraits.cpp" />
<ClCompile Include="XML_ShippingDestinations.cpp" />
</ItemGroup>
+36
View File
@@ -213,6 +213,18 @@
<ClInclude Include="Store Inventory.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="BriefingRoom.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="BriefingRoomM.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Encyclopedia.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Encyclopedia_Data.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="aim.cpp">
@@ -422,5 +434,29 @@
<ClCompile Include="XML_ConditionsForMercAvailability.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="XML_EmailMercAvailable.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="XML_EmailMercLevelUp.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="BriefingRoom.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="BriefingRoomM.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Encyclopedia.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Encyclopedia_Data.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="XML_EncyclopediaLocation.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="XML_Email.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
+22 -3
View File
@@ -19,6 +19,10 @@
#include "connect.h"
#include "Strategic Event Handler.h"
#ifdef JA2UB
#include "ub_config.h"
#endif
using namespace std;
/************************************************************************************/
@@ -526,14 +530,29 @@ BOOLEAN CPostalService::DeliverShipment(UINT16 usShipmentID)
// WANNE - MP: Do not send email notification from Bobby Ray in a multiplayer game
if (!is_networked)
{
StopTimeCompression();
StopTimeCompression();
#ifdef JA2UB
//no UB
if ( gGameUBOptions.fBobbyRSite == TRUE )
{
// Shipment from Bobby Ray
if (shs.sSenderID == BOBBYR_SENDER_ID)
AddBobbyREmailJA2( 198, 4, BOBBY_R, GetWorldTotalMin(), -1, gusCurShipmentDestinationID, TYPE_EMAIL_BOBBY_R_EMAIL_JA2_EDT);
// Shipment from John Kulba
//else
// AddEmail( JOHN_KULBA_GIFT_IN_DRASSEN, JOHN_KULBA_GIFT_IN_DRASSEN_LENGTH, JOHN_KULBA, GetWorldTotalMin(), -1, gusCurShipmentDestinationID, TYPE_EMAIL_EMAIL_EDT);
}
#else
// Shipment from Bobby Ray
if (shs.sSenderID == BOBBYR_SENDER_ID)
AddEmail( BOBBYR_SHIPMENT_ARRIVED, BOBBYR_SHIPMENT_ARRIVED_LENGTH, BOBBY_R, GetWorldTotalMin(), -1, gusCurShipmentDestinationID);
AddEmail( BOBBYR_SHIPMENT_ARRIVED, BOBBYR_SHIPMENT_ARRIVED_LENGTH, BOBBY_R, GetWorldTotalMin(), -1, gusCurShipmentDestinationID, TYPE_EMAIL_EMAIL_EDT);
// Shipment from John Kulba
else
AddEmail( JOHN_KULBA_GIFT_IN_DRASSEN, JOHN_KULBA_GIFT_IN_DRASSEN_LENGTH, JOHN_KULBA, GetWorldTotalMin(), -1, gusCurShipmentDestinationID);
AddEmail( JOHN_KULBA_GIFT_IN_DRASSEN, JOHN_KULBA_GIFT_IN_DRASSEN_LENGTH, JOHN_KULBA, GetWorldTotalMin(), -1, gusCurShipmentDestinationID, TYPE_EMAIL_EMAIL_EDT);
#endif
}
shs.ShipmentPackages.clear();
+151
View File
@@ -2,6 +2,156 @@
#define _SPECK_QUOTES_H_
//Enum,s for all of specks quotes
#ifdef JA2UB
enum
{
/*
Ja25: no longer in game
SPECK_QUOTE_FIRST_TIME_IN_0, //0
SPECK_QUOTE_FIRST_TIME_IN_1,
SPECK_QUOTE_FIRST_TIME_IN_2,
SPECK_QUOTE_FIRST_TIME_IN_3,
SPECK_QUOTE_FIRST_TIME_IN_4,
SPECK_QUOTE_FIRST_TIME_IN_5,
SPECK_QUOTE_FIRST_TIME_IN_6,
SPECK_QUOTE_FIRST_TIME_IN_7,
SPECK_QUOTE_FIRST_TIME_IN_8,
SPECK_QUOTE_THANK_PLAYER_FOR_OPENING_ACCOUNT,
SPECK_QUOTE_ALTERNATE_OPENING_1_TOUGH_START, //10
SPECK_QUOTE_ALTERNATE_OPENING_2_BUSINESS_BAD,
SPECK_QUOTE_ALTERNATE_OPENING_3_BUSINESS_GOOD,
SPECK_QUOTE_ALTERNATE_OPENING_4_TRYING_TO_RECRUIT,
SPECK_QUOTE_ALTERNATE_OPENING_5_PLAYER_OWES_SPECK_ACCOUNT_SUSPENDED,
SPECK_QUOTE_ALTERNATE_OPENING_6_PLAYER_OWES_SPECK_ALMOST_BANKRUPT_1,
SPECK_QUOTE_ALTERNATE_OPENING_6_PLAYER_OWES_SPECK_ALMOST_BANKRUPT_2,
SPECK_QUOTE_ALTERNATE_OPENING_7_PLAYER_ACCOUNT_OK,
SPECK_QUOTE_ALTERNATE_OPENING_8_MADE_PARTIAL_PAYMENT,
SPECK_QUOTE_ALTERNATE_OPENING_9_FIRST_VISIT_SINCE_SERVER_WENT_DOWN,
SPECK_QUOTE_ALTERNATE_OPENING_10_GENERIC_OPENING, //20
SPECK_QUOTE_ALTERNATE_OPENING_10_TAG_FOR_20,
SPECK_QUOTE_ALTERNATE_OPENING_11_NEW_MERCS_AVAILABLE,
*/
SPECK_QUOTE_ALTERNATE_OPENING_12_PLAYERS_LOST_MERCS =23,
/*
Ja25: no longer in game
SPECK_QUOTE_ALTERNATE_OPENING_TAG_PLAYER_OWES_MONEY,
SPECK_QUOTE_ALTERNATE_OPENING_TAG_PLAYER_CLEARED_DEBT,
SPECK_QUOTE_ALTERNATE_OPENING_TAG_PLAYER_CLEARED_OVERDUE_ACCOUNT,
SPECK_QUOTE_ALTERNATE_OPENING_TAG_FIRST_MERC_DIES,
*/
SPECK_QUOTE_ALTERNATE_OPENING_TAG_BIFF_IS_DEAD =28,
SPECK_QUOTE_ALTERNATE_OPENING_TAG_HAYWIRE_IS_DEAD,
SPECK_QUOTE_ALTERNATE_OPENING_TAG_GASKET_IS_DEAD, //30
SPECK_QUOTE_ALTERNATE_OPENING_TAG_RAZOR_IS_DEAD,
SPECK_QUOTE_ALTERNATE_OPENING_TAG_FLO_IS_DEAD_BIFF_ALIVE,
SPECK_QUOTE_ALTERNATE_OPENING_TAG_FLO_IS_DEAD_BIFF_IS_DEAD,
/*
Ja25: no longer in game
SPECK_QUOTE_ALTERNATE_OPENING_TAG_FLO_MARRIED_A_COUSIN_BIFF_IS_ALIVE,
*/
SPECK_QUOTE_ALTERNATE_OPENING_TAG_GUMPY_IS_DEAD =35,
SPECK_QUOTE_ALTERNATE_OPENING_TAG_LARRY_IS_DEAD,
SPECK_QUOTE_ALTERNATE_OPENING_TAG_LARRY_RELAPSED,
SPECK_QUOTE_ALTERNATE_OPENING_TAG_COUGER_IS_DEAD,
SPECK_QUOTE_ALTERNATE_OPENING_TAG_NUMB_IS_DEAD,
SPECK_QUOTE_ALTERNATE_OPENING_TAG_BUBBA_IS_DEAD, //40
SPECK_QUOTE_ALTERNATE_OPENING_TAG_ON_AFTER_OTHER_TAGS_1,
SPECK_QUOTE_ALTERNATE_OPENING_TAG_ON_AFTER_OTHER_TAGS_2,
/*
Ja25: no longer in game
SPECK_QUOTE_ALTERNATE_OPENING_TAG_ON_AFTER_OTHER_TAGS_3,
SPECK_QUOTE_ALTERNATE_OPENING_TAG_ON_AFTER_OTHER_TAGS_4,
SPECK_QUOTE_PLAYER_MAKES_FULL_PAYMENT,
SPECK_QUOTE_PLAYER_MAKES_PARTIAL_PAYMENT,
*/
SPECK_QUOTE_PLAYER_NOT_DOING_ANYTHING_SPECK_SELLS_BIFF =47,
SPECK_QUOTE_PLAYER_NOT_DOING_ANYTHING_SPECK_SELLS_HAYWIRE,
SPECK_QUOTE_PLAYER_NOT_DOING_ANYTHING_SPECK_SELLS_GASKET,
SPECK_QUOTE_PLAYER_NOT_DOING_ANYTHING_SPECK_SELLS_RAZOR, //50
SPECK_QUOTE_PLAYER_NOT_DOING_ANYTHING_SPECK_SELLS_FLO,
SPECK_QUOTE_PLAYER_NOT_DOING_ANYTHING_SPECK_SELLS_GUMPY,
SPECK_QUOTE_PLAYER_NOT_DOING_ANYTHING_SPECK_SELLS_LARRY,
SPECK_QUOTE_PLAYER_NOT_DOING_ANYTHING_SPECK_SELLS_COUGER,
SPECK_QUOTE_PLAYER_NOT_DOING_ANYTHING_SPECK_SELLS_NUMB,
SPECK_QUOTE_PLAYER_NOT_DOING_ANYTHING_SPECK_SELLS_BUBBA,
/*
Ja25: no longer in game
SPECK_QUOTE_PLAYER_NOT_DOING_ANYTHING_TAG_GETTING_MORE_MERCS,
*/
SPECK_QUOTE_PLAYER_NOT_DOING_ANYTHING_AIM_SLANDER_1=58,
SPECK_QUOTE_PLAYER_NOT_DOING_ANYTHING_AIM_SLANDER_2,
SPECK_QUOTE_PLAYER_NOT_DOING_ANYTHING_AIM_SLANDER_3, //60
SPECK_QUOTE_PLAYER_NOT_DOING_ANYTHING_AIM_SLANDER_4,
SPECK_QUOTE_BIFF_UNAVALIABLE,
SPECK_QUOTE_PLAYERS_HIRES_BIFF_SPECK_PLUGS_LARRY,
SPECK_QUOTE_PLAYERS_HIRES_BIFF_SPECK_PLUGS_FLO,
SPECK_QUOTE_PLAYERS_HIRES_HAYWIRE_SPECK_PLUGS_RAZOR,
SPECK_QUOTE_PLAYERS_HIRES_RAZOR_SPECK_PLUGS_HAYWIRE,
SPECK_QUOTE_PLAYERS_HIRES_FLO_SPECK_PLUGS_BIFF,
SPECK_QUOTE_PLAYERS_HIRES_LARRY_SPECK_PLUGS_BIFF,
SPECK_QUOTE_GENERIC_THANKS_FOR_HIRING_MERCS_1,
SPECK_QUOTE_GENERIC_THANKS_FOR_HIRING_MERCS_2, //70
SPECK_QUOTE_PLAYER_TRIES_TO_HIRE_ALREADY_HIRED_MERC,
SPECK_QUOTE_GOOD_BYE_1,
SPECK_QUOTE_GOOD_BYE_2,
SPECK_QUOTE_GOOD_BYE_3,
/*
Ja25: no longer in game
SPECK_QUOTE_GOOD_BYE_TAG_PLAYER_OWES_MONEY,
*/
//New Quotes
SPECK_QUOTE_NEW_INTRO_1=76,
SPECK_QUOTE_NEW_INTRO_2,
SPECK_QUOTE_NEW_INTRO_3,
SPECK_QUOTE_NEW_INTRO_4,
SPECK_QUOTE_NEW_INTRO_5,//80
SPECK_QUOTE_NEW_INTRO_6,
SPECK_QUOTE_NEW_INTRO_7,
SPECK_QUOTE_DEFAULT_INTRO_HAVENT_HIRED_MERCS,
SPECK_QUOTE_DEFAULT_INTRO_HAVE_HIRED_MERCS,
SPECK_QUOTE_BETTER_STARTING_EQPMNT_TAG_ON,
SPECK_QUOTE_PLAYER_CANT_AFFORD_TO_HIRE_MERC,
SPECK_QUOTE_ENCOURAGE_SHOP_TAG_ON,
SPECK_QUOTE_2ND_INTRO_LAPTOP_WORKING_AGAIN_1,
SPECK_QUOTE_2ND_INTRO_LAPTOP_WORKING_AGAIN_2,
SPECK_QUOTE_2ND_INTRO_LAPTOP_WORKING_AGAIN_3, //90
SPECK_QUOTE_2ND_INTRO_LAPTOP_WORKING_AGAIN_4,
SPECK_QUOTE_2ND_INTRO_LAPTOP_WORKING_AGAIN_5,
SPECK_QUOTE_2ND_INTRO_LAPTOP_WORKING_AGAIN_6,
SPECK_QUOTE_ADVERTISE_GASTON,
SPECK_QUOTE_ADVERTISE_STOGIE,
SPECK_QUOTE_GASTON_DEAD,
SPECK_QUOTE_STOGIE_DEAD,
SPECK_QUOTE_PLAYER_HIRES_GASTON,
SPECK_QUOTE_PLAYER_HIRES_STOGIE,
SPECK_QUOTE_RANDOM_CHIT_CHAT_1, //100
SPECK_QUOTE_RANDOM_CHIT_CHAT_2,
SPECK_QUOTE_RANDOM_CHIT_CHAT_3,
SPECK_QUOTE_BIFF_DEAD_WHEN_IMPORTING,
/*
SPECK_QUOTE_,
SPECK_QUOTE_,
SPECK_QUOTE_,
SPECK_QUOTE_,
SPECK_QUOTE_,
SPECK_QUOTE_,
*/
};
#else
enum
{
SPECK_QUOTE_FIRST_TIME_IN_0, //0
@@ -115,5 +265,6 @@ enum
SPECK_QUOTE_,
*/
};
#endif
#endif
+301
View File
@@ -0,0 +1,301 @@
#ifdef PRECOMPILEDHEADERS
#include "Tactical All.h"
#include "Editor All.h"
#include "LuaInitNPCs.h"
#else
#include "sgp.h"
#include "Debug Control.h"
#include "expat.h"
#include "XML.h"
#include "Interface.h"
#include "Item Statistics.h"
#include "LuaInitNPCs.h"
#include "email.h"
#endif
struct
{
PARSE_STAGE curElement;
CHAR8 szCharData[MAIL_STRING_SIZE+1];
EMAIL_OTHER_VALUES curEmailOther;
UINT32 maxArraySize;
UINT32 curIndex;
UINT32 currentDepth;
UINT32 maxReadDepth;
}
typedef EmailOtherParseData;
BOOLEAN EmailOther_TextOnly;
static void XMLCALL
EmailOtherStartElementHandle(void *userData, const XML_Char *name, const XML_Char **atts)
{
EmailOtherParseData * pData = (EmailOtherParseData *)userData;
if(pData->currentDepth <= pData->maxReadDepth) //are we reading this element?
{
if(strcmp(name, "NEW_EMAIL") == 0 && pData->curElement == ELEMENT_NONE)
{
pData->curElement = ELEMENT_LIST;
pData->maxReadDepth++; //we are not skipping this element
}
else if(strcmp(name, "EMAIL") == 0 && pData->curElement == ELEMENT_LIST)
{
pData->curElement = ELEMENT;
pData->maxReadDepth++; //we are not skipping this element
}
else if(pData->curElement == ELEMENT &&
(strcmp(name, "uiIndex") == 0 ||
strcmp(name, "Subject") == 0 ||
strcmp(name, "Message0") == 0 ||
strcmp(name, "Message1") == 0 ||
strcmp(name, "Message2") == 0 ||
strcmp(name, "Message3") == 0 ||
strcmp(name, "Message4") == 0 ||
strcmp(name, "Message5") == 0 ||
strcmp(name, "Message6") == 0 ||
strcmp(name, "Message7") == 0 ||
strcmp(name, "Message8") == 0 ||
strcmp(name, "Message9") == 0 ||
strcmp(name, "Message10") == 0 ||
strcmp(name, "Message11") == 0 ||
strcmp(name, "Message12") == 0 ||
strcmp(name, "Message13") == 0 ||
strcmp(name, "Message14") == 0 ||
strcmp(name, "Message15") == 0 ||
strcmp(name, "Message16") == 0 ||
strcmp(name, "Message17") == 0 ||
strcmp(name, "Message18") == 0 ||
strcmp(name, "Message19") == 0 ||
strcmp(name, "Message20") == 0 ||
strcmp(name, "Message21") == 0 ||
strcmp(name, "Message22") == 0 ||
strcmp(name, "Message23") == 0 ||
strcmp(name, "Message24") == 0 ||
strcmp(name, "Message25") == 0 ||
strcmp(name, "Message26") == 0 ||
strcmp(name, "Message27") == 0 ||
strcmp(name, "Message28") == 0 ||
strcmp(name, "Message29") == 0 ))
{
pData->curElement = ELEMENT_PROPERTY;
pData->maxReadDepth++; //we are not skipping this element
}
pData->szCharData[0] = '\0';
}
pData->currentDepth++;
}
static void XMLCALL
EmailOtherCharacterDataHandle(void *userData, const XML_Char *str, int len)
{
EmailOtherParseData * pData = (EmailOtherParseData *)userData;
if( (pData->currentDepth <= pData->maxReadDepth) &&
(strlen(pData->szCharData) < MAX_CHAR_DATA_LENGTH)
){
strncat(pData->szCharData,str,__min((unsigned int)len,MAX_CHAR_DATA_LENGTH-strlen(pData->szCharData)));
}
}
static void XMLCALL
EmailOtherEndElementHandle(void *userData, const XML_Char *name)
{
EmailOtherParseData * pData = (EmailOtherParseData *)userData;
if(pData->currentDepth <= pData->maxReadDepth)
{
if(strcmp(name, "NEW_EMAIL") == 0)
{
pData->curElement = ELEMENT_NONE;
}
else if(strcmp(name, "EMAIL") == 0)
{
pData->curElement = ELEMENT_LIST;
if (!EmailOther_TextOnly)
{
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szSubject, pData->curEmailOther.szSubject);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[0], L"1. sdssdsfs dfg fdgd fgffdsf test" ); //pData->curEmailOther.szMessage[0]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[1], L"2. sdssdsfs dfg fgfgffdsf test" );
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[2], L"3. sdssdsfsd gdfg fdfgfdg ffdsf test" );
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[3], L"4. sdssdsf dgdfg dgsffdsf test" );
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[4], L"5. sdssdsfdgdfg dgfd gsffdsf test" );
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[5], L"6. sdssdsfsffdsf test" );
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[6], L"7. sdssdsfsffdsf test" );
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[7], L"8. sdssdsfsfdgdgfgfdsf test" );
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[8], L"9. sdssdsfsff dg dfgdg fg dfg dsf test" );
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[9], L"10. sdssdsfsfgdsgdfgfdsf test" );
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[10], L"11. sdssdsfsff dgdf fgfdg dfgd dsf test" );
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[11], L"12. sdssdsfsf dfg dfgf gdfg dsf test" );
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[12], L"13. sdssdsfsf dfgdfgdf gdfg gfdsf test" );
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[13], L"14. sdssdsf dgdf gsffdsf test" );
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[14], L"15. sdssdsf dgdf dfg d gdf ffdsf test" );
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[15], L"16. sdssdsfs dgdfg fdg dgdfg gffdsf test" );
/*
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[1], pData->curEmailOther.szMessage[1]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[2], pData->curEmailOther.szMessage[2]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[3], pData->curEmailOther.szMessage[3]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[4], pData->curEmailOther.szMessage[4]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[5], pData->curEmailOther.szMessage[5]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[6], pData->curEmailOther.szMessage[6]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[7], pData->curEmailOther.szMessage[7]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[8], pData->curEmailOther.szMessage[8]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[9], pData->curEmailOther.szMessage[9]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[10], pData->curEmailOther.szMessage[10]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[11], pData->curEmailOther.szMessage[11]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[12], pData->curEmailOther.szMessage[12]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[13], pData->curEmailOther.szMessage[13]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[14], pData->curEmailOther.szMessage[14]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[15], pData->curEmailOther.szMessage[15]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[16], pData->curEmailOther.szMessage[16]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[17], pData->curEmailOther.szMessage[17]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[18], pData->curEmailOther.szMessage[18]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[19], pData->curEmailOther.szMessage[19]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[20], pData->curEmailOther.szMessage[20]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[21], pData->curEmailOther.szMessage[21]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[22], pData->curEmailOther.szMessage[22]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[23], pData->curEmailOther.szMessage[23]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[24], pData->curEmailOther.szMessage[24]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[25], pData->curEmailOther.szMessage[25]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[26], pData->curEmailOther.szMessage[26]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[27], pData->curEmailOther.szMessage[27]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[28], pData->curEmailOther.szMessage[28]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[29], pData->curEmailOther.szMessage[29]);
*/
}
else
{
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szSubject, pData->curEmailOther.szSubject);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[0], L"sdssdsfsffdsf test" ); //pData->curEmailOther.szMessage[0]);
/*
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[1], pData->curEmailOther.szMessage[1]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[2], pData->curEmailOther.szMessage[2]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[3], pData->curEmailOther.szMessage[3]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[4], pData->curEmailOther.szMessage[4]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[5], pData->curEmailOther.szMessage[5]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[6], pData->curEmailOther.szMessage[6]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[7], pData->curEmailOther.szMessage[7]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[8], pData->curEmailOther.szMessage[8]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[9], pData->curEmailOther.szMessage[9]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[10], pData->curEmailOther.szMessage[10]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[11], pData->curEmailOther.szMessage[11]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[12], pData->curEmailOther.szMessage[12]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[13], pData->curEmailOther.szMessage[13]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[14], pData->curEmailOther.szMessage[14]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[15], pData->curEmailOther.szMessage[15]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[16], pData->curEmailOther.szMessage[16]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[17], pData->curEmailOther.szMessage[17]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[18], pData->curEmailOther.szMessage[18]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[19], pData->curEmailOther.szMessage[19]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[20], pData->curEmailOther.szMessage[20]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[21], pData->curEmailOther.szMessage[21]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[22], pData->curEmailOther.szMessage[22]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[23], pData->curEmailOther.szMessage[23]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[24], pData->curEmailOther.szMessage[24]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[25], pData->curEmailOther.szMessage[25]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[26], pData->curEmailOther.szMessage[26]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[27], pData->curEmailOther.szMessage[27]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[28], pData->curEmailOther.szMessage[28]);
wcscpy(EmailOtherText[pData->curEmailOther.uiIndex].szMessage[29], pData->curEmailOther.szMessage[29]);
*/
}
}
else if(strcmp(name, "uiIndex") == 0)
{
pData->curElement = ELEMENT;
pData->curEmailOther.uiIndex = (UINT8) atol(pData->szCharData);
}
else if(strcmp(name, "Subject") == 0 )
{
pData->curElement = ELEMENT;
MultiByteToWideChar( CP_UTF8, 0, pData->szCharData, -1, pData->curEmailOther.szSubject, sizeof(pData->curEmailOther.szSubject)/sizeof(pData->curEmailOther.szSubject[0]) );
pData->curEmailOther.szSubject[sizeof(pData->curEmailOther.szSubject)/sizeof(pData->curEmailOther.szSubject[0]) - 1] = '\0';
}
/*
else if(strcmp(name, "Message0") == 0 )
{
pData->curElement = ELEMENT;
MultiByteToWideChar( CP_UTF8, 0, pData->szCharData, -1, pData->curEmailOther.szMessage[0], sizeof(pData->curEmailOther.szMessage[0])/sizeof(pData->curEmailOther.szMessage[0]) );
pData->curEmailOther.szMessage[sizeof(pData->curEmailOther.szMessage[0])/sizeof(pData->curEmailOther.szMessage[0]) - 1][0] = '\0';
}
*/
pData->maxReadDepth--;
}
pData->currentDepth--;
}
BOOLEAN ReadInEmailOther(STR fileName, BOOLEAN localizedVersion)
{
HWFILE hFile;
UINT32 uiBytesRead;
UINT32 uiFSize;
CHAR8 * lpcBuffer;
XML_Parser parser = XML_ParserCreate(NULL);
EmailOtherParseData pData;
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, "Loading EmailOther.xml" );
EmailOther_TextOnly = localizedVersion;
// Open file
hFile = FileOpen( fileName, FILE_ACCESS_READ, FALSE );
if ( !hFile )
return( localizedVersion );
uiFSize = FileGetSize(hFile);
lpcBuffer = (CHAR8 *) MemAlloc(uiFSize+1);
//Read in block
if ( !FileRead( hFile, lpcBuffer, uiFSize, &uiBytesRead ) )
{
MemFree(lpcBuffer);
return( FALSE );
}
lpcBuffer[uiFSize] = 0; //add a null terminator
FileClose( hFile );
XML_SetElementHandler(parser, EmailOtherStartElementHandle, EmailOtherEndElementHandle);
XML_SetCharacterDataHandler(parser, EmailOtherCharacterDataHandle);
memset(&pData,0,sizeof(pData));
XML_SetUserData(parser, &pData);
if(!XML_Parse(parser, lpcBuffer, uiFSize, TRUE))
{
CHAR8 errorBuf[511];
sprintf(errorBuf, "XML Parser Error in EmailOther.xml: %s at line %d", XML_ErrorString(XML_GetErrorCode(parser)), XML_GetCurrentLineNumber(parser));
LiveMessage(errorBuf);
MemFree(lpcBuffer);
return FALSE;
}
MemFree(lpcBuffer);
XML_ParserFree(parser);
return( TRUE );
}
+192
View File
@@ -0,0 +1,192 @@
#ifdef PRECOMPILEDHEADERS
#include "Tactical All.h"
#include "Editor All.h"
#include "LuaInitNPCs.h"
#else
#include "sgp.h"
#include "Debug Control.h"
#include "expat.h"
#include "XML.h"
#include "Interface.h"
#include "Item Statistics.h"
#include "LuaInitNPCs.h"
#include "email.h"
#endif
struct
{
PARSE_STAGE curElement;
CHAR8 szCharData[MAIL_STRING_SIZE+1];
EMAIL_MERC_AVAILABLE_VALUES curEmailMercAvailable;
UINT32 maxArraySize;
UINT32 curIndex;
UINT32 currentDepth;
UINT32 maxReadDepth;
}
typedef emailMercAvailableParseData;
BOOLEAN EmailMercAvailable_TextOnly;
static void XMLCALL
emailMercAvailableStartElementHandle(void *userData, const XML_Char *name, const XML_Char **atts)
{
emailMercAvailableParseData * pData = (emailMercAvailableParseData *)userData;
if(pData->currentDepth <= pData->maxReadDepth) //are we reading this element?
{
if(strcmp(name, "EMAIL_MERC_AVAILABLE") == 0 && pData->curElement == ELEMENT_NONE)
{
pData->curElement = ELEMENT_LIST;
pData->maxReadDepth++; //we are not skipping this element
}
else if(strcmp(name, "EMAIL") == 0 && pData->curElement == ELEMENT_LIST)
{
pData->curElement = ELEMENT;
pData->maxReadDepth++; //we are not skipping this element
}
else if(pData->curElement == ELEMENT &&
(strcmp(name, "uiIndex") == 0 ||
strcmp(name, "Subject") == 0 ||
strcmp(name, "Message") == 0 ))
{
pData->curElement = ELEMENT_PROPERTY;
pData->maxReadDepth++; //we are not skipping this element
}
pData->szCharData[0] = '\0';
}
pData->currentDepth++;
}
static void XMLCALL
emailMercAvailableCharacterDataHandle(void *userData, const XML_Char *str, int len)
{
emailMercAvailableParseData * pData = (emailMercAvailableParseData *)userData;
if( (pData->currentDepth <= pData->maxReadDepth) &&
(strlen(pData->szCharData) < MAX_CHAR_DATA_LENGTH)
){
strncat(pData->szCharData,str,__min((unsigned int)len,MAX_CHAR_DATA_LENGTH-strlen(pData->szCharData)));
}
}
static void XMLCALL
emailMercAvailableEndElementHandle(void *userData, const XML_Char *name)
{
emailMercAvailableParseData * pData = (emailMercAvailableParseData *)userData;
if(pData->currentDepth <= pData->maxReadDepth)
{
if(strcmp(name, "EMAIL_MERC_AVAILABLE") == 0)
{
pData->curElement = ELEMENT_NONE;
}
else if(strcmp(name, "EMAIL") == 0)
{
pData->curElement = ELEMENT_LIST;
if (!EmailMercAvailable_TextOnly)
{
wcscpy(EmailMercAvailableText[pData->curEmailMercAvailable.uiIndex].szSubject, pData->curEmailMercAvailable.szSubject);
wcscpy(EmailMercAvailableText[pData->curEmailMercAvailable.uiIndex].szMessage, pData->curEmailMercAvailable.szMessage);
}
else
{
wcscpy(EmailMercAvailableText[pData->curEmailMercAvailable.uiIndex].szSubject, pData->curEmailMercAvailable.szSubject);
wcscpy(EmailMercAvailableText[pData->curEmailMercAvailable.uiIndex].szMessage, pData->curEmailMercAvailable.szMessage);
}
}
else if(strcmp(name, "uiIndex") == 0)
{
pData->curElement = ELEMENT;
pData->curEmailMercAvailable.uiIndex = (UINT8) atol(pData->szCharData);
}
else if(strcmp(name, "Subject") == 0 )
{
pData->curElement = ELEMENT;
MultiByteToWideChar( CP_UTF8, 0, pData->szCharData, -1, pData->curEmailMercAvailable.szSubject, sizeof(pData->curEmailMercAvailable.szSubject)/sizeof(pData->curEmailMercAvailable.szSubject[0]) );
pData->curEmailMercAvailable.szSubject[sizeof(pData->curEmailMercAvailable.szSubject)/sizeof(pData->curEmailMercAvailable.szSubject[0]) - 1] = '\0';
}
else if(strcmp(name, "Message") == 0 )
{
pData->curElement = ELEMENT;
MultiByteToWideChar( CP_UTF8, 0, pData->szCharData, -1, pData->curEmailMercAvailable.szMessage, sizeof(pData->curEmailMercAvailable.szMessage)/sizeof(pData->curEmailMercAvailable.szMessage[0]) );
pData->curEmailMercAvailable.szMessage[sizeof(pData->curEmailMercAvailable.szMessage)/sizeof(pData->curEmailMercAvailable.szMessage[0]) - 1] = '\0';
}
pData->maxReadDepth--;
}
pData->currentDepth--;
}
BOOLEAN ReadInEmailMercAvailable(STR fileName, BOOLEAN localizedVersion)
{
HWFILE hFile;
UINT32 uiBytesRead;
UINT32 uiFSize;
CHAR8 * lpcBuffer;
XML_Parser parser = XML_ParserCreate(NULL);
emailMercAvailableParseData pData;
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, "Loading EmailMercAvailable.xml" );
EmailMercAvailable_TextOnly = localizedVersion;
// Open file
hFile = FileOpen( fileName, FILE_ACCESS_READ, FALSE );
if ( !hFile )
return( localizedVersion );
uiFSize = FileGetSize(hFile);
lpcBuffer = (CHAR8 *) MemAlloc(uiFSize+1);
//Read in block
if ( !FileRead( hFile, lpcBuffer, uiFSize, &uiBytesRead ) )
{
MemFree(lpcBuffer);
return( FALSE );
}
lpcBuffer[uiFSize] = 0; //add a null terminator
FileClose( hFile );
XML_SetElementHandler(parser, emailMercAvailableStartElementHandle, emailMercAvailableEndElementHandle);
XML_SetCharacterDataHandler(parser, emailMercAvailableCharacterDataHandle);
memset(&pData,0,sizeof(pData));
XML_SetUserData(parser, &pData);
if(!XML_Parse(parser, lpcBuffer, uiFSize, TRUE))
{
CHAR8 errorBuf[511];
sprintf(errorBuf, "XML Parser Error in EmailMercAvailable.xml: %s at line %d", XML_ErrorString(XML_GetErrorCode(parser)), XML_GetCurrentLineNumber(parser));
LiveMessage(errorBuf);
MemFree(lpcBuffer);
return FALSE;
}
MemFree(lpcBuffer);
XML_ParserFree(parser);
return( TRUE );
}
+192
View File
@@ -0,0 +1,192 @@
#ifdef PRECOMPILEDHEADERS
#include "Tactical All.h"
#include "Editor All.h"
#include "LuaInitNPCs.h"
#else
#include "sgp.h"
#include "Debug Control.h"
#include "expat.h"
#include "XML.h"
#include "Interface.h"
#include "Item Statistics.h"
#include "LuaInitNPCs.h"
#include "email.h"
#endif
struct
{
PARSE_STAGE curElement;
CHAR8 szCharData[MAIL_STRING_SIZE+1];
EMAIL_MERC_LEVEL_UP_VALUES curEmailMercLevelUp;
UINT32 maxArraySize;
UINT32 curIndex;
UINT32 currentDepth;
UINT32 maxReadDepth;
}
typedef emailMercLevelUpParseData;
BOOLEAN EmailMercLevelUp_TextOnly;
static void XMLCALL
emailMercLevelUpStartElementHandle(void *userData, const XML_Char *name, const XML_Char **atts)
{
emailMercLevelUpParseData * pData = (emailMercLevelUpParseData *)userData;
if(pData->currentDepth <= pData->maxReadDepth) //are we reading this element?
{
if(strcmp(name, "EMAIL_MERC_LEVEL_UP") == 0 && pData->curElement == ELEMENT_NONE)
{
pData->curElement = ELEMENT_LIST;
pData->maxReadDepth++; //we are not skipping this element
}
else if(strcmp(name, "EMAIL") == 0 && pData->curElement == ELEMENT_LIST)
{
pData->curElement = ELEMENT;
pData->maxReadDepth++; //we are not skipping this element
}
else if(pData->curElement == ELEMENT &&
(strcmp(name, "uiIndex") == 0 ||
strcmp(name, "Subject") == 0 ||
strcmp(name, "Message") == 0 ))
{
pData->curElement = ELEMENT_PROPERTY;
pData->maxReadDepth++; //we are not skipping this element
}
pData->szCharData[0] = '\0';
}
pData->currentDepth++;
}
static void XMLCALL
emailMercLevelUpCharacterDataHandle(void *userData, const XML_Char *str, int len)
{
emailMercLevelUpParseData * pData = (emailMercLevelUpParseData *)userData;
if( (pData->currentDepth <= pData->maxReadDepth) &&
(strlen(pData->szCharData) < MAX_CHAR_DATA_LENGTH)
){
strncat(pData->szCharData,str,__min((unsigned int)len,MAX_CHAR_DATA_LENGTH-strlen(pData->szCharData)));
}
}
static void XMLCALL
emailMercLevelUpEndElementHandle(void *userData, const XML_Char *name)
{
emailMercLevelUpParseData * pData = (emailMercLevelUpParseData *)userData;
if(pData->currentDepth <= pData->maxReadDepth)
{
if(strcmp(name, "EMAIL_MERC_LEVEL_UP") == 0)
{
pData->curElement = ELEMENT_NONE;
}
else if(strcmp(name, "EMAIL") == 0)
{
pData->curElement = ELEMENT_LIST;
if (!EmailMercLevelUp_TextOnly)
{
wcscpy(EmailMercLevelUpText[pData->curEmailMercLevelUp.uiIndex].szSubject, pData->curEmailMercLevelUp.szSubject);
wcscpy(EmailMercLevelUpText[pData->curEmailMercLevelUp.uiIndex].szMessage, pData->curEmailMercLevelUp.szMessage);
}
else
{
wcscpy(EmailMercLevelUpText[pData->curEmailMercLevelUp.uiIndex].szSubject, pData->curEmailMercLevelUp.szSubject);
wcscpy(EmailMercLevelUpText[pData->curEmailMercLevelUp.uiIndex].szMessage, pData->curEmailMercLevelUp.szMessage);
}
}
else if(strcmp(name, "uiIndex") == 0)
{
pData->curElement = ELEMENT;
pData->curEmailMercLevelUp.uiIndex = (UINT8) atol(pData->szCharData);
}
else if(strcmp(name, "Subject") == 0 )
{
pData->curElement = ELEMENT;
MultiByteToWideChar( CP_UTF8, 0, pData->szCharData, -1, pData->curEmailMercLevelUp.szSubject, sizeof(pData->curEmailMercLevelUp.szSubject)/sizeof(pData->curEmailMercLevelUp.szSubject[0]) );
pData->curEmailMercLevelUp.szSubject[sizeof(pData->curEmailMercLevelUp.szSubject)/sizeof(pData->curEmailMercLevelUp.szSubject[0]) - 1] = '\0';
}
else if(strcmp(name, "Message") == 0 )
{
pData->curElement = ELEMENT;
MultiByteToWideChar( CP_UTF8, 0, pData->szCharData, -1, pData->curEmailMercLevelUp.szMessage, sizeof(pData->curEmailMercLevelUp.szMessage)/sizeof(pData->curEmailMercLevelUp.szMessage[0]) );
pData->curEmailMercLevelUp.szMessage[sizeof(pData->curEmailMercLevelUp.szMessage)/sizeof(pData->curEmailMercLevelUp.szMessage[0]) - 1] = '\0';
}
pData->maxReadDepth--;
}
pData->currentDepth--;
}
BOOLEAN ReadInEmailMercLevelUp(STR fileName, BOOLEAN localizedVersion)
{
HWFILE hFile;
UINT32 uiBytesRead;
UINT32 uiFSize;
CHAR8 * lpcBuffer;
XML_Parser parser = XML_ParserCreate(NULL);
emailMercLevelUpParseData pData;
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, "Loading EmailMercLevelUp.xml" );
EmailMercLevelUp_TextOnly = localizedVersion;
// Open file
hFile = FileOpen( fileName, FILE_ACCESS_READ, FALSE );
if ( !hFile )
return( localizedVersion );
uiFSize = FileGetSize(hFile);
lpcBuffer = (CHAR8 *) MemAlloc(uiFSize+1);
//Read in block
if ( !FileRead( hFile, lpcBuffer, uiFSize, &uiBytesRead ) )
{
MemFree(lpcBuffer);
return( FALSE );
}
lpcBuffer[uiFSize] = 0; //add a null terminator
FileClose( hFile );
XML_SetElementHandler(parser, emailMercLevelUpStartElementHandle, emailMercLevelUpEndElementHandle);
XML_SetCharacterDataHandler(parser, emailMercLevelUpCharacterDataHandle);
memset(&pData,0,sizeof(pData));
XML_SetUserData(parser, &pData);
if(!XML_Parse(parser, lpcBuffer, uiFSize, TRUE))
{
CHAR8 errorBuf[511];
sprintf(errorBuf, "XML Parser Error in EmailMercLevelUp.xml: %s at line %d", XML_ErrorString(XML_GetErrorCode(parser)), XML_GetCurrentLineNumber(parser));
LiveMessage(errorBuf);
MemFree(lpcBuffer);
return FALSE;
}
MemFree(lpcBuffer);
XML_ParserFree(parser);
return( TRUE );
}
File diff suppressed because it is too large Load Diff
+887 -112
View File
File diff suppressed because it is too large Load Diff
+353 -6
View File
@@ -2,12 +2,231 @@
#define __EMAIL_H
#include "types.h"
#include "soldier profile type.h"
// defines
#define MAX_EMAIL_LINES 10 //max number of lines can be shown in a message
#define MAX_MESSAGES_PAGE 18 // max number of messages per page
//---ja25 ub
#ifdef JA2UB
#define EMAIL_INSURANCE_L1 170
#define EMAIL_INSURANCE_L2 211
#define EMAIL_INSURANCE_L3 170
#define EMAIL_INSURANCE_L4 173
#define EMAIL_INSURANCE_L5 179
#define EMAIL_INSURANCE_L6 176
#define EMAIL_BOBBY_R_L1 198
#define EMAIL_AIM_L1 206
#define EMAIL_AIM_L2 27
#define EMAIL_AIM_L3 217
#define EMAIL_AIM_L4 214
//JA25: New emails
// email # 1
#define EMAIL_STARTGAME 0
#define EMAIL_STARTGAME_LENGTH 8
// email # 2
#define EMAIL_PILOTMISSING (EMAIL_STARTGAME + EMAIL_STARTGAME_LENGTH)
#define EMAIL_PILOTMISSING_LENGTH 2
// email # 3
#define EMAIL_MAKECONTACT (EMAIL_PILOTMISSING + EMAIL_PILOTMISSING_LENGTH)
#define EMAIL_MAKECONTACT_LENGTH 3
// email # 4
#define EMAIL_MANUEL (EMAIL_MAKECONTACT + EMAIL_MAKECONTACT_LENGTH)
#define EMAIL_MANUEL_LENGTH 4
// # email # 5 - only if Miguel is alive!
#define EMAIL_MIGUELHELLO (EMAIL_MANUEL + EMAIL_MANUEL_LENGTH)
#define EMAIL_MIGUELHELLO_LENGTH 3
// email # 6 - player not advancing fast enough
#define EMAIL_CONCERNED (EMAIL_MIGUELHELLO + EMAIL_MIGUELHELLO_LENGTH)
#define EMAIL_CONCERNED_LENGTH 2
// email # 7 - player still not advancing fast enough
#define EMAIL_URGENT (EMAIL_CONCERNED + EMAIL_CONCERNED_LENGTH)
#define EMAIL_URGENT_LENGTH 3
// email # 8a - from Miguel
#define EMAIL_MIGUELSORRY (EMAIL_URGENT + EMAIL_URGENT_LENGTH)
#define EMAIL_MIGUELSORRY_LENGTH 3
// email # 8b - from Miguel, mentioning Manuel
#define EMAIL_MIGUELMANUEL (EMAIL_MIGUELSORRY + EMAIL_MIGUELSORRY_LENGTH)
#define EMAIL_MIGUELMANUEL_LENGTH 4
// email # 9 - Miguel sick
#define EMAIL_MIGUELSICK (EMAIL_MIGUELMANUEL + EMAIL_MIGUELMANUEL_LENGTH)
#define EMAIL_MIGUELSICK_LENGTH 3
// email # 10a
#define EMAIL_UNDERSTANDING (EMAIL_MIGUELSICK + EMAIL_MIGUELSICK_LENGTH)
#define EMAIL_UNDERSTANDING_LENGTH 3
// email # 10b - if we need extra cash
#define EMAIL_EXTRACASH (EMAIL_UNDERSTANDING + EMAIL_UNDERSTANDING_LENGTH)
#define EMAIL_EXTRACASH_LENGTH 4
// email # 11
#define EMAIL_PILOTFOUND (EMAIL_EXTRACASH + EMAIL_EXTRACASH_LENGTH)
#define EMAIL_PILOTFOUND_LENGTH 2
// email # 12a - Miguel dead, Manuel never recruited
#define EMAIL_CONGRATS (EMAIL_PILOTFOUND + EMAIL_PILOTFOUND_LENGTH)
#define EMAIL_CONGRATS_LENGTH 4
// email # 12b - Miguel alive, Manuel never recruited
#define EMAIL_CONGRATSICK (EMAIL_CONGRATS + EMAIL_CONGRATS_LENGTH)
#define EMAIL_CONGRATSICK_LENGTH 5
// email # 12c - Miguel alive, Manuel dead
#define EMAIL_CONGRATMIGMANUELDEAD (EMAIL_CONGRATSICK + EMAIL_CONGRATSICK_LENGTH)
#define EMAIL_CONGRATMIGMANUELDEAD_LENGTH 6
// email # 12d - Miguel alive, Manuel recruited and alive
#define EMAIL_CONGRATMIGMANUELALIVE (EMAIL_CONGRATMIGMANUELDEAD + EMAIL_CONGRATMIGMANUELDEAD_LENGTH)
#define EMAIL_CONGRATMIGMANUELALIVE_LENGTH 6
// email # 12e - Miguel dead, Manuel dead
#define EMAIL_CONGRATMANUELDEAD (EMAIL_CONGRATMIGMANUELALIVE + EMAIL_CONGRATMIGMANUELALIVE_LENGTH)
#define EMAIL_CONGRATMANUELDEAD_LENGTH 5
// email # 12f - Miguel dead, Manuel recruited and alive
#define EMAIL_CONGRATMANUELALIVE (EMAIL_CONGRATMANUELDEAD + EMAIL_CONGRATMANUELDEAD_LENGTH)
#define EMAIL_CONGRATMANUELALIVE_LENGTH 5
// email # 13 - original AIM email
#define EMAIL_AIMDISCOUNT (EMAIL_CONGRATMANUELALIVE + EMAIL_CONGRATMANUELALIVE_LENGTH)
#define EMAIL_AIMDISCOUNT_LENGTH 7
#define MANUEL_AT_HOME_NOT_USED ( EMAIL_AIMDISCOUNT + EMAIL_AIMDISCOUNT_LENGTH )
#define MANUEL_AT_HOME_NOT_USED_LENGTH 1
//Email #14 Initial IMP email
#define IMP_EMAIL_INTRO (MANUEL_AT_HOME_NOT_USED + MANUEL_AT_HOME_NOT_USED_LENGTH )
#define IMP_EMAIL_INTRO_LENGTH 10
//Email #15 Imp follow up
#define IMP_EMAIL_AGAIN (IMP_EMAIL_INTRO + IMP_EMAIL_INTRO_LENGTH)
#define IMP_EMAIL_AGAIN_LENGTH 5
// Email #16 - ?? merc left-me-a-message-and-now-I'm-back emails
#define AIM_REPLY_BARRY ( IMP_EMAIL_AGAIN + IMP_EMAIL_AGAIN_LENGTH )
#define AIM_REPLY_LENGTH_BARRY 2
#define AIM_REPLY_MELTDOWN (AIM_REPLY_BARRY + ( 39 * AIM_REPLY_LENGTH_BARRY ))
#define AIM_REPLY_LENGTH_MELTDOWN AIM_REPLY_LENGTH_BARRY
#define AIM_REFUND ( AIM_REPLY_MELTDOWN + AIM_REPLY_LENGTH_MELTDOWN )
#define AIM_REFUND_LENGTH 3
#define MERC_REFUND ( AIM_REFUND + AIM_REFUND_LENGTH )
#define MERC_REFUND_LENGTH 3
#define EMAIL_AIM_PROMOTION_1 ( MERC_REFUND + MERC_REFUND_LENGTH )
#define EMAIL_AIM_PROMOTION_1_LENGTH 4
#define EMAIL_MERC_PROMOTION_1 ( EMAIL_AIM_PROMOTION_1 + EMAIL_AIM_PROMOTION_1_LENGTH )
#define EMAIL_MERC_PROMOTION_1_LENGTH 5
#define EMAIL_AIM_PROMOTION_2 ( EMAIL_MERC_PROMOTION_1 + EMAIL_MERC_PROMOTION_1_LENGTH )
#define EMAIL_AIM_PROMOTION_2_LENGTH 5
#define IMP_EMAIL_PROFILE_RESULTS ( EMAIL_AIM_PROMOTION_2 + EMAIL_AIM_PROMOTION_2_LENGTH )
#define IMP_EMAIL_PROFILE_RESULTS_LENGTH 1
#define IMP_EMAIL_INTRO2 0
#define IMP_EMAIL_INTRO_LENGTH2 10
#define ENRICO_CONGRATS2 (IMP_EMAIL_INTRO2 + IMP_EMAIL_INTRO_LENGTH2)
#define ENRICO_CONGRATS_LENGTH2 3
#define IMP_EMAIL_AGAIN2 (ENRICO_CONGRATS2 + ENRICO_CONGRATS_LENGTH2)
#define IMP_EMAIL_AGAIN_LENGTH2 6
#define MERC_INTRO2 (IMP_EMAIL_AGAIN2 + IMP_EMAIL_AGAIN_LENGTH2)
#define MERC_INTRO_LENGTH2 5
#define MERC_NEW_SITE_ADDRESS2 ( MERC_INTRO2 + MERC_INTRO_LENGTH2 )
#define MERC_NEW_SITE_ADDRESS_LENGTH2 2
#define AIM_MEDICAL_DEPOSIT_REFUND2 ( MERC_NEW_SITE_ADDRESS2 + MERC_NEW_SITE_ADDRESS_LENGTH2 )
#define AIM_MEDICAL_DEPOSIT_REFUND_LENGTH2 3
#define IMP_EMAIL_PROFILE_RESULTS2 ( AIM_MEDICAL_DEPOSIT_REFUND2 + AIM_MEDICAL_DEPOSIT_REFUND_LENGTH2 )
#define IMP_EMAIL_PROFILE_RESULTS_LENGTH2 1
#define MERC_WARNING2 ( IMP_EMAIL_PROFILE_RESULTS_LENGTH2 + IMP_EMAIL_PROFILE_RESULTS2 )
#define MERC_WARNING_LENGTH2 2
#define MERC_INVALID2 ( MERC_WARNING2 + MERC_WARNING_LENGTH2 )
#define MERC_INVALID_LENGTH2 2
#define NEW_MERCS_AT_MERC ( MERC_INVALID2 + MERC_INVALID_LENGTH2 )
#define NEW_MERCS_AT_MERC_LENGTH 2
//Jagged Alliance 2
// insurance company emails
#define INSUR_PAYMENT 200
#define INSUR_PAYMENT_LENGTH 3
#define INSUR_SUSPIC 201
#define INSUR_SUSPIC_LENGTH 3
#define INSUR_INVEST_OVER 202
#define INSUR_INVEST_OVER_LENGTH 3
#define INSUR_SUSPIC_2 203
#define INSUR_SUSPIC_2_LENGTH 3
#define BOBBYR_NOW_OPEN 204
#define BOBBYR_NOW_OPEN_LENGTH 3
#define KING_PIN_LETTER 205
#define KING_PIN_LETTER_LENGTH 4
#define LACK_PLAYER_PROGRESS_1 206
#define LACK_PLAYER_PROGRESS_1_LENGTH 3
#define LACK_PLAYER_PROGRESS_2 207
#define LACK_PLAYER_PROGRESS_2_LENGTH 3
#define LACK_PLAYER_PROGRESS_3 208
#define LACK_PLAYER_PROGRESS_3_LENGTH 3
//A package from bobby r has arrived in Drassen
#define BOBBYR_SHIPMENT_ARRIVED 199
#define BOBBYR_SHIPMENT_ARRIVED_LENGTH 4
// John Kulba has left the gifts for theplayers in drassen
#define JOHN_KULBA_GIFT_IN_DRASSEN 209
#define JOHN_KULBA_GIFT_IN_DRASSEN_LENGTH 4
//when a merc dies on ANOTHER assignment ( ie not with the player )
#define MERC_DIED_ON_OTHER_ASSIGNMENT 210
#define MERC_DIED_ON_OTHER_ASSIGNMENT_LENGTH 5
#define INSUR_1HOUR_FRAUD 211
#define INSUR_1HOUR_FRAUD_LENGTH 3
//when a merc is fired, and is injured
#define AIM_MEDICAL_DEPOSIT_PARTIAL_REFUND 212
#define AIM_MEDICAL_DEPOSIT_PARTIAL_REFUND_LENGTH 3
//when a merc is fired, and is dead
#define AIM_MEDICAL_DEPOSIT_NO_REFUND 213
#define AIM_MEDICAL_DEPOSIT_NO_REFUND_LENGTH 3
#define BOBBY_R_MEDUNA_SHIPMENT 214
#define BOBBY_R_MEDUNA_SHIPMENT_LENGTH 4
#define AIM_MEDICAL_DEPOSIT_REFUND 215
#define AIM_MEDICAL_DEPOSIT_REFUND_LENGTH 3
#else
#define IMP_EMAIL_INTRO 0
#define IMP_EMAIL_INTRO_LENGTH 10
#define ENRICO_CONGRATS (IMP_EMAIL_INTRO + IMP_EMAIL_INTRO_LENGTH)
@@ -133,7 +352,7 @@
#define BOBBY_R_MEDUNA_SHIPMENT ( AIM_MEDICAL_DEPOSIT_NO_REFUND + AIM_MEDICAL_DEPOSIT_NO_REFUND_LENGTH )
#define BOBBY_R_MEDUNA_SHIPMENT_LENGTH 4
#endif
// WANNE: New 1.13 MERC merc mail text for level up that Speck sends
//#define MERC_UP_LEVEL_GASTON (BOBBY_R_MEDUNA_SHIPMENT + BOBBY_R_MEDUNA_SHIPMENT_LENGTH)
//#define MERC_UP_LEVEL_GASTON_LENGTH 2
@@ -181,6 +400,10 @@ struct email
// WANNE: A reference to the IMP position in the gMercProfiles array.
// So we know which analyse email belongs to the imp
INT32 iCurrentIMPPosition;
UINT8 EmailVersion;
UINT32 EmailType;
// WANNE.MAIL: Fix
INT16 iCurrentShipmentDestinationID;
@@ -269,6 +492,9 @@ enum {
KING_PIN,
JOHN_KULBA,
AIM_SITE,
#ifdef JA2UB
MAIL_MIGUEL,
#endif
};
// the length of the subject in char
@@ -300,16 +526,16 @@ void RenderEmail();
// message manipulation
void AddEmailMessage(INT32 iMessageOffset, INT32 iMessageLength,STR16 pSubject, INT32 iDate, UINT8 ubSender, BOOLEAN fAlreadyRead, INT32 uiFirstData, UINT32 uiSecondData, INT32 iCurrentIMPPosition, INT16 iCurrentShipmentDestinationID );
void AddEmailMessage(INT32 iMessageOffset, INT32 iMessageLength,STR16 pSubject, INT32 iDate, UINT8 ubSender, BOOLEAN fAlreadyRead, INT32 uiFirstData, UINT32 uiSecondData, INT32 iCurrentIMPPosition, INT16 iCurrentShipmentDestinationID, UINT8 EmailType, UINT32 EmailAIM );
void RemoveEmailMessage(INT32 iId);
EmailPtr GetEmailMessage(INT32 iId);
void LookForUnread();
void AddEmail(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iCurrentIMPPosition, INT16 iCurrentShipmentDestinationID);
void AddEmail(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iCurrentIMPPosition, INT16 iCurrentShipmentDestinationID, UINT8 EmailType);
// WANNE: For the new WF merc, when they available again
void AddEmailWFMercAvailable(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iCurrentIMPPosition);
void AddEmailWFMercAvailable(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iCurrentIMPPosition, UINT8 EmailType);
void AddPreReadEmail(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate);
void AddPreReadEmail(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, UINT8 EmailType );
BOOLEAN DisplayNewMailBox();
void CreateDestroyNewMailButton();
void CreateDestroyDeleteNoticeMailButton();
@@ -319,12 +545,133 @@ void ReDrawNewMailBox( void );
void ReDisplayBoxes( void );
void ShutDownEmailList();
void AddMessageToPages(INT32 iMessageId);
void AddEmailWithSpecialData(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iFirstData, UINT32 uiSecondData );
void AddEmailWithSpecialData(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iFirstData, UINT32 uiSecondData, UINT8 EmailType, UINT32 EmailAIM );
void AddCustomEmail(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iCurrentIMPPosition, INT16 iCurrentShipmentDestinationID, UINT8 EmailType);
#ifdef JA2BETAVERSION
void AddAllEmails();
#endif
typedef struct
{
UINT8 uiIndex;
CHAR16 szMessage[MAIL_STRING_SIZE];
CHAR16 szSubject[EMAIL_SUBJECT_LENGTH];
} EMAIL_MERC_AVAILABLE_VALUES;
typedef struct
{
UINT8 uiIndex;
CHAR16 szMessage[MAIL_STRING_SIZE];
CHAR16 szSubject[EMAIL_SUBJECT_LENGTH];
} EMAIL_MERC_LEVEL_UP_VALUES;
typedef struct
{
UINT8 uiIndex;
CHAR16 szMessage[MAIL_STRING_SIZE];
CHAR16 szSubject[EMAIL_SUBJECT_LENGTH];
} EMAIL_MERC_INSURANCE_VALUES;
#define EMAIL_INDEX 500
typedef struct
{
UINT8 uiIndex;
CHAR16 szMessage[MAIL_STRING_SIZE][30];
CHAR16 szSubject[EMAIL_SUBJECT_LENGTH];
} EMAIL_OTHER_VALUES;
typedef struct
{
UINT8 uiIndex;
UINT32 EmailType;
UINT8 EmailVersion;
} EMAIL_TYPE;
#define EMAIL_VAL 4000
extern EMAIL_TYPE gEmailT[EMAIL_VAL];
enum {
//------------------------------
//Read Email.edt
// read message from Email.edt
TYPE_EMAIL_EMAIL_EDT = 0,
// read message from Email.edt and nickname (sender) read from MercProfiles.xml
TYPE_EMAIL_EMAIL_EDT_NAME_MERC,
//-------------------------------
//Read *.xml
//Read message from Email\EmailMercAvailable.xml.XML and nickname (sender) read from MercProfiles.xml
TYPE_EMAIL_AIM_AVAILABLE,
//Read message from Email\EmailMercLevelUp.xml.XML and nickname (sender) read from MercProfiles.xml
TYPE_EMAIL_MERC_LEVEL_UP,
//Read from others *.XMLs
TYPE_EMAIL_BOBBY_R,
//Read from JA2 Email.edt
TYPE_EMAIL_BOBBY_R_EMAIL_JA2_EDT,
TYPE_EMAIL_INSURANCE_COMPANY_EMAIL_JA2_EDT,
TYPE_EMAIL_DEAD_MERC_AIM_SITE_EMAIL_JA2_EDT,
//Read from others *.XMLs
TYPE_EMAIL_ENRICO,
TYPE_EMAIL_CHAR_PROFILE_SITE,
TYPE_EMAIL_GAME_HELP,
TYPE_EMAIL_IMP_PROFILE_RESULTS,
TYPE_EMAIL_SPECK_FROM_MERC,
TYPE_EMAIL_RIS_EMAIL,
TYPE_EMAIL_INSURANCE_COMPANY,
TYPE_EMAIL_KING_PIN,
TYPE_EMAIL_JOHN_KULBA,
TYPE_EMAIL_AIM_SITE,
TYPE_EMAIL_OTHER,
};
enum {
TYPE_E_NONE = 0,
TYPE_E_AIM_L1 = 1, //206
TYPE_E_AIM_L2 = 2, //27
TYPE_E_AIM_L3 = 3, //217
TYPE_E_AIM_L4 = 4, //214
TYPE_E_INSURANCE_L1 = 5, //170
TYPE_E_INSURANCE_L2 = 6, //211
TYPE_E_INSURANCE_L3 = 7, //170
TYPE_E_INSURANCE_L4 = 8, //173
TYPE_E_INSURANCE_L5 = 9, //179
TYPE_E_INSURANCE_L6 = 10, //176
TYPE_EMAIL_BOBBY_R_L1 = 11,
};
extern EMAIL_MERC_AVAILABLE_VALUES EmailMercAvailableText[NUM_PROFILES];
extern EMAIL_MERC_LEVEL_UP_VALUES EmailMercLevelUpText[NUM_PROFILES];
extern EMAIL_MERC_INSURANCE_VALUES EmailInsuranceText[NUM_PROFILES];
extern EMAIL_OTHER_VALUES EmailOtherText[EMAIL_INDEX];
extern BOOLEAN ReadXMLEmail;
extern void AddEmailTypeXML( INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iCurrentIMPPosition, UINT8 EmailType );
extern void AddPreReadEmailTypeXML( INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, UINT8 EmailType );
extern void AddEmailWithSpecialDataXML(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iFirstData, UINT32 uiSecondData, UINT8 EmailType );
extern BOOLEAN SaveNewEmailDataToSaveGameFile( HWFILE hFile );
extern BOOLEAN LoadNewEmailDataFromLoadGameFile( HWFILE hFile );
#ifdef JA2UB
extern void AddBobbyREmailJA2(INT32 iMessageOffset, INT32 iMessageLength, UINT8 ubSender, INT32 iDate, INT32 iCurrentIMPPosition, INT16 iCurrentShipmentDestinationID, UINT8 EmailType );
#endif
#endif
+291 -2
View File
@@ -20,6 +20,10 @@
#include "GameSettings.h"
#endif
#ifdef JA2UB
#include "ub_config.h"
#endif
#define TOP_X LAPTOP_SCREEN_UL_X
#define TOP_Y LAPTOP_SCREEN_UL_Y
#define BLOCK_FILE_HEIGHT 10
@@ -44,7 +48,12 @@
#define FILES_LIST_X FILES_SENDER_TEXT_X
#define FILES_LIST_Y ( 9 * BLOCK_HEIGHT )
#define FILES_LIST_WIDTH 100
#ifdef JA2UB
#define LENGTH_OF_ENRICO_FILE 39 //Ja25 68
#else
#define LENGTH_OF_ENRICO_FILE 68
#endif
#define MAX_FILE_MESSAGE_PAGE_SIZE 325
#define VIEWER_MESSAGE_BODY_START_Y FILES_LIST_Y
#define PREVIOUS_FILE_PAGE_BUTTON_X iScreenWidthOffset + 553
@@ -56,6 +65,13 @@
#define FILES_COUNTER_2_WIDTH 43
#define FILES_COUNTER_3_WIDTH 45
#ifdef JA2UB
#define RIS_EDT_FILE_JA25 "BINARYDATA\\RIS25.edt"
#define RIS_EDT_FILE_JA2 "BINARYDATA\\RIS.edt"
#define MAP_JA25 "LAPTOP\\TraconaMap.sti"
#define MAP_JA2 "LAPTOP\\ArucoFilesMap.sti"
#endif
// the highlighted line
INT32 iHighLightFileLine=-1;
@@ -176,6 +192,8 @@ void AddStringToFilesList( STR16 pString );
BOOLEAN HandleSpecialFiles( UINT8 ubFormat );
BOOLEAN HandleSpecialTerroristFile( INT32 iFileNumber, STR sPictureName );
BOOLEAN HandleMissionBriefingFiles( UINT8 ubFormat ); //mission briefing by Jazz
FileRecordWidthPtr CreateWidthRecordsForMissionBriefingFile( void );
// callbacks
void FilesBtnCallBack(MOUSE_REGION * pRegion, INT32 iReason );
@@ -224,8 +242,16 @@ void GameInitFiles( )
ClearFilesList( );
// add background check by RIS
AddFilesToPlayersLog( ENRICO_BACKGROUND, 0,255, NULL, NULL );
//#ifdef JA2UB
//if ( gGameUBOptions.RISRAPORT == TRUE )
// AddFilesToPlayersLog( ENRICO_BACKGROUND, 0,255, NULL, NULL );
//#else
AddFilesToPlayersLog( ENRICO_BACKGROUND, 0,255, NULL, NULL );
//#endif
//mission briefing by Jazz
//AddFilesToPlayersLog( MISSION_BRIEFING, 0,4, NULL, NULL );
}
void EnterFiles()
@@ -997,6 +1023,11 @@ BOOLEAN DisplayFormattedText( void )
// load first graphic
HandleSpecialTerroristFile( pFilesList->ubCode, pFilesList->pPicFileNameList[ 0 ] );
break;
case 4:
// picture on the left, with text on right and below
// load first graphic
HandleMissionBriefingFiles( pFilesList->ubFormat );
break;
default:
HandleSpecialFiles( pFilesList->ubFormat );
break;
@@ -1009,6 +1040,232 @@ BOOLEAN DisplayFormattedText( void )
return ( TRUE );
}
//Mission briefing by Jazz
FileRecordWidthPtr CreateWidthRecordsForMissionBriefingFile( void )
{
// this fucntion will create the width list for the Arulco intelligence file
FileRecordWidthPtr pTempRecord = NULL;
FileRecordWidthPtr pRecordListHead = NULL;
// first record width
// pTempRecord = CreateRecordWidth( 7, 350, 200,0 );
pTempRecord = CreateRecordWidth( FILES_COUNTER_1_WIDTH, 200, 0,0 );
// set up head of list now
pRecordListHead = pTempRecord;
// next record
// pTempRecord->Next = CreateRecordWidth( 43, 200,0, 0 );
pTempRecord->Next = CreateRecordWidth( FILES_COUNTER_2_WIDTH, 200,0, 0 );
pTempRecord = pTempRecord->Next;
// and the next..
// pTempRecord->Next = CreateRecordWidth( 45, 200,0, 0 );
pTempRecord->Next = CreateRecordWidth( FILES_COUNTER_3_WIDTH, 200,0, 0 );
pTempRecord = pTempRecord->Next;
return( pRecordListHead );
}
BOOLEAN HandleMissionBriefingFiles( UINT8 ubFormat )
{
INT32 iCounter = 0;
CHAR16 sString[2048];
FileStringPtr pTempString = NULL ;
FileStringPtr pLocatorString = NULL;
INT32 iYPositionOnPage = 0;
INT32 iFileLineWidth = 0;
INT32 iFileStartX = 0;
UINT32 uiFlags = 0;
UINT32 uiFont = 0;
BOOLEAN fGoingOffCurrentPage = FALSE;
FileRecordWidthPtr WidthList = NULL;
UINT32 uiPicture;
HVOBJECT hHandle;
VOBJECT_DESC VObjectDesc;
ClearFileStringList( );
switch( ubFormat )
{
case( 4 ):
// load data
// read one record from file manager file
WidthList = CreateWidthRecordsForMissionBriefingFile( );
while( iCounter < 250 )
{
LoadEncryptedDataFromFile( "binarydata\\MissionBriefing.EDT", sString, FILE_STRING_SIZE * ( iCounter ) * 2, FILE_STRING_SIZE * 2 );
AddStringToFilesList( sString );
iCounter++;
}
pTempString = pFileStringList;
iYPositionOnPage = 0;
iCounter = 0;
pLocatorString = pTempString;
pTempString = GetFirstStringOnThisPage( pFileStringList,FILES_TEXT_FONT, 350, FILE_GAP, giFilesPage, MAX_FILE_MESSAGE_PAGE_SIZE, WidthList);
// find out where this string is
while( pLocatorString != pTempString )
{
iCounter++;
pLocatorString = pLocatorString->Next;
}
// move through list and display
while( pTempString )
{
uiFlags = IAN_WRAP_NO_SHADOW;
// copy over string
wcscpy( sString, pTempString->pString );
if( sString[ 0 ] == 0 )
{
// on last page
fOnLastFilesPageFlag = TRUE;
}
// set up font
uiFont = FILES_TEXT_FONT;
if( giFilesPage == 0 )
{
switch( iCounter )
{
case( 0 ):
uiFont = FILES_TITLE_FONT;
break;
}
}
if( iCounter == 0 )
{
// reset width
iFileLineWidth = 350;
iFileStartX = (UINT16) ( FILE_VIEWER_X + 10 );
}
else
{
// reset width
iFileLineWidth = 350;
iFileStartX = (UINT16) ( FILE_VIEWER_X + 10 );
}
if( ( iYPositionOnPage + IanWrappedStringHeight(0, 0, ( UINT16 )iFileLineWidth, FILE_GAP,
uiFont, 0, sString,
0, 0, 0 ) ) < MAX_FILE_MESSAGE_PAGE_SIZE )
{
// now print it
iYPositionOnPage += ( INT32 )IanDisplayWrappedString((UINT16) ( iFileStartX ), ( UINT16 )( FILE_VIEWER_Y + iYPositionOnPage), ( INT16 )iFileLineWidth, FILE_GAP, uiFont, FILE_TEXT_COLOR, sString,0,FALSE, uiFlags );
fGoingOffCurrentPage = FALSE;
}
else
{
// gonna get cut off...end now
fGoingOffCurrentPage = TRUE;
}
pTempString = pTempString->Next;
if( pTempString == NULL )
{
// on last page
fOnLastFilesPageFlag = TRUE;
}
else
{
fOnLastFilesPageFlag = FALSE;
}
// going over the edge, stop now
if( fGoingOffCurrentPage == TRUE )
{
pTempString = NULL;
}
iCounter++;
}
ClearOutWidthRecordsList( WidthList );
ClearFileStringList( );
break;
}
// place pictures
// page 1 picture of country
if( giFilesPage == 0 )
{
// title bar
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
//Ja25, new map
#ifdef JA2UB
if (FileExists(MAP_JA25))
{
FilenameForBPP("LAPTOP\\TraconaMap.sti", VObjectDesc.ImageFile);
}
else
{
FilenameForBPP("LAPTOP\\ArucoFilesMap.sti", VObjectDesc.ImageFile);
}
#else
FilenameForBPP("LAPTOP\\ArucoFilesMap.sti", VObjectDesc.ImageFile);
#endif
CHECKF(AddVideoObject(&VObjectDesc, &uiPicture));
// get title bar object
GetVideoObject(&hHandle, uiPicture);
// blt title bar to screen
BltVideoObject(FRAME_BUFFER, hHandle, 0,iScreenWidthOffset + 300, iScreenHeightOffset + 270, VO_BLT_SRCTRANSPARENCY,NULL);
DeleteVideoObjectFromIndex( uiPicture );
}
else if( giFilesPage == 1 )
{
// title bar
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
//Ja25, new map
#ifdef JA2UB
if (FileExists(MAP_JA25))
{
FilenameForBPP("LAPTOP\\TraconaMap.sti", VObjectDesc.ImageFile);
}
else
{
FilenameForBPP("LAPTOP\\ArucoFilesMap.sti", VObjectDesc.ImageFile);
}
#else
FilenameForBPP("LAPTOP\\ArucoFilesMap.sti", VObjectDesc.ImageFile);
#endif
CHECKF(AddVideoObject(&VObjectDesc, &uiPicture));
// get title bar object
GetVideoObject(&hHandle, uiPicture);
// blt title bar to screen
BltVideoObject(FRAME_BUFFER, hHandle, 0,iScreenWidthOffset + 300, iScreenHeightOffset + 270, VO_BLT_SRCTRANSPARENCY,NULL);
DeleteVideoObjectFromIndex( uiPicture );
}
return ( TRUE );
}
//-------------------------------------------
BOOLEAN HandleSpecialFiles( UINT8 ubFormat )
{
@@ -1041,7 +1298,18 @@ BOOLEAN HandleSpecialFiles( UINT8 ubFormat )
WidthList = CreateWidthRecordsForAruloIntelFile( );
while( iCounter < LENGTH_OF_ENRICO_FILE )
{
#ifdef JA2UB
if (FileExists(RIS_EDT_FILE_JA25))
{
LoadEncryptedDataFromFile( RIS_EDT_FILE_JA25, sString, FILE_STRING_SIZE * ( iCounter ) * 2, FILE_STRING_SIZE * 2 );
}
else
{
LoadEncryptedDataFromFile( RIS_EDT_FILE_JA25, sString, FILE_STRING_SIZE * ( iCounter ) * 2, FILE_STRING_SIZE * 2 );
}
#else
LoadEncryptedDataFromFile( "BINARYDATA\\RIS.EDT", sString, FILE_STRING_SIZE * ( iCounter ) * 2, FILE_STRING_SIZE * 2 );
#endif
AddStringToFilesList( sString );
iCounter++;
}
@@ -1189,7 +1457,19 @@ BOOLEAN HandleSpecialFiles( UINT8 ubFormat )
{
// title bar
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
#ifdef JA2UB
//Ja25, new map
if (FileExists(MAP_JA25))
{
FilenameForBPP("LAPTOP\\TraconaMap.sti", VObjectDesc.ImageFile);
}
else
{
FilenameForBPP("LAPTOP\\ArucoFilesMap.sti", VObjectDesc.ImageFile);
}
#else
FilenameForBPP("LAPTOP\\ArucoFilesMap.sti", VObjectDesc.ImageFile);
#endif
CHECKF(AddVideoObject(&VObjectDesc, &uiPicture));
// get title bar object
@@ -1201,6 +1481,10 @@ BOOLEAN HandleSpecialFiles( UINT8 ubFormat )
DeleteVideoObjectFromIndex( uiPicture );
}
#ifdef JA2UB
//JA25 : no picture needed
#else
else if( giFilesPage == 4 )
{
// kid pic
@@ -1217,6 +1501,11 @@ BOOLEAN HandleSpecialFiles( UINT8 ubFormat )
DeleteVideoObjectFromIndex( uiPicture );
}
#endif
#ifdef JA2UB
//Ja25 No picture
#else
else if( giFilesPage == 5 )
{
@@ -1234,7 +1523,7 @@ BOOLEAN HandleSpecialFiles( UINT8 ubFormat )
DeleteVideoObjectFromIndex( uiPicture );
}
#endif
return ( TRUE );
}
+4
View File
@@ -652,6 +652,9 @@ void BtnFlowerOrderSendButtonCallback(GUI_BUTTON *btn,INT32 reason)
if ( gubCurrentlySelectedFlowerLocation == 7 )
{
#ifdef JA2UB
// no UB
#else
// sent to meduna!
if ( gfFLoristCheckBox0Down )
{
@@ -661,6 +664,7 @@ void BtnFlowerOrderSendButtonCallback(GUI_BUTTON *btn,INT32 reason)
{
HandleFlowersMeanwhileScene( 1 );
}
#endif
}
//increment the order number
+27
View File
@@ -68,6 +68,11 @@ UINT32 guiSHADELINE;
//UINT32 guiVERTLINE;
//UINT32 guiBIGBOX;
#ifdef JA2UB
#define QUEST_EDT_FILE_JA25 "BINARYDATA\\quests25.edt"
#define QUEST_EDT_FILE_JA2 "BINARYDATA\\quests.edt"
#endif
enum{
PREV_PAGE_BUTTON=0,
NEXT_PAGE_BUTTON,
@@ -1681,14 +1686,36 @@ UINT32 GetTimeQuestWasStarted( UINT8 ubCode )
void GetQuestStartedString( UINT8 ubQuestValue, STR16 sQuestString )
{
// open the file and copy the string
#ifdef JA2UB
if (FileExists(QUEST_EDT_FILE_JA25))
{
LoadEncryptedDataFromFile( QUEST_EDT_FILE_JA25, sQuestString, 160 * ( ubQuestValue * 2 ), 160 );
}
else
{
LoadEncryptedDataFromFile( QUEST_EDT_FILE_JA2, sQuestString, 160 * ( ubQuestValue * 2 ), 160 );
}
#else
LoadEncryptedDataFromFile( "BINARYDATA\\quests.edt", sQuestString, 160 * ( ubQuestValue * 2 ), 160 );
#endif
}
void GetQuestEndedString( UINT8 ubQuestValue, STR16 sQuestString )
{
// open the file and copy the string
#ifdef JA2UB
if (FileExists(QUEST_EDT_FILE_JA25))
{
LoadEncryptedDataFromFile( QUEST_EDT_FILE_JA25, sQuestString, 160 * ( ( ubQuestValue * 2 ) + 1), 160 );
}
else
{
LoadEncryptedDataFromFile( QUEST_EDT_FILE_JA2, sQuestString, 160 * ( ubQuestValue * 2 ), 160 );
}
#else
LoadEncryptedDataFromFile( "BINARYDATA\\quests.edt", sQuestString, 160 * ( ( ubQuestValue * 2 ) + 1), 160 );
#endif
}
+55 -5
View File
@@ -28,6 +28,11 @@
#endif
#include <vector>
#ifdef JA2UB
#include "ub_config.h"
#include "quests.h"
#endif
#define INS_CTRCT_ORDER_GRID_WIDTH 132
#define INS_CTRCT_ORDER_GRID_HEIGHT 216
#define INS_CTRCT_ORDER_GRID_OFFSET_X INS_CTRCT_ORDER_GRID_WIDTH + 2
@@ -1361,12 +1366,30 @@ void StartInsuranceInvestigation( UINT8 ubPayoutID )
if (gStrategicStatus.ubInsuranceInvestigationsCnt == 0)
{
// first offense
AddEmailWithSpecialData( INSUR_SUSPIC, INSUR_SUSPIC_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID );
#ifdef JA2UB
// no UB
if( gubQuest[ QUEST_FIX_LAPTOP ] == QUESTDONE || gGameUBOptions.LaptopQuestEnabled == FALSE )
{
if ( gGameUBOptions.LaptopLinkInsurance == TRUE )
AddEmailWithSpecialData( 173, INSUR_SUSPIC_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, TYPE_EMAIL_INSURANCE_COMPANY_EMAIL_JA2_EDT, TYPE_E_INSURANCE_L4 );
}
#else
AddEmailWithSpecialData( INSUR_SUSPIC, INSUR_SUSPIC_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE );
#endif
}
else
{
// subsequent offense
AddEmailWithSpecialData( INSUR_SUSPIC_2, INSUR_SUSPIC_2_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID );
#ifdef JA2UB
// no UB
if( gubQuest[ QUEST_FIX_LAPTOP ] == QUESTDONE || gGameUBOptions.LaptopQuestEnabled == FALSE )
{
if ( gGameUBOptions.LaptopLinkInsurance == TRUE )
AddEmailWithSpecialData( 179, INSUR_SUSPIC_2_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, TYPE_EMAIL_INSURANCE_COMPANY_EMAIL_JA2_EDT, TYPE_E_INSURANCE_L5 );
}
#else
AddEmailWithSpecialData( INSUR_SUSPIC_2, INSUR_SUSPIC_2_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE );
#endif
}
if ( gMercProfiles[ LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID ].ubSuspiciousDeath == VERY_SUSPICIOUS_DEATH )
@@ -1394,11 +1417,29 @@ void EndInsuranceInvestigation( UINT8 ubPayoutID )
if ( gMercProfiles[ LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID ].ubSuspiciousDeath == VERY_SUSPICIOUS_DEATH )
{
// fraud, no payout!
AddEmailWithSpecialData( INSUR_1HOUR_FRAUD, INSUR_1HOUR_FRAUD_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID );
#ifdef JA2UB
// no UB
if( gubQuest[ QUEST_FIX_LAPTOP ] == QUESTDONE || gGameUBOptions.LaptopQuestEnabled == FALSE )
{
if ( gGameUBOptions.LaptopLinkInsurance == TRUE )
AddEmailWithSpecialData( 211, INSUR_1HOUR_FRAUD_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, TYPE_EMAIL_INSURANCE_COMPANY_EMAIL_JA2_EDT, TYPE_E_INSURANCE_L2 );
}
#else
AddEmailWithSpecialData( INSUR_1HOUR_FRAUD, INSUR_1HOUR_FRAUD_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE );
#endif
}
else
{
AddEmailWithSpecialData( INSUR_INVEST_OVER, INSUR_INVEST_OVER_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID );
#ifdef JA2UB
// No UB
if( gubQuest[ QUEST_FIX_LAPTOP ] == QUESTDONE || gGameUBOptions.LaptopQuestEnabled == FALSE )
{
if ( gGameUBOptions.LaptopLinkInsurance == TRUE )
AddEmailWithSpecialData( 176, INSUR_INVEST_OVER_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, TYPE_EMAIL_INSURANCE_COMPANY_EMAIL_JA2_EDT, TYPE_E_INSURANCE_L6 );
}
#else
AddEmailWithSpecialData( INSUR_INVEST_OVER, INSUR_INVEST_OVER_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE );
#endif
// only now make a payment (immediately)
InsuranceContractPayLifeInsuranceForDeadMerc( ubPayoutID );
@@ -1427,7 +1468,16 @@ void InsuranceContractPayLifeInsuranceForDeadMerc( UINT8 ubPayoutID )
if( gMercProfiles[ LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID ].ubSuspiciousDeath == 0 )
{
//Add an email telling the user that he received an insurance payment
AddEmailWithSpecialData( INSUR_PAYMENT, INSUR_PAYMENT_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID );
#ifdef JA2UB
// no UB
if( gubQuest[ QUEST_FIX_LAPTOP ] == QUESTDONE || gGameUBOptions.LaptopQuestEnabled == FALSE )
{
if ( gGameUBOptions.LaptopLinkInsurance == TRUE )
AddEmailWithSpecialData( 170, INSUR_PAYMENT_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, TYPE_EMAIL_INSURANCE_COMPANY_EMAIL_JA2_EDT, TYPE_E_INSURANCE_L3 );
}
#else
AddEmailWithSpecialData( INSUR_PAYMENT, INSUR_PAYMENT_LENGTH, INSURANCE_COMPANY, GetWorldTotalMin(), LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].iPayOutPrice, LaptopSaveInfo.pLifeInsurancePayouts[ ubPayoutID ].ubMercID, TYPE_EMAIL_EMAIL_EDT, TYPE_E_NONE );
#endif
}
LaptopSaveInfo.ubNumberLifeInsurancePayoutUsed --;
+447 -28
View File
@@ -85,12 +85,26 @@
#endif
#include "connect.h"
#include "Encyclopedia_Data.h"
#include "Encyclopedia.h"
#include "BriefingRoom.h"
#include "BriefingRoomM.h"
#ifdef JA2UB
#include "Ja25_Tactical.h"
#include "Ja25 Strategic Ai.h"
#include "End Game.h"
#include "ub_config.h"
#endif
//forward declarations of common classes to eliminate includes
class OBJECTTYPE;
class SOLDIERTYPE;
#ifdef JA2UB
BOOLEAN gfProcessCustomMaps = FALSE; //ja25 UB
#endif
// icons text id's
enum{
@@ -651,7 +665,10 @@ extern void CheatToGetAll5Merc();
extern void DemoHiringOfMercs( );
#endif
#ifdef JA2UB
//JA25 UB
#define LAPTOP__HAVENT_CREATED_IMP_REMINDER_EMAIL_ARRIVE_TIME ( (8 + Random(4) ) * 60 )
#endif
void SetLaptopExitScreen( UINT32 uiExitScreen )
{
@@ -740,6 +757,13 @@ UINT32 LaptopScreenInit()
//reset the flag that enables the 'just hired merc' popup
LaptopSaveInfo.sLastHiredMerc.fHaveDisplayedPopUpInLaptop = FALSE;
#ifdef JA2UB
//JA25 UB
//Set the internet as WORKING
if ( gGameUBOptions.LaptopQuestEnabled == TRUE )
gubQuest[ QUEST_FIX_LAPTOP ] = QUESTNOTSTARTED;
#endif
//Initialize all vars
guiCurrentLaptopMode = LAPTOP_MODE_EMAIL;
guiPreviousLaptopMode = LAPTOP_MODE_NONE;
@@ -770,12 +794,27 @@ UINT32 LaptopScreenInit()
GameInitEmail();
GameInitCharProfile();
GameInitFlorist();
#ifdef JA2UB
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
{
GameInitInsurance();
GameInitInsuranceContract();
}
//JA25:
#else
GameInitInsurance();
GameInitInsuranceContract();
#endif
GameInitFuneral();
GameInitSirTech();
GameInitFiles();
GameInitPersonnel();
//legion
GameInitEncyclopedia();
GameInitEncyclopediaLocation();
GameInitBriefingRoom();
GameInitBriefingRoomEnter();
// init program states
memset( &gLaptopProgramStates, LAPTOP_PROGRAM_MINIMIZED, sizeof( gLaptopProgramStates ) );
@@ -783,7 +822,9 @@ UINT32 LaptopScreenInit()
gfAtLeastOneMercWasHired = FALSE;
//No longer inits the laptop screens, now InitLaptopAndLaptopScreens() does
#ifdef JA2UB
InitJa25SaveStruct();
#endif
return( 1 );
}
@@ -798,6 +839,11 @@ BOOLEAN InitLaptopAndLaptopScreens()
LaptopSaveInfo.fIMPCompletedFlag = FALSE;
//Reset the flag so that BOBBYR's isnt available at the begining of the game
#ifdef JA2UB
if ( gGameUBOptions.fBobbyRSite == TRUE )
LaptopSaveInfo.fBobbyRSiteCanBeAccessed = TRUE;
else
#endif
LaptopSaveInfo.fBobbyRSiteCanBeAccessed = FALSE;
return( TRUE );
@@ -825,7 +871,13 @@ DrawLapTopText()
//This is only called once at game shutdown.
UINT32 LaptopScreenShutdown()
{
#ifdef JA2UB
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
InsuranceContractEndGameShutDown();
//JA25:
#else
InsuranceContractEndGameShutDown();
#endif
BobbyRayMailOrderEndGameShutDown();
ShutDownEmailList();
@@ -991,16 +1043,24 @@ INT32 EnterLaptop()
fMaximizingProgram = FALSE;
fMinizingProgram = FALSE;
// initialize open queue
InitLaptopOpenQueue( );
gfShowBookmarks=FALSE;
LoadBookmark( );
if (!is_networked)
SetBookMark(AIM_BOOKMARK);
#ifdef JA2UB
//JA25 UB
SetBookMark(MERC_BOOKMARK);
#endif
if ( gGameExternalOptions.gEncyclopedia == TRUE && !is_networked )
SetBookMark(ENCYCLOPEDIA_BOOKMARK);
if ( gGameExternalOptions.gBriefingRoom == TRUE && !is_networked )
SetBookMark(BRIEFING_ROOM_BOOKMARK);
LoadLoadPending( );
@@ -1137,7 +1197,13 @@ void ExitLaptop()
// CloseLibrary( LIBRARY_LAPTOP );
//pause the game because we dont want time to advance in the laptop
UnPauseGame();
#ifdef JA2UB
//ja25 UB
if( gTacticalStatus.uiFlags & IN_ENDGAME_SEQUENCE )
{
HandleJa25EndGameAndGoToCreditsScreen( FALSE );
}
#endif
}
void
@@ -1183,6 +1249,27 @@ void RenderLaptop()
case( LAPTOP_MODE_NONE ):
DrawDeskTopBackground( );
break;
case LAPTOP_MODE_ENCYCLOPEDIA: //LEGION
RenderEncyclopedia();
break;
case LAPTOP_MODE_ENCYCLOPEDIA_LOCATION:
RenderEncyclopediaLocation(FALSE);
break;
case LAPTOP_MODE_BRIEFING_ROOM_PAGE:
RenderBriefingRoom();
break;
case LAPTOP_MODE_BRIEFING_ROOM_ENTER:
RenderBriefingRoomEnter();
break;
case LAPTOP_MODE_BRIEFING_ROOM:
RenderEncyclopediaLocation(FALSE);
break;
case LAPTOP_MODE_AIM:
RenderAIM();
break;
@@ -1214,10 +1301,18 @@ void RenderLaptop()
RenderMercsFiles();
break;
case LAPTOP_MODE_MERC_ACCOUNT:
#ifdef JA2UB
//Ja25
#else
RenderMercsAccount();
#endif
break;
case LAPTOP_MODE_MERC_NO_ACCOUNT:
#ifdef JA2UB
//Ja25
#else
RenderMercsNoAccount();
#endif
break;
case LAPTOP_MODE_BOBBY_R:
@@ -1259,19 +1354,43 @@ void RenderLaptop()
break;
case LAPTOP_MODE_INSURANCE:
#ifdef JA2UB
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
RenderInsurance();
//JA25: // Assert( 0 );
#else
RenderInsurance();
#endif
break;
case LAPTOP_MODE_INSURANCE_INFO:
#ifdef JA2UB
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
RenderInsuranceInfo();
//JA25: // Assert( 0 );
#else
RenderInsuranceInfo();
#endif
break;
case LAPTOP_MODE_INSURANCE_CONTRACT:
#ifdef JA2UB
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
RenderInsuranceContract();
//JA25:
#else
RenderInsuranceContract();
#endif
break;
case LAPTOP_MODE_INSURANCE_COMMENTS:
#ifdef JA2UB
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
RenderInsuranceComments();
//JA25: // Assert( 0 );
#else
RenderInsuranceComments();
#endif
break;
case LAPTOP_MODE_FUNERAL:
@@ -1450,6 +1569,16 @@ void EnterNewLaptopMode()
default:
if( gLaptopProgramStates[ LAPTOP_PROGRAM_WEB_BROWSER ] == LAPTOP_PROGRAM_MINIMIZED )
{
if ( guiCurrentLaptopMode == LAPTOP_MODE_ENCYCLOPEDIA_LOCATION || guiCurrentLaptopMode == LAPTOP_MODE_ENCYCLOPEDIA )
{
guiCurrentLaptopMode = LAPTOP_MODE_ENCYCLOPEDIA;
}
else if ( guiCurrentLaptopMode == LAPTOP_MODE_BRIEFING_ROOM_PAGE || guiCurrentLaptopMode == LAPTOP_MODE_BRIEFING_ROOM || guiCurrentLaptopMode == LAPTOP_MODE_BRIEFING_ROOM_ENTER )
{
guiCurrentLaptopMode = LAPTOP_MODE_BRIEFING_ROOM_ENTER;
}
// minized, maximized
if( fMaximizingProgram == FALSE )
{
@@ -1536,6 +1665,26 @@ void EnterNewLaptopMode()
//Initialize the new mode.
switch( guiCurrentLaptopMode )
{
//legion
case LAPTOP_MODE_ENCYCLOPEDIA:
EnterEncyclopedia();
break;
case LAPTOP_MODE_ENCYCLOPEDIA_LOCATION:
EnterEncyclopediaLocation();
break;
case LAPTOP_MODE_BRIEFING_ROOM_PAGE:
EnterBriefingRoom();
break;
case LAPTOP_MODE_BRIEFING_ROOM_ENTER:
EnterBriefingRoomEnter();
break;
case LAPTOP_MODE_BRIEFING_ROOM:
EnterEncyclopediaLocation();
break;
case LAPTOP_MODE_AIM:
EnterAIM();
@@ -1570,10 +1719,18 @@ void EnterNewLaptopMode()
EnterMercsFiles();
break;
case LAPTOP_MODE_MERC_ACCOUNT:
#ifdef JA2UB
//Ja25
#else
EnterMercsAccount();
#endif
break;
case LAPTOP_MODE_MERC_NO_ACCOUNT:
#ifdef JA2UB
//Ja25
#else
EnterMercsNoAccount();
#endif
break;
case LAPTOP_MODE_BOBBY_R:
@@ -1613,7 +1770,24 @@ void EnterNewLaptopMode()
case LAPTOP_MODE_FLORIST_CARD_GALLERY:
EnterFloristCards();
break;
#ifdef JA2UB
case LAPTOP_MODE_INSURANCE:
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
EnterInsurance();
break;
case LAPTOP_MODE_INSURANCE_INFO:
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
EnterInsuranceInfo();
break;
case LAPTOP_MODE_INSURANCE_CONTRACT:
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
EnterInsuranceContract();
break;
case LAPTOP_MODE_INSURANCE_COMMENTS:
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
EnterInsuranceComments();
break;
#else
case LAPTOP_MODE_INSURANCE:
EnterInsurance();
break;
@@ -1626,7 +1800,7 @@ void EnterNewLaptopMode()
case LAPTOP_MODE_INSURANCE_COMMENTS:
EnterInsuranceComments();
break;
#endif
case LAPTOP_MODE_FUNERAL:
EnterFuneral();
break;
@@ -1694,6 +1868,26 @@ void HandleLapTopHandles()
switch( guiCurrentLaptopMode )
{
//legion
case LAPTOP_MODE_ENCYCLOPEDIA:
HandleEncyclopedia();
break;
case LAPTOP_MODE_ENCYCLOPEDIA_LOCATION:
HandleEncyclopediaLocation();
break;
case LAPTOP_MODE_BRIEFING_ROOM_PAGE:
HandleBriefingRoom();
break;
case LAPTOP_MODE_BRIEFING_ROOM_ENTER:
HandleBriefingRoomEnter();
break;
case LAPTOP_MODE_BRIEFING_ROOM:
HandleEncyclopediaLocation();
break;
case LAPTOP_MODE_AIM:
@@ -1727,13 +1921,21 @@ void HandleLapTopHandles()
case LAPTOP_MODE_MERC_FILES:
HandleMercsFiles();
break;
#ifdef JA2UB
case LAPTOP_MODE_MERC_ACCOUNT:
//Ja25 HandleMercsAccount();
break;
case LAPTOP_MODE_MERC_NO_ACCOUNT:
//Ja25 HandleMercsNoAccount();
break;
#else
case LAPTOP_MODE_MERC_ACCOUNT:
HandleMercsAccount();
break;
case LAPTOP_MODE_MERC_NO_ACCOUNT:
HandleMercsNoAccount();
break;
#endif
case LAPTOP_MODE_BOBBY_R:
HandleBobbyR();
@@ -1773,7 +1975,30 @@ void HandleLapTopHandles()
case LAPTOP_MODE_FLORIST_CARD_GALLERY:
HandleFloristCards();
break;
#ifdef JA2UB
case LAPTOP_MODE_INSURANCE:
// Assert( 0 );
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
HandleInsurance();
break;
case LAPTOP_MODE_INSURANCE_INFO:
// Assert( 0 );
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
HandleInsuranceInfo();
break;
case LAPTOP_MODE_INSURANCE_CONTRACT:
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
HandleInsuranceContract();
break;
case LAPTOP_MODE_INSURANCE_COMMENTS:
// Assert( 0 );
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
HandleInsuranceComments();
break;
#else
case LAPTOP_MODE_INSURANCE:
HandleInsurance();
break;
@@ -1789,6 +2014,7 @@ void HandleLapTopHandles()
HandleInsuranceComments();
break;
#endif
case LAPTOP_MODE_FUNERAL:
HandleFuneral();
break;
@@ -1857,9 +2083,9 @@ UINT32 LaptopScreenHandle()
// just entered
if(gfEnterLapTop)
{
EnterLaptop();
CreateLaptopButtons();
gfEnterLapTop=FALSE;
EnterLaptop();
CreateLaptopButtons();
gfEnterLapTop=FALSE;
}
if( gfStartMapScreenToLaptopTransition )
@@ -2186,6 +2412,29 @@ UINT32 ExitLaptopMode(UINT32 uiMode)
switch( uiMode )
{
case LAPTOP_MODE_ENCYCLOPEDIA:
ExitEncyclopedia();
//InitEncyklopediaBool();
break;
case LAPTOP_MODE_ENCYCLOPEDIA_LOCATION:
ExitEncyclopediaLocation();
break;
case LAPTOP_MODE_BRIEFING_ROOM_PAGE:
ExitBriefingRoom();
break;
case LAPTOP_MODE_BRIEFING_ROOM_ENTER:
ExitBriefingRoomEnter();
break;
case LAPTOP_MODE_BRIEFING_ROOM:
ExitEncyclopediaLocation();
//InitEncyklopediaBool();
break;
case LAPTOP_MODE_AIM:
ExitAIM();
break;
@@ -2217,13 +2466,21 @@ UINT32 ExitLaptopMode(UINT32 uiMode)
case LAPTOP_MODE_MERC_FILES:
ExitMercsFiles();
break;
#ifdef JA2UB
case LAPTOP_MODE_MERC_ACCOUNT:
//Ja25 ExitMercsAccount();
break;
case LAPTOP_MODE_MERC_NO_ACCOUNT:
//Ja25 ExitMercsNoAccount();
break;
#else
case LAPTOP_MODE_MERC_ACCOUNT:
ExitMercsAccount();
break;
case LAPTOP_MODE_MERC_NO_ACCOUNT:
ExitMercsNoAccount();
break;
#endif
case LAPTOP_MODE_BOBBY_R:
ExitBobbyR();
@@ -2263,7 +2520,30 @@ UINT32 ExitLaptopMode(UINT32 uiMode)
case LAPTOP_MODE_FLORIST_CARD_GALLERY:
ExitFloristCards();
break;
#ifdef JA2UB
case LAPTOP_MODE_INSURANCE:
// Assert( 0 );
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
ExitInsurance();
break;
case LAPTOP_MODE_INSURANCE_INFO:
// Assert( 0 );
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
ExitInsuranceInfo();
break;
case LAPTOP_MODE_INSURANCE_CONTRACT:
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
ExitInsuranceContract();
break;
case LAPTOP_MODE_INSURANCE_COMMENTS:
// Assert( 0 );
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
ExitInsuranceComments();
break;
#else
case LAPTOP_MODE_INSURANCE:
ExitInsurance();
break;
@@ -2278,7 +2558,7 @@ UINT32 ExitLaptopMode(UINT32 uiMode)
case LAPTOP_MODE_INSURANCE_COMMENTS:
ExitInsuranceComments();
break;
#endif
case LAPTOP_MODE_FUNERAL:
ExitFuneral();
break;
@@ -2509,6 +2789,11 @@ BOOLEAN LeaveLapTopScreen( void )
fExitingLaptopFlag = TRUE;
InitNewGame( FALSE );
gfDontStartTransitionFromLaptop = TRUE;
#ifdef JA2UB
//Ja25 UB
// ATE: Set flag to look for custom maps
gfProcessCustomMaps = TRUE;
#endif
return( TRUE );
}
}
@@ -2658,12 +2943,31 @@ BOOLEAN HandleExit( void )
void HaventMadeImpMercEmailCallBack()
{
#ifdef JA2UB
//if the Laptop is NOT broken
if( gubQuest[ QUEST_FIX_LAPTOP ] != QUESTINPROGRESS && gGameUBOptions.LaptopQuestEnabled == TRUE )
{
//if the player STILL hasnt made an imp merc yet
if( ( LaptopSaveInfo.fIMPCompletedFlag == FALSE ) && ( LaptopSaveInfo.fSentImpWarningAlready == FALSE ) )
{
//if the player DIDNT import the save
//if( !gubFact[ FACT_PLAYER_IMPORTED_SAVE ] )
//{
//send a follow up email to the player
LaptopSaveInfo.fSentImpWarningAlready = TRUE;
AddEmail( IMP_EMAIL_AGAIN, IMP_EMAIL_AGAIN_LENGTH, CHAR_PROFILE_SITE, GetWorldTotalMin( ), -1 ,-1, TYPE_EMAIL_EMAIL_EDT);
//}
}
}
#else
//if the player STILL hasnt made an imp merc yet
if( ( LaptopSaveInfo.fIMPCompletedFlag == FALSE ) && ( LaptopSaveInfo.fSentImpWarningAlready == FALSE ) )
{
LaptopSaveInfo.fSentImpWarningAlready = TRUE;
AddEmail(IMP_EMAIL_AGAIN,IMP_EMAIL_AGAIN_LENGTH,1, GetWorldTotalMin( ), -1, -1 );
AddEmail(IMP_EMAIL_AGAIN,IMP_EMAIL_AGAIN_LENGTH,1, GetWorldTotalMin( ), -1, -1, TYPE_EMAIL_EMAIL_EDT );
}
#endif
}
@@ -2832,7 +3136,8 @@ void WWWRegionButtonCallback(GUI_BUTTON *btn,INT32 reason )
{
if (btn->uiFlags & BUTTON_CLICKED_ON)
{
btn->uiFlags&=~(BUTTON_CLICKED_ON);
btn->uiFlags&=~(BUTTON_CLICKED_ON);
if(giCurrentRegion!=WWW_REGION)
giOldRegion=giCurrentRegion;
if(!fNewWWW)
@@ -2877,7 +3182,27 @@ void WWWRegionButtonCallback(GUI_BUTTON *btn,INT32 reason )
}
}
giCurrentRegion=WWW_REGION;
RestoreOldRegion(giOldRegion);
RestoreOldRegion(giOldRegion);
if ( guiCurrentWWWMode >= LAPTOP_MODE_FINANCES && guiCurrentWWWMode <= LAPTOP_MODE_BOBBYR_SHIPMENTS )
{
IDPageEncyData = PAGENONE;
UnLoadMenuButtons ();
bEncyclopediaLocation = FALSE;
bEncyclopediaCharacter = FALSE;
bEncyclopediaInventory = FALSE;
bEncyclopediaQuests = FALSE;
bBriefingRoom = FALSE;
bBriefingRoomSpecialMission = FALSE;
}
if ( IDPageEncyData == PAGEENCYCLOPEDIALOCATION ) guiCurrentWWWMode = LAPTOP_MODE_ENCYCLOPEDIA;//{ bEncyclopediaLocation = TRUE; InitData (); }
else if ( IDPageEncyData == PAGEENCYCLOPEDIACHARACTER ) guiCurrentWWWMode = LAPTOP_MODE_ENCYCLOPEDIA;//{ bEncyclopediaCharacter = TRUE; InitData (); }
else if ( IDPageEncyData == PAGEENCYCLOPEDIAINVENTORY ) guiCurrentWWWMode = LAPTOP_MODE_ENCYCLOPEDIA;//{ bEncyclopediaInventory = TRUE; InitData (); }
else if ( IDPageEncyData == PAGEENCYCLOPEDIAQUESTS ) guiCurrentWWWMode = LAPTOP_MODE_ENCYCLOPEDIA;//{ bEncyclopediaQuests = TRUE; InitData (); }
else if ( IDPageEncyData == PAGEBRIEFINGROOM ) guiCurrentWWWMode = LAPTOP_MODE_BRIEFING_ROOM_ENTER;//{ bBriefingRoom = TRUE; InitData (); }
else if ( IDPageEncyData == PAGEBRIEFINGROOMSPECIALMISSION ) guiCurrentWWWMode = LAPTOP_MODE_BRIEFING_ROOM_ENTER;//{ bBriefingRoomSpecialMission = TRUE; InitData (); }
if(guiCurrentWWWMode!=LAPTOP_MODE_NONE)
guiCurrentLaptopMode = guiCurrentWWWMode;
else
@@ -2894,7 +3219,6 @@ void WWWRegionButtonCallback(GUI_BUTTON *btn,INT32 reason )
btn->uiFlags&=~(BUTTON_CLICKED_ON);
// nothing yet
if(giCurrentRegion!=WWW_REGION)
giOldRegion=giCurrentRegion;
@@ -3650,7 +3974,11 @@ void GoToWebPage(INT32 iPageId )
//}
//else
// giRainDelayInternetSite = -1;
#ifdef JA2UB
//if the laptop is broken
if( (gubQuest[ QUEST_FIX_LAPTOP ] != QUESTINPROGRESS) || (gGameUBOptions.LaptopQuestEnabled != TRUE) )
{
#endif
switch(iPageId)
{
case AIM_BOOKMARK:
@@ -3671,6 +3999,46 @@ void GoToWebPage(INT32 iPageId )
fFastLoadFlag = TRUE;
}
break;
//LEGION
case ENCYCLOPEDIA_BOOKMARK:
guiCurrentWWWMode=LAPTOP_MODE_ENCYCLOPEDIA;
guiCurrentLaptopMode=LAPTOP_MODE_ENCYCLOPEDIA;
// do we have to have a World Wide Wait
if( LaptopSaveInfo.fVisitedBookmarkAlready[ ENCYCLOPEDIA_BOOKMARK ] == FALSE )
{
// reset flag and set load pending flag
LaptopSaveInfo.fVisitedBookmarkAlready[ ENCYCLOPEDIA_BOOKMARK ] = TRUE;
fLoadPendingFlag = TRUE;
}
else
{
// fast reload
fLoadPendingFlag = TRUE;
fFastLoadFlag = TRUE;
}
break;
case BRIEFING_ROOM_BOOKMARK:
guiCurrentWWWMode=LAPTOP_MODE_BRIEFING_ROOM_PAGE;
guiCurrentLaptopMode=LAPTOP_MODE_BRIEFING_ROOM_PAGE;
// do we have to have a World Wide Wait
if( LaptopSaveInfo.fVisitedBookmarkAlready[ BRIEFING_ROOM_BOOKMARK ] == FALSE )
{
// reset flag and set load pending flag
LaptopSaveInfo.fVisitedBookmarkAlready[ BRIEFING_ROOM_BOOKMARK ] = TRUE;
fLoadPendingFlag = TRUE;
}
else
{
// fast reload
fLoadPendingFlag = TRUE;
fFastLoadFlag = TRUE;
}
break;
case BOBBYR_BOOKMARK:
guiCurrentWWWMode=LAPTOP_MODE_BOBBY_R;
guiCurrentLaptopMode=LAPTOP_MODE_BOBBY_R;
@@ -3795,6 +4163,20 @@ void GoToWebPage(INT32 iPageId )
}
#ifdef JA2UB
}
//the web is not working
else
{
guiCurrentWWWMode = LAPTOP_MODE_BROKEN_LINK;
guiCurrentLaptopMode = LAPTOP_MODE_BROKEN_LINK;
// slow load
fLoadPendingFlag = TRUE;
fFastLoadFlag = FALSE;
}
#endif
gfShowBookmarks=FALSE;
fReDrawScreenFlag=TRUE;
return;
@@ -3882,6 +4264,14 @@ BOOLEAN DisplayLoadPending( void )
iUnitTime += WWaitDelayIncreasedIfRaining( iUnitTime );
iLoadTime = iUnitTime * 30;
#ifdef JA2UB
//if the site we are going to is the web poage not found page
if( guiCurrentLaptopMode == LAPTOP_MODE_BROKEN_LINK )
{
iLoadTime=1;
iUnitTime=1;
}
#endif
}
@@ -4162,7 +4552,12 @@ void EnterLaptopInitLaptopPages()
EnterInitAimPolicies();
EnterInitAimHistory();
EnterInitFloristGallery();
#ifdef JA2UB
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
EnterInitInsuranceInfo();
#else
EnterInitInsuranceInfo();
#endif
EnterInitBobbyRayOrder();
EnterInitMercSite();
@@ -4271,13 +4666,13 @@ void CheckIfNewWWWW( void )
{
// if no www mode, set new www flag..until new www mode that is not 0
if( guiCurrentWWWMode == LAPTOP_MODE_NONE )
if( guiCurrentWWWMode == LAPTOP_MODE_NONE )
{
fNewWWW = TRUE;
fNewWWW = TRUE;
}
else
{
fNewWWW = FALSE;
fNewWWW = FALSE;
}
return;
@@ -5225,14 +5620,26 @@ void SetCurrentToLastProgramOpened( void )
break;
case( LAPTOP_PROGRAM_WEB_BROWSER ):
// last www mode
if( guiCurrentWWWMode != 0 )
if ( guiCurrentLaptopMode == LAPTOP_MODE_ENCYCLOPEDIA_LOCATION || guiCurrentLaptopMode == LAPTOP_MODE_ENCYCLOPEDIA )
{
guiCurrentLaptopMode = guiCurrentWWWMode;
guiCurrentLaptopMode = LAPTOP_MODE_ENCYCLOPEDIA;
}
else if ( guiCurrentLaptopMode == LAPTOP_MODE_BRIEFING_ROOM_PAGE || guiCurrentLaptopMode == LAPTOP_MODE_BRIEFING_ROOM || guiCurrentLaptopMode == LAPTOP_MODE_BRIEFING_ROOM_ENTER )
{
guiCurrentLaptopMode = LAPTOP_MODE_BRIEFING_ROOM_ENTER;
}
//else if( guiCurrentWWWMode != 0 && ( guiCurrentWWWMode == LAPTOP_MODE_ENCYCLOPEDIA_LOCATION || guiCurrentWWWMode == LAPTOP_MODE_ENCYCLOPEDIA || guiCurrentWWWMode == LAPTOP_MODE_BRIEFING_ROOM_PAGE || guiCurrentWWWMode == LAPTOP_MODE_BRIEFING_ROOM || guiCurrentWWWMode == LAPTOP_MODE_BRIEFING_ROOM_ENTER ) )
else if( guiCurrentWWWMode >= LAPTOP_MODE_FINANCES && guiCurrentWWWMode <= LAPTOP_MODE_BOBBYR_SHIPMENTS )
{
guiCurrentLaptopMode = guiCurrentWWWMode;
}
else
{
guiCurrentLaptopMode = LAPTOP_MODE_WWW;
}
guiCurrentLaptopMode = LAPTOP_MODE_WWW;
//gfShowBookmarks = TRUE;
fShowBookmarkInfo = TRUE;
break;
@@ -5538,7 +5945,12 @@ void HandleKeyBoardShortCutsForLapTop( UINT16 usEvent, UINT32 usParam, UINT16 us
SetBookMark( MERC_BOOKMARK );
SetBookMark( FUNERAL_BOOKMARK );
SetBookMark( FLORIST_BOOKMARK );
#ifdef JA2UB
if (gGameUBOptions.LaptopLinkInsurance == TRUE )
SetBookMark( INSURANCE_BOOKMARK );
#else
SetBookMark( INSURANCE_BOOKMARK );
#endif
}
}
@@ -6492,11 +6904,18 @@ void CreateLaptopButtonHelpText( INT32 iButtonIndex, UINT32 uiButtonHelpTextID )
{
SetButtonFastHelpText( iButtonIndex, gzLaptopHelpText[ uiButtonHelpTextID ] );
}
#ifdef JA2UB
//ja25 ub
void ShouldImpReminderEmailBeSentWhenLaptopBackOnline()
{
//if this is past the point of when the IMP email should have been sent
if( GetWorldTotalMin() > LAPTOP__HAVENT_CREATED_IMP_REMINDER_EMAIL_ARRIVE_TIME )
{
//and the email hasnt been sent
HaventMadeImpMercEmailCallBack();
}
}
#endif
+19
View File
@@ -137,6 +137,17 @@ enum
LAPTOP_MODE_SIRTECH,
LAPTOP_MODE_BROKEN_LINK,
LAPTOP_MODE_BOBBYR_SHIPMENTS,
//ENCYCLOPEDIA
LAPTOP_MODE_ENCYCLOPEDIA,
LAPTOP_MODE_ENCYCLOPEDIA_LOCATION,
LAPTOP_MODE_BRIEFING_ROOM_PAGE,
LAPTOP_MODE_BRIEFING_ROOM,
LAPTOP_MODE_BRIEFING_ROOM_ENTER,
LAPTOP_MODE_AIM_MEMBERS_ARCHIVES_NEW,
};
// bookamrks for WWW bookmark list
@@ -194,6 +205,8 @@ enum{
FLORIST_BOOKMARK,
INSURANCE_BOOKMARK,
CANCEL_STRING,
ENCYCLOPEDIA_BOOKMARK, //Encyclopedia
BRIEFING_ROOM_BOOKMARK,
TEXT_NUM_LAPTOP_BOOKMARKS
};
@@ -205,6 +218,12 @@ extern UINT32 guiLaptopBACKGROUND;
#define DEAD_MERC_COLOR_GREEN 55
#define DEAD_MERC_COLOR_BLUE 55
#ifdef JA2UB
//ja25 UB
void ShouldImpReminderEmailBeSentWhenLaptopBackOnline();
extern BOOLEAN gfProcessCustomMaps;
#endif
#endif
+53 -5
View File
@@ -83,8 +83,12 @@ INT32 guiAccountButtonImage;
BOOLEAN gfMercPlayerDoesntHaveEnoughMoney_DisplayWarning = FALSE;
// The Authorize button
#ifdef JA2UB
// not UB
#else
void BtnMercAuthorizeButtonCallback(GUI_BUTTON *btn,INT32 reason);
UINT32 guiMercAuthorizeBoxButton;
#endif
INT32 guiMercAuthorizeButtonImage;
@@ -202,7 +206,12 @@ INT32 GetNumberOfHiredMercs()
// Is the merc hired?
if( IsMercOnTeam( (UINT8)usMercID ) || gMercProfiles[ usMercID ].iMercMercContractLength != 0 )
{
#ifdef JA2UB
uiContractCharge = gMercProfiles[ usMercID ].uiWeeklySalary * gMercProfiles[ usMercID ].iMercMercContractLength;
#else
uiContractCharge = gMercProfiles[ usMercID ].sSalary * gMercProfiles[ usMercID ].iMercMercContractLength;
#endif
giMercTotalContractCharge += uiContractCharge;
count++;
@@ -285,7 +294,9 @@ BOOLEAN EnterMercsAccount()
guiMercAuthorizeButtonImage = LoadButtonImage("LAPTOP\\BigButtons.sti", -1,0,-1,1,-1 );
#ifdef JA2UB
// not UB
#else
guiMercAuthorizeBoxButton = CreateIconAndTextButton( guiMercAuthorizeButtonImage, MercAccountText[MERC_ACCOUNT_AUTHORIZE],
FONT12ARIAL,
MERC_BUTTON_UP_COLOR, DEFAULT_SHADOW,
@@ -295,6 +306,7 @@ BOOLEAN EnterMercsAccount()
DEFAULT_MOVE_CALLBACK, BtnMercAuthorizeButtonCallback);
SetButtonCursor(guiMercAuthorizeBoxButton, CURSOR_LAPTOP_SCREEN);
SpecifyDisabledButtonStyle( guiMercAuthorizeBoxButton, DISABLED_STYLE_SHADED);
#endif
guiMercBackBoxButton = CreateIconAndTextButton( guiMercAuthorizeButtonImage, MercAccountText[MERC_ACCOUNT_HOME],
FONT12ARIAL,
@@ -329,7 +341,13 @@ void ExitMercsAccount()
DeleteVideoObjectFromIndex(guiAccountNumberGrid);
UnloadButtonImage( guiMercAuthorizeButtonImage );
#ifdef JA2UB
//not UB
#else
RemoveButton( guiMercAuthorizeBoxButton );
#endif
RemoveButton( guiMercBackBoxButton );
DeleteVideoObjectFromIndex(guiMercOrderGrid0);
@@ -391,11 +409,15 @@ void RenderMercsAccount()
DisplayHiredMercs();
#ifdef JA2UB
//not UB
#else
// giMercTotalContractCharge gets set with the price in DisplayHiredMercs(), so if there is currently no charge, disable the button
if( giMercTotalContractCharge == 0 )
{
DisableButton( guiMercAuthorizeBoxButton );
}
#endif
@@ -404,7 +426,9 @@ void RenderMercsAccount()
InvalidateRegion(LAPTOP_SCREEN_UL_X,LAPTOP_SCREEN_WEB_UL_Y,LAPTOP_SCREEN_LR_X,LAPTOP_SCREEN_WEB_LR_Y);
}
#ifdef JA2UB
//not UB
#else
void BtnMercAuthorizeButtonCallback(GUI_BUTTON *btn,INT32 reason)
{
if(reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
@@ -440,7 +464,7 @@ void BtnMercAuthorizeButtonCallback(GUI_BUTTON *btn,INT32 reason)
InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
}
}
#endif
void BtnMercBackButtonCallback(GUI_BUTTON *btn,INT32 reason)
{
@@ -542,11 +566,19 @@ void DisplayHiredMercs()
DrawTextToScreen(sTemp, MERC_AC_SECOND_COLUMN_X, usPosY, MERC_AC_SECOND_COLUMN_WIDTH, MERC_ACCOUNT_DYNAMIC_TEXT_FONT, ubFontColor, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
//Display the mercs rate
#ifdef JA2UB
swprintf(sTemp, L"$%6d",gMercProfiles[ usMercID ].uiWeeklySalary );
#else
swprintf(sTemp, L"$%6d",gMercProfiles[ usMercID ].sSalary );
#endif
DrawTextToScreen(sTemp, MERC_AC_THIRD_COLUMN_X, usPosY, MERC_AC_THIRD_COLUMN_WIDTH, MERC_ACCOUNT_DYNAMIC_TEXT_FONT, ubFontColor, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
//Display the total charge
#ifdef JA2UB
uiContractCharge = gMercProfiles[ usMercID ].uiWeeklySalary * gMercProfiles[ usMercID ].iMercMercContractLength;
#else
uiContractCharge = gMercProfiles[ usMercID ].sSalary * gMercProfiles[ usMercID ].iMercMercContractLength;
#endif
swprintf(sTemp, L"$%6d", uiContractCharge );
DrawTextToScreen(sTemp, MERC_AC_FOURTH_COLUMN_X, usPosY, MERC_AC_FOURTH_COLUMN_WIDTH, MERC_ACCOUNT_DYNAMIC_TEXT_FONT, ubFontColor, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
@@ -584,7 +616,11 @@ void SettleMercAccounts()
if( IsMercOnTeam( ubMercID ) || ( gMercProfiles[ ubMercID ].iMercMercContractLength != 0 ) )
{
//Calc the contract charge
#ifdef JA2UB
iContractCharge = gMercProfiles[ ubMercID ].uiWeeklySalary * gMercProfiles[ ubMercID ].iMercMercContractLength;
#else
iContractCharge = gMercProfiles[ ubMercID ].sSalary * gMercProfiles[ ubMercID ].iMercMercContractLength;
#endif
//if the player can afford to pay this merc
if( LaptopSaveInfo.iCurrentBalance >= iPartialPayment + iContractCharge )
@@ -611,12 +647,20 @@ void SettleMercAccounts()
}
// add the transaction to the finance page
#ifdef JA2UB
AddTransactionToPlayersBook( PAY_SPECK_FOR_MERC, GetMercIDFromMERCArray( gubCurMercIndex ), GetWorldTotalMin(), -iPartialPayment );
#else
AddTransactionToPlayersBook( PAY_SPECK_FOR_MERC, GetMercIDFromMERCArray( gubCurMercIndex ), GetWorldTotalMin(), -iPartialPayment );
#endif
AddHistoryToPlayersLog( HISTORY_SETTLED_ACCOUNTS_AT_MERC, GetMercIDFromMERCArray( gubCurMercIndex ), GetWorldTotalMin(), -1, -1 );
//Increment the amount of money paid to speck
LaptopSaveInfo.uiTotalMoneyPaidToSpeck += iPartialPayment;
#ifdef JA2UB
//not ub
#else
//If the player only made a partial payment
if( iPartialPayment != giMercTotalContractCharge )
gusMercVideoSpeckSpeech = SPECK_QUOTE_PLAYER_MAKES_PARTIAL_PAYMENT;
@@ -633,7 +677,7 @@ void SettleMercAccounts()
// Since the player has paid, make sure speck wont complain about the lack of payment
LaptopSaveInfo.uiSpeckQuoteFlags &= ~SPECK_QUOTE__SENT_EMAIL_ABOUT_LACK_OF_PAYMENT;
}
#endif
//Go to the merc homepage to say the quote
guiCurrentLaptopMode = LAPTOP_MODE_MERC;
gubArrivedFromMercSubSite = MERC_CAME_FROM_ACCOUNTS_PAGE;
@@ -765,7 +809,11 @@ UINT32 CalculateHowMuchPlayerOwesSpeck()
//if( IsMercOnTeam( (UINT8)usMercID ) )
{
//Calc salary for the # of days the merc has worked since last paid
#ifdef JA2UB
uiContractCharge += gMercProfiles[ usMercID ].uiWeeklySalary * gMercProfiles[ usMercID ].iMercMercContractLength;
#else
uiContractCharge += gMercProfiles[ usMercID ].sSalary * gMercProfiles[ usMercID ].iMercMercContractLength;
#endif
}
}
Binary file not shown.
+4 -2
View File
@@ -149,9 +149,11 @@ void BtnOpenAccountBoxButtonCallback(GUI_BUTTON *btn,INT32 reason)
//Get an account number
LaptopSaveInfo.guiPlayersMercAccountNumber = Random( 99999 );
#ifdef JA2UB
// gusMercVideoSpeckSpeech = SPECK_QUOTE_THANK_PLAYER_FOR_OPENING_ACCOUNT;
#else
gusMercVideoSpeckSpeech = SPECK_QUOTE_THANK_PLAYER_FOR_OPENING_ACCOUNT;
#endif
guiCurrentLaptopMode = LAPTOP_MODE_MERC;
gubArrivedFromMercSubSite = MERC_CAME_FROM_ACCOUNTS_PAGE;
+289 -35
View File
@@ -1,6 +1,11 @@
#ifdef PRECOMPILEDHEADERS
#include "Laptop All.h"
#include "GameSettings.h"
#ifdef JA2UB
#include "Ja25 Strategic Ai.h"
#endif
#else
#include "laptop.h"
#include "mercs.h"
@@ -27,6 +32,12 @@
#include "Quests.h"
#endif
#ifdef JA2UB
#include "Ja25_Tactical.h"
#include "Ja25 Strategic Ai.h"
#include "Speck Quotes.h"
#endif
#include "connect.h"
UINT8 NUMBER_OF_MERCS = 0;
@@ -102,7 +113,11 @@ UINT8 NUMBER_OF_BAD_MERCS = -1;
#define SPECK_IDLE_CHAT_DELAY 10000
#ifdef JA2UB
#define MERC_NUMBER_OF_RANDOM_QUOTES 20//19//14
#else
#define MERC_NUMBER_OF_RANDOM_QUOTES 19//14
#endif
#define MERC_FIRST_MERC BIFF
@@ -212,10 +227,16 @@ typedef struct
} NUMBER_TIMES_QUOTE_SAID;
NUMBER_TIMES_QUOTE_SAID gNumberOfTimesQuoteSaid[ MERC_NUMBER_OF_RANDOM_QUOTES ] =
{
#ifdef JA2UB
{ SPECK_QUOTE_BIFF_DEAD_WHEN_IMPORTING, 0 },
#endif
{ SPECK_QUOTE_RANDOM_CHIT_CHAT_1, 0 },
{ SPECK_QUOTE_RANDOM_CHIT_CHAT_2, 0 },
#ifdef JA2UB
{ SPECK_QUOTE_RANDOM_CHIT_CHAT_3, 0 },
#endif
{ SPECK_QUOTE_ADVERTISE_GASTON, 0 },
{ SPECK_QUOTE_ADVERTISE_STOGIE, 0 },
@@ -304,6 +325,11 @@ BOOLEAN AreAnyOfTheNewMercsAvailable();
void ShouldAnyNewMercMercBecomeAvailable();
BOOLEAN CanMercBeAvailableYet( UINT8 ubMercToCheck );
UINT32 CalcMercDaysServed();
#ifdef JA2UB
void MarkSpeckImportantQuoteUsed( UINT32 uiQuoteNum );
BOOLEAN HasImportantSpeckQuoteBeingSaid( UINT32 uiQuoteNum );
INT8 IsSpeckQuoteImportantQuote( UINT32 uiQuoteNum );
#endif
//ppp
BOOLEAN SaveNewMercsToSaveGameFile( HWFILE hFile )
@@ -368,6 +394,17 @@ void GameInitMercs()
{
LaptopSaveInfo.gubLastMercIndex = LAST_MERC_ID; //NUMBER_OF_BAD_MERCS;
}
#ifdef JA2UB
//Ja25. create an account immediately
{
//open an account
LaptopSaveInfo.gubPlayersMercAccountStatus = MERC_ACCOUNT_VALID;
//Get an account number
LaptopSaveInfo.guiPlayersMercAccountNumber = Random( 99999 );
}
#endif
gubCurrentMercVideoMode = MERC_VIDEO_NO_VIDEO_MODE;
gfMercVideoIsBeingDisplayed = FALSE;
@@ -430,13 +467,16 @@ BOOLEAN EnterMercs()
// Account Box button
guiAccountBoxButtonImage = LoadButtonImage("LAPTOP\\SmallButtons.sti", -1,0,-1,1,-1 );
#ifdef JA2UB
// no UB
#else
guiAccountBoxButton = QuickCreateButton(guiAccountBoxButtonImage, MERC_ACCOUNT_BUTTON_X, MERC_ACCOUNT_BUTTON_Y,
BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, BtnAccountBoxButtonCallback);
SetButtonCursor(guiAccountBoxButton, CURSOR_LAPTOP_SCREEN);
SpecifyDisabledButtonStyle( guiAccountBoxButton, DISABLED_STYLE_SHADED);
#endif
guiFileBoxButton = QuickCreateButton(guiAccountBoxButtonImage, MERC_FILE_BUTTON_X, MERC_FILE_BUTTON_Y,
BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, BtnFileBoxButtonCallback);
@@ -524,8 +564,11 @@ void ExitMercs()
UnloadButtonImage( guiAccountBoxButtonImage );
RemoveButton( guiFileBoxButton );
#ifdef JA2UB
//JA25: removed RemoveButton( guiAccountBoxButton );
#else
RemoveButton( guiAccountBoxButton );
#endif
RemoveMercBackGround();
DeleteVideoSurfaceFromIndex( guiMercVideoFaceBackground );
@@ -634,21 +677,31 @@ void RenderMercs()
//Text on the Speck Portrait
DisplayWrappedString(MERC_PORTRAIT_TEXT_X, MERC_PORTRAIT_TEXT_Y, MERC_PORTRAIT_TEXT_WIDTH, 2, MERC_TEXT_FONT, MERC_TEXT_COLOR, MercHomePageText[MERC_SPECK_OWNER], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
#ifdef JA2UB
//Display the "ask about or special offer
DisplayWrappedString(MERC_ACCOUNT_BOX_TEXT_X, MERC_ACCOUNT_BOX_TEXT_Y, 230, 2, MERC_TEXT_FONT, MERC_TEXT_COLOR, gzNewLaptopMessages[ LPTP_MSG__MERC_SPECIAL_OFFER ], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
#else
/* ja25:*/
//Text on the Account Box
if( LaptopSaveInfo.gubPlayersMercAccountStatus == MERC_NO_ACCOUNT )
DisplayWrappedString(MERC_ACCOUNT_BOX_TEXT_X, MERC_ACCOUNT_BOX_TEXT_Y, MERC_ACCOUNT_BOX_TEXT_WIDTH, 2, MERC_TEXT_FONT, MERC_TEXT_COLOR, MercHomePageText[MERC_OPEN_ACCOUNT], FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
else
DisplayWrappedString(MERC_ACCOUNT_BOX_TEXT_X, MERC_ACCOUNT_BOX_TEXT_Y, MERC_ACCOUNT_BOX_TEXT_WIDTH, 2, MERC_TEXT_FONT, MERC_TEXT_COLOR, MercHomePageText[MERC_VIEW_ACCOUNT], FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
#endif
//Text on the Files Box
DisplayWrappedString(MERC_FILE_BOX_TEXT_X, MERC_FILE_BOX_TEXT_Y, MERC_FILE_BOX_TEXT_WIDTH, 2, MERC_TEXT_FONT, MERC_TEXT_COLOR, MercHomePageText[MERC_VIEW_FILES], FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
//If the Specks popup dioalogue box is active, display it.
if( iMercPopUpBox != -1 )
{
#ifdef JA2UB
//JA25: removed DrawButton( guiAccountBoxButton );
// ButtonList[ guiAccountBoxButton ]->uiFlags |= BUTTON_FORCE_UNDIRTY;
#else
DrawButton( guiAccountBoxButton );
ButtonList[ guiAccountBoxButton ]->uiFlags |= BUTTON_FORCE_UNDIRTY;
#endif
RenderMercPopUpBoxFromIndex( iMercPopUpBox, gusSpeckDialogueX, MERC_TEXT_BOX_POS_Y, FRAME_BUFFER);
}
@@ -657,9 +710,11 @@ void RenderMercs()
//if the page is redrawn, and we are in video conferencing, redraw the VC backgrund graphic
gfMercSiteScreenIsReDrawn = TRUE;
#ifdef JA2UB
//JA25: removed ButtonList[ guiAccountBoxButton ]->uiFlags &= ~BUTTON_FORCE_UNDIRTY;
#else
ButtonList[ guiAccountBoxButton ]->uiFlags &= ~BUTTON_FORCE_UNDIRTY;
#endif
InvalidateRegion(LAPTOP_SCREEN_UL_X,LAPTOP_SCREEN_WEB_UL_Y,LAPTOP_SCREEN_LR_X,LAPTOP_SCREEN_WEB_LR_Y);
}
@@ -692,8 +747,9 @@ BOOLEAN RemoveMercBackGround()
}
#ifdef JA2UB
//no UB
#else
void BtnAccountBoxButtonCallback(GUI_BUTTON *btn,INT32 reason)
{
if(reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
@@ -728,6 +784,7 @@ void BtnAccountBoxButtonCallback(GUI_BUTTON *btn,INT32 reason)
InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
}
}
#endif
void BtnFileBoxButtonCallback(GUI_BUTTON *btn,INT32 reason)
{
@@ -793,12 +850,20 @@ void DailyUpdateOfMercSite( UINT16 usDate)
// pSoldier->iTotalContractLength++;
}
#ifdef JA2UB
//JA25: MERC does a 1 time fee, no longer pay as you go
#else
//Get the longest time
if( gMercProfiles[ pSoldier->ubProfile ].iMercMercContractLength > iNumDays )
iNumDays = gMercProfiles[ pSoldier->ubProfile ].iMercMercContractLength;
#endif
}
}
#ifdef JA2UB
//JA25: No longer pay as you go, now pay up front
#else
//if the players hasnt paid for a while, get email him to tell him to pay
//iTotalContractLength
if( iNumDays > MERC_NUM_DAYS_TILL_ACCOUNT_INVALID )
@@ -806,7 +871,7 @@ void DailyUpdateOfMercSite( UINT16 usDate)
if( LaptopSaveInfo.gubPlayersMercAccountStatus != MERC_ACCOUNT_INVALID )
{
LaptopSaveInfo.gubPlayersMercAccountStatus = MERC_ACCOUNT_INVALID;
AddEmail( MERC_INVALID, MERC_INVALID_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1);
AddEmail( MERC_INVALID, MERC_INVALID_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT);
}
}
else if( iNumDays > MERC_NUM_DAYS_TILL_ACCOUNT_SUSPENDED )
@@ -814,7 +879,7 @@ void DailyUpdateOfMercSite( UINT16 usDate)
if( LaptopSaveInfo.gubPlayersMercAccountStatus != MERC_ACCOUNT_SUSPENDED )
{
LaptopSaveInfo.gubPlayersMercAccountStatus = MERC_ACCOUNT_SUSPENDED;
AddEmail( MERC_WARNING, MERC_WARNING_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1);
AddEmail( MERC_WARNING, MERC_WARNING_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT);
// Have speck complain next time player come to site
LaptopSaveInfo.uiSpeckQuoteFlags |= SPECK_QUOTE__SENT_EMAIL_ABOUT_LACK_OF_PAYMENT;
@@ -825,13 +890,13 @@ void DailyUpdateOfMercSite( UINT16 usDate)
if( LaptopSaveInfo.gubPlayersMercAccountStatus != MERC_ACCOUNT_VALID_FIRST_WARNING )
{
LaptopSaveInfo.gubPlayersMercAccountStatus = MERC_ACCOUNT_VALID_FIRST_WARNING;
AddEmail( MERC_FIRST_WARNING, MERC_FIRST_WARNING_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1);
AddEmail( MERC_FIRST_WARNING, MERC_FIRST_WARNING_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT);
// Have speck complain next time player come to site
LaptopSaveInfo.uiSpeckQuoteFlags |= SPECK_QUOTE__SENT_EMAIL_ABOUT_LACK_OF_PAYMENT;
}
}
#endif
//Check and act if any new Merc Mercs should become available
ShouldAnyNewMercMercBecomeAvailable();
@@ -868,7 +933,7 @@ void DailyUpdateOfMercSite( UINT16 usDate)
//if we havent already sent an email this turn
if( !fAlreadySentEmailToPlayerThisTurn )
{
AddEmail( NEW_MERCS_AT_MERC, NEW_MERCS_AT_MERC_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin());
AddEmail( NEW_MERCS_AT_MERC, NEW_MERCS_AT_MERC_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), TYPE_EMAIL_EMAIL_EDT);
fAlreadySentEmailToPlayerThisTurn = TRUE;
}
LaptopSaveInfo.gbNumDaysTillFirstMercArrives = -1;
@@ -961,6 +1026,9 @@ void DailyUpdateOfMercSite( UINT16 usDate)
// If the merc site has never gone down, the number of MERC payment days is above 'X',
// and the players account status is ok ( cant have the merc site going down when the player owes him money, player may lose account that way )
#ifdef JA2UB
// no UB
#else
if( ShouldTheMercSiteServerGoDown() )
{
UINT32 uiTimeInMinutes=0;
@@ -979,6 +1047,7 @@ void DailyUpdateOfMercSite( UINT16 usDate)
//Add an event that will get the site back up and running
AddStrategicEvent( EVENT_MERC_SITE_BACK_ONLINE, uiTimeInMinutes, 0 );
}
#endif
}
@@ -1523,8 +1592,13 @@ void HandleTalkingSpeck()
if( iMercPopUpBox != -1 )
{
#ifdef JA2UB
//JA25: removed DrawButton( guiAccountBoxButton );
//JA25: removed ButtonList[ guiAccountBoxButton ]->uiFlags |= BUTTON_FORCE_UNDIRTY;
#else
DrawButton( guiAccountBoxButton );
ButtonList[ guiAccountBoxButton ]->uiFlags |= BUTTON_FORCE_UNDIRTY;
#endif
RenderMercPopUpBoxFromIndex( iMercPopUpBox, gusSpeckDialogueX, MERC_TEXT_BOX_POS_Y, FRAME_BUFFER);
}
@@ -1643,7 +1717,11 @@ BOOLEAN GetSpeckConditionalOpening( BOOLEAN fJustEnteredScreen )
if( fJustEnteredScreen )
{
gfDoneIntroSpeech = FALSE;
#ifdef JA2UB
usQuoteToSay = SPECK_QUOTE_NEW_INTRO_1;
#else
usQuoteToSay = 0;
#endif
return( FALSE );
}
@@ -1656,31 +1734,65 @@ BOOLEAN GetSpeckConditionalOpening( BOOLEAN fJustEnteredScreen )
gfDoneIntroSpeech = TRUE;
//set the opening quote based on if the player has been here before
#ifdef JA2UB
if( LaptopSaveInfo.ubPlayerBeenToMercSiteStatus == MERC_SITE_FIRST_VISIT && usQuoteToSay <= SPECK_QUOTE_NEW_INTRO_7 ) //!= 0 )
#else
if( LaptopSaveInfo.ubPlayerBeenToMercSiteStatus == MERC_SITE_FIRST_VISIT && usQuoteToSay <= 8 ) //!= 0 )
#endif
{
StartSpeckTalking( usQuoteToSay );
usQuoteToSay++;
#ifdef JA2UB
if( usQuoteToSay <= SPECK_QUOTE_NEW_INTRO_7 )
#else
if( usQuoteToSay <= 8 )
#endif
gfDoneIntroSpeech = FALSE;
}
#ifdef JA2UB
//else if its the first time back since the laptop went down
else if( gJa25SaveStruct.fHaveAimandMercOffferItems && !HasImportantSpeckQuoteBeingSaid( SPECK_QUOTE_2ND_INTRO_LAPTOP_WORKING_AGAIN_1 ) )
{
StartSpeckTalking( SPECK_QUOTE_2ND_INTRO_LAPTOP_WORKING_AGAIN_1 );
StartSpeckTalking( SPECK_QUOTE_2ND_INTRO_LAPTOP_WORKING_AGAIN_2 );
StartSpeckTalking( SPECK_QUOTE_2ND_INTRO_LAPTOP_WORKING_AGAIN_3 );
StartSpeckTalking( SPECK_QUOTE_2ND_INTRO_LAPTOP_WORKING_AGAIN_4 );
StartSpeckTalking( SPECK_QUOTE_2ND_INTRO_LAPTOP_WORKING_AGAIN_5 );
StartSpeckTalking( SPECK_QUOTE_2ND_INTRO_LAPTOP_WORKING_AGAIN_6 );
}
#else
//if its the players second visit
else if( LaptopSaveInfo.ubPlayerBeenToMercSiteStatus == MERC_SITE_SECOND_VISIT )
{
StartSpeckTalking( SPECK_QUOTE_ALTERNATE_OPENING_1_TOUGH_START );
fCanUseIdleTag = TRUE;
}
#endif
// We have been here at least 2 times before, Check which quote we should use
else
{
//if the player has not hired any MERC mercs before
// CJC Dec 1 2002: fixing this, so near-bankrupt msg will play
#ifdef JA2UB
if( !IsAnyMercMercsHired( ) && CalcMercDaysServed() == 0)
StartSpeckTalking( SPECK_QUOTE_DEFAULT_INTRO_HAVENT_HIRED_MERCS );
else
StartSpeckTalking( SPECK_QUOTE_DEFAULT_INTRO_HAVE_HIRED_MERCS );
#endif
#ifdef JA2UB
//JA25: not using quote quote
#else
//if the player has not hired any MERC mercs before
if( !IsAnyMercMercsHired( ) && CalcMercDaysServed() == 0)
{
StartSpeckTalking( SPECK_QUOTE_ALTERNATE_OPENING_2_BUSINESS_BAD );
}
#endif
#ifdef JA2UB
//JA25: not using quote quote
#else
//else if it is the first visit since the server went down
else if( LaptopSaveInfo.fFirstVisitSinceServerWentDown == TRUE )
{
@@ -1688,6 +1800,7 @@ BOOLEAN GetSpeckConditionalOpening( BOOLEAN fJustEnteredScreen )
StartSpeckTalking( SPECK_QUOTE_ALTERNATE_OPENING_9_FIRST_VISIT_SINCE_SERVER_WENT_DOWN );
fCanUseIdleTag = TRUE;
}
#endif
/*
//else if new mercs are available
else if( LaptopSaveInfo.fNewMercsAvailableAtMercSite )
@@ -1698,14 +1811,20 @@ BOOLEAN GetSpeckConditionalOpening( BOOLEAN fJustEnteredScreen )
}
*/
//else if lots of MERC mercs are DEAD, and speck can say the quote ( dont want him to continously say it )
#ifdef JA2UB
if( CountNumberOfMercMercsWhoAreDead() >= 2 && LaptopSaveInfo.ubSpeckCanSayPlayersLostQuote )
#else
else if( CountNumberOfMercMercsWhoAreDead() >= 2 && LaptopSaveInfo.ubSpeckCanSayPlayersLostQuote )
#endif
{
StartSpeckTalking( SPECK_QUOTE_ALTERNATE_OPENING_12_PLAYERS_LOST_MERCS );
//Set it so speck Wont say the quote again till someone else dies
LaptopSaveInfo.ubSpeckCanSayPlayersLostQuote = 0;
}
#ifdef JA2UB
//JA25: not using quote quote
#else
//else if player owes lots of money
else if( LaptopSaveInfo.gubPlayersMercAccountStatus == MERC_ACCOUNT_SUSPENDED )
{
@@ -1713,8 +1832,11 @@ BOOLEAN GetSpeckConditionalOpening( BOOLEAN fJustEnteredScreen )
fCanSayLackOfPaymentQuote = FALSE;
}
#endif
//else if the player owes speck a large sum of money, have speck say so
#ifdef JA2UB
//JA25: not using quote quote
#else
else if( CalculateHowMuchPlayerOwesSpeck() > 5000 )
{
StartSpeckTalking( SPECK_QUOTE_ALTERNATE_OPENING_6_PLAYER_OWES_SPECK_ALMOST_BANKRUPT_1 );
@@ -1722,11 +1844,17 @@ BOOLEAN GetSpeckConditionalOpening( BOOLEAN fJustEnteredScreen )
fCanSayLackOfPaymentQuote = FALSE;
}
#endif
else
{
#ifdef JA2UB
UINT8 ubNumMercsDead = NumberOfMercMercsDead();
BOOLEAN fCanUseIdleTag = FALSE;
#endif
UINT8 ubRandom = ( UINT8 ) Random( 100 );
#ifdef JA2UB
//JA25: not using quote quote
#else
//if business is good
// if( ubRandom < 40 && ubNumMercsDead < 2 && CountNumberOfMercMercsHired() > 1 )
if( ubRandom < 40 && AreAnyOfTheNewMercsAvailable() && CountNumberOfMercMercsHired() > 1 )
@@ -1734,9 +1862,12 @@ BOOLEAN GetSpeckConditionalOpening( BOOLEAN fJustEnteredScreen )
StartSpeckTalking( SPECK_QUOTE_ALTERNATE_OPENING_3_BUSINESS_GOOD );
fCanUseIdleTag = TRUE;
}
#endif
//or if still trying to recruit ( the last recruit hasnt arrived and the player has paid for some of his mercs )
// else if( ubRandom < 80 && LaptopSaveInfo.gbNumDaysTillFourthMercArrives != -1 && LaptopSaveInfo.gbNumDaysTillFirstMercArrives < MERC_NUM_DAYS_TILL_FIRST_MERC_AVAILABLE )
#ifdef JA2UB
//JA25: not using quote quote
#else
else if( ubRandom < 80 && gConditionsForMercAvailability[ LaptopSaveInfo.ubLastMercAvailableId ].usMoneyPaid <= LaptopSaveInfo.uiTotalMoneyPaidToSpeck && CanMercBeAvailableYet( LaptopSaveInfo.ubLastMercAvailableId ) )
{
StartSpeckTalking( SPECK_QUOTE_ALTERNATE_OPENING_4_TRYING_TO_RECRUIT );
@@ -1745,10 +1876,16 @@ BOOLEAN GetSpeckConditionalOpening( BOOLEAN fJustEnteredScreen )
//else use the generic opening
else
#endif
{
#ifdef JA2UB
//JA25: not using quote quote
#else
StartSpeckTalking( SPECK_QUOTE_ALTERNATE_OPENING_10_GENERIC_OPENING );
fCanUseIdleTag = TRUE;
//JA25: not using quote quote
//if the merc hasnt said the line before
if( !LaptopSaveInfo.fSaidGenericOpeningInMercSite )
{
@@ -1756,8 +1893,11 @@ BOOLEAN GetSpeckConditionalOpening( BOOLEAN fJustEnteredScreen )
StartSpeckTalking( SPECK_QUOTE_ALTERNATE_OPENING_10_TAG_FOR_20 );
}
}
#endif
}
#ifdef JA2UB
//no UB
#else
if( fCanUseIdleTag )
{
UINT8 ubRandom = Random( 100 );
@@ -1784,10 +1924,13 @@ BOOLEAN GetSpeckConditionalOpening( BOOLEAN fJustEnteredScreen )
Assert( 0 );
}
}
#endif
}
}
#ifdef JA2UB
//JA25: not using quote quote
#else
//If Speck has sent an email to the player, and the player still hasnt paid, has speck complain about it.
// CJC Dec 1 2002 ACTUALLY HOOKED IN THAT CHECK
if (fCanSayLackOfPaymentQuote)
@@ -1807,18 +1950,22 @@ BOOLEAN GetSpeckConditionalOpening( BOOLEAN fJustEnteredScreen )
StartSpeckTalking( SPECK_QUOTE_ALTERNATE_OPENING_11_NEW_MERCS_AVAILABLE );
}
#endif
//if any mercs are dead
if( IsAnyMercMercsDead() )
{
UINT8 ubMercID;
//if no merc has died before
#ifdef JA2UB
//JA25: not using quote quote
#else
if( !LaptopSaveInfo.fHasAMercDiedAtMercSite )
{
LaptopSaveInfo.fHasAMercDiedAtMercSite = TRUE;
StartSpeckTalking( SPECK_QUOTE_ALTERNATE_OPENING_TAG_FIRST_MERC_DIES );
}
#endif
//loop through all the mercs and see if any are dead and the quote is not said
for( ubCnt=0; ubCnt<NUMBER_OF_MERCS; ubCnt++ )
{
@@ -1873,12 +2020,21 @@ BOOLEAN GetSpeckConditionalOpening( BOOLEAN fJustEnteredScreen )
case BUBBA:
StartSpeckTalking( SPECK_QUOTE_ALTERNATE_OPENING_TAG_BUBBA_IS_DEAD );
break;
#ifdef JA2UB
case 58://GASTON:
StartSpeckTalking( SPECK_QUOTE_GASTON_DEAD );
break;
case 59://STOGIE:
StartSpeckTalking( SPECK_QUOTE_STOGIE_DEAD );
break;
#else
case GASTON:
StartSpeckTalking( SPECK_QUOTE_GASTON_DEAD );
break;
case STOGIE:
StartSpeckTalking( SPECK_QUOTE_STOGIE_DEAD );
break;
#endif
};
}
@@ -1886,7 +2042,9 @@ BOOLEAN GetSpeckConditionalOpening( BOOLEAN fJustEnteredScreen )
}
}
#ifdef JA2UB
//JA25: not using quote quote
#else
//if flo has married the cousin
if( gubFact[ FACT_PC_MARRYING_DARYL_IS_FLO ] )
{
@@ -1899,7 +2057,7 @@ BOOLEAN GetSpeckConditionalOpening( BOOLEAN fJustEnteredScreen )
MakeBiffAwayForCoupleOfDays();
}
}
#endif
//if larry has relapsed
if( HasLarryRelapsed() && !( LaptopSaveInfo.uiSpeckQuoteFlags & SPECK_QUOTE__ALREADY_TOLD_PLAYER_THAT_LARRY_RELAPSED ) )
@@ -2096,7 +2254,21 @@ void HandlePlayerHiringMerc( UINT8 ubHiredMercID )
if( IsMercMercAvailable( BIFF ) )
StartSpeckTalking( SPECK_QUOTE_PLAYERS_HIRES_LARRY_SPECK_PLUGS_BIFF );
break;
#ifdef JA2UB
//Gaston is hired
case 58: //GASTON:
//if biff is available, advertise for biff
if( IsMercMercAvailable( FLO ) )
StartSpeckTalking( SPECK_QUOTE_PLAYER_HIRES_GASTON );
break;
//Stogie is hired
case 59: //STOGIE:
//if biff is available, advertise for biff
if( IsMercMercAvailable( BIFF ) )
StartSpeckTalking( SPECK_QUOTE_PLAYER_HIRES_STOGIE );
break;
#else
//Gaston is hired
case GASTON:
//if biff is available, advertise for biff
@@ -2110,6 +2282,7 @@ void HandlePlayerHiringMerc( UINT8 ubHiredMercID )
if( IsMercMercAvailable( BIFF ) )
StartSpeckTalking( SPECK_QUOTE_PLAYER_HIRES_STOGIE );
break;
#endif
}
}
@@ -2145,13 +2318,25 @@ BOOLEAN ShouldSpeckStartTalkingDueToActionOnSubPage()
{
HandlePlayerHiringMerc( GetMercIDFromMERCArray( gubCurMercIndex ) );
//get speck to say the thank you
#ifdef JA2UB
//if it hasnt been said, say the better equipment quote
if( !HasImportantSpeckQuoteBeingSaid( SPECK_QUOTE_BETTER_STARTING_EQPMNT_TAG_ON ) )
{
StartSpeckTalking( SPECK_QUOTE_BETTER_STARTING_EQPMNT_TAG_ON );
}
#endif
//get speck to say the thank you
if( Random( 100 ) > 50 )
StartSpeckTalking( SPECK_QUOTE_GENERIC_THANKS_FOR_HIRING_MERCS_1 );
else
StartSpeckTalking( SPECK_QUOTE_GENERIC_THANKS_FOR_HIRING_MERCS_2 );
#ifdef JA2UB
//if it hasnt been said, say the encouraged to shop quote
if( !HasImportantSpeckQuoteBeingSaid( SPECK_QUOTE_ENCOURAGE_SHOP_TAG_ON ) )
{
StartSpeckTalking( SPECK_QUOTE_ENCOURAGE_SHOP_TAG_ON );
}
#endif
gfJustHiredAMercMerc = FALSE;
// gfDoneIntroSpeech = TRUE;
@@ -2246,6 +2431,11 @@ void HandleSpeckIdleConversation( BOOLEAN fReset )
{
IncreaseMercRandomQuoteValue( (UINT8)sLeastSaidQuote, 1 );
}
#ifdef JA2UB
//if its the biff is dead quote, only say the quote once
else if( sLeastSaidQuote == SPECK_QUOTE_BIFF_DEAD_WHEN_IMPORTING )
IncreaseMercRandomQuoteValue( (UINT8)sLeastSaidQuote, 255 );
#endif
else if( sLeastSaidQuote != -1 )
IncreaseMercRandomQuoteValue( (UINT8)sLeastSaidQuote, 3 );
}
@@ -2348,15 +2538,18 @@ BOOLEAN ShouldTheMercSiteServerGoDown()
return( FALSE );
}
#ifdef JA2UB
//no UB
#else
void GetMercSiteBackOnline()
{
//Add an email telling the user the site is back up
AddEmail( MERC_NEW_SITE_ADDRESS, MERC_NEW_SITE_ADDRESS_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1 );
AddEmail( MERC_NEW_SITE_ADDRESS, MERC_NEW_SITE_ADDRESS_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1 , TYPE_EMAIL_EMAIL_EDT);
//Set a flag indicating that the server just went up ( so speck can make a comment when the player next visits the site )
LaptopSaveInfo.fFirstVisitSinceServerWentDown = TRUE;
}
#endif
void DrawMercVideoBackGround()
{
@@ -2374,7 +2567,11 @@ void DisableMercSiteButton()
{
if( iMercPopUpBox != -1 )
{
#ifdef JA2UB
//JA25: removed ButtonList[ guiAccountBoxButton ]->uiFlags |= BUTTON_FORCE_UNDIRTY;
#else
ButtonList[ guiAccountBoxButton ]->uiFlags |= BUTTON_FORCE_UNDIRTY;
#endif
}
}
@@ -2434,6 +2631,22 @@ BOOLEAN CanMercQuoteBeSaid( UINT32 uiQuoteID )
if( !IsMercMercAvailable( BUBBA ) )
fRetVal = FALSE;
break;
#ifdef JA2UB
case SPECK_QUOTE_BIFF_DEAD_WHEN_IMPORTING:
if( !gJa25SaveStruct.fBiffWasKilledWhenImportingSave )
fRetVal = FALSE;
break;
case SPECK_QUOTE_ADVERTISE_GASTON:
if( !IsMercMercAvailable( 58 ) )//GASTON
fRetVal = FALSE;
break;
case SPECK_QUOTE_ADVERTISE_STOGIE:
if( !IsMercMercAvailable( 59 ) )//STOGIE
fRetVal = FALSE;
break;
#else
case SPECK_QUOTE_ADVERTISE_GASTON:
if( !IsMercMercAvailable( GASTON ) )
fRetVal = FALSE;
@@ -2443,6 +2656,7 @@ BOOLEAN CanMercQuoteBeSaid( UINT32 uiQuoteID )
if( !IsMercMercAvailable( STOGIE ) )
fRetVal = FALSE;
break;
#endif
}
@@ -2536,7 +2750,7 @@ void NewMercsAvailableAtMercSiteCallBack( )
for(UINT8 i=0; i<NUM_PROFILES; i++)
{
if ( gConditionsForMercAvailability[i].ProfilId != 0 && gConditionsForMercAvailability[i].NewMercsAvailable == FALSE && gConditionsForMercAvailability[i].StartMercsAvailable == FALSE )
{
{
if( CanMercBeAvailableYet( gConditionsForMercAvailability[i].uiIndex ) )
{
gConditionsForMercAvailability[i].NewMercsAvailable = TRUE;
@@ -2563,7 +2777,7 @@ void NewMercsAvailableAtMercSiteCallBack( )
LaptopSaveInfo.ubLastMercAvailableId = gConditionsForMercAvailability[i].uiIndex;
gConditionsForMercAvailability[i].StartMercsAvailable = TRUE;
AddEmail( NEW_MERCS_AT_MERC, NEW_MERCS_AT_MERC_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1);
AddEmail( NEW_MERCS_AT_MERC, NEW_MERCS_AT_MERC_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT);
//new mercs are available
LaptopSaveInfo.fNewMercsAvailableAtMercSite = TRUE;
@@ -2604,11 +2818,51 @@ UINT32 CalcMercDaysServed()
}
return( uiDaysServed );
}
#ifdef JA2UB
INT8 IsSpeckQuoteImportantQuote( UINT32 uiQuoteNum )
{
INT32 iFlag=-1;
switch( uiQuoteNum )
{
case SPECK_QUOTE_BETTER_STARTING_EQPMNT_TAG_ON:
iFlag = SPECK__BETTER_EQUIPMENT;
break;
case SPECK_QUOTE_ENCOURAGE_SHOP_TAG_ON:
iFlag = SPECK__ENCOURAGE_POAYER_TO_KEEP_SHOPPING;
break;
case SPECK_QUOTE_2ND_INTRO_LAPTOP_WORKING_AGAIN_1:
iFlag = SPECK__SECOND_INTRO_BEEN_SAID;
break;
}
return( (INT8) iFlag );
}
BOOLEAN HasImportantSpeckQuoteBeingSaid( UINT32 uiQuoteNum )
{
INT8 iFlag;
iFlag = IsSpeckQuoteImportantQuote( uiQuoteNum );
if( iFlag == -1 )
{
return( FALSE );
}
//has the quote been said
return( ( gJa25SaveStruct.ubImportantSpeckQuotesSaidBefore & ( 1 << iFlag ) ) != 0 );
}
//if the quote is a special quote, mark it said so we dont say it again
void MarkSpeckImportantQuoteUsed( UINT32 uiQuoteNum )
{
INT8 iFlag;
iFlag = IsSpeckQuoteImportantQuote( uiQuoteNum );
if( iFlag == -1 )
{
return;
}
gJa25SaveStruct.ubImportantSpeckQuotesSaidBefore |= ( 1 << iFlag );
}
#endif
+9 -2
View File
@@ -129,9 +129,11 @@ BOOLEAN IsMercMercAvailable( UINT8 ubMercID );
void HandlePlayerHiringMerc( UINT8 ubHiredMercID );
void EnterInitMercSite();
#ifdef JA2UB
//void GetMercSiteBackOnline();
#else
void GetMercSiteBackOnline();
#endif
void DisableMercSiteButton();
extern UINT16 gusMercVideoSpeckSpeech;
@@ -152,6 +154,11 @@ void InitializeNumDaysMercArrive();
void NewMercsAvailableAtMercSiteCallBack( );
void CalcAproximateAmountPaidToSpeck();
#ifdef JA2UB
extern void MarkSpeckImportantQuoteUsed( UINT32 uiQuoteNum );
extern BOOLEAN HasImportantSpeckQuoteBeingSaid( UINT32 uiQuoteNum );
extern INT8 IsSpeckQuoteImportantQuote( UINT32 uiQuoteNum );
#endif
#endif
+20 -1
View File
@@ -6526,6 +6526,10 @@ void DisplayEmploymentinformation( INT32 iId, INT32 iSlot )
case 0:
{
//UINT32 uiTimeUnderThisDisplayAsHours = 24*60;
#ifdef JA2UB
wcscpy( sString, gpStrategicString[ STR_PB_NOTAPPLICABLE_ABBREVIATION ] );
mprintf((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH)),pPersonnelScreenPoints[iCounter].y,pPersonnelScreenStrings[PRSNL_TXT_CURRENT_CONTRACT]);
#else
static const UINT32 uiMinutesInDay = 24 * 60;
if(Menptr[iId].ubWhatKindOfMercAmI == MERC_TYPE__AIM_MERC || Menptr[iId].ubProfile == SLAY )
@@ -6569,7 +6573,7 @@ void DisplayEmploymentinformation( INT32 iId, INT32 iSlot )
wcscpy( sString, gpStrategicString[ STR_PB_NOTAPPLICABLE_ABBREVIATION ] );
mprintf((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH)),pPersonnelScreenPoints[iCounter].y,pPersonnelScreenStrings[PRSNL_TXT_CURRENT_CONTRACT]);
}
#endif
FindFontRightCoordinates((INT16)(pPersonnelScreenPoints[iCounter].x+(iSlot*TEXT_BOX_WIDTH)+Prsnl_DATA_OffSetX),0,TEXT_BOX_WIDTH-20,0,sString, PERS_FONT, &sX, &sY);
mprintf(sX,pPersonnelScreenPoints[iCounter].y,sString);
}
@@ -7319,6 +7323,11 @@ void AssignPersonnelSkillTraitHelpText( UINT8 ubTraitNumber, BOOLEAN fExpertLeve
wcscat( apStr, atStr );
}
}
if( gSkillTraitValues.ubMAReducedAPsRegisteredWhenMoving != 0 && gGameExternalOptions.fImprovedInterruptSystem )
{
swprintf( atStr, gzIMPMajorTraitsHelpTextsMartialArts[27], ( gSkillTraitValues.ubMAReducedAPsRegisteredWhenMoving * (fExpertLevel ? 2 : 1)), L"%");
wcscat( apStr, atStr );
}
if( gSkillTraitValues.ubMAChanceToCkickDoors != 0 )
{
swprintf( atStr, gzIMPMajorTraitsHelpTextsMartialArts[25], ( gSkillTraitValues.ubMAChanceToCkickDoors * (fExpertLevel ? 2 : 1)), L"%");
@@ -7352,6 +7361,11 @@ void AssignPersonnelSkillTraitHelpText( UINT8 ubTraitNumber, BOOLEAN fExpertLeve
swprintf( atStr, gzIMPMajorTraitsHelpTextsSquadleader[2], ( gSkillTraitValues.ubSLEffectiveLevelAsStandby * (fExpertLevel ? 2 : 1)));
wcscat( apStr, atStr );
}
if( gSkillTraitValues.ubSLCollectiveInterruptsBonus != 0 && gGameExternalOptions.fImprovedInterruptSystem )
{
swprintf( atStr, gzIMPMajorTraitsHelpTextsSquadleader[11], ( gSkillTraitValues.ubSLCollectiveInterruptsBonus * (fExpertLevel ? 2 : 1)), L"%");
wcscat( apStr, atStr );
}
if( gSkillTraitValues.ubSLOverallSuppresionBonusPercent != 0 )
{
swprintf( atStr, gzIMPMajorTraitsHelpTextsSquadleader[3], ( gSkillTraitValues.ubSLOverallSuppresionBonusPercent * (fExpertLevel ? 2 : 1)), L"%", (fExpertLevel ? gzMercSkillTextNew[ubTraitNumber + 19] : gzMercSkillTextNew[ubTraitNumber]));
@@ -7708,6 +7722,11 @@ void AssignPersonnelSkillTraitHelpText( UINT8 ubTraitNumber, BOOLEAN fExpertLeve
swprintf( atStr, gzIMPMinorTraitsHelpTextsStealthy[2], gSkillTraitValues.ubSTStealthBonus, L"%");
wcscat( apStr, atStr );
}
if( gSkillTraitValues.ubSTReducedAPsRegistered != 0 && gGameExternalOptions.fImprovedInterruptSystem )
{
swprintf( atStr, gzIMPMinorTraitsHelpTextsStealthy[4], gSkillTraitValues.ubSTReducedAPsRegistered, L"%");
wcscat( apStr, atStr );
}
if( gSkillTraitValues.ubSTStealthPenaltyForMovingReduction != 0 )
{
swprintf( atStr, gzIMPMinorTraitsHelpTextsStealthy[3], gSkillTraitValues.ubSTStealthPenaltyForMovingReduction, L"%");