mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Merged from revision: 7002
Editor Enhancement (by Buggler) - Hold shift to select previous merc instead of next merc when using hotkeys or associated buttons git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7003 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+59
-14
@@ -63,6 +63,7 @@
|
|||||||
#include "Timer Control.h"
|
#include "Timer Control.h"
|
||||||
#include "message.h"
|
#include "message.h"
|
||||||
#include "InterfaceItemImages.h"
|
#include "InterfaceItemImages.h"
|
||||||
|
#include "english.h"
|
||||||
#endif
|
#endif
|
||||||
//forward declarations of common classes to eliminate includes
|
//forward declarations of common classes to eliminate includes
|
||||||
class OBJECTTYPE;
|
class OBJECTTYPE;
|
||||||
@@ -1540,6 +1541,7 @@ void IndicateSelectedMerc( INT16 sID )
|
|||||||
{
|
{
|
||||||
SOLDIERINITNODE *prev;
|
SOLDIERINITNODE *prev;
|
||||||
INT8 bTeam;
|
INT8 bTeam;
|
||||||
|
BOOLEAN fSelectPrevious;
|
||||||
|
|
||||||
//If we are trying to select a merc that is already selected, ignore.
|
//If we are trying to select a merc that is already selected, ignore.
|
||||||
if( sID >= 0 && sID == gsSelectedMercGridNo )
|
if( sID >= 0 && sID == gsSelectedMercGridNo )
|
||||||
@@ -1557,6 +1559,9 @@ void IndicateSelectedMerc( INT16 sID )
|
|||||||
|
|
||||||
bTeam = -1;
|
bTeam = -1;
|
||||||
|
|
||||||
|
// hotkey to select previous instead of next merc
|
||||||
|
fSelectPrevious = gfKeyState[ SHIFT ];
|
||||||
|
|
||||||
//determine selection method
|
//determine selection method
|
||||||
switch( sID )
|
switch( sID )
|
||||||
{
|
{
|
||||||
@@ -1568,13 +1573,27 @@ void IndicateSelectedMerc( INT16 sID )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ //validate this merc in the list.
|
{ //validate this merc in the list.
|
||||||
if( gpSelected->next )
|
if( fSelectPrevious )
|
||||||
{ //select the next merc in the list
|
{
|
||||||
gpSelected = gpSelected->next;
|
if( gpSelected->prev )
|
||||||
|
{ //select the prev merc in the list
|
||||||
|
gpSelected = gpSelected->prev;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{ //we are at the beginning of the list, so select the last merc in the list.
|
||||||
|
gpSelected = gSoldierInitTail;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ //we are at the end of the list, so select the first merc in the list.
|
{
|
||||||
gpSelected = gSoldierInitHead;
|
if( gpSelected->next )
|
||||||
|
{ //select the next merc in the list
|
||||||
|
gpSelected = gpSelected->next;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{ //we are at the end of the list, so select the first merc in the list.
|
||||||
|
gpSelected = gSoldierInitHead;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( !gpSelected ) //list is empty
|
if( !gpSelected ) //list is empty
|
||||||
@@ -1587,14 +1606,20 @@ void IndicateSelectedMerc( INT16 sID )
|
|||||||
{
|
{
|
||||||
if( !gpSelected )
|
if( !gpSelected )
|
||||||
{
|
{
|
||||||
gpSelected = gSoldierInitHead;
|
if( fSelectPrevious )
|
||||||
|
gpSelected = gSoldierInitTail;
|
||||||
|
else
|
||||||
|
gpSelected = gSoldierInitHead;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if( gpSelected->pSoldier && gpSelected->pSoldier->bVisible == 1 )
|
if( gpSelected->pSoldier && gpSelected->pSoldier->bVisible == 1 )
|
||||||
{ //we have found a visible soldier, so select him.
|
{ //we have found a visible soldier, so select him.
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
gpSelected = gpSelected->next;
|
if( fSelectPrevious )
|
||||||
|
gpSelected = gpSelected->prev;
|
||||||
|
else
|
||||||
|
gpSelected = gpSelected->next;
|
||||||
}
|
}
|
||||||
//we have a valid merc now.
|
//we have a valid merc now.
|
||||||
break;
|
break;
|
||||||
@@ -1639,13 +1664,27 @@ void IndicateSelectedMerc( INT16 sID )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ //validate this merc in the list.
|
{ //validate this merc in the list.
|
||||||
if( gpSelected->next )
|
if( fSelectPrevious )
|
||||||
{ //select the next merc in the list
|
{
|
||||||
gpSelected = gpSelected->next;
|
if( gpSelected->prev )
|
||||||
|
{ //select the prev merc in the list
|
||||||
|
gpSelected = gpSelected->prev;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{ //we are at the beginning of the list, so select the last merc in the list.
|
||||||
|
gpSelected = gSoldierInitTail;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ //we are at the end of the list, so select the first merc in the list.
|
{
|
||||||
gpSelected = gSoldierInitHead;
|
if( gpSelected->next )
|
||||||
|
{ //select the next merc in the list
|
||||||
|
gpSelected = gpSelected->next;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{ //we are at the end of the list, so select the first merc in the list.
|
||||||
|
gpSelected = gSoldierInitHead;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( !gpSelected ) //list is empty
|
if( !gpSelected ) //list is empty
|
||||||
@@ -1658,14 +1697,20 @@ void IndicateSelectedMerc( INT16 sID )
|
|||||||
{
|
{
|
||||||
if( !gpSelected )
|
if( !gpSelected )
|
||||||
{
|
{
|
||||||
gpSelected = gSoldierInitHead;
|
if( fSelectPrevious )
|
||||||
|
gpSelected = gSoldierInitTail;
|
||||||
|
else
|
||||||
|
gpSelected = gSoldierInitHead;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if( gpSelected->pSoldier && gpSelected->pSoldier->bVisible == 1 && gpSelected->pSoldier->bTeam == bTeam )
|
if( gpSelected->pSoldier && gpSelected->pSoldier->bVisible == 1 && gpSelected->pSoldier->bTeam == bTeam )
|
||||||
{ //we have found a visible soldier on the desired team, so select him.
|
{ //we have found a visible soldier on the desired team, so select him.
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
gpSelected = gpSelected->next;
|
if( fSelectPrevious )
|
||||||
|
gpSelected = gpSelected->prev;
|
||||||
|
else
|
||||||
|
gpSelected = gpSelected->next;
|
||||||
}
|
}
|
||||||
if( !gpSelected )
|
if( !gpSelected )
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -533,9 +533,9 @@ STR16 iEditorMercsToolbarText[] =
|
|||||||
L"删除", //L"DELETE",
|
L"删除", //L"DELETE",
|
||||||
L"删除当前选中佣兵(|D|e|l)", //L"Delete currently selected merc (|D|e|l)",
|
L"删除当前选中佣兵(|D|e|l)", //L"Delete currently selected merc (|D|e|l)",
|
||||||
L"下一个", //20 //L"NEXT",
|
L"下一个", //20 //L"NEXT",
|
||||||
L"定位下一个佣兵(|S|p|a|c|e)", //L"Find next merc (|S|p|a|c|e)",
|
L"定位下一个佣兵(|S|p|a|c|e)\n定位上一个佣兵(|S|h|i|f|t+|S|p|a|c|e)", //L"Find next merc (|S|p|a|c|e)\nFind previous merc (|S|h|i|f|t+|S|p|a|c|e)",
|
||||||
L"选择优先级", //L"Toggle priority existance",
|
L"选择优先级", //L"Toggle priority existance",
|
||||||
L"选择此人是否可以开关门", //L"Toggle whether or not placement has/naccess to all doors",
|
L"选择此人是否可以开关门", //L"Toggle whether or not placement\nhas access to all doors",
|
||||||
|
|
||||||
//Orders
|
//Orders
|
||||||
L"站立", //L"STATIONARY",
|
L"站立", //L"STATIONARY",
|
||||||
|
|||||||
@@ -534,9 +534,9 @@ STR16 iEditorMercsToolbarText[] =
|
|||||||
L"DELETE",
|
L"DELETE",
|
||||||
L"Delete currently selected merc (|D|e|l)",
|
L"Delete currently selected merc (|D|e|l)",
|
||||||
L"NEXT", //20
|
L"NEXT", //20
|
||||||
L"Find next merc (|S|p|a|c|e)",
|
L"Find next merc (|S|p|a|c|e)\nFind previous merc (|S|h|i|f|t+|S|p|a|c|e)",
|
||||||
L"Toggle priority existance",
|
L"Toggle priority existance",
|
||||||
L"Toggle whether or not placement has/naccess to all doors",
|
L"Toggle whether or not placement\nhas access to all doors",
|
||||||
|
|
||||||
//Orders
|
//Orders
|
||||||
L"STATIONARY",
|
L"STATIONARY",
|
||||||
|
|||||||
@@ -533,9 +533,9 @@ STR16 iEditorMercsToolbarText[] =
|
|||||||
L"DELETE",
|
L"DELETE",
|
||||||
L"Delete currently selected merc (|D|e|l)",
|
L"Delete currently selected merc (|D|e|l)",
|
||||||
L"NEXT", //20
|
L"NEXT", //20
|
||||||
L"Find next merc (|S|p|a|c|e)",
|
L"Find next merc (|S|p|a|c|e)\nFind previous merc (|S|h|i|f|t+|S|p|a|c|e)",
|
||||||
L"Toggle priority existance",
|
L"Toggle priority existance",
|
||||||
L"Toggle whether or not placement has/naccess to all doors",
|
L"Toggle whether or not placement\nhas access to all doors",
|
||||||
|
|
||||||
//Orders
|
//Orders
|
||||||
L"STATIONARY",
|
L"STATIONARY",
|
||||||
|
|||||||
@@ -537,9 +537,9 @@ STR16 iEditorMercsToolbarText[] =
|
|||||||
L"SUPPRIMER",
|
L"SUPPRIMER",
|
||||||
L"Supprimer le mercenaire sélectionné (|S|u|p|p|r)",
|
L"Supprimer le mercenaire sélectionné (|S|u|p|p|r)",
|
||||||
L"SUIVANT", //20
|
L"SUIVANT", //20
|
||||||
L"Mercenaire suivant (|E|s|p|a|c|e)",
|
L"Mercenaire suivant (|E|s|p|a|c|e)\nMercenaire précédente (|M|a|j|+|E|s|p|a|c|e)",
|
||||||
L"Changer l'existence prioritaire",
|
L"Changer l'existence prioritaire",
|
||||||
L"Changer, si le placement a/naccès à toutes les portes",
|
L"Changer, si le placement a\naccès à toutes les portes",
|
||||||
|
|
||||||
//Orders
|
//Orders
|
||||||
L"STATIONNAIRE",
|
L"STATIONNAIRE",
|
||||||
|
|||||||
@@ -556,9 +556,9 @@ STR16 iEditorMercsToolbarText[] =
|
|||||||
L"DELETE",
|
L"DELETE",
|
||||||
L"Delete currently selected merc (|D|e|l)",
|
L"Delete currently selected merc (|D|e|l)",
|
||||||
L"NEXT", //20
|
L"NEXT", //20
|
||||||
L"Find next merc (|S|p|a|c|e)",
|
L"Find next merc (|S|p|a|c|e)\nFind previous merc (|S|h|i|f|t+|S|p|a|c|e)",
|
||||||
L"Toggle priority existance",
|
L"Toggle priority existance",
|
||||||
L"Toggle whether or not placement has/naccess to all doors",
|
L"Toggle whether or not placement\nhas access to all doors",
|
||||||
|
|
||||||
//Orders
|
//Orders
|
||||||
L"STATIONARY",
|
L"STATIONARY",
|
||||||
|
|||||||
@@ -532,9 +532,9 @@ STR16 iEditorMercsToolbarText[] =
|
|||||||
L"DELETE",
|
L"DELETE",
|
||||||
L"Delete currently selected merc (|D|e|l)",
|
L"Delete currently selected merc (|D|e|l)",
|
||||||
L"NEXT", //20
|
L"NEXT", //20
|
||||||
L"Find next merc (|S|p|a|c|e)",
|
L"Find next merc (|S|p|a|c|e)\nFind previous merc (|S|h|i|f|t+|S|p|a|c|e)",
|
||||||
L"Toggle priority existance",
|
L"Toggle priority existance",
|
||||||
L"Toggle whether or not placement has/naccess to all doors",
|
L"Toggle whether or not placement\nhas access to all doors",
|
||||||
|
|
||||||
//Orders
|
//Orders
|
||||||
L"STATIONARY",
|
L"STATIONARY",
|
||||||
|
|||||||
@@ -539,7 +539,7 @@ STR16 iEditorMercsToolbarText[] =
|
|||||||
L"Usuń",
|
L"Usuń",
|
||||||
L"Usuń zaznaczonego najemnika (|D|e|l)",
|
L"Usuń zaznaczonego najemnika (|D|e|l)",
|
||||||
L"Kolejny", //20
|
L"Kolejny", //20
|
||||||
L"Znajdź następnego najemnika (|S|p|a|c|e)",
|
L"Znajdź następnego najemnika (|S|p|a|c|j|a)\nZnajdź poprzedniego najemnika (|S|h|i|f|t+|S|p|a|c|j|a)",
|
||||||
L"Włącz priorytet egzystencji",
|
L"Włącz priorytet egzystencji",
|
||||||
L"Postać ma dostęp do wszystkich zamkniętych drzwi",
|
L"Postać ma dostęp do wszystkich zamkniętych drzwi",
|
||||||
|
|
||||||
|
|||||||
@@ -534,9 +534,9 @@ STR16 iEditorMercsToolbarText[] =
|
|||||||
L"DELETE",
|
L"DELETE",
|
||||||
L"Delete currently selected merc (|D|e|l)",
|
L"Delete currently selected merc (|D|e|l)",
|
||||||
L"NEXT", //20
|
L"NEXT", //20
|
||||||
L"Find next merc (|S|p|a|c|e)",
|
L"Find next merc (|S|p|a|c|e)\nFind previous merc (|S|h|i|f|t+|S|p|a|c|e)",
|
||||||
L"Toggle priority existance",
|
L"Toggle priority existance",
|
||||||
L"Toggle whether or not placement has/naccess to all doors",
|
L"Toggle whether or not placement\nhas access to all doors",
|
||||||
|
|
||||||
//Orders
|
//Orders
|
||||||
L"STATIONARY",
|
L"STATIONARY",
|
||||||
|
|||||||
@@ -532,9 +532,9 @@ STR16 iEditorMercsToolbarText[] =
|
|||||||
L"DELETE",
|
L"DELETE",
|
||||||
L"Delete currently selected merc (|D|e|l)",
|
L"Delete currently selected merc (|D|e|l)",
|
||||||
L"NEXT", //20
|
L"NEXT", //20
|
||||||
L"Find next merc |S|p|a|c|e)",
|
L"Find next merc (|S|p|a|c|e)\nFind previous merc (|S|h|i|f|t+|S|p|a|c|e)",
|
||||||
L"Toggle priority existance",
|
L"Toggle priority existance",
|
||||||
L"Toggle whether or not placement has/naccess to all doors",
|
L"Toggle whether or not placement\nhas access to all doors",
|
||||||
|
|
||||||
//Orders
|
//Orders
|
||||||
L"STATIONARY",
|
L"STATIONARY",
|
||||||
|
|||||||
Reference in New Issue
Block a user