Due to erroneous code, the encyclopedia feature has been deactivated. for more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=23090&goto=345928&#msg_345928

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8273 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2016-07-16 12:21:22 +00:00
parent 7a34e9a154
commit 57ec4e7fa1
15 changed files with 194 additions and 121 deletions
+5
View File
@@ -1655,8 +1655,11 @@ BOOLEAN DisplayMercsInventory(UINT8 ubMercID)
{
PosX += WEAPONBOX_SIZE_X_NSGI;
}
#ifdef ENCYCLOPEDIA_WORKS
//Moa: update encyclopedia item visibility when item gets displayed
EncyclopediaSetItemAsVisible( usItem, ENC_ITEM_DISCOVERED_NOT_INSPECTABLE );
#endif
}
}
}
@@ -1725,8 +1728,10 @@ BOOLEAN DisplayMercsInventory(UINT8 ubMercID)
PosX += WEAPONBOX_SIZE_X;
#ifdef ENCYCLOPEDIA_WORKS
//Moa: update encyclopedia item visibility when item gets displayed
EncyclopediaSetItemAsVisible( usItem, ENC_ITEM_DISCOVERED_NOT_INSPECTABLE );
#endif
}
}
}
+2
View File
@@ -2446,8 +2446,10 @@ void DisplayItemNameAndInfo(UINT16 usPosY, UINT16 usIndex, UINT16 usBobbyIndex,
LoadBRDesc(usIndex,sText);
DisplayWrappedString(BOBBYR_ITEM_DESC_START_X, usPosY, BOBBYR_ITEM_DESC_START_WIDTH, 2, BOBBYR_ITEM_DESC_TEXT_FONT, BOBBYR_ITEM_DESC_TEXT_COLOR, sText, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
#ifdef ENCYCLOPEDIA_WORKS
//Moa: update encyclopedia item visibility when item gets displayed
EncyclopediaSetItemAsVisible( usIndex, ENC_ITEM_DISCOVERED_NOT_INSPECTABLE );
#endif
}
/*
+91 -99
View File
@@ -18,11 +18,6 @@
#endif
#define MAX_FILTR_LOCATION_BUTTONS 11
#define FILTR_INVENTORY_BUTTONS 5
#define FILTR_BUTTONS_CHARACTER 8
@@ -31,11 +26,15 @@
UINT32 gFiltrBox = -1;
#ifdef ENCYCLOPEDIA_WORKS
INT32 guiEncyclopediaLocationPageButton[3] = { -1,-1,-1 };
INT32 guiEncyclopediaLocationPageButtonImage = -1;
INT32 guiEncyclopediaPageButton[3] = { -1,-1,-1 };
INT32 guiEncyclopediaiPageButtonImage = -1;
UINT32 guiEncyclopediaPopUp;
#endif
INT32 ID = 0;
INT32 IDimage = 0;
INT32 MaxImages = 1;
@@ -74,8 +73,12 @@ void InitData ( BOOLEAN bInit );
#define ENCYCLOPEDIA_IMAGE_X LAPTOP_SCREEN_UL_X
#define ENCYCLOPEDIA_IMAGE_Y iScreenHeightOffset + LAPTOP_SCREEN_WEB_DELTA_Y
#define ENCYCLOPEDIA_FILTR_BUTTON_GAP 16
#ifdef ENCYCLOPEDIA_WORKS
void SelectEncyclopediaLocationPageRegionCallBack(GUI_BUTTON * btn, INT32 reason );
void SelectEncyclopediaLocationRegionCallBack(GUI_BUTTON * btn, INT32 reason );
#endif
void SelectFiltrButtonsRegionCallBack(GUI_BUTTON * btn, INT32 reason );
//void BtnEncyclopediaTogglesCallback( GUI_BUTTON *btn, INT32 reason );
@@ -91,8 +94,9 @@ void UnLoadMenuButtons ();
#define MAX_NUMBER_OF_OPTION_TOGGLES 5
//UINT32 guiEncyclopediaToggles[ MAX_NUMBER_OF_OPTION_TOGGLES ];
#ifdef ENCYCLOPEDIA_WORKS
MOUSE_REGION gSelectedEncyclopediaTextRegion[ MAX_FILTR_LOCATION_BUTTONS ];
#endif
BOOLEAN bBriefingRoom = FALSE;
BOOLEAN bBriefingRoomSpecialMission = FALSE;
@@ -197,56 +201,13 @@ BOOLEAN DisplayEncyclopediaLocationText()
return(TRUE);
}
void GameInitEncyclopediaLocation()
{/*
UINT32 typeSize = 0,total = 0;
CHAR buffer[150];
typeSize = sizeof (BRIEFINGROOM_M_DATA);
//backup data
total += sizeof(gEncyclopediaLocationDataBackup);
total += sizeof(gEncyclopediaProfilesDataBackup);
total += sizeof(gEncyclopediaInventoryDataBackup);
total += sizeof(gEncyclopediaOldProfilesDataBackup);
total += sizeof(gEncyclopediaQuestsDataBackup);
//actual data
total += sizeof(gEncyclopediaLocationData);
total += sizeof(gEncyclopediaProfilesData);
total += sizeof(gEncyclopediaInventoryData);
total += sizeof(gEncyclopediaOldProfilesData);
total += sizeof(gEncyclopediaQuestsData);
//save data
total += sizeof(saveEncyclopediaLocationData);
total += sizeof(saveEncyclopediaProfilesData);
total += sizeof(saveEncyclopediaInventoryData);
total += sizeof(saveEncyclopediaOldProfilesData);
total += sizeof(saveEncyclopediaQuestsData);
//working data
total += sizeof(gbriefingRoomDataTemp);
total /= 1024*1024;
sprintf(buffer,"Memory usage by Encyclopedia: %d MegaBytes\n",total);
OutputDebugString( buffer );
int tmpFlag = _CrtSetDbgFlag( _CRTDBG_REPORT_FLAG );
// Turn on leak-checking bit.
tmpFlag |= _CRTDBG_LEAK_CHECK_DF;
// Turn off CRT block checking bit.
tmpFlag &= ~_CRTDBG_CHECK_CRT_DF;
// Set flag to the new value.
_CrtSetDbgFlag( tmpFlag );
DumpMemoryInfoIntoFile( "ExtremeMemoryDump.txt", FALSE );*/
}
void ResetTemp()
{
#ifdef ENABLE_BRIEFINGROOM
UINT32 i,NUM_TEMP;
UINT32 i,NUM_TEMP;
NUM_TEMP = NUM_MISSION;
NUM_TEMP = NUM_MISSION;
for(i=0; i<NUM_TEMP; i++)
{
@@ -271,22 +232,22 @@ void BackupBRandEncyclopedia ( BRIEFINGROOM_M_DATA *EncyBackup, BRIEFINGROOM_M_D
{
#ifdef ENABLE_BRIEFINGROOM
UINT32 i,NUM_TEMP;
UINT32 i,NUM_TEMP;
NUM_TEMP = NUM_MISSION;
NUM_TEMP = NUM_MISSION;
for(i=0; i<NUM_TEMP; i++)
{
Ency[i].uiIndex = EncyBackup[i].uiIndex;
Ency[i].uiIndex = EncyBackup[i].uiIndex;
Ency[i].Hidden = EncyBackup[i].Hidden;
Ency[i].Hidden = EncyBackup[i].Hidden;
Ency[i].bvisible = EncyBackup[i].bvisible;
Ency[i].bvisible = EncyBackup[i].bvisible;
Ency[i].MissionID = EncyBackup[i].MissionID;
Ency[i].NextMission = EncyBackup[i].NextMission;
Ency[i].MissionID = EncyBackup[i].MissionID;
Ency[i].NextMission = EncyBackup[i].NextMission;
Ency[i].CheckMission = EncyBackup[i].CheckMission;
Ency[i].CheckMission = EncyBackup[i].CheckMission;
}
#endif // ENABLE_BRIEFINGROOM
@@ -307,9 +268,7 @@ void CopyToTemp ( BRIEFINGROOM_M_DATA *Ency, BOOLEAN bFiltr, INT32 sort, INT32 T
bBoxShow = TRUE;
ResetVal = FALSE;
NUM_TEMP = NUM_MISSION;
NUM_TEMP = NUM_MISSION;
for(i=0; i<NUM_TEMP; i++)
{
@@ -440,12 +399,12 @@ void InitData ( BOOLEAN bInit)
BOOLEAN EnterEncyclopediaLocation()
{
#ifdef ENABLE_BRIEFINGROOM
UINT16 usPosX, usPosY, i;
CHAR8 str[MAX_ENCYCLOPEDIA_CHARS];
CHAR8 str[MAX_ENCYCLOPEDIA_CHARS];
InitData (ResetVal);
#ifdef ENCYCLOPEDIA_WORKS
UINT16 usPosX, usPosY, i;
InitEncyclopediaDefaults();
guiEncyclopediaLocationPageButtonImage = LoadButtonImage("ENCYCLOPEDIA\\BottomButtons2.sti", -1,0,-1,1,-1 );
@@ -486,6 +445,7 @@ BOOLEAN EnterEncyclopediaLocation()
usPosX += ENCYCLOPEDIA_LOCATION_PAGE_GAP+60;
}
#endif
fFirstTimeInEncyclopediaLocation = FALSE;
@@ -493,16 +453,20 @@ BOOLEAN EnterEncyclopediaLocation()
RenderButtonDisabled();
#ifdef ENCYCLOPEDIA_WORKS
DisableButton( guiEncyclopediaPageButton[0] );
DisableButton( guiEncyclopediaLocationPageButton[0] );
#endif
if ( gbriefingRoomDataTemp[LocationID].CheckMission == MISSIONSTART || gbriefingRoomDataTemp[LocationID].CheckMission == MISSIONEND )
DisableButton ( guiSoundButtons[1] );
else if ( gbriefingRoomDataTemp[LocationID].CheckMission == MISSIONNOSTARTED )
EnableButton ( guiSoundButtons[1] );
#ifdef ENCYCLOPEDIA_WORKS
if ( MaxLocation == -1 || MaxLocation == 0 || MaxLocation == 1 )
DisableButton( guiEncyclopediaLocationPageButton[2] );
#endif
sprintf(str, "BriefingRoom\\mission%d.wav", gbriefingRoomDataTemp[LocationID].MissionID,IDimage);
if( FileExists(str) )
@@ -524,21 +488,24 @@ void UnLoadMenuButtons ()
void ExitEncyclopediaLocation()
{
UINT16 i;
UINT16 i;
#ifdef ENCYCLOPEDIA_WORKS
RemoveEncyclopediaDefaults();
if (guiEncyclopediaiPageButtonImage != -1 )
UnloadButtonImage( guiEncyclopediaiPageButtonImage );
UnloadButtonImage( guiEncyclopediaiPageButtonImage );
if (guiEncyclopediaLocationPageButtonImage != -1 )
UnloadButtonImage( guiEncyclopediaLocationPageButtonImage );
UnloadButtonImage( guiEncyclopediaLocationPageButtonImage );
for(i=0; i<3; i++)
RemoveButton( guiEncyclopediaPageButton[i] );
for(i=0; i<3; i++)
RemoveButton( guiEncyclopediaLocationPageButton[i] );
#endif
if ( bSoundButtons == TRUE )
{
if ( guiSoundButtonsImage != -1 )
@@ -569,6 +536,7 @@ void HandleEncyclopediaLocation()
void RenderButtonDisabled()
{
#ifdef ENABLE_BRIEFINGROOM
#ifdef ENCYCLOPEDIA_WORKS
if ( bPage2 == FALSE && bPage3 == FALSE )
{
DisableButton( guiEncyclopediaPageButton[0] );
@@ -578,34 +546,41 @@ void RenderButtonDisabled()
{
EnableButton( guiEncyclopediaPageButton[2] );
}
#endif
#endif // ENABLE_BRIEFINGROOM
}
void RenderButtonDisabled2()
{
#ifdef ENABLE_BRIEFINGROOM
#ifdef ENCYCLOPEDIA_WORKS
DisableButton( guiEncyclopediaPageButton[0] );
EnableButton( guiEncyclopediaPageButton[2] );
#endif
#endif // ENABLE_BRIEFINGROOM
}
void RenderButtonDisabled3()
{
#ifdef ENABLE_BRIEFINGROOM
#ifdef ENABLE_BRIEFINGROOM
#ifdef ENCYCLOPEDIA_WORKS
DisableButton( guiEncyclopediaLocationPageButton[0] );
if ( MaxLocation == -1 || MaxLocation == 0 || MaxLocation == 1 )
DisableButton( guiEncyclopediaLocationPageButton[2] );
else
EnableButton( guiEncyclopediaLocationPageButton[2] );
#endif
#endif // ENABLE_BRIEFINGROOM
}
void RenderButtonDisabled4()
{
#ifdef ENABLE_BRIEFINGROOM
#ifdef ENCYCLOPEDIA_WORKS
DisableButton( guiEncyclopediaPageButton[0] );
DisableButton( guiEncyclopediaPageButton[2] );
#endif
#endif // ENABLE_BRIEFINGROOM
}
@@ -616,6 +591,7 @@ void RenderBoxDisabledButton()
MaxLocation = 0;
IDimage = 0;
#ifdef ENCYCLOPEDIA_WORKS
DisableButton( guiEncyclopediaLocationPageButton[0] );
//DisableButton( guiEncyclopediaLocationPageButton[1] );
DisableButton( guiEncyclopediaLocationPageButton[2] );
@@ -623,6 +599,7 @@ void RenderBoxDisabledButton()
DisableButton( guiEncyclopediaPageButton[0] );
DisableButton( guiEncyclopediaPageButton[1] );
DisableButton( guiEncyclopediaPageButton[2] );
#endif
#endif // ENABLE_BRIEFINGROOM
}
@@ -796,14 +773,14 @@ void RenderEncyclopediaLocation( BOOLEAN bHidden )
//Reset
if ( ResetVal == TRUE )
DisplayWrappedString(ENCYCLOPEDIA_LOCATION_BOX_DESC_X, ENCYCLOPEDIA_LOCATION_BOX_DESC_Y + 13, ENCYCLOPEDIA_LOCATION_BOX_TEXT_WIDTH, 6, ENCYCLOPEDIA_LOCATION_BOX_FONT, ENCYCLOPEDIA_LOCATION_BOX_COLOR, L"", FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
MarkButtonsDirty( );
RenderWWWProgramTitleBar( );
if ( ENCYCLOPEDIA_PAGE == -1 || ENCYCLOPEDIA_PAGE == 0 )
RenderButtonDisabled4();
#ifdef ENCYCLOPEDIA_WORKS
if ( bHidden == TRUE && ( MaxImages == 0 || MaxImages == -1 || MaxImages == 1 ) ) //|| gbriefingRoomDataTemp[0].MaxImages == 1 ) )
DisableButton( guiEncyclopediaPageButton[1] );
else if ( bHidden == FALSE && MaxImages > 1 )
@@ -811,8 +788,9 @@ void RenderEncyclopediaLocation( BOOLEAN bHidden )
//Reset
if ( ResetVal == TRUE )
DisableButton( guiEncyclopediaPageButton[1] );
DisableButton( guiEncyclopediaPageButton[1] );
#endif
if ( gbriefingRoomDataTemp[LocationID].CheckMission == MISSIONSTART || gbriefingRoomDataTemp[LocationID].CheckMission == MISSIONEND )
DisableButton ( guiSoundButtons[1] );
else if ( gbriefingRoomDataTemp[LocationID].CheckMission == MISSIONNOSTARTED )
@@ -844,9 +822,11 @@ void SelectEncyclopediaLocationPageRegionCallBack(GUI_BUTTON * btn, INT32 reason
{
ID++;
#ifdef ENCYCLOPEDIA_WORKS
if ( ID == ENCYCLOPEDIA_PAGE || ID > ENCYCLOPEDIA_PAGE ) DisableButton( guiEncyclopediaPageButton[2] );
if ( ID > 0 ) EnableButton( guiEncyclopediaPageButton[0] );
#endif
RenderEncyclopediaLocation(FALSE);
RenderMap();
}
@@ -854,8 +834,11 @@ void SelectEncyclopediaLocationPageRegionCallBack(GUI_BUTTON * btn, INT32 reason
{
ID--;
//if ( ID < 0 ) ID = 0;
#ifdef ENCYCLOPEDIA_WORKS
if ( ID == 0 ) DisableButton( guiEncyclopediaPageButton[0] );
if ( ID < ENCYCLOPEDIA_PAGE ) EnableButton( guiEncyclopediaPageButton[2] );
#endif
RenderEncyclopediaLocation(FALSE);
RenderMap();
}
@@ -898,9 +881,11 @@ void SelectEncyclopediaLocationRegionCallBack(GUI_BUTTON * btn, INT32 reason )
LocationID = IDNewLocation;
#ifdef ENCYCLOPEDIA_WORKS
if ( IDNewLocation == MaxLocation - 1 || IDNewLocation == -1 ) DisableButton( guiEncyclopediaLocationPageButton[2] );
if ( IDNewLocation > 0 ) EnableButton( guiEncyclopediaLocationPageButton[0] );
#endif
IDimage = 0;
RenderEncyclopediaLocation(FALSE);
@@ -909,11 +894,13 @@ void SelectEncyclopediaLocationRegionCallBack(GUI_BUTTON * btn, INT32 reason )
if ( ENCYCLOPEDIA_PAGE == -1 || ENCYCLOPEDIA_PAGE == 0 )
RenderButtonDisabled4();
#ifdef ENCYCLOPEDIA_WORKS
if ( MaxImages == -1 || MaxImages == 0 || MaxImages == 1 )
DisableButton( guiEncyclopediaPageButton[1] );
else
EnableButton( guiEncyclopediaPageButton[1] );
#endif
if( uiSoundSampleBR!=NO_SAMPLE )
{
SoundStop( uiSoundSampleBR );
@@ -930,26 +917,30 @@ void SelectEncyclopediaLocationRegionCallBack(GUI_BUTTON * btn, INT32 reason )
LocationID = IDNewLocation;
#ifdef ENCYCLOPEDIA_WORKS
if ( IDNewLocation == 0 || IDNewLocation == -1 ) DisableButton( guiEncyclopediaLocationPageButton[0] );
if ( IDNewLocation < MaxLocation-1) EnableButton( guiEncyclopediaLocationPageButton[2] );
#endif
IDimage = 0;
RenderEncyclopediaLocation(FALSE);
RenderButtonDisabled2();
if ( ENCYCLOPEDIA_PAGE == -1 || ENCYCLOPEDIA_PAGE == 0 )
RenderButtonDisabled4();
if ( MaxImages == -1 || MaxImages == 0 || MaxImages == 1 )
DisableButton( guiEncyclopediaPageButton[1] );
else
EnableButton( guiEncyclopediaPageButton[1] );
if( uiSoundSampleBR!=NO_SAMPLE )
{
SoundStop( uiSoundSampleBR );
}
if ( ENCYCLOPEDIA_PAGE == -1 || ENCYCLOPEDIA_PAGE == 0 )
RenderButtonDisabled4();
#ifdef ENCYCLOPEDIA_WORKS
if ( MaxImages == -1 || MaxImages == 0 || MaxImages == 1 )
DisableButton( guiEncyclopediaPageButton[1] );
else
EnableButton( guiEncyclopediaPageButton[1] );
#endif
if( uiSoundSampleBR!=NO_SAMPLE )
{
SoundStop( uiSoundSampleBR );
}
RenderMap();
@@ -958,27 +949,28 @@ void SelectEncyclopediaLocationRegionCallBack(GUI_BUTTON * btn, INT32 reason )
{
//ExitEncyclopediaLocation();
if( uiSoundSampleBR!=NO_SAMPLE )
{
SoundStop( uiSoundSampleBR );
}
if( uiSoundSampleBR!=NO_SAMPLE )
{
SoundStop( uiSoundSampleBR );
}
if ( bBriefingRoom == TRUE || bBriefingRoomSpecialMission == TRUE )
{
if(!fFirstTimeInEncyclopediaLocation) guiCurrentLaptopMode = LAPTOP_MODE_BRIEFING_ROOM_ENTER;
}
#ifdef ENCYCLOPEDIA_WORKS
else
{
if(!fFirstTimeInEncyclopediaLocation) guiCurrentLaptopMode = LAPTOP_MODE_ENCYCLOPEDIA;
}
#endif
}
}
}
if(reason & MSYS_CALLBACK_REASON_LOST_MOUSE)
{
btn->uiFlags &= (~BUTTON_CLICKED_ON );
}
#endif // ENABLE_BRIEFINGROOM
}
-1
View File
@@ -3,7 +3,6 @@
#include "Quests.h"
void GameInitEncyclopediaLocation();
BOOLEAN EnterEncyclopediaLocation();
void ExitEncyclopediaLocation();
void HandleEncyclopediaLocation();
+6
View File
@@ -32,6 +32,7 @@
#include "Quests.h"
#endif
#ifdef ENCYCLOPEDIA_WORKS
/** @ingroup ENCYCLOPEDIA
* @file
* Encyclopedia data page in laptop.
@@ -65,8 +66,11 @@ struct ENC_DATA_ENTRY_T {
UINT8 uiTextPage; ///< Current text page. Number of pages is currently 2 as there is no use for more at the moment. To define different pages modify \ref CreateData() and \ref BtnEncyclopedia_Data_NextPreviousTextBtnCallBack() accordingly.
} gstEncyclopediaDataEntry; ///< Current data.
#endif
UINT8 gbEncyclopediaData_ItemVisible[MAXITEMS];///< Visibility of items. If an item should be visible the value is not 0. Gets loaded from savegame, updated by \ref EncyclopediaSetItemAsVisible() and reset by \ref EncyclopediaInitItemsVisibility().
#ifdef ENCYCLOPEDIA_WORKS
/// Various filters for locations. Only filtered locations are shown. Subfilters, if any, are handled by callback function.
enum ENC_DATA_FILTER_LOCATION {
ENC_DATA_FILTER_L_ALL = 0, ///< All locations visible
@@ -1728,3 +1732,5 @@ void RenderEncyclopediaData_NEW( )
}
/** @} */
#endif
+3
View File
@@ -3,6 +3,7 @@
#include "Item Types.h"
#ifdef ENCYCLOPEDIA_WORKS
#define ENC_NUM_DATAPAGES MAXITEMS
@@ -13,3 +14,5 @@ extern BOOLEAN EnterEncyclopediaData_NEW( );
extern BOOLEAN ExitEncyclopediaData_NEW( );
#endif
#endif
+7 -1
View File
@@ -53,9 +53,10 @@
//#include "Campaign Types.h"
//#include "Quests.h"
//#include "Tactical Save.h"
//#include "Encyclopedia_Data_new.h"
#include "Encyclopedia_Data_new.h"
#endif
#ifdef ENCYCLOPEDIA_WORKS
/** @defgroup ENCYCLOPEDIA Encyclopedia
* Encyclopedia shows discovered places, characters, known items and quests.
*/
@@ -352,6 +353,8 @@ void EncyclopediaInitItemsVisibility()
memset( gbEncyclopediaData_ItemVisible, ENC_ITEM_NOT_DISCOVERED, MAXITEMS*sizeof(UINT8) );
}
#endif
/**
* @brief Saves Item visibility array to file.
*
@@ -381,6 +384,7 @@ BOOLEAN LoadEncyclopediaItemVisibility( HWFILE hFile )
}
///@}
#ifdef ENCYCLOPEDIA_WORKS
/**
* @brief Prepares a change to a different subpage.
* Subpages currently available: Loactions, Characters, Items, Quests.
@@ -460,3 +464,5 @@ void BtnEncyclopedia_newSelectDataPageRegionCallBack( MOUSE_REGION * pRegion, IN
}
}
#endif
#endif
+10 -3
View File
@@ -1,6 +1,8 @@
#ifndef __Encyclopedia_new_H
#define __Encyclopedia_new_H
#ifdef ENCYCLOPEDIA_WORKS
/// For switching between data sub pages.
enum ENC_SUBPAGE_T {
ENC_MAINPAGE = 0,
@@ -20,18 +22,23 @@ ENC_ITEM_DISCOVERED_NOT_INSPECTABLE, ///< item is visible in encyclopedia if ext
ENC_ITEM_DISCOVERED_INSPECTABLE, ///< item is visible in encyclopedia if external option allows inspectable items to be added as discovered. Item is potentially reachable and can be inspected. example: discovering from a dealers inventory, discovering from sector stash.
ENC_ITEM_DISCOVERED ///< item is visible in encyclopedia. Item can be fully inspected. example: item is in merc inventory.
};
extern UINT8 gbEncyclopediaData_ItemVisible[];
extern void EncyclopediaInitItemsVisibility();
extern void EncyclopediaSetItemAsVisible( UINT16 itemIndex, ENC_ITEM_VISIBILITY_T visibility );
extern BOOLEAN LoadEncyclopediaItemVisibility( HWFILE hFile );
extern BOOLEAN SaveEncyclopediaItemVisibility( HWFILE hFile );
#endif
extern UINT8 gbEncyclopediaData_ItemVisible[];
BOOLEAN LoadEncyclopediaItemVisibility( HWFILE hFile );
BOOLEAN SaveEncyclopediaItemVisibility( HWFILE hFile );
#ifdef ENCYCLOPEDIA_WORKS
extern void GameInitEncyclopedia_NEW( );
extern void HandleEncyclopedia_NEW( );
extern void RenderEncyclopedia_NEW( );
extern BOOLEAN EnterEncyclopedia_NEW( );
extern BOOLEAN ExitEncyclopedia_NEW( );
#endif
#endif
+32 -16
View File
@@ -788,11 +788,14 @@ UINT32 LaptopScreenInit()
GameInitFiles();
GameInitPersonnel();
#ifdef ENCYCLOPEDIA_WORKS
//legion
/* GameInitEncyclopedia();
GameInitEncyclopediaLocation();*/
GameInitEncyclopedia_NEW();
GameInitEncyclopediaData_NEW();
#endif
GameInitBriefingRoom();
GameInitBriefingRoomEnter();
@@ -1046,8 +1049,10 @@ INT32 EnterLaptop()
{
SetBookMark( AIM_BOOKMARK );
#ifdef ENCYCLOPEDIA_WORKS
if ( gGameExternalOptions.gEncyclopedia )
SetBookMark( ENCYCLOPEDIA_BOOKMARK );
#endif
if ( gGameExternalOptions.gBriefingRoom )
SetBookMark( BRIEFING_ROOM_BOOKMARK );
@@ -1258,9 +1263,10 @@ void RenderLaptop()
switch( guiCurrentLaptopMode )
{
case( LAPTOP_MODE_NONE ):
DrawDeskTopBackground( );
break;
DrawDeskTopBackground( );
break;
#ifdef ENCYCLOPEDIA_WORKS
case LAPTOP_MODE_ENCYCLOPEDIA: //LEGION
// RenderEncyclopedia();
RenderEncyclopedia_NEW();
@@ -1270,6 +1276,7 @@ void RenderLaptop()
// RenderEncyclopediaLocation(FALSE);
RenderEncyclopediaData_NEW();
break;
#endif
case LAPTOP_MODE_BRIEFING_ROOM_PAGE:
RenderBriefingRoom();
@@ -1638,14 +1645,16 @@ void EnterNewLaptopMode()
if( gLaptopProgramStates[ LAPTOP_PROGRAM_WEB_BROWSER ] == LAPTOP_PROGRAM_MINIMIZED )
{
if ( guiCurrentLaptopMode == LAPTOP_MODE_ENCYCLOPEDIA_DATA || 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 )
if ( guiCurrentLaptopMode == LAPTOP_MODE_BRIEFING_ROOM_PAGE || guiCurrentLaptopMode == LAPTOP_MODE_BRIEFING_ROOM || guiCurrentLaptopMode == LAPTOP_MODE_BRIEFING_ROOM_ENTER )
{
guiCurrentLaptopMode = LAPTOP_MODE_BRIEFING_ROOM_ENTER;
}
#ifdef ENCYCLOPEDIA_WORKS
else if ( guiCurrentLaptopMode == LAPTOP_MODE_ENCYCLOPEDIA_DATA || guiCurrentLaptopMode == LAPTOP_MODE_ENCYCLOPEDIA )
{
guiCurrentLaptopMode = LAPTOP_MODE_ENCYCLOPEDIA;
}
#endif
// minized, maximized
if( fMaximizingProgram == FALSE )
@@ -1733,6 +1742,7 @@ void EnterNewLaptopMode()
//Initialize the new mode.
switch( guiCurrentLaptopMode )
{
#ifdef ENCYCLOPEDIA_WORKS
//legion
case LAPTOP_MODE_ENCYCLOPEDIA:
// EnterEncyclopedia();
@@ -1743,6 +1753,7 @@ void EnterNewLaptopMode()
// EnterEncyclopediaLocation();
EnterEncyclopediaData_NEW();
break;
#endif
case LAPTOP_MODE_BRIEFING_ROOM_PAGE:
EnterBriefingRoom();
@@ -1999,6 +2010,7 @@ void HandleLapTopHandles()
switch( guiCurrentLaptopMode )
{
#ifdef ENCYCLOPEDIA_WORKS
//legion
case LAPTOP_MODE_ENCYCLOPEDIA:
// HandleEncyclopedia();
@@ -2009,6 +2021,7 @@ void HandleLapTopHandles()
// HandleEncyclopediaLocation();
HandleEncyclopediaData_NEW();
break;
#endif
case LAPTOP_MODE_BRIEFING_ROOM_PAGE:
HandleBriefingRoom();
@@ -2587,7 +2600,7 @@ UINT32 ExitLaptopMode(UINT32 uiMode)
switch( uiMode )
{
#ifdef ENCYCLOPEDIA_WORKS
case LAPTOP_MODE_ENCYCLOPEDIA:
ExitEncyclopedia_NEW();
// ExitEncyclopedia();
@@ -2598,7 +2611,8 @@ UINT32 ExitLaptopMode(UINT32 uiMode)
// ExitEncyclopediaLocation();
ExitEncyclopediaData_NEW();
break;
#endif
case LAPTOP_MODE_BRIEFING_ROOM_PAGE:
ExitBriefingRoom();
break;
@@ -4195,6 +4209,7 @@ void GoToWebPage(INT32 iPageId )
//LEGION
case ENCYCLOPEDIA_BOOKMARK:
#ifdef ENCYCLOPEDIA_WORKS
guiCurrentWWWMode=LAPTOP_MODE_ENCYCLOPEDIA;
guiCurrentLaptopMode=LAPTOP_MODE_ENCYCLOPEDIA;
@@ -4211,6 +4226,7 @@ void GoToWebPage(INT32 iPageId )
fLoadPendingFlag = TRUE;
fFastLoadFlag = TRUE;
}
#endif
break;
case BRIEFING_ROOM_BOOKMARK:
@@ -5920,16 +5936,16 @@ void SetCurrentToLastProgramOpened( void )
break;
case( LAPTOP_PROGRAM_WEB_BROWSER ):
// last www mode
if ( guiCurrentLaptopMode == LAPTOP_MODE_ENCYCLOPEDIA_DATA || 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 )
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 ) )
#ifdef ENCYCLOPEDIA_WORKS
else if ( guiCurrentLaptopMode == LAPTOP_MODE_ENCYCLOPEDIA_DATA || guiCurrentLaptopMode == LAPTOP_MODE_ENCYCLOPEDIA )
{
guiCurrentLaptopMode = LAPTOP_MODE_ENCYCLOPEDIA;
}
#endif
else if( guiCurrentWWWMode >= LAPTOP_MODE_FINANCES && guiCurrentWWWMode <= LAPTOP_MODE_BOBBYR_SHIPMENTS )
{
guiCurrentLaptopMode = guiCurrentWWWMode;
+4
View File
@@ -1691,10 +1691,14 @@ BOOLEAN DisplayMERCMercsInventory(UINT8 ubMercID)
{
PosX += MERC_WEAPONBOX_SIZE_X_NSGI;
}
#ifdef ENCYCLOPEDIA_WORKS
//Moa: update encyclopedia item visibility when item gets displayed
EncyclopediaSetItemAsVisible( usItem, ENC_ITEM_DISCOVERED_NOT_INSPECTABLE );
#endif
}
}
return(TRUE);
}
//JMich_MMG: Creating the mouseregion for tooltips
+2
View File
@@ -6085,8 +6085,10 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
LoadGameFilePosition( FileGetPos( hFile), "Encyclopedia item visibility" );
#endif
}
#ifdef ENCYCLOPEDIA_WORKS
else
EncyclopediaInitItemsVisibility();
#endif
if( guiCurrentSaveGameVersion >= CAMPAIGNSTATS )
{
@@ -635,15 +635,21 @@ BOOLEAN RenderItemInPoolSlot( INT32 iCurrentSlot, INT32 iFirstSlotOnPage )
) )
{
//Shade the item, but only if it is an active item!
if ( pInventoryPoolList[ iCurrentSlot + iFirstSlotOnPage ].object.exists() == true) {
if ( pInventoryPoolList[ iCurrentSlot + iFirstSlotOnPage ].object.exists() == true)
{
DrawHatchOnInventory( guiSAVEBUFFER, sX, sY, MAP_INVEN_SLOT_WIDTH, MAP_INVEN_SLOT_IMAGE_HEIGHT );
#ifdef ENCYCLOPEDIA_WORKS
//Moa: set encyclopedia item visibility (not reachable)
EncyclopediaSetItemAsVisible( pInventoryPoolList[ iCurrentSlot + iFirstSlotOnPage ].object.usItem, ENC_ITEM_DISCOVERED_NOT_REACHABLE );
#endif
}
}
#ifdef ENCYCLOPEDIA_WORKS
//Moa: set encyclopedia item visibility (reachable)
else if ( pInventoryPoolList[ iCurrentSlot + iFirstSlotOnPage ].object.exists() == true )
EncyclopediaSetItemAsVisible( pInventoryPoolList[ iCurrentSlot + iFirstSlotOnPage ].object.usItem, ENC_ITEM_DISCOVERED_NOT_INSPECTABLE );
#endif
// Flugente: militia equipment
if( gGameExternalOptions.fMilitiaUseSectorInventory && ( pInventoryPoolList[ iCurrentSlot + iFirstSlotOnPage ].usFlags & WORLD_ITEM_TABOO_FOR_MILITIA_EQ_ALL ) )
+2
View File
@@ -3748,8 +3748,10 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec
RestoreExternBackgroundRect( sX, sY, sWidth, sHeight );
}
#ifdef ENCYCLOPEDIA_WORKS
//Moa: set encyclopedia item visibility
EncyclopediaSetItemAsVisible( pItem->uiIndex, ENC_ITEM_DISCOVERED );
#endif
}
SetFont( ITEM_FONT );
+2
View File
@@ -2830,8 +2830,10 @@ UINT32 DisplayInvSlot( UINT16 ubSlotNum, UINT16 usItemIndex, UINT16 usPosX, UINT
//blt the item
BltVideoObjectOutlineFromIndex( FRAME_BUFFER, GetInterfaceGraphicForItem( pItem ), g_bUsePngItemImages ? 0 : pItem->ubGraphicNum, sCenX, sCenY, Get16BPPColor( FROMRGB( 255, 255, 255 ) ), fHighlighted );
#ifdef ENCYCLOPEDIA_WORKS
//Moa: encyclopedia item visibility
EncyclopediaSetItemAsVisible( usItemIndex, ENC_ITEM_DISCOVERED_INSPECTABLE );
#endif
//Display the status of the item
DrawItemUIBarEx( pItemObject, 0, (INT16)(usPosX+2), (INT16)(usPosY+2+20), 2, 20, Get16BPPColor( FROMRGB( 140, 136, 119 ) ), Get16BPPColor( FROMRGB( 140, 136, 119 ) ), TRUE, guiRENDERBUFFER );//guiSAVEBUFFER
+21
View File
@@ -311,23 +311,32 @@ void SoldierTooltip( SOLDIERTYPE* pSoldier )
if ( gGameExternalOptions.fEnableSoldierTooltipHelmet )
{
swprintf( pStrInfo, gzTooltipStrings[STR_TT_CAT_HELMET], pStrInfo, pSoldier->inv[HELMETPOS].usItem ? ItemNames[ pSoldier->inv[HELMETPOS].usItem ] : gzTooltipStrings[STR_TT_NO_HELMET] );
#ifdef ENCYCLOPEDIA_WORKS
//Moa: encyclopedia item visibility
if ( pSoldier->inv[HELMETPOS].usItem )
EncyclopediaSetItemAsVisible( pSoldier->inv[HELMETPOS].usItem, ENC_ITEM_DISCOVERED_NOT_REACHABLE );
#endif
}
if ( gGameExternalOptions.fEnableSoldierTooltipVest )
{
swprintf( pStrInfo, gzTooltipStrings[STR_TT_CAT_VEST], pStrInfo, pSoldier->inv[VESTPOS].usItem ? ItemNames[ pSoldier->inv[VESTPOS].usItem ] : gzTooltipStrings[STR_TT_NO_VEST] );
#ifdef ENCYCLOPEDIA_WORKS
//Moa: encyclopedia item visibility
if ( pSoldier->inv[VESTPOS].usItem )
EncyclopediaSetItemAsVisible( pSoldier->inv[VESTPOS].usItem, ENC_ITEM_DISCOVERED_NOT_REACHABLE );
#endif
}
if ( gGameExternalOptions.fEnableSoldierTooltipLeggings )
{
swprintf( pStrInfo, gzTooltipStrings[STR_TT_CAT_LEGGINGS], pStrInfo, pSoldier->inv[LEGPOS].usItem ? ItemNames[ pSoldier->inv[LEGPOS].usItem ] : gzTooltipStrings[STR_TT_NO_LEGGING] );
#ifdef ENCYCLOPEDIA_WORKS
//Moa: encyclopedia item visibility
if ( pSoldier->inv[LEGPOS].usItem )
EncyclopediaSetItemAsVisible( pSoldier->inv[LEGPOS].usItem, ENC_ITEM_DISCOVERED_NOT_REACHABLE );
#endif
}
}
else
@@ -380,9 +389,12 @@ void SoldierTooltip( SOLDIERTYPE* pSoldier )
{
swprintf( pStrInfo, gzTooltipStrings[STR_TT_CAT_NVG], pStrInfo,
iNVG ? ItemNames[ pSoldier->inv[ iNVG ].usItem ] : gzTooltipStrings[STR_TT_NO_NVG] );
#ifdef ENCYCLOPEDIA_WORKS
//Moa: encyclopedia item visibility
if ( iNVG )
EncyclopediaSetItemAsVisible( pSoldier->inv[ iNVG ].usItem, ENC_ITEM_DISCOVERED_NOT_REACHABLE );
#endif
}
else
{
@@ -397,16 +409,22 @@ void SoldierTooltip( SOLDIERTYPE* pSoldier )
if ( gGameExternalOptions.fEnableSoldierTooltipHeadItem1 )
{
swprintf( pStrInfo, gzTooltipStrings[STR_TT_CAT_HEAD_POS_1], pStrInfo, ItemNames[ pSoldier->inv[HEAD1POS].usItem ] );
#ifdef ENCYCLOPEDIA_WORKS
//Moa: encyclopedia item visibility
if ( pSoldier->inv[HEAD1POS].usItem )
EncyclopediaSetItemAsVisible( pSoldier->inv[ HEAD1POS ].usItem, ENC_ITEM_DISCOVERED_NOT_REACHABLE );
#endif
}
if ( gGameExternalOptions.fEnableSoldierTooltipHeadItem2 )
{
swprintf( pStrInfo, gzTooltipStrings[STR_TT_CAT_HEAD_POS_2], pStrInfo, ItemNames[ pSoldier->inv[HEAD2POS].usItem ] );
#ifdef ENCYCLOPEDIA_WORKS
//Moa: encyclopedia item visibility
if ( pSoldier->inv[HEAD2POS].usItem )
EncyclopediaSetItemAsVisible( pSoldier->inv[ HEAD2POS ].usItem, ENC_ITEM_DISCOVERED_NOT_REACHABLE );
#endif
}
}
// head slots info code block end
@@ -529,9 +547,12 @@ void DisplayWeaponInfo( SOLDIERTYPE* pSoldier, CHAR16* pStrInfo, UINT8 ubSlot, U
// display exact weapon model
swprintf( pStrInfo, gzTooltipStrings[STR_TT_CAT_WEAPON], pStrInfo,
WeaponInHand( pSoldier ) ? ItemNames[ pSoldier->inv[ubSlot].usItem ] : gzTooltipStrings[STR_TT_NO_WEAPON] );
#ifdef ENCYCLOPEDIA_WORKS
//Moa: encyclopedia item visibility
if ( pSoldier->inv[ubSlot].usItem )
EncyclopediaSetItemAsVisible( pSoldier->inv[ ubSlot ].usItem, ENC_ITEM_DISCOVERED_NOT_REACHABLE );
#endif
}
else
{