diff --git a/Console/Console.vcproj b/Console/Console.vcproj
new file mode 100644
index 00000000..3a249f41
--- /dev/null
+++ b/Console/Console.vcproj
@@ -0,0 +1,171 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GameVersion.cpp b/GameVersion.cpp
index 272249dc..d13fb5b6 100644
--- a/GameVersion.cpp
+++ b/GameVersion.cpp
@@ -23,7 +23,7 @@ CHAR16 zVersionLabel[256] = { L"Beta v. 0.98" };
#else
//RELEASE BUILD VERSION
- CHAR16 zVersionLabel[256] = { L"Release v1.13.1047" };
+ CHAR16 zVersionLabel[256] = { L"Release v1.13.1051" };
#endif
diff --git a/JA2.sln b/JA2.sln
index 5783e369..6d17adf9 100644
--- a/JA2.sln
+++ b/JA2.sln
@@ -37,6 +37,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lua", "lua\lua.vcproj", "{0
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ja2", "JA2.vcproj", "{32A550A8-FEBD-4F8D-8D62-6F97C63F83DA}"
ProjectSection(ProjectDependencies) = postProject
+ {286FCC0E-C6E1-4E29-8642-588D7358966F} = {286FCC0E-C6E1-4E29-8642-588D7358966F}
{2124B612-013E-492D-911C-B5737D60EEDF} = {2124B612-013E-492D-911C-B5737D60EEDF}
{095CC13E-F2F8-4070-AC7A-70926A0ADF37} = {095CC13E-F2F8-4070-AC7A-70926A0ADF37}
{33CD085A-A03E-4D2C-970A-D69CD5466806} = {33CD085A-A03E-4D2C-970A-D69CD5466806}
@@ -48,6 +49,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ja2", "JA2.vcproj", "{32A55
{4D4A4AF3-63D1-4C4B-81B5-3EFB3BD574F2} = {4D4A4AF3-63D1-4C4B-81B5-3EFB3BD574F2}
EndProjectSection
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Console", "Console\Console.vcproj", "{286FCC0E-C6E1-4E29-8642-588D7358966F}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Bounds Checker = Bounds Checker
@@ -220,6 +225,22 @@ Global
{32A550A8-FEBD-4F8D-8D62-6F97C63F83DA}.Release Demo.Build.0 = Release Demo|Win32
{32A550A8-FEBD-4F8D-8D62-6F97C63F83DA}.Release with Debug Info.ActiveCfg = Release with Debug Info|Win32
{32A550A8-FEBD-4F8D-8D62-6F97C63F83DA}.Release with Debug Info.Build.0 = Release with Debug Info|Win32
+ {286FCC0E-C6E1-4E29-8642-588D7358966F}.Bounds Checker.ActiveCfg = Release|Win32
+ {286FCC0E-C6E1-4E29-8642-588D7358966F}.Bounds Checker.Build.0 = Release|Win32
+ {286FCC0E-C6E1-4E29-8642-588D7358966F}.Debug.ActiveCfg = Debug|Win32
+ {286FCC0E-C6E1-4E29-8642-588D7358966F}.Debug.Build.0 = Debug|Win32
+ {286FCC0E-C6E1-4E29-8642-588D7358966F}.Debug Demo.ActiveCfg = Debug|Win32
+ {286FCC0E-C6E1-4E29-8642-588D7358966F}.Debug Demo.Build.0 = Debug|Win32
+ {286FCC0E-C6E1-4E29-8642-588D7358966F}.Demo Bounds Checker.ActiveCfg = Debug|Win32
+ {286FCC0E-C6E1-4E29-8642-588D7358966F}.Demo Bounds Checker.Build.0 = Debug|Win32
+ {286FCC0E-C6E1-4E29-8642-588D7358966F}.Demo Release with Debug Info.ActiveCfg = Release|Win32
+ {286FCC0E-C6E1-4E29-8642-588D7358966F}.Demo Release with Debug Info.Build.0 = Release|Win32
+ {286FCC0E-C6E1-4E29-8642-588D7358966F}.Release.ActiveCfg = Release|Win32
+ {286FCC0E-C6E1-4E29-8642-588D7358966F}.Release.Build.0 = Release|Win32
+ {286FCC0E-C6E1-4E29-8642-588D7358966F}.Release Demo.ActiveCfg = Release|Win32
+ {286FCC0E-C6E1-4E29-8642-588D7358966F}.Release Demo.Build.0 = Release|Win32
+ {286FCC0E-C6E1-4E29-8642-588D7358966F}.Release with Debug Info.ActiveCfg = Release|Win32
+ {286FCC0E-C6E1-4E29-8642-588D7358966F}.Release with Debug Info.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
diff --git a/JA2.vcproj b/JA2.vcproj
index c4296b10..b5b4e6e1 100644
--- a/JA2.vcproj
+++ b/JA2.vcproj
@@ -523,7 +523,7 @@
FavorSizeOrSpeed="1"
OptimizeForProcessor="3"
OptimizeForWindowsApplication="TRUE"
- AdditionalIncludeDirectories="".\Standard Gaming Platform";.\TileEngine;.\Tactical;.\Utils;.\TacticalAI;.\Editor;.\Strategic;.\laptop;.\Lua;.\"
+ AdditionalIncludeDirectories=".\Res;".\Standard Gaming Platform";.\TileEngine;.\Tactical;.\Utils;.\TacticalAI;.\Editor;.\Strategic;.\laptop;.\Lua;.\Console;.\"
PreprocessorDefinitions="CALLBACKTIMER;PRECOMPILEDHEADERS;NDEBUG;WIN32;_WINDOWS;JA2;XML_STATIC;CINTERFACE"
StringPooling="TRUE"
RuntimeLibrary="0"
@@ -545,7 +545,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Standard Gaming Platform/Standard Gaming Platform.vcproj b/Standard Gaming Platform/Standard Gaming Platform.vcproj
index f0d67371..ea71f8b5 100644
--- a/Standard Gaming Platform/Standard Gaming Platform.vcproj
+++ b/Standard Gaming Platform/Standard Gaming Platform.vcproj
@@ -177,7 +177,7 @@
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
- AdditionalIncludeDirectories="..\;..\Lua;..\TileEngine;..\Tactical;..\Utils;..\strategic;.\"
+ AdditionalIncludeDirectories=".\;..\;..\Lua;..\TileEngine;..\Tactical;..\Utils;..\Strategic;..\Console;..\Res"
PreprocessorDefinitions="NO_ZLIB;JA2_PRECOMPILED_HEADERS;NO_ZLIB_COMPRESSION;NDEBUG;WIN32;_WINDOWS;JA2;XML_STATIC;CINTERFACE"
StringPooling="TRUE"
RuntimeLibrary="0"
diff --git a/Strategic/Map Screen Interface Map Inventory.cpp b/Strategic/Map Screen Interface Map Inventory.cpp
index 19200fe7..cc98554f 100644
--- a/Strategic/Map Screen Interface Map Inventory.cpp
+++ b/Strategic/Map Screen Interface Map Inventory.cpp
@@ -218,6 +218,9 @@ extern void StackObjs( OBJECTTYPE * pSourceObj, OBJECTTYPE * pTargetObj, UINT8 u
extern void MAPEndItemPointer( );
extern BOOLEAN GetCurrentBattleSectorXYZAndReturnTRUEIfThereIsABattle( INT16 *psSectorX, INT16 *psSectorY, INT16 *psSectorZ );
+void DeleteAllItemsInInventoryPool();
+void DeleteItemsOfType( UINT16 usItemType );
+INT32 SellItemsOfType( UINT16 usItemType );
// load the background panel graphics for inventory
BOOLEAN LoadInventoryPoolGraphic( void )
@@ -1411,6 +1414,7 @@ void BeginInventoryPoolPtr( OBJECTTYPE *pInventorySlot )
BOOLEAN fSELLALL = gGameExternalOptions.fSellAll;
INT16 iPriceModifier = gGameExternalOptions.iPriceModifier;
+
// If not null return
if ( gpItemPointer != NULL )
{
@@ -1438,8 +1442,16 @@ void BeginInventoryPoolPtr( OBJECTTYPE *pInventorySlot )
if ( _KeyDown ( CTRL ))
{
+ INT16 usDesiredItemType = gItemPointer.usItem;
+
gpItemPointer = NULL;
fMapInventoryItem = FALSE;
+
+ if ( _KeyDown ( 89 )) //Lalien: delete all items of this type on Ctrl+Y
+ {
+ DeleteItemsOfType( usDesiredItemType );
+ }
+
if ( fShowMapInventoryPool )
HandleButtonStatesWhileMapInventoryActive();
}
@@ -1447,6 +1459,7 @@ void BeginInventoryPoolPtr( OBJECTTYPE *pInventorySlot )
{
INT32 iPrice = 0;
+ INT16 usDesiredItemType = gItemPointer.usItem;
if( gItemPointer.ubNumberOfObjects > 1)
{
@@ -1478,13 +1491,20 @@ void BeginInventoryPoolPtr( OBJECTTYPE *pInventorySlot )
if( iPriceModifier < 1) iPriceModifier = 1;
iPrice = (INT32) (iPrice / iPriceModifier);
-
- AddTransactionToPlayersBook( SOLD_ITEMS, 0, GetWorldTotalMin(), iPrice );
+
PlayJA2Sample( COMPUTER_BEEP2_IN, RATE_11025, 15, 1, MIDDLEPAN );
gpItemPointer = NULL;
fMapInventoryItem = FALSE;
+
+ if ( _KeyDown ( 89 )) //Lalien: sell all items of this type on Alt+Y
+ {
+ iPrice = iPrice + SellItemsOfType( usDesiredItemType );
+ }
+
+ AddTransactionToPlayersBook( SOLD_ITEMS, 0, GetWorldTotalMin(), iPrice );
+
if ( fShowMapInventoryPool )
- HandleButtonStatesWhileMapInventoryActive();
+ HandleButtonStatesWhileMapInventoryActive();
}
else
@@ -2283,3 +2303,84 @@ BOOLEAN CanPlayerUseSectorInventory( SOLDIERTYPE *pSelectedSoldier )
return( TRUE );
}
+
+void DeleteAllItemsInInventoryPool()
+{
+ INT32 iNumber;
+
+ for( iNumber = 0 ; iNumber < iTotalNumberOfSlots ; ++iNumber)
+ {
+ DeleteObj( &pInventoryPoolList [ iNumber ].o );
+ }
+
+ fMapPanelDirty = TRUE;
+
+ ClearUpTempUnSeenList( );
+ SaveSeenAndUnseenItems();
+ DestroyStash();
+ BuildStashForSelectedSector( sSelMapX, sSelMapY, iCurrentMapSectorZ);
+}
+
+
+void DeleteItemsOfType( UINT16 usItemType )
+{
+ INT32 iNumber;
+
+ for( iNumber = 0 ; iNumber < iTotalNumberOfSlots ; ++iNumber)
+ {
+ if ( pInventoryPoolList [ iNumber ].o.usItem == usItemType )
+ {
+ DeleteObj( &pInventoryPoolList [ iNumber ].o );
+ }
+ }
+
+}
+
+
+INT32 SellItemsOfType( UINT16 usItemType )
+{
+ INT32 iNumber;
+ INT32 iPrice = 0;
+ INT16 iPriceModifier = gGameExternalOptions.iPriceModifier;
+
+ for( iNumber = 0 ; iNumber < iTotalNumberOfSlots ; ++iNumber)
+ {
+ if ( pInventoryPoolList[ iNumber ].o.usItem == usItemType )
+ {
+ if( pInventoryPoolList[ iNumber ].o.ubNumberOfObjects > 1)
+ {
+ if( Item[ pInventoryPoolList[ iNumber ].o.usItem ].usItemClass == IC_AMMO )
+ {
+ for (INT8 bLoop = 0; bLoop < pInventoryPoolList [ iNumber ].o.ubNumberOfObjects; bLoop++)
+ {
+ iPrice += (INT32)( Item[pInventoryPoolList[ iNumber ].o.usItem].usPrice * (float) pInventoryPoolList[ iNumber ].o.ubShotsLeft[bLoop] / Magazine[ Item[pInventoryPoolList[ iNumber ].o.usItem].ubClassIndex ].ubMagSize );
+ }
+ }
+ else
+ {
+ for (INT8 bLoop = 0; bLoop < pInventoryPoolList[ iNumber ].o.ubNumberOfObjects; bLoop++)
+ {
+ iPrice += (INT32)( Item[pInventoryPoolList[ iNumber ].o.usItem].usPrice * (float)pInventoryPoolList[ iNumber ].o.bStatus[bLoop] / 100 );
+ }
+ }
+ }
+ else
+ {
+ iPrice = ( Item[pInventoryPoolList[ iNumber ].o.usItem].usPrice * pInventoryPoolList[ iNumber ].o.bStatus[0] / 100 );
+
+ for (INT8 bLoop = 0; bLoop < MAX_ATTACHMENTS; bLoop++)
+ {
+ iPrice += (INT32) ( Item[pInventoryPoolList[ iNumber ].o.usAttachItem[bLoop]].usPrice * (float)pInventoryPoolList[ iNumber ].o.bAttachStatus[bLoop] / 100);
+ }
+ }
+
+ if( iPriceModifier < 1) iPriceModifier = 1;
+
+ iPrice = (INT32) (iPrice / iPriceModifier);
+
+
+ DeleteObj( &pInventoryPoolList [ iNumber ].o );
+ }
+ }
+ return iPrice;
+}
diff --git a/Utils/Utils.vcproj b/Utils/Utils.vcproj
index e081d37c..e4a6e5ae 100644
--- a/Utils/Utils.vcproj
+++ b/Utils/Utils.vcproj
@@ -183,7 +183,7 @@
FavorSizeOrSpeed="1"
OptimizeForProcessor="3"
OptimizeForWindowsApplication="TRUE"
- AdditionalIncludeDirectories=""..\Standard Gaming Platform";..\TileEngine;..\;..\Tactical;..\tacticalai;..\Editor;..\strategic;..\Laptop;.\"
+ AdditionalIncludeDirectories=""..\Standard Gaming Platform";..\TileEngine;..\;..\Tactical;..\tacticalai;..\Editor;..\strategic;..\Laptop;.\;..\Console"
PreprocessorDefinitions="CALLBACKTIMER;PRECOMPILEDHEADERS;NDEBUG;WIN32;_WINDOWS;JA2;XML_STATIC;CINTERFACE"
StringPooling="TRUE"
RuntimeLibrary="0"
diff --git a/lua/lua.vcproj b/lua/lua.vcproj
index a599ef8e..f8e3a64e 100644
--- a/lua/lua.vcproj
+++ b/lua/lua.vcproj
@@ -67,7 +67,7 @@
FavorSizeOrSpeed="1"
OptimizeForProcessor="3"
OptimizeForWindowsApplication="TRUE"
- AdditionalIncludeDirectories=".\;..\;"..\Standard Gaming Platform";..\TileEngine;..\Tactical;..\Utils;..\tacticalai;..\Editor;..\strategic"
+ AdditionalIncludeDirectories=".\;..\;"..\Standard Gaming Platform";..\TileEngine;..\Tactical;..\Utils;..\TacticalAI;..\Editor;..\Strategic;..\Res"
PreprocessorDefinitions="PRECOMPILEDHEADERS;NDEBUG;WIN32;_WINDOWS;JA2;XML_STATIC;CINTERFACE"
StringPooling="TRUE"
RuntimeLibrary="0"
@@ -114,9 +114,6 @@
Name="Quelldateien"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-
-
@@ -128,9 +125,6 @@
Name="Headerdateien"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-
-
diff --git a/resource.h b/resource.h
new file mode 100644
index 00000000..f0f6ca6f
--- /dev/null
+++ b/resource.h
@@ -0,0 +1,28 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by ja2.rc
+//
+#define IDI_ICON1 113
+#define IDI_ICON2 115
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 114
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1000
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
+
+
+#define ID_ABOUT 116
+#define IDD_ABOUT 117
+#define ID_COPY 118
+#define ID_PASTE 119
+#define ID_EXIT_CONSOLE 120
+#define IDR_POPUP_MENU 130
+
+
+