New (originally very old) feature: merc relations are influenced by appearance/refinement/racism/nationality/sexism. See http://www.bears-pit.com/board/ubbthreads.php/topics/326828.html#Post326828 for more info.

Also includes classes for creation of dropdown menua, see Laptop/DropDown.h.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6510 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2013-10-19 16:33:43 +00:00
parent 73be285e09
commit b9ac50aaac
29 changed files with 3624 additions and 21 deletions
+8
View File
@@ -1686,6 +1686,14 @@ void LoadGameExternalOptions()
//Madd: override map item appearance chance
gGameExternalOptions.ubMapItemChanceOverride = iniReader.ReadInteger("Strategic Gameplay Settings","MAP_ITEM_CHANCE_OVERRIDE", 0, 0, 100);
//################# Morale Settings ##################
gGameExternalOptions.sMoraleModAppearance = iniReader.ReadInteger("Morale Settings","MORALE_MOD_APPEARANCE", 1, 0, 5);
gGameExternalOptions.sMoraleModRefinement = iniReader.ReadInteger("Morale Settings","MORALE_MOD_REFINEMENT", 2, 0, 5);
gGameExternalOptions.sMoraleModHatedNationality = iniReader.ReadInteger("Morale Settings","MORALE_MOD_HATEDNATIONALITY", 3, 0, 5);
gGameExternalOptions.sMoraleModRacism = iniReader.ReadInteger("Morale Settings","MORALE_MOD_RACISM", 3, 0, 5);
gGameExternalOptions.sMoraleModSexism = iniReader.ReadInteger("Morale Settings","MORALE_MOD_SEXISM", 1, 0, 5);
gGameExternalOptions.sMoraleModXenophobicBackGround = iniReader.ReadInteger("Morale Settings","MORALE_MOD_BACKGROUND_XENOPHOBIC", 5, 0, 15);
//################# Laptop Settings ##################
#ifdef ENABLE_BRIEFINGROOM
+8
View File
@@ -1253,6 +1253,14 @@ typedef struct
UINT8 ubPrisonerProcessInfoDirectionChance;
UINT8 ubPrisonerProcessRansomBaseChance;
UINT16 ubPrisonerInterrogationPoints[4]; // points needed to interrogate a prisoner of a specific type
// Flugente: sexism/racism/etc.
INT8 sMoraleModAppearance;
INT8 sMoraleModRefinement;
INT8 sMoraleModHatedNationality;
INT8 sMoraleModRacism;
INT8 sMoraleModSexism;
INT8 sMoraleModXenophobicBackGround;
// Sandro: Alternative weapon holding (rifles fired from hip / pistols fired one-handed)
UINT8 ubAllowAlternativeWeaponHolding;
+41 -2
View File
@@ -32,6 +32,7 @@
#include "IMP Color Choosing.h"
#include "IMP Minor Trait.h"
#include "IMP Background.h" // added by Flugente
#include "IMP Prejudice.h" // added by Flugente
#endif
@@ -80,6 +81,18 @@ INT32 iAttitude = 0;
// Flugente: background
UINT8 usBackground = 0;
// Flugente: sexism, racism etc.
INT8 bRace = 0;
INT8 bNationality = 0;
INT8 bAppearance = 0;
INT8 bAppearanceCareLevel = 0;
INT8 bRefinement = 0;
INT8 bRefinementCareLevel = 0;
INT8 bHatedNationality = -1;
INT8 bHatedNationalityCareLevel = 0;
INT8 bRacist = 0;
UINT8 bSexist = 0;
// additives, but no preservatives
INT32 iAddStrength = 0;
INT32 iAddDexterity = 0;
@@ -280,6 +293,9 @@ void HandleCharProfile()
case( IMP_BACKGROUND ):
HandleIMPBackground( );
break;
case( IMP_PREJUDICE ):
HandleIMPPrejudice( );
break;
}
return;
@@ -359,6 +375,9 @@ void RenderCharProfile()
case( IMP_BACKGROUND ):
RenderIMPBackground( );
break;
case( IMP_PREJUDICE ):
RenderIMPPrejudice( );
break;
}
// render title bar
@@ -468,6 +487,10 @@ void ExitOldIMPMode( void )
DestroyIMPButtons( );
ExitIMPBackground( );
break;
case( IMP_PREJUDICE ):
DestroyIMPButtons( );
ExitIMPPrejudice( );
break;
}
return;
@@ -559,6 +582,10 @@ void EnterNewIMPMode( void )
CreateIMPButtons( );
EnterIMPBackground( );
break;
case( IMP_PREJUDICE ):
CreateIMPButtons( );
EnterIMPPrejudice( );
break;
}
@@ -593,10 +620,22 @@ void ResetCharacterStats( void )
// attitude
iAttitude = 0;
// background
// Flugente: background
usBackground = 0;
// Flugente: sexism, racsim etc.
bRace = 0;
bNationality = 0;
bAppearance = 0;
bAppearanceCareLevel = 0;
bRefinement = 0;
bRefinementCareLevel = 0;
bHatedNationality = -1;
bHatedNationalityCareLevel = 0;
bRacist = 0;
bSexist = 0;
// names
memset( &pFullName, 0 , sizeof( pFullName) );
memset( &pNickName, 0 , sizeof( pNickName) );
+14
View File
@@ -49,6 +49,18 @@ extern INT32 iAttitude;
// Flugente: background
extern UINT8 usBackground;
// Flugente: sexism, racism etc.
extern INT8 bRace;
extern INT8 bNationality;
extern INT8 bAppearance;
extern INT8 bAppearanceCareLevel;
extern INT8 bRefinement;
extern INT8 bRefinementCareLevel;
extern INT8 bHatedNationality;
extern INT8 bHatedNationalityCareLevel;
extern INT8 bRacist;
extern UINT8 bSexist;
//addtivies
extern INT32 iAddStrength;
extern INT32 iAddDexterity;
@@ -88,7 +100,9 @@ enum{
IMP_DISABILITY_PAGE,
IMP_COLOR_CHOICE_PAGE,
IMP_MINOR_TRAITS_PAGE,
// added by Flugente
IMP_BACKGROUND,
IMP_PREJUDICE,
IMP_NUM_PAGES,
};
+621
View File
@@ -0,0 +1,621 @@
/**
* @file
* @author Flugente (bears-pit.com)
*/
#include "DropDown.h"
#include "Font.h"
#include "laptop.h"
#include "Cursors.h"
#include "Utilities.h"
#include "vobject.h"
#include "WCheck.h"
#include "line.h"
#include "WordWrap.h"
#include "input.h" // for gfLeftButtonState
// define now, make a parameter later
#define DEF_DROPDOWN_FONT FONT12ARIAL
#define DEF_SCROLL_ARROW_HEIGHT 24
#define CITY_NAME_OFFSET 6
#define STATIC_TEXT_COLOR 145
// helpful draw functions, as adding sti objects to paint boundaries is... lets say, inefficient
void DisplaySmallLine( UINT16 usStartX, UINT16 usStartY, UINT16 EndX, UINT16 EndY, UINT16 usColor )
{
UINT32 uiDestPitchBYTES;
UINT8 *pDestBuf;
pDestBuf = LockVideoSurface( FRAME_BUFFER, &uiDestPitchBYTES );
SetClippingRegionAndImageWidth( uiDestPitchBYTES, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
// draw the line
LineDraw(FALSE, usStartX, usStartY, EndX, EndY, usColor, pDestBuf);
// unlock frame buffer
UnLockVideoSurface( FRAME_BUFFER );
}
void Display2Line2ShadowHorizontal( UINT16 usStartX, UINT16 usStartY, UINT16 EndX, UINT16 usColor1, UINT16 usColor2 )
{
DisplaySmallLine(usStartX, usStartY , EndX, usStartY, usColor1);
DisplaySmallLine(usStartX, usStartY+1, EndX, usStartY+1, usColor1);
DisplaySmallLine(usStartX, usStartY+2, EndX, usStartY+2, usColor2);
DisplaySmallLine(usStartX, usStartY+3, EndX, usStartY+3, usColor2);
}
void Display2Line2ShadowVertical( UINT16 usStartX, UINT16 usStartY, UINT16 EndY, UINT16 usColor1, UINT16 usColor2 )
{
DisplaySmallLine(usStartX, usStartY, usStartX, EndY, usColor1);
DisplaySmallLine(usStartX+1, usStartY, usStartX+1, EndY, usColor1);
DisplaySmallLine(usStartX+2, usStartY, usStartX+2, EndY, usColor2);
DisplaySmallLine(usStartX+3, usStartY, usStartX+3, EndY, usColor2);
}
DropDown::DropDown()
{
// default settings
musWidth = 100; // width of text field
musArrowWidth = 22; // width of arrow (and thus scrollbar)
mEntryVector.clear();
mSelectedEntry = 0;
mFirstShownEntry = 0;
mColorLine = Get16BPPColor( FROMRGB( 231, 199, 90 ) );
mColorLineShadow = Get16BPPColor( FROMRGB( 33, 24, 8 ) );
mColorMarked = Get16BPPColor( FROMRGB( 200, 169, 87 ) );
mColorHighLight = Get16BPPColor( FROMRGB( 235, 222, 171 ) );
}
void
DropDown::Init(UINT16 sX, UINT16 sY)
{
mfMouseRegionsCreated = FALSE;
musStartX = sX;
musStartY = sY;
mSelectedEntry = min(mSelectedEntry, mEntryVector.size() - 1);
mNumDisplayedEntries = min(DROPDOWN_REGIONS, mEntryVector.size() );
mFirstShownEntry = max(0, min(mFirstShownEntry, mEntryVector.size() - 1 - mNumDisplayedEntries));
musWidth = 0;
UINT8 size = mEntryVector.size();
for( UINT8 i = 0; i < size; ++i)
{
musWidth = max(musWidth, StringPixLength ( mEntryVector[i].second, DEF_DROPDOWN_FONT ));
}
// account for a bit of space let and right
musWidth += 2 * CITY_NAME_OFFSET;
musUpArrowX = musStartX + musWidth;
musUpArrowY = musStartY + 2;
musFontHeight = GetFontHeight( DEF_DROPDOWN_FONT ); // does not work on init of static objects, as the fonts do not yet exist!
}
void
DropDown::Init_Drop()
{
mfMouseRegionsCreated_Drop = FALSE;
musStartX_Drop = musStartX;
musStartY_Drop = musStartY + DEF_SCROLL_ARROW_HEIGHT;
musScrollAreaX = musStartX_Drop + musWidth;
musDownArrowX = musUpArrowX;
musAreaHeight = mNumDisplayedEntries * (musFontHeight + 4);
musDownArrowY = musStartY_Drop + musAreaHeight - 24 + 2;
}
void * gDropObj;
void
DropDown::Create(UINT16 sX, UINT16 sY)
{
if( mfMouseRegionsCreated )
{
return Destroy();
}
Init(sX, sY);
VOBJECT_DESC VObjectDesc;
// Gold Arrow for the scroll area
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
FilenameForBPP( "LAPTOP\\GoldArrows.sti", VObjectDesc.ImageFile );
if ( !AddVideoObject( &VObjectDesc, &muiGoldArrowImages ) )
return;
gDropObj = (void*) this;
MSYS_DefineRegion( &mSelectedOpenDropDownRegion, musStartX + musWidth, musStartY, musStartX + musWidth + musArrowWidth, musStartY + DEF_SCROLL_ARROW_HEIGHT, MSYS_PRIORITY_HIGH,
CURSOR_WWW, MSYS_NO_CALLBACK, CallBackWrapper((void*) this, DROPDOWN_OPEN, &DropDown::Dummyfunc) );
MSYS_AddRegion(&mSelectedOpenDropDownRegion);
//click anywhere on the screen to close the window( only when the drop down window is active)
MSYS_DefineRegion( &mSelectedCloseDropDownRegion, LAPTOP_SCREEN_UL_X, LAPTOP_SCREEN_WEB_UL_Y , LAPTOP_SCREEN_LR_X, LAPTOP_SCREEN_WEB_LR_Y, MSYS_PRIORITY_HIGH-1,
CURSOR_LAPTOP_SCREEN, MSYS_NO_CALLBACK, CallBackWrapper((void*) this, DROPDOWN_CLOSE, &DropDown::Dummyfunc) );
MSYS_AddRegion(&mSelectedCloseDropDownRegion);
MSYS_DisableRegion(&mSelectedCloseDropDownRegion);
mfMouseRegionsCreated = TRUE;
}
void
DropDown::Create_Drop()
{
if( mfMouseRegionsCreated_Drop )
{
return Destroy_Drop();
}
Init_Drop();
UINT16 i;
UINT16 usPosX = musStartX_Drop;
UINT16 usPosY = musStartY_Drop;
UINT16 usHeight = 0;
for( i=0; i< DROPDOWN_REGIONS; ++i)
{
MSYS_DefineRegion( &mDropDownRegion[i], usPosX, (UINT16)(usPosY+4), (UINT16)(usPosX+musWidth-6), (UINT16)(usPosY+musFontHeight+7), MSYS_PRIORITY_HIGH,
CURSOR_WWW, CallBackWrapper((void*) this, DROPDOWN_MOVEMENT, &DropDown::Dummyfunc), CallBackWrapper((void*) this, DROPDOWN_REGION, &DropDown::Dummyfunc));
MSYS_AddRegion(&mDropDownRegion[i]);
MSYS_SetRegionUserData( &mDropDownRegion[ i ], 0, i);
usPosY += musFontHeight + 2;
}
usHeight = usPosY - musStartY_Drop + 10;
//create the scroll bars regions
//up arrow
usPosX = musUpArrowX;
usPosY = musUpArrowY;
for(i=0; i<2; ++i)
{
MSYS_DefineRegion( &mgSelectedUpDownArrowOnScrollAreaRegion[i], usPosX, usPosY, (UINT16)(usPosX+musWidth), (UINT16)(usPosY+DEF_SCROLL_ARROW_HEIGHT), MSYS_PRIORITY_HIGH,
CURSOR_WWW, MSYS_NO_CALLBACK, CallBackWrapper((void*) this, DROPDOWN_ARROW, &DropDown::Dummyfunc));
MSYS_AddRegion(&mgSelectedUpDownArrowOnScrollAreaRegion[i]);
MSYS_SetRegionUserData( &mgSelectedUpDownArrowOnScrollAreaRegion[ i ], 0, i);
usPosX = musDownArrowX;
usPosY = musDownArrowY;
}
//the scroll area itself
usPosX = musUpArrowX;
usPosY = musUpArrowY + DEF_SCROLL_ARROW_HEIGHT;
usHeight = ( musAreaHeight - DEF_SCROLL_ARROW_HEIGHT - 4 ) / (mNumDisplayedEntries);
for(i=0; i<DROPDOWN_REGIONS - 1; ++i)
{
MSYS_DefineRegion( &mSelectedScrollAreaDropDownRegion[i], usPosX, usPosY, (UINT16)(usPosX+musWidth), (UINT16)(usPosY+usHeight), MSYS_PRIORITY_HIGH+1,
CURSOR_LAPTOP_SCREEN, CallBackWrapper((void*) this, DROPDOWN_SCROLL_MOVEMENT, &DropDown::Dummyfunc), CallBackWrapper((void*) this, DROPDOWN_SCROLL_REGION, &DropDown::Dummyfunc));
MSYS_AddRegion(&mSelectedScrollAreaDropDownRegion[i]);
MSYS_SetRegionUserData( &mSelectedScrollAreaDropDownRegion[ i ], 0, i);
usPosY += usHeight;
}
//put the last one down to cover the remaining area
MSYS_DefineRegion( &mSelectedScrollAreaDropDownRegion[i], usPosX, usPosY, (UINT16)(usPosX+musWidth), musDownArrowY, MSYS_PRIORITY_HIGH+1,
CURSOR_LAPTOP_SCREEN, CallBackWrapper((void*) this, DROPDOWN_SCROLL_MOVEMENT, &DropDown::Dummyfunc), CallBackWrapper((void*) this, DROPDOWN_SCROLL_REGION, &DropDown::Dummyfunc));
MSYS_AddRegion(&mSelectedScrollAreaDropDownRegion[i]);
MSYS_SetRegionUserData( &mSelectedScrollAreaDropDownRegion[ i ], 0, i);
MSYS_EnableRegion(&mSelectedCloseDropDownRegion);
mfMouseRegionsCreated_Drop = TRUE;
}
void
DropDown::Destroy()
{
Destroy_Drop();
if( !mfMouseRegionsCreated )
return;
mfMouseRegionsCreated = FALSE;
MSYS_RemoveRegion( &mSelectedOpenDropDownRegion);
MSYS_RemoveRegion( &mSelectedCloseDropDownRegion);
DeleteVideoObjectFromIndex(muiGoldArrowImages);
SetRefresh();
}
void
DropDown::Destroy_Drop()
{
if( !mfMouseRegionsCreated_Drop )
return;
UINT8 i;
for( i=0; i< DROPDOWN_REGIONS; ++i)
MSYS_RemoveRegion( &mDropDownRegion[i]);
//destroy the scroll bar arrow regions
for( i=0; i< 2; ++i)
MSYS_RemoveRegion( &mgSelectedUpDownArrowOnScrollAreaRegion[i]);
//destroy the scroll bar regions
for( i=0; i<DROPDOWN_REGIONS; ++i)
MSYS_RemoveRegion( &mSelectedScrollAreaDropDownRegion[i]);
//disable the close region
MSYS_DisableRegion(&mSelectedCloseDropDownRegion);
mfMouseRegionsCreated_Drop = FALSE;
SetRefresh();
}
void
DropDown::Display()
{
if( !mfMouseRegionsCreated )
return;
HVOBJECT hArrowHandle;
//Display the background for the drop down window
ColorFillVideoSurfaceArea( FRAME_BUFFER, musStartX, musStartY, musStartX + musWidth + musArrowWidth, musStartY + DEF_SCROLL_ARROW_HEIGHT, Get16BPPColor( FROMRGB( 0, 0, 0 ) ) );
// top
Display2Line2ShadowHorizontal( musStartX, musStartY, musStartX + musWidth + musArrowWidth - 1, mColorLine, mColorLineShadow );
// left
Display2Line2ShadowVertical( musStartX, musStartY+2, musStartY + DEF_SCROLL_ARROW_HEIGHT - 1, mColorLine, mColorLineShadow );
// right between text and arrow
Display2Line2ShadowVertical( musStartX + musWidth - 4, musStartY+2, musStartY + DEF_SCROLL_ARROW_HEIGHT - 1, mColorLine, mColorLineShadow );
// bottom
Display2Line2ShadowHorizontal( musStartX, musStartY + DEF_SCROLL_ARROW_HEIGHT - 4, musStartX + musWidth + musArrowWidth - 1, mColorLine, mColorLineShadow );
// right
Display2Line2ShadowVertical( musStartX + musWidth + musArrowWidth - 4, musStartY, musStartY + DEF_SCROLL_ARROW_HEIGHT - 3, mColorLine, mColorLineShadow );
DrawTopEntry();
//get and display the up and down arrows
GetVideoObject(&hArrowHandle, muiGoldArrowImages);
//top arrow
BltVideoObject(FRAME_BUFFER, hArrowHandle, 0, musUpArrowX, musUpArrowY, VO_BLT_SRCTRANSPARENCY,NULL);
InvalidateRegion(LAPTOP_SCREEN_UL_X,LAPTOP_SCREEN_WEB_UL_Y,LAPTOP_SCREEN_LR_X,LAPTOP_SCREEN_WEB_LR_Y);
// display dropped region if necessary
Display_Drop();
}
void
DropDown::Display_Drop()
{
if( !mfMouseRegionsCreated_Drop )
return;
HVOBJECT hArrowHandle;
//Display the background for the drop down window
ColorFillVideoSurfaceArea( FRAME_BUFFER, musStartX_Drop, musStartY_Drop, musStartX_Drop+musWidth+musArrowWidth, musStartY_Drop+musAreaHeight, Get16BPPColor( FROMRGB( 0, 0, 0 ) ) );
// top
Display2Line2ShadowHorizontal( musStartX_Drop, musStartY_Drop-4, musStartX_Drop + musWidth + musArrowWidth - 1, mColorLine, mColorLineShadow );
// left
Display2Line2ShadowVertical( musStartX_Drop, musStartY_Drop-2, musStartY_Drop + musAreaHeight - 1, mColorLine, mColorLineShadow );
// right between text and arrow
Display2Line2ShadowVertical( musStartX_Drop + musWidth - 4, musStartY_Drop-2, musStartY_Drop + musAreaHeight - 1, mColorLine, mColorLineShadow );
// bottom
Display2Line2ShadowHorizontal( musStartX_Drop, musStartY_Drop + musAreaHeight - 4, musStartX_Drop + musWidth + musArrowWidth - 1, mColorLine, mColorLineShadow );
// right
Display2Line2ShadowVertical( musStartX_Drop + musWidth + musArrowWidth - 4, musStartY_Drop-4, musStartY_Drop + musAreaHeight - 3, mColorLine, mColorLineShadow );
DrawSelectedCity();
//get and display the up and down arrows
GetVideoObject(&hArrowHandle, muiGoldArrowImages);
// top arrow
BltVideoObject(FRAME_BUFFER, hArrowHandle, 1, musUpArrowX, musUpArrowY, VO_BLT_SRCTRANSPARENCY,NULL);
// down arrow
BltVideoObject(FRAME_BUFFER, hArrowHandle, 0, musDownArrowX, musDownArrowY, VO_BLT_SRCTRANSPARENCY,NULL);
//display the scroll rectangle
DrawGoldRectangle();
InvalidateRegion(LAPTOP_SCREEN_UL_X,LAPTOP_SCREEN_WEB_UL_Y,LAPTOP_SCREEN_LR_X,LAPTOP_SCREEN_WEB_LR_Y);
}
void
DropDown::DrawTopEntry()
{
if ( mSelectedEntry >= mEntryVector.size() )
return;
//display the name in the list
ColorFillVideoSurfaceArea( FRAME_BUFFER, musStartX+4, musStartY+4, musStartX+musWidth-4, musStartY+musFontHeight+8, mColorMarked );
SetFontShadow(NO_SHADOW);
DrawTextToScreen( mEntryVector[mSelectedEntry].second, musStartX+CITY_NAME_OFFSET, (UINT16)(musStartY+7), 0, DEF_DROPDOWN_FONT, FONT_BLACK, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );;
SetFontShadow(DEFAULT_SHADOW);
}
void
DropDown::DrawSelectedCity()
{
UINT16 usPosY = musStartY_Drop;
// make sure we dont go out of our array
if( mFirstShownEntry+mNumDisplayedEntries > (UINT8)(mEntryVector.size() ) )
mFirstShownEntry = mEntryVector.size() - mNumDisplayedEntries;
for( UINT8 i = mFirstShownEntry; i < mFirstShownEntry+mNumDisplayedEntries; ++i)
{
if ( i == mSelectedEntry )
{
ColorFillVideoSurfaceArea( FRAME_BUFFER, musStartX_Drop+4, usPosY-2, musStartX_Drop+musWidth-4, usPosY+musFontHeight+2, mColorMarked );
SetFontShadow(NO_SHADOW);
DrawTextToScreen( mEntryVector[i].second, musStartX_Drop+CITY_NAME_OFFSET, usPosY, 0, DEF_DROPDOWN_FONT, FONT_BLACK, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
SetFontShadow(DEFAULT_SHADOW);
}
else
{
ColorFillVideoSurfaceArea( FRAME_BUFFER, musStartX_Drop+4, usPosY-2, musStartX_Drop+musWidth-4, usPosY+musFontHeight+2, Get16BPPColor( FROMRGB( 0, 0, 0 ) ) );
DrawTextToScreen( mEntryVector[i].second, musStartX_Drop+CITY_NAME_OFFSET, usPosY, 0, DEF_DROPDOWN_FONT, STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
}
usPosY += musFontHeight + 4;
}
}
void
DropDown::DrawGoldRectangle()
{
UINT32 uiDestPitchBYTES;
UINT8 *pDestBuf;
UINT16 usWidth, usTempHeight, usTempPosY, usHeight;
UINT16 usPosX, usPosY;
UINT16 temp;
usTempPosY = musStartY;
usTempPosY += DEF_SCROLL_ARROW_HEIGHT;
usPosX = musScrollAreaX;
usWidth = musArrowWidth - 5;
usTempHeight = ( musAreaHeight - DEF_SCROLL_ARROW_HEIGHT ) - 4;
usHeight = usTempHeight / (mEntryVector.size() - 1);
usPosY = usTempPosY + (UINT16)( ( usHeight * mSelectedEntry ) );
temp = musStartY_Drop + musAreaHeight - DEF_SCROLL_ARROW_HEIGHT - usHeight;
if( usPosY >= temp )
usPosY = musStartY_Drop + musAreaHeight - DEF_SCROLL_ARROW_HEIGHT - usHeight - 5;
// color everything black and then color te rectangle, that way we dont have to redraw the entire page
ColorFillVideoSurfaceArea( FRAME_BUFFER, musScrollAreaX, usTempPosY, musScrollAreaX+usWidth, usTempPosY+usTempHeight, Get16BPPColor( FROMRGB( 0, 0, 0 ) ) );
ColorFillVideoSurfaceArea( FRAME_BUFFER, musScrollAreaX, usPosY, musScrollAreaX+usWidth, usPosY+usHeight, mColorMarked );
//display the line
pDestBuf = LockVideoSurface( FRAME_BUFFER, &uiDestPitchBYTES );
SetClippingRegionAndImageWidth( uiDestPitchBYTES, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
// draw the gold highlite line on the top and left
LineDraw(FALSE, usPosX, usPosY, usPosX+usWidth, usPosY, mColorHighLight, pDestBuf);
LineDraw(FALSE, usPosX, usPosY, usPosX, usPosY+usHeight, mColorHighLight, pDestBuf);
// draw the shadow line on the bottom and right
LineDraw(FALSE, usPosX, usPosY+usHeight, usPosX+usWidth, usPosY+usHeight, mColorLineShadow, pDestBuf);
LineDraw(FALSE, usPosX+usWidth, usPosY, usPosX+usWidth, usPosY+usHeight, mColorLineShadow, pDestBuf);
// unlock frame buffer
UnLockVideoSurface( FRAME_BUFFER );
}
void
DropDown::SelectDropDownMovementCallBack(MOUSE_REGION * pRegion, INT32 reason )
{
if( reason & MSYS_CALLBACK_REASON_LOST_MOUSE )
{
pRegion->uiFlags &= (~BUTTON_CLICKED_ON );
InvalidateRegion(pRegion->RegionTopLeftX, pRegion->RegionTopLeftY, pRegion->RegionBottomRightX, pRegion->RegionBottomRightY);
}
else if( reason & MSYS_CALLBACK_REASON_GAIN_MOUSE )
{
pRegion->uiFlags |= BUTTON_CLICKED_ON ;
mSelectedEntry = (UINT8)MSYS_GetRegionUserData( pRegion, 0 ) + mFirstShownEntry;
InvalidateRegion(pRegion->RegionTopLeftX, pRegion->RegionTopLeftY, pRegion->RegionBottomRightX, pRegion->RegionBottomRightY);
DrawTopEntry();
DrawSelectedCity();
DrawGoldRectangle();
}
}
void
DropDown::SelectDropDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason )
{
if (iReason & MSYS_CALLBACK_REASON_INIT)
{
}
else if (iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
{
UINT8 ubSelected = (UINT8)MSYS_GetRegionUserData( pRegion, 0 );
mSelectedEntry = min(ubSelected + mFirstShownEntry, mEntryVector.size() -1) ;
Destroy_Drop();
}
}
void
DropDown::SelectUpDownArrowOnScrollAreaRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason )
{
if (iReason & MSYS_CALLBACK_REASON_INIT)
{
}
else if( iReason & MSYS_CALLBACK_REASON_LBUTTON_UP || iReason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
{
UINT8 ubDownArrow = (UINT8)MSYS_GetRegionUserData( pRegion, 0 );
if( ubDownArrow )
{
if( mSelectedEntry < mEntryVector.size() - 1 )
{
mSelectedEntry++;
}
if( ( mSelectedEntry - mFirstShownEntry ) >= mNumDisplayedEntries && mFirstShownEntry <= mEntryVector.size() - 1 - mNumDisplayedEntries )
{
mFirstShownEntry++;
}
}
else
{
if( mSelectedEntry > 0 )
mSelectedEntry--;
if( mSelectedEntry < mFirstShownEntry )
mFirstShownEntry--;
}
DrawTopEntry();
DrawSelectedCity();
DrawGoldRectangle();
}
}
void
DropDown::SelectScrollAreaDropDownMovementCallBack(MOUSE_REGION * pRegion, INT32 reason )
{
if( reason & MSYS_CALLBACK_REASON_LOST_MOUSE )
{
pRegion->uiFlags &= (~BUTTON_CLICKED_ON );
InvalidateRegion(pRegion->RegionTopLeftX, pRegion->RegionTopLeftY, pRegion->RegionBottomRightX, pRegion->RegionBottomRightY);
}
else if (reason & MSYS_CALLBACK_REASON_GAIN_MOUSE )
{
if( gfLeftButtonState )
{
UINT8 ubCityNum = (UINT8)MSYS_GetRegionUserData( pRegion, 0 );
pRegion->uiFlags |= BUTTON_CLICKED_ON;
if( mFirstShownEntry + ubCityNum < mSelectedEntry )
{
mSelectedEntry = max(mFirstShownEntry + ubCityNum, 0);
if( ubCityNum == 0 )
mFirstShownEntry = max(mFirstShownEntry - 1, 0);
}
else if( mFirstShownEntry + ubCityNum > mSelectedEntry )
{
mSelectedEntry = min(mFirstShownEntry + ubCityNum, mEntryVector.size() - 1);
if ( ubCityNum == mNumDisplayedEntries - 1 )
mFirstShownEntry = min(mFirstShownEntry + 1, mEntryVector.size() - 1);
}
InvalidateRegion(pRegion->RegionTopLeftX, pRegion->RegionTopLeftY, pRegion->RegionBottomRightX, pRegion->RegionBottomRightY);
DrawTopEntry();
DrawSelectedCity();
DrawGoldRectangle();
}
}
}
void
DropDown::SelectScrollAreaDropDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason )
{
if (iReason & MSYS_CALLBACK_REASON_INIT)
{
}
else if (iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
{
UINT8 ubCityNum = (UINT8)MSYS_GetRegionUserData( pRegion, 0 );
if( ubCityNum < mSelectedEntry )
{
mSelectedEntry--;
if( mSelectedEntry < mFirstShownEntry )
mFirstShownEntry--;
}
else if( ubCityNum > mSelectedEntry )
{
mSelectedEntry++;
if( ( mSelectedEntry - mFirstShownEntry ) >= mNumDisplayedEntries )
mFirstShownEntry++;
}
DrawTopEntry();
DrawSelectedCity();
DrawGoldRectangle();
}
else if (iReason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT)
{
UINT8 ubCityNum = (UINT8)MSYS_GetRegionUserData( pRegion, 0 );
pRegion->uiFlags |= BUTTON_CLICKED_ON ;
if( ubCityNum < mSelectedEntry )
{
mSelectedEntry--;
if( mSelectedEntry < mFirstShownEntry )
mFirstShownEntry--;
}
else if( ubCityNum > mSelectedEntry )
{
mSelectedEntry++;
if( ( mSelectedEntry - mFirstShownEntry ) >= mNumDisplayedEntries )
mFirstShownEntry++;
}
InvalidateRegion(pRegion->RegionTopLeftX, pRegion->RegionTopLeftY, pRegion->RegionBottomRightX, pRegion->RegionBottomRightY);
DrawTopEntry();
DrawSelectedCity();
DrawGoldRectangle();
}
}
void
DropDown::OpenDropDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason )
{
if (iReason & MSYS_CALLBACK_REASON_INIT)
{
}
else if (iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
{
Create_Drop();
Display_Drop();
}
}
void
DropDown::CloseDropDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason )
{
if (iReason & MSYS_CALLBACK_REASON_INIT)
{
}
else if (iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
{
Destroy_Drop();
}
}
+278
View File
@@ -0,0 +1,278 @@
#ifndef __DROPDOWN_H
#define __DROPDOWN_H
/**
* @file
* @author Flugente (bears-pit.com)
*/
#include "LaptopSave.h"
/*
* helpful draw functions that used to draw the boundaries of the dropdown. The old way of adding sti objects to paint boundaries is... lets say, inefficient
*/
void DisplaySmallLine( UINT16 usStartX, UINT16 usStartY, UINT16 EndX, UINT16 EndY, UINT16 usColor );
void Display2Line2ShadowVertical( UINT16 usStartX, UINT16 usStartY, UINT16 EndX, UINT16 usColor1, UINT16 usColor2 );
void Display2Line2ShadowHorizontal( UINT16 usStartX, UINT16 usStartY, UINT16 EndY, UINT16 usColor1, UINT16 usColor2 );
// the maximum number of entries that can be shown at once. Increase requires recompilation!
#define DROPDOWN_REGIONS 8
/*
* As we cannot directly add our callbacks (we need a static callback due to the way MSYS_DefineRegion(...) works, which utterly fails if we have multiple instance of a class) we
* use a very odd looking workaround.
* For every DropDown you need, you have to inherit from this class and fill CallBackWrapper(...). You then need a static pointer to an instance of your class, and a wrapper for each callback
* that will then call the correct callback. The derived class will also have to be a singleton, otherwise callbacks for multiple instances will always refer to the last created one.
* This seems a lot of work and pretty absurd, but I've found no better workaround without changing MSYS_DefineRegion(), as it expects a MOUSE_CALLBACK and not voi* pointers to objects.
* On the plus side, you can simply copy this code:
Definition:
class DropDown_Example : public DropDown
{
public:
static DropDown_Example& getInstance()
{
static DropDown_Example instance; // Guaranteed to be destroyed.
// Instantiated on first use.
return instance;
}
virtual MOUSE_CALLBACK CallBackWrapper(void* pt2Object, UINT8 arg, void (*pt2Function)(MOUSE_REGION * pRegion, INT32 iReason) );
//somehow refresh display, otherwise DropDownA will write over itself and other stuff
// this function has to be implemented!
virtual void SetRefresh()
{
// do stuff here...
}
private:
DropDown_Example() {}; // private constructor, so we cannot create more instances
// declare but don't define
DropDown_Example(DropDown_Example const&);
void operator=(DropDown_Example const&);
};
Declaration:
void * gPtrDropDown_Example;
void OpenDropDown_Example(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast<DropDown*>(gPtrDropDown_Example)->OpenDropDownRegionCallBack(pRegion, iReason); }
void CloseDropDown_Example(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast<DropDown*>(gPtrDropDown_Example)->CloseDropDownRegionCallBack(pRegion, iReason); }
void SelectRegionDropDown_Example(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast<DropDown*>(gPtrDropDown_Example)->SelectDropDownRegionCallBack(pRegion, iReason); }
void SelectMovementDropDown_Example(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast<DropDown*>(gPtrDropDown_Example)->SelectDropDownMovementCallBack(pRegion, iReason); }
void SelectArrowDropDown_Example(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast<DropDown*>(gPtrDropDown_Example)->SelectUpDownArrowOnScrollAreaRegionCallBack(pRegion, iReason); }
void SelectScrollRegionDropDown_Example(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast<DropDown*>(gPtrDropDown_Example)->SelectScrollAreaDropDownRegionCallBack(pRegion, iReason); }
void SelectScrollMovementDropDown_Example(MOUSE_REGION * pRegion, INT32 iReason ) { return static_cast<DropDown*>(gPtrDropDown_Example)->SelectScrollAreaDropDownMovementCallBack(pRegion, iReason); }
MOUSE_CALLBACK
DropDown_Example::CallBackWrapper(void* pt2Object, UINT8 arg, void (*pt2Function)(MOUSE_REGION * pRegion, INT32 iReason) )
{
gPtrDropDown_Example = pt2Object;
switch ( arg )
{
case DROPDOWN_OPEN:
return &OpenDropDown_Example;
break;
case DROPDOWN_CLOSE:
return &CloseDropDown_Example;
break;
case DROPDOWN_REGION:
return &SelectRegionDropDown_Example;
break;
case DROPDOWN_MOVEMENT:
return &SelectMovementDropDown_Example;
break;
case DROPDOWN_ARROW:
return &SelectArrowDropDown_Example;
break;
case DROPDOWN_SCROLL_REGION:
return &SelectScrollRegionDropDown_Example;
break;
case DROPDOWN_SCROLL_MOVEMENT:
return &SelectScrollMovementDropDown_Example;
break;
}
return *pt2Function;
}
Usage:
std::vector<std::pair<INT16, STR16> > entryvecDropDown_Appearance;
for(UINT8 i = 0; i < NUM_APPEARANCES; ++i)
entryvecDropDown_Appearance.push_back( std::make_pair<INT16, STR16>(i, szAppearanceText[i]) );
DropDown_Appearance::getInstance().SetEntries(entryvecDropDown_Appearance);
DropDown_Appearance::getInstance().Create(usX, usY);
...
*/
class DropDown
{
public:
DropDown();
/*
* Create a Dropdown with upper left coordinates
*/
void Create(UINT16 sX, UINT16 sY);
/*
* Destroy Dropdown, for example once a webiste isn't displayed anymore
*/
void Destroy();
/*
* Display DropDown. Use this when refreshing
*/
void Display();
/*
* Sometimes a refresh inside the class isn't enough - best example is closing the dropdown area, after whcih te previous background cannot be restored by this class.
* In that case, the background and this class has to be redrawn.
* This function is called internally whenver such a refreh is necessary.
* It has to be defined in derived classes and should notify your dialogues to redraw at apporpiate times
*
* This function has to be implemented!
*/
virtual void SetRefresh() = 0;
// internal callback types
enum {
DROPDOWN_OPEN = 0,
DROPDOWN_CLOSE,
DROPDOWN_REGION,
DROPDOWN_MOVEMENT,
DROPDOWN_ARROW,
DROPDOWN_SCROLL_REGION,
DROPDOWN_SCROLL_MOVEMENT,
};
// call to open/close the drop down
void OpenDropDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason );
void CloseDropDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason );
void SelectDropDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason );
void SelectDropDownMovementCallBack(MOUSE_REGION * pRegion, INT32 iReason );
void SelectUpDownArrowOnScrollAreaRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason );
void SelectScrollAreaDropDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason );
void SelectScrollAreaDropDownMovementCallBack(MOUSE_REGION * pRegion, INT32 iReason );
/*
* This function has to be implemented, see documetnation as to why and how!
*/
virtual MOUSE_CALLBACK CallBackWrapper(void* pt2Object, UINT8 arg, void (*pt2Function)(MOUSE_REGION * pRegion, INT32 iReason) ) = 0;
/*
* Set the content of a dropdown. Each entry consists of an INT16 key, by which you can later identify which entry was selected, and a STR16 that will be displayed.
* There can be multiple instances of the same key or name.
*/
void SetEntries( std::vector<std::pair<INT16, STR16> >& arEntryVec ) { mEntryVector = arEntryVec; }
/*
* Set Color of boundary line
*/
void SetColorLine( UINT16 aCol ) { mColorLine = aCol; }
/*
* Set Color of boundary line shadow
*/
void SetColorLineShadow( UINT16 aCol ) { mColorLineShadow = aCol; }
/*
* Set background color of selected entry
*/
void SetColorMarked( UINT16 aCol ) { mColorMarked = aCol; }
/*
* Set Color of highlight of the scrollbar mover
*/
void SetColorHighLight( UINT16 aCol ) { mColorHighLight = aCol; }
/*
* Get key of selected entry
*/
INT16 GetSelectedEntryKey() { return mEntryVector[mSelectedEntry].first; }
/*
* Get width of entire DropDown
*/
UINT16 GetTotalWidth() { return musWidth + musArrowWidth; }
/*
* Get right x coordinate
*/
UINT16 GetLastX() { return musStartX + GetTotalWidth(); }
private:
// declare but don't define
DropDown(DropDown const&);
void operator=(DropDown const&);
/*
* Initialise variables. Called after each creationm which allows moving a dropdown
*/
void Init(UINT16 sX, UINT16 sY);
/*
* Functions exclusively for the dropdown region, which is only shown after user interaction
*/
void Create_Drop();
void Init_Drop();
void Display_Drop();
void Destroy_Drop();
/*
* This dummy is needed internally and does nothing when called
*/
static void Dummyfunc(MOUSE_REGION * pRegion, INT32 iReason ) {}
void DrawTopEntry();
void DrawSelectedCity();
void DrawGoldRectangle();
private:
UINT16 musHeight;
UINT16 musWidth;
UINT16 musStartX;
UINT16 musStartY;
UINT16 musStartX_Drop;
UINT16 musStartY_Drop;
UINT16 musScrollAreaX;
UINT16 musUpArrowX;
UINT16 musUpArrowY;
UINT16 musDownArrowX;
UINT16 musDownArrowY;
UINT16 musArrowWidth;
UINT16 musAreaHeight;
UINT16 musFontHeight;
UINT16 mColorLine; // color of boundary lines
UINT16 mColorLineShadow; // color of boundary line shadows
UINT16 mColorMarked; // color of marked entries
UINT16 mColorHighLight; // color of bar highlighting
BOOLEAN mfMouseRegionsCreated;
BOOLEAN mfMouseRegionsCreated_Drop;
MOUSE_REGION mSelectedOpenDropDownRegion;
MOUSE_REGION mSelectedCloseDropDownRegion;
MOUSE_REGION mDropDownRegion[DROPDOWN_REGIONS];
MOUSE_REGION mgSelectedUpDownArrowOnScrollAreaRegion[2];
MOUSE_REGION mSelectedScrollAreaDropDownRegion[DROPDOWN_REGIONS];
UINT32 muiGoldArrowImages;
std::vector<std::pair<INT16, STR16> > mEntryVector;
UINT8 mSelectedEntry; // keeps track of the currently selected city
UINT8 mFirstShownEntry; // top entry of the dropped region
UINT8 mNumDisplayedEntries; // number of entries displayed. Calculated internally, no need to change by user
};
#endif
+12
View File
@@ -176,6 +176,18 @@ void CreateACharacterFromPlayerEnteredStats( void )
// Flugente: background
gMercProfiles[ LaptopSaveInfo.iIMPIndex ].usBackground = ( INT8 )usBackground;
// Flugente: sexism, racsim etc.
gMercProfiles[ LaptopSaveInfo.iIMPIndex ].bRace = ( INT8 )bRace;
gMercProfiles[ LaptopSaveInfo.iIMPIndex ].bNationality = ( INT8 )bNationality;
gMercProfiles[ LaptopSaveInfo.iIMPIndex ].bAppearance = ( INT8 )bAppearance;
gMercProfiles[ LaptopSaveInfo.iIMPIndex ].bAppearanceCareLevel = ( INT8 )bAppearanceCareLevel;
gMercProfiles[ LaptopSaveInfo.iIMPIndex ].bRefinement = ( INT8 )bRefinement;
gMercProfiles[ LaptopSaveInfo.iIMPIndex ].bRefinementCareLevel = ( INT8 )bRefinementCareLevel;
gMercProfiles[ LaptopSaveInfo.iIMPIndex ].bHatedNationality = ( INT8 )bHatedNationality;
gMercProfiles[ LaptopSaveInfo.iIMPIndex ].bHatedNationalityCareLevel = ( INT8 )bHatedNationalityCareLevel;
gMercProfiles[ LaptopSaveInfo.iIMPIndex ].bRacist = ( INT8 )bRacist;
gMercProfiles[ LaptopSaveInfo.iIMPIndex ].bSexist = ( UINT8 )bSexist;
// WDS: Advanced start
//gMercProfiles[ LaptopSaveInfo.iIMPIndex ].bExpLevel = gGameExternalOptions.ubIMPStartingLevel;
gMercProfiles[ LaptopSaveInfo.iIMPIndex ].bExpLevel = StartingLevelChosen(); // We now choose the starting level on IMP creation - SANDRO
+5 -10
View File
@@ -501,24 +501,19 @@ void BtnIMPMinorTraitFinishCallback(GUI_BUTTON *btn,INT32 reason)
//go back tot he done screen
iCurrentImpPage = IMP_FINISH;
}
// Flugente: setting determines wether we see the background page
else if ( gGameOptions.fBackGround )
{
iCurrentImpPage = IMP_BACKGROUND;
fButtonPendingFlag = TRUE;
}
else
{
iCurrentImpPage = IMP_MAIN_PAGE;
iCurrentImpPage = IMP_PREJUDICE;
if( CameBackToMinorTraitPageButNotFinished() )
{
}
else
{
//We are finished on this page
iCurrentProfileMode = IMP__ATTRIBUTES;
if ( iCurrentProfileMode != IMP__FINISH )
iCurrentProfileMode = IMP__PERSONALITY;
else
iCurrentProfileMode = IMP__FINISH;
}
}
}
File diff suppressed because it is too large Load Diff
+12
View File
@@ -0,0 +1,12 @@
#ifndef __IMP_PREJUDICE__H_
#define __IMP_PREJUDICE__H_
#include "Types.h"
#include "mousesystem.h"
void EnterIMPPrejudice( void );
void RenderIMPPrejudice( void );
void ExitIMPPrejudice( void );
void HandleIMPPrejudice( void );
#endif
+17 -1
View File
@@ -418,6 +418,10 @@
RelativePath=".\CharProfile.h"
>
</File>
<File
RelativePath=".\DropDown.h"
>
</File>
<File
RelativePath=".\email.h"
>
@@ -546,6 +550,10 @@
RelativePath=".\IMP Portraits.h"
>
</File>
<File
RelativePath=".\IMP Prejudice.h"
>
</File>
<File
RelativePath=".\IMP Skill Trait.h"
>
@@ -716,6 +724,10 @@
RelativePath=".\CharProfile.cpp"
>
</File>
<File
RelativePath=".\DropDown.cpp"
>
</File>
<File
RelativePath=".\email.cpp"
>
@@ -777,7 +789,7 @@
>
</File>
<File
RelativePath="IMP Background.cpp"
RelativePath=".\IMP Background.cpp"
>
</File>
<File
@@ -840,6 +852,10 @@
RelativePath=".\IMP Portraits.cpp"
>
</File>
<File
RelativePath=".\IMP Prejudice.cpp"
>
</File>
<File
RelativePath=".\IMP Skill Trait.cpp"
>
+16
View File
@@ -418,6 +418,10 @@
RelativePath="CharProfile.h"
>
</File>
<File
RelativePath="DropDown.h"
>
</File>
<File
RelativePath="email.h"
>
@@ -546,6 +550,10 @@
RelativePath="IMP Portraits.h"
>
</File>
<File
RelativePath="IMP Prejudice.h"
>
</File>
<File
RelativePath="IMP Skill Trait.h"
>
@@ -714,6 +722,10 @@
RelativePath="CharProfile.cpp"
>
</File>
<File
RelativePath="DropDown.cpp"
>
</File>
<File
RelativePath="email.cpp"
>
@@ -842,6 +854,10 @@
RelativePath="IMP Portraits.cpp"
>
</File>
<File
RelativePath="IMP Prejudice.cpp"
>
</File>
<File
RelativePath="IMP Skill Trait.cpp"
>
+4
View File
@@ -43,6 +43,7 @@
<ClInclude Include="BriefingRoomM.h" />
<ClInclude Include="BrokenLink.h" />
<ClInclude Include="CharProfile.h" />
<ClInclude Include="DropDown.h" />
<ClInclude Include="email.h" />
<ClInclude Include="Encyclopedia.h" />
<ClInclude Include="Encyclopedia_Data.h" />
@@ -75,6 +76,7 @@
<ClInclude Include="IMP Personality Finish.h" />
<ClInclude Include="IMP Personality Quiz.h" />
<ClInclude Include="IMP Portraits.h" />
<ClInclude Include="IMP Prejudice.h" />
<ClInclude Include="IMP Skill Trait.h" />
<ClInclude Include="IMP Text System.h" />
<ClInclude Include="IMP Voices.h" />
@@ -118,6 +120,7 @@
<ClCompile Include="BriefingRoomM.cpp" />
<ClCompile Include="BrokenLink.cpp" />
<ClCompile Include="CharProfile.cpp" />
<ClCompile Include="DropDown.cpp" />
<ClCompile Include="email.cpp" />
<ClCompile Include="Encyclopedia.cpp" />
<ClCompile Include="Encyclopedia_Data.cpp" />
@@ -150,6 +153,7 @@
<ClCompile Include="IMP Personality Finish.cpp" />
<ClCompile Include="IMP Personality Quiz.cpp" />
<ClCompile Include="IMP Portraits.cpp" />
<ClCompile Include="IMP Prejudice.cpp" />
<ClCompile Include="IMP Skill Trait.cpp" />
<ClCompile Include="IMP Text System.cpp" />
<ClCompile Include="IMP Voices.cpp" />
+12
View File
@@ -228,6 +228,12 @@
<ClInclude Include="IMP Background.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="IMP Prejudice.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="DropDown.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="aim.cpp">
@@ -467,5 +473,11 @@
<ClCompile Include="IMP Background.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="IMP Prejudice.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="DropDown.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
+73
View File
@@ -465,6 +465,9 @@ void AssignPersonnelAchievementsHelpText( INT32 IMercId );
void AssignPersonnelWoundsHelpText( INT32 IMercId );
INT8 CalculateMercsAchievemntPercentage( INT32 IMercId );
// Flugente: personality info
void AssignPersonalityHelpText( SOLDIERTYPE* pSoldier, MOUSE_REGION* pMouseregion );
BOOLEAN fShowRecordsIfZero = TRUE;
void GameInitPersonnel( void )
@@ -1714,6 +1717,38 @@ void DisplayCharStats(INT32 iId, INT32 iSlot)
break;
// Added by Flugente
case 17:
// sexism, racism, nationalities etc.
{
UINT8 loc = 22;
UINT8 regionnr = 8;
mprintf((INT16)(pPersonnelScreenPoints[loc].x+(iSlot*TEXT_BOX_WIDTH)),(pPersonnelScreenPoints[loc].y + 15), L"Personality:");
swprintf(sString, L"->");
FindFontRightCoordinates((INT16)(pPersonnelScreenPoints[loc].x+(iSlot*TEXT_BOX_WIDTH)),0,TEXT_BOX_WIDTH-20,0,sString, PERS_FONT, &sX, &sY);
mprintf(sX,(pPersonnelScreenPoints[loc].y + 15),sString);
// Add specific region for fast help window
if( fAddedTraitRegion[regionnr] )
{
MSYS_RemoveRegion( &gSkillTraitHelpTextRegion[regionnr] );
}
MSYS_DefineRegion( &gSkillTraitHelpTextRegion[regionnr], ( sX - 3 ), (UINT16)( pPersonnelScreenPoints[loc].y + 15),
( sX + StringPixLength(sString,PERS_FONT) + 3 ), (UINT16)( pPersonnelScreenPoints[loc].y + 23 ), MSYS_PRIORITY_HIGH,
MSYS_NO_CURSOR, MSYS_NO_CALLBACK, NULL );
MSYS_AddRegion( &gSkillTraitHelpTextRegion[regionnr] );
fAddedTraitRegion[regionnr] = TRUE;
// assign bubblehelp text
AssignPersonalityHelpText( pSoldier, &(gSkillTraitHelpTextRegion[regionnr]) );
}
break;
/////////////////////////////////////////////////////////////////////////
// Added by SANDRO
case 15:
@@ -8719,3 +8754,41 @@ INT8 CalculateMercsAchievemntPercentage( INT32 IMercId )
else
return( 0 );
}
// Flugente: personality info
void AssignPersonalityHelpText( SOLDIERTYPE* pSoldier, MOUSE_REGION* pMouseregion )
{
CHAR16 apStr[ 4500 ];
CHAR16 atStr[ 260 ];
swprintf( apStr, L"" );
if ( pSoldier )
{
swprintf(atStr, L"- You look %s and appearance is %s important to you.\n", szAppearanceText[gMercProfiles[ pSoldier->ubProfile ].bAppearance], szCareLevelText[gMercProfiles[ pSoldier->ubProfile ].bAppearanceCareLevel] );
wcscat( apStr, atStr );
swprintf(atStr, L"- You have %s and care %s about that.\n", szRefinementText[gMercProfiles[ pSoldier->ubProfile ].bRefinement], szCareLevelText[gMercProfiles[ pSoldier->ubProfile ].bRefinementCareLevel] );
wcscat( apStr, atStr );
if ( gMercProfiles[ pSoldier->ubProfile ].bHatedNationality < 0 )
swprintf(atStr, L"- You are %s and %s\n", szNationalityText[gMercProfiles[ pSoldier->ubProfile ].bNationality], szNationalityText_Special[0] );
else
swprintf(atStr, L"- You are %s and hate everyone %s %s.\n", szNationalityText[gMercProfiles[ pSoldier->ubProfile ].bNationality], szNationalityText[gMercProfiles[ pSoldier->ubProfile ].bHatedNationality], szCareLevelText[gMercProfiles[ pSoldier->ubProfile ].bHatedNationalityCareLevel] );
wcscat( apStr, atStr );
swprintf(atStr, L"- You are %s racist against non-%s people.\n", szRacistText[gMercProfiles[ pSoldier->ubProfile ].bRacist], szRaceText[gMercProfiles[ pSoldier->ubProfile ].bRace] );
wcscat( apStr, atStr );
swprintf(atStr, L"- You are %s.\n", szSexistText[gMercProfiles[ pSoldier->ubProfile ].bSexist] );
wcscat( apStr, atStr );
}
else
return;
// Set region help text
SetRegionFastHelpText( pMouseregion, apStr );
SetRegionHelpEndCallback( pMouseregion, MSYS_NO_CALLBACK );
return;
}
+133 -2
View File
@@ -1095,12 +1095,143 @@ void HourlyMoraleUpdate( void )
bOpinion = 0;
}
// Flugente: evaluate appearance/refinement/hated nationalities
// some people loathe ugly people and like beautiful people. It's a mean world.
// we also handle sexism here
switch ( gMercProfiles[ pOtherSoldier->ubProfile ].bAppearance )
{
case APPEARANCE_UGLY:
{
if ( pProfile->bAppearanceCareLevel == CARELEVEL_SOME )
bOpinion -= gGameExternalOptions.sMoraleModAppearance * 2;
else if ( pProfile->bAppearanceCareLevel == CARELEVEL_EXTREME )
bOpinion -= gGameExternalOptions.sMoraleModAppearance * 4;
// some people are sexists
if ( pProfile->bSexist && gMercProfiles[ pOtherSoldier->ubProfile ].bSex != pProfile->bSex )
{
if ( pProfile->bSexist == SOMEWHAT_SEXIST )
bOpinion -= gGameExternalOptions.sMoraleModSexism * 2;
else if ( pProfile->bSexist == VERY_SEXIST )
bOpinion -= gGameExternalOptions.sMoraleModSexism * 4;
}
}
break;
case APPEARANCE_HOMELY:
{
if ( pProfile->bAppearanceCareLevel == CARELEVEL_SOME )
bOpinion -= gGameExternalOptions.sMoraleModAppearance;
else if ( pProfile->bAppearanceCareLevel == CARELEVEL_EXTREME )
bOpinion -= gGameExternalOptions.sMoraleModAppearance * 2;
// some people are sexists
if ( pProfile->bSexist && gMercProfiles[ pOtherSoldier->ubProfile ].bSex != pProfile->bSex )
{
if ( pProfile->bSexist == SOMEWHAT_SEXIST )
bOpinion -= gGameExternalOptions.sMoraleModSexism;
else if ( pProfile->bSexist == VERY_SEXIST )
bOpinion -= gGameExternalOptions.sMoraleModSexism * 2;
}
}
break;
case APPEARANCE_ATTRACTIVE:
{
if ( pProfile->bAppearanceCareLevel == CARELEVEL_SOME )
bOpinion += gGameExternalOptions.sMoraleModAppearance;
else if ( pProfile->bAppearanceCareLevel == CARELEVEL_EXTREME )
bOpinion += gGameExternalOptions.sMoraleModAppearance * 2;
// some people are sexists
if ( pProfile->bSexist && gMercProfiles[ pOtherSoldier->ubProfile ].bSex != pProfile->bSex )
{
if ( pProfile->bSexist == SOMEWHAT_SEXIST )
bOpinion += gGameExternalOptions.sMoraleModSexism;
else if ( pProfile->bSexist == VERY_SEXIST )
bOpinion += gGameExternalOptions.sMoraleModSexism * 2;
}
}
break;
case APPEARANCE_BABE:
{
if ( pProfile->bAppearanceCareLevel == CARELEVEL_SOME )
bOpinion += gGameExternalOptions.sMoraleModAppearance * 2;
else if ( pProfile->bAppearanceCareLevel == CARELEVEL_EXTREME )
bOpinion += gGameExternalOptions.sMoraleModAppearance * 4;
// some people are sexists
if ( pProfile->bSexist && gMercProfiles[ pOtherSoldier->ubProfile ].bSex != pProfile->bSex )
{
if ( pProfile->bSexist == SOMEWHAT_SEXIST )
bOpinion += gGameExternalOptions.sMoraleModSexism * 2;
else if ( pProfile->bSexist == VERY_SEXIST )
bOpinion += gGameExternalOptions.sMoraleModSexism * 4;
}
}
break;
}
// some people care about how distuingished other people are. Malus if on different ends of the spectrum, a small bonus if on the same and its really important to the person
switch ( gMercProfiles[ pOtherSoldier->ubProfile ].bRefinement )
{
case REFINEMENT_SLOB:
{
if ( pProfile->bRefinement == REFINEMENT_SLOB )
{
if ( pProfile->bRefinementCareLevel == CARELEVEL_EXTREME )
bOpinion += gGameExternalOptions.sMoraleModRefinement;
}
else if ( pProfile->bRefinement == REFINEMENT_SNOB )
{
if ( pProfile->bRefinementCareLevel == CARELEVEL_SOME )
bOpinion -= gGameExternalOptions.sMoraleModRefinement;
else if ( pProfile->bRefinementCareLevel == CARELEVEL_EXTREME )
bOpinion -= gGameExternalOptions.sMoraleModRefinement * 2;
}
}
break;
case REFINEMENT_SNOB:
{
if ( pProfile->bRefinement == REFINEMENT_SNOB )
{
if ( pProfile->bRefinementCareLevel == CARELEVEL_EXTREME )
bOpinion += gGameExternalOptions.sMoraleModRefinement;
}
else if ( pProfile->bRefinement == REFINEMENT_SLOB )
{
if ( pProfile->bRefinementCareLevel == CARELEVEL_SOME )
bOpinion -= gGameExternalOptions.sMoraleModRefinement;
else if ( pProfile->bRefinementCareLevel == CARELEVEL_EXTREME )
bOpinion -= gGameExternalOptions.sMoraleModRefinement * 2;
}
}
break;
}
// some people hate other nationalities (do not mix up with racism, which uses bRace)
if ( pProfile->bHatedNationality > -1 && gMercProfiles[ pOtherSoldier->ubProfile ].bNationality == pProfile->bHatedNationality )
{
if ( pProfile->bHatedNationalityCareLevel == CARELEVEL_SOME )
bOpinion -= gGameExternalOptions.sMoraleModHatedNationality;
else if ( pProfile->bHatedNationalityCareLevel == CARELEVEL_EXTREME )
bOpinion -= gGameExternalOptions.sMoraleModHatedNationality * 2;
}
// some people are racists
if ( pProfile->bRacist && gMercProfiles[ pOtherSoldier->ubProfile ].bRace != pProfile->bRace )
{
if ( pProfile->bRacist == RACIST_SOME )
bOpinion -= gGameExternalOptions.sMoraleModRacism;
else if ( pProfile->bRacist == RACIST_VERY )
bOpinion -= gGameExternalOptions.sMoraleModRacism * 2;
}
// Flugente: backgrounds
if ( pSoldier->HasBackgroundFlag( BACKGROUND_XENOPHOBIC ) && pOtherSoldier->ubProfile != NO_PROFILE && gMercProfiles[pSoldier->ubProfile].usBackground != gMercProfiles[pOtherSoldier->ubProfile].usBackground )
bOpinion -= 2;
bOpinion -= gGameExternalOptions.sMoraleModXenophobicBackGround;
if (bOpinion == HATED_OPINION)
{
bHated = WhichHated( pSoldier->ubProfile, pOtherSoldier->ubProfile );
if ( bHated >= 2 )
{
+11
View File
@@ -379,6 +379,17 @@ typedef struct
UINT8 bLearnToHate;
INT8 bLearnToHateTime;
INT8 bRace;
INT8 bNationality;
INT8 bAppearance;
INT8 bAppearanceCareLevel;
INT8 bRefinement;
INT8 bRefinementCareLevel;
INT8 bHatedNationality;
INT8 bHatedNationalityCareLevel;
INT8 bRacist;
UINT8 bSexist;
INT16 sSalary;
UINT32 uiWeeklySalary;
UINT32 uiBiWeeklySalary;
+119 -4
View File
@@ -158,6 +158,16 @@ profileStartElementHandle(void *userData, const XML_Char *name, const XML_Char *
strcmp(name, "bHatedTime5") == 0 ||
strcmp(name, "bLearnToHate") == 0 ||
strcmp(name, "bLearnToHateTime") == 0 ||
strcmp(name, "bRace") == 0 ||
strcmp(name, "bNationality") == 0 ||
strcmp(name, "bAppearance") == 0 ||
strcmp(name, "bAppearanceCareLevel") == 0 ||
strcmp(name, "bRefinement") == 0 ||
strcmp(name, "bRefinementCareLevel") == 0 ||
strcmp(name, "bHatedNationality") == 0 ||
strcmp(name, "bHatedNationalityCareLevel") == 0 ||
strcmp(name, "bRacist") == 0 ||
strcmp(name, "bSexist") == 0 ||
strcmp(name, "sSalary") == 0 ||
strcmp(name, "uiWeeklySalary") == 0 ||
strcmp(name, "uiBiWeeklySalary") == 0 ||
@@ -318,6 +328,17 @@ profileEndElementHandle(void *userData, const XML_Char *name)
tempProfiles[pData->curIndex].bLearnToHate = pData->curProfile.bLearnToHate;
tempProfiles[pData->curIndex].bLearnToHateTime = pData->curProfile.bLearnToHateTime;
tempProfiles[pData->curIndex].bRace = pData->curProfile.bRace;
tempProfiles[pData->curIndex].bNationality = pData->curProfile.bNationality;
tempProfiles[pData->curIndex].bAppearance = pData->curProfile.bAppearance;
tempProfiles[pData->curIndex].bAppearanceCareLevel = pData->curProfile.bAppearanceCareLevel;
tempProfiles[pData->curIndex].bRefinement = pData->curProfile.bRefinement;
tempProfiles[pData->curIndex].bRefinementCareLevel = pData->curProfile.bRefinementCareLevel;
tempProfiles[pData->curIndex].bHatedNationality = pData->curProfile.bHatedNationality;
tempProfiles[pData->curIndex].bHatedNationalityCareLevel = pData->curProfile.bHatedNationalityCareLevel;
tempProfiles[pData->curIndex].bRacist = pData->curProfile.bRacist;
tempProfiles[pData->curIndex].bSexist = pData->curProfile.bSexist;
tempProfiles[pData->curIndex].sSalary = pData->curProfile.sSalary;
tempProfiles[pData->curIndex].uiWeeklySalary = pData->curProfile.uiWeeklySalary;
tempProfiles[pData->curIndex].uiBiWeeklySalary = pData->curProfile.uiBiWeeklySalary;
@@ -854,6 +875,87 @@ profileEndElementHandle(void *userData, const XML_Char *name)
pData->curElement = ELEMENT;
pData->curProfile.bLearnToHateTime = (UINT32) strtoul(pData->szCharData, NULL, 0);
}
else if(strcmp(name, "bRace") == 0)
{
pData->curElement = ELEMENT;
pData->curProfile.bRace = (INT8) strtoul(pData->szCharData, NULL, 0);
// no nonsense values
pData->curProfile.bRace = max(0, min(NUM_RACES-1, pData->curProfile.bRace));
}
else if(strcmp(name, "bNationality") == 0)
{
pData->curElement = ELEMENT;
pData->curProfile.bNationality = (INT8) strtoul(pData->szCharData, NULL, 0);
// no nonsense values
pData->curProfile.bNationality = max(0, min(NUM_NATIONALITIES-1, pData->curProfile.bNationality));
}
else if(strcmp(name, "bAppearance") == 0)
{
pData->curElement = ELEMENT;
pData->curProfile.bAppearance = (INT8) strtoul(pData->szCharData, NULL, 0);
// no nonsense values
pData->curProfile.bAppearance = max(0, min(NUM_APPEARANCES-1, pData->curProfile.bAppearance));
}
else if(strcmp(name, "bAppearanceCareLevel") == 0)
{
pData->curElement = ELEMENT;
pData->curProfile.bAppearanceCareLevel = (INT8) strtoul(pData->szCharData, NULL, 0);
// no nonsense values
pData->curProfile.bAppearanceCareLevel = max(0, min(NUM_CARELEVELS-1, pData->curProfile.bAppearanceCareLevel));
}
else if(strcmp(name, "bRefinement") == 0)
{
pData->curElement = ELEMENT;
pData->curProfile.bRefinement = (INT8) strtoul(pData->szCharData, NULL, 0);
// no nonsense values
pData->curProfile.bRefinement = max(0, min(NUM_REFINEMENT-1, pData->curProfile.bRefinement));
}
else if(strcmp(name, "bRefinementCareLevel") == 0)
{
pData->curElement = ELEMENT;
pData->curProfile.bRefinementCareLevel = (INT8) strtoul(pData->szCharData, NULL, 0);
// no nonsense values
pData->curProfile.bRefinementCareLevel = max(0, min(NUM_CARELEVELS-1, pData->curProfile.bRefinementCareLevel));
}
else if(strcmp(name, "bHatedNationality") == 0)
{
pData->curElement = ELEMENT;
pData->curProfile.bHatedNationality = (INT8) strtoul(pData->szCharData, NULL, 0);
// no nonsense values
pData->curProfile.bHatedNationality = max(-1, min(NUM_NATIONALITIES-1, pData->curProfile.bHatedNationality));
}
else if(strcmp(name, "bHatedNationalityCareLevel") == 0)
{
pData->curElement = ELEMENT;
pData->curProfile.bHatedNationalityCareLevel = (INT8) strtoul(pData->szCharData, NULL, 0);
// no nonsense values
pData->curProfile.bHatedNationalityCareLevel = max(0, min(NUM_CARELEVELS-1, pData->curProfile.bHatedNationalityCareLevel));
}
else if(strcmp(name, "bRacist") == 0)
{
pData->curElement = ELEMENT;
pData->curProfile.bRacist = (INT8) strtoul(pData->szCharData, NULL, 0);
// no nonsense values
pData->curProfile.bRacist = max(0, min(NUM_RACIST-1, pData->curProfile.bRacist));
}
else if(strcmp(name, "bSexist") == 0)
{
pData->curElement = ELEMENT;
pData->curProfile.bSexist = (UINT8) strtoul(pData->szCharData, NULL, 0);
// no nonsense values
pData->curProfile.bSexist = max(0, min(NUM_SEXIST-1, pData->curProfile.bSexist));
}
else if(strcmp(name, "sSalary") == 0)
{
@@ -962,7 +1064,7 @@ profileEndElementHandle(void *userData, const XML_Char *name)
{
pData->curElement = ELEMENT;
pData->curProfile.bSectorZ = (INT8) atol(pData->szCharData);
}
}
else if(strcmp(name, "ubCivilianGroup") == 0)
{
pData->curElement = ELEMENT;
@@ -972,8 +1074,10 @@ profileEndElementHandle(void *userData, const XML_Char *name)
{
pData->curElement = ELEMENT;
pData->curProfile.bTown = (INT8) atol(pData->szCharData);
}
else if(strcmp(name, "bTownAttachment") == 0)
}
// Flugente: need to break the 'else if' structure here. Otherwise the compiler will complain about fatal error C1061: compiler limit : blocks nested too deeply
if(strcmp(name, "bTownAttachment") == 0)
{
pData->curElement = ELEMENT;
pData->curProfile.bTownAttachment = (INT8) atol(pData->szCharData);
@@ -982,7 +1086,7 @@ profileEndElementHandle(void *userData, const XML_Char *name)
{
pData->curElement = ELEMENT;
pData->curProfile.usBackground = (UINT8) atol(pData->szCharData);
}
}
pData->maxReadDepth--;
@@ -1523,6 +1627,17 @@ BOOLEAN WriteMercProfiles()
FilePrintf(hFile,"\t\t<bLearnToHate>%d</bLearnToHate>\r\n", gMercProfiles[ cnt ].bLearnToHate);
FilePrintf(hFile,"\t\t<bLearnToHateTime>%d</bLearnToHateTime>\r\n", gMercProfiles[ cnt ].bLearnToHateTime);
FilePrintf(hFile,"\t\t<bRace>%d</bRace>\r\n", gMercProfiles[ cnt ].bRace);
FilePrintf(hFile,"\t\t<bNationality>%d</bNationality>\r\n", gMercProfiles[ cnt ].bNationality);
FilePrintf(hFile,"\t\t<bAppearance>%d</bAppearance>\r\n", gMercProfiles[ cnt ].bAppearance);
FilePrintf(hFile,"\t\t<bAppearanceCareLevel>%d</bAppearanceCareLevel>\r\n", gMercProfiles[ cnt ].bAppearanceCareLevel);
FilePrintf(hFile,"\t\t<bRefinement>%d</bRefinement>\r\n", gMercProfiles[ cnt ].bRefinement);
FilePrintf(hFile,"\t\t<bRefinementCareLevel>%d</bRefinementCareLevel>\r\n", gMercProfiles[ cnt ].bRefinementCareLevel);
FilePrintf(hFile,"\t\t<bHatedNationality>%d</bHatedNationality>\r\n", gMercProfiles[ cnt ].bHatedNationality);
FilePrintf(hFile,"\t\t<bHatedNationalityCareLevel>%d</bHatedNationalityCareLevel>\r\n", gMercProfiles[ cnt ].bHatedNationalityCareLevel);
FilePrintf(hFile,"\t\t<bRacist>%d</bRacist>\r\n", gMercProfiles[ cnt ].bRacist);
FilePrintf(hFile,"\t\t<bSexist>%d</bSexist>\r\n", gMercProfiles[ cnt ].bSexist);
FilePrintf(hFile,"\t\t<sSalary>%d</sSalary>\r\n", gMercProfiles[ cnt ].sSalary);
FilePrintf(hFile,"\t\t<uiWeeklySalary>%d</uiWeeklySalary>\r\n", gMercProfiles[ cnt ].uiWeeklySalary);
FilePrintf(hFile,"\t\t<uiBiWeeklySalary>%d</uiBiWeeklySalary>\r\n", gMercProfiles[ cnt ].uiBiWeeklySalary);
+98 -2
View File
@@ -197,13 +197,108 @@ typedef enum
// SANDRO - appearances
typedef enum
{
APPEARANCE_AVARAGE = 0,
APPEARANCE_AVERAGE = 0,
APPEARANCE_UGLY,
APPEARANCE_HOMELY,
APPEARANCE_ATTRACTIVE,
APPEARANCE_BABE,
NUM_APPEARANCES
} Appearances;
// Flugente - care levels
typedef enum
{
CARELEVEL_NONE = 0,
CARELEVEL_SOME = 1,
CARELEVEL_EXTREME = 2,
NUM_CARELEVELS
} CareLevels;
// Flugente - refinements
typedef enum
{
REFINEMENT_AVERAGE = 0,
REFINEMENT_SLOB = 1,
REFINEMENT_SNOB = 2,
NUM_REFINEMENT
} Refinements;
// Flugente - nationalities
typedef enum
{
// old Sirtech values
AMERICAN = 0, // take that, Murica! Sirtech knew you have no value :-)
ARAB = 1,
AUSTRALIAN = 2,
BRITISH = 3,
CANADIAN = 4,
CUBAN = 5,
DANISH = 6,
FRENCH = 7,
RUSSIAN = 8,
NIGERIAN = 9, // this was simply not defined in original data (I did not find any country), but we can't have any holes in here, so just invented soemthing
SWISS = 10,
JAMAICAN = 11,
POLISH = 12,
CHINESE = 13,
IRISH = 14,
SOUTH_AFRICAN = 15,
HUNGARIAN = 16,
SCOTTISH = 17,
ARULCAN = 18,
GERMAN = 19,
AFRICAN = 20,
ITALIAN = 21,
DUTCH = 22,
ROMANIAN = 23,
METAVIRAN = 24,
// new values, because why not
GREEK, // 25
ESTONIAN,
VENEZUELAN ,
JAPANESE,
TURKISH,
INDIAN, // 30
MEXICAN,
NORWEGIAN,
SPANISH,
BRASILIAN,
FINNISH, // 35
IRANIAN,
ISRAELI,
BULGARIAN,
SWEDISH,
IRAQI, // 40
SYRIAN,
NUM_NATIONALITIES
} Nationalities;
// Flugente - races
typedef enum
{
WHITE = 0,
BLACK = 1,
ASIAN = 2,
ESKIMO = 3,
HISPANIC = 4,
NUM_RACES
} Races;
// Flugente - racist levels
typedef enum
{
RACIST_NONE = 0,
RACIST_SOME = 1,
RACIST_VERY = 2,
NUM_RACIST
} RacistLevels;
//////////////////////////////////////////////////////////////////////
typedef enum
@@ -250,7 +345,8 @@ typedef enum
NOT_SEXIST = 0,
SOMEWHAT_SEXIST,
VERY_SEXIST,
GENTLEMAN
GENTLEMAN,
NUM_SEXIST
} SexistLevels;
+27
View File
@@ -2388,6 +2388,33 @@ extern STR16 gszPocketPopupText[];
extern STR16 szBackgroundText_Flags[];
extern STR16 szBackgroundText_Value[];
// Flugente: personality
enum
{
PERSONALITYTEXT_YOULOOK,
PERSONALITYTEXT_ANDAPPEARANCEIS,
PERSONALITYTEXT_IMPORTANTTOYOU,
PERSONALITYTEXT_YOUHAVE,
PERSONALITYTEXT_ANDCARE,
PERSONALITYTEXT_ABOUTTHAT,
PERSONALITYTEXT_YOUARE,
PERSONALITYTEXT_ADHATEEVERYONE,
PERSONALITYTEXT_DOT,
PERSONALITYTEXT_RACISTAGAINSTNON,
PERSONALITYTEXT_PEOPLE,
PERSONALITYTEXT_MAX,
};
extern STR16 szPersonalityDisplayText[];
extern STR16 szRaceText[];
extern STR16 szAppearanceText[];
extern STR16 szRefinementText[];
extern STR16 szNationalityText[];
extern STR16 szNationalityText_Special[];
extern STR16 szCareLevelText[];
extern STR16 szRacistText[];
extern STR16 szSexistText[];
// Enumeration support
typedef struct Str8EnumLookupType {
int value;
+119
View File
@@ -7700,6 +7700,125 @@ STR16 szBackgroundText_Value[]=
L" %s%d%%医疗保证金\n", //L" %s%d%% insurance cost\n",
};
// Flugente: personality
STR16 szPersonalityDisplayText[]= // TODO.Translate
{
L"You look",
L"and appearance is",
L"important to you.",
L"You have",
L"and care",
L"about that.",
L"You are",
L"and hate everyone",
L".",
L"racist against non-",
L"people.",
};
STR16 szRaceText[]=
{
L"white",
L"black",
L"asian",
L"eskimo",
L"hispanic",
};
STR16 szAppearanceText[]=
{
L"average",
L"ugly",
L"homely",
L"attractive",
L"like a babe",
};
STR16 szRefinementText[]=
{
L"average manners",
L"manners of a slob",
L"manners of a snob",
};
STR16 szNationalityText[]=
{
L"american", // 0
L"arab",
L"australian",
L"british",
L"canadian",
L"cuban", // 5
L"danish",
L"french",
L"russian",
L"nigerian",
L"swiss", // 10
L"jamaican",
L"polish",
L"chinese",
L"irish",
L"south african", // 15
L"hungarian",
L"scottish",
L"arulcan",
L"german",
L"african", // 20
L"italian",
L"dutch",
L"romanian",
L"metaviran",
// newly added from here on
L"greek", // 25
L"estonian",
L"venezuelan",
L"japanese",
L"turkish",
L"indian", // 30
L"mexican",
L"norwegian",
L"spanish",
L"brasilian",
L"finnish", // 35
L"iranian",
L"israeli",
L"bulgarian",
L"swedish",
L"iraqi", // 40
L"syrian",
};
// special text used if we do not hate any nation (value of -1)
STR16 szNationalityText_Special[]=
{
L"do not hate any other nationality.", // used in personnel.cpp
L"of no origin", // used in IMP generation
};
STR16 szCareLevelText[]=
{
L"not",
L"somewhat",
L"extremely",
};
STR16 szRacistText[]=
{
L"not",
L"somewhat",
L"very",
};
STR16 szSexistText[]=
{
L"no sexist",
L"somewhat sexist",
L"very sexist",
L"a Gentleman",
};
// WANNE: Some Chinese specific strings that needs to be in unicode!
STR16 ChineseSpecString1 = L"%"; //defined in _ChineseText.cpp as this file is already unicode
STR16 ChineseSpecString2 = L"*%3d%%%"; //defined in _ChineseText.cpp as this file is already unicode
+119
View File
@@ -7717,4 +7717,123 @@ STR16 szBackgroundText_Value[]=
L" %s%d%% insurance cost\n",
};
// Flugente: personality
STR16 szPersonalityDisplayText[]= // TODO.Translate
{
L"You look",
L"and appearance is",
L"important to you.",
L"You have",
L"and care",
L"about that.",
L"You are",
L"and hate everyone",
L".",
L"racist against non-",
L"people.",
};
STR16 szRaceText[]=
{
L"white",
L"black",
L"asian",
L"eskimo",
L"hispanic",
};
STR16 szAppearanceText[]=
{
L"average",
L"ugly",
L"homely",
L"attractive",
L"like a babe",
};
STR16 szRefinementText[]=
{
L"average manners",
L"manners of a slob",
L"manners of a snob",
};
STR16 szNationalityText[]=
{
L"american", // 0
L"arab",
L"australian",
L"british",
L"canadian",
L"cuban", // 5
L"danish",
L"french",
L"russian",
L"nigerian",
L"swiss", // 10
L"jamaican",
L"polish",
L"chinese",
L"irish",
L"south african", // 15
L"hungarian",
L"scottish",
L"arulcan",
L"german",
L"african", // 20
L"italian",
L"dutch",
L"romanian",
L"metaviran",
// newly added from here on
L"greek", // 25
L"estonian",
L"venezuelan",
L"japanese",
L"turkish",
L"indian", // 30
L"mexican",
L"norwegian",
L"spanish",
L"brasilian",
L"finnish", // 35
L"iranian",
L"israeli",
L"bulgarian",
L"swedish",
L"iraqi", // 40
L"syrian",
};
// special text used if we do not hate any nation (value of -1)
STR16 szNationalityText_Special[]=
{
L"do not hate any other nationality.", // used in personnel.cpp
L"of no origin", // used in IMP generation
};
STR16 szCareLevelText[]=
{
L"not",
L"somewhat",
L"extremely",
};
STR16 szRacistText[]=
{
L"not",
L"somewhat",
L"very",
};
STR16 szSexistText[]=
{
L"no sexist",
L"somewhat sexist",
L"very sexist",
L"a Gentleman",
};
#endif //DUTCH
+119
View File
@@ -7700,4 +7700,123 @@ STR16 szBackgroundText_Value[]=
L" %s%d%% insurance cost\n",
};
// Flugente: personality
STR16 szPersonalityDisplayText[]=
{
L"You look",
L"and appearance is",
L"important to you.",
L"You have",
L"and care",
L"about that.",
L"You are",
L"and hate everyone",
L".",
L"racist against non-",
L"people.",
};
STR16 szRaceText[]=
{
L"white",
L"black",
L"asian",
L"eskimo",
L"hispanic",
};
STR16 szAppearanceText[]=
{
L"average",
L"ugly",
L"homely",
L"attractive",
L"like a babe",
};
STR16 szRefinementText[]=
{
L"average manners",
L"manners of a slob",
L"manners of a snob",
};
STR16 szNationalityText[]=
{
L"american", // 0
L"arab",
L"australian",
L"british",
L"canadian",
L"cuban", // 5
L"danish",
L"french",
L"russian",
L"nigerian",
L"swiss", // 10
L"jamaican",
L"polish",
L"chinese",
L"irish",
L"south african", // 15
L"hungarian",
L"scottish",
L"arulcan",
L"german",
L"african", // 20
L"italian",
L"dutch",
L"romanian",
L"metaviran",
// newly added from here on
L"greek", // 25
L"estonian",
L"venezuelan",
L"japanese",
L"turkish",
L"indian", // 30
L"mexican",
L"norwegian",
L"spanish",
L"brasilian",
L"finnish", // 35
L"iranian",
L"israeli",
L"bulgarian",
L"swedish",
L"iraqi", // 40
L"syrian",
};
// special text used if we do not hate any nation (value of -1)
STR16 szNationalityText_Special[]=
{
L"do not hate any other nationality.", // used in personnel.cpp
L"of no origin", // used in IMP generation
};
STR16 szCareLevelText[]=
{
L"not",
L"somewhat",
L"extremely",
};
STR16 szRacistText[]=
{
L"not",
L"somewhat",
L"very",
};
STR16 szSexistText[]=
{
L"no sexist",
L"somewhat sexist",
L"very sexist",
L"a Gentleman",
};
#endif //ENGLISH
+119
View File
@@ -7702,4 +7702,123 @@ STR16 szBackgroundText_Value[]=
L" %s%d%% insurance cost\n",
};
// Flugente: personality
STR16 szPersonalityDisplayText[]= // TODO.Translate
{
L"You look",
L"and appearance is",
L"important to you.",
L"You have",
L"and care",
L"about that.",
L"You are",
L"and hate everyone",
L".",
L"racist against non-",
L"people.",
};
STR16 szRaceText[]=
{
L"white",
L"black",
L"asian",
L"eskimo",
L"hispanic",
};
STR16 szAppearanceText[]=
{
L"average",
L"ugly",
L"homely",
L"attractive",
L"like a babe",
};
STR16 szRefinementText[]=
{
L"average manners",
L"manners of a slob",
L"manners of a snob",
};
STR16 szNationalityText[]=
{
L"american", // 0
L"arab",
L"australian",
L"british",
L"canadian",
L"cuban", // 5
L"danish",
L"french",
L"russian",
L"nigerian",
L"swiss", // 10
L"jamaican",
L"polish",
L"chinese",
L"irish",
L"south african", // 15
L"hungarian",
L"scottish",
L"arulcan",
L"german",
L"african", // 20
L"italian",
L"dutch",
L"romanian",
L"metaviran",
// newly added from here on
L"greek", // 25
L"estonian",
L"venezuelan",
L"japanese",
L"turkish",
L"indian", // 30
L"mexican",
L"norwegian",
L"spanish",
L"brasilian",
L"finnish", // 35
L"iranian",
L"israeli",
L"bulgarian",
L"swedish",
L"iraqi", // 40
L"syrian",
};
// special text used if we do not hate any nation (value of -1)
STR16 szNationalityText_Special[]=
{
L"do not hate any other nationality.", // used in personnel.cpp
L"of no origin", // used in IMP generation
};
STR16 szCareLevelText[]=
{
L"not",
L"somewhat",
L"extremely",
};
STR16 szRacistText[]=
{
L"not",
L"somewhat",
L"very",
};
STR16 szSexistText[]=
{
L"no sexist",
L"somewhat sexist",
L"very sexist",
L"a Gentleman",
};
#endif //FRENCH
+119
View File
@@ -7526,4 +7526,123 @@ STR16 szBackgroundText_Value[]=
L" %s%d%% insurance cost\n",
};
// Flugente: personality
STR16 szPersonalityDisplayText[]= // TODO.Translate
{
L"You look",
L"and appearance is",
L"important to you.",
L"You have",
L"and care",
L"about that.",
L"You are",
L"and hate everyone",
L".",
L"racist against non-",
L"people.",
};
STR16 szRaceText[]=
{
L"white",
L"black",
L"asian",
L"eskimo",
L"hispanic",
};
STR16 szAppearanceText[]=
{
L"average",
L"ugly",
L"homely",
L"attractive",
L"like a babe",
};
STR16 szRefinementText[]=
{
L"average manners",
L"manners of a slob",
L"manners of a snob",
};
STR16 szNationalityText[]=
{
L"american", // 0
L"arab",
L"australian",
L"british",
L"canadian",
L"cuban", // 5
L"danish",
L"french",
L"russian",
L"nigerian",
L"swiss", // 10
L"jamaican",
L"polish",
L"chinese",
L"irish",
L"south african", // 15
L"hungarian",
L"scottish",
L"arulcan",
L"german",
L"african", // 20
L"italian",
L"dutch",
L"romanian",
L"metaviran",
// newly added from here on
L"greek", // 25
L"estonian",
L"venezuelan",
L"japanese",
L"turkish",
L"indian", // 30
L"mexican",
L"norwegian",
L"spanish",
L"brasilian",
L"finnish", // 35
L"iranian",
L"israeli",
L"bulgarian",
L"swedish",
L"iraqi", // 40
L"syrian",
};
// special text used if we do not hate any nation (value of -1)
STR16 szNationalityText_Special[]=
{
L"do not hate any other nationality.", // used in personnel.cpp
L"of no origin", // used in IMP generation
};
STR16 szCareLevelText[]=
{
L"not",
L"somewhat",
L"extremely",
};
STR16 szRacistText[]=
{
L"not",
L"somewhat",
L"very",
};
STR16 szSexistText[]=
{
L"no sexist",
L"somewhat sexist",
L"very sexist",
L"a Gentleman",
};
#endif //GERMAN
+119
View File
@@ -7704,4 +7704,123 @@ STR16 szBackgroundText_Value[]=
L" %s%d%% insurance cost\n",
};
// Flugente: personality
STR16 szPersonalityDisplayText[]= // TODO.Translate
{
L"You look",
L"and appearance is",
L"important to you.",
L"You have",
L"and care",
L"about that.",
L"You are",
L"and hate everyone",
L".",
L"racist against non-",
L"people.",
};
STR16 szRaceText[]=
{
L"white",
L"black",
L"asian",
L"eskimo",
L"hispanic",
};
STR16 szAppearanceText[]=
{
L"average",
L"ugly",
L"homely",
L"attractive",
L"like a babe",
};
STR16 szRefinementText[]=
{
L"average manners",
L"manners of a slob",
L"manners of a snob",
};
STR16 szNationalityText[]=
{
L"american", // 0
L"arab",
L"australian",
L"british",
L"canadian",
L"cuban", // 5
L"danish",
L"french",
L"russian",
L"nigerian",
L"swiss", // 10
L"jamaican",
L"polish",
L"chinese",
L"irish",
L"south african", // 15
L"hungarian",
L"scottish",
L"arulcan",
L"german",
L"african", // 20
L"italian",
L"dutch",
L"romanian",
L"metaviran",
// newly added from here on
L"greek", // 25
L"estonian",
L"venezuelan",
L"japanese",
L"turkish",
L"indian", // 30
L"mexican",
L"norwegian",
L"spanish",
L"brasilian",
L"finnish", // 35
L"iranian",
L"israeli",
L"bulgarian",
L"swedish",
L"iraqi", // 40
L"syrian",
};
// special text used if we do not hate any nation (value of -1)
STR16 szNationalityText_Special[]=
{
L"do not hate any other nationality.", // used in personnel.cpp
L"of no origin", // used in IMP generation
};
STR16 szCareLevelText[]=
{
L"not",
L"somewhat",
L"extremely",
};
STR16 szRacistText[]=
{
L"not",
L"somewhat",
L"very",
};
STR16 szSexistText[]=
{
L"no sexist",
L"somewhat sexist",
L"very sexist",
L"a Gentleman",
};
#endif //ITALIAN
+119
View File
@@ -7728,4 +7728,123 @@ STR16 szBackgroundText_Value[]=
L" %s%d%% insurance cost\n",
};
// Flugente: personality
STR16 szPersonalityDisplayText[]= // TODO.Translate
{
L"You look",
L"and appearance is",
L"important to you.",
L"You have",
L"and care",
L"about that.",
L"You are",
L"and hate everyone",
L".",
L"racist against non-",
L"people.",
};
STR16 szRaceText[]=
{
L"white",
L"black",
L"asian",
L"eskimo",
L"hispanic",
};
STR16 szAppearanceText[]=
{
L"average",
L"ugly",
L"homely",
L"attractive",
L"like a babe",
};
STR16 szRefinementText[]=
{
L"average manners",
L"manners of a slob",
L"manners of a snob",
};
STR16 szNationalityText[]=
{
L"american", // 0
L"arab",
L"australian",
L"british",
L"canadian",
L"cuban", // 5
L"danish",
L"french",
L"russian",
L"nigerian",
L"swiss", // 10
L"jamaican",
L"polish",
L"chinese",
L"irish",
L"south african", // 15
L"hungarian",
L"scottish",
L"arulcan",
L"german",
L"african", // 20
L"italian",
L"dutch",
L"romanian",
L"metaviran",
// newly added from here on
L"greek", // 25
L"estonian",
L"venezuelan",
L"japanese",
L"turkish",
L"indian", // 30
L"mexican",
L"norwegian",
L"spanish",
L"brasilian",
L"finnish", // 35
L"iranian",
L"israeli",
L"bulgarian",
L"swedish",
L"iraqi", // 40
L"syrian",
};
// special text used if we do not hate any nation (value of -1)
STR16 szNationalityText_Special[]=
{
L"do not hate any other nationality.", // used in personnel.cpp
L"of no origin", // used in IMP generation
};
STR16 szCareLevelText[]=
{
L"not",
L"somewhat",
L"extremely",
};
STR16 szRacistText[]=
{
L"not",
L"somewhat",
L"very",
};
STR16 szSexistText[]=
{
L"no sexist",
L"somewhat sexist",
L"very sexist",
L"a Gentleman",
};
#endif //POLISH
+119
View File
@@ -7702,4 +7702,123 @@ STR16 szBackgroundText_Value[]=
L" %s%d%% insurance cost\n",
};
// Flugente: personality
STR16 szPersonalityDisplayText[]= // TODO.Translate
{
L"You look",
L"and appearance is",
L"important to you.",
L"You have",
L"and care",
L"about that.",
L"You are",
L"and hate everyone",
L".",
L"racist against non-",
L"people.",
};
STR16 szRaceText[]=
{
L"white",
L"black",
L"asian",
L"eskimo",
L"hispanic",
};
STR16 szAppearanceText[]=
{
L"average",
L"ugly",
L"homely",
L"attractive",
L"like a babe",
};
STR16 szRefinementText[]=
{
L"average manners",
L"manners of a slob",
L"manners of a snob",
};
STR16 szNationalityText[]=
{
L"american", // 0
L"arab",
L"australian",
L"british",
L"canadian",
L"cuban", // 5
L"danish",
L"french",
L"russian",
L"nigerian",
L"swiss", // 10
L"jamaican",
L"polish",
L"chinese",
L"irish",
L"south african", // 15
L"hungarian",
L"scottish",
L"arulcan",
L"german",
L"african", // 20
L"italian",
L"dutch",
L"romanian",
L"metaviran",
// newly added from here on
L"greek", // 25
L"estonian",
L"venezuelan",
L"japanese",
L"turkish",
L"indian", // 30
L"mexican",
L"norwegian",
L"spanish",
L"brasilian",
L"finnish", // 35
L"iranian",
L"israeli",
L"bulgarian",
L"swedish",
L"iraqi", // 40
L"syrian",
};
// special text used if we do not hate any nation (value of -1)
STR16 szNationalityText_Special[]=
{
L"do not hate any other nationality.", // used in personnel.cpp
L"of no origin", // used in IMP generation
};
STR16 szCareLevelText[]=
{
L"not",
L"somewhat",
L"extremely",
};
STR16 szRacistText[]=
{
L"not",
L"somewhat",
L"very",
};
STR16 szSexistText[]=
{
L"no sexist",
L"somewhat sexist",
L"very sexist",
L"a Gentleman",
};
#endif //RUSSIAN
+119
View File
@@ -7719,4 +7719,123 @@ STR16 szBackgroundText_Value[]=
L" %s%d%% insurance cost\n",
};
// Flugente: personality
STR16 szPersonalityDisplayText[]= // TODO.Translate
{
L"You look",
L"and appearance is",
L"important to you.",
L"You have",
L"and care",
L"about that.",
L"You are",
L"and hate everyone",
L".",
L"racist against non-",
L"people.",
};
STR16 szRaceText[]=
{
L"white",
L"black",
L"asian",
L"eskimo",
L"hispanic",
};
STR16 szAppearanceText[]=
{
L"average",
L"ugly",
L"homely",
L"attractive",
L"like a babe",
};
STR16 szRefinementText[]=
{
L"average manners",
L"manners of a slob",
L"manners of a snob",
};
STR16 szNationalityText[]=
{
L"american", // 0
L"arab",
L"australian",
L"british",
L"canadian",
L"cuban", // 5
L"danish",
L"french",
L"russian",
L"nigerian",
L"swiss", // 10
L"jamaican",
L"polish",
L"chinese",
L"irish",
L"south african", // 15
L"hungarian",
L"scottish",
L"arulcan",
L"german",
L"african", // 20
L"italian",
L"dutch",
L"romanian",
L"metaviran",
// newly added from here on
L"greek", // 25
L"estonian",
L"venezuelan",
L"japanese",
L"turkish",
L"indian", // 30
L"mexican",
L"norwegian",
L"spanish",
L"brasilian",
L"finnish", // 35
L"iranian",
L"israeli",
L"bulgarian",
L"swedish",
L"iraqi", // 40
L"syrian",
};
// special text used if we do not hate any nation (value of -1)
STR16 szNationalityText_Special[]=
{
L"do not hate any other nationality.", // used in personnel.cpp
L"of no origin", // used in IMP generation
};
STR16 szCareLevelText[]=
{
L"not",
L"somewhat",
L"extremely",
};
STR16 szRacistText[]=
{
L"not",
L"somewhat",
L"very",
};
STR16 szSexistText[]=
{
L"no sexist",
L"somewhat sexist",
L"very sexist",
L"a Gentleman",
};
#endif //TAIWANESE