mirror of
https://github.com/1dot13/source.git
synced 2026-08-26 14:30:26 +02:00
Added Autobandage option to Skill Menu.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9344 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+20
-2
@@ -27,6 +27,7 @@ extern INT8 bSelectedInfoChar;
|
|||||||
|
|
||||||
// sevenfm: need this for correct calculation of traits menu position
|
// sevenfm: need this for correct calculation of traits menu position
|
||||||
extern INT16 gsInterfaceLevel;
|
extern INT16 gsInterfaceLevel;
|
||||||
|
extern void BeginAutoBandage();
|
||||||
|
|
||||||
UINT16 usTraitMenuPosX = 0;
|
UINT16 usTraitMenuPosX = 0;
|
||||||
UINT16 usTraitMenuPosY = 0;
|
UINT16 usTraitMenuPosY = 0;
|
||||||
@@ -70,6 +71,14 @@ SkillSelection gSkillSelection;
|
|||||||
void Wrapper_Function_SkillSelection( UINT32 aVal) { gSkillSelection.Functions(aVal); }
|
void Wrapper_Function_SkillSelection( UINT32 aVal) { gSkillSelection.Functions(aVal); }
|
||||||
void Wrapper_Setup_SkillSelection( UINT32 aVal) { gSkillSelection.Setup(aVal); }
|
void Wrapper_Setup_SkillSelection( UINT32 aVal) { gSkillSelection.Setup(aVal); }
|
||||||
void Wrapper_Cancel_SkillSelection( UINT32 aVal ) { gSkillSelection.Cancel(); }
|
void Wrapper_Cancel_SkillSelection( UINT32 aVal ) { gSkillSelection.Cancel(); }
|
||||||
|
|
||||||
|
void Wrapper_Setup_AutobandageSelection(UINT32 aVal)
|
||||||
|
{
|
||||||
|
gSkillSelection.Cancel();
|
||||||
|
gTraitSelection.Cancel();
|
||||||
|
|
||||||
|
BeginAutoBandage();
|
||||||
|
}
|
||||||
/////////////////////////////// Skill Selection ////////////////////////////////////////////
|
/////////////////////////////// Skill Selection ////////////////////////////////////////////
|
||||||
|
|
||||||
/////////////////////////////// Artillery Sector Selection ////////////////////////////////////////////
|
/////////////////////////////// Artillery Sector Selection ////////////////////////////////////////////
|
||||||
@@ -141,16 +150,25 @@ TraitSelection::Setup( UINT32 aVal )
|
|||||||
CHAR16 pStr[300];
|
CHAR16 pStr[300];
|
||||||
|
|
||||||
// create entries for the sub-menus for each trait
|
// create entries for the sub-menus for each trait
|
||||||
const UINT8 num = 3;
|
const UINT8 num = 4;
|
||||||
UINT8 traitarray[num];
|
UINT8 traitarray[num];
|
||||||
traitarray[0] = RADIO_OPERATOR_NT;
|
traitarray[0] = RADIO_OPERATOR_NT;
|
||||||
traitarray[1] = INTEL;
|
traitarray[1] = INTEL;
|
||||||
traitarray[2] = VARIOUSSKILLS;
|
traitarray[2] = VARIOUSSKILLS;
|
||||||
|
traitarray[3] = AUTOBANDAGESKILLS;
|
||||||
|
|
||||||
for ( int i = 0; i < num; ++i)
|
for ( int i = 0; i < num; ++i)
|
||||||
{
|
{
|
||||||
swprintf( pStr, gzMercSkillTextNew[traitarray[i]] );
|
swprintf( pStr, gzMercSkillTextNew[traitarray[i]] );
|
||||||
|
|
||||||
pOption = new POPUP_OPTION(&std::wstring( pStr ), new popupCallbackFunction<void,UINT32>( &Wrapper_Setup_SkillSelection, traitarray[i] ) );
|
if (traitarray[i] == AUTOBANDAGESKILLS)
|
||||||
|
{
|
||||||
|
pOption = new POPUP_OPTION(&std::wstring(pStr), new popupCallbackFunction<void, UINT32>(&Wrapper_Setup_AutobandageSelection, traitarray[i]));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pOption = new POPUP_OPTION(&std::wstring(pStr), new popupCallbackFunction<void, UINT32>(&Wrapper_Setup_SkillSelection, traitarray[i]));
|
||||||
|
}
|
||||||
|
|
||||||
// if we cannot perform this skill, grey it out
|
// if we cannot perform this skill, grey it out
|
||||||
if ( !HAS_SKILL_TRAIT(pSoldier, traitarray[i]) )
|
if ( !HAS_SKILL_TRAIT(pSoldier, traitarray[i]) )
|
||||||
|
|||||||
@@ -162,6 +162,9 @@ extern BOOLEAN AddSoldierToSectorNoCalculateDirectionUseAnimation( UINT8 ubID, U
|
|||||||
// Flugente: external sector data
|
// Flugente: external sector data
|
||||||
extern SECTOR_EXT_DATA SectorExternalData[256][4];
|
extern SECTOR_EXT_DATA SectorExternalData[256][4];
|
||||||
|
|
||||||
|
// sevenfm: check availability of actions
|
||||||
|
extern BOOLEAN CheckAutoBandage(void);
|
||||||
|
|
||||||
// Enumerate extended directions
|
// Enumerate extended directions
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
@@ -24361,6 +24364,12 @@ BOOLEAN HAS_SKILL_TRAIT( SOLDIERTYPE * pSoldier, UINT8 uiSkillTraitNumber )
|
|||||||
if ( uiSkillTraitNumber == INTEL || uiSkillTraitNumber == VARIOUSSKILLS )
|
if ( uiSkillTraitNumber == INTEL || uiSkillTraitNumber == VARIOUSSKILLS )
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
// sevenfm: add Autobandage option to skills menu
|
||||||
|
if (uiSkillTraitNumber == AUTOBANDAGESKILLS)
|
||||||
|
{
|
||||||
|
return CheckAutoBandage();
|
||||||
|
}
|
||||||
|
|
||||||
INT8 bNumMajorTraitsCounted = 0;
|
INT8 bNumMajorTraitsCounted = 0;
|
||||||
INT8 bMaxTraits = gSkillTraitValues.ubMaxNumberOfTraits;
|
INT8 bMaxTraits = gSkillTraitValues.ubMaxNumberOfTraits;
|
||||||
INT8 bMaxMajorTraits = gSkillTraitValues.ubNumberOfMajorTraitsAllowed;
|
INT8 bMaxMajorTraits = gSkillTraitValues.ubNumberOfMajorTraitsAllowed;
|
||||||
|
|||||||
@@ -313,6 +313,9 @@ void HandleMouseTBMButton( UINT32 *puiNewEvent );
|
|||||||
void HandleMouseTBX1Button( UINT32 *puiNewEvent );
|
void HandleMouseTBX1Button( UINT32 *puiNewEvent );
|
||||||
void HandleMouseTBX2Button( UINT32 *puiNewEvent );
|
void HandleMouseTBX2Button( UINT32 *puiNewEvent );
|
||||||
|
|
||||||
|
// sevenfm: check availability for actions
|
||||||
|
BOOLEAN CheckAutoBandage(void);
|
||||||
|
|
||||||
// sevenfm: common functionality
|
// sevenfm: common functionality
|
||||||
void HandleTBSelectAllMercs( void );
|
void HandleTBSelectAllMercs( void );
|
||||||
void HandleTBToggleStealthAll( void );
|
void HandleTBToggleStealthAll( void );
|
||||||
@@ -3290,7 +3293,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
|
|||||||
#else
|
#else
|
||||||
//shadooow: trying to use autobandage during conversation will mess up game
|
//shadooow: trying to use autobandage during conversation will mess up game
|
||||||
// sevenfm: don't try to activate autobandage in hostile sector
|
// sevenfm: don't try to activate autobandage in hostile sector
|
||||||
if (!(gTacticalStatus.uiFlags & INCOMBAT) && NumEnemyInSector() == 0 && DialogueQueueIsEmpty())
|
if (CheckAutoBandage())
|
||||||
{
|
{
|
||||||
BeginAutoBandage();
|
BeginAutoBandage();
|
||||||
}
|
}
|
||||||
@@ -9621,3 +9624,13 @@ void HandleTBSkillsMenu(void)
|
|||||||
TraitsMenu(MercPtrs[gusSelectedSoldier]->sGridNo);
|
TraitsMenu(MercPtrs[gusSelectedSoldier]->sGridNo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOLEAN CheckAutoBandage(void)
|
||||||
|
{
|
||||||
|
if (!(gTacticalStatus.uiFlags & INCOMBAT) && NumEnemyInSector() == 0 && DialogueQueueIsEmpty())
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|||||||
@@ -182,6 +182,8 @@ typedef enum
|
|||||||
// Flugente: these aren't really traits, but it is convenient to pretend so
|
// Flugente: these aren't really traits, but it is convenient to pretend so
|
||||||
#define INTEL (2 * NEWTRAIT_MERCSKILL_EXPERTOFFSET + 2)
|
#define INTEL (2 * NEWTRAIT_MERCSKILL_EXPERTOFFSET + 2)
|
||||||
#define VARIOUSSKILLS (INTEL + 1)
|
#define VARIOUSSKILLS (INTEL + 1)
|
||||||
|
// sevenfm: add autobandage to skills menu
|
||||||
|
#define AUTOBANDAGESKILLS (VARIOUSSKILLS + 1)
|
||||||
|
|
||||||
// SANDRO - new set of character traits
|
// SANDRO - new set of character traits
|
||||||
typedef enum
|
typedef enum
|
||||||
|
|||||||
@@ -3241,7 +3241,8 @@ STR16 gzMercSkillTextNew[] =
|
|||||||
L"生还者", // for survival (minor trait)
|
L"生还者", // for survival (minor trait)
|
||||||
L"更多...", // 47
|
L"更多...", // 47
|
||||||
L"情报", //L"Intel", for INTEL
|
L"情报", //L"Intel", for INTEL
|
||||||
L"多种技能", // for VARIOUSSKILLS
|
L"多种技能", // for VARIOUSSKILLS
|
||||||
|
L"Bandage Mercs", // for AUTOBANDAGESKILLS //TODO.Translate
|
||||||
};
|
};
|
||||||
//////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|||||||
@@ -3228,6 +3228,7 @@ STR16 gzMercSkillTextNew[] =
|
|||||||
L"More...", // 47
|
L"More...", // 47
|
||||||
L"Intel", // for INTEL // TODO.Translate
|
L"Intel", // for INTEL // TODO.Translate
|
||||||
L"various", // for VARIOUSSKILLS
|
L"various", // for VARIOUSSKILLS
|
||||||
|
L"Bandage Mercs", // for AUTOBANDAGESKILLS //TODO.Translate
|
||||||
};
|
};
|
||||||
//////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|||||||
@@ -3242,6 +3242,7 @@ STR16 gzMercSkillTextNew[] =
|
|||||||
L"More...", // 47
|
L"More...", // 47
|
||||||
L"Intel", // for INTEL
|
L"Intel", // for INTEL
|
||||||
L"various", // for VARIOUSSKILLS
|
L"various", // for VARIOUSSKILLS
|
||||||
|
L"Bandage Mercs", // for AUTOBANDAGESKILLS
|
||||||
};
|
};
|
||||||
//////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|||||||
@@ -3234,9 +3234,10 @@ STR16 gzMercSkillTextNew[] =
|
|||||||
L"Placeholder", // for radio operator (minor trait)
|
L"Placeholder", // for radio operator (minor trait)
|
||||||
L"Placeholder", // for snitch (minor trait)
|
L"Placeholder", // for snitch (minor trait)
|
||||||
L"Placeholder", // for survival (minor trait)
|
L"Placeholder", // for survival (minor trait)
|
||||||
L"Plus...", // 47
|
L"Plus...", // 47
|
||||||
L"Intel", // for INTEL // TODO.Translate
|
L"Intel", // for INTEL // TODO.Translate
|
||||||
L"Divers", // for VARIOUSSKILLS
|
L"Divers", // for VARIOUSSKILLS
|
||||||
|
L"Bandage Mercs", // for AUTOBANDAGESKILLS //TODO.Translate
|
||||||
};
|
};
|
||||||
//////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|||||||
@@ -3271,6 +3271,7 @@ STR16 gzMercSkillTextNew[] =
|
|||||||
L"Mehr...", // 47
|
L"Mehr...", // 47
|
||||||
L"Intel", // for INTEL // TODO.Translate
|
L"Intel", // for INTEL // TODO.Translate
|
||||||
L"diverse", // for VARIOUSSKILLS
|
L"diverse", // for VARIOUSSKILLS
|
||||||
|
L"Bandage Mercs", // for AUTOBANDAGESKILLS //TODO.Translate
|
||||||
};
|
};
|
||||||
|
|
||||||
// This is pop up help text for the options that are available to the merc
|
// This is pop up help text for the options that are available to the merc
|
||||||
|
|||||||
@@ -3224,6 +3224,7 @@ STR16 gzMercSkillTextNew[] =
|
|||||||
L"More...", // 47
|
L"More...", // 47
|
||||||
L"Intel", // for INTEL // TODO.Translate
|
L"Intel", // for INTEL // TODO.Translate
|
||||||
L"various", // for VARIOUSSKILLS
|
L"various", // for VARIOUSSKILLS
|
||||||
|
L"Bandage Mercs", // for AUTOBANDAGESKILLS //TODO.Translate
|
||||||
};
|
};
|
||||||
//////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|||||||
@@ -3234,6 +3234,7 @@ STR16 gzMercSkillTextNew[] =
|
|||||||
L"Więcej...", // 47
|
L"Więcej...", // 47
|
||||||
L"Intel", // for INTEL // TODO.Translate
|
L"Intel", // for INTEL // TODO.Translate
|
||||||
L"różne", // for VARIOUSSKILLS
|
L"różne", // for VARIOUSSKILLS
|
||||||
|
L"Bandage Mercs", // for AUTOBANDAGESKILLS //TODO.Translate
|
||||||
};
|
};
|
||||||
//////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|||||||
@@ -3241,7 +3241,8 @@ STR16 gzMercSkillTextNew[] =
|
|||||||
L"Placeholder", // for survival (minor trait)
|
L"Placeholder", // for survival (minor trait)
|
||||||
L"Ещё...", // 47
|
L"Ещё...", // 47
|
||||||
L"Intel", // for INTEL // TODO.Translate
|
L"Intel", // for INTEL // TODO.Translate
|
||||||
L"различные", // for VARIOUSSKILLS
|
L"Различные", // for VARIOUSSKILLS
|
||||||
|
L"Автоперевязка", // for AUTOBANDAGESKILLS
|
||||||
};
|
};
|
||||||
//////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user