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:
@@ -63,6 +63,7 @@
|
||||
#include "Timer Control.h"
|
||||
#include "message.h"
|
||||
#include "InterfaceItemImages.h"
|
||||
#include "english.h"
|
||||
#endif
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
@@ -1540,6 +1541,7 @@ void IndicateSelectedMerc( INT16 sID )
|
||||
{
|
||||
SOLDIERINITNODE *prev;
|
||||
INT8 bTeam;
|
||||
BOOLEAN fSelectPrevious;
|
||||
|
||||
//If we are trying to select a merc that is already selected, ignore.
|
||||
if( sID >= 0 && sID == gsSelectedMercGridNo )
|
||||
@@ -1557,6 +1559,9 @@ void IndicateSelectedMerc( INT16 sID )
|
||||
|
||||
bTeam = -1;
|
||||
|
||||
// hotkey to select previous instead of next merc
|
||||
fSelectPrevious = gfKeyState[ SHIFT ];
|
||||
|
||||
//determine selection method
|
||||
switch( sID )
|
||||
{
|
||||
@@ -1568,6 +1573,19 @@ void IndicateSelectedMerc( INT16 sID )
|
||||
}
|
||||
else
|
||||
{ //validate this merc in the list.
|
||||
if( fSelectPrevious )
|
||||
{
|
||||
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
|
||||
{
|
||||
if( gpSelected->next )
|
||||
{ //select the next merc in the list
|
||||
gpSelected = gpSelected->next;
|
||||
@@ -1577,6 +1595,7 @@ void IndicateSelectedMerc( INT16 sID )
|
||||
gpSelected = gSoldierInitHead;
|
||||
}
|
||||
}
|
||||
}
|
||||
if( !gpSelected ) //list is empty
|
||||
{
|
||||
SetMercEditability( TRUE );
|
||||
@@ -1587,6 +1606,9 @@ void IndicateSelectedMerc( INT16 sID )
|
||||
{
|
||||
if( !gpSelected )
|
||||
{
|
||||
if( fSelectPrevious )
|
||||
gpSelected = gSoldierInitTail;
|
||||
else
|
||||
gpSelected = gSoldierInitHead;
|
||||
continue;
|
||||
}
|
||||
@@ -1594,6 +1616,9 @@ void IndicateSelectedMerc( INT16 sID )
|
||||
{ //we have found a visible soldier, so select him.
|
||||
break;
|
||||
}
|
||||
if( fSelectPrevious )
|
||||
gpSelected = gpSelected->prev;
|
||||
else
|
||||
gpSelected = gpSelected->next;
|
||||
}
|
||||
//we have a valid merc now.
|
||||
@@ -1639,6 +1664,19 @@ void IndicateSelectedMerc( INT16 sID )
|
||||
}
|
||||
else
|
||||
{ //validate this merc in the list.
|
||||
if( fSelectPrevious )
|
||||
{
|
||||
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
|
||||
{
|
||||
if( gpSelected->next )
|
||||
{ //select the next merc in the list
|
||||
gpSelected = gpSelected->next;
|
||||
@@ -1648,6 +1686,7 @@ void IndicateSelectedMerc( INT16 sID )
|
||||
gpSelected = gSoldierInitHead;
|
||||
}
|
||||
}
|
||||
}
|
||||
if( !gpSelected ) //list is empty
|
||||
{
|
||||
SetMercEditability( TRUE );
|
||||
@@ -1658,6 +1697,9 @@ void IndicateSelectedMerc( INT16 sID )
|
||||
{
|
||||
if( !gpSelected )
|
||||
{
|
||||
if( fSelectPrevious )
|
||||
gpSelected = gSoldierInitTail;
|
||||
else
|
||||
gpSelected = gSoldierInitHead;
|
||||
continue;
|
||||
}
|
||||
@@ -1665,6 +1707,9 @@ void IndicateSelectedMerc( INT16 sID )
|
||||
{ //we have found a visible soldier on the desired team, so select him.
|
||||
break;
|
||||
}
|
||||
if( fSelectPrevious )
|
||||
gpSelected = gpSelected->prev;
|
||||
else
|
||||
gpSelected = gpSelected->next;
|
||||
}
|
||||
if( !gpSelected )
|
||||
|
||||
@@ -533,9 +533,9 @@ STR16 iEditorMercsToolbarText[] =
|
||||
L"删除", //L"DELETE",
|
||||
L"删除当前选中佣兵(|D|e|l)", //L"Delete currently selected merc (|D|e|l)",
|
||||
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 whether or not placement has/naccess to all doors",
|
||||
L"选择此人是否可以开关门", //L"Toggle whether or not placement\nhas access to all doors",
|
||||
|
||||
//Orders
|
||||
L"站立", //L"STATIONARY",
|
||||
|
||||
@@ -534,9 +534,9 @@ STR16 iEditorMercsToolbarText[] =
|
||||
L"DELETE",
|
||||
L"Delete currently selected merc (|D|e|l)",
|
||||
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 whether or not placement has/naccess to all doors",
|
||||
L"Toggle whether or not placement\nhas access to all doors",
|
||||
|
||||
//Orders
|
||||
L"STATIONARY",
|
||||
|
||||
@@ -533,9 +533,9 @@ STR16 iEditorMercsToolbarText[] =
|
||||
L"DELETE",
|
||||
L"Delete currently selected merc (|D|e|l)",
|
||||
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 whether or not placement has/naccess to all doors",
|
||||
L"Toggle whether or not placement\nhas access to all doors",
|
||||
|
||||
//Orders
|
||||
L"STATIONARY",
|
||||
|
||||
@@ -537,9 +537,9 @@ STR16 iEditorMercsToolbarText[] =
|
||||
L"SUPPRIMER",
|
||||
L"Supprimer le mercenaire sélectionné (|S|u|p|p|r)",
|
||||
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, si le placement a/naccès à toutes les portes",
|
||||
L"Changer, si le placement a\naccès à toutes les portes",
|
||||
|
||||
//Orders
|
||||
L"STATIONNAIRE",
|
||||
|
||||
@@ -556,9 +556,9 @@ STR16 iEditorMercsToolbarText[] =
|
||||
L"DELETE",
|
||||
L"Delete currently selected merc (|D|e|l)",
|
||||
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 whether or not placement has/naccess to all doors",
|
||||
L"Toggle whether or not placement\nhas access to all doors",
|
||||
|
||||
//Orders
|
||||
L"STATIONARY",
|
||||
|
||||
@@ -532,9 +532,9 @@ STR16 iEditorMercsToolbarText[] =
|
||||
L"DELETE",
|
||||
L"Delete currently selected merc (|D|e|l)",
|
||||
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 whether or not placement has/naccess to all doors",
|
||||
L"Toggle whether or not placement\nhas access to all doors",
|
||||
|
||||
//Orders
|
||||
L"STATIONARY",
|
||||
|
||||
@@ -539,7 +539,7 @@ STR16 iEditorMercsToolbarText[] =
|
||||
L"Usuń",
|
||||
L"Usuń zaznaczonego najemnika (|D|e|l)",
|
||||
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"Postać ma dostęp do wszystkich zamkniętych drzwi",
|
||||
|
||||
|
||||
@@ -534,9 +534,9 @@ STR16 iEditorMercsToolbarText[] =
|
||||
L"DELETE",
|
||||
L"Delete currently selected merc (|D|e|l)",
|
||||
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 whether or not placement has/naccess to all doors",
|
||||
L"Toggle whether or not placement\nhas access to all doors",
|
||||
|
||||
//Orders
|
||||
L"STATIONARY",
|
||||
|
||||
@@ -532,9 +532,9 @@ STR16 iEditorMercsToolbarText[] =
|
||||
L"DELETE",
|
||||
L"Delete currently selected merc (|D|e|l)",
|
||||
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 whether or not placement has/naccess to all doors",
|
||||
L"Toggle whether or not placement\nhas access to all doors",
|
||||
|
||||
//Orders
|
||||
L"STATIONARY",
|
||||
|
||||
Reference in New Issue
Block a user