From 2dd71043544c60a193b78ea5f4f3935d0de499bc Mon Sep 17 00:00:00 2001 From: Wanne Date: Wed, 20 Nov 2013 12:48:29 +0000 Subject: [PATCH] Editor Bugfix: Added item stack no info for pre-placed map items (by Buggler) git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6636 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Editor/Editor Taskbar Utils.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Editor/Editor Taskbar Utils.cpp b/Editor/Editor Taskbar Utils.cpp index ad5ce335a..5dd854c29 100644 --- a/Editor/Editor Taskbar Utils.cpp +++ b/Editor/Editor Taskbar Utils.cpp @@ -802,7 +802,7 @@ void RenderSelectedItemBlownUp() INT16 sScreenX, sScreenY, xp, yp; ITEM_POOL *pItemPool; CHAR16 szItemName[ SIZE_ITEM_NAME ]; - INT32 i; + INT32 i, iStackIndex; INT16 sWidth, sHeight, sOffsetX, sOffsetY; GetGridNoScreenPos( gsItemGridNo, 0, &sScreenX, &sScreenY ); @@ -866,20 +866,27 @@ void RenderSelectedItemBlownUp() mprintf( xp, yp, L"%d", Item[ gpItem->usItem ].uiIndex ); } - //Count the number of items in the current pool, and display that. + //Display current item stack index and number of items in stack i = 0; GetItemPoolFromGround( gsItemGridNo, &pItemPool ); Assert( pItemPool ); + //Count the number of items in the current pool while( pItemPool ) { i++; + if ( gpItemPool == pItemPool ) + iStackIndex = i; pItemPool = pItemPool->pNext; } xp = sScreenX; yp = sScreenY + 10; SetFont( FONT10ARIAL ); SetFontForeground( FONT_YELLOW ); - mprintf( xp, yp, L"%d", i ); + //Omit current item stack index if only 1 item in stack + if ( i == 1 ) + mprintf( xp, yp, L"%d", i ); + else + mprintf( xp - 6, yp, L"%d/%d", iStackIndex , i ); //If the item is hidden, render a blinking H (just like DG) if( gWorldItems[ gpItemPool->iItemIndex ].bVisible == HIDDEN_ITEM ||